index.vue 233 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923
  1. <template>
  2. <div class="app-container">
  3. <div
  4. v-if="isPercentage"
  5. class="percentage"
  6. style="
  7. width: 210px;
  8. height: 90px;
  9. background: #fff;
  10. position: fixed;
  11. bottom: 0;
  12. left: 0;
  13. z-index: 9999999999999;
  14. "
  15. >
  16. <h4 style="padding-left: 10px; line-height: 0">导出进度:</h4>
  17. <el-progress
  18. style="padding-left: 10px"
  19. :text-inside="true"
  20. :stroke-width="26"
  21. :percentage="percentage"
  22. />
  23. </div>
  24. <div class="filter-container">
  25. <!-- @change="changePastureName" -->
  26. <el-select
  27. v-model="getdataListParm.parammaps.pastureArr"
  28. style="width: 220px"
  29. placeholder="牧场"
  30. multiple
  31. collapse-tags
  32. filterable collapse-tags-tooltip
  33. class="filter-item"
  34. >
  35. <el-option
  36. v-for="item in findAllPasture"
  37. :key="item.id"
  38. :label="item.name"
  39. :value="item.name"
  40. />
  41. </el-select>
  42. <el-input
  43. v-model="getdataListParm.parammaps.orderNumber"
  44. placeholder="申购单号"
  45. style="width: 200px"
  46. class="filter-item"
  47. />
  48. <el-select
  49. v-model="getdataListParm.parammaps.stuteSH"
  50. style="width: 140px"
  51. clearable
  52. placeholder="审核状态"
  53. class="filter-item"
  54. >
  55. <el-option
  56. v-for="item in statues"
  57. :key="item.id"
  58. :label="item.name"
  59. :value="item.id"
  60. />
  61. </el-select>
  62. <el-select
  63. v-model="getdataListParm.parammaps.departmentId"
  64. clearable
  65. style="width: 140px"
  66. placeholder="申购部门"
  67. class="filter-item"
  68. >
  69. <el-option
  70. v-for="item in findAllDepart"
  71. :key="item.id"
  72. :label="item.name"
  73. :value="item.id"
  74. />
  75. </el-select>
  76. <el-select
  77. v-model="getdataListParm.parammaps.purchase_type"
  78. clearable
  79. style="width: 140px"
  80. placeholder="申购类型"
  81. class="filter-item"
  82. >
  83. <el-option
  84. v-for="item in subscriptionStatusList"
  85. :key="item.id"
  86. :label="item.name"
  87. :value="item.id"
  88. />
  89. </el-select>
  90. <el-input
  91. v-model="getdataListParm.parammaps.empName"
  92. placeholder="申购人"
  93. style="width: 200px"
  94. class="filter-item"
  95. />
  96. <!-- <el-select v-model="getdataListParm.parammaps.empName " style="width: 140px;" placeholder="申购人" class="filter-item">
  97. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  98. </el-select> -->
  99. <el-date-picker
  100. ref="inputDatetime"
  101. v-model="getdataListParm.parammaps.inputDatetime"
  102. class="inputDatetime"
  103. type="datetimerange"
  104. style="width: 270px; top: -3px"
  105. format="yyyy-MM-dd"
  106. value-format="yyyy-MM-dd"
  107. range-separator="至"
  108. start-placeholder="开始日期"
  109. end-placeholder="结束日期"
  110. />
  111. <el-button
  112. v-waves
  113. class="filter-item"
  114. type="primary"
  115. icon="el-icon-search"
  116. @click="form_search"
  117. >搜索</el-button>
  118. <div>
  119. <el-button
  120. v-if="isSubscribeAdd"
  121. class="filter-item"
  122. type="primary"
  123. icon="el-icon-edit"
  124. @click="apply_subscribe"
  125. >新增</el-button>
  126. <el-button
  127. v-if="isSubscribeSpecial"
  128. class="filter-item"
  129. type="primary"
  130. icon="el-icon-edit"
  131. @click="handle_specialSubscription"
  132. >特殊申购</el-button>
  133. <el-button
  134. v-if="isSubscribeMilk"
  135. class="filter-item"
  136. type="primary"
  137. icon="el-icon-edit"
  138. @click="handle_milkSubscription"
  139. >奶厅申购</el-button>
  140. <el-button
  141. v-if="isSubscribeExport"
  142. v-waves
  143. class="filter-item"
  144. type="success"
  145. icon="el-icon-upload2"
  146. @click="handleDownload"
  147. >导出</el-button>
  148. <el-radio-group
  149. v-model="radioAll"
  150. style="margin-top: -9px"
  151. @change="changeAll()"
  152. >
  153. <el-radio-button label="全部" />
  154. <el-badge :value="pending.total" class="item">
  155. <el-radio-button label="待处理" />
  156. </el-badge>
  157. <el-radio-button label="已处理" />
  158. </el-radio-group>
  159. </div>
  160. </div>
  161. <div class="filter-button" />
  162. <el-table
  163. :key="tableKey"
  164. v-loading="listLoading"
  165. element-loading-text="给我一点时间"
  166. :data="list"
  167. border
  168. fit
  169. highlight-current-row
  170. style="width: 100%"
  171. :row-style="rowStyle"
  172. :cell-style="cellStyle"
  173. class="elTable"
  174. :max-height="myHeight"
  175. >
  176. <el-table-column label="序号" align="center" type="index" width="50px">
  177. <template slot-scope="scope">
  178. <span>{{ scope.$index + (pageNum - 1) * pageSize + 1 }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="申购单号" min-width="150px" align="center">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.orderNumber }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="牧场" min-width="90px" align="center">
  187. <template slot-scope="scope">
  188. <span>{{ scope.row.pastureName }}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column
  192. label="申购日期"
  193. sortable
  194. prop="inputTime"
  195. min-width="80px"
  196. align="center"
  197. />
  198. <el-table-column label="申购类型" min-width="80px" align="center">
  199. <template slot-scope="scope">
  200. <span v-if="scope.row.purchase_type == 1">暂估申购</span>
  201. <span v-else-if="scope.row.purchase_type == 3">赠品申购</span>
  202. <span v-else-if="scope.row.departmentName == '挤奶处'">奶厅申购</span>
  203. <span v-else>新增申购</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column
  207. label="审核状态"
  208. min-width="80px"
  209. align="center"
  210. :formatter="statue"
  211. />
  212. <el-table-column
  213. label="操作"
  214. align="center"
  215. width="250"
  216. class-name="small-padding fixed-width"
  217. fixed="right"
  218. >
  219. <template slot-scope="{ row }">
  220. <el-button
  221. v-if="isSubscribeSee"
  222. type="primary"
  223. size="mini"
  224. @click="form_see(row)"
  225. >查看</el-button>
  226. <el-button
  227. v-if="
  228. row.statue == 4 ||
  229. row.statue == 6 ||
  230. row.statue == 8 ||
  231. row.statue == 10 ||
  232. row.statue == 12 ||
  233. row.statue == 14
  234. "
  235. style="display: inline-block"
  236. type="success"
  237. size="mini"
  238. @click="form_edit(row)"
  239. >编辑</el-button>
  240. <el-button
  241. v-else
  242. style="display: none"
  243. type="success"
  244. size="mini"
  245. @click="form_edit(row)"
  246. >编辑</el-button>
  247. <!-- 库管 -->
  248. <el-button
  249. v-if="
  250. isSubscribeExamineKG &&
  251. row.statue == 2 &&
  252. (row.departmentName == '挤奶处' && row.isPasturd)
  253. "
  254. style="display: inline-block"
  255. type="success"
  256. size="mini"
  257. @click="handleExamine1(row)"
  258. >审核</el-button>
  259. <el-button
  260. v-if="
  261. isSubscribeExamineKG &&
  262. row.statue == 2 &&
  263. (row.departmentName !== '挤奶处' && row.isPasturd)
  264. "
  265. style="display: inline-block"
  266. type="success"
  267. size="mini"
  268. @click="form_edit1(row)"
  269. >合单</el-button>
  270. <el-button
  271. v-if="
  272. isSubscribeExamineKG &&
  273. row.statue == 2 &&
  274. (row.departmentName !== '挤奶处' && row.isPasturd)
  275. "
  276. style="display: inline-block"
  277. type="success"
  278. size="mini"
  279. @click="form_modify1(row)"
  280. >提交</el-button>
  281. <!-- 设备 -->
  282. <el-button
  283. v-if="isSubscribeExamineSBZG && row.statue == 3 && (!row.isPasturd || row.isRolePasturd )"
  284. style="display: inline-block"
  285. type="success"
  286. size="mini"
  287. @click="handleExamine2(row)"
  288. >审核</el-button>
  289. <!-- 供应商主管 -->
  290. <el-button
  291. v-if="isSubscribeExamineZG && row.statue == 9 && row.isPasturd"
  292. style="display: inline-block"
  293. type="success"
  294. size="mini"
  295. @click="handleExamine3(row)"
  296. >审核</el-button>
  297. <!-- 场长 -->
  298. <el-button
  299. v-if="
  300. sdchangzhangshenhe &&
  301. row.statue == 5 &&
  302. row.departmentName == '挤奶处' &&
  303. row.examine == 1 && (!row.isPasturd || row.isRolePasturd )
  304. "
  305. style="display: inline-block"
  306. type="success"
  307. size="mini"
  308. @click="handleExamine4(row)"
  309. >审核</el-button>
  310. <el-button
  311. v-else-if="
  312. sdchangzhangshenhe &&
  313. row.statue == 5 &&
  314. row.departmentName !== '挤奶处' && (!row.isPasturd || row.isRolePasturd )
  315. "
  316. style="display: inline-block"
  317. type="success"
  318. size="mini"
  319. @click="handleExamine4(row)"
  320. >审核</el-button>
  321. <!-- 采购 -->
  322. <el-button
  323. v-if="isSubscribeExamineCG && (row.statue == 11 || (row.departmentName == '挤奶处' && row.statue == 15)) && row.isPasturd"
  324. style="display: inline-block"
  325. type="success"
  326. size="mini"
  327. @click="handleExamine5(row)"
  328. >审核</el-button>
  329. <!-- 财务 -->
  330. <el-button
  331. v-if="
  332. isSubscribeExamineCW && row.purchase_type == 1 && row.statue == 7 && (!row.isPasturd || row.isRolePasturd )
  333. "
  334. style="display: inline-block"
  335. type="success"
  336. size="mini"
  337. @click="handleExamine6(row)"
  338. >审核</el-button>
  339. <!-- 奶厅 -->
  340. <el-button
  341. v-if="
  342. isSubscribeExamineNT &&
  343. row.departmentName == '挤奶处' &&
  344. ((row.examine !== 1 && row.statue == 5) || row.statue == 11) && (!row.isPasturd || row.isRolePasturd )
  345. "
  346. style="display: inline-block"
  347. type="success"
  348. size="mini"
  349. @click="handleExamine7(row)"
  350. >审核</el-button>
  351. <el-button
  352. v-if="
  353. isSubscribeDelete &&
  354. (row.statue == 4 ||
  355. row.statue == 6 ||
  356. row.statue == 8 ||
  357. row.statue == 10 ||
  358. row.statue == 12 ||
  359. row.statue == 14 ||
  360. row.statue == 16)
  361. "
  362. style="display: inline-block"
  363. type="danger"
  364. size="mini"
  365. @click="form_delete(row)"
  366. >删除</el-button>
  367. <el-button
  368. v-else
  369. style="display: none"
  370. type="danger"
  371. size="mini"
  372. @click="form_delete(row)"
  373. >删除</el-button>
  374. </template>
  375. </el-table-column>
  376. </el-table>
  377. <pagination
  378. v-show="total > 0"
  379. :total="total"
  380. :page.sync="getdataListParm.offset"
  381. :limit.sync="getdataListParm.pagecount"
  382. @pagination="get_table_data"
  383. />
  384. <!-- 弹出层新增or修改 -->
  385. <el-dialog
  386. :title="textMap[dialogStatus]"
  387. :visible.sync="dialogFormVisible"
  388. :close-on-click-modal="false"
  389. width="90%"
  390. >
  391. <div class="app-container">
  392. <el-form
  393. ref="createTemp"
  394. :rules="rules"
  395. :model="createTemp"
  396. label-position="right"
  397. label-width="100px"
  398. style="width: 90%; margin: 0 auto"
  399. >
  400. <el-row>
  401. <el-col :span="8">
  402. <el-form-item label="申购单号:" prop="orderNumber">
  403. <el-input
  404. ref="orderNumber"
  405. v-model="createTemp.orderNumber"
  406. disabled
  407. />
  408. </el-form-item>
  409. </el-col>
  410. <el-col :span="8">
  411. <el-form-item label="牧场:" prop="pastureId">
  412. <el-select
  413. v-model="createTemp.pastureId"
  414. placeholder="牧场"
  415. class="filter-item"
  416. style="width: 100%"
  417. :disabled="dialogStatus === 'update'"
  418. @change="changePasture"
  419. >
  420. <el-option
  421. v-for="item in findAllPasture"
  422. :key="item.id"
  423. :label="item.name"
  424. :value="item.id"
  425. />
  426. </el-select>
  427. </el-form-item>
  428. </el-col>
  429. <el-col :span="8">
  430. <el-form-item label="申购部门:" prop="departmentId">
  431. <el-select
  432. v-model="createTemp.departmentId"
  433. placeholder="申购部门"
  434. class="filter-item"
  435. style="width: 100%"
  436. :disabled="dialogStatus === 'update' || isMilk"
  437. @change="changeDepart"
  438. >
  439. <el-option
  440. v-for="item in createDepartList"
  441. :key="item.id"
  442. :label="item.name"
  443. :value="item.id"
  444. :disabled="item.name == '挤奶处'"
  445. />
  446. </el-select>
  447. </el-form-item>
  448. </el-col>
  449. </el-row>
  450. <el-row>
  451. <el-col :span="8">
  452. <el-form-item label="申购人:" prop="employeId">
  453. <el-select
  454. v-model="createTemp.employeId"
  455. placeholder="申购人"
  456. class="filter-item"
  457. style="width: 100%"
  458. :disabled="dialogStatus === 'update'"
  459. >
  460. <el-option
  461. v-for="item in findAllEmploye"
  462. :key="item.id"
  463. :label="item.name"
  464. :value="item.id"
  465. />
  466. </el-select>
  467. </el-form-item>
  468. </el-col>
  469. <el-col :span="8">
  470. <el-form-item label="申购日期:" prop="createTime">
  471. <el-date-picker
  472. v-model="createTemp.createTime"
  473. :picker-options="pickerOptions"
  474. type="datetime"
  475. placeholder="申购日期"
  476. style="width: 100%"
  477. :disabled="dialogStatus === 'update'"
  478. />
  479. </el-form-item>
  480. </el-col>
  481. <el-col v-if="dialogStatus === 'create'" :span="8">
  482. <el-form-item label="线上采购:" prop="providerId">
  483. <el-select
  484. v-model="createTemp.providerId"
  485. placeholder="线上采购"
  486. clearable
  487. class="filter-item"
  488. style="width: 100%"
  489. @change="changeProvider"
  490. >
  491. <el-option
  492. v-for="item in onlineSubscriptionList"
  493. :key="item.id"
  494. :label="item.providerName"
  495. :value="item.id"
  496. />
  497. </el-select>
  498. </el-form-item>
  499. </el-col>
  500. <el-col v-if="dialogStatus === 'update'" :span="8">
  501. <el-form-item label="线上采购:" prop="providerName">
  502. <el-input
  503. ref="providerName"
  504. v-model="createTemp.providerName"
  505. disabled
  506. />
  507. </el-form-item>
  508. </el-col>
  509. </el-row>
  510. <el-row>
  511. <el-col :span="16">
  512. <el-form-item label="备件:" prop="partCode">
  513. <el-autocomplete
  514. ref="autocomplete"
  515. v-model="createTemp.partCode"
  516. value-key="name"
  517. class="inline-input"
  518. :fetch-suggestions="sparePartSearch"
  519. placeholder="请输入备件编号或备件名称或备件规格"
  520. style="width: 100%"
  521. @select="handleSelectSparePart"
  522. >
  523. <template slot-scope="{ item }">
  524. <b>备件编号:</b>
  525. <div class="name" style="display: inline">
  526. {{ item.partCode }}
  527. </div>
  528. &nbsp; | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp; | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  529. </template>
  530. </el-autocomplete>
  531. </el-form-item>
  532. </el-col>
  533. </el-row>
  534. </el-form>
  535. <el-table
  536. :key="tableKey"
  537. v-loading="listLoading"
  538. element-loading-text="给我一点时间"
  539. :data="listAdd"
  540. border
  541. fit
  542. highlight-current-row
  543. style="width: 100%; margin-bottom: 30px"
  544. :row-style="rowStyle"
  545. :cell-style="cellStyle"
  546. class="elTable"
  547. :row-class-name="getRowClass"
  548. >
  549. <!-- table表格 -->
  550. <el-table-column
  551. label="序号"
  552. align="center"
  553. type="index"
  554. width="50px"
  555. />
  556. <el-table-column
  557. label="备件编号"
  558. prop="partCode"
  559. align="center"
  560. min-width="90"
  561. >
  562. <template slot-scope="scope">
  563. <span>{{ scope.row.partCode }}</span>
  564. </template>
  565. </el-table-column>
  566. <el-table-column
  567. label="备件名称"
  568. prop="partName"
  569. align="center"
  570. min-width="90"
  571. >
  572. <template slot-scope="scope">
  573. <span>{{ scope.row.partName }}</span>
  574. </template>
  575. </el-table-column>
  576. <el-table-column
  577. label="备件规格"
  578. prop="specification"
  579. min-width="80px"
  580. align="center"
  581. >
  582. <template slot-scope="scope">
  583. <span>{{ scope.row.specification }}</span>
  584. </template>
  585. </el-table-column>
  586. <el-table-column
  587. label="备件图片"
  588. prop="picpath"
  589. min-width="110px"
  590. align="center"
  591. >
  592. <template slot-scope="scope">
  593. <el-popover placement="right" title="" trigger="hover">
  594. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  595. <img
  596. v-if="scope.row.picpath !== ''"
  597. slot="reference"
  598. :src="scope.row.picpath"
  599. :alt="scope.row.srcpath"
  600. style="height: 100px; width: 100px"
  601. >
  602. </el-popover>
  603. </template>
  604. </el-table-column>
  605. <el-table-column
  606. label="备件品牌"
  607. prop="brand"
  608. align="center"
  609. min-width="60"
  610. >
  611. <template slot-scope="scope">
  612. <span v-if="dialogStatus === 'create'">{{
  613. scope.row.brandName
  614. }}</span>
  615. <span v-if="dialogStatus === 'update'">{{
  616. scope.row.brandName
  617. }}</span>
  618. </template>
  619. </el-table-column>
  620. <el-table-column
  621. label="计量单位"
  622. prop="unit"
  623. align="center"
  624. min-width="60"
  625. >
  626. <template slot-scope="scope">
  627. <span>{{ scope.row.unit }}</span>
  628. </template>
  629. </el-table-column>
  630. <el-table-column
  631. label="现有库存"
  632. prop="reportery"
  633. align="center"
  634. min-width="60"
  635. >
  636. <template slot-scope="scope">
  637. <span
  638. v-if="
  639. createTemp.providerId == '' ||
  640. parseFloat(createTemp.purchaseType) > 0
  641. "
  642. >{{ scope.row.reportery }}</span>
  643. </template>
  644. </el-table-column>
  645. <el-table-column
  646. label="价格"
  647. prop="price"
  648. align="center"
  649. min-width="150"
  650. >
  651. <template slot-scope="scope">
  652. <div
  653. v-if="
  654. scope.row.contractId == '' ||
  655. parseInt(scope.row.contractId) < 0 ||
  656. parseInt(scope.row.contractId) == 0
  657. "
  658. >
  659. <el-form :model="scope.row" :rules="rules">
  660. <el-form-item>
  661. <el-input
  662. v-model="scope.row.price"
  663. style="margin-top: 15px"
  664. />
  665. </el-form-item>
  666. </el-form>
  667. </div>
  668. <div v-for="item in scope.row.pricearr" v-else>
  669. <el-tooltip class="item" effect="dark" placement="top-start">
  670. <div slot="content">{{ item }}</div>
  671. <div
  672. style="
  673. overflow: hidden;
  674. white-space: nowrap;
  675. text-overflow: ellipsis;
  676. "
  677. >
  678. {{ item }}
  679. </div>
  680. </el-tooltip>
  681. </div>
  682. </template>
  683. </el-table-column>
  684. <el-table-column
  685. v-if="
  686. dialogStatus === 'create' ||
  687. (createTemp.purchase_type !== 1 && createTemp.purchase_type !== 3)
  688. "
  689. label="使用周期"
  690. min-width="120px"
  691. align="center"
  692. >
  693. <template slot-scope="scope">
  694. <div v-for="item in scope.row.lifeCyclearr">
  695. <el-tooltip class="item" effect="dark" placement="top-start">
  696. <div slot="content">{{ item }}</div>
  697. <div
  698. style="
  699. overflow: hidden;
  700. white-space: nowrap;
  701. text-overflow: ellipsis;
  702. "
  703. >
  704. {{ item }}
  705. </div>
  706. </el-tooltip>
  707. </div>
  708. </template>
  709. </el-table-column>
  710. <el-table-column
  711. v-if="
  712. dialogStatus === 'create' ||
  713. (createTemp.purchase_type !== 1 && createTemp.purchase_type !== 3)
  714. "
  715. label="合同差异项"
  716. min-width="120px"
  717. align="center"
  718. >
  719. <template slot-scope="scope">
  720. <div v-for="item in scope.row.contractVarianceItemarr">
  721. <el-tooltip class="item" effect="dark" placement="top-start">
  722. <div slot="content">{{ item }}</div>
  723. <div
  724. style="
  725. overflow: hidden;
  726. white-space: nowrap;
  727. text-overflow: ellipsis;
  728. "
  729. >
  730. {{ item }}
  731. </div>
  732. </el-tooltip>
  733. </div>
  734. </template>
  735. </el-table-column>
  736. <el-table-column
  737. label="申购数量"
  738. min-width="100px"
  739. align="center"
  740. valign="middle"
  741. >
  742. <template slot-scope="scope">
  743. <el-form :model="scope.row" :rules="rules">
  744. <el-form-item prop="amount">
  745. <el-input
  746. v-model="scope.row.amount"
  747. style="margin-top: 15px"
  748. />
  749. </el-form-item>
  750. </el-form>
  751. </template>
  752. </el-table-column>
  753. <!-- <el-table-column label="部门" min-width="110px" align="center" prop="purpose" valign="middle" /> -->
  754. <el-table-column
  755. v-if="textMap.create == '新增'"
  756. label="驳回说明"
  757. min-width="110px"
  758. align="center"
  759. prop="explain1"
  760. valign="middle"
  761. />
  762. <el-table-column
  763. label="备注"
  764. min-width="110px"
  765. align="center"
  766. valign="middle"
  767. >
  768. <template slot-scope="scope">
  769. <el-input v-model="scope.row.purpose" />
  770. </template>
  771. </el-table-column>
  772. <el-table-column
  773. label="操作"
  774. align="center"
  775. width="100"
  776. class-name="small-padding fixed-width"
  777. fixed="right"
  778. >
  779. <template slot-scope="{ row }">
  780. <a class="del" @click="partDelete(row)">删除</a>
  781. </template>
  782. </el-table-column>
  783. </el-table>
  784. <div slot="footer" class="dialog-footer" style="bottom: 10px">
  785. <el-button
  786. v-if="dialogStatus === 'create'"
  787. type="primary"
  788. :disabled="isokDisable"
  789. @click="add_dialog_save()"
  790. >保存并关闭</el-button>
  791. <el-button
  792. v-else-if="dialogStatus === 'update'"
  793. type="primary"
  794. :disabled="isokDisable"
  795. @click="edit_dialog_save()"
  796. >保存并关闭</el-button>
  797. <el-button
  798. @click="
  799. dialogFormVisible = false
  800. get_table_data()
  801. "
  802. >取消并关闭</el-button>
  803. </div>
  804. </div>
  805. </el-dialog>
  806. <!-- 特殊申购 -->
  807. <el-dialog
  808. :title="textMap[dialogStatus]"
  809. :visible.sync="dialogFormVisible2"
  810. :close-on-click-modal="false"
  811. width="90%"
  812. >
  813. <div class="app-container">
  814. <el-form
  815. ref="createTemp"
  816. :rules="rules"
  817. :model="createTemp"
  818. label-position="right"
  819. label-width="100px"
  820. style="width: 90%; margin: 0 auto"
  821. >
  822. <el-row>
  823. <el-col :span="8">
  824. <el-form-item label="申购单号:" prop="orderNumber">
  825. <el-input
  826. ref="orderNumber"
  827. v-model="createTemp.orderNumber"
  828. disabled
  829. />
  830. </el-form-item>
  831. </el-col>
  832. <el-col :span="8">
  833. <el-form-item label="牧场:" prop="pastureId">
  834. <el-select
  835. v-model="createTemp.pastureId"
  836. placeholder="牧场"
  837. class="filter-item"
  838. style="width: 100%"
  839. :disabled="dialogStatus === 'update'"
  840. @change="changePasture"
  841. >
  842. <el-option
  843. v-for="item in findAllPasture"
  844. :key="item.id"
  845. :label="item.name"
  846. :value="item.id"
  847. />
  848. </el-select>
  849. </el-form-item>
  850. </el-col>
  851. <el-col :span="8">
  852. <el-form-item label="申购部门:" prop="departmentId">
  853. <el-select
  854. v-model="createTemp.departmentId"
  855. placeholder="申购部门"
  856. class="filter-item"
  857. style="width: 100%"
  858. :disabled="dialogStatus === 'update'"
  859. @change="changeDepart"
  860. >
  861. <el-option
  862. v-for="item in createDepartList"
  863. :key="item.id"
  864. :label="item.name"
  865. :value="item.id"
  866. />
  867. </el-select>
  868. </el-form-item>
  869. </el-col>
  870. </el-row>
  871. <el-row>
  872. <el-col :span="8">
  873. <el-form-item label="申购人:" prop="employeId">
  874. <el-select
  875. v-model="createTemp.employeId"
  876. placeholder="申购人"
  877. class="filter-item"
  878. style="width: 100%"
  879. :disabled="dialogStatus === 'update'"
  880. >
  881. <el-option
  882. v-for="item in findAllEmploye"
  883. :key="item.id"
  884. :label="item.name"
  885. :value="item.id"
  886. />
  887. </el-select>
  888. </el-form-item>
  889. </el-col>
  890. <el-col :span="8">
  891. <el-form-item label="申购日期:" prop="createTime">
  892. <el-date-picker
  893. v-model="createTemp.createTime"
  894. :picker-options="pickerOptions"
  895. type="datetime"
  896. placeholder="申购日期"
  897. style="width: 100%"
  898. :disabled="dialogStatus === 'update'"
  899. />
  900. </el-form-item>
  901. </el-col>
  902. <el-col
  903. v-if="
  904. (dialogStatus === 'special' &&
  905. createTemp.purchaseType == '1') ||
  906. createTemp.purchaseType == '3'
  907. "
  908. :span="8"
  909. >
  910. <el-form-item label="供应商:" prop="providerId">
  911. <el-select
  912. v-model="createTemp.providerId"
  913. filterable
  914. placeholder="供应商"
  915. class="filter-item"
  916. style="width: 100%"
  917. :disabled="dialogStatus === 'update'"
  918. >
  919. <el-option
  920. v-for="item in providerList"
  921. :key="item.id"
  922. :label="item.providerName"
  923. :value="item.id"
  924. />
  925. </el-select>
  926. </el-form-item>
  927. </el-col>
  928. <el-col
  929. v-if="
  930. dialogStatus === 'special' && createTemp.purchaseType == '2'
  931. "
  932. :span="8"
  933. >
  934. <el-form-item label="供应商:" prop="providerId">
  935. <el-input
  936. ref="providerName"
  937. v-model="createTemp.providerName"
  938. />
  939. <!-- <el-select v-model="createTemp.providerId" placeholder="供应商" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  940. <el-option v-for="item in providerList" :key="item.id" :label="item.providerName" :value="item.id" />
  941. </el-select> -->
  942. </el-form-item>
  943. </el-col>
  944. <el-col
  945. v-if="
  946. dialogStatus === 'special' && createTemp.purchaseType == '2'
  947. "
  948. :span="8"
  949. >
  950. <el-form-item label="垫付人:" prop="funderId">
  951. <el-select
  952. v-model="createTemp.funderId"
  953. filterable
  954. placeholder="垫付人"
  955. class="filter-item"
  956. style="width: 100%"
  957. :disabled="dialogStatus === 'update'"
  958. >
  959. <el-option
  960. v-for="item in findAllEmploye"
  961. :key="item.id"
  962. :label="item.name"
  963. :value="item.id"
  964. />
  965. </el-select>
  966. </el-form-item>
  967. </el-col>
  968. </el-row>
  969. <el-row>
  970. <el-col :span="24">
  971. <el-form-item label="申购类型:" prop="purchaseType">
  972. <el-radio
  973. v-model="createTemp.purchaseType"
  974. label="1"
  975. @change="changeType()"
  976. >暂估</el-radio>
  977. <!-- <el-radio v-model="createTemp.purchaseType" label="2" @change="changeType()">垫付</el-radio> -->
  978. <el-radio
  979. v-model="createTemp.purchaseType"
  980. label="3"
  981. @change="changeType()"
  982. >赠品</el-radio>
  983. </el-form-item>
  984. </el-col>
  985. </el-row>
  986. <el-row>
  987. <el-col :span="16">
  988. <el-form-item label="备件:" prop="partCode">
  989. <el-autocomplete
  990. ref="autocomplete"
  991. v-model="createTemp.partCode"
  992. value-key="name"
  993. class="inline-input"
  994. :fetch-suggestions="sparePartSearch"
  995. placeholder="请输入备件编号或备件名称或备件规格"
  996. style="width: 100%"
  997. @select="handleSelectSparePart"
  998. >
  999. <template slot-scope="{ item }">
  1000. <b>备件编号:</b>
  1001. <div class="name" style="display: inline">
  1002. {{ item.partCode }}
  1003. </div>
  1004. &nbsp; | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp; | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  1005. </template>
  1006. </el-autocomplete>
  1007. </el-form-item>
  1008. </el-col>
  1009. </el-row>
  1010. </el-form>
  1011. <el-table
  1012. :key="tableKey"
  1013. v-loading="listLoading"
  1014. element-loading-text="给我一点时间"
  1015. :data="listAdd"
  1016. border
  1017. fit
  1018. highlight-current-row
  1019. style="width: 100%; margin-bottom: 30px"
  1020. :row-style="rowStyle"
  1021. :cell-style="cellStyle"
  1022. :row-class-name="getRowClass"
  1023. >
  1024. <el-table-column
  1025. label="序号"
  1026. align="center"
  1027. type="index"
  1028. width="50px"
  1029. />
  1030. <el-table-column
  1031. label="备件编号"
  1032. prop="partCode"
  1033. align="center"
  1034. min-width="90"
  1035. >
  1036. <template slot-scope="scope">
  1037. <span>{{ scope.row.partCode }}</span>
  1038. </template>
  1039. </el-table-column>
  1040. <el-table-column
  1041. label="备件名称"
  1042. prop="partName"
  1043. align="center"
  1044. min-width="90"
  1045. >
  1046. <template slot-scope="scope">
  1047. <span>{{ scope.row.partName }}</span>
  1048. </template>
  1049. </el-table-column>
  1050. <el-table-column
  1051. label="备件规格"
  1052. prop="specification"
  1053. min-width="80px"
  1054. align="center"
  1055. >
  1056. <template slot-scope="scope">
  1057. <span>{{ scope.row.specification }}</span>
  1058. </template>
  1059. </el-table-column>
  1060. <el-table-column
  1061. label="备件图片"
  1062. prop="picpath"
  1063. min-width="110px"
  1064. align="center"
  1065. >
  1066. <template slot-scope="scope">
  1067. <el-popover placement="right" title="" trigger="hover">
  1068. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  1069. <img
  1070. v-if="scope.row.picpath !== ''"
  1071. slot="reference"
  1072. :src="scope.row.picpath"
  1073. :alt="scope.row.srcpath"
  1074. style="height: 100px; width: 100px"
  1075. >
  1076. </el-popover>
  1077. </template>
  1078. </el-table-column>
  1079. <el-table-column
  1080. label="备件品牌"
  1081. prop="brand"
  1082. align="center"
  1083. min-width="160"
  1084. >
  1085. <template slot-scope="scope">
  1086. <el-form :model="scope.row" :rules="rules">
  1087. <el-form-item prop="brandName">
  1088. <el-autocomplete
  1089. v-model="scope.row.brandName"
  1090. value-key="brandName"
  1091. class="inline-input"
  1092. :fetch-suggestions="brandSearch"
  1093. placeholder="请输入品牌"
  1094. style="width: 100%"
  1095. @select="
  1096. (value) => {
  1097. handleSelectBrand(value, scope.row)
  1098. }
  1099. "
  1100. />
  1101. </el-form-item>
  1102. </el-form>
  1103. </template>
  1104. </el-table-column>
  1105. <el-table-column
  1106. label="计量单位"
  1107. prop="unit"
  1108. align="center"
  1109. min-width="60"
  1110. >
  1111. <template slot-scope="scope">
  1112. <span>{{ scope.row.unit }}</span>
  1113. </template>
  1114. </el-table-column>
  1115. <el-table-column
  1116. label="现有库存"
  1117. prop="reportery"
  1118. align="center"
  1119. min-width="60"
  1120. >
  1121. <template slot-scope="scope">
  1122. <span
  1123. v-if="
  1124. createTemp.providerId == '' ||
  1125. parseFloat(createTemp.purchaseType) > 0
  1126. "
  1127. >{{ scope.row.reportery }}</span>
  1128. </template>
  1129. </el-table-column>
  1130. <!-- <el-table-column v-if="createTemp.purchaseType == '1'" label="价格" prop="price" align="center" min-width="150">
  1131. <template slot-scope="scope">
  1132. <div v-if="createTemp.purchaseType == '1'" v-for="item in scope.row.pricearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  1133. <el-tooltip class="item" effect="dark" placement="top-start">
  1134. <div slot="content">{{item}}</div>
  1135. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  1136. </el-tooltip>
  1137. </div>
  1138. </template>
  1139. </el-table-column> -->
  1140. <el-table-column
  1141. label="价格"
  1142. prop="price"
  1143. align="center"
  1144. min-width="150"
  1145. >
  1146. <template slot-scope="scope">
  1147. <el-form :model="scope.row" :rules="rules">
  1148. <el-form-item prop="price">
  1149. <el-input
  1150. v-model="scope.row.price"
  1151. style="margin-top: 15px"
  1152. />
  1153. </el-form-item>
  1154. </el-form>
  1155. </template>
  1156. </el-table-column>
  1157. <el-table-column
  1158. label="申购数量"
  1159. min-width="100px"
  1160. align="center"
  1161. valign="middle"
  1162. >
  1163. <template slot-scope="scope">
  1164. <el-form :model="scope.row" :rules="rules">
  1165. <el-form-item prop="amount">
  1166. <el-input
  1167. v-model="scope.row.amount"
  1168. style="margin-top: 15px"
  1169. />
  1170. </el-form-item>
  1171. </el-form>
  1172. </template>
  1173. </el-table-column>
  1174. <el-table-column
  1175. v-if="createTemp.purchaseType == '1'"
  1176. label="驳回说明"
  1177. min-width="110px"
  1178. align="center"
  1179. prop="explain1"
  1180. valign="middle"
  1181. />
  1182. <el-table-column
  1183. label="备注"
  1184. min-width="110px"
  1185. align="center"
  1186. valign="middle"
  1187. >
  1188. <template slot-scope="scope">
  1189. <el-input v-model="scope.row.purpose" />
  1190. </template>
  1191. </el-table-column>
  1192. <el-table-column
  1193. label="操作"
  1194. align="center"
  1195. width="100"
  1196. class-name="small-padding fixed-width"
  1197. fixed="right"
  1198. >
  1199. <template slot-scope="{ row }">
  1200. <a class="del" @click="partDelete(row)">删除</a>
  1201. </template>
  1202. </el-table-column>
  1203. </el-table>
  1204. <div slot="footer" class="dialog-footer" style="bottom: 10px">
  1205. <el-button
  1206. v-if="dialogStatus === 'special'"
  1207. type="primary"
  1208. :disabled="isokDisable"
  1209. @click="special_dialog_save()"
  1210. >保存并关闭</el-button>
  1211. <el-button
  1212. @click="
  1213. dialogFormVisible2 = false
  1214. get_table_data()
  1215. "
  1216. >取消并关闭</el-button>
  1217. </div>
  1218. </div>
  1219. </el-dialog>
  1220. <!-- 查看 -->
  1221. <el-dialog
  1222. :title="textMap[dialogStatus]"
  1223. :visible.sync="dialogFormVisibleSee"
  1224. :close-on-click-modal="false"
  1225. :before-close="handleCancel"
  1226. width="90%"
  1227. ref="dialogFormVisibleSeeRef"
  1228. >
  1229. <div class="app-containerSee">
  1230. <el-form
  1231. ref="seeTemp"
  1232. :rules="rules"
  1233. :model="seeTemp"
  1234. label-position="right"
  1235. label-width="100px"
  1236. style="width: 90%; margin: 0 auto"
  1237. >
  1238. <el-row>
  1239. <el-col :span="8">
  1240. <el-form-item label="申购单号:" prop="orderNumber">
  1241. <el-input
  1242. ref="orderNumber"
  1243. v-model="seeTemp.orderNumber"
  1244. disabled
  1245. />
  1246. </el-form-item>
  1247. </el-col>
  1248. <el-col :span="8">
  1249. <el-form-item label="牧场:" prop="pastureId">
  1250. <el-select
  1251. v-model="seeTemp.pastureId"
  1252. placeholder="牧场"
  1253. class="filter-item"
  1254. disabled
  1255. style="width: 100%"
  1256. >
  1257. <el-option
  1258. v-for="item in findAllPasture"
  1259. :key="item.id"
  1260. :label="item.name"
  1261. :value="item.id"
  1262. />
  1263. </el-select>
  1264. </el-form-item>
  1265. </el-col>
  1266. <el-col :span="8">
  1267. <el-form-item label="申购部门:" prop="departmentName">
  1268. <el-input
  1269. ref="departmentName"
  1270. v-model="seeTemp.departmentName"
  1271. disabled
  1272. />
  1273. </el-form-item>
  1274. </el-col>
  1275. </el-row>
  1276. <el-row>
  1277. <el-col :span="8">
  1278. <el-form-item label="申购人:" prop="empname">
  1279. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  1280. </el-form-item>
  1281. </el-col>
  1282. <el-col :span="8">
  1283. <el-form-item label="申购日期:" prop="inputTime">
  1284. <el-date-picker
  1285. v-model="seeTemp.inputTime"
  1286. :picker-options="pickerOptions"
  1287. type="date"
  1288. placeholder="申购日期"
  1289. format="yyyy-MM-dd"
  1290. value-format="yyyy-MM-dd"
  1291. style="width: 100%"
  1292. disabled
  1293. />
  1294. </el-form-item>
  1295. </el-col>
  1296. <el-col v-if="seeTemp.purchaseType == '2'" :span="8">
  1297. <el-form-item label="供应商:" prop="funderProviderName ">
  1298. <el-input
  1299. ref="funderProviderName "
  1300. v-model="seeTemp.funderProviderName"
  1301. disabled
  1302. />
  1303. </el-form-item>
  1304. </el-col>
  1305. <el-col
  1306. v-if="seeTemp.purchase_type > 0 && seeTemp.purchaseType !== '2'"
  1307. :span="8"
  1308. >
  1309. <el-form-item label="供应商:" prop="providerName">
  1310. <el-input
  1311. ref="providerName"
  1312. v-model="seeTemp.providerName"
  1313. disabled
  1314. />
  1315. </el-form-item>
  1316. </el-col>
  1317. <el-col v-if="seeTemp.purchaseType == '2'" :span="8">
  1318. <el-form-item label="垫付人:" prop="funder_name">
  1319. <el-input
  1320. ref="funder_name"
  1321. v-model="seeTemp.funder_name"
  1322. disabled
  1323. />
  1324. </el-form-item>
  1325. </el-col>
  1326. <el-col v-if="seeTemp.purchase_type < 1" :span="8">
  1327. <el-form-item label="线上采购:" prop="providerName">
  1328. <el-input
  1329. ref="providerName"
  1330. v-model="seeTemp.providerName"
  1331. disabled
  1332. />
  1333. </el-form-item>
  1334. </el-col>
  1335. </el-row>
  1336. <el-row v-if="seeTemp.purchase_type > 0">
  1337. <el-col :span="24">
  1338. <el-form-item label="申购类型:" prop="purchaseType">
  1339. <!-- <el-radio v-model="seeTemp.purchaseType" disabled label="1">暂估</el-radio> -->
  1340. <!-- <el-radio v-model="seeTemp.purchaseType" disabled label="2">垫付</el-radio> -->
  1341. <el-radio
  1342. v-model="seeTemp.purchaseType"
  1343. disabled
  1344. label="3"
  1345. >赠品</el-radio>
  1346. </el-form-item>
  1347. </el-col>
  1348. </el-row>
  1349. </el-form>
  1350. <el-table
  1351. :key="tableKey"
  1352. v-loading="listLoadingSee"
  1353. element-loading-text="给我一点时间"
  1354. :data="listSee"
  1355. border
  1356. fit
  1357. highlight-current-row
  1358. style="width: 100%; margin-bottom: 30px"
  1359. :row-style="rowStyle"
  1360. :cell-style="cellStyle"
  1361. class="elTable"
  1362. @sort-change="tableSort"
  1363. >
  1364. <el-table-column
  1365. type="index"
  1366. label="序号"
  1367. align="center"
  1368. width="50px"
  1369. />
  1370. <el-table-column
  1371. label="备件编号"
  1372. prop="partCode"
  1373. align="center"
  1374. min-width="90"
  1375. >
  1376. <template slot-scope="scope">
  1377. <span>{{ scope.row.partCode }}</span>
  1378. </template>
  1379. </el-table-column>
  1380. <el-table-column
  1381. label="备件名称"
  1382. prop="partName"
  1383. align="center"
  1384. min-width="90"
  1385. >
  1386. <template slot-scope="scope">
  1387. <span>{{ scope.row.partName }}</span>
  1388. </template>
  1389. </el-table-column>
  1390. <el-table-column
  1391. label="备件规格"
  1392. prop="specification"
  1393. min-width="90px"
  1394. align="center"
  1395. >
  1396. <template slot-scope="scope">
  1397. <span>{{ scope.row.specification }}</span>
  1398. </template>
  1399. </el-table-column>
  1400. <el-table-column
  1401. label="备件图片"
  1402. prop="picpath"
  1403. min-width="110px"
  1404. align="center"
  1405. >
  1406. <template slot-scope="scope">
  1407. <el-popover placement="right" title="" trigger="hover">
  1408. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  1409. <img
  1410. v-if="scope.row.picpath !== ''"
  1411. slot="reference"
  1412. :src="scope.row.picpath"
  1413. :alt="scope.row.srcpath"
  1414. style="height: 100px; width: 100px"
  1415. >
  1416. </el-popover>
  1417. </template>
  1418. </el-table-column>
  1419. <el-table-column
  1420. label="备件品牌"
  1421. prop="brandName"
  1422. align="center"
  1423. min-width="60"
  1424. >
  1425. <template slot-scope="scope">
  1426. <span>{{ scope.row.brandName }}</span>
  1427. </template>
  1428. </el-table-column>
  1429. <el-table-column
  1430. label="计量单位"
  1431. prop="unit"
  1432. align="center"
  1433. min-width="60"
  1434. >
  1435. <template slot-scope="scope">
  1436. <span>{{ scope.row.unit }}</span>
  1437. </template>
  1438. </el-table-column>
  1439. <el-table-column
  1440. label="现有库存"
  1441. sortable
  1442. prop="storageAmount"
  1443. align="center"
  1444. min-width="60"
  1445. />
  1446. <!-- <el-table-column label="价格" sortable prop="price" align="center" min-width="60" /> -->
  1447. <el-table-column label="价格" min-width="150px" align="center">
  1448. <template slot-scope="scope">
  1449. <div
  1450. v-for="item in scope.row.pricearr"
  1451. style="
  1452. overflow: hidden;
  1453. white-space: nowrap;
  1454. text-overflow: ellipsis;
  1455. "
  1456. >
  1457. <el-tooltip class="item" effect="dark" placement="top-start">
  1458. <div slot="content">{{ item }}</div>
  1459. <div
  1460. style="
  1461. overflow: hidden;
  1462. white-space: nowrap;
  1463. text-overflow: ellipsis;
  1464. "
  1465. >
  1466. {{ item }}
  1467. </div>
  1468. </el-tooltip>
  1469. </div>
  1470. </template>
  1471. </el-table-column>
  1472. <el-table-column label="使用周期" min-width="120px" align="center">
  1473. <template slot-scope="scope">
  1474. <div
  1475. v-for="item in scope.row.lifeCyclearr"
  1476. style="
  1477. overflow: hidden;
  1478. white-space: nowrap;
  1479. text-overflow: ellipsis;
  1480. "
  1481. >
  1482. <el-tooltip class="item" effect="dark" placement="top-start">
  1483. <div slot="content">{{ item }}</div>
  1484. <div
  1485. style="
  1486. overflow: hidden;
  1487. white-space: nowrap;
  1488. text-overflow: ellipsis;
  1489. "
  1490. >
  1491. {{ item }}
  1492. </div>
  1493. </el-tooltip>
  1494. </div>
  1495. </template>
  1496. </el-table-column>
  1497. <el-table-column label="合同差异项" min-width="120px" align="center">
  1498. <template slot-scope="scope">
  1499. <div
  1500. v-for="item in scope.row.contractVarianceItemarr"
  1501. style="
  1502. overflow: hidden;
  1503. white-space: nowrap;
  1504. text-overflow: ellipsis;
  1505. "
  1506. >
  1507. <el-tooltip class="item" effect="dark" placement="top-start">
  1508. <div slot="content">{{ item }}</div>
  1509. <div
  1510. style="
  1511. overflow: hidden;
  1512. white-space: nowrap;
  1513. text-overflow: ellipsis;
  1514. "
  1515. >
  1516. {{ item }}
  1517. </div>
  1518. </el-tooltip>
  1519. </div>
  1520. </template>
  1521. </el-table-column>
  1522. <el-table-column
  1523. label="申购数量"
  1524. sortable
  1525. prop="amount"
  1526. align="center"
  1527. min-width="60"
  1528. />
  1529. <el-table-column
  1530. label="驳回说明"
  1531. min-width="110px"
  1532. align="center"
  1533. prop="explain1"
  1534. valign="middle"
  1535. />
  1536. <el-table-column
  1537. label="备注"
  1538. min-width="110px"
  1539. align="center"
  1540. prop="purpose"
  1541. />
  1542. </el-table>
  1543. <el-form
  1544. ref="seeTemp"
  1545. :rules="rules"
  1546. :model="seeTemp"
  1547. label-position="right"
  1548. label-width="100px"
  1549. style="width: 90%; margin: 0 auto"
  1550. >
  1551. <el-row>
  1552. <el-col>
  1553. <el-form-item label="流程进度" />
  1554. <el-steps :active="active" align-center finish-status="success">
  1555. <el-step
  1556. v-for="(item, index) in activeList"
  1557. :key="index"
  1558. :title="item.title"
  1559. :status="item.status"
  1560. >
  1561. <template slot="description">
  1562. <div class="step-row">
  1563. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  1564. <div>{{ item.reason }}</div>
  1565. </div>
  1566. </template>
  1567. </el-step>
  1568. </el-steps>
  1569. </el-col>
  1570. </el-row>
  1571. <el-row>
  1572. <el-col>
  1573. <el-form-item label="操作:">
  1574. <!-- 库管 -->
  1575. <el-button
  1576. v-if="
  1577. isSubscribeExamineKG &&
  1578. seeTemp.statue == 2 &&
  1579. (seeTemp.departmentName == '挤奶处' && (seeTemp.isPasturd || seeTemp.isRolePasturd ))
  1580. "
  1581. type="success"
  1582. style="display: inline-block"
  1583. @click="handleExamine1(row)"
  1584. >审核</el-button>
  1585. <!-- 设备 -->
  1586. <el-button
  1587. v-if="isSubscribeExamineSBZG && seeTemp.statue == 3 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )"
  1588. type="success"
  1589. style="display: inline-block"
  1590. @click="handleExamine2(row)"
  1591. >审核</el-button>
  1592. <!-- 供应商主管 -->
  1593. <el-button
  1594. v-if="isSubscribeExamineZG && seeTemp.statue == 9 && seeTemp.isPasturd"
  1595. type="success"
  1596. style="display: inline-block"
  1597. @click="handleExamine3(row)"
  1598. >审核</el-button>
  1599. <!-- 场长 -->
  1600. <el-button
  1601. v-if="
  1602. sdchangzhangshenhe &&
  1603. seeTemp.statue == 5 &&
  1604. seeTemp.departmentName == '挤奶处' &&
  1605. seeTemp.examine == 1 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  1606. "
  1607. type="success"
  1608. style="display: inline-block"
  1609. @click="handleExamine4(row)"
  1610. >审核</el-button>
  1611. <el-button
  1612. v-else-if="
  1613. sdchangzhangshenhe &&
  1614. seeTemp.statue == 5 &&
  1615. seeTemp.departmentName !== '挤奶处' && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  1616. "
  1617. type="success"
  1618. style="display: inline-block"
  1619. @click="handleExamine4(row)"
  1620. >审核</el-button>
  1621. <!-- 采购 -->
  1622. <el-button
  1623. v-if="isSubscribeExamineCG && (seeTemp.statue == 11 || (seeTemp.departmentName == '挤奶处' && seeTemp.statue == 15)) && seeTemp.isPasturd"
  1624. type="success"
  1625. style="display: inline-block"
  1626. @click="handleExamine5(row)"
  1627. >审核</el-button>
  1628. <!-- 财务 -->
  1629. <el-button
  1630. v-if="
  1631. isSubscribeExamineCW &&
  1632. seeTemp.purchase_type == 1 &&
  1633. seeTemp.statue == 7 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  1634. "
  1635. style="display: inline-block"
  1636. type="success"
  1637. size="mini"
  1638. @click="handleExamine6(row)"
  1639. >审核</el-button>
  1640. <!-- 奶厅 -->
  1641. <el-button
  1642. v-if="
  1643. isSubscribeExamineNT &&
  1644. seeTemp.departmentName == '挤奶处' &&
  1645. ((seeTemp.examine !== 1 && seeTemp.statue == 5) ||
  1646. seeTemp.statue == 11) && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  1647. "
  1648. style="display: inline-block"
  1649. type="success"
  1650. size="mini"
  1651. @click="handleExamine7(row)"
  1652. >审核</el-button>
  1653. </el-form-item>
  1654. </el-col>
  1655. </el-row>
  1656. </el-form>
  1657. <div slot="footer" class="dialog-footer" style="bottom: 5px">
  1658. <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
  1659. </div>
  1660. </div>
  1661. </el-dialog>
  1662. <!-- 审核 -->
  1663. <el-dialog
  1664. :title="textMap[dialogStatus]"
  1665. :visible.sync="dialogFormVisible_Examine"
  1666. :close-on-click-modal="false"
  1667. width="30%"
  1668. ref="dialogFormVisibleSeeRef2"
  1669. >
  1670. <div class="app-examine">
  1671. <h3 style="width: 100%; margin: 0 0 0 5%; line-height: 50px">
  1672. 请确认审核结果:
  1673. </h3>
  1674. <el-form
  1675. ref="examineTemp"
  1676. :rules="rules"
  1677. :model="examineTemp"
  1678. label-position="right"
  1679. style="width: 50%; margin: 0 auto"
  1680. >
  1681. <el-row style="width: 88%; height: 150px; margin: 0 auto">
  1682. <el-col :span="20">
  1683. <el-form-item>
  1684. <el-radio-group
  1685. v-model="examineTemp.statue"
  1686. @change="changeStatue"
  1687. >
  1688. <el-radio :label="1" checked>通过</el-radio>
  1689. <el-radio :label="2">不通过</el-radio>
  1690. </el-radio-group>
  1691. </el-form-item>
  1692. </el-col>
  1693. <el-col v-if="statueReason" :span="20">
  1694. <el-input
  1695. v-model="examineTemp.workflowNote"
  1696. type="textarea"
  1697. :autosize="{ minRows: 2, maxRows: 4 }"
  1698. placeholder="请输入不通过原因"
  1699. />
  1700. </el-col>
  1701. </el-row>
  1702. </el-form>
  1703. </div>
  1704. <div slot="footer" class="dialog-footer">
  1705. <el-button
  1706. v-if="dialogStatus === 'examine1'"
  1707. type="primary"
  1708. :disabled="isokDisable"
  1709. @click="createExamineData1()"
  1710. >确认</el-button>
  1711. <el-button
  1712. v-if="dialogStatus === 'examine2'"
  1713. type="primary"
  1714. :disabled="isokDisable"
  1715. @click="createExamineData2()"
  1716. >确认</el-button>
  1717. <el-button
  1718. v-if="dialogStatus === 'examine3'"
  1719. type="primary"
  1720. :disabled="isokDisable"
  1721. @click="createExamineData3()"
  1722. >确认</el-button>
  1723. <el-button
  1724. v-if="dialogStatus === 'examine4'"
  1725. type="primary"
  1726. :disabled="isokDisable"
  1727. @click="createExamineData4()"
  1728. >确认</el-button>
  1729. <el-button
  1730. v-if="dialogStatus === 'examine5'"
  1731. type="primary"
  1732. :disabled="isokDisable"
  1733. @click="createExamineData5()"
  1734. >确认</el-button>
  1735. <el-button
  1736. v-if="dialogStatus === 'examine6'"
  1737. type="primary"
  1738. :disabled="isokDisable"
  1739. @click="createExamineData6()"
  1740. >确认</el-button>
  1741. <el-button
  1742. v-if="dialogStatus === 'examine7'"
  1743. type="primary"
  1744. :disabled="isokDisable"
  1745. @click="createExamineData7()"
  1746. >确认</el-button>
  1747. <el-button @click="dialogFormVisible_Examine = false">关闭</el-button>
  1748. </div>
  1749. </el-dialog>
  1750. <!-- 查看备件 -->
  1751. <el-dialog
  1752. :title="textMap[dialogStatus]"
  1753. :visible.sync="dialogFormVisible_seepart"
  1754. :close-on-click-modal="false"
  1755. width="90%"
  1756. ref="dialogFormVisibleSeeRef3"
  1757. >
  1758. <div>
  1759. <el-input
  1760. v-model="seepart.getdataListParm.parammaps.partName"
  1761. placeholder="备件"
  1762. style="width: 200px"
  1763. class="filter-item"
  1764. />
  1765. <el-button
  1766. v-waves
  1767. class="filter-item"
  1768. type="primary"
  1769. icon="el-icon-search"
  1770. @click="seepart_search"
  1771. >搜索</el-button>
  1772. <h3
  1773. v-if="seepartList.length == 0"
  1774. style="text-align: center; height: 300px; line-height: 300px"
  1775. >
  1776. 呆滞库存查询(如可调拨使用,请优先消耗)
  1777. </h3>
  1778. <div v-else>
  1779. <el-table
  1780. :key="seepart.tableKey"
  1781. v-loading="seepart.listLoading"
  1782. element-loading-text="给我一点时间"
  1783. :data="seepartList"
  1784. border
  1785. fit
  1786. highlight-current-row
  1787. style="width: 100%; margin-bottom: 30px; margin-top: 20px"
  1788. :row-style="rowStyle"
  1789. :cell-style="cellStyle"
  1790. class="elTable"
  1791. height="300"
  1792. >
  1793. <el-table-column
  1794. label="序号"
  1795. align="center"
  1796. type="index"
  1797. width="50px"
  1798. />
  1799. <el-table-column
  1800. label="牧场名称"
  1801. prop="pastureName"
  1802. align="center"
  1803. min-width="90"
  1804. />
  1805. <el-table-column
  1806. label="备件编号"
  1807. prop="partCode"
  1808. align="center"
  1809. min-width="90"
  1810. />
  1811. <el-table-column
  1812. label="备件名称"
  1813. prop="partName"
  1814. align="center"
  1815. min-width="90"
  1816. />
  1817. <el-table-column
  1818. label="备件规格"
  1819. prop="specification"
  1820. align="center"
  1821. min-width="90"
  1822. />
  1823. <el-table-column
  1824. label="备件图片"
  1825. prop="picpath"
  1826. align="center"
  1827. min-width="90"
  1828. >
  1829. <template slot-scope="scope">
  1830. <el-popover placement="right" title="" trigger="hover">
  1831. <img
  1832. v-if="scope.row.picpath !== ''"
  1833. :src="scope.row.picpath"
  1834. >
  1835. <img
  1836. v-if="scope.row.picpath !== ''"
  1837. slot="reference"
  1838. :src="scope.row.picpath"
  1839. :alt="scope.row.srcpath"
  1840. style="height: 100px; width: 100px"
  1841. >
  1842. </el-popover>
  1843. </template>
  1844. </el-table-column>
  1845. <el-table-column
  1846. label="备件品牌"
  1847. prop="brand"
  1848. align="center"
  1849. min-width="90"
  1850. />
  1851. <el-table-column
  1852. label="计量单位"
  1853. prop="unit"
  1854. align="center"
  1855. min-width="90"
  1856. />
  1857. <el-table-column
  1858. label="现有库存"
  1859. sortable
  1860. prop="reportery"
  1861. align="center"
  1862. min-width="60"
  1863. />
  1864. <el-table-column
  1865. label="价格"
  1866. sortable
  1867. prop="price"
  1868. align="center"
  1869. min-width="60"
  1870. />
  1871. <el-table-column
  1872. label="在库天数"
  1873. sortable
  1874. prop="daysInStorage"
  1875. align="center"
  1876. min-width="60"
  1877. />
  1878. <el-table-column
  1879. label="负责人"
  1880. prop="dutyPersonal"
  1881. align="center"
  1882. min-width="90"
  1883. />
  1884. <el-table-column
  1885. label="联系方式"
  1886. prop="telphone"
  1887. align="center"
  1888. min-width="90"
  1889. />
  1890. </el-table>
  1891. <pagination
  1892. v-show="seepart.total > 0"
  1893. :total="seepart.total"
  1894. :page.sync="seepart.getdataListParm.offset"
  1895. :limit.sync="seepart.getdataListParm.pagecount"
  1896. @pagination="get_seepart_data"
  1897. />
  1898. </div>
  1899. </div>
  1900. <div slot="footer" class="dialog-footer">
  1901. <el-button
  1902. type="primary"
  1903. :disabled="isokDisable"
  1904. @click="form_add()"
  1905. >继续申购</el-button>
  1906. <el-button
  1907. @click="
  1908. dialogFormVisible_seepart = false
  1909. seepart.getdataListParm.parammaps.partName = ''
  1910. "
  1911. >取消</el-button>
  1912. </div>
  1913. </el-dialog>
  1914. <!-- 合单 -->
  1915. <el-dialog
  1916. :title="textMap[dialogStatus]"
  1917. :visible.sync="dialogFormVisible_modify"
  1918. :close-on-click-modal="false"
  1919. width="90%"
  1920. ref="dialogFormVisibleSeeRef4"
  1921. >
  1922. <div>
  1923. <el-form
  1924. ref="modifyTemp"
  1925. :rules="rules"
  1926. :model="modifyTemp"
  1927. label-position="right"
  1928. label-width="100px"
  1929. style="width: 90%; margin: 0 auto"
  1930. >
  1931. <el-row>
  1932. <el-col :span="8">
  1933. <el-form-item label="申购单号:" prop="orderNumber">
  1934. <el-input
  1935. ref="orderNumber"
  1936. v-model="modifyTemp.orderNumber"
  1937. disabled
  1938. />
  1939. </el-form-item>
  1940. </el-col>
  1941. <el-col :span="8">
  1942. <el-form-item label="牧场:" prop="pastureId">
  1943. <el-select
  1944. v-model="modifyTemp.pastureId"
  1945. placeholder="牧场"
  1946. class="filter-item"
  1947. style="width: 100%"
  1948. :disabled="dialogStatus === 'update'"
  1949. @change="changePasture"
  1950. >
  1951. <el-option
  1952. v-for="item in findAllPasture"
  1953. :key="item.id"
  1954. :label="item.name"
  1955. :value="item.id"
  1956. />
  1957. </el-select>
  1958. </el-form-item>
  1959. </el-col>
  1960. </el-row>
  1961. </el-form>
  1962. <span
  1963. v-if="modifyTemp.purchase_type == 1"
  1964. style="float: right; font-size: 16px; margin-bottom: 10px"
  1965. >总金额:{{ modifyTemp.sumPrices }}</span>
  1966. <el-table
  1967. :key="tableKey"
  1968. v-loading="listLoading"
  1969. element-loading-text="给我一点时间"
  1970. :data="modifylist"
  1971. border
  1972. fit
  1973. highlight-current-row
  1974. style="width: 100%; margin-bottom: 30px"
  1975. :row-style="rowStyle"
  1976. :cell-style="cellStyle"
  1977. class="elTable"
  1978. >
  1979. <!-- table表格 -->
  1980. <el-table-column
  1981. label="序号"
  1982. align="center"
  1983. type="index"
  1984. width="50px"
  1985. />
  1986. <el-table-column
  1987. label="备件编号"
  1988. prop="partCode"
  1989. align="center"
  1990. min-width="90"
  1991. />
  1992. <el-table-column
  1993. label="备件名称"
  1994. prop="partName"
  1995. align="center"
  1996. min-width="90"
  1997. />
  1998. <el-table-column
  1999. label="备件规格"
  2000. prop="specification"
  2001. min-width="80px"
  2002. align="center"
  2003. />
  2004. <el-table-column
  2005. label="供应商"
  2006. prop="providerName"
  2007. align="center"
  2008. min-width="60"
  2009. />
  2010. <el-table-column
  2011. label="备件品牌"
  2012. prop="brandName"
  2013. align="center"
  2014. min-width="60"
  2015. />
  2016. <el-table-column
  2017. label="计量单位"
  2018. prop="unit"
  2019. align="center"
  2020. min-width="60"
  2021. />
  2022. <el-table-column
  2023. label="现有库存"
  2024. prop="reportery"
  2025. align="center"
  2026. min-width="60"
  2027. />
  2028. <el-table-column
  2029. label="价格"
  2030. prop="price"
  2031. align="center"
  2032. min-width="150"
  2033. >
  2034. <template slot-scope="scope">
  2035. <div v-for="item in scope.row.pricearr">
  2036. <el-tooltip class="item" effect="dark" placement="top-start">
  2037. <div slot="content">{{ item }}</div>
  2038. <div
  2039. style="
  2040. overflow: hidden;
  2041. white-space: nowrap;
  2042. text-overflow: ellipsis;
  2043. "
  2044. >
  2045. {{ item }}
  2046. </div>
  2047. </el-tooltip>
  2048. </div>
  2049. </template>
  2050. </el-table-column>
  2051. <el-table-column
  2052. v-if="
  2053. modifyTemp.purchase_type !== 1 && modifyTemp.purchase_type !== 3
  2054. "
  2055. label="使用周期"
  2056. min-width="120px"
  2057. align="center"
  2058. >
  2059. <template slot-scope="scope">
  2060. <div v-for="item in scope.row.lifeCyclearr">
  2061. <el-tooltip class="item" effect="dark" placement="top-start">
  2062. <div slot="content">{{ item }}</div>
  2063. <div
  2064. style="
  2065. overflow: hidden;
  2066. white-space: nowrap;
  2067. text-overflow: ellipsis;
  2068. "
  2069. >
  2070. {{ item }}
  2071. </div>
  2072. </el-tooltip>
  2073. </div>
  2074. </template>
  2075. </el-table-column>
  2076. <el-table-column
  2077. v-if="
  2078. modifyTemp.purchase_type !== 1 && modifyTemp.purchase_type !== 3
  2079. "
  2080. label="合同差异项"
  2081. min-width="120px"
  2082. align="center"
  2083. >
  2084. <template slot-scope="scope">
  2085. <div v-for="item in scope.row.contractVarianceItemarr">
  2086. <el-tooltip class="item" effect="dark" placement="top-start">
  2087. <div slot="content">{{ item }}</div>
  2088. <div
  2089. style="
  2090. overflow: hidden;
  2091. white-space: nowrap;
  2092. text-overflow: ellipsis;
  2093. "
  2094. >
  2095. {{ item }}
  2096. </div>
  2097. </el-tooltip>
  2098. </div>
  2099. </template>
  2100. </el-table-column>
  2101. <el-table-column
  2102. label="部门"
  2103. prop="departmentName"
  2104. align="center"
  2105. min-width="60"
  2106. />
  2107. <el-table-column
  2108. label="申购人"
  2109. prop="empname"
  2110. align="center"
  2111. min-width="60"
  2112. />
  2113. <el-table-column
  2114. label="申购日期"
  2115. prop="date"
  2116. align="center"
  2117. min-width="60"
  2118. />
  2119. <el-table-column
  2120. label="备注"
  2121. min-width="110px"
  2122. align="center"
  2123. valign="middle"
  2124. prop="purpose"
  2125. />
  2126. <el-table-column
  2127. label="操作"
  2128. align="center"
  2129. width="100"
  2130. class-name="small-padding fixed-width"
  2131. fixed="right"
  2132. >
  2133. <template slot-scope="{ row }">
  2134. <a class="del" @click="partReject(row)">驳回</a>
  2135. </template>
  2136. </el-table-column>
  2137. </el-table>
  2138. </div>
  2139. <div slot="footer" class="dialog-footer">
  2140. <el-button
  2141. type="primary"
  2142. :disabled="isokDisable"
  2143. @click="form_modify()"
  2144. >提交</el-button>
  2145. <el-button @click="dialogFormVisible_modify = false">取消</el-button>
  2146. </div>
  2147. </el-dialog>
  2148. <el-dialog
  2149. :title="textMap[dialogStatus]"
  2150. :visible.sync="dialogFormVisibleSee1"
  2151. :close-on-click-modal="false"
  2152. width="90%"
  2153. ref="dialogFormVisibleSeeRef5"
  2154. >
  2155. <div class="app-containerSee">
  2156. <el-form
  2157. ref="seeTemp"
  2158. :rules="rules"
  2159. :model="seeTemp"
  2160. label-position="right"
  2161. label-width="100px"
  2162. style="width: 90%; margin: 0 auto"
  2163. >
  2164. <el-row>
  2165. <el-col :span="8">
  2166. <el-form-item label="申购单号:" prop="orderNumber">
  2167. <el-input
  2168. ref="orderNumber"
  2169. v-model="seeTemp.orderNumber"
  2170. disabled
  2171. />
  2172. </el-form-item>
  2173. </el-col>
  2174. <el-col :span="8">
  2175. <el-form-item label="牧场:" prop="pastureId">
  2176. <el-select
  2177. v-model="seeTemp.pastureId"
  2178. placeholder="牧场"
  2179. class="filter-item"
  2180. disabled
  2181. style="width: 100%"
  2182. >
  2183. <el-option
  2184. v-for="item in findAllPasture"
  2185. :key="item.id"
  2186. :label="item.name"
  2187. :value="item.id"
  2188. />
  2189. </el-select>
  2190. </el-form-item>
  2191. </el-col>
  2192. </el-row>
  2193. </el-form>
  2194. <span
  2195. v-if="seeTemp.purchase_type == 1"
  2196. style="float: right; font-size: 16px; margin-bottom: 10px"
  2197. >总金额:{{ seeTemp.sumPrices }}</span>
  2198. <el-table
  2199. :key="tableKey"
  2200. v-loading="listLoadingSee"
  2201. element-loading-text="给我一点时间"
  2202. :data="listSee"
  2203. border
  2204. fit
  2205. highlight-current-row
  2206. style="width: 100%; margin-bottom: 30px"
  2207. :row-style="rowStyle"
  2208. :cell-style="cellStyle"
  2209. class="elTable"
  2210. @sort-change="tableSort"
  2211. >
  2212. <el-table-column
  2213. type="index"
  2214. label="序号"
  2215. align="center"
  2216. width="50px"
  2217. />
  2218. <el-table-column
  2219. label="备件编号"
  2220. prop="partCode"
  2221. align="center"
  2222. min-width="90"
  2223. />
  2224. <el-table-column
  2225. label="备件名称"
  2226. prop="partName"
  2227. align="center"
  2228. min-width="90"
  2229. />
  2230. <el-table-column
  2231. label="备件规格"
  2232. prop="specification"
  2233. min-width="90px"
  2234. align="center"
  2235. />
  2236. <el-table-column
  2237. label="供应商"
  2238. prop="providerName"
  2239. align="center"
  2240. min-width="60"
  2241. />
  2242. <el-table-column
  2243. label="备件品牌"
  2244. prop="brandName"
  2245. align="center"
  2246. min-width="60"
  2247. />
  2248. <el-table-column
  2249. label="计量单位"
  2250. prop="unit"
  2251. align="center"
  2252. min-width="60"
  2253. />
  2254. <el-table-column
  2255. label="现有库存"
  2256. sortable
  2257. prop="storageAmount"
  2258. align="center"
  2259. min-width="60"
  2260. />
  2261. <el-table-column
  2262. label="申购数量"
  2263. sortable
  2264. prop="amount"
  2265. align="center"
  2266. min-width="60"
  2267. />
  2268. <el-table-column label="价格" min-width="110px" align="center">
  2269. <template slot-scope="scope">
  2270. <div
  2271. v-for="item in scope.row.pricearr"
  2272. style="
  2273. overflow: hidden;
  2274. white-space: nowrap;
  2275. text-overflow: ellipsis;
  2276. "
  2277. >
  2278. <el-tooltip class="item" effect="dark" placement="top-start">
  2279. <div slot="content">{{ item }}</div>
  2280. <div
  2281. style="
  2282. overflow: hidden;
  2283. white-space: nowrap;
  2284. text-overflow: ellipsis;
  2285. "
  2286. >
  2287. {{ item }}
  2288. </div>
  2289. </el-tooltip>
  2290. </div>
  2291. </template>
  2292. </el-table-column>
  2293. <el-table-column
  2294. v-if="seeTemp.purchase_type !== 1 && seeTemp.purchase_type !== 3"
  2295. label="使用周期"
  2296. min-width="100px"
  2297. align="center"
  2298. >
  2299. <template slot-scope="scope">
  2300. <div
  2301. v-for="item in scope.row.lifeCyclearr"
  2302. style="
  2303. overflow: hidden;
  2304. white-space: nowrap;
  2305. text-overflow: ellipsis;
  2306. "
  2307. >
  2308. <el-tooltip class="item" effect="dark" placement="top-start">
  2309. <div slot="content">{{ item }}</div>
  2310. <div
  2311. style="
  2312. overflow: hidden;
  2313. white-space: nowrap;
  2314. text-overflow: ellipsis;
  2315. "
  2316. >
  2317. {{ item }}
  2318. </div>
  2319. </el-tooltip>
  2320. </div>
  2321. </template>
  2322. </el-table-column>
  2323. <el-table-column
  2324. v-if="seeTemp.purchase_type !== 1 && seeTemp.purchase_type !== 3"
  2325. label="合同差异项"
  2326. min-width="100px"
  2327. align="center"
  2328. >
  2329. <template slot-scope="scope">
  2330. <div
  2331. v-for="item in scope.row.contractVarianceItemarr"
  2332. style="
  2333. overflow: hidden;
  2334. white-space: nowrap;
  2335. text-overflow: ellipsis;
  2336. "
  2337. >
  2338. <el-tooltip class="item" effect="dark" placement="top-start">
  2339. <div slot="content">{{ item }}</div>
  2340. <div
  2341. style="
  2342. overflow: hidden;
  2343. white-space: nowrap;
  2344. text-overflow: ellipsis;
  2345. "
  2346. >
  2347. {{ item }}
  2348. </div>
  2349. </el-tooltip>
  2350. </div>
  2351. </template>
  2352. </el-table-column>
  2353. <el-table-column
  2354. label="部门"
  2355. sortable
  2356. prop="departmentName"
  2357. align="center"
  2358. min-width="80"
  2359. />
  2360. <el-table-column
  2361. label="申购人"
  2362. sortable
  2363. prop="empname"
  2364. align="center"
  2365. min-width="60"
  2366. />
  2367. <el-table-column
  2368. label="申购日期"
  2369. sortable
  2370. prop="date"
  2371. align="center"
  2372. min-width="100"
  2373. />
  2374. <el-table-column
  2375. label="备注"
  2376. min-width="110px"
  2377. align="center"
  2378. prop="purpose"
  2379. />
  2380. </el-table>
  2381. <el-form
  2382. ref="seeTemp"
  2383. :rules="rules"
  2384. :model="seeTemp"
  2385. label-position="right"
  2386. label-width="100px"
  2387. style="width: 90%; margin: 0 auto"
  2388. >
  2389. <el-row>
  2390. <el-col>
  2391. <el-form-item label="流程进度" />
  2392. <el-steps :active="active" align-center finish-status="success">
  2393. <el-step
  2394. v-for="(item, index) in activeList"
  2395. :key="index"
  2396. :title="item.title"
  2397. :status="item.status"
  2398. >
  2399. <template slot="description">
  2400. <div class="step-row">
  2401. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  2402. <div>{{ item.reason }}</div>
  2403. </div>
  2404. </template>
  2405. </el-step>
  2406. </el-steps>
  2407. </el-col>
  2408. </el-row>
  2409. <el-row>
  2410. <el-col>
  2411. <el-form-item label="操作:">
  2412. <!-- 库管 -->
  2413. <el-button
  2414. v-if="
  2415. isSubscribeExamineKG &&
  2416. seeTemp.statue == 2 &&
  2417. (seeTemp.departmentName == '挤奶处' && seeTemp.isPasturd)
  2418. "
  2419. type="success"
  2420. style="display: inline-block"
  2421. @click="handleExamine1(row)"
  2422. >审核</el-button>
  2423. <!-- 设备 -->
  2424. <el-button
  2425. v-if="isSubscribeExamineSBZG && seeTemp.statue == 3 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )"
  2426. type="success"
  2427. style="display: inline-block"
  2428. @click="handleExamine2(row)"
  2429. >审核</el-button>
  2430. <!-- 供应商主管 -->
  2431. <el-button
  2432. v-if="isSubscribeExamineZG && seeTemp.statue == 9 && seeTemp.isPasturd"
  2433. type="success"
  2434. style="display: inline-block"
  2435. @click="handleExamine3(row)"
  2436. >审核</el-button>
  2437. <!-- 场长 -->
  2438. <el-button
  2439. v-if="
  2440. sdchangzhangshenhe &&
  2441. seeTemp.statue == 5 &&
  2442. seeTemp.departmentName == '挤奶处' &&
  2443. seeTemp.examine == 1 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  2444. "
  2445. type="success"
  2446. style="display: inline-block"
  2447. @click="handleExamine4(row)"
  2448. >审核</el-button>
  2449. <el-button
  2450. v-else-if="
  2451. sdchangzhangshenhe &&
  2452. seeTemp.statue == 5 &&
  2453. seeTemp.departmentName !== '挤奶处' && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  2454. "
  2455. type="success"
  2456. style="display: inline-block"
  2457. @click="handleExamine4(row)"
  2458. >审核</el-button>
  2459. <!-- 采购 -->
  2460. <el-button
  2461. v-if="isSubscribeExamineCG && (seeTemp.statue == 11 || (seeTemp.departmentName == '挤奶处' && seeTemp.statue == 15)) && seeTemp.isPasturd"
  2462. type="success"
  2463. style="display: inline-block"
  2464. @click="handleExamine5(row)"
  2465. >审核</el-button>
  2466. <!-- 财务 -->
  2467. <el-button
  2468. v-if="
  2469. isSubscribeExamineCW &&
  2470. seeTemp.purchase_type == 1 &&
  2471. seeTemp.statue == 7 && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  2472. "
  2473. style="display: inline-block"
  2474. type="success"
  2475. @click="handleExamine6(row)"
  2476. >审核</el-button>
  2477. <!-- 奶厅 -->
  2478. <el-button
  2479. v-if="
  2480. isSubscribeExamineNT &&
  2481. seeTemp.departmentName == '挤奶处' &&
  2482. ((seeTemp.examine !== 1 && seeTemp.statue == 5) ||
  2483. seeTemp.statue == 11) && (!seeTemp.isPasturd || seeTemp.isRolePasturd )
  2484. "
  2485. style="display: inline-block"
  2486. type="success"
  2487. @click="handleExamine7(row)"
  2488. >审核</el-button>
  2489. </el-form-item>
  2490. </el-col>
  2491. </el-row>
  2492. </el-form>
  2493. <div slot="footer" class="dialog-footer" style="bottom: 5px">
  2494. <el-button @click="dialogFormVisibleSee1 = false">关闭</el-button>
  2495. </div>
  2496. </div>
  2497. </el-dialog>
  2498. </div>
  2499. </template>
  2500. <script>
  2501. // / 引入
  2502. import {
  2503. GetDataByName,
  2504. postJson,
  2505. GetDataByNames,
  2506. partslistSGv2,
  2507. PostDataByName,
  2508. ExecDataByConfig,
  2509. checkButtons,
  2510. failproccess,
  2511. GetAccount
  2512. } from '@/api/common'
  2513. import waves from '@/directive/waves' // waves directive
  2514. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  2515. // eslint-disable-next-line no-unused-vars
  2516. import { validateEMail } from '@/utils/validate.js'
  2517. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  2518. import { MessageBox } from 'element-ui'
  2519. import Cookies from 'js-cookie'
  2520. import { getToken } from '@/utils/auth'
  2521. export default {
  2522. name: 'Subscribe',
  2523. components: { Pagination },
  2524. directives: { waves },
  2525. inject: ['reload'],
  2526. data() {
  2527. return {
  2528. providerNames: '',
  2529. isSubscribeAdd: [],
  2530. isSubscribeSpecial: [],
  2531. isSubscribeExamineSBZG: [],
  2532. isSubscribeTemplate: [],
  2533. isSubscribeImport: [],
  2534. isSubscribeExport: [],
  2535. isSubscribeSee: [],
  2536. isSubscribeDelete: [],
  2537. isSubscribeExamineKG: [],
  2538. isSubscribeExamineCG: [],
  2539. isSubscribeExamineCW: [],
  2540. isSubscribeExamineZG: [],
  2541. isSubscribeExamineNT: [],
  2542. sdchangzhangshenhe: [],
  2543. isSubscribeMilk: [],
  2544. isokDisable: false,
  2545. findAllProvider: [],
  2546. findAllPasture: [],
  2547. findAllDepart: [],
  2548. findAllEmploye: [],
  2549. subscriptionStatusList: [
  2550. { id: 0, name: '新增申购' },
  2551. { id: 1, name: '暂估申购' },
  2552. { id: 3, name: '赠品申购' },
  2553. { id: 4, name: '奶厅申购' }
  2554. ], // 申购状态
  2555. onlineSubscriptionList: [],
  2556. createDepartList: [],
  2557. edit: 0,
  2558. requestParams: [
  2559. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  2560. {
  2561. name: 'findAllMainPasture',
  2562. offset: 0,
  2563. pagecount: 0,
  2564. returntype: 'Map',
  2565. parammaps: { id: Cookies.get('pastureid') }
  2566. },
  2567. {
  2568. name: 'findAllEmploye',
  2569. offset: 0,
  2570. pagecount: 0,
  2571. parammaps: { pastureId: Cookies.get('pastureid') }
  2572. },
  2573. { name: 'getflexProviderList', offset: 0, pagecount: 0, parammaps: {}}
  2574. ],
  2575. getDepartParam: {
  2576. name: 'findAllDepart',
  2577. offset: 0,
  2578. pagecount: 0,
  2579. parammaps: {
  2580. pastureId: Cookies.get('pastureid'),
  2581. eId: Cookies.get('employeid')
  2582. }
  2583. },
  2584. pickerOptions: {
  2585. disabledDate(time) {
  2586. return time.getTime() > Date.now() // 当天之前的时间可选
  2587. }
  2588. },
  2589. textMap: {
  2590. update: '编辑',
  2591. create: '新增',
  2592. see: '查看',
  2593. examine1: '库管审核',
  2594. examine2: '设备主管审核',
  2595. examine3: '供应商主管审核',
  2596. examine4: '场长审核',
  2597. examine5: '采购审核',
  2598. examine6: '财务审核',
  2599. examine7: '职能中心审核',
  2600. special: '特殊申购',
  2601. seepart: '备件申购'
  2602. },
  2603. rules: {
  2604. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
  2605. },
  2606. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  2607. cellStyle: { padding: 0 + 'px' },
  2608. statues: [
  2609. { id: '0', name: '审核中' },
  2610. { id: '1', name: '已通过' },
  2611. { id: '2', name: '未通过' }
  2612. ],
  2613. radioAll: '全部',
  2614. getdataListParm: {
  2615. name:'getpartpurchaseList' , // 'getpartpurchaseList',
  2616. page: 1,
  2617. offset: 1,
  2618. pagecount: 50,
  2619. returntype: 'Map',
  2620. parammaps: {
  2621. pastureName: Cookies.get('pasturename'),
  2622. pastureArr:[],
  2623. empId: Cookies.get('employeid'),
  2624. orderNumber: '',
  2625. stuteSH: '',
  2626. departmentId: '',
  2627. inputDatetime: '',
  2628. startTime: '',
  2629. stopTime: '',
  2630. loginId: Cookies.get('employeid'),
  2631. menu: 'Subscribe',
  2632. logindeptId: Cookies.get('departmentid'),
  2633. loginpastureId: Cookies.get('pastureid'),
  2634. purchase_type: ''
  2635. }
  2636. },
  2637. tableKey: 0,
  2638. listLoading: true,
  2639. total: 0,
  2640. list: [],
  2641. dialogStatus: '',
  2642. dialogFormVisible: false,
  2643. dialogFormVisible_milk: false,
  2644. dialogFormVisible2: false,
  2645. dialogFormVisibleSee: false,
  2646. dialogFormVisibleSee1: false,
  2647. listLoadingSee: true,
  2648. listSee: [],
  2649. totalSee: 0,
  2650. seeTemp: {},
  2651. getdataListSee: {
  2652. name: 'getpartpurchaseBybig',
  2653. returntype: 'Map',
  2654. parammaps: {}
  2655. },
  2656. createTemp: {
  2657. pastureId: this.$store.state.user.pastureid,
  2658. departmentId: this.$store.state.user.departmentid,
  2659. employeId: this.$store.state.user.employeid,
  2660. createTime: parseTime(new Date(), '{y}-{m}-{d}'),
  2661. providerId: '',
  2662. purchaseType: '1',
  2663. funderId: '',
  2664. partCode: ''
  2665. },
  2666. requestSparePart: {
  2667. name: 'getPartsListSG',
  2668. page: 1,
  2669. offset: 1,
  2670. pagecount: 20,
  2671. returntype: 'Map',
  2672. parammaps: {
  2673. pastureId: Cookies.get('pastureid')
  2674. }
  2675. },
  2676. getParmCreateNumber: {
  2677. name: 'autoCreatCode',
  2678. page: 0,
  2679. offset: 0,
  2680. pagecount: 0,
  2681. returntype: 'Map',
  2682. parammaps: {
  2683. pastureId: Cookies.get('pastureid'),
  2684. codeType: 'SG'
  2685. }
  2686. },
  2687. getParmCreateAmount: {
  2688. name: 'getPartsListSGv2',
  2689. page: 0,
  2690. offset: 0,
  2691. pagecount: 0,
  2692. returntype: 'Map',
  2693. parammaps: {
  2694. pastureId: Cookies.get('pastureid'),
  2695. pastureName: Cookies.get('pasturename')
  2696. }
  2697. },
  2698. listAdd: [],
  2699. postDataPramas: {},
  2700. requestParam: {
  2701. parammaps: { partCode: '' }
  2702. },
  2703. dialogFormVisible_Examine: false,
  2704. examineTemp: {
  2705. statue: 1
  2706. },
  2707. statueReason: false,
  2708. activeList: [],
  2709. active: 3,
  2710. buttons: [],
  2711. downloadParam: {},
  2712. isPercentage: false,
  2713. percentage: 1,
  2714. pending: {
  2715. total: 0,
  2716. getdataListParm: {
  2717. name: 'getpartpurchaseWebListNO',
  2718. page: 1,
  2719. offset: 1,
  2720. getTotal: 'total3',
  2721. pagecount: 50,
  2722. returntype: 'Map',
  2723. parammaps: {
  2724. loginId: Cookies.get('employeid'),
  2725. menu: 'Subscribe',
  2726. logindeptId: Cookies.get('departmentid'),
  2727. loginpastureId: Cookies.get('pastureid'),
  2728. empId: Cookies.get('employeid'),
  2729. pastureId: Cookies.get('pastureid'),
  2730. deptId: Cookies.get('departmentid')
  2731. }
  2732. }
  2733. },
  2734. providerList: [],
  2735. dialogFormVisible_seepart: false,
  2736. seepartList: [],
  2737. seepart: {
  2738. tableKey: 0,
  2739. listLoading: true,
  2740. total: 0,
  2741. getdataListParm: {
  2742. page: 1,
  2743. offset: 1,
  2744. pagecount: 50,
  2745. name: 'getIdleSpareParts',
  2746. parammaps: {
  2747. partName: '',
  2748. pastureArr:[],
  2749. }
  2750. }
  2751. },
  2752. apply_subscribeData: {},
  2753. isApplyEx4: true,
  2754. isMilk: false, // 标记是不是奶厅申购
  2755. myHeight: document.documentElement.clientHeight - 85 - 150,
  2756. dialogFormVisible_modify: false,
  2757. modifyTemp: {
  2758. orderNumber: ''
  2759. },
  2760. modifylist: [{}],
  2761. requestBrand: {
  2762. name: 'getBrandByPartCode',
  2763. page: 0,
  2764. offset: 0,
  2765. pagecount: 50,
  2766. returntype: 'Map',
  2767. parammaps: {}
  2768. },
  2769. BrandList: [],
  2770. isDepartmentId: false ,// 部门是挤奶处且点击新增按钮
  2771. isPasturd: false, // 不是赛四权限
  2772. isRolePasturd: false, // 是赛四所有权限
  2773. }
  2774. },
  2775. created() {
  2776. const that = this
  2777. GetDataByName({
  2778. name: 'getUserPCButtons',
  2779. parammaps: { jwt_username: Cookies.get('name') }
  2780. }).then((response) => {
  2781. that.buttons = response.data.list;
  2782. that.get_auto_buttons()
  2783. })
  2784. this.get_select_list()
  2785. // this.get_table_data()
  2786. this.getPendingList()
  2787. this.getProviderList()
  2788. console.log(this.$store.state.user,'user')
  2789. },
  2790. methods: {
  2791. // 关闭查看弹窗
  2792. handleCancel() {
  2793. this.dialogFormVisibleSee = false;
  2794. this.reload()// 需要刷新页面
  2795. this.get_table_data()
  2796. },
  2797. tableSort(column) {
  2798. sortChange(column, this.listSee)
  2799. },
  2800. get_auto_buttons() {
  2801. // 新增
  2802. const SubscribeAdd = 'customs:subscribe:add'
  2803. const isSubscribeAdd = checkButtons(
  2804. this.$store.state.user.buttons,
  2805. SubscribeAdd
  2806. )
  2807. this.isSubscribeAdd = isSubscribeAdd
  2808. // isSubscribeSpecial
  2809. // 特殊申购
  2810. const SubscribeSpecial = 'customs:subscribe:special'
  2811. const isSubscribeSpecial = checkButtons(
  2812. this.$store.state.user.buttons,
  2813. SubscribeSpecial
  2814. )
  2815. this.isSubscribeSpecial = isSubscribeSpecial
  2816. // 奶厅申购
  2817. const SubscribeMilk = 'customs:subscribe:milk'
  2818. const isSubscribeMilk = checkButtons(
  2819. this.$store.state.user.buttons,
  2820. SubscribeMilk
  2821. )
  2822. this.isSubscribeMilk = isSubscribeMilk
  2823. // 模板
  2824. // eslint-disable-next-line no-redeclare
  2825. const SubscribeTemplate = 'customs:subscribe:template'
  2826. const isSubscribeTemplate = checkButtons(
  2827. this.$store.state.user.buttons,
  2828. SubscribeTemplate
  2829. )
  2830. this.isSubscribeTemplate = isSubscribeTemplate
  2831. // 导入
  2832. // eslint-disable-next-line no-redeclare
  2833. const SubscribeImport = 'customs:subscribe:import'
  2834. const isSubscribeImport = checkButtons(
  2835. this.$store.state.user.buttons,
  2836. SubscribeImport
  2837. )
  2838. this.isSubscribeImport = isSubscribeImport
  2839. // 导出
  2840. // eslint-disable-next-line no-redeclare
  2841. const SubscribeExport = 'customs:subscribe:export'
  2842. const isSubscribeExport = checkButtons(
  2843. this.$store.state.user.buttons,
  2844. SubscribeExport
  2845. )
  2846. this.isSubscribeExport = isSubscribeExport
  2847. // 查看
  2848. // eslint-disable-next-line no-redeclare
  2849. const SubscribeSee = 'customs:subscribe:see'
  2850. const isSubscribeSee = checkButtons(
  2851. this.$store.state.user.buttons,
  2852. SubscribeSee
  2853. )
  2854. this.isSubscribeSee = isSubscribeSee
  2855. // 删除
  2856. // eslint-disable-next-line no-redeclare
  2857. const SubscribeDelete = 'customs:subscribe:delete'
  2858. const isSubscribeDelete = checkButtons(
  2859. this.$store.state.user.buttons,
  2860. SubscribeDelete
  2861. )
  2862. this.isSubscribeDelete = isSubscribeDelete
  2863. // 库管审核
  2864. // eslint-disable-next-line no-redeclare
  2865. const SubscribeExamineKG = 'customs:subscribe:examineKG'
  2866. const isSubscribeExamineKG = checkButtons(
  2867. this.$store.state.user.buttons,
  2868. SubscribeExamineKG
  2869. )
  2870. this.isSubscribeExamineKG = isSubscribeExamineKG
  2871. console.log( this.isSubscribeExamineKG,'SubscribeExamineKGSubscribeExamineKG')
  2872. // 设备主管审核
  2873. const SubscribeExamineSBZG = 'customs:subscribe:examineSBZG'
  2874. const isSubscribeExamineSBZG = checkButtons(
  2875. this.$store.state.user.buttons,
  2876. SubscribeExamineSBZG
  2877. )
  2878. this.isSubscribeExamineSBZG = isSubscribeExamineSBZG
  2879. // 主管审核
  2880. // eslint-disable-next-line no-redeclare
  2881. const SubscribeExamineZG = 'customs:subscribe:examineZG'
  2882. const isSubscribeExamineZG = checkButtons(
  2883. this.$store.state.user.buttons,
  2884. SubscribeExamineZG
  2885. )
  2886. this.isSubscribeExamineZG = isSubscribeExamineZG
  2887. const changzhangshenhe = 'changzhangshenhe'
  2888. const sdchangzhangshenhe = checkButtons(
  2889. this.$store.state.user.buttons,
  2890. changzhangshenhe
  2891. )
  2892. this.sdchangzhangshenhe = sdchangzhangshenhe
  2893. // 采购审核
  2894. // eslint-disable-next-line no-redeclare
  2895. const SubscribeExamineCG = 'customs:subscribe:examineCG'
  2896. const isSubscribeExamineCG = checkButtons(
  2897. this.$store.state.user.buttons,
  2898. SubscribeExamineCG
  2899. )
  2900. this.isSubscribeExamineCG = isSubscribeExamineCG
  2901. // 财务审核
  2902. const SubscribeExamineCW = 'customs:subscribe:examineCW'
  2903. const isSubscribeExamineCW = checkButtons(
  2904. this.$store.state.user.buttons,
  2905. SubscribeExamineCW
  2906. )
  2907. this.isSubscribeExamineCW = isSubscribeExamineCW
  2908. // 财务审核
  2909. const SubscribeExamineNT = 'customs:subscribe:examineNT'
  2910. const isSubscribeExamineNT = checkButtons(
  2911. this.$store.state.user.buttons,
  2912. SubscribeExamineNT
  2913. )
  2914. this.isSubscribeExamineNT = isSubscribeExamineNT
  2915. },
  2916. getPendingList() {
  2917. this.pending.getdataListParm.parammaps.pastureName =
  2918. this.getdataListParm.parammaps.pastureName
  2919. this.pending.getdataListParm.parammaps.orderNumber =
  2920. this.getdataListParm.parammaps.orderNumber
  2921. this.pending.getdataListParm.parammaps.stuteSH =
  2922. this.getdataListParm.parammaps.stuteSH
  2923. this.pending.getdataListParm.parammaps.departmentId =
  2924. this.getdataListParm.parammaps.departmentId
  2925. this.pending.getdataListParm.parammaps.inputDatetime =
  2926. this.getdataListParm.parammaps.inputDatetime
  2927. this.pending.getdataListParm.parammaps.loginId =
  2928. this.getdataListParm.parammaps.loginId
  2929. this.pending.getdataListParm.parammaps.menu =
  2930. this.getdataListParm.parammaps.menu
  2931. this.pending.getdataListParm.parammaps.logindeptId =
  2932. this.getdataListParm.parammaps.logindeptId
  2933. this.pending.getdataListParm.parammaps.loginpastureId =
  2934. this.getdataListParm.parammaps.loginpastureId
  2935. this.pending.getdataListParm.parammaps.empId =
  2936. this.getdataListParm.parammaps.empId
  2937. this.pending.getdataListParm.parammaps.pastureId = this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid')
  2938. this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
  2939. GetDataByName(this.pending.getdataListParm).then((response) => {
  2940. this.pending.total = response.data.total3
  2941. })
  2942. },
  2943. get_table_data() {
  2944. this.listLoading = true
  2945. if (
  2946. this.$refs['inputDatetime'] !== undefined &&
  2947. this.$refs['inputDatetime'].value !== null
  2948. ) {
  2949. this.getdataListParm.parammaps.startTime =
  2950. this.$refs['inputDatetime'].value[0]
  2951. this.getdataListParm.parammaps.stopTime =
  2952. this.$refs['inputDatetime'].value[1]
  2953. } else {
  2954. this.getdataListParm.parammaps.startTime = ''
  2955. this.getdataListParm.parammaps.stopTime = ''
  2956. }
  2957. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  2958. if (this.getdataListParm.parammaps.pastureArr && this.getdataListParm.parammaps.pastureArr.length > 0) {
  2959. const arr = this.findAllPasture.filter((item) => {
  2960. if (this.getdataListParm.parammaps.pastureArr.includes(item.name)) {
  2961. return item
  2962. }
  2963. })
  2964. const ids = arr.map((child) => { return child.id })
  2965. console.log(arr,ids,'999999')
  2966. this.getdataListParm.parammaps.pastureId = ids.toString();
  2967. }
  2968. GetDataByName(this.getdataListParm).then((response) => {
  2969. if (response.data.list !== null) {
  2970. console.log('table数据', response.data.list)
  2971. this.list = response.data.list.map((item) => {
  2972. item.isPasturd = false
  2973. item.isRolePasturd = false
  2974. // this.$set(item,isPasturd,false );
  2975. // this.$set(item,isRolePasturd,false );
  2976. // 如果当前登陆者是订单的负责人,则展示审核按钮,否则不展示
  2977. // 如果不是赛四 不可库管审核
  2978. // 如果是设备 可审核
  2979. if( item.pastureId != Cookies.get('pastureid') ) {
  2980. item.isPasturd = true
  2981. item.isRolePasturd = false
  2982. } else if (item.pastureId == Cookies.get('mainpasture')) {
  2983. item.isPasturd = true
  2984. item.isRolePasturd = true
  2985. }else {
  2986. item.isPasturd = false
  2987. item.isRolePasturd = false
  2988. }
  2989. return item;
  2990. })
  2991. this.pageNum = response.data.pageNum
  2992. this.pageSize = response.data.pageSize
  2993. } else {
  2994. this.list = []
  2995. }
  2996. this.total = response.data.total
  2997. console.log(this.list,'list-----')
  2998. setTimeout(() => {
  2999. this.listLoading = false
  3000. }, 100)
  3001. })
  3002. },
  3003. changeAll() {
  3004. console.log(this.radioAll)
  3005. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  3006. if (this.getdataListParm.parammaps.pastureArr && this.getdataListParm.parammaps.pastureArr.length > 0) {
  3007. const arr = this.findAllPasture.filter((item) => {
  3008. if (this.getdataListParm.parammaps.pastureArr.includes(item.name)) {
  3009. return item
  3010. }
  3011. })
  3012. const ids = arr.map((child) => { return child.id })
  3013. console.log(arr,ids,'999999')
  3014. this.getdataListParm.parammaps.pastureId = ids.toString();
  3015. }
  3016. if (this.radioAll === '全部') {
  3017. this.getdataListParm.name = 'getpartpurchaseList'
  3018. this.getdataListParm.offset = 1
  3019. this.getdataListParm.parammaps = {
  3020. pastureName: Cookies.get('pasturename'),
  3021. orderNumber: '',
  3022. departmentId: '',
  3023. inputDatetime: '',
  3024. startTime: '',
  3025. stopTime: '',
  3026. loginId: Cookies.get('employeid'),
  3027. menu: 'Subscribe',
  3028. logindeptId: Cookies.get('departmentid'),
  3029. loginpastureId: Cookies.get('pastureid'),
  3030. pastureId:this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid'),
  3031. pastureArr :this.getdataListParm.parammaps.pastureArr,
  3032. }
  3033. this.get_table_data()
  3034. } else if (this.radioAll === '待处理') {
  3035. this.getdataListParm.name = 'getpartpurchaseWebListNO'
  3036. this.getdataListParm.offset = 1
  3037. this.getdataListParm.parammaps = {
  3038. pastureName: this.getdataListParm.parammaps.pastureName,
  3039. pastureArr :this.getdataListParm.parammaps.pastureArr,
  3040. orderNumber: this.getdataListParm.parammaps.orderNumber,
  3041. stuteSH: this.getdataListParm.parammaps.stuteSH,
  3042. departmentId: this.getdataListParm.parammaps.departmentId,
  3043. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  3044. startTime: this.getdataListParm.parammaps.startTime,
  3045. stopTime: this.getdataListParm.parammaps.stopTime,
  3046. loginId: Cookies.get('employeid'),
  3047. menu: 'Subscribe',
  3048. logindeptId: Cookies.get('departmentid'),
  3049. loginpastureId: Cookies.get('pastureid'),
  3050. empId: Cookies.get('employeid'),
  3051. pastureId:this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid'),
  3052. deptId: Cookies.get('departmentid')
  3053. }
  3054. this.get_table_data()
  3055. } else if (this.radioAll === '已处理') {
  3056. this.getdataListParm.name = 'getpartpurchaseWebList'
  3057. this.getdataListParm.offset = 1
  3058. this.getdataListParm.parammaps = {
  3059. pastureName: this.getdataListParm.parammaps.pastureName,
  3060. pastureArr :this.getdataListParm.parammaps.pastureArr,
  3061. orderNumber: this.getdataListParm.parammaps.orderNumber,
  3062. stuteSH: this.getdataListParm.parammaps.stuteSH,
  3063. departmentId: this.getdataListParm.parammaps.departmentId,
  3064. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  3065. startTime: this.getdataListParm.parammaps.startTime,
  3066. stopTime: this.getdataListParm.parammaps.stopTime,
  3067. loginId: Cookies.get('employeid'),
  3068. menu: 'Subscribe',
  3069. logindeptId: Cookies.get('departmentid'),
  3070. loginpastureId: Cookies.get('pastureid'),
  3071. empId: Cookies.get('employeid'),
  3072. pastureId:this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid'),
  3073. deptId: Cookies.get('departmentid')
  3074. }
  3075. this.get_table_data()
  3076. }
  3077. },
  3078. statue: function(cellValue) {
  3079. // console.log(cellValue)
  3080. // departmentName
  3081. // purchase_type
  3082. if (cellValue.purchase_type == 1) {
  3083. // 特殊申购-暂估
  3084. if (
  3085. cellValue.statue == 2 ||
  3086. cellValue.statue == 3 ||
  3087. cellValue.statue == 5 ||
  3088. cellValue.statue == 7 ||
  3089. cellValue.statue == 9 ||
  3090. cellValue.statue == 11 ||
  3091. cellValue.statue == 15
  3092. ) {
  3093. return '审核中'
  3094. } else if (cellValue.statue == 13) {
  3095. return '已通过'
  3096. } else {
  3097. return '未通过'
  3098. }
  3099. } else if (cellValue.purchase_type == 3) {
  3100. // 特殊申购-赠品
  3101. return '已通过'
  3102. } else {
  3103. if (
  3104. cellValue.statue == 2 ||
  3105. cellValue.statue == 3 ||
  3106. cellValue.statue == 5 ||
  3107. cellValue.statue == 9 ||
  3108. cellValue.statue == 15 ||
  3109. cellValue.statue == 11
  3110. ) {
  3111. return '审核中'
  3112. } else if (cellValue.statue == 7) {
  3113. return '已通过'
  3114. } else {
  3115. return '未通过'
  3116. }
  3117. }
  3118. },
  3119. form_search() {
  3120. console.log('点击了table搜索')
  3121. if (this.getdataListParm.parammaps.inputDatetime === null) {
  3122. this.getdataListParm.parammaps.inputDatetime = ''
  3123. }
  3124. this.getdataListParm.offset = 1
  3125. this.listLoading = true
  3126. this.get_table_data()
  3127. this.getPendingList()
  3128. },
  3129. resetCreateTemp() {
  3130. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  3131. // 如果获取的部门是挤奶处,在点击新增按钮的时候,是无法让他选择挤奶处,默认申购部门为第一
  3132. this.createTemp.departmentId = parseInt(Cookies.get('departmentid')) // departmentId
  3133. this.createTemp.departmentName = Cookies.get('departmentname')
  3134. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  3135. this.createTemp.createTime = parseTime(
  3136. new Date(),
  3137. '{y}-{m}-{d} {h}:{i}:{s}'
  3138. )
  3139. this.createTemp.orderNumber = ''
  3140. this.createTemp.providerId = ''
  3141. this.createTemp.funderId = ''
  3142. this.createTemp.partCode = ''
  3143. // this.requestSparePart.parammaps['partCode'] = ''
  3144. this.$set(this.createTemp, 'partCode', '')
  3145. // this.$set(this.requestSparePart.parammaps,'partCode','')
  3146. this.createTemp.purchaseType = '1'
  3147. this.listAdd = []
  3148. },
  3149. form_add() {
  3150. this.getdataListSee.parammaps.id = ''
  3151. this.textMap.create = '新增'
  3152. this.isMilk = false
  3153. this.seepart.getdataListParm.parammaps.partName = ''
  3154. this.resetCreateTemp()
  3155. this.edit = 1
  3156. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  3157. this.getCreateDepartDownList()
  3158. this.dialogStatus = 'create'
  3159. this.dialogFormVisible = true
  3160. this.dialogFormVisible_seepart = false
  3161. this.$nextTick(() => {
  3162. this.$refs['createTemp'].clearValidate()
  3163. })
  3164. this.getBigPartpurchase(0)
  3165. },
  3166. getBigPartpurchase(type) {
  3167. const data = {
  3168. name: 'getBigPartpurchase',
  3169. parammaps: {
  3170. purchaseType: type,
  3171. pastureId: parseInt(Cookies.get('pastureid'))
  3172. }
  3173. }
  3174. GetDataByName(data).then((response) => {
  3175. console.log(response, 'response=====')
  3176. if (response.data.list && response.data.list.length > 0) {
  3177. this.createTemp.markBackend = true
  3178. this.createTemp.pastureId = response.data.list[0].pastureId
  3179. this.createTemp.orderNumber = response.data.list[0].orderNumber
  3180. this.createTemp.createTime = parseTime(
  3181. new Date(),
  3182. '{y}-{m}-{d} {h}:{i}:{s}'
  3183. )
  3184. this.createTemp.bigId = response.data.list[0].id
  3185. this.getdataListSee.parammaps.id = response.data.list[0].id
  3186. if (this.dialogStatus == 'create') {
  3187. this.getdataListSee.parammaps.purchaseType = 0
  3188. } else if (this.dialogStatus == 'special') {
  3189. if (this.createTemp.purchaseType == '1') {
  3190. this.getdataListSee.parammaps.purchaseType = 1
  3191. }
  3192. }
  3193. this.getdataListSee.parammaps.empId = Cookies.get('employeid')
  3194. this.getSeeList()
  3195. } else {
  3196. this.createTemp.markBackend = false
  3197. this.getCreateNumber()
  3198. if (this.dialogStatus == 'create') {
  3199. this.getdataListSee.parammaps.purchaseType = 0
  3200. this.getdataListSee.parammaps.empId = Cookies.get('employeid')
  3201. this.getSeeList()
  3202. } else if (this.dialogStatus == 'special') {
  3203. if (this.createTemp.purchaseType == '1') {
  3204. this.getdataListSee.parammaps.purchaseType = 1
  3205. this.getdataListSee.parammaps.empId = Cookies.get('employeid')
  3206. this.getSeeList()
  3207. }
  3208. }
  3209. }
  3210. })
  3211. },
  3212. getCreateNumber() {
  3213. GetDataByName(this.getParmCreateNumber).then((response) => {
  3214. this.$nextTick(() => {
  3215. console.log(
  3216. '新增申购单号',
  3217. response.data.list[0].orderCode,
  3218. this.dialogStatus
  3219. )
  3220. if (this.createTemp.purchaseType == 3) {
  3221. console.log(111)
  3222. this.createTemp.orderNumber = response.data.list[0].orderCode
  3223. this.modifyTemp.orderNumber = response.data.list[0].orderCode
  3224. this.$forceUpdate()
  3225. } else if (this.createTemp.purchaseType == 1) {
  3226. console.log(222)
  3227. if (this.createTemp.orderNumber == '') {
  3228. this.createTemp.orderNumber = response.data.list[0].orderCode
  3229. this.modifyTemp.orderNumber = response.data.list[0].orderCode
  3230. this.$forceUpdate()
  3231. }
  3232. } else {
  3233. console.log(333)
  3234. // this.textMap.create = '新增'
  3235. // this.dialogStatus = 'create'
  3236. this.createTemp.orderNumber = response.data.list[0].orderCode
  3237. this.modifyTemp.orderNumber = response.data.list[0].orderCode
  3238. this.$forceUpdate()
  3239. }
  3240. })
  3241. })
  3242. },
  3243. // getPartsListSG
  3244. changeProvider(item) {
  3245. console.log(item, 'item')
  3246. if (item !== '') {
  3247. this.createTemp.providerName = this.onlineSubscriptionList.find(
  3248. (obj) => obj.id == item
  3249. ).providerName
  3250. } else {
  3251. this.$set(this.createTemp, 'providerName', '')
  3252. this.$set(this.createTemp, 'providerId', '')
  3253. }
  3254. // this.listAdd = []
  3255. },
  3256. sparePartSearch(queryString, cb) {
  3257. console.log('备件模糊查询输入值', queryString)
  3258. if (this.dialogStatus === 'special') {
  3259. if (
  3260. this.createTemp.purchaseType == 1 ||
  3261. this.createTemp.purchaseType == '3'
  3262. ) {
  3263. if (this.createTemp.providerId == '') {
  3264. this.$message({ type: 'warning', message: '请选择供应商' })
  3265. return false
  3266. } else {
  3267. if (this.createTemp.purchaseType == '3') {
  3268. this.requestSparePart.name = 'getStockListByGiveaway'
  3269. this.requestSparePart.parammaps['providerName'] =
  3270. this.providerList.find(
  3271. (obj) => obj.id == this.createTemp.providerId
  3272. ).providerName
  3273. this.requestSparePart.parammaps['providerId'] =
  3274. this.createTemp.providerId
  3275. this.requestSparePart.parammaps['pastureId'] =
  3276. this.createTemp.pastureId
  3277. } else if (this.createTemp.purchaseType == '1') {
  3278. this.requestSparePart.name = 'getPartsListSGFlex'
  3279. this.requestSparePart.parammaps.providerId =
  3280. this.createTemp.providerId
  3281. this.requestSparePart.parammaps['providerName'] =
  3282. this.providerList.find(
  3283. (obj) => obj.id == this.createTemp.providerId
  3284. ).providerName
  3285. this.requestSparePart.parammaps.providerName =
  3286. this.createTemp.providerName
  3287. } else {
  3288. this.requestSparePart.name = 'getPartsListSG'
  3289. this.requestSparePart.parammaps['providerId'] =
  3290. this.createTemp.providerId
  3291. }
  3292. }
  3293. }
  3294. } else {
  3295. if (this.createTemp.providerId == '') {
  3296. this.requestSparePart.name = 'getPartsListSG'
  3297. this.requestSparePart.parammaps['providerName'] = ''
  3298. this.requestSparePart.parammaps['providerId'] = ''
  3299. } else {
  3300. this.requestSparePart.name = 'getPartsListSGFlex'
  3301. this.requestSparePart.parammaps.providerId =
  3302. this.createTemp.providerId
  3303. this.requestSparePart.parammaps.providerName =
  3304. this.createTemp.providerName
  3305. }
  3306. }
  3307. this.requestSparePart.parammaps['partCode'] = queryString
  3308. // this.createTemp.partCode = queryString
  3309. this.$set(this.requestSparePart.parammaps, 'partCode', queryString)
  3310. this.$set(this.createTemp, 'partCode', queryString)
  3311. GetDataByName(this.requestSparePart).then((response) => {
  3312. console.log('备件模糊查询搜索data', response.data.list)
  3313. if (response.data.list == null) {
  3314. cb([])
  3315. } else {
  3316. cb(response.data.list)
  3317. }
  3318. })
  3319. },
  3320. brandSearch(queryString, cb) {
  3321. console.log('品牌模糊查询输入值', queryString)
  3322. this.requestBrand.parammaps['brandName'] = queryString
  3323. GetDataByName(this.requestBrand).then((response) => {
  3324. console.log('品牌模糊查询搜索data', response.data.list)
  3325. this.BrandList = response.data.list
  3326. cb(this.BrandList)
  3327. })
  3328. },
  3329. handleSelectBrand(item, row) {
  3330. console.log('品牌模糊查询选中值', item)
  3331. this.$set(row, 'brandName', item.brandName)
  3332. this.$set(row, 'brandId', item.brandId)
  3333. this.$forceUpdate()
  3334. },
  3335. handleSelectSparePart(item) {
  3336. console.log('备件模糊查询选中值', item)
  3337. console.log('备件模糊查询选中值', item.partId)
  3338. console.log(this.listAdd)
  3339. if (
  3340. this.dialogStatus === 'special' &&
  3341. this.createTemp.purchaseType == '1' &&
  3342. this.createTemp.providerId == ''
  3343. ) {
  3344. this.createTemp.providerId = item.providerId
  3345. }
  3346. this.public_select(item)
  3347. },
  3348. apply_subscribe() {
  3349. this.dialogStatus = 'seepart'
  3350. this.seepartList = []
  3351. this.dialogFormVisible_seepart = true
  3352. // 点击新增 判断是否是在 挤奶处 id=46
  3353. this.isDepartmentId = parseInt(Cookies.get('departmentid')) == 46
  3354. },
  3355. seepart_search() {
  3356. this.get_seepart_data()
  3357. },
  3358. get_seepart_data() {
  3359. this.seepart.listLoading = true
  3360. GetDataByName(this.seepart.getdataListParm).then((response) => {
  3361. if (response.data.list !== null) {
  3362. console.log('table数据', response.data.list)
  3363. this.seepartList = response.data.list;
  3364. this.seepart.pageNum = response.data.pageNum
  3365. this.seepart.pageSize = response.data.pageSize
  3366. } else {
  3367. this.seepartList = []
  3368. }
  3369. this.seepart.total = response.data.total
  3370. setTimeout(() => {
  3371. this.seepart.listLoading = false
  3372. }, 100)
  3373. })
  3374. },
  3375. public_select(item) {
  3376. this.$set(item, 'myId', Date.parse(new Date()))
  3377. if (this.createTemp.providerId == '') {
  3378. if (this.listAdd.length > 0) {
  3379. if (this.listAdd.find((obj) => obj.partId == item.partId)) {
  3380. this.$message({
  3381. type: 'warning',
  3382. message: '此备件已存在,请重新选择备件'
  3383. })
  3384. } else {
  3385. this.getParmCreateAmount.parammaps.partCode = item.partCode
  3386. partslistSGv2(this.getParmCreateAmount).then((response) => {
  3387. this.$nextTick(() => {
  3388. console.log(
  3389. '新增根据编号获取备件库存数量',
  3390. response.data.list[0]
  3391. )
  3392. item = response.data.list[0]
  3393. this.$set(item, 'myId', Date.parse(new Date()))
  3394. if (
  3395. item.srcpath !== null &&
  3396. item.picpath !== null &&
  3397. item.srcpath !== undefined &&
  3398. item.picpath !== undefined
  3399. ) {
  3400. this.$set(
  3401. item,
  3402. 'srcpath',
  3403. process.env.VUE_APP_BASE_API + item.srcpath
  3404. )
  3405. this.$set(
  3406. item,
  3407. 'picpath',
  3408. process.env.VUE_APP_BASE_API + item.picpath
  3409. )
  3410. } else {
  3411. item.srcpath = ''
  3412. item.picpath = ''
  3413. }
  3414. this.$set(item, 'amount', '')
  3415. this.$set(item, 'purpose', '')
  3416. if (
  3417. this.dialogStatus === 'special' &&
  3418. this.createTemp.purchaseType == '2'
  3419. ) {
  3420. this.$set(item, 'price', '')
  3421. } else if (
  3422. this.dialogStatus === 'special' &&
  3423. this.createTemp.purchaseType == '3'
  3424. ) {
  3425. this.$set(item, 'price', '0')
  3426. this.$set(item, 'amount', '0')
  3427. }
  3428. if (item.price) {
  3429. var pricearr = item.price.split(',')
  3430. this.$set(item, 'pricearr', pricearr)
  3431. } else {
  3432. this.$set(item, 'pricearr', [])
  3433. }
  3434. if (item.contractId) {
  3435. var contractId = item.contractId
  3436. this.$set(item, 'contractId', contractId)
  3437. } else {
  3438. this.$set(item, 'contractId', 0)
  3439. }
  3440. if (item.lifeCycle) {
  3441. var lifeCyclearr = item.lifeCycle.split(',')
  3442. this.$set(item, 'lifeCyclearr', lifeCyclearr)
  3443. }
  3444. if (item.contractVarianceItem) {
  3445. var contractVarianceItemarr =
  3446. item.contractVarianceItem.split(',')
  3447. this.$set(
  3448. item,
  3449. 'contractVarianceItemarr',
  3450. contractVarianceItemarr
  3451. )
  3452. }
  3453. this.listAdd.unshift(item)
  3454. this.$forceUpdate()
  3455. })
  3456. })
  3457. }
  3458. } else {
  3459. this.getParmCreateAmount.parammaps.partCode = item.partCode
  3460. partslistSGv2(this.getParmCreateAmount).then((response) => {
  3461. this.$nextTick(() => {
  3462. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  3463. item = response.data.list[0]
  3464. this.$set(item, 'myId', Date.parse(new Date()))
  3465. if (
  3466. item.srcpath !== null &&
  3467. item.picpath !== null &&
  3468. item.srcpath !== undefined &&
  3469. item.picpath !== undefined
  3470. ) {
  3471. this.$set(
  3472. item,
  3473. 'srcpath',
  3474. process.env.VUE_APP_BASE_API + item.srcpath
  3475. )
  3476. this.$set(
  3477. item,
  3478. 'picpath',
  3479. process.env.VUE_APP_BASE_API + item.picpath
  3480. )
  3481. } else {
  3482. item.srcpath = ''
  3483. item.picpath = ''
  3484. }
  3485. this.$set(item, 'amount', '')
  3486. this.$set(item, 'purpose', '')
  3487. if (
  3488. this.dialogStatus === 'special' &&
  3489. this.createTemp.purchaseType == '2'
  3490. ) {
  3491. this.$set(item, 'price', '')
  3492. } else if (
  3493. this.dialogStatus === 'special' &&
  3494. this.createTemp.purchaseType == '3'
  3495. ) {
  3496. this.$set(item, 'price', '0')
  3497. this.$set(item, 'amount', '0')
  3498. }
  3499. if (item.price) {
  3500. var pricearr = item.price.split(',')
  3501. this.$set(item, 'pricearr', pricearr)
  3502. } else {
  3503. this.$set(item, 'pricearr', [])
  3504. }
  3505. if (item.lifeCycle) {
  3506. var lifeCyclearr = item.lifeCycle.split(',')
  3507. this.$set(item, 'lifeCyclearr', lifeCyclearr)
  3508. }
  3509. if (item.contractVarianceItem) {
  3510. var contractVarianceItemarr =
  3511. item.contractVarianceItem.split(',')
  3512. this.$set(
  3513. item,
  3514. 'contractVarianceItemarr',
  3515. contractVarianceItemarr
  3516. )
  3517. }
  3518. if (item.contractId) {
  3519. var contractId = item.contractId
  3520. this.$set(item, 'contractId', contractId)
  3521. } else {
  3522. this.$set(item, 'contractId', 0)
  3523. }
  3524. this.listAdd.unshift(item)
  3525. this.$forceUpdate()
  3526. })
  3527. })
  3528. }
  3529. this.$forceUpdate()
  3530. } else {
  3531. if (this.listAdd.length > 0) {
  3532. if (this.listAdd.find((obj) => obj.partId == item.partId)) {
  3533. this.$message({
  3534. type: 'warning',
  3535. message: '此备件已存在,请重新选择备件'
  3536. })
  3537. } else {
  3538. if (
  3539. item.srcpath !== null &&
  3540. item.picpath !== null &&
  3541. item.srcpath !== undefined &&
  3542. item.picpath !== undefined
  3543. ) {
  3544. this.$set(
  3545. item,
  3546. 'srcpath',
  3547. process.env.VUE_APP_BASE_API + item.srcpath
  3548. )
  3549. this.$set(
  3550. item,
  3551. 'picpath',
  3552. process.env.VUE_APP_BASE_API + item.picpath
  3553. )
  3554. } else {
  3555. item.srcpath = ''
  3556. item.picpath = ''
  3557. }
  3558. this.$set(item, 'amount', '')
  3559. this.$set(item, 'purpose', '')
  3560. if (
  3561. this.dialogStatus === 'special' &&
  3562. this.createTemp.purchaseType == '3'
  3563. ) {
  3564. this.$set(item, 'price', '0')
  3565. this.$set(item, 'amount', '0')
  3566. }
  3567. if (item.price) {
  3568. var pricearr = item.price.split(',')
  3569. this.$set(item, 'pricearr', pricearr)
  3570. } else {
  3571. this.$set(item, 'pricearr', [])
  3572. }
  3573. if (item.lifeCycle) {
  3574. var lifeCyclearr = item.lifeCycle.split(',')
  3575. this.$set(item, 'lifeCyclearr', lifeCyclearr)
  3576. }
  3577. if (item.contractVarianceItem) {
  3578. var contractVarianceItemarr = item.contractVarianceItem.split(',')
  3579. this.$set(
  3580. item,
  3581. 'contractVarianceItemarr',
  3582. contractVarianceItemarr
  3583. )
  3584. }
  3585. if (item.contractId) {
  3586. var contractId = item.contractId
  3587. this.$set(item, 'contractId', contractId)
  3588. } else {
  3589. this.$set(item, 'contractId', 0)
  3590. }
  3591. this.listAdd.unshift(item)
  3592. }
  3593. } else {
  3594. if (
  3595. item.srcpath !== null &&
  3596. item.picpath !== null &&
  3597. item.srcpath !== undefined &&
  3598. item.picpath !== undefined
  3599. ) {
  3600. this.$set(
  3601. item,
  3602. 'srcpath',
  3603. process.env.VUE_APP_BASE_API + item.srcpath
  3604. )
  3605. this.$set(
  3606. item,
  3607. 'picpath',
  3608. process.env.VUE_APP_BASE_API + item.picpath
  3609. )
  3610. } else {
  3611. item.srcpath = ''
  3612. item.picpath = ''
  3613. }
  3614. this.$set(item, 'amount', '')
  3615. this.$set(item, 'purpose', '')
  3616. if (
  3617. this.dialogStatus === 'special' &&
  3618. this.createTemp.purchaseType == '3'
  3619. ) {
  3620. this.$set(item, 'price', '0')
  3621. this.$set(item, 'amount', '0')
  3622. }
  3623. if (item.contractId) {
  3624. var contractId = item.contractId
  3625. this.$set(item, 'contractId', contractId)
  3626. } else {
  3627. this.$set(item, 'contractId', 0)
  3628. }
  3629. if (
  3630. this.dialogStatus !== 'special' &&
  3631. this.createTemp.providerId == ''
  3632. ) {
  3633. var pricearr = item.price.split(',')
  3634. this.$set(item, 'pricearr', pricearr)
  3635. var lifeCyclearr = item.lifeCycle.split(',')
  3636. this.$set(item, 'lifeCyclearr', lifeCyclearr)
  3637. var contractVarianceItemarr = item.contractVarianceItem.split(',')
  3638. this.$set(item, 'contractVarianceItemarr', contractVarianceItemarr)
  3639. }
  3640. if (this.createTemp.providerId == '') {
  3641. if (item.price) {
  3642. var pricearr = item.price.split(',')
  3643. this.$set(item, 'pricearr', pricearr)
  3644. } else {
  3645. this.$set(item, 'pricearr', [])
  3646. }
  3647. if (item.lifeCycle) {
  3648. var lifeCyclearr = item.lifeCycle.split(',')
  3649. this.$set(item, 'lifeCyclearr', lifeCyclearr)
  3650. }
  3651. if (item.contractVarianceItem) {
  3652. var contractVarianceItemarr = item.contractVarianceItem.split(',')
  3653. this.$set(
  3654. item,
  3655. 'contractVarianceItemarr',
  3656. contractVarianceItemarr
  3657. )
  3658. }
  3659. }
  3660. this.listAdd.unshift(item)
  3661. this.$forceUpdate()
  3662. }
  3663. this.$forceUpdate()
  3664. }
  3665. },
  3666. add_dialog_save() {
  3667. this.isokDisable = true
  3668. setTimeout(() => {
  3669. this.isokDisable = false
  3670. }, 1000)
  3671. this.$refs['createTemp'].validate((valid) => {
  3672. if (valid) {
  3673. console.log(this.listAdd)
  3674. if (
  3675. this.createTemp.orderNumber == '' ||
  3676. this.createTemp.orderNumber == null ||
  3677. this.createTemp.orderNumber == undefined
  3678. ) {
  3679. GetDataByName(this.getParmCreateNumber).then((response) => {
  3680. this.$nextTick(() => {
  3681. console.log('新增申购单号', response.data.list[0].orderCode)
  3682. this.createTemp.orderNumber = response.data.list[0].orderCode
  3683. this.$forceUpdate()
  3684. this.add_dialog_saveSave()
  3685. })
  3686. })
  3687. } else {
  3688. this.add_dialog_saveSave()
  3689. }
  3690. }
  3691. })
  3692. },
  3693. add_dialog_saveSave() {
  3694. if (this.listAdd.length !== 0) {
  3695. for (var j = 0; j < this.listAdd.length; j++) {
  3696. console.log(this.listAdd[j].amount)
  3697. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  3698. this.$message({
  3699. type: 'warning',
  3700. message: '请检查申购数量是否未填写',
  3701. duration: 2000
  3702. })
  3703. return false
  3704. } else {
  3705. var rulesAmount = /^[1-9]\d*$/
  3706. if (!rulesAmount.test(this.listAdd[j].amount)) {
  3707. this.$message({
  3708. type: 'error',
  3709. message: '申购数量请输入正整数',
  3710. duration: 2000
  3711. })
  3712. return false
  3713. }
  3714. }
  3715. }
  3716. if (this.createTemp.markBackend) {
  3717. console.log('有数据-走新保存')
  3718. const url = 'authdata/partpurchase/edit'
  3719. const dataArr = []
  3720. console.log(this.providerNames, 'hss')
  3721. for (let i = 0; i < this.listAdd.length; i++) {
  3722. // 若有合单,走/edit的接口 再次对价格做个校验判断;
  3723. if (parseFloat(this.listAdd[i].price) == 0 || this.listAdd[i].price == '') {
  3724. this.$message({
  3725. type: 'warning',
  3726. message: '价格请输入正数,最多保留小数点后五位',
  3727. duration: 2000
  3728. })
  3729. return false
  3730. }
  3731. if (this.listAdd[i].myId !== undefined) {
  3732. this.listAdd[i].id = 0
  3733. }
  3734. const obj = {
  3735. id: parseFloat(this.listAdd[i].id),
  3736. contractId: this.listAdd[i].contractId,
  3737. bigId: parseFloat(this.createTemp.bigId),
  3738. pastureId: parseFloat(this.listAdd[i].pastureId),
  3739. partId: parseFloat(this.listAdd[i].partId),
  3740. partCode: this.listAdd[i].partCode.toString(),
  3741. partName: this.listAdd[i].partName.toString(),
  3742. specification: this.listAdd[i].specification,
  3743. amount: parseFloat(this.listAdd[i].amount),
  3744. unit: this.listAdd[i].unit.toString(),
  3745. brandId: parseFloat(this.listAdd[i].brandId),
  3746. purpose: this.listAdd[i].purpose.toString(),
  3747. price: this.listAdd[i].price.toString(),
  3748. lifeCycle: this.listAdd[i].lifeCycle.toString(),
  3749. contractVarianceItem:
  3750. this.listAdd[i].contractVarianceItem.toString(),
  3751. departmentId: this.createTemp.departmentId.toString(),
  3752. date: parseTime(
  3753. this.createTemp.createTime,
  3754. '{y}-{m}-{d} {h}:{i}:{s}'
  3755. ).toString(),
  3756. employeId: parseFloat(this.createTemp.employeId)
  3757. }
  3758. if (this.listAdd[i].contractId) {
  3759. this.$set(
  3760. this.listAdd[i],
  3761. 'contractId',
  3762. this.listAdd[i].contractId.toString()
  3763. )
  3764. } else {
  3765. this.$set(this.listAdd[i], 'contractId', '')
  3766. }
  3767. if (this.listAdd[i].storageAmount) {
  3768. obj.storageAmount = parseFloat(this.listAdd[i].storageAmount)
  3769. } else {
  3770. obj.storageAmount = 0
  3771. }
  3772. if (this.listAdd[i].reject) {
  3773. obj.reject = this.listAdd[i].reject.toString()
  3774. } else {
  3775. obj.reject = ''
  3776. }
  3777. if (this.listAdd[i].explain) {
  3778. obj.explain = this.listAdd[i].explain.toString()
  3779. } else {
  3780. obj.explain = ''
  3781. }
  3782. dataArr.push(obj)
  3783. }
  3784. const data = dataArr
  3785. console.log(data, 'hss===1')
  3786. postJson(url, data).then((response) => {
  3787. if (response.msg !== 'fail') {
  3788. this.get_table_data()
  3789. this.dialogFormVisible = false
  3790. this.$notify({
  3791. title: '成功',
  3792. message: '保存成功',
  3793. type: 'success',
  3794. duration: 2000
  3795. })
  3796. } else {
  3797. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  3798. }
  3799. })
  3800. } else {
  3801. console.log('无数据-走原有保存')
  3802. for (var j = 0; j < this.listAdd.length; j++) {
  3803. console.log(this.listAdd[j].amount)
  3804. if (
  3805. this.listAdd[j].amount == null ||
  3806. this.listAdd[j].amount === ''
  3807. ) {
  3808. this.$message({
  3809. type: 'warning',
  3810. message: '请检查申购数量是否未填写',
  3811. duration: 2000
  3812. })
  3813. return false
  3814. } else {
  3815. var rulesAmount = /^[1-9]\d*$/
  3816. if (!rulesAmount.test(this.listAdd[j].amount)) {
  3817. this.$message({
  3818. type: 'error',
  3819. message: '申购数量请输入正整数',
  3820. duration: 2000
  3821. })
  3822. return false
  3823. }
  3824. }
  3825. if (this.listAdd[j].price == '') {
  3826. this.$message({
  3827. type: 'warning',
  3828. message: '请检查单价是否为空',
  3829. duration: 2000
  3830. })
  3831. return false
  3832. } else {
  3833. if (
  3834. this.listAdd[j].contractId == '' ||
  3835. this.listAdd[j].contractId == undefined ||
  3836. parseFloat(this.listAdd[j].contractId) == 0 ||
  3837. parseFloat(this.listAdd[j].contractId) < 0
  3838. ) {
  3839. if (parseFloat(this.listAdd[j].price) == 0) {
  3840. this.$message({
  3841. type: 'warning',
  3842. message: '价格请输入正数,最多保留小数点后五位',
  3843. duration: 2000
  3844. })
  3845. return false
  3846. } else {
  3847. if (
  3848. this.listAdd[j].contractId == '' ||
  3849. this.listAdd[j].contractId == undefined ||
  3850. parseFloat(this.listAdd[j].contractId) == 0 ||
  3851. parseFloat(this.listAdd[j].contractId) < 0
  3852. ) {
  3853. // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  3854. var rulesPrice =
  3855. /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  3856. if (rulesPrice.test(this.listAdd[j].price) == false) {
  3857. this.$message({
  3858. type: 'error',
  3859. message: '价格请输入正数,最多保留小数点后五位',
  3860. duration: 2000
  3861. })
  3862. return false
  3863. }
  3864. }
  3865. }
  3866. }
  3867. }
  3868. }
  3869. for (let i = 0; i < this.listAdd.length; i++) {
  3870. this.$set(
  3871. this.listAdd[i],
  3872. 'date',
  3873. parseTime(this.createTemp.createTime, '{y}-{m}-{d} {h}:{i}:{s}')
  3874. )
  3875. this.$set(this.listAdd[i], 'employeId', this.createTemp.employeId)
  3876. if (this.listAdd[i].reject) {
  3877. this.$set(this.listAdd[i], 'reject', this.listAdd[i].reject)
  3878. } else {
  3879. this.$set(this.listAdd[i], 'reject', 0)
  3880. }
  3881. }
  3882. this.postDataPramas.common = { returnmap: '0' }
  3883. this.postDataPramas.data = []
  3884. this.postDataPramas.data[0] = {
  3885. name: 'insertBigPartpurchase',
  3886. type: 'e',
  3887. parammaps: {
  3888. pastureId: this.createTemp.pastureId,
  3889. departmentId: this.createTemp.departmentId,
  3890. orderNumber: this.createTemp.orderNumber,
  3891. useType: this.createTemp.useType,
  3892. createTime: parseTime(
  3893. this.createTemp.createTime,
  3894. '{y}-{m}-{d} {h}:{i}:{s}'
  3895. ),
  3896. employeId: this.createTemp.employeId,
  3897. providerId: this.createTemp.providerId
  3898. }
  3899. }
  3900. // eslint-disable-next-line no-irregular-whitespace
  3901. this.postDataPramas.data[1] = {
  3902. name: 'insertSpotList',
  3903. resultmaps: { list: this.listAdd }
  3904. }
  3905. this.postDataPramas.data[1].children = []
  3906. this.postDataPramas.data[1].children[0] = {
  3907. name: 'insertPartpurchase',
  3908. type: 'e',
  3909. parammaps: {
  3910. bigId: '@insertBigPartpurchase.LastInsertId',
  3911. pastureId: '@insertSpotList.pastureId',
  3912. partId: '@insertSpotList.partId',
  3913. partCode: '@insertSpotList.partCode',
  3914. partName: '@insertSpotList.partName',
  3915. specification: '@insertSpotList.specification',
  3916. unit: '@insertSpotList.unit',
  3917. brandId: '@insertSpotList.brandId',
  3918. storageAmount: '@insertSpotList.reportery',
  3919. purpose: '@insertSpotList.purpose',
  3920. amount: '@insertSpotList.amount',
  3921. price: '@insertSpotList.price',
  3922. contractId: '@insertSpotList.contractId',
  3923. lifeCycle: '@insertSpotList.lifeCycle',
  3924. date: '@insertSpotList.date',
  3925. employeId: '@insertSpotList.employeId',
  3926. reject: '@insertSpotList.reject',
  3927. departmentId: this.createTemp.departmentId,
  3928. contractVarianceItem: '@insertSpotList.contractVarianceItem',
  3929. contractId: '@insertSpotList.contractId'
  3930. }
  3931. }
  3932. ExecDataByConfig(this.postDataPramas).then((response) => {
  3933. console.log('新增保存发送参数', this.postDataPramas)
  3934. if (response.msg === 'fail') {
  3935. this.$notify({
  3936. title: '保存失败',
  3937. message: response.data,
  3938. type: 'warning',
  3939. duration: 2000
  3940. })
  3941. } else {
  3942. this.dialogFormVisible = false
  3943. this.getdataListParm.parammaps.inputDatetime = ''
  3944. this.get_table_data()
  3945. this.getPendingList()
  3946. this.$notify({
  3947. title: '',
  3948. message: '保存成功',
  3949. type: 'success',
  3950. duration: 2000
  3951. })
  3952. }
  3953. })
  3954. return true
  3955. }
  3956. } else {
  3957. this.$message({
  3958. title: '',
  3959. message: '请选择备件',
  3960. type: 'warning',
  3961. duration: 2000
  3962. })
  3963. return false
  3964. }
  3965. },
  3966. partDelete(row) {
  3967. console.log(this.listAdd)
  3968. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  3969. confirmButtonText: '确认',
  3970. cancelButtonText: '取消',
  3971. type: 'warning'
  3972. }).then(() => {
  3973. // console.log(this.list2)
  3974. for (var i = 0; i < this.listAdd.length; i++) {
  3975. console.log(this.listAdd[i])
  3976. if (this.listAdd[i].id === row.id) {
  3977. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  3978. }
  3979. if (listAddIndex > -1) {
  3980. this.listAdd.splice(listAddIndex, 1)
  3981. return
  3982. }
  3983. }
  3984. })
  3985. },
  3986. // 查看
  3987. form_see(row) {
  3988. // 查看/特殊申购
  3989. console.log(row,'查查看')
  3990. if (row.purchase_type == 1 || row.purchase_type == 3) {
  3991. this.textMap.see = '特殊申购'
  3992. } else {
  3993. this.textMap.see = '查看'
  3994. }
  3995. this.dialogStatus = 'see'
  3996. // this.dialogFormVisibleSee = true
  3997. this.dialogFormVisibleSee1 = true
  3998. this.seeTemp.purchaseType = String(row.purchase_type)
  3999. console.log('查看上方数据(从table读取)', this.seeTemp)
  4000. this.listSee = []
  4001. this.getdataListSee.parammaps.id = this.seeTemp.id
  4002. this.getdataListSee.parammaps.empId = ''
  4003. this.isApplyEx4 = false
  4004. this.getSeeList(row)
  4005. // // 赛四是同id 反之不同id
  4006. // if( row.pastureId != Cookies.get('pastureid') ) {
  4007. // row.isPasturd = true
  4008. // row.isRolePasturd = false
  4009. // } else if ( Cookies.get('pastureid') == Cookies.get('mainpasture')) {
  4010. // row.isPasturd = true
  4011. // row.isRolePasturd = true
  4012. // }else {
  4013. // row.isPasturd = false
  4014. // row.isRolePasturd = false
  4015. // }
  4016. this.seeTemp = Object.assign({}, row)
  4017. console.log('查看=======hss',this.seeTemp,this.list)
  4018. },
  4019. getFlowPath() {
  4020. // 流程图
  4021. var reason = '未通过原因:' + this.seeTemp.workflowNote
  4022. if (this.seeTemp.purchase_type == 1) {
  4023. // 特殊申购-暂估
  4024. if (this.seeTemp.statue === 2) {
  4025. this.activeList = [
  4026. {
  4027. title: '备件申购',
  4028. date: this.seeTemp.inputTime,
  4029. name: this.seeTemp.empname
  4030. },
  4031. { title: '库管审核' },
  4032. { title: '设备主管审核' },
  4033. { title: '供应主管审核' },
  4034. { title: '场长审核' },
  4035. { title: '采购审核' },
  4036. { title: '财务审核' }
  4037. ]
  4038. this.active = 1
  4039. } else if (this.seeTemp.statue === 3) {
  4040. this.activeList = [
  4041. {
  4042. title: '备件申购',
  4043. date: this.seeTemp.inputTime,
  4044. name: this.seeTemp.empname
  4045. },
  4046. {
  4047. title: '库管审核',
  4048. date: this.seeTemp.KGChargedate,
  4049. name: this.seeTemp.KGChargePerson
  4050. },
  4051. { title: '设备主管审核' },
  4052. { title: '供应主管审核' },
  4053. { title: '场长审核' },
  4054. { title: '采购审核' },
  4055. { title: '财务审核' }
  4056. ]
  4057. this.active = 2
  4058. } else if (this.seeTemp.statue === 4) {
  4059. this.activeList = [
  4060. {
  4061. title: '备件申购',
  4062. date: this.seeTemp.inputTime,
  4063. name: this.seeTemp.empname
  4064. },
  4065. {
  4066. title: '库管审核',
  4067. date: this.seeTemp.KGChargedate,
  4068. name: this.seeTemp.KGChargePerson,
  4069. status: 'error',
  4070. reason: reason
  4071. },
  4072. { title: '设备主管审核' },
  4073. { title: '供应主管审核' },
  4074. { title: '场长审核' },
  4075. { title: '采购审核' },
  4076. { title: '财务审核' }
  4077. ]
  4078. this.active = 2
  4079. } else if (this.seeTemp.statue === 9) {
  4080. this.activeList = [
  4081. {
  4082. title: '备件申购',
  4083. date: this.seeTemp.inputTime,
  4084. name: this.seeTemp.empname
  4085. },
  4086. {
  4087. title: '库管审核',
  4088. date: this.seeTemp.KGChargedate,
  4089. name: this.seeTemp.KGChargePerson
  4090. },
  4091. {
  4092. title: '设备主管审核',
  4093. date: this.seeTemp.equipmentdate,
  4094. name: this.seeTemp.equipmentPerson
  4095. },
  4096. { title: '供应主管审核' },
  4097. { title: '场长审核' },
  4098. { title: '采购审核' },
  4099. { title: '财务审核' }
  4100. ]
  4101. this.active = 3
  4102. } else if (this.seeTemp.statue === 10) {
  4103. this.activeList = [
  4104. {
  4105. title: '备件申购',
  4106. date: this.seeTemp.inputTime,
  4107. name: this.seeTemp.empname
  4108. },
  4109. {
  4110. title: '库管审核',
  4111. date: this.seeTemp.KGChargedate,
  4112. name: this.seeTemp.KGChargePerson
  4113. },
  4114. {
  4115. title: '设备主管审核',
  4116. date: this.seeTemp.equipmentdate,
  4117. name: this.seeTemp.equipmentPerson,
  4118. status: 'error',
  4119. reason: reason
  4120. },
  4121. { title: '供应主管审核' },
  4122. { title: '场长审核' },
  4123. { title: '采购审核' },
  4124. { title: '财务审核' }
  4125. ]
  4126. this.active = 3
  4127. } else if (this.seeTemp.statue === 5) {
  4128. this.activeList = [
  4129. {
  4130. title: '备件申购',
  4131. date: this.seeTemp.inputTime,
  4132. name: this.seeTemp.empname
  4133. },
  4134. {
  4135. title: '库管审核',
  4136. date: this.seeTemp.KGChargedate,
  4137. name: this.seeTemp.KGChargePerson
  4138. },
  4139. {
  4140. title: '设备主管审核',
  4141. date: this.seeTemp.equipmentdate,
  4142. name: this.seeTemp.equipmentPerson
  4143. },
  4144. {
  4145. title: '供应主管审核',
  4146. date: this.seeTemp.chargeDate,
  4147. name: this.seeTemp.chargePerson
  4148. },
  4149. { title: '场长审核' },
  4150. { title: '采购审核' },
  4151. { title: '财务审核' }
  4152. ]
  4153. this.active = 4
  4154. } else if (this.seeTemp.statue === 6) {
  4155. this.activeList = [
  4156. {
  4157. title: '备件申购',
  4158. date: this.seeTemp.inputTime,
  4159. name: this.seeTemp.empname
  4160. },
  4161. {
  4162. title: '库管审核',
  4163. date: this.seeTemp.KGChargedate,
  4164. name: this.seeTemp.KGChargePerson
  4165. },
  4166. {
  4167. title: '设备主管审核',
  4168. date: this.seeTemp.equipmentdate,
  4169. name: this.seeTemp.equipmentPerson
  4170. },
  4171. {
  4172. title: '供应主管审核',
  4173. date: this.seeTemp.chargeDate,
  4174. name: this.seeTemp.chargePerson,
  4175. status: 'error',
  4176. reason: reason
  4177. },
  4178. { title: '场长审核' },
  4179. { title: '采购审核' },
  4180. { title: '财务审核' }
  4181. ]
  4182. this.active = 4
  4183. } else if (this.seeTemp.statue === 11) {
  4184. this.activeList = [
  4185. {
  4186. title: '备件申购',
  4187. date: this.seeTemp.inputTime,
  4188. name: this.seeTemp.empname
  4189. },
  4190. {
  4191. title: '库管审核',
  4192. date: this.seeTemp.KGChargedate,
  4193. name: this.seeTemp.KGChargePerson
  4194. },
  4195. {
  4196. title: '设备主管审核',
  4197. date: this.seeTemp.equipmentdate,
  4198. name: this.seeTemp.equipmentPerson
  4199. },
  4200. {
  4201. title: '供应主管审核',
  4202. date: this.seeTemp.chargeDate,
  4203. name: this.seeTemp.chargePerson
  4204. },
  4205. {
  4206. title: '场长审核',
  4207. date: this.seeTemp.fielddate,
  4208. name: this.seeTemp.fieldPerson
  4209. },
  4210. { title: '采购审核' },
  4211. { title: '财务审核' }
  4212. ]
  4213. this.active = 5
  4214. } else if (this.seeTemp.statue === 12) {
  4215. this.activeList = [
  4216. {
  4217. title: '备件申购',
  4218. date: this.seeTemp.inputTime,
  4219. name: this.seeTemp.empname
  4220. },
  4221. {
  4222. title: '库管审核',
  4223. date: this.seeTemp.KGChargedate,
  4224. name: this.seeTemp.KGChargePerson
  4225. },
  4226. {
  4227. title: '设备主管审核',
  4228. date: this.seeTemp.equipmentdate,
  4229. name: this.seeTemp.equipmentPerson
  4230. },
  4231. {
  4232. title: '供应主管审核',
  4233. date: this.seeTemp.chargeDate,
  4234. name: this.seeTemp.chargePerson
  4235. },
  4236. {
  4237. title: '场长审核',
  4238. date: this.seeTemp.fielddate,
  4239. name: this.seeTemp.fieldPerson,
  4240. status: 'error',
  4241. reason: reason
  4242. },
  4243. { title: '采购审核' },
  4244. { title: '财务审核' }
  4245. ]
  4246. this.active = 5
  4247. } else if (this.seeTemp.statue === 7) {
  4248. this.activeList = [
  4249. {
  4250. title: '备件申购',
  4251. date: this.seeTemp.inputTime,
  4252. name: this.seeTemp.empname
  4253. },
  4254. {
  4255. title: '库管审核',
  4256. date: this.seeTemp.KGChargedate,
  4257. name: this.seeTemp.KGChargePerson
  4258. },
  4259. {
  4260. title: '设备主管审核',
  4261. date: this.seeTemp.equipmentdate,
  4262. name: this.seeTemp.equipmentPerson
  4263. },
  4264. {
  4265. title: '供应主管审核',
  4266. date: this.seeTemp.chargeDate,
  4267. name: this.seeTemp.chargePerson
  4268. },
  4269. {
  4270. title: '场长审核',
  4271. date: this.seeTemp.fielddate,
  4272. name: this.seeTemp.fieldPerson
  4273. },
  4274. {
  4275. title: '采购审核',
  4276. date: this.seeTemp.CGChargedate,
  4277. name: this.seeTemp.CGChargePerson
  4278. },
  4279. { title: '财务审核' }
  4280. ]
  4281. this.active = 6
  4282. } else if (this.seeTemp.statue === 8) {
  4283. this.activeList = [
  4284. {
  4285. title: '备件申购',
  4286. date: this.seeTemp.inputTime,
  4287. name: this.seeTemp.empname
  4288. },
  4289. {
  4290. title: '库管审核',
  4291. date: this.seeTemp.KGChargedate,
  4292. name: this.seeTemp.KGChargePerson
  4293. },
  4294. {
  4295. title: '设备主管审核',
  4296. date: this.seeTemp.equipmentdate,
  4297. name: this.seeTemp.equipmentPerson
  4298. },
  4299. {
  4300. title: '供应主管审核',
  4301. date: this.seeTemp.chargeDate,
  4302. name: this.seeTemp.chargePerson
  4303. },
  4304. {
  4305. title: '场长审核',
  4306. date: this.seeTemp.fielddate,
  4307. name: this.seeTemp.fieldPerson
  4308. },
  4309. {
  4310. title: '采购审核',
  4311. date: this.seeTemp.CGChargedate,
  4312. name: this.seeTemp.CGChargePerson,
  4313. status: 'error',
  4314. reason: reason
  4315. },
  4316. { title: '财务审核' }
  4317. ]
  4318. this.active = 6
  4319. } else if (this.seeTemp.statue === 13) {
  4320. this.activeList = [
  4321. {
  4322. title: '备件申购',
  4323. date: this.seeTemp.inputTime,
  4324. name: this.seeTemp.empname
  4325. },
  4326. {
  4327. title: '库管审核',
  4328. date: this.seeTemp.KGChargedate,
  4329. name: this.seeTemp.KGChargePerson
  4330. },
  4331. {
  4332. title: '设备主管审核',
  4333. date: this.seeTemp.equipmentdate,
  4334. name: this.seeTemp.equipmentPerson
  4335. },
  4336. {
  4337. title: '供应主管审核',
  4338. date: this.seeTemp.chargeDate,
  4339. name: this.seeTemp.chargePerson
  4340. },
  4341. {
  4342. title: '场长审核',
  4343. date: this.seeTemp.fielddate,
  4344. name: this.seeTemp.fieldPerson
  4345. },
  4346. {
  4347. title: '采购审核',
  4348. date: this.seeTemp.CGChargedate,
  4349. name: this.seeTemp.CGChargePerson
  4350. },
  4351. {
  4352. title: '财务审核',
  4353. date: this.seeTemp.financedate,
  4354. name: this.seeTemp.financeName
  4355. }
  4356. ]
  4357. this.active = 7
  4358. } else if (this.seeTemp.statue === 14) {
  4359. this.activeList = [
  4360. {
  4361. title: '备件申购',
  4362. date: this.seeTemp.inputTime,
  4363. name: this.seeTemp.empname
  4364. },
  4365. {
  4366. title: '库管审核',
  4367. date: this.seeTemp.KGChargedate,
  4368. name: this.seeTemp.KGChargePerson
  4369. },
  4370. {
  4371. title: '设备主管审核',
  4372. date: this.seeTemp.equipmentdate,
  4373. name: this.seeTemp.equipmentPerson
  4374. },
  4375. {
  4376. title: '供应主管审核',
  4377. date: this.seeTemp.chargeDate,
  4378. name: this.seeTemp.chargePerson
  4379. },
  4380. {
  4381. title: '场长审核',
  4382. date: this.seeTemp.fielddate,
  4383. name: this.seeTemp.fieldPerson
  4384. },
  4385. {
  4386. title: '采购审核',
  4387. date: this.seeTemp.CGChargedate,
  4388. name: this.seeTemp.CGChargePerson
  4389. },
  4390. {
  4391. title: '财务审核',
  4392. date: this.seeTemp.financedate,
  4393. name: this.seeTemp.financeName,
  4394. status: 'error',
  4395. reason: reason
  4396. }
  4397. ]
  4398. this.active = 7
  4399. }
  4400. } else if (this.seeTemp.purchase_type == 3) {
  4401. // 赠品
  4402. this.activeList = [
  4403. {
  4404. title: '备件申购',
  4405. date: this.seeTemp.inputTime,
  4406. name: this.seeTemp.empname
  4407. }
  4408. ]
  4409. this.active = 1
  4410. } else if (
  4411. this.seeTemp.purchase_type < 0 ||
  4412. this.seeTemp.purchase_type == 0 ||
  4413. this.seeTemp.purchase_type == 4
  4414. ) {
  4415. if (this.seeTemp.departmentName == '挤奶处') {
  4416. // 奶厅申购审核流程
  4417. if (this.seeTemp.examine == 1) {
  4418. console.log(11111111111)
  4419. if (this.seeTemp.statue === 2) {
  4420. this.activeList = [
  4421. {
  4422. title: '备件申购',
  4423. date: this.seeTemp.inputTime,
  4424. name: this.seeTemp.empname
  4425. },
  4426. { title: '库管审核' },
  4427. { title: '设备主管审核' },
  4428. { title: '供应主管审核' },
  4429. { title: '场长审核' },
  4430. { title: '职能中心审核' },
  4431. { title: '采购审核' }
  4432. ]
  4433. this.active = 1
  4434. } else if (this.seeTemp.statue === 3) {
  4435. this.activeList = [
  4436. {
  4437. title: '备件申购',
  4438. date: this.seeTemp.inputTime,
  4439. name: this.seeTemp.empname
  4440. },
  4441. {
  4442. title: '库管审核',
  4443. date: this.seeTemp.KGChargedate,
  4444. name: this.seeTemp.KGChargePerson
  4445. },
  4446. { title: '设备主管审核' },
  4447. { title: '供应主管审核' },
  4448. { title: '场长审核' },
  4449. { title: '职能中心审核' },
  4450. { title: '采购审核' }
  4451. ]
  4452. this.active = 2
  4453. } else if (this.seeTemp.statue === 4) {
  4454. this.activeList = [
  4455. {
  4456. title: '备件申购',
  4457. date: this.seeTemp.inputTime,
  4458. name: this.seeTemp.empname
  4459. },
  4460. {
  4461. title: '库管审核',
  4462. date: this.seeTemp.KGChargedate,
  4463. name: this.seeTemp.KGChargePerson,
  4464. status: 'error',
  4465. reason: reason
  4466. },
  4467. { title: '设备主管审核' },
  4468. { title: '供应主管审核' },
  4469. { title: '场长审核' },
  4470. { title: '职能中心审核' },
  4471. { title: '采购审核' }
  4472. ]
  4473. this.active = 2
  4474. } else if (this.seeTemp.statue === 9) {
  4475. this.activeList = [
  4476. {
  4477. title: '备件申购',
  4478. date: this.seeTemp.inputTime,
  4479. name: this.seeTemp.empname
  4480. },
  4481. {
  4482. title: '库管审核',
  4483. date: this.seeTemp.KGChargedate,
  4484. name: this.seeTemp.KGChargePerson
  4485. },
  4486. {
  4487. title: '设备主管审核',
  4488. date: this.seeTemp.equipmentdate,
  4489. name: this.seeTemp.equipmentPerson
  4490. },
  4491. { title: '供应主管审核' },
  4492. { title: '场长审核' },
  4493. { title: '职能中心审核' },
  4494. { title: '采购审核' }
  4495. ]
  4496. this.active = 3
  4497. } else if (this.seeTemp.statue === 10) {
  4498. this.activeList = [
  4499. {
  4500. title: '备件申购',
  4501. date: this.seeTemp.inputTime,
  4502. name: this.seeTemp.empname
  4503. },
  4504. {
  4505. title: '库管审核',
  4506. date: this.seeTemp.KGChargedate,
  4507. name: this.seeTemp.KGChargePerson
  4508. },
  4509. {
  4510. title: '设备主管审核',
  4511. date: this.seeTemp.equipmentdate,
  4512. name: this.seeTemp.equipmentPerson,
  4513. status: 'error',
  4514. reason: reason
  4515. },
  4516. { title: '供应主管审核' },
  4517. { title: '场长审核' },
  4518. { title: '职能中心审核' },
  4519. { title: '采购审核' }
  4520. ]
  4521. this.active = 3
  4522. } else if (this.seeTemp.statue === 5) {
  4523. this.activeList = [
  4524. {
  4525. title: '备件申购',
  4526. date: this.seeTemp.inputTime,
  4527. name: this.seeTemp.empname
  4528. },
  4529. {
  4530. title: '库管审核',
  4531. date: this.seeTemp.KGChargedate,
  4532. name: this.seeTemp.KGChargePerson
  4533. },
  4534. {
  4535. title: '设备主管审核',
  4536. date: this.seeTemp.equipmentdate,
  4537. name: this.seeTemp.equipmentPerson
  4538. },
  4539. {
  4540. title: '供应主管审核',
  4541. date: this.seeTemp.chargeDate,
  4542. name: this.seeTemp.chargePerson
  4543. },
  4544. { title: '场长审核' },
  4545. { title: '职能中心审核' },
  4546. { title: '采购审核' }
  4547. ]
  4548. this.active = 4
  4549. } else if (this.seeTemp.statue === 6) {
  4550. this.activeList = [
  4551. {
  4552. title: '备件申购',
  4553. date: this.seeTemp.inputTime,
  4554. name: this.seeTemp.empname
  4555. },
  4556. {
  4557. title: '库管审核',
  4558. date: this.seeTemp.KGChargedate,
  4559. name: this.seeTemp.KGChargePerson
  4560. },
  4561. {
  4562. title: '设备主管审核',
  4563. date: this.seeTemp.equipmentdate,
  4564. name: this.seeTemp.equipmentPerson
  4565. },
  4566. {
  4567. title: '供应主管审核',
  4568. date: this.seeTemp.chargeDate,
  4569. name: this.seeTemp.chargePerson,
  4570. status: 'error',
  4571. reason: reason
  4572. },
  4573. { title: '场长审核' },
  4574. { title: '职能中心审核' },
  4575. { title: '采购审核' }
  4576. ]
  4577. this.active = 4
  4578. } else if (this.seeTemp.statue === 11) {
  4579. this.activeList = [
  4580. {
  4581. title: '备件申购',
  4582. date: this.seeTemp.inputTime,
  4583. name: this.seeTemp.empname
  4584. },
  4585. {
  4586. title: '库管审核',
  4587. date: this.seeTemp.KGChargedate,
  4588. name: this.seeTemp.KGChargePerson
  4589. },
  4590. {
  4591. title: '设备主管审核',
  4592. date: this.seeTemp.equipmentdate,
  4593. name: this.seeTemp.equipmentPerson
  4594. },
  4595. {
  4596. title: '供应主管审核',
  4597. date: this.seeTemp.chargeDate,
  4598. name: this.seeTemp.chargePerson
  4599. },
  4600. {
  4601. title: '场长审核',
  4602. date: this.seeTemp.fielddate,
  4603. name: this.seeTemp.fieldPerson
  4604. },
  4605. { title: '职能中心审核' },
  4606. { title: '采购审核' }
  4607. ]
  4608. this.active = 5
  4609. } else if (this.seeTemp.statue === 12) {
  4610. this.activeList = [
  4611. {
  4612. title: '备件申购',
  4613. date: this.seeTemp.inputTime,
  4614. name: this.seeTemp.empname
  4615. },
  4616. {
  4617. title: '库管审核',
  4618. date: this.seeTemp.KGChargedate,
  4619. name: this.seeTemp.KGChargePerson
  4620. },
  4621. {
  4622. title: '设备主管审核',
  4623. date: this.seeTemp.equipmentdate,
  4624. name: this.seeTemp.equipmentPerson
  4625. },
  4626. {
  4627. title: '供应主管审核',
  4628. date: this.seeTemp.chargeDate,
  4629. name: this.seeTemp.chargePerson
  4630. },
  4631. {
  4632. title: '场长审核',
  4633. date: this.seeTemp.fielddate,
  4634. name: this.seeTemp.fieldPerson,
  4635. status: 'error',
  4636. reason: reason
  4637. },
  4638. { title: '职能中心审核' },
  4639. { title: '采购审核' }
  4640. ]
  4641. this.active = 5
  4642. } else if (this.seeTemp.statue === 15) {
  4643. this.activeList = [
  4644. {
  4645. title: '备件申购',
  4646. date: this.seeTemp.inputTime,
  4647. name: this.seeTemp.empname
  4648. },
  4649. {
  4650. title: '库管审核',
  4651. date: this.seeTemp.KGChargedate,
  4652. name: this.seeTemp.KGChargePerson
  4653. },
  4654. {
  4655. title: '设备主管审核',
  4656. date: this.seeTemp.equipmentdate,
  4657. name: this.seeTemp.equipmentPerson
  4658. },
  4659. {
  4660. title: '供应主管审核',
  4661. date: this.seeTemp.chargeDate,
  4662. name: this.seeTemp.chargePerson
  4663. },
  4664. {
  4665. title: '场长审核',
  4666. date: this.seeTemp.fielddate,
  4667. name: this.seeTemp.fieldPerson
  4668. },
  4669. {
  4670. title: '职能中心审核',
  4671. name: this.seeTemp.positionName,
  4672. date: this.seeTemp.positiondate
  4673. },
  4674. { title: '采购审核' }
  4675. ]
  4676. this.active = 6
  4677. } else if (this.seeTemp.statue === 16) {
  4678. this.activeList = [
  4679. {
  4680. title: '备件申购',
  4681. date: this.seeTemp.inputTime,
  4682. name: this.seeTemp.empname
  4683. },
  4684. {
  4685. title: '库管审核',
  4686. date: this.seeTemp.KGChargedate,
  4687. name: this.seeTemp.KGChargePerson
  4688. },
  4689. {
  4690. title: '设备主管审核',
  4691. date: this.seeTemp.equipmentdate,
  4692. name: this.seeTemp.equipmentPerson
  4693. },
  4694. {
  4695. title: '供应主管审核',
  4696. date: this.seeTemp.chargeDate,
  4697. name: this.seeTemp.chargePerson
  4698. },
  4699. {
  4700. title: '场长审核',
  4701. date: this.seeTemp.fielddate,
  4702. name: this.seeTemp.fieldPerson
  4703. },
  4704. {
  4705. title: '职能中心审核',
  4706. name: this.seeTemp.positionName,
  4707. date: this.seeTemp.positiondate,
  4708. status: 'error',
  4709. reason: reason
  4710. },
  4711. { title: '采购审核' }
  4712. ]
  4713. this.active = 6
  4714. } else if (this.seeTemp.statue === 7) {
  4715. this.activeList = [
  4716. {
  4717. title: '备件申购',
  4718. date: this.seeTemp.inputTime,
  4719. name: this.seeTemp.empname
  4720. },
  4721. {
  4722. title: '库管审核',
  4723. date: this.seeTemp.KGChargedate,
  4724. name: this.seeTemp.KGChargePerson
  4725. },
  4726. {
  4727. title: '设备主管审核',
  4728. date: this.seeTemp.equipmentdate,
  4729. name: this.seeTemp.equipmentPerson
  4730. },
  4731. {
  4732. title: '供应主管审核',
  4733. date: this.seeTemp.chargeDate,
  4734. name: this.seeTemp.chargePerson
  4735. },
  4736. {
  4737. title: '场长审核',
  4738. date: this.seeTemp.fielddate,
  4739. name: this.seeTemp.fieldPerson
  4740. },
  4741. {
  4742. title: '职能中心审核',
  4743. name: this.seeTemp.positionName,
  4744. date: this.seeTemp.positiondate
  4745. },
  4746. {
  4747. title: '采购审核',
  4748. date: this.seeTemp.CGChargedate,
  4749. name: this.seeTemp.CGChargePerson
  4750. }
  4751. ]
  4752. this.active = 7
  4753. } else if (this.seeTemp.statue === 8) {
  4754. this.activeList = [
  4755. {
  4756. title: '备件申购',
  4757. date: this.seeTemp.inputTime,
  4758. name: this.seeTemp.empname
  4759. },
  4760. {
  4761. title: '库管审核',
  4762. date: this.seeTemp.KGChargedate,
  4763. name: this.seeTemp.KGChargePerson
  4764. },
  4765. {
  4766. title: '设备主管审核',
  4767. date: this.seeTemp.equipmentdate,
  4768. name: this.seeTemp.equipmentPerson
  4769. },
  4770. {
  4771. title: '供应主管审核',
  4772. date: this.seeTemp.chargeDate,
  4773. name: this.seeTemp.chargePerson
  4774. },
  4775. {
  4776. title: '场长审核',
  4777. date: this.seeTemp.fielddate,
  4778. name: this.seeTemp.fieldPerson
  4779. },
  4780. {
  4781. title: '职能中心审核',
  4782. name: this.seeTemp.positionName,
  4783. date: this.seeTemp.positiondate
  4784. },
  4785. {
  4786. title: '采购审核',
  4787. date: this.seeTemp.CGChargedate,
  4788. name: this.seeTemp.CGChargePerson,
  4789. status: 'error',
  4790. reason: reason
  4791. }
  4792. ]
  4793. this.active = 7
  4794. }
  4795. } else {
  4796. if (this.seeTemp.statue === 2) {
  4797. this.activeList = [
  4798. {
  4799. title: '备件申购',
  4800. date: this.seeTemp.inputTime,
  4801. name: this.seeTemp.empname
  4802. },
  4803. { title: '库管审核' },
  4804. { title: '设备主管审核' },
  4805. { title: '供应主管审核' },
  4806. { title: '职能中心审核' },
  4807. { title: '采购审核' }
  4808. ]
  4809. this.active = 1
  4810. } else if (this.seeTemp.statue === 3) {
  4811. this.activeList = [
  4812. {
  4813. title: '备件申购',
  4814. date: this.seeTemp.inputTime,
  4815. name: this.seeTemp.empname
  4816. },
  4817. {
  4818. title: '库管审核',
  4819. date: this.seeTemp.KGChargedate,
  4820. name: this.seeTemp.KGChargePerson
  4821. },
  4822. { title: '设备主管审核' },
  4823. { title: '供应主管审核' },
  4824. { title: '职能中心审核' },
  4825. { title: '采购审核' }
  4826. ]
  4827. this.active = 2
  4828. } else if (this.seeTemp.statue === 4) {
  4829. this.activeList = [
  4830. {
  4831. title: '备件申购',
  4832. date: this.seeTemp.inputTime,
  4833. name: this.seeTemp.empname
  4834. },
  4835. {
  4836. title: '库管审核',
  4837. date: this.seeTemp.KGChargedate,
  4838. name: this.seeTemp.KGChargePerson,
  4839. status: 'error',
  4840. reason: reason
  4841. },
  4842. { title: '设备主管审核' },
  4843. { title: '供应主管审核' },
  4844. { title: '职能中心审核' },
  4845. { title: '采购审核' }
  4846. ]
  4847. this.active = 2
  4848. } else if (this.seeTemp.statue === 9) {
  4849. this.activeList = [
  4850. {
  4851. title: '备件申购',
  4852. date: this.seeTemp.inputTime,
  4853. name: this.seeTemp.empname
  4854. },
  4855. {
  4856. title: '库管审核',
  4857. date: this.seeTemp.KGChargedate,
  4858. name: this.seeTemp.KGChargePerson
  4859. },
  4860. {
  4861. title: '设备主管审核',
  4862. date: this.seeTemp.equipmentdate,
  4863. name: this.seeTemp.equipmentPerson
  4864. },
  4865. { title: '供应主管审核' },
  4866. { title: '职能中心审核' },
  4867. { title: '采购审核' }
  4868. ]
  4869. this.active = 3
  4870. } else if (this.seeTemp.statue === 10) {
  4871. this.activeList = [
  4872. {
  4873. title: '备件申购',
  4874. date: this.seeTemp.inputTime,
  4875. name: this.seeTemp.empname
  4876. },
  4877. {
  4878. title: '库管审核',
  4879. date: this.seeTemp.KGChargedate,
  4880. name: this.seeTemp.KGChargePerson
  4881. },
  4882. {
  4883. title: '设备主管审核',
  4884. date: this.seeTemp.equipmentdate,
  4885. name: this.seeTemp.equipmentPerson,
  4886. status: 'error',
  4887. reason: reason
  4888. },
  4889. { title: '供应主管审核' },
  4890. { title: '职能中心审核' },
  4891. { title: '采购审核' }
  4892. ]
  4893. this.active = 3
  4894. } else if (this.seeTemp.statue === 5) {
  4895. this.activeList = [
  4896. {
  4897. title: '备件申购',
  4898. date: this.seeTemp.inputTime,
  4899. name: this.seeTemp.empname
  4900. },
  4901. {
  4902. title: '库管审核',
  4903. date: this.seeTemp.KGChargedate,
  4904. name: this.seeTemp.KGChargePerson
  4905. },
  4906. {
  4907. title: '设备主管审核',
  4908. date: this.seeTemp.equipmentdate,
  4909. name: this.seeTemp.equipmentPerson
  4910. },
  4911. {
  4912. title: '供应主管审核',
  4913. date: this.seeTemp.chargeDate,
  4914. name: this.seeTemp.chargePerson
  4915. },
  4916. { title: '职能中心审核' },
  4917. { title: '采购审核' }
  4918. ]
  4919. this.active = 4
  4920. } else if (this.seeTemp.statue === 6) {
  4921. this.activeList = [
  4922. {
  4923. title: '备件申购',
  4924. date: this.seeTemp.inputTime,
  4925. name: this.seeTemp.empname
  4926. },
  4927. {
  4928. title: '库管审核',
  4929. date: this.seeTemp.KGChargedate,
  4930. name: this.seeTemp.KGChargePerson
  4931. },
  4932. {
  4933. title: '设备主管审核',
  4934. date: this.seeTemp.equipmentdate,
  4935. name: this.seeTemp.equipmentPerson
  4936. },
  4937. {
  4938. title: '供应主管审核',
  4939. date: this.seeTemp.chargeDate,
  4940. name: this.seeTemp.chargePerson,
  4941. status: 'error',
  4942. reason: reason
  4943. },
  4944. { title: '职能中心审核' },
  4945. { title: '采购审核' }
  4946. ]
  4947. this.active = 4
  4948. } else if (this.seeTemp.statue === 15) {
  4949. this.activeList = [
  4950. {
  4951. title: '备件申购',
  4952. date: this.seeTemp.inputTime,
  4953. name: this.seeTemp.empname
  4954. },
  4955. {
  4956. title: '库管审核',
  4957. date: this.seeTemp.KGChargedate,
  4958. name: this.seeTemp.KGChargePerson
  4959. },
  4960. {
  4961. title: '设备主管审核',
  4962. date: this.seeTemp.equipmentdate,
  4963. name: this.seeTemp.equipmentPerson
  4964. },
  4965. {
  4966. title: '供应主管审核',
  4967. date: this.seeTemp.chargeDate,
  4968. name: this.seeTemp.chargePerson
  4969. },
  4970. {
  4971. title: '职能中心审核',
  4972. name: this.seeTemp.positionName,
  4973. date: this.seeTemp.positiondate
  4974. },
  4975. { title: '采购审核' }
  4976. ]
  4977. this.active = 5
  4978. } else if (this.seeTemp.statue === 16) {
  4979. this.activeList = [
  4980. {
  4981. title: '备件申购',
  4982. date: this.seeTemp.inputTime,
  4983. name: this.seeTemp.empname
  4984. },
  4985. {
  4986. title: '库管审核',
  4987. date: this.seeTemp.KGChargedate,
  4988. name: this.seeTemp.KGChargePerson
  4989. },
  4990. {
  4991. title: '设备主管审核',
  4992. date: this.seeTemp.equipmentdate,
  4993. name: this.seeTemp.equipmentPerson
  4994. },
  4995. {
  4996. title: '供应主管审核',
  4997. date: this.seeTemp.chargeDate,
  4998. name: this.seeTemp.chargePerson
  4999. },
  5000. {
  5001. title: '职能中心审核',
  5002. name: this.seeTemp.positionName,
  5003. date: this.seeTemp.positiondate,
  5004. status: 'error',
  5005. reason: reason
  5006. },
  5007. { title: '采购审核' }
  5008. ]
  5009. this.active = 5
  5010. } else if (this.seeTemp.statue === 7) {
  5011. this.activeList = [
  5012. {
  5013. title: '备件申购',
  5014. date: this.seeTemp.inputTime,
  5015. name: this.seeTemp.empname
  5016. },
  5017. {
  5018. title: '库管审核',
  5019. date: this.seeTemp.KGChargedate,
  5020. name: this.seeTemp.KGChargePerson
  5021. },
  5022. {
  5023. title: '设备主管审核',
  5024. date: this.seeTemp.equipmentdate,
  5025. name: this.seeTemp.equipmentPerson
  5026. },
  5027. {
  5028. title: '供应主管审核',
  5029. date: this.seeTemp.chargeDate,
  5030. name: this.seeTemp.chargePerson
  5031. },
  5032. {
  5033. title: '职能中心审核',
  5034. name: this.seeTemp.positionName,
  5035. date: this.seeTemp.positiondate
  5036. },
  5037. {
  5038. title: '采购审核',
  5039. date: this.seeTemp.CGChargedate,
  5040. name: this.seeTemp.CGChargePerson
  5041. }
  5042. ]
  5043. this.active = 6
  5044. } else if (this.seeTemp.statue === 8) {
  5045. this.activeList = [
  5046. {
  5047. title: '备件申购',
  5048. date: this.seeTemp.inputTime,
  5049. name: this.seeTemp.empname
  5050. },
  5051. {
  5052. title: '库管审核',
  5053. date: this.seeTemp.KGChargedate,
  5054. name: this.seeTemp.KGChargePerson
  5055. },
  5056. {
  5057. title: '设备主管审核',
  5058. date: this.seeTemp.equipmentdate,
  5059. name: this.seeTemp.equipmentPerson
  5060. },
  5061. {
  5062. title: '供应主管审核',
  5063. date: this.seeTemp.chargeDate,
  5064. name: this.seeTemp.chargePerson
  5065. },
  5066. {
  5067. title: '职能中心审核',
  5068. name: this.seeTemp.positionName,
  5069. date: this.seeTemp.positiondate
  5070. },
  5071. {
  5072. title: '采购审核',
  5073. date: this.seeTemp.CGChargedate,
  5074. name: this.seeTemp.CGChargePerson,
  5075. status: 'error',
  5076. reason: reason
  5077. }
  5078. ]
  5079. this.active = 6
  5080. }
  5081. }
  5082. } else {
  5083. // 申购合单审核流程
  5084. if (this.seeTemp.statue === 2) {
  5085. this.activeList = [
  5086. {
  5087. title: '备件申购',
  5088. date: this.seeTemp.inputTime,
  5089. name: this.seeTemp.empname
  5090. },
  5091. { title: '库管审核' },
  5092. { title: '设备主管审核' },
  5093. { title: '供应主管审核' },
  5094. { title: '场长审核' },
  5095. { title: '采购审核' }
  5096. ]
  5097. this.active = 1
  5098. } else if (this.seeTemp.statue === 3) {
  5099. this.activeList = [
  5100. {
  5101. title: '备件申购',
  5102. date: this.seeTemp.inputTime,
  5103. name: this.seeTemp.empname
  5104. },
  5105. {
  5106. title: '库管审核',
  5107. date: this.seeTemp.KGChargedate,
  5108. name: this.seeTemp.KGChargePerson
  5109. },
  5110. { title: '设备主管审核' },
  5111. { title: '供应主管审核' },
  5112. { title: '场长审核' },
  5113. { title: '采购审核' }
  5114. ]
  5115. this.active = 2
  5116. } else if (this.seeTemp.statue === 4) {
  5117. this.activeList = [
  5118. {
  5119. title: '备件申购',
  5120. date: this.seeTemp.inputTime,
  5121. name: this.seeTemp.empname
  5122. },
  5123. {
  5124. title: '库管审核',
  5125. date: this.seeTemp.KGChargedate,
  5126. name: this.seeTemp.KGChargePerson,
  5127. status: 'error',
  5128. reason: reason
  5129. },
  5130. { title: '设备主管审核' },
  5131. { title: '供应主管审核' },
  5132. { title: '场长审核' },
  5133. { title: '采购审核' }
  5134. ]
  5135. this.active = 2
  5136. } else if (this.seeTemp.statue === 9) {
  5137. this.activeList = [
  5138. {
  5139. title: '备件申购',
  5140. date: this.seeTemp.inputTime,
  5141. name: this.seeTemp.empname
  5142. },
  5143. {
  5144. title: '库管审核',
  5145. date: this.seeTemp.KGChargedate,
  5146. name: this.seeTemp.KGChargePerson
  5147. },
  5148. {
  5149. title: '设备主管审核',
  5150. date: this.seeTemp.equipmentdate,
  5151. name: this.seeTemp.equipmentPerson
  5152. },
  5153. { title: '供应主管审核' },
  5154. { title: '场长审核' },
  5155. { title: '采购审核' }
  5156. ]
  5157. this.active = 3
  5158. } else if (this.seeTemp.statue === 10) {
  5159. this.activeList = [
  5160. {
  5161. title: '备件申购',
  5162. date: this.seeTemp.inputTime,
  5163. name: this.seeTemp.empname
  5164. },
  5165. {
  5166. title: '库管审核',
  5167. date: this.seeTemp.KGChargedate,
  5168. name: this.seeTemp.KGChargePerson
  5169. },
  5170. {
  5171. title: '设备主管审核',
  5172. date: this.seeTemp.equipmentdate,
  5173. name: this.seeTemp.equipmentPerson,
  5174. status: 'error',
  5175. reason: reason
  5176. },
  5177. { title: '供应主管审核' },
  5178. { title: '场长审核' },
  5179. { title: '采购审核' }
  5180. ]
  5181. this.active = 3
  5182. } else if (this.seeTemp.statue === 5) {
  5183. this.activeList = [
  5184. {
  5185. title: '备件申购',
  5186. date: this.seeTemp.inputTime,
  5187. name: this.seeTemp.empname
  5188. },
  5189. {
  5190. title: '库管审核',
  5191. date: this.seeTemp.KGChargedate,
  5192. name: this.seeTemp.KGChargePerson
  5193. },
  5194. {
  5195. title: '设备主管审核',
  5196. date: this.seeTemp.equipmentdate,
  5197. name: this.seeTemp.equipmentPerson
  5198. },
  5199. {
  5200. title: '供应主管审核',
  5201. date: this.seeTemp.chargeDate,
  5202. name: this.seeTemp.chargePerson
  5203. },
  5204. { title: '场长审核' },
  5205. { title: '采购审核' }
  5206. ]
  5207. this.active = 4
  5208. } else if (this.seeTemp.statue === 6) {
  5209. this.activeList = [
  5210. {
  5211. title: '备件申购',
  5212. date: this.seeTemp.inputTime,
  5213. name: this.seeTemp.empname
  5214. },
  5215. {
  5216. title: '库管审核',
  5217. date: this.seeTemp.KGChargedate,
  5218. name: this.seeTemp.KGChargePerson
  5219. },
  5220. {
  5221. title: '设备主管审核',
  5222. date: this.seeTemp.equipmentdate,
  5223. name: this.seeTemp.equipmentPerson
  5224. },
  5225. {
  5226. title: '供应主管审核',
  5227. date: this.seeTemp.chargeDate,
  5228. name: this.seeTemp.chargePerson,
  5229. status: 'error',
  5230. reason: reason
  5231. },
  5232. { title: '场长审核' },
  5233. { title: '采购审核' }
  5234. ]
  5235. this.active = 4
  5236. } else if (this.seeTemp.statue === 11) {
  5237. this.activeList = [
  5238. {
  5239. title: '备件申购',
  5240. date: this.seeTemp.inputTime,
  5241. name: this.seeTemp.empname
  5242. },
  5243. {
  5244. title: '库管审核',
  5245. date: this.seeTemp.KGChargedate,
  5246. name: this.seeTemp.KGChargePerson
  5247. },
  5248. {
  5249. title: '设备主管审核',
  5250. date: this.seeTemp.equipmentdate,
  5251. name: this.seeTemp.equipmentPerson
  5252. },
  5253. {
  5254. title: '供应主管审核',
  5255. date: this.seeTemp.chargeDate,
  5256. name: this.seeTemp.chargePerson
  5257. },
  5258. {
  5259. title: '场长审核',
  5260. date: this.seeTemp.fielddate,
  5261. name: this.seeTemp.fieldPerson
  5262. },
  5263. { title: '采购审核' }
  5264. ]
  5265. this.active = 5
  5266. } else if (this.seeTemp.statue === 12) {
  5267. this.activeList = [
  5268. {
  5269. title: '备件申购',
  5270. date: this.seeTemp.inputTime,
  5271. name: this.seeTemp.empname
  5272. },
  5273. {
  5274. title: '库管审核',
  5275. date: this.seeTemp.KGChargedate,
  5276. name: this.seeTemp.KGChargePerson
  5277. },
  5278. {
  5279. title: '设备主管审核',
  5280. date: this.seeTemp.equipmentdate,
  5281. name: this.seeTemp.equipmentPerson
  5282. },
  5283. {
  5284. title: '供应主管审核',
  5285. date: this.seeTemp.chargeDate,
  5286. name: this.seeTemp.chargePerson
  5287. },
  5288. {
  5289. title: '场长审核',
  5290. date: this.seeTemp.fielddate,
  5291. name: this.seeTemp.fieldPerson,
  5292. status: 'error',
  5293. reason: reason
  5294. },
  5295. { title: '采购审核' }
  5296. ]
  5297. this.active = 5
  5298. } else if (this.seeTemp.statue === 7) {
  5299. this.activeList = [
  5300. {
  5301. title: '备件申购',
  5302. date: this.seeTemp.inputTime,
  5303. name: this.seeTemp.empname
  5304. },
  5305. {
  5306. title: '库管审核',
  5307. date: this.seeTemp.KGChargedate,
  5308. name: this.seeTemp.KGChargePerson
  5309. },
  5310. {
  5311. title: '设备主管审核',
  5312. date: this.seeTemp.equipmentdate,
  5313. name: this.seeTemp.equipmentPerson
  5314. },
  5315. {
  5316. title: '供应主管审核',
  5317. date: this.seeTemp.chargeDate,
  5318. name: this.seeTemp.chargePerson
  5319. },
  5320. {
  5321. title: '场长审核',
  5322. date: this.seeTemp.fielddate,
  5323. name: this.seeTemp.fieldPerson
  5324. },
  5325. {
  5326. title: '采购审核',
  5327. date: this.seeTemp.CGChargedate,
  5328. name: this.seeTemp.CGChargePerson
  5329. }
  5330. ]
  5331. this.active = 6
  5332. } else if (this.seeTemp.statue === 8) {
  5333. this.activeList = [
  5334. {
  5335. title: '备件申购',
  5336. date: this.seeTemp.inputTime,
  5337. name: this.seeTemp.empname
  5338. },
  5339. {
  5340. title: '库管审核',
  5341. date: this.seeTemp.KGChargedate,
  5342. name: this.seeTemp.KGChargePerson
  5343. },
  5344. {
  5345. title: '设备主管审核',
  5346. date: this.seeTemp.equipmentdate,
  5347. name: this.seeTemp.equipmentPerson
  5348. },
  5349. {
  5350. title: '供应主管审核',
  5351. date: this.seeTemp.chargeDate,
  5352. name: this.seeTemp.chargePerson
  5353. },
  5354. {
  5355. title: '场长审核',
  5356. date: this.seeTemp.fielddate,
  5357. name: this.seeTemp.fieldPerson
  5358. },
  5359. {
  5360. title: '采购审核',
  5361. date: this.seeTemp.CGChargedate,
  5362. name: this.seeTemp.CGChargePerson,
  5363. status: 'error',
  5364. reason: reason
  5365. }
  5366. ]
  5367. this.active = 6
  5368. }
  5369. }
  5370. }
  5371. },
  5372. getSeeList(row) {
  5373. this.listLoadingSee = true
  5374. console.log(this.dialogStatus, '======')
  5375. if (this.dialogStatus == 'create') {
  5376. console.log(this.dialogStatus, '======')
  5377. this.getdataListSee.parammaps.reject = 1
  5378. } else {
  5379. this.getdataListSee.parammaps.reject = 0
  5380. if (this.dialogStatus == 'special') {
  5381. if (
  5382. this.createTemp.purchaseType == '1' ||
  5383. this.createTemp.purchaseType == '3'
  5384. ) {
  5385. this.getdataListSee.parammaps.reject = 1
  5386. }
  5387. }
  5388. }
  5389. if (row && row.pastureId) {
  5390. this.getdataListSee.parammaps.pastureId = row.pastureId
  5391. this.getdataListSee.parammaps.id = row.id || ''
  5392. } else {
  5393. this.getdataListSee.parammaps.pastureId = Cookies.get('pastureid')
  5394. }
  5395. GetDataByName(this.getdataListSee).then((response) => {
  5396. if (response.data.list !== null) {
  5397. console.log('查看下方table数据', response.data.list)
  5398. response.data.list.forEach((item) => {
  5399. console.log(item, 'item')
  5400. var pricearr = item.price.split(',')
  5401. this.$set(item, 'pricearr', pricearr)
  5402. var lifeCyclearr = item.lifeCycle.split(',')
  5403. this.$set(item, 'lifeCyclearr', lifeCyclearr)
  5404. var contractVarianceItemarr = item.contractVarianceItem.split(',')
  5405. this.$set(item, 'contractVarianceItemarr', contractVarianceItemarr)
  5406. })
  5407. this.listSee = response.data.list
  5408. this.listAdd = response.data.list
  5409. this.modifylist = response.data.list
  5410. var sumPrices = 0
  5411. response.data.list.forEach(function(i, j) {
  5412. sumPrices = sumPrices + parseFloat(i.price1) * parseFloat(i.amount)
  5413. })
  5414. this.$set(this.seeTemp, 'sumPrices', sumPrices)
  5415. this.$set(this.modifyTemp, 'sumPrices', sumPrices)
  5416. console.log('总价sumPrices', sumPrices)
  5417. var priceObj = false
  5418. var priceArr = []
  5419. response.data.list.forEach(function(i, j) {
  5420. if (parseFloat(i.price1) >= 500) {
  5421. priceArr.push(true)
  5422. } else {
  5423. priceArr.push(false)
  5424. }
  5425. })
  5426. if (priceArr.includes(true)) {
  5427. priceObj = true
  5428. } else {
  5429. priceObj = false
  5430. }
  5431. console.log('priceObj', priceObj)
  5432. // 总价大于2000 或单价>500
  5433. if (sumPrices >= 2000 || priceObj) {
  5434. if (this.isMilk) {
  5435. this.isApplyEx4 = true
  5436. } else {
  5437. this.isApplyEx4 = false
  5438. }
  5439. this.getFlowPath()
  5440. } else {
  5441. this.isApplyEx4 = false
  5442. this.getFlowPath()
  5443. }
  5444. for (let i = 0; i < response.data.list.length; i++) {
  5445. if (
  5446. response.data.list[i].srcpath !== null &&
  5447. response.data.list[i].picpath !== null &&
  5448. response.data.list[i].srcpath !== undefined &&
  5449. response.data.list[i].picpath !== undefined
  5450. ) {
  5451. console.log(
  5452. process.env.VUE_APP_BASE_API + response.data.list[i].srcpath,
  5453. '=======1'
  5454. )
  5455. this.listSee[i].srcpath =
  5456. process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  5457. this.listSee[i].picpath =
  5458. process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  5459. this.listAdd[i].srcpath = this.listSee[i].srcpath
  5460. this.listAdd[i].picpath = this.listSee[i].picpath
  5461. // this.seeTemp.providerName = response.data.list.providerName
  5462. this.pageNumSee = response.data.pageNum
  5463. this.pageSizeSee = response.data.pageSize
  5464. } else {
  5465. this.listSee[i].srcpath = ''
  5466. this.listSee[i].picpath = ''
  5467. this.listAdd[i].srcpath = ''
  5468. this.listAdd[i].picpath = ''
  5469. }
  5470. }
  5471. }
  5472. if (response.data.total) {
  5473. this.totalSee = response.data.total
  5474. }
  5475. setTimeout(() => {
  5476. this.listLoadingSee = false
  5477. }, 100)
  5478. })
  5479. },
  5480. form_edit(row) {
  5481. this.isMilk = false
  5482. this.edit = 0
  5483. this.getDepartParam.parammaps.pastureId = row.pastureId
  5484. this.getCreateDepartDownList()
  5485. if (row.providerId == undefined) {
  5486. row.providerId = ''
  5487. row.providerName = ''
  5488. }
  5489. this.createTemp = Object.assign({}, row) // copy obj
  5490. this.createTemp.createTime = row.inputTime
  5491. this.dialogStatus = 'update'
  5492. this.dialogFormVisible = true
  5493. this.$nextTick(() => {
  5494. this.$refs['createTemp'].clearValidate()
  5495. })
  5496. this.getdataListSee.parammaps.id = this.createTemp.id
  5497. this.getSeeList(row)
  5498. },
  5499. edit_dialog_save() {
  5500. this.isokDisable = true
  5501. setTimeout(() => {
  5502. this.isokDisable = false
  5503. }, 1000)
  5504. this.$refs['createTemp'].validate((valid) => {
  5505. if (valid) {
  5506. this.edit_dialog_saveSave()
  5507. }
  5508. })
  5509. },
  5510. edit_dialog_saveSave() {
  5511. if (this.listAdd.length !== 0) {
  5512. for (var j = 0; j < this.listAdd.length; j++) {
  5513. console.log(this.listAdd[j].amount)
  5514. // eslint-disable-next-line use-isnan
  5515. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  5516. this.$message({
  5517. type: 'warning',
  5518. message: '请检查申购数量是否未填写',
  5519. duration: 2000
  5520. })
  5521. return false
  5522. } else {
  5523. var rulesAmount = /^[1-9]\d*$/
  5524. if (!rulesAmount.test(this.listAdd[j].amount)) {
  5525. this.$message({
  5526. type: 'error',
  5527. message: '申购数量请输入正整数',
  5528. duration: 2000
  5529. })
  5530. return false
  5531. }
  5532. }
  5533. if (this.listAdd[j].price == '') {
  5534. this.$message({
  5535. type: 'warning',
  5536. message: '请检查单价是否为空',
  5537. duration: 2000
  5538. })
  5539. return false
  5540. } else {
  5541. if (parseFloat(this.listAdd[j].price) == 0) {
  5542. this.$message({
  5543. type: 'warning',
  5544. message: '价格请输入正数,最多保留小数点后五位',
  5545. duration: 2000
  5546. })
  5547. return false
  5548. } else {
  5549. console.log(this.listAdd)
  5550. if (
  5551. this.listAdd[j].contractId == '' ||
  5552. this.listAdd[j].contractId == undefined ||
  5553. parseFloat(this.listAdd[j].contractId) == 0 ||
  5554. parseFloat(this.listAdd[j].contractId) < 0
  5555. ) {
  5556. // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  5557. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  5558. if (rulesPrice.test(this.listAdd[j].price) == false) {
  5559. this.$message({
  5560. type: 'error',
  5561. message: '价格请输入正数,最多保留小数点后五位',
  5562. duration: 2000
  5563. })
  5564. return false
  5565. }
  5566. }
  5567. }
  5568. }
  5569. }
  5570. for (let i = 0; i < this.listAdd.length; i++) {
  5571. this.$set(
  5572. this.listAdd[i],
  5573. 'date',
  5574. parseTime(this.createTemp.createTime, '{y}-{m}-{d} {h}:{i}:{s}')
  5575. )
  5576. this.$set(this.listAdd[i], 'employeId', this.createTemp.employeId)
  5577. if (this.listAdd[i].reject) {
  5578. this.$set(this.listAdd[i], 'reject', this.listAdd[i].reject)
  5579. } else {
  5580. this.$set(this.listAdd[i], 'reject', 0)
  5581. }
  5582. }
  5583. this.postDataPramas.common = { returnmap: '0' }
  5584. this.postDataPramas.data = []
  5585. this.postDataPramas.data[0] = {
  5586. name: 'updatepartpurchaseCharge',
  5587. type: 'e',
  5588. parammaps: {
  5589. id: this.createTemp.id
  5590. }
  5591. }
  5592. this.postDataPramas.data[1] = {
  5593. name: 'deletePartpurchase',
  5594. type: 'e',
  5595. parammaps: {
  5596. bigId: this.createTemp.id
  5597. }
  5598. }
  5599. // eslint-disable-next-line no-irregular-whitespace
  5600. this.postDataPramas.data[2] = {
  5601. name: 'insertSpotList',
  5602. resultmaps: { list: this.listAdd }
  5603. }
  5604. this.postDataPramas.data[2].children = []
  5605. this.postDataPramas.data[2].children[0] = {
  5606. name: 'insertPartpurchase',
  5607. type: 'e',
  5608. parammaps: {
  5609. bigId: this.createTemp.id,
  5610. pastureId: '@insertSpotList.pastureId',
  5611. partId: '@insertSpotList.partId',
  5612. partCode: '@insertSpotList.partCode',
  5613. partName: '@insertSpotList.partName',
  5614. specification: '@insertSpotList.specification',
  5615. unit: '@insertSpotList.unit',
  5616. brandId: '@insertSpotList.brandId',
  5617. storageAmount: '@insertSpotList.reportery',
  5618. purpose: '@insertSpotList.purpose',
  5619. amount: '@insertSpotList.amount',
  5620. price: '@insertSpotList.price',
  5621. contractId: '@insertSpotList.contractId',
  5622. lifeCycle: '@insertSpotList.lifeCycle',
  5623. reject: '@insertSpotList.reject',
  5624. departmentId: this.createTemp.departmentId,
  5625. date: this.createTemp.inputTime,
  5626. employeId: this.createTemp.employeId,
  5627. contractVarianceItem: '@insertSpotList.contractVarianceItem'
  5628. // partpurchase:''
  5629. }
  5630. }
  5631. ExecDataByConfig(this.postDataPramas).then((response) => {
  5632. console.log('编辑保存发送参数', this.postDataPramas)
  5633. if (response.msg === 'fail') {
  5634. this.$notify({
  5635. title: '保存失败',
  5636. message: response.data,
  5637. type: 'warning',
  5638. duration: 2000
  5639. })
  5640. } else {
  5641. this.dialogFormVisible = false
  5642. this.getdataListParm.parammaps.inputDatetime = ''
  5643. this.get_table_data()
  5644. this.$notify({
  5645. title: '',
  5646. message: '保存成功',
  5647. type: 'success',
  5648. duration: 2000
  5649. })
  5650. }
  5651. })
  5652. return true
  5653. } else {
  5654. this.$message({
  5655. title: '',
  5656. message: '请选择备件',
  5657. type: 'warning',
  5658. duration: 2000
  5659. })
  5660. return false
  5661. }
  5662. },
  5663. get_select_list() {
  5664. GetDataByNames(this.requestParams).then((response) => {
  5665. this.findAllProvider = response.data.findAllProvider.list
  5666. this.findAllPasture = response.data.findAllMainPasture.list
  5667. this.findAllEmploye = response.data.findAllEmploye.list
  5668. this.onlineSubscriptionList = response.data.getflexProviderList.list
  5669. this.getdataListParm.parammaps.pastureArr = this.findAllPasture.map(item => {
  5670. return item.name
  5671. })
  5672. this.getDepartDownList()
  5673. this.get_table_data()
  5674. })
  5675. },
  5676. getDepartDownList() {
  5677. this.getDepartParam.parammaps.pastureId =this.getdataListParm.parammaps.pastureId || Cookies.get('pastureid')
  5678. GetDataByName(this.getDepartParam).then((response) => {
  5679. this.findAllDepart = response.data.list
  5680. })
  5681. },
  5682. changePastureName(item) {
  5683. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(
  5684. (obj) => obj.name == item
  5685. ).id
  5686. this.getdataListParm.parammaps.departmentId = ''
  5687. this.getDepartDownList()
  5688. },
  5689. getCreateDepartDownList() {
  5690. GetDataByName(this.getDepartParam).then((response) => {
  5691. this.createDepartList = response.data.list
  5692. if (this.edit == 1) {
  5693. if (
  5694. this.createDepartList.find(
  5695. (obj) => obj.id == Cookies.get('departmentid')
  5696. )
  5697. ) {
  5698. // 如果是新增并且在挤奶处 则申请部门名称和id为数组的第一个 TODO:
  5699. if (this.isDepartmentId) {
  5700. this.createTemp.departmentId = this.createDepartList[0].id
  5701. this.createTemp.departmentName = this.createDepartList[0].name
  5702. } else {
  5703. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  5704. this.createTemp.departmentName = this.createDepartList.find(
  5705. (obj) => obj.id == Cookies.get('departmentid')
  5706. ).name
  5707. }
  5708. } else {
  5709. this.createTemp.departmentId = response.data.list[0].id
  5710. this.createTemp.departmentName = response.data.list[0].name
  5711. }
  5712. if (this.isMilk) {
  5713. console.log('milk')
  5714. this.createTemp.departmentName = '挤奶处'
  5715. this.createTemp.departmentId = this.createDepartList.find(
  5716. (obj) => obj.name == this.createTemp.departmentName
  5717. ).id
  5718. }
  5719. }
  5720. })
  5721. },
  5722. changePasture(item) {
  5723. this.getDepartParam.parammaps.pastureId = item
  5724. this.edit = 1
  5725. this.getCreateDepartDownList()
  5726. },
  5727. changeDepart(item) {
  5728. this.createTemp.departmentName = this.createDepartList.find(
  5729. (obj) => obj.id == item
  5730. ).name
  5731. },
  5732. handleDownload() {
  5733. console.log('点击了下载')
  5734. this.$alert(
  5735. '备件申购正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出',
  5736. {}
  5737. )
  5738. this.isPercentage = true
  5739. this.percentage = 1
  5740. var timer = setInterval(() => {
  5741. this.percentage += 5
  5742. if (this.percentage > 95) {
  5743. this.percentage = 99
  5744. clearInterval(timer)
  5745. }
  5746. this.percentage = this.percentage
  5747. }, 1000)
  5748. this.downloadParam.name = 'downloadPartpurchaseList'
  5749. this.downloadParam.parammaps = this.getdataListParm.parammaps
  5750. GetAccount(this.downloadParam).then((response) => {
  5751. if (response.data.list !== '') {
  5752. this.percentage = 99
  5753. setTimeout(() => {
  5754. this.isPercentage = false
  5755. }, 2000)
  5756. }
  5757. this.$nextTick(() => {
  5758. const ExcelDatas = [
  5759. {
  5760. tHeader: [
  5761. '牧场',
  5762. '申购单号',
  5763. '申购时间',
  5764. '备件编号',
  5765. '备件名称',
  5766. '规格型号',
  5767. '品牌',
  5768. '单位',
  5769. '申购数量',
  5770. '申购部门',
  5771. '申购人',
  5772. '备注'
  5773. ],
  5774. filterVal: [
  5775. 'pastureName',
  5776. 'orderNumber',
  5777. 'inputTime',
  5778. 'partCode',
  5779. 'partName',
  5780. 'specification',
  5781. 'brandName',
  5782. 'unit',
  5783. 'amount',
  5784. 'departmentName',
  5785. 'empname',
  5786. 'purpose'
  5787. ],
  5788. tableDatas: response.data.list,
  5789. sheetName: '备件申购'
  5790. }
  5791. ]
  5792. json2excel(ExcelDatas, '备件申购', true, 'xlsx')
  5793. })
  5794. })
  5795. },
  5796. form_delete(row) {
  5797. console.log('点击了删除')
  5798. MessageBox.confirm('确认删除此条信息?', {
  5799. confirmButtonText: '确认',
  5800. cancelButtonText: '取消',
  5801. type: 'warning'
  5802. })
  5803. .then(() => {
  5804. this.postDataPramas.common = { returnmap: '0' }
  5805. this.postDataPramas.data = []
  5806. this.postDataPramas.data[0] = {
  5807. name: 'deleteBigPartpurchase',
  5808. type: 'e',
  5809. parammaps: {
  5810. id: row.id
  5811. }
  5812. }
  5813. this.postDataPramas.data[1] = {
  5814. name: 'deletePartpurchase',
  5815. type: 'e',
  5816. parammaps: {
  5817. bigId: row.id
  5818. }
  5819. }
  5820. ExecDataByConfig(this.postDataPramas).then((response) => {
  5821. this.get_table_data()
  5822. this.$notify({
  5823. title: '成功',
  5824. message: '删除成功',
  5825. type: 'success',
  5826. duration: 2000
  5827. })
  5828. })
  5829. })
  5830. .catch(() => {
  5831. this.$message({
  5832. type: 'info',
  5833. message: '已取消删除'
  5834. })
  5835. })
  5836. },
  5837. handleExamine1(row) {
  5838. console.log('点击了库管审核')
  5839. if (row == undefined) {
  5840. this.examineTemp = this.seeTemp
  5841. this.$set(this.seeTemp, 'statue', 1)
  5842. this.$set(this.seeTemp, 'workflowNote', '')
  5843. } else {
  5844. this.examineTemp = Object.assign({}, row)
  5845. this.$set(this.examineTemp, 'statue', 1)
  5846. this.$set(this.examineTemp, 'workflowNote', '')
  5847. }
  5848. this.dialogStatus = 'examine1'
  5849. this.dialogFormVisible_Examine = true
  5850. this.statueReason = false
  5851. },
  5852. changeStatue(val) {
  5853. if (val == 2) {
  5854. this.statueReason = true
  5855. } else {
  5856. this.statueReason = false
  5857. }
  5858. },
  5859. createExamineData1() {
  5860. console.log('点击了库管审核')
  5861. this.isokDisable = true
  5862. setTimeout(() => {
  5863. this.isokDisable = false
  5864. }, 1000)
  5865. this.$refs['examineTemp'].validate((valid) => {
  5866. if (valid) {
  5867. this.requestParam = {}
  5868. this.requestParam.name = 'partpurchaseCharge'
  5869. this.requestParam.parammaps = {}
  5870. this.requestParam.parammaps.id = this.examineTemp.id
  5871. if (this.examineTemp.statue == 1) {
  5872. this.requestParam.parammaps.statue = 3
  5873. } else if (this.examineTemp.statue == 2) {
  5874. this.requestParam.parammaps.statue = 4
  5875. }
  5876. this.requestParam.parammaps.empId = Cookies.get('employeid')
  5877. this.requestParam.parammaps.workflowNote =
  5878. this.examineTemp.workflowNote
  5879. PostDataByName(this.requestParam).then((response) => {
  5880. console.log('审核确认发送参数', this.requestParam)
  5881. this.isokDisable = false
  5882. if (response.msg !== 'fail') {
  5883. // this.get_table_data()
  5884. this.dialogFormVisible_Examine = false
  5885. this.handleCancel()
  5886. this.statueReason = false
  5887. this.$notify({
  5888. title: '成功',
  5889. message: '审核成功',
  5890. type: 'success',
  5891. duration: 2000
  5892. })
  5893. } else {
  5894. failproccess(response, this.$notify, 1)
  5895. }
  5896. })
  5897. }
  5898. })
  5899. },
  5900. handleExamine2(row) {
  5901. console.log('点击了设备主管审核')
  5902. if (row == undefined) {
  5903. this.examineTemp = this.seeTemp
  5904. this.$set(this.seeTemp, 'statue', 1)
  5905. this.$set(this.seeTemp, 'workflowNote', '')
  5906. } else {
  5907. this.examineTemp = Object.assign({}, row)
  5908. this.$set(this.examineTemp, 'statue', 1)
  5909. this.$set(this.examineTemp, 'workflowNote', '')
  5910. }
  5911. this.dialogStatus = 'examine2'
  5912. this.dialogFormVisible_Examine = true
  5913. this.statueReason = false
  5914. },
  5915. createExamineData2() {
  5916. console.log('点击了设备主管审核')
  5917. this.isokDisable = true
  5918. setTimeout(() => {
  5919. this.isokDisable = false
  5920. }, 1000)
  5921. this.$refs['examineTemp'].validate((valid) => {
  5922. if (valid) {
  5923. this.requestParam = {}
  5924. this.requestParam.name = 'partpurchaseEquipment'
  5925. this.requestParam.parammaps = {}
  5926. this.requestParam.parammaps.id = this.examineTemp.id
  5927. if (this.examineTemp.statue == 1) {
  5928. this.requestParam.parammaps.statue = 9
  5929. } else if (this.examineTemp.statue == 2) {
  5930. this.requestParam.parammaps.statue = 10
  5931. }
  5932. this.requestParam.parammaps.empId = Cookies.get('employeid')
  5933. this.requestParam.parammaps.workflowNote =
  5934. this.examineTemp.workflowNote
  5935. PostDataByName(this.requestParam).then((response) => {
  5936. this.isokDisable = false
  5937. console.log('审核确认发送参数', this.requestParam)
  5938. if (response.msg !== 'fail') {
  5939. // this.get_table_data()
  5940. this.dialogFormVisible_Examine = false
  5941. this.handleCancel()
  5942. this.statueReason = false
  5943. this.$notify({
  5944. title: '成功',
  5945. message: '审核成功',
  5946. type: 'success',
  5947. duration: 2000
  5948. })
  5949. } else {
  5950. failproccess(response, this.$notify, 1)
  5951. }
  5952. })
  5953. }
  5954. })
  5955. },
  5956. handleExamine3(row) {
  5957. console.log('点击了供应主管审核')
  5958. if (row == undefined) {
  5959. this.examineTemp = this.seeTemp
  5960. this.$set(this.seeTemp, 'statue', 1)
  5961. this.$set(this.seeTemp, 'workflowNote', '')
  5962. this.getdataListSee.parammaps.id = this.seeTemp.id
  5963. } else {
  5964. this.examineTemp = Object.assign({}, row)
  5965. this.getdataListSee.parammaps.id = this.examineTemp.id
  5966. this.$set(this.examineTemp, 'statue', 1)
  5967. this.$set(this.examineTemp, 'workflowNote', '')
  5968. }
  5969. this.getSeeList(row)
  5970. this.dialogStatus = 'examine3'
  5971. this.dialogFormVisible_Examine = true
  5972. this.statueReason = false
  5973. },
  5974. createExamineData3() {
  5975. console.log('点击了供应主管审核', this.examineTemp.statue)
  5976. console.log(this.examineTemp.purchase_type, '=====')
  5977. console.log(this.isApplyEx4, '=====')
  5978. this.isokDisable = true
  5979. setTimeout(() => {
  5980. this.isokDisable = false
  5981. }, 1000)
  5982. this.$refs['examineTemp'].validate((valid) => {
  5983. if (valid) {
  5984. this.requestParam = {}
  5985. this.requestParam.name = 'partpurchaseCharge3'
  5986. this.requestParam.parammaps = {}
  5987. this.requestParam.parammaps.id = this.examineTemp.id
  5988. if (this.examineTemp.statue == 1) {
  5989. this.requestParam.parammaps.statue = 5
  5990. // if(this.examineTemp.purchase_type !== 1 && this.examineTemp.purchase_type !== 3){
  5991. // console.log(this.isApplyEx4,'=====')
  5992. // if(this.isApplyEx4 == true){
  5993. // this.requestParam.parammaps.statue = 5
  5994. // }else{
  5995. // this.requestParam.parammaps.statue = 11
  5996. // }
  5997. // }else{
  5998. // this.requestParam.parammaps.statue = 5
  5999. // }
  6000. } else if (this.examineTemp.statue == 2) {
  6001. // if(this.examineTemp.purchase_type !== 1 && this.examineTemp.purchase_type !== 3){
  6002. // if(this.isApplyEx4 == true){
  6003. // this.requestParam.parammaps.statue = 6
  6004. // }else{
  6005. // this.requestParam.parammaps.statue = 12
  6006. // }
  6007. // }else{
  6008. // this.requestParam.parammaps.statue = 6
  6009. // }
  6010. this.requestParam.parammaps.statue = 6
  6011. }
  6012. this.requestParam.parammaps.empId = Cookies.get('employeid')
  6013. this.requestParam.parammaps.workflowNote =
  6014. this.examineTemp.workflowNote
  6015. // return false
  6016. PostDataByName(this.requestParam).then((response) => {
  6017. console.log('审核确认发送参数', this.requestParam)
  6018. this.isokDisable = false
  6019. if (response.msg !== 'fail') {
  6020. // this.get_table_data()
  6021. this.dialogFormVisible_Examine = false
  6022. this.handleCancel()
  6023. this.statueReason = false
  6024. this.$notify({
  6025. title: '成功',
  6026. message: '审核成功',
  6027. type: 'success',
  6028. duration: 2000
  6029. })
  6030. } else {
  6031. failproccess(response, this.$notify, 1)
  6032. }
  6033. })
  6034. }
  6035. })
  6036. },
  6037. handleExamine4(row) {
  6038. console.log('点击了场长审核')
  6039. if (row == undefined) {
  6040. this.examineTemp = this.seeTemp
  6041. this.$set(this.seeTemp, 'statue', 1)
  6042. this.$set(this.seeTemp, 'workflowNote', '')
  6043. } else {
  6044. this.examineTemp = Object.assign({}, row)
  6045. this.$set(this.examineTemp, 'workflowNote', '')
  6046. this.$set(this.examineTemp, 'statue', 1)
  6047. }
  6048. this.dialogStatus = 'examine4'
  6049. this.dialogFormVisible_Examine = true
  6050. this.statueReason = false
  6051. },
  6052. createExamineData4() {
  6053. console.log('点击了场长审核')
  6054. this.isokDisable = true
  6055. setTimeout(() => {
  6056. this.isokDisable = false
  6057. }, 1000)
  6058. this.$refs['examineTemp'].validate((valid) => {
  6059. if (valid) {
  6060. this.requestParam = {}
  6061. this.requestParam.parammaps = {}
  6062. this.requestParam.common = { returnmap: '0' }
  6063. this.requestParam.data = []
  6064. // 通过
  6065. if (this.examineTemp.statue == 1) {
  6066. this.requestParam.data[0] = {
  6067. name: 'partpurchaseField',
  6068. type: 'e',
  6069. parammaps: {
  6070. id: this.examineTemp.id,
  6071. statue: 11,
  6072. field: Cookies.get('employeid'),
  6073. workflowNote: this.examineTemp.workflowNote
  6074. }
  6075. }
  6076. this.requestParam.data[1] = {
  6077. name: 'createBuydetailBySG',
  6078. type: 'e',
  6079. parammaps: {
  6080. id: this.examineTemp.id,
  6081. pastureId: this.examineTemp.pastureId
  6082. }
  6083. }
  6084. // 不通过
  6085. } else if (this.examineTemp.statue == 2) {
  6086. this.requestParam.data[0] = {
  6087. name: 'partpurchaseField',
  6088. type: 'e',
  6089. parammaps: {
  6090. id: this.examineTemp.id,
  6091. statue: 12,
  6092. field: Cookies.get('employeid'),
  6093. workflowNote: this.examineTemp.workflowNote
  6094. }
  6095. }
  6096. }
  6097. ExecDataByConfig(this.requestParam).then((response) => {
  6098. this.isokDisable = false
  6099. if (response.msg !== 'fail') {
  6100. // this.get_table_data()
  6101. this.dialogFormVisible_Examine = false
  6102. this.handleCancel()
  6103. // this.dialogFormVisible_See = false
  6104. // this.dialogFormVisible2 = false
  6105. this.statueReason = false
  6106. this.$notify({
  6107. title: '成功',
  6108. message: '审核成功',
  6109. type: 'success',
  6110. duration: 2000
  6111. })
  6112. } else {
  6113. failproccess(response, this.$notify, 1)
  6114. }
  6115. })
  6116. }
  6117. })
  6118. },
  6119. handleExamine5(row) {
  6120. console.log('点击了采购审核')
  6121. if (row == undefined) {
  6122. this.examineTemp = this.seeTemp
  6123. this.$set(this.seeTemp, 'statue', 1)
  6124. this.$set(this.seeTemp, 'workflowNote', '')
  6125. } else {
  6126. this.examineTemp = Object.assign({}, row)
  6127. this.$set(this.examineTemp, 'workflowNote', '')
  6128. this.$set(this.examineTemp, 'statue', 1)
  6129. }
  6130. this.dialogStatus = 'examine5'
  6131. this.dialogFormVisible_Examine = true
  6132. this.statueReason = false
  6133. },
  6134. createExamineData5() {
  6135. console.log('点击了采购审核')
  6136. this.isokDisable = true
  6137. setTimeout(() => {
  6138. this.isokDisable = false
  6139. }, 10000)
  6140. this.$refs['examineTemp'].validate((valid) => {
  6141. if (valid) {
  6142. this.requestParam = {}
  6143. this.requestParam.parammaps = {}
  6144. this.requestParam.common = { returnmap: '0' }
  6145. this.requestParam.data = []
  6146. if (this.examineTemp.purchase_type == 1) {
  6147. if (this.examineTemp.statue == 1) {
  6148. this.requestParam.data[0] = {
  6149. name: 'partpurchaseCharge1V2',
  6150. type: 'e',
  6151. parammaps: {
  6152. id: this.examineTemp.id,
  6153. statue: 7,
  6154. empId: Cookies.get('employeid'),
  6155. workflowNote: this.examineTemp.workflowNote
  6156. }
  6157. }
  6158. } else if (this.examineTemp.statue == 2) {
  6159. this.requestParam.data[0] = {
  6160. name: 'partpurchaseCharge1V2',
  6161. type: 'e',
  6162. parammaps: {
  6163. id: this.examineTemp.id,
  6164. statue: 8,
  6165. empId: Cookies.get('employeid'),
  6166. workflowNote: this.examineTemp.workflowNote
  6167. }
  6168. }
  6169. }
  6170. } else {
  6171. if (this.examineTemp.statue == 1) {
  6172. this.requestParam.data[0] = {
  6173. name: 'partpurchaseCharge1',
  6174. type: 'e',
  6175. parammaps: {
  6176. id: this.examineTemp.id,
  6177. statue: 7,
  6178. empId: Cookies.get('employeid'),
  6179. workflowNote: this.examineTemp.workflowNote
  6180. }
  6181. }
  6182. this.requestParam.data[1] = {
  6183. name: 'createBuydetailBySG',
  6184. type: 'e',
  6185. parammaps: {
  6186. id: this.examineTemp.id,
  6187. pastureId: this.examineTemp.pastureId
  6188. }
  6189. }
  6190. } else if (this.examineTemp.statue == 2) {
  6191. this.requestParam.data[0] = {
  6192. name: 'partpurchaseCharge1',
  6193. type: 'e',
  6194. parammaps: {
  6195. id: this.examineTemp.id,
  6196. statue: 8,
  6197. empId: Cookies.get('employeid'),
  6198. workflowNote: this.examineTemp.workflowNote
  6199. }
  6200. }
  6201. }
  6202. }
  6203. ExecDataByConfig(this.requestParam).then((response) => {
  6204. this.isokDisable = false
  6205. if (response.msg !== 'fail') {
  6206. // this.get_table_data()
  6207. this.dialogFormVisible_Examine = false
  6208. this.handleCancel()
  6209. this.statueReason = false
  6210. this.$notify({
  6211. title: '成功',
  6212. message: '审核成功',
  6213. type: 'success',
  6214. duration: 2000
  6215. })
  6216. } else {
  6217. failproccess(response, this.$notify, 1)
  6218. }
  6219. })
  6220. }
  6221. })
  6222. },
  6223. handleExamine6(row) {
  6224. console.log('点击了财务审核')
  6225. if (row == undefined) {
  6226. this.examineTemp = this.seeTemp
  6227. this.$set(this.seeTemp, 'statue', 1)
  6228. this.$set(this.seeTemp, 'workflowNote', '')
  6229. } else {
  6230. this.examineTemp = Object.assign({}, row)
  6231. this.$set(this.examineTemp, 'workflowNote', '')
  6232. this.$set(this.examineTemp, 'statue', 1)
  6233. }
  6234. this.dialogStatus = 'examine6'
  6235. this.dialogFormVisible_Examine = true
  6236. this.statueReason = false
  6237. },
  6238. createExamineData6() {
  6239. console.log('点击了财务审核')
  6240. this.isokDisable = true
  6241. setTimeout(() => {
  6242. this.isokDisable = false
  6243. }, 10000)
  6244. this.$refs['examineTemp'].validate((valid) => {
  6245. if (valid) {
  6246. this.requestParam = {}
  6247. this.requestParam.name = 'partpurchaseFinanceId1'
  6248. this.requestParam.parammaps = {}
  6249. this.requestParam.parammaps.id = this.examineTemp.id
  6250. if (this.examineTemp.statue == 1) {
  6251. this.requestParam.parammaps.statue = 13
  6252. } else if (this.examineTemp.statue == 2) {
  6253. this.requestParam.parammaps.statue = 14
  6254. }
  6255. this.requestParam.parammaps.financeId = Cookies.get('employeid')
  6256. this.requestParam.parammaps.workflowNote =
  6257. this.examineTemp.workflowNote
  6258. PostDataByName(this.requestParam).then((response) => {
  6259. console.log('审核确认发送参数', this.requestParam)
  6260. this.isokDisable = false
  6261. if (response.msg !== 'fail') {
  6262. // this.get_table_data()
  6263. this.dialogFormVisible_Examine = false
  6264. this.handleCancel()
  6265. this.statueReason = false
  6266. this.$notify({
  6267. title: '成功',
  6268. message: '审核成功',
  6269. type: 'success',
  6270. duration: 2000
  6271. })
  6272. } else {
  6273. failproccess(response, this.$notify, 1)
  6274. }
  6275. })
  6276. }
  6277. })
  6278. },
  6279. handleExamine7(row) {
  6280. console.log('点击了奶厅职能中心审核')
  6281. if (row == undefined) {
  6282. this.examineTemp = this.seeTemp
  6283. this.$set(this.seeTemp, 'statue', 1)
  6284. this.$set(this.seeTemp, 'workflowNote', '')
  6285. } else {
  6286. this.examineTemp = Object.assign({}, row)
  6287. this.$set(this.examineTemp, 'workflowNote', '')
  6288. this.$set(this.examineTemp, 'statue', 1)
  6289. }
  6290. this.dialogStatus = 'examine7'
  6291. this.dialogFormVisible_Examine = true
  6292. this.statueReason = false
  6293. },
  6294. createExamineData7() {
  6295. console.log('点击了奶厅职能中心审核')
  6296. this.isokDisable = true
  6297. setTimeout(() => {
  6298. this.isokDisable = false
  6299. }, 10000)
  6300. this.$refs['examineTemp'].validate((valid) => {
  6301. if (valid) {
  6302. this.requestParam = {}
  6303. this.requestParam.name = 'partpurchasePosition'
  6304. this.requestParam.parammaps = {}
  6305. this.requestParam.parammaps.id = this.examineTemp.id
  6306. if (this.examineTemp.statue == 1) {
  6307. this.requestParam.parammaps.statue = 15
  6308. } else if (this.examineTemp.statue == 2) {
  6309. this.requestParam.parammaps.statue = 16
  6310. }
  6311. this.requestParam.parammaps.empId = Cookies.get('employeid')
  6312. this.requestParam.parammaps.workflowNote =
  6313. this.examineTemp.workflowNote
  6314. PostDataByName(this.requestParam).then((response) => {
  6315. console.log('审核确认发送参数', this.requestParam)
  6316. this.isokDisable = false
  6317. if (response.msg !== 'fail') {
  6318. // this.get_table_data()
  6319. this.dialogFormVisible_Examine = false
  6320. this.handleCancel()
  6321. this.statueReason = false
  6322. this.$notify({
  6323. title: '成功',
  6324. message: '审核成功',
  6325. type: 'success',
  6326. duration: 2000
  6327. })
  6328. } else {
  6329. failproccess(response, this.$notify, 1)
  6330. }
  6331. })
  6332. }
  6333. })
  6334. },
  6335. handle_specialSubscription() {
  6336. this.getdataListSee.parammaps.id = ''
  6337. this.resetCreateTemp()
  6338. this.listAdd = []
  6339. this.createTemp.purchaseType = '1'
  6340. this.edit = 1
  6341. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  6342. this.getCreateDepartDownList()
  6343. this.dialogStatus = 'special'
  6344. this.createTemp.purchaseType = '3'
  6345. this.dialogFormVisible2 = true
  6346. this.$nextTick(() => {
  6347. this.$refs['createTemp'].clearValidate()
  6348. })
  6349. if (this.createTemp.purchaseType == 1) {
  6350. this.getBigPartpurchase(parseInt(this.createTemp.purchaseType))
  6351. } else {
  6352. this.getCreateNumber()
  6353. }
  6354. },
  6355. getProviderList() {
  6356. const data = {
  6357. name: 'getProviderList',
  6358. page: 1,
  6359. offset: 1,
  6360. pagecount: 0,
  6361. returntype: 'Map',
  6362. parammaps: { providerName: '' }
  6363. }
  6364. GetDataByName(data).then((response) => {
  6365. if (response.data.list !== null) {
  6366. this.providerList = response.data.list
  6367. } else {
  6368. this.providerList = []
  6369. }
  6370. })
  6371. },
  6372. changeType() {
  6373. if (this.createTemp.purchaseType == 1) {
  6374. // setTimeout(()=>{
  6375. this.getBigPartpurchase(parseInt(this.createTemp.purchaseType))
  6376. // },30000)
  6377. } else {
  6378. this.createTemp.orderNumber = ''
  6379. this.getCreateNumber()
  6380. }
  6381. this.listAdd = []
  6382. this.$set(this.createTemp, 'providerId', '')
  6383. this.$set(this.createTemp, 'providerName', '')
  6384. },
  6385. special_dialog_save() {
  6386. console.log('特殊申购保存')
  6387. this.isokDisable = true
  6388. setTimeout(() => {
  6389. this.isokDisable = false
  6390. }, 1000)
  6391. this.$refs['createTemp'].validate((valid) => {
  6392. if (valid) {
  6393. console.log(this.listAdd)
  6394. if (
  6395. this.createTemp.orderNumber == '' ||
  6396. this.createTemp.orderNumber == null ||
  6397. this.createTemp.orderNumber == undefined
  6398. ) {
  6399. GetDataByName(this.getParmCreateNumber).then((response) => {
  6400. this.$nextTick(() => {
  6401. console.log('新增申购单号', response.data.list[0].orderCode)
  6402. this.createTemp.orderNumber = response.data.list[0].orderCode
  6403. this.$forceUpdate()
  6404. this.special_dialog_saveSave()
  6405. })
  6406. })
  6407. } else {
  6408. this.special_dialog_saveSave()
  6409. }
  6410. }
  6411. })
  6412. },
  6413. special_dialog_saveSave() {
  6414. if (this.listAdd.length !== 0) {
  6415. for (var j = 0; j < this.listAdd.length; j++) {
  6416. console.log(this.listAdd[j].amount)
  6417. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  6418. this.$message({
  6419. type: 'warning',
  6420. message: '请检查申购数量是否未填写',
  6421. duration: 2000
  6422. })
  6423. return false
  6424. } else {
  6425. var rulesAmount = /^[1-9]\d*$/
  6426. if (!rulesAmount.test(this.listAdd[j].amount)) {
  6427. this.$message({
  6428. type: 'error',
  6429. message: '申购数量请输入正整数',
  6430. duration: 2000
  6431. })
  6432. return false
  6433. }
  6434. }
  6435. if (this.createTemp.purchaseType == '2') {
  6436. if (this.listAdd[j].price == '') {
  6437. this.$message({
  6438. type: 'warning',
  6439. message: '请检查单价是否为空',
  6440. duration: 2000
  6441. })
  6442. return false
  6443. } else {
  6444. if (parseFloat(this.listAdd[j].price) == 0) {
  6445. this.$message({
  6446. type: 'warning',
  6447. message: '价格请输入正数,最多保留小数点后五位',
  6448. duration: 2000
  6449. })
  6450. return false
  6451. } else {
  6452. if (
  6453. this.listAdd[j].contractId == '' ||
  6454. this.listAdd[j].contractId == undefined ||
  6455. parseFloat(this.listAdd[j].contractId) == 0 ||
  6456. parseFloat(this.listAdd[j].contractId) < 0
  6457. ) {
  6458. // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  6459. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  6460. if (rulesPrice.test(this.listAdd[j].price) == false) {
  6461. this.$message({
  6462. type: 'error',
  6463. message: '价格请输入正数,最多保留小数点后五位',
  6464. duration: 2000
  6465. })
  6466. return false
  6467. }
  6468. }
  6469. }
  6470. }
  6471. }
  6472. }
  6473. if (
  6474. this.createTemp.purchaseType == '1' ||
  6475. this.createTemp.purchaseType == '3'
  6476. ) {
  6477. if (this.createTemp.providerId == '') {
  6478. this.$message({
  6479. type: 'error',
  6480. message: '请选择供应商',
  6481. duration: 2000
  6482. })
  6483. return false
  6484. }
  6485. } else {
  6486. // if(this.createTemp.providerId == ''){
  6487. // this.$message({ type: 'error', message: '请选择供应商', duration: 2000 })
  6488. // return false
  6489. // }
  6490. if (this.createTemp.funderId == '') {
  6491. this.$message({
  6492. type: 'error',
  6493. message: '请选择垫付人',
  6494. duration: 2000
  6495. })
  6496. return false
  6497. }
  6498. }
  6499. if (this.createTemp.purchaseType == 1) {
  6500. if (this.createTemp.markBackend) {
  6501. console.log('有数据-走新保存', this.listAdd)
  6502. const url = 'authdata/partpurchase/edit'
  6503. this.providerNames = this.providerList.find(
  6504. (obj) => obj.id == this.createTemp.providerId
  6505. ).providerName
  6506. const dataArr = []
  6507. console.log(this.listAdd, 'hss===3//')
  6508. for (let i = 0; i < this.listAdd.length; i++) {
  6509. // 价格判断
  6510. if (parseFloat(this.listAdd[i].price) == 0 || this.listAdd[i].price == '') {
  6511. this.$message({
  6512. type: 'warning',
  6513. message: '价格请输入正数,最多保留小数点后五位',
  6514. duration: 2000
  6515. })
  6516. return false
  6517. }
  6518. if (this.listAdd[i].myId !== undefined) {
  6519. this.listAdd[i].id = 0
  6520. }
  6521. const obj = {
  6522. id: parseFloat(this.listAdd[i].id),
  6523. contractId: this.listAdd[i].contractId.toString(),
  6524. providerName: this.providerNames,
  6525. providerId: this.createTemp.providerId,
  6526. bigId: parseFloat(this.createTemp.bigId),
  6527. pastureId: parseFloat(this.listAdd[i].pastureId),
  6528. partId: parseFloat(this.listAdd[i].partId),
  6529. partCode: this.listAdd[i].partCode.toString(),
  6530. partName: this.listAdd[i].partName.toString(),
  6531. specification: this.listAdd[i].specification,
  6532. amount: parseFloat(this.listAdd[i].amount),
  6533. unit: this.listAdd[i].unit.toString(),
  6534. brandId: parseFloat(this.listAdd[i].brandId),
  6535. purpose: this.listAdd[i].purpose.toString(),
  6536. price: this.listAdd[i].price.toString(),
  6537. lifeCycle: this.listAdd[i].lifeCycle.toString(),
  6538. contractVarianceItem:
  6539. this.listAdd[i].contractVarianceItem.toString(),
  6540. departmentId: this.createTemp.departmentId.toString(),
  6541. date: parseTime(
  6542. this.createTemp.createTime,
  6543. '{y}-{m}-{d} {h}:{i}:{s}'
  6544. ).toString(),
  6545. employeId: parseFloat(this.createTemp.employeId)
  6546. }
  6547. // if (this.listAdd[i].contractId) {
  6548. // this.$set(
  6549. // this.listAdd[i],
  6550. // 'contractId',
  6551. // this.listAdd[i].contractId.toString()
  6552. // )
  6553. // } else {
  6554. // this.$set(this.listAdd[i], 'contractId', '')
  6555. // }
  6556. if (this.listAdd[i].storageAmount) {
  6557. obj.storageAmount = parseFloat(this.listAdd[i].storageAmount)
  6558. } else {
  6559. obj.storageAmount = 0
  6560. }
  6561. if (this.listAdd[i].reject) {
  6562. obj.reject = this.listAdd[i].reject.toString()
  6563. } else {
  6564. obj.reject = ''
  6565. }
  6566. if (this.listAdd[i].explain) {
  6567. obj.explain = this.listAdd[i].explain.toString()
  6568. } else {
  6569. obj.explain = ''
  6570. }
  6571. dataArr.push(obj)
  6572. }
  6573. const data = dataArr
  6574. console.log(data, 'hss===2//')
  6575. postJson(url, data).then((response) => {
  6576. if (response.msg !== 'fail') {
  6577. this.get_table_data()
  6578. this.dialogFormVisible2 = false
  6579. this.$notify({
  6580. title: '成功',
  6581. message: '保存成功',
  6582. type: 'success',
  6583. duration: 2000
  6584. })
  6585. } else {
  6586. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  6587. }
  6588. })
  6589. } else {
  6590. console.log('无数据-走原有保存')
  6591. this.special_saveSave()
  6592. }
  6593. } else {
  6594. console.log('赠品-走原有保存')
  6595. this.special_saveSave()
  6596. }
  6597. } else {
  6598. this.$message({
  6599. title: '',
  6600. message: '请选择备件',
  6601. type: 'warning',
  6602. duration: 2000
  6603. })
  6604. return false
  6605. }
  6606. },
  6607. special_saveSave() {
  6608. const url = 'authdata/spare/parts/requisitions'
  6609. for (let i = 0; i < this.listAdd.length; i++) {
  6610. this.$set(
  6611. this.listAdd[i],
  6612. 'contractId',
  6613. String(this.listAdd[i].contractId)
  6614. )
  6615. this.$set(
  6616. this.listAdd[i],
  6617. 'departmentId',
  6618. String(this.createTemp.departmentId)
  6619. )
  6620. this.$set(
  6621. this.listAdd[i],
  6622. 'date',
  6623. parseTime(this.createTemp.createTime, '{y}-{m}-{d} {h}:{i}:{s}')
  6624. )
  6625. this.$set(
  6626. this.listAdd[i],
  6627. 'employeId',
  6628. String(this.createTemp.employeId)
  6629. )
  6630. }
  6631. const data = {
  6632. pastureId: parseInt(this.createTemp.pastureId),
  6633. departmentId: parseInt(this.createTemp.departmentId),
  6634. departmentName: this.createTemp.departmentName,
  6635. orderNumber: this.createTemp.orderNumber,
  6636. createTime: parseTime(
  6637. this.createTemp.createTime,
  6638. '{y}-{m}-{d} {h}:{i}:{s}'
  6639. ),
  6640. employeId: this.createTemp.employeId,
  6641. providerName: this.createTemp.providerName,
  6642. purchaseType: parseInt(this.createTemp.purchaseType),
  6643. spot_list: this.listAdd
  6644. }
  6645. if (
  6646. this.createTemp.purchaseType == '1' ||
  6647. this.createTemp.purchaseType == '3'
  6648. ) {
  6649. data.providerId = this.createTemp.providerId
  6650. data.providerName = this.providerList.find(
  6651. (obj) => obj.id == this.createTemp.providerId
  6652. ).providerName
  6653. }
  6654. if (this.createTemp.funderId) {
  6655. data.funderId = this.createTemp.funderId
  6656. }
  6657. postJson(url, data).then((response) => {
  6658. if (response.msg !== 'fail') {
  6659. this.get_table_data()
  6660. this.dialogFormVisible2 = false
  6661. this.$notify({
  6662. title: '成功',
  6663. message: '保存成功',
  6664. type: 'success',
  6665. duration: 2000
  6666. })
  6667. } else {
  6668. failproccess(response, this.$notify, 1)
  6669. }
  6670. })
  6671. return true
  6672. },
  6673. // 合单
  6674. form_edit1(row) {
  6675. this.modifyTemp = Object.assign({}, row) // copy obj
  6676. this.dialogStatus = 'update'
  6677. this.dialogFormVisible_modify = true
  6678. this.modifylist = []
  6679. this.getdataListSee.parammaps.id = row.id
  6680. this.getSeeList(row)
  6681. },
  6682. partReject(row) {
  6683. // 驳回
  6684. this.$prompt('请输入驳回原因:', '驳回', {
  6685. confirmButtonText: '确定',
  6686. cancelButtonText: '取消',
  6687. inputValidator: (value) => {
  6688. if (
  6689. value === 'null' ||
  6690. value === null ||
  6691. value === 'undefined' ||
  6692. value === undefined ||
  6693. value === ''
  6694. ) {
  6695. return false
  6696. }
  6697. },
  6698. // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
  6699. inputErrorMessage: '请输入驳回原因'
  6700. })
  6701. .then(({ value }) => {
  6702. const data = {
  6703. name: 'editPartpurchaseReject',
  6704. parammaps: {
  6705. reject: 1,
  6706. explain: value,
  6707. id:row.id,
  6708. }
  6709. }
  6710. PostDataByName(data).then((response) => {
  6711. console.log('审核确认发送参数', this.requestParam)
  6712. this.isokDisable = false
  6713. if (response.msg !== 'fail') {
  6714. this.get_table_data()
  6715. this.$notify({
  6716. title: '成功',
  6717. message: '驳回成功',
  6718. type: 'success',
  6719. duration: 2000
  6720. })
  6721. this.getdataListSee.parammaps.id = this.modifyTemp.id
  6722. this.getSeeList(row)
  6723. } else {
  6724. failproccess(response, this.$notify, 1)
  6725. }
  6726. })
  6727. })
  6728. .catch(() => {
  6729. this.$message({
  6730. type: 'info',
  6731. message: '取消输入'
  6732. })
  6733. })
  6734. },
  6735. form_modify() {
  6736. // 提交
  6737. console.log('点击了库管审核')
  6738. this.isokDisable = true
  6739. setTimeout(() => {
  6740. this.isokDisable = false
  6741. }, 1000)
  6742. this.requestParam = {}
  6743. this.requestParam.name = 'partpurchaseCharge'
  6744. this.requestParam.parammaps = {}
  6745. this.requestParam.parammaps.id = this.modifyTemp.id
  6746. this.requestParam.parammaps.statue = 3
  6747. this.requestParam.parammaps.empId = Cookies.get('employeid')
  6748. PostDataByName(this.requestParam).then((response) => {
  6749. console.log('提交确认发送参数', this.requestParam)
  6750. this.isokDisable = false
  6751. if (response.msg !== 'fail') {
  6752. this.get_table_data()
  6753. this.dialogFormVisible_modify = false
  6754. this.$notify({
  6755. title: '成功',
  6756. message: '成功',
  6757. type: 'success',
  6758. duration: 2000
  6759. })
  6760. } else {
  6761. failproccess(response, this.$notify, 1)
  6762. }
  6763. })
  6764. },
  6765. form_modify1(row) {
  6766. // 提交
  6767. this.$confirm('确认提交吗?', '', {
  6768. confirmButtonText: '确定',
  6769. cancelButtonText: '取消',
  6770. type: 'warning'
  6771. })
  6772. .then(() => {
  6773. console.log('点击了库管审核')
  6774. this.isokDisable = true
  6775. setTimeout(() => {
  6776. this.isokDisable = false
  6777. }, 1000)
  6778. this.requestParam = {}
  6779. this.requestParam.name = 'partpurchaseCharge'
  6780. this.requestParam.parammaps = {}
  6781. this.requestParam.parammaps.id = row.id
  6782. this.requestParam.parammaps.statue = 3
  6783. this.requestParam.parammaps.empId = Cookies.get('employeid')
  6784. PostDataByName(this.requestParam).then((response) => {
  6785. console.log('提交确认发送参数', this.requestParam)
  6786. this.isokDisable = false
  6787. if (response.msg !== 'fail') {
  6788. this.get_table_data()
  6789. this.dialogFormVisible_modify = false
  6790. this.$notify({
  6791. title: '成功',
  6792. message: '成功',
  6793. type: 'success',
  6794. duration: 2000
  6795. })
  6796. } else {
  6797. failproccess(response, this.$notify)
  6798. }
  6799. })
  6800. })
  6801. .catch(() => {
  6802. this.$message({
  6803. type: 'info',
  6804. message: '已取消'
  6805. })
  6806. })
  6807. },
  6808. handle_milkSubscription() {
  6809. // 奶厅申购
  6810. this.textMap.create = '奶厅申购'
  6811. this.dialogStatus = 'create'
  6812. this.isMilk = true
  6813. this.seepart.getdataListParm.parammaps.partName = ''
  6814. this.resetCreateTemp()
  6815. this.edit = 1
  6816. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  6817. this.getCreateDepartDownList()
  6818. this.dialogStatus = 'create'
  6819. this.dialogFormVisible = true
  6820. this.dialogFormVisible_seepart = false
  6821. this.getCreateNumber()
  6822. this.createTemp.markBackend = false
  6823. this.$nextTick(() => {
  6824. this.$refs['createTemp'].clearValidate()
  6825. })
  6826. },
  6827. getRowClass({ row, index }) {
  6828. // 根据数据的不同返回不同的类名
  6829. if (row.explain1 !== undefined && row.explain1 !== '') {
  6830. console.log(row, 'row77')
  6831. return 'warning-aa'
  6832. } else {
  6833. console.log(row, 'row66')
  6834. return ''
  6835. }
  6836. }
  6837. }
  6838. }
  6839. </script>
  6840. <style lang="scss" scoped>
  6841. .pagination-container {
  6842. display: block !important;
  6843. }
  6844. /deep/ .el-badge__content.is-fixed {
  6845. z-index: 1;
  6846. }
  6847. </style>
  6848. <style lang="scss">
  6849. .el-step__head.is-success {
  6850. color: #409eff;
  6851. border-color: #409eff;
  6852. }
  6853. .el-step__title.is-success {
  6854. color: #409eff;
  6855. }
  6856. .el-step__head.is-process {
  6857. color: #409eff;
  6858. border-color: #409eff;
  6859. .el-step__icon.is-text {
  6860. background: #409eff;
  6861. color: #fff;
  6862. }
  6863. }
  6864. .step-row {
  6865. color: #000;
  6866. }
  6867. </style>
  6868. <style>
  6869. .el-table .warning-aa {
  6870. background: #ffd386;
  6871. }
  6872. </style>