daily.vue 450 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. <!-- <el-tooltip v-if="index == choseDay" effect="dark" content="填报时长超过北森考勤时长" placement="top-start">
  22. <i class="el-icon-warning" style="color:red;"></i>
  23. </el-tooltip> -->
  24. </div>
  25. </div>
  26. </span>
  27. </div>
  28. </div>
  29. <div style="display:flex;">
  30. <div class="grand flex">
  31. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  32. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  33. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  34. </div> -->
  35. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  36. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  37. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  38. </el-input>
  39. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  40. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  41. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  42. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  43. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  44. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  45. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  46. </el-select>
  47. </div>
  48. <div>
  49. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  50. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <!-- <span>{{ node.label }}</span> -->
  53. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  54. <span v-if="user.userNameNeedTranslate == '1'">
  55. <span v-if="node.data.children">
  56. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  57. </span>
  58. <span v-else>
  59. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  60. </span>
  61. </span>
  62. <span v-if="user.userNameNeedTranslate != '1'">
  63. {{ node.label }}
  64. </span>
  65. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  66. </span>
  67. <div style="position: absolute;right: 15px;">
  68. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  69. <!-- 未填报 -->
  70. {{$t('state.DidNotFillIn')}}
  71. </span>
  72. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  73. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  74. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  75. </span>
  76. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  77. <!-- 待审核 -->
  78. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  79. </span>
  80. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  81. <!-- 已通过 -->
  82. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  83. </span>
  84. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  85. <!-- 未通过 -->
  86. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  87. </span>
  88. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  89. <!-- 待提交 -->
  90. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  91. </span>
  92. </div>
  93. </span>
  94. </el-tree>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  99. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  100. -
  101. -
  102. -
  103. </div>
  104. </div>
  105. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  106. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  107. <div class="allDaily" style="float:left;flex-grow:1">
  108. <!--系统管理员和部门负责人 -->
  109. <div class="report_title" style="display:flex;justify-content: space-between;">
  110. <span>
  111. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  112. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  113. <!-- {{depData != null ?depData.label:""}} -->
  114. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  116. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  117. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  118. <span v-if="targetUid == null">
  119. <!-- - 已提交 -->
  120. -{{$t('state.hasBeenSubmitted')}}
  121. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 待提交 -->
  123. {{$t('state.waitingsubmit')}}
  124. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  125. <!-- 漏填 -->
  126. <!-- {{$t('state.missFillReport')}} -->
  127. 未填
  128. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  129. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  130. </span>
  131. </span>
  132. </span>
  133. <span style="float:right;">
  134. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  135. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  136. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  137. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  138. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  139. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  140. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  141. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  142. <!--部门负责人给个导出工时的功能 -->
  143. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  144. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  146. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  147. </span>
  148. </div>
  149. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  150. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  151. <i class="fa fa-circle"></i>
  152. <!-- {{item1.name}} -->
  153. <span v-if="user.userNameNeedTranslate == '1'">
  154. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  155. </span>
  156. <span v-if="user.userNameNeedTranslate != '1'">
  157. {{item1.name}}
  158. </span>
  159. <span style="margin-left:30px;">
  160. <span style="margin-right:20px;">
  161. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  162. <!-- 工作总时长: -->
  163. {{$t('other.totalWorkingHours')}}
  164. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  165. <span >{{item1.reportTime | amounts}}</span>h
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  178. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  182. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. </div>
  184. <div class="one_daily_body">
  185. <el-timeline>
  186. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  187. <el-card shadow="never">
  188. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  189. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  190. <span v-if="user.company.packageEngineering == 0">
  191. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  192. <span v-if="item2.isDeptAudit==0">
  193. <span v-if="item2.projectAuditState==0">
  194. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  195. <span v-if="item2.projectAuditorName != null">(
  196. <!-- {{item2.projectAuditorName}} -->
  197. <span v-if="user.userNameNeedTranslate == '1'">
  198. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  199. </span>
  200. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  201. )</span>
  202. <!-- 审核 --> {{$t('other.audit')}}
  203. </span>
  204. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  205. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  206. <span v-if="item2.projectAuditorName != null">(
  207. <!-- {{item2.projectAuditorName}} -->
  208. <span v-if="user.userNameNeedTranslate == '1'">
  209. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  210. </span>
  211. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  212. )</span>
  213. <!-- 审核通过 --> {{$t('state.approved')}}
  214. </span>
  215. </span>
  216. <span v-else-if="item2.isDeptAudit==1">
  217. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  218. ({{$t('other.await')}}
  219. <span v-if="user.userNameNeedTranslate == '1'">
  220. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  221. </span>
  222. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  223. {{$t('other.audit')}})
  224. </span>
  225. ]</span>
  226. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  227. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  228. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  229. </span>
  230. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  232. </span>
  233. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  234. <span v-if="user.company.packageEngineering == 1">
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  238. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  239. (
  240. <span v-if="user.userNameNeedTranslate != 1">
  241. {{item2.projectAuditorName}}
  242. </span>
  243. <span v-if="user.userNameNeedTranslate == 1">
  244. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  245. </span>
  246. )
  247. </span>{{$t('other.audit')}} ]</span>
  248. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  249. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  251. </span>
  252. <!--每个项目上单独审核 -->
  253. <span style="float:right;">
  254. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  255. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  256. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  257. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  258. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  259. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  260. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  261. <!--自己可以撤回待审核状态的报告 -->
  262. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  263. </span>
  264. </p>
  265. <p v-if="user.companyId == yuzhongCompId">
  266. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  267. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  268. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  269. <!--任务分组和阶段 -->
  270. <p v-if="item2.groupId != 0">
  271. {{$t('other.taskGroup')}}:{{item2.groupName}}
  272. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  273. </p>
  274. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  275. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  276. <!-- 自定义日报文本 -->
  277. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  278. <p v-if="user.company.packageEngineering == 1">
  279. {{$t('other.professionalProgress')}}:
  280. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  281. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  282. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhetongguo"></i>
  286. </el-tooltip>
  287. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  288. <i class="iconfont firerock-iconshenhebohui"></i>
  289. </el-tooltip>
  290. </span>
  291. </p>
  292. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  293. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  294. </p>
  295. <div v-if="item2.multiWorktime==0">
  296. <p style="display: inline-block;">{{$t('time.duration')}}:
  297. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  298. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  299. {{item2.time.toFixed(1)}}h
  300. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  301. </p>
  302. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  303. </div>
  304. <div v-if="item2.multiWorktime==1" >
  305. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  306. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  307. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  308. <p style="display: inline-block;">{{$t('time.duration')}}:
  309. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  310. {{timeItem.time.toFixed(1)}}h
  311. </p>
  312. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  313. </div>
  314. </div>
  315. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  316. <!--照片的显示 -->
  317. <p v-if="item2.pics != null && item2.pics.length > 0">
  318. <el-image v-for="(pic, index) in item2.pics" :key="index"
  319. style="width: 100px; height: 100px; margin-right:10px;"
  320. :src="pic"
  321. :preview-src-list="item2.pics">
  322. </el-image>
  323. </p>
  324. </el-card>
  325. </el-timeline-item>
  326. </el-timeline>
  327. </div>
  328. </div>
  329. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  330. <!-- 简陋的无报告提示 -->
  331. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </el-card>
  338. </div>
  339. <!-- 工时推送日志弹窗 -->
  340. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  341. <template>
  342. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  343. </template>
  344. <template>
  345. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  346. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  347. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  348. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  349. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  350. <el-table-column prop="result" label="推送结果" width="250">
  351. <template slot-scope="scope">
  352. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  353. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  357. </el-table>
  358. </template>
  359. <span slot="footer" class="dialog-footer">
  360. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  361. </span>
  362. </el-dialog>
  363. <!-- 填写日报的dialog -->
  364. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  365. <div style="height: 65vh;overflow: auto;">
  366. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  367. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  368. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  369. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  370. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  371. <span class="spnn" v-if="workForm.userNames">
  372. <span v-for="(item, index) in workForm.userNames" :key="index">
  373. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  374. <span v-if="index < workForm.userNames.length - 1">,</span>
  375. </span>
  376. </span>
  377. <span class="spnn hover" v-else>
  378. {{$t('defaultText.pleaseSelectAsubstitute')}}
  379. </span>
  380. </div>
  381. </el-form-item>
  382. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  383. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  384. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  385. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  386. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  387. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  389. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  390. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  391. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  392. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  393. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  394. <!-- AI智能填报 -->
  395. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  396. </el-form-item>
  397. <!--考勤时长显示-->
  398. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.time || user.companyId == 5978">
  399. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  400. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  401. </span>
  402. <!--批量填报和批量代填不显示考勤记录-->
  403. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  404. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  405. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  406. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  407. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  408. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  409. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  410. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  411. @click="refreshAttendance(workForm.createDate)"></el-button>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  414. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  415. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  416. </el-form-item>
  417. <!-- 000000 -->
  418. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  419. <div v-if="reportTimeType.multiWorktime==0">
  420. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  421. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  422. <el-select v-model="domain.timeType" style="width:200px;"
  423. v-if="reportTimeType.type == 0"
  424. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. @change="onTimeTypeChange(domain.timeType)">
  427. <el-option
  428. v-for="item in timeType"
  429. :key="item.value"
  430. :label="item.label"
  431. :value="item.value">
  432. </el-option>
  433. </el-select>
  434. <!-- 数字时长选择 -->
  435. <el-select v-model="domain.workingTime" style="width:200px;"
  436. v-if="reportTimeType.type == 1"
  437. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  438. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  439. @change="seleChn(0,domain)">
  440. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  441. </el-select>
  442. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  443. <span v-if="reportTimeType.type == 2">
  444. <!--时间范围选择 -->
  445. <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.startTime"
  448. :placeholder="$t('time.startTime')"
  449. style="width:120px;"
  450. format="HH:mm"
  451. value-format="HH:mm"
  452. :picker-options="{
  453. start: '08:00',
  454. end: '23:30'
  455. }"
  456. @change="iptChang()">
  457. </el-time-picker> - <el-time-picker
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  459. v-model="domain.endTime"
  460. :placeholder="$t('time.endTime')"
  461. style="width:120px;"
  462. format="HH:mm"
  463. value-format="HH:mm"
  464. :picker-options="{
  465. start: '08:00',
  466. end: '23:30',
  467. minTime: domain.startTime
  468. }"
  469. @change="iptChang()">
  470. </el-time-picker>
  471. </span>
  472. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  473. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  474. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  475. </div>
  476. </el-form-item>
  477. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  478. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  479. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  480. @change="selectProject(domain, index)"
  481. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  482. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  483. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  484. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  485. <span style="float: right;">{{ item.projectName }}</span>
  486. </el-option>
  487. </el-option-group>
  488. </el-select>
  489. <!--昱众不显示子项目-->
  490. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  491. <span style="margin-left:45px;">
  492. {{$t('lable.subproject')}}</span>
  493. <!--子项目 -->
  494. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  495. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  496. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  497. </el-select>
  498. </template>
  499. <template v-if="user.companyId == yuzhongCompId">
  500. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  501. <!--角色选择 -->
  502. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  503. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  504. <el-option
  505. v-for="item in roleList"
  506. :key="item.value"
  507. :label="item.label"
  508. :value="item.value">
  509. </el-option>
  510. </el-select>
  511. </template>
  512. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
  513. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  514. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  515. </el-link>
  516. <!-- <el-link type="primary" v-if="canEdit"
  517. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  518. </el-form-item>
  519. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  520. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  521. </el-form-item>
  522. <!--如果设置了工时成本预警的预算成本项-->
  523. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  524. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  525. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  526. </el-select>
  527. </el-form-item>
  528. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  529. <template slot="label">
  530. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  531. <span >{{$t('lable.taskGrouping')}}</span>
  532. </template>
  533. <!-- 任务分组 -->
  534. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  535. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  536. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  537. </el-select>
  538. <template v-if="user.companyId == yuzhongCompId">
  539. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  540. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  541. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  542. <el-option
  543. v-for="item in domain.filteredRespList"
  544. :key="item.id"
  545. :label="item.jobRespon"
  546. :value="item.id">
  547. </el-option>
  548. </el-select>
  549. </template>
  550. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  551. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  552. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  553. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  554. @change="changeStages(domain, index)"
  555. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  556. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  557. </el-select>
  558. </template>
  559. </el-form-item>
  560. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  561. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  562. <template slot="label">
  563. <span style="color:#FF0000;">*</span>
  564. <span >{{$t('other.projectAuditor')}}</span>
  565. </template>
  566. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  567. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  568. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  569. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  570. </el-option>
  571. </el-select>
  572. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="domain.projectAuditorId ? true : false" :flgs="true" @selectCatCli="selectCatCli" :disabled="!domain.canEdit"></selectCat>
  573. </el-form-item>
  574. </div>
  575. <el-form-item v-if="user.companyId == yuzhongCompId">
  576. <template slot="label">
  577. <span style="color:#FF0000;">*</span>
  578. <span >工作内容</span>
  579. </template>
  580. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  581. :disabled="(workForm.domains[index].state>=2?false:true)" >
  582. <el-option
  583. v-for="item in domain.workContentList"
  584. :key="item.id"
  585. :label="item.workContext"
  586. :value="item.id">
  587. </el-option>
  588. </el-select>
  589. </el-form-item>
  590. <!-- 111111 -->
  591. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  592. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  593. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  594. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  595. <span v-else>{{item.name}}</span>
  596. </el-option>
  597. </el-select>
  598. <template v-if="user.timeType.auditLevel > 1">
  599. <i class="el-icon-right"></i>
  600. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  601. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  602. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  603. <span v-else>{{item.name}}</span>
  604. </el-option>
  605. </el-select>
  606. </template>
  607. <template v-if="user.timeType.auditLevel > 2">
  608. <i class="el-icon-right"></i>
  609. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  610. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  611. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  612. <span v-else>{{item.name}}</span>
  613. </el-option>
  614. </el-select>
  615. </template>
  616. </el-form-item>
  617. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  618. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  619. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  620. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  621. <span v-else>{{item.name}}</span>
  622. </el-option>
  623. </el-select>
  624. </el-form-item>
  625. <!-- 相关维度/自定义维度 -->
  626. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  627. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  628. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  629. </el-option>
  630. </el-select>
  631. </el-form-item>
  632. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  633. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  634. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  635. </el-option>
  636. </el-select>
  637. </el-form-item>
  638. <!-- 相关数值 -->
  639. <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  640. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  641. </el-form-item>
  642. <!-- 自定义文本 -->
  643. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  644. <el-input :disabled="!domain.canEdit" v-model="domain.customText" type="textarea" :rows="1" style="width:75%;margin-right:7%" maxlength="1000" show-word-limit></el-input>
  645. </el-form-item>
  646. <!--按比例填报-->
  647. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  648. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  649. <div style="width:400px;">
  650. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  651. <el-col :span="isBatch?6:10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span><span v-if="isBatch == 0">{{domain.workingTime}}{{$t('time.hour')}}</span></span></el-col>
  652. </div>
  653. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  654. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  655. </div>
  656. </el-form-item>
  657. <!--工程专业版本模式下, 各个专业的进度填报 -->
  658. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  659. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  660. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  661. <el-input size="mini" style="width:60px;" v-model="item.progress"
  662. @keyup.native="onProgressChange"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  664. </span>
  665. </el-form-item>
  666. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  667. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  668. <template slot="label" v-if="user.timeType.taskRequired == 1">
  669. <span style="color:#FF0000;">*</span>
  670. <span >任务</span>
  671. </template>
  672. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  673. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  674. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  675. </el-select>
  676. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  677. </el-form-item>
  678. <!--针对依斯贝的SAP服务-->
  679. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  680. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  681. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  682. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  683. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  684. </el-select>
  685. </el-form-item>
  686. <!--工作事项-->
  687. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  688. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  689. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  690. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  691. </el-form-item>
  692. <!-- 拍照上传 -->
  693. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  694. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  695. <div class="photos">
  696. <div>
  697. <el-upload
  698. list-type="picture-card"
  699. :http-request="(file) => {return addImg(file, index)}"
  700. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  701. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  702. :file-list="domain.imgListUrl" :limit="9"
  703. :disabled="workForm.domains[index].state>=2?false:true">
  704. <i class="el-icon-plus"></i>
  705. </el-upload>
  706. </div>
  707. </div>
  708. </el-form-item>
  709. </div>
  710. <!--多个工作事项填报的情况 -->
  711. <div v-if="reportTimeType.multiWorktime==1">
  712. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  713. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  714. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  715. @change="selectProject(domain, index)"
  716. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  717. <!-- <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  718. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  719. <span style="float: right;">{{ item.projectName }}</span>
  720. </el-option> -->
  721. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  722. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  723. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  724. <span style="float: right;">{{ item.projectName }}</span>
  725. </el-option>
  726. </el-option-group>
  727. </el-select>
  728. <template v-if="user.timeType.mainProjectState != 1">
  729. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  730. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  731. <!--子项目 -->
  732. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  733. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  734. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  735. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  736. </el-select>
  737. </template>
  738. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  740. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  741. </el-link>
  742. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  743. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  744. </div>
  745. <!-- <el-link type="primary" v-if="canEdit"
  746. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  747. </el-form-item>
  748. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  749. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  750. </el-form-item>
  751. <!--如果设置了工时成本预警的预算成本项-->
  752. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  753. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  754. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  755. </el-select>
  756. </el-form-item>
  757. <el-form-item v-if="user.company.packageProject == 1">
  758. <template slot="label">
  759. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  760. <span >{{$t('lable.taskGrouping')}}</span>
  761. </template>
  762. <!-- 任务分组 -->
  763. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  764. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  765. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  766. </el-select>
  767. <!-- 项目的阶段 -->
  768. <span v-if="domain.stages != null && domain.stages.length> 0"
  769. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  770. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  771. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  772. @change="changeStages(domain, index)"
  773. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  774. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  775. </el-select>
  776. </el-form-item>
  777. <el-form-item :label="$t('other.projectAuditor')" >
  778. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  779. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  780. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  781. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  782. </el-option>
  783. </el-select>
  784. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" :flgs="true" @selectCatCli="selectCatCli"></selectCat>
  785. </el-form-item>
  786. <!--工程专业版本模式下, 各个专业的进度填报 -->
  787. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  788. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  789. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  790. <el-input size="mini" style="width:60px;" v-model="item.progress"
  791. @keyup.native="onProgressChange"
  792. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  793. </span>
  794. </el-form-item>
  795. <!-- 相关维度 -->
  796. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  797. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  798. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  799. </el-option>
  800. </el-select>
  801. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  802. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  803. </el-option>
  804. </el-select>
  805. </el-form-item>
  806. <!-- 相关数值 -->
  807. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  808. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  809. </el-form-item>
  810. <!-- 自定义文本 -->
  811. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  812. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  813. </el-form-item>
  814. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  815. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  816. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  818. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  819. </el-select>
  820. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  821. </el-form-item>
  822. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  823. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  824. <i v-if="tIndex>0&&workForm.domains[index].state>=2" @click="removeTimeItem(domain,tIndex)" class="el-icon-delete" style="position:absolute;right:-7px;top:-7px;font-size:16px;"></i>
  825. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  826. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  827. <span v-if="reportTimeType.type == 2">
  828. <!-- <span> -->
  829. <!--时间范围选择 -->
  830. <el-time-picker
  831. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  832. v-model="timeItem.startTime"
  833. :placeholder="$t('time.startTime')"
  834. style="width:120px;"
  835. format="HH:mm"
  836. value-format="HH:mm"
  837. :picker-options="{
  838. start: '00:00',
  839. end: '23:59',
  840. }"
  841. @change="iptChangs()">
  842. </el-time-picker> - <el-time-picker
  843. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  844. v-model="timeItem.endTime"
  845. :placeholder="$t('time.endTime')"
  846. style="width:120px;"
  847. format="HH:mm"
  848. value-format="HH:mm"
  849. :picker-options="{
  850. start: '00:00',
  851. end: '23:59',
  852. minTime: timeItem.startTime
  853. }"
  854. @change="iptChangs()">
  855. </el-time-picker>
  856. </span>
  857. </el-form-item>
  858. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  859. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  860. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  861. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  862. ></el-input>
  863. </el-form-item>
  864. </div>
  865. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  866. </div>
  867. <!--照片的显示 -->
  868. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  869. <el-image v-for="(pic, index) in domain.pics" :key="index"
  870. style="width: 100px; height: 100px; margin-right:10px;"
  871. :src="pic"
  872. :preview-src-list="domain.pics">
  873. </el-image>
  874. </p>
  875. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  876. </div>
  877. <span id="workFormsItemBottom"></span>
  878. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  879. </el-form>
  880. </div>
  881. <span slot="footer" class="dialog-footer">
  882. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  883. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  884. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  885. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  886. <el-button v-if="!isSubstitude && !isBatch" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  887. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  888. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  889. </span>
  890. </el-dialog>
  891. <!-- 按周填报 -->
  892. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  893. <!-- 按周填报-已填工时-点击 -->
  894. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  895. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  896. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  897. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  898. <el-table-column prop="state" :label="$t('state.states')">
  899. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  900. </el-table-column>
  901. <!-- <el-table-column label="操作">
  902. <template slot-scope="scope">
  903. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  904. </template>
  905. </el-table-column> -->
  906. </el-table>
  907. <span slot="footer" class="dialog-footer">
  908. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  909. </span>
  910. </el-dialog>
  911. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  912. <el-form-item style="height:30px;margin-top:-72px;">
  913. <!-- <el-date-picker v-model="weekDateRange" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initWeekFormData()" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" style="margin-right: 18px" :clearable="false"></el-date-picker> -->
  914. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  915. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  916. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  917. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  918. <el-select v-model="selCon" size="small" multiple :placeholder="$t('defaultText.pleaseChoose')" @change="onSelProjectChange()" filterable style="margin-right:50px;float:right;width:50%;" collapse-tags>
  919. <el-option
  920. v-for="item in fillProjectList"
  921. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  922. :key="item.id"
  923. :label="item.projectName + '\u3000' + item.projectCode"
  924. :value="item.id">
  925. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  926. <span style="float: right">{{ item.projectName }}</span>
  927. </el-option>
  928. </el-select>
  929. <span style="float:right;margin-right:10px;">选择项目</span>
  930. </el-form-item>
  931. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  932. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  933. <template slot-scope="scope">
  934. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  935. </template>
  936. </el-table-column>
  937. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  938. <template slot-scope="scope">
  939. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  940. <p v-else></p>
  941. </template>
  942. </el-table-column> -->
  943. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  944. <template slot-scope="scope">
  945. <div v-if="scope.row.canFill == 1">
  946. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  947. <el-button v-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 3 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  948. <el-button v-else-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 1 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  949. <el-button v-else-if="scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  950. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  951. </div>
  952. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  953. <el-button v-if="scope.row[item.projectName] != null && scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+hworkReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  954. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  955. </div>
  956. </div>
  957. <div v-else >
  958. <span style="color:#999999;">不可超前填报</span>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  963. <template slot-scope="scope">
  964. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  965. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  966. </template>
  967. </el-table-column>
  968. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  969. <template slot-scope="scope">
  970. <div class="zhiss">
  971. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  972. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  973. </div>
  974. </template>
  975. </el-table-column>
  976. </el-table>
  977. </el-form>
  978. <span slot="footer" class="dialog-footer" >
  979. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  980. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  981. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  982. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 重庆物奇私人定制的按周填报 -->
  986. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  987. <div class="fillWeekDialogVisiCustom">
  988. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  989. </div>
  990. </el-dialog>
  991. <!-- 选择时间 -->
  992. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  993. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  994. <span slot="footer" class="dialog-footer">
  995. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  996. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  997. </span>
  998. </el-dialog>
  999. <!-- 按周填报弹窗 -->
  1000. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1001. <div>
  1002. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1003. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1004. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1005. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1006. </el-select>
  1007. </div>
  1008. <!--如果设置了工时成本预警的预算成本项-->
  1009. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1010. <p>{{$t('lable.budgetSource')}}</p>
  1011. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1012. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <!-- 任务分组 -->
  1016. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1017. <p>{{$t('lable.taskGrouping')}}</p>
  1018. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1019. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1020. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1021. </el-select>
  1022. </div>
  1023. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1024. <p>{{$t('other.inputStage')}}</p>
  1025. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1026. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1027. </el-select>
  1028. </div>
  1029. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1030. <p>{{$t('other.reviewer')}}</p>
  1031. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1032. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. <template v-if="user.timeType.reportAuditType == 3">
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1046. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. <div class="zhoFel">
  1052. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1053. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1054. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1055. </el-select>
  1056. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1057. </div>
  1058. <div class="zhoFel">
  1059. <p>{{ $t('chao-song-ren') }}</p>
  1060. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1061. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. </template>
  1066. <!-- 自定义维度 -->
  1067. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1068. <p>{{user.timeType.customDegreeName}}</p>
  1069. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1070. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1071. </el-select>
  1072. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1073. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1074. </el-select>
  1075. </div>
  1076. <!-- 自定义数值 -->
  1077. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1078. <p>{{user.timeType.customDataName}}</p>
  1079. <el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  1080. </div>
  1081. <!-- 自定义文本 -->
  1082. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1083. <p>{{user.timeType.customTextName}}</p>
  1084. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1085. </div>
  1086. <!-- 选择任务 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1088. <p>任务 / 里程碑</p>
  1089. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1090. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1091. </el-select>
  1092. </div>
  1093. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1094. <p>{{$t('other.timeSelection')}}</p>
  1095. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" @change="$forceUpdate()" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  1096. </div>
  1097. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1098. <p>{{$t('other.chooseDuration')}}</p>
  1099. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1100. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1101. </el-select>
  1102. </div>
  1103. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1104. <p>{{$t('lable.percentageOfTime')}}</p>
  1105. <div style="width:400px;display: flex;align-items: center;">
  1106. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1107. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}{{$t('time.hour')}}</span></el-col>
  1108. </div>
  1109. </div>
  1110. <div class="zhoFel">
  1111. <p>{{$t('other.workMatters')}}</p>
  1112. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1113. </div>
  1114. </div>
  1115. <span slot="footer" class="dialog-footer">
  1116. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1117. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1118. </span>
  1119. </el-dialog>
  1120. <!--导出报表条件选择 -->
  1121. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1122. <el-form ref="form3" :model="exportParam" >
  1123. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1124. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1125. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1126. </el-select>
  1127. </el-form-item>
  1128. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1129. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1130. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1131. </el-form-item>
  1132. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1133. <el-date-picker
  1134. v-model="exportParam.dateRange" :editable="false"
  1135. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1136. :range-separator="$t('other.to')"
  1137. type="daterange"
  1138. :start-placeholder="$t('time.startDate')"
  1139. :end-placeholder="$t('time.endDate')"
  1140. ></el-date-picker>
  1141. </el-form-item>
  1142. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1143. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1144. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1145. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1146. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1147. </el-select>
  1148. </el-form-item>
  1149. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1150. <div class="exportReportRadio">
  1151. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1152. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1153. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1154. <i class="el-icon-question"></i>
  1155. </el-tooltip>
  1156. </div>
  1157. </el-form-item>
  1158. </el-form>
  1159. <div slot="footer" class="dialog-footer">
  1160. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1161. </div>
  1162. </el-dialog>
  1163. <!--导出报表条件选择 -->
  1164. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1165. <el-form ref="form3" :model="exportParam" >
  1166. <el-form-item prop="range" :label="$t('time.dateRange')">
  1167. <el-date-picker
  1168. v-model="exportParam.dateRange" :editable="false"
  1169. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1170. :clearable="true"
  1171. :range-separator="$t('other.to')"
  1172. type="daterange"
  1173. :start-placeholder="$t('time.startDate')"
  1174. :end-placeholder="$t('time.endDate')"
  1175. ></el-date-picker>
  1176. </el-form-item>
  1177. </el-form>
  1178. <div slot="footer" class="dialog-footer">
  1179. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1180. </div>
  1181. </el-dialog>
  1182. <!--人员列表 -->
  1183. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1184. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1185. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1186. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1187. <el-table-column type="selection"></el-table-column>
  1188. <el-table-column prop="label" :label="$t('lable.name')" >
  1189. <template slot-scope="scope">
  1190. <span>
  1191. <!-- {{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}} -->
  1192. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1193. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1194. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1195. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1196. </span>
  1197. <span v-else>
  1198. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1199. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1200. </span>
  1201. </span>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1205. <template slot-scope="scope">
  1206. <div>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1209. </div>
  1210. </template>
  1211. </el-table-column>
  1212. </el-table>
  1213. </el-tab-pane>
  1214. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1215. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1216. <el-table-column prop="label" :label="$t('lable.name')" >
  1217. <template slot-scope="scope">
  1218. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天 - ' + leaveTypeName[scope.row.leaveType] + ')' : '(请假' + scope.row.leaveTimes + 'h - ' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1219. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1220. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1222. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1223. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1224. </span>
  1225. <span v-else>
  1226. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1227. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1228. </span>
  1229. </template>
  1230. </el-table-column>
  1231. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1232. <template slot-scope="scope">
  1233. <div>
  1234. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1236. </div>
  1237. </template>
  1238. </el-table-column>
  1239. </el-table>
  1240. </el-tab-pane>
  1241. </el-tabs>
  1242. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1243. <el-table-column type="selection"></el-table-column>
  1244. <el-table-column prop="label" :label="$t('lable.name')" >
  1245. <template slot-scope="scope">
  1246. <div>
  1247. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1248. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1249. </div>
  1250. </template>
  1251. </el-table-column>
  1252. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1253. <template slot-scope="scope">
  1254. <div>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1257. </div>
  1258. </template>
  1259. </el-table-column>
  1260. </el-table>
  1261. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1262. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1263. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1264. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1265. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1266. </div>
  1267. </el-dialog>
  1268. <!-- 按部门选择人员 -->
  1269. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1270. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1271. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1272. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1273. </el-input>
  1274. <div class="tree" style="height:400px">
  1275. <el-scrollbar style="height:100%">
  1276. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1277. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1278. highlight-current :filter-node-method="filterNode">
  1279. <span class="custom-tree-node" slot-scope="{ node }">
  1280. <span v-if="user.userNameNeedTranslate == '1'">
  1281. <span v-if="node.data.children">
  1282. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1283. </span>
  1284. <span v-else>
  1285. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1286. </span>
  1287. </span>
  1288. <span v-if="user.userNameNeedTranslate != '1'">
  1289. {{ node.label }}
  1290. </span>
  1291. <!-- {{ node.label }} -->
  1292. </span>
  1293. </el-tree>
  1294. </el-scrollbar>
  1295. </div>
  1296. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1297. <div slot="footer" class="dialog-footer">
  1298. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1299. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1300. </div>
  1301. </el-dialog>
  1302. <el-dialog
  1303. v-if="monthWorkTimeDialog"
  1304. :visible.sync="monthWorkTimeDialog"
  1305. :close-on-click-modal="false"
  1306. customClass="customWidth selectworktime"
  1307. width="1200px"
  1308. title=""
  1309. >
  1310. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1311. <el-tabs v-model="activeName" @tab-click="handleClick">
  1312. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1313. <div class="selectworktime_export" style="margin-top:10px;">
  1314. <div class="selectworktime_export_l">
  1315. <el-date-picker
  1316. class="selecteworktime_datapick"
  1317. v-model="WorktimeDatepickValue"
  1318. value-format="yyyy-MM-dd"
  1319. type="daterange"
  1320. align="right"
  1321. unlink-panels
  1322. :range-separator="$t('other.to')"
  1323. :start-placeholder="$t('time.startDate')"
  1324. :end-placeholder="$t('time.endDate')"
  1325. :default-time="['12:00:00', '12:00:00']"
  1326. size="small"
  1327. popper-class="selecteorktime_datapick_popper"
  1328. @change="showMonthWorkTime()"
  1329. >
  1330. </el-date-picker>
  1331. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1332. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1333. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1334. <!-- 222 -->
  1335. </div>
  1336. <div>
  1337. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1338. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1339. </el-input>
  1340. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1341. </div>
  1342. <div style="float: right; vertical-align: middle;height:32px">
  1343. <el-link
  1344. v-if="user.companyId==5978"
  1345. type="primary"
  1346. @click="changeReminder()"
  1347. >{{'变更提醒'}}</el-link
  1348. >
  1349. <el-link
  1350. type="primary"
  1351. @click="exportMembWorkHours()"
  1352. >{{$t('export.exportData')}}</el-link
  1353. >
  1354. </div>
  1355. </div>
  1356. <el-table ref="hasworkTbl"
  1357. :data="monthWorkDataS"
  1358. v-el-table-infinite-scroll="listScroll"
  1359. border
  1360. :height="500"
  1361. highlight-current-row
  1362. style="width: 100%"
  1363. v-loading="tbload"
  1364. :lazy="true"
  1365. >
  1366. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1367. <template slot-scope="scope">
  1368. {{ scope.$index + 1 }}
  1369. </template>
  1370. </el-table-column>
  1371. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1372. <template slot-scope="scope">
  1373. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1374. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1375. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1376. <!-- {{scope.row.name}} -->
  1377. </span>
  1378. </template>
  1379. </el-table-column>
  1380. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1381. <template slot-scope="scope">
  1382. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1383. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1384. </template>
  1385. </el-table-column>
  1386. <el-table-column
  1387. min-width="105"
  1388. v-for="(item, index) in pickDateArray"
  1389. :key="index"
  1390. :label="item.label"
  1391. align="center"
  1392. >
  1393. <template slot-scope="scope">
  1394. <div
  1395. style="color: red"
  1396. v-if="
  1397. scope.row.worktimeList.filter(
  1398. (w) =>
  1399. w.createDate==item.date
  1400. ).length > 0 &&
  1401. scope.row.worktimeList.filter(
  1402. (w) =>w.createDate==item.date
  1403. )[0].workingTime < reportTimeType.allday
  1404. "
  1405. >
  1406. {{
  1407. scope.row.worktimeList.filter(
  1408. (w) =>w.createDate==item.date
  1409. )[0].workingTime.toFixed(1)
  1410. }}
  1411. </div>
  1412. <div
  1413. style="color: #20a0ff"
  1414. v-if="
  1415. scope.row.worktimeList.filter(
  1416. (w) =>w.createDate==item.date
  1417. ).length > 0 &&
  1418. scope.row.worktimeList.filter(
  1419. (w) =>w.createDate==item.date
  1420. )[0].workingTime > reportTimeType.allday
  1421. "
  1422. >
  1423. {{
  1424. scope.row.worktimeList.filter(
  1425. (w) =>w.createDate==item.date
  1426. )[0].workingTime.toFixed(1)
  1427. }}
  1428. </div>
  1429. <div
  1430. v-if="
  1431. scope.row.worktimeList.filter(
  1432. (w) =>w.createDate==item.date
  1433. ).length > 0 &&
  1434. scope.row.worktimeList.filter(
  1435. (w) =>w.createDate==item.date
  1436. )[0].workingTime == reportTimeType.allday
  1437. "
  1438. >
  1439. {{
  1440. scope.row.worktimeList.filter(
  1441. (w) =>w.createDate==item.date
  1442. )[0].workingTime
  1443. }}
  1444. </div>
  1445. <div
  1446. v-if="
  1447. scope.row.worktimeList.filter(
  1448. (w) =>w.createDate==item.date
  1449. ).length == 0
  1450. "
  1451. >
  1452. 0
  1453. </div>
  1454. <div
  1455. v-if="
  1456. scope.row.worktimeList.filter(
  1457. (w) =>w.createDate==item.date
  1458. ).length > 0 &&
  1459. typeof scope.row.worktimeList.filter(
  1460. (w) =>w.createDate==item.date
  1461. )[0].workingTime == 'string'
  1462. "
  1463. >
  1464. {{
  1465. scope.row.worktimeList.filter(
  1466. (w) =>w.createDate==item.date
  1467. )[0].workingTime
  1468. }}
  1469. </div>
  1470. </template>
  1471. </el-table-column>
  1472. </el-table>
  1473. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1474. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1475. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1476. <label style="font-size: 16px">员工每日已填报工时数</label>
  1477. <el-link
  1478. type="primary"
  1479. style="float: right; margin-right: 60px"
  1480. @click="exportMembWorkHours()"
  1481. >导出已填报数据</el-link
  1482. > -->
  1483. <!-- <el-button >导出</el-button> -->
  1484. <!-- </div> -->
  1485. </el-tab-pane>
  1486. <el-tab-pane label="未提交人员列表" name="second" >
  1487. <div class="selectworktime_export" style="margin-top:10px">
  1488. <div class="selectworktime_export_l">
  1489. <el-date-picker
  1490. class="selecteworktime_datapick"
  1491. v-model="WorktimeDatepickValue"
  1492. value-format="yyyy-MM-dd"
  1493. type="daterange"
  1494. align="right"
  1495. unlink-panels
  1496. :range-separator="$t('other.to')"
  1497. :start-placeholder="$t('time.startDate')"
  1498. :end-placeholder="$t('time.endDate')"
  1499. :default-time="['12:00:00', '12:00:00']"
  1500. size="small"
  1501. popper-class="selecteorktime_datapick_popper"
  1502. @change="showMonthNotWorkTime()"
  1503. >
  1504. </el-date-picker>
  1505. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1506. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1507. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1508. </div>
  1509. <div>
  1510. <div style="margin-top:10px;">
  1511. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1512. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1513. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1514. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1515. </el-input>
  1516. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1517. <el-link
  1518. type="primary"
  1519. style="float: right; vertical-align: middle;height:32px"
  1520. @click="exportMembNotWorkHours()"
  1521. >{{$t('export.exportData')}}</el-link
  1522. >
  1523. </div>
  1524. </div>
  1525. </div>
  1526. <el-table
  1527. ref="hasworkTbl2"
  1528. :data="monthNotWorkDateS"
  1529. v-el-table-infinite-scroll="notListScroll"
  1530. border
  1531. :height="500"
  1532. highlight-current-row
  1533. style="width: 100%"
  1534. v-loading="tbload"
  1535. lazy
  1536. >
  1537. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1538. <template slot-scope="scope">
  1539. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1540. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1541. </template>
  1542. </el-table-column>
  1543. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1544. <template slot-scope="scope">
  1545. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1546. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1547. </template>
  1548. </el-table-column>
  1549. <el-table-column
  1550. min-width="200"
  1551. :label="$t('weekDay.date')"
  1552. align="center"
  1553. prop="createDate"
  1554. >
  1555. </el-table-column>
  1556. <el-table-column
  1557. min-width="200"
  1558. :label="$t('state.states')"
  1559. align="center"
  1560. prop="status"
  1561. />
  1562. <el-table-column
  1563. min-width="200"
  1564. :label="$t('other.attendanceData')"
  1565. prop="cardTime"
  1566. align="center"
  1567. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1568. </el-table>
  1569. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1570. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1571. </el-tab-pane>
  1572. </el-tabs>
  1573. </el-dialog>
  1574. <!--驳回弹出框 -->
  1575. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1576. <div>
  1577. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
  1578. </div>
  1579. <div slot="footer" class="dialog-footer">
  1580. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1581. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1582. </div>
  1583. </el-dialog>
  1584. <!-- 通过弹出框 -->
  1585. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1586. <div>
  1587. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1588. </div>
  1589. <div slot="footer" class="dialog-footer">
  1590. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1591. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1592. </div>
  1593. </el-dialog>
  1594. <!--批量导入日报 -->
  1595. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1596. <p>1. {{$t('other.download')}}
  1597. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1598. </p>
  1599. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1600. <p style="display: flex;justify-content: center;">
  1601. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1602. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1603. </el-upload>
  1604. </p>
  1605. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1606. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1607. </div>
  1608. </el-dialog>
  1609. <!-- 工时导入记录弹窗 -->
  1610. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1611. <div style="height: 452px">
  1612. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1613. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1614. <el-table-column prop="userName" :label="$t('other.operator')">
  1615. <template slot-scope="scope">
  1616. <div>
  1617. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1618. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1619. </div>
  1620. </template>
  1621. </el-table-column>
  1622. <el-table-column prop="datel" :label="$t('other.document')">
  1623. <template slot-scope="scope">
  1624. <div>
  1625. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1626. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1627. </div>
  1628. </template>
  1629. </el-table-column>
  1630. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1631. <template slot-scope="scope">
  1632. <div>
  1633. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1634. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1635. </div>
  1636. </template>
  1637. </el-table-column>
  1638. </el-table>
  1639. <el-col :span="24" class="paginatis">
  1640. <el-pagination
  1641. @size-change="handleSizeChange"
  1642. @current-change="handleCurrentChange"
  1643. :page-sizes="[20 , 50 , 80 , 100]"
  1644. :page-size="20"
  1645. layout="total, sizes, prev, pager, next"
  1646. :total="toViewForm.total"
  1647. style="float:right;"
  1648. ></el-pagination>
  1649. </el-col>
  1650. </div>
  1651. </el-dialog>
  1652. <!--基于企业微信考勤数据的工时导入 -->
  1653. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1654. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1655. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1656. </el-step>
  1657. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1658. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1659. </el-steps>
  1660. <div v-if="active==0" style="padding:30px;height:360px;">
  1661. <div style="margin-top:50px;margin-left:280px;">
  1662. <el-date-picker
  1663. v-model="importWxParam.date" :editable="false"
  1664. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1665. :clearable="true"
  1666. :range-separator="$t('other.to')"
  1667. type="daterange"
  1668. :start-placeholder="$t('time.startDate')"
  1669. :end-placeholder="$t('time.endDate')"
  1670. @change="loadCheckInData"
  1671. ></el-date-picker>
  1672. </div>
  1673. </div>
  1674. <div v-if="active==1" style="padding:10px;">
  1675. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1676. style="width: 100%;margin-top:5px;" >
  1677. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1678. <template slot-scope="scope">
  1679. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1680. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1681. </template>
  1682. </el-table-column>
  1683. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1684. </el-table-column>
  1685. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1686. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1687. <template slot-scope="scope">
  1688. <div>
  1689. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1690. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1691. </div>
  1692. </template>
  1693. </el-table-column>
  1694. <el-table-column prop="departmentName" label="部门" >
  1695. <template slot-scope="scope">
  1696. <div>
  1697. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1698. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1699. </div>
  1700. </template>
  1701. </el-table-column>
  1702. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1703. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1704. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1705. <template slot-scope="scope">
  1706. {{scope.row.workHours.toFixed(1)}}h
  1707. </template>
  1708. </el-table-column>
  1709. </el-table>
  1710. </div>
  1711. <div v-if="active==2" >
  1712. <p style="display: flex;justify-content: center;height:390px;">
  1713. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1714. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1715. </el-upload>
  1716. </p>
  1717. </div>
  1718. <div slot="title">
  1719. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1720. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1721. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1722. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1723. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1724. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1725. </div>
  1726. <span slot="footer">
  1727. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1728. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1729. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1730. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1731. </span>
  1732. </el-dialog>
  1733. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1734. <p style="display: flex;justify-content: center;height:100px;">
  1735. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1736. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1737. </el-upload>
  1738. </p>
  1739. </el-dialog>
  1740. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1741. <div>
  1742. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1743. v-model="deleteReportParam.date" :editable="false"
  1744. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1745. :clearable="true"
  1746. :range-separator="$t('other.to')"
  1747. type="daterange"
  1748. :start-placeholder="$t('time.startDate')"
  1749. :end-placeholder="$t('time.endDate')"
  1750. ></el-date-picker>
  1751. </div>
  1752. <div style="margin-top:10px;">
  1753. <span>请选择部门:</span>
  1754. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1755. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1756. </div>
  1757. <div style="margin-top:10px;">
  1758. <span>请选择员工:</span>
  1759. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1760. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1761. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1762. <span v-else>{{item.name}}</span>
  1763. </el-option>
  1764. </el-select>
  1765. </div>
  1766. <span slot="footer">
  1767. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1768. </span>
  1769. </el-dialog>
  1770. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1771. <div>
  1772. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1773. v-model="deleteReportParam.date" :editable="false"
  1774. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1775. :clearable="true"
  1776. :range-separator="$t('other.to')"
  1777. type="daterange"
  1778. :start-placeholder="$t('time.startDate')"
  1779. :end-placeholder="$t('time.endDate')"
  1780. ></el-date-picker>
  1781. </div>
  1782. <div style="margin-top:15px;">
  1783. <span>选择部门:</span>
  1784. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1785. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1786. size="small" v-if="user.userNameNeedTranslate != 1"
  1787. ></el-cascader>
  1788. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1789. </div>
  1790. <span slot="footer">
  1791. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1792. </span>
  1793. </el-dialog>
  1794. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1795. <div>
  1796. <span>选择时间:</span><el-date-picker
  1797. v-model="modImportTime"
  1798. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1799. :clearable="true"
  1800. type="datetime"
  1801. ></el-date-picker>
  1802. <span>选择导入人员:</span><el-select
  1803. v-model="modImportUserId"
  1804. >
  1805. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1806. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1807. <span v-else>{{item.name}}</span>
  1808. </el-option>
  1809. </el-select>
  1810. </div>
  1811. <span slot="footer">
  1812. <el-button @click="confirmChangeModTime" >确认</el-button>
  1813. </span>
  1814. </el-dialog>
  1815. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1816. <div>
  1817. <span>请选择年月:</span>
  1818. <el-date-picker
  1819. v-model="ratioYmonth" :editable="false"
  1820. format="yyyyMM" value-format="yyyyMM"
  1821. type="month"
  1822. ></el-date-picker>
  1823. </div>
  1824. <span slot="footer">
  1825. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1826. </span>
  1827. </el-dialog>
  1828. <!--工时批量代填 -->
  1829. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1830. <div>
  1831. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1832. v-model="importWxParam.date" :editable="false"
  1833. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1834. :clearable="true"
  1835. :range-separator="$t('other.to')"
  1836. type="daterange"
  1837. :start-placeholder="$t('time.startDate')"
  1838. :end-placeholder="$t('time.endDate')"
  1839. @change="loadCheckInData"
  1840. ></el-date-picker>
  1841. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1842. </div>
  1843. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1844. :key="timeStamp"
  1845. style="width: 100%;margin-top:5px;" ref="tab">
  1846. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1847. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1848. <template slot-scope="scope">
  1849. <div>
  1850. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1851. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1852. </div>
  1853. </template>
  1854. </el-table-column>
  1855. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1856. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1857. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1858. <template slot-scope="scope">
  1859. {{scope.row.workHours.toFixed(1)}}h
  1860. </template>
  1861. </el-table-column>
  1862. <!--项目名称列表 -->
  1863. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1864. <template slot-scope="scope">
  1865. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1866. </template>
  1867. </el-table-column>
  1868. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1869. <template slot-scope="scope">
  1870. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1871. </template>
  1872. </el-table-column>
  1873. </el-table>
  1874. </el-dialog>
  1875. <!--基于企业微信考勤数据的工时导入 -->
  1876. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1877. <div style="padding-bottom:10px;">
  1878. <p>{{importResultMsg}}</p>
  1879. </div>
  1880. <!-- <span slot="footer" class="dialog-footer">
  1881. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1882. </span> -->
  1883. </el-dialog>
  1884. <!-- 审核流程展示 -->
  1885. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1886. <div style="padding:20px 40px 20px 0">
  1887. <el-timeline :reverse="false">
  1888. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1889. <!-- {{item.msg}} -->
  1890. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1891. <span v-if="user.userNameNeedTranslate == 1">
  1892. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1893. <span>{{item.msgCon.two}}</span>
  1894. </span>
  1895. </el-timeline-item>
  1896. </el-timeline>
  1897. </div>
  1898. </el-dialog>
  1899. </section>
  1900. </template>
  1901. <script>
  1902. // 左右滑动
  1903. import dragMixin from "@/common/js/tensile.js";
  1904. import util from "../../common/js/util";
  1905. // 自定义select组件
  1906. import selectCat from "@/components/select.vue"
  1907. // 引入自定义级联组件
  1908. import vueCascader from "@/components/cascader.vue"
  1909. // 重庆物奇定制组件
  1910. import WeeklyCustomization from "./weeklyCustomization.vue"
  1911. import { mapMutations } from 'vuex'
  1912. let _that = this
  1913. export default {
  1914. mixins: [dragMixin],
  1915. components: {
  1916. selectCat,
  1917. vueCascader,
  1918. WeeklyCustomization
  1919. },
  1920. data() {
  1921. return {
  1922. pageIndex: 0,
  1923. hasMore: true,
  1924. exportType: 0,
  1925. exportingData: false,
  1926. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1927. jobResponseList:[],
  1928. yisibeiCompId: 3092,
  1929. yuzhongCompId: 3385,
  1930. mingyiName : '成都明夷电子科技有限公司',
  1931. // mingyiName : '明夷',
  1932. modItemDataId: null,
  1933. modImportTime: null,
  1934. modImportUserId: null,
  1935. showModImportTimeDialog: false,
  1936. showBatchSimpleApproveReport: false,
  1937. startDeleting: false,
  1938. showBatchDeleteReport: false,
  1939. deleteReportParam: {date:null, userIds:[]},
  1940. isDenying: false,
  1941. targetWeekDate: null,//填写周报中的周日期
  1942. importCardTimeVisi: false,
  1943. startRatioExporting: false,
  1944. exportUserRatio: false,
  1945. ratioYmonth:null,
  1946. hasWrittenReport: false,
  1947. today:null,
  1948. syncTimeLoading: false,
  1949. seluserText: '',
  1950. translation: '1', // 1、文字, 2、部门, 3、人员
  1951. exportLoad: false,
  1952. getPickerOptions: {
  1953. disabledDate: (time) => {
  1954. var date = new Date();
  1955. var year = date.getFullYear();
  1956. var month = date.getMonth() + 1;
  1957. if (month >= 1 && month <= 9) {
  1958. month = "0" + month;
  1959. }
  1960. var currentdate = year.toString() + month.toString();
  1961. var timeyear = time.getFullYear();
  1962. var timemonth = time.getMonth() + 1;
  1963. if (timemonth >= 1 && timemonth <= 9) {
  1964. timemonth = "0" + timemonth;
  1965. }
  1966. var timedate = timeyear.toString() + timemonth.toString();
  1967. if(this.user.timeType.fillAhead == 0){
  1968. return currentdate < timedate;
  1969. }else{
  1970. return false
  1971. }
  1972. }
  1973. },
  1974. alalal: '8.0',
  1975. timeBasecostList:null,
  1976. tbload: false,
  1977. exportTimeDialog: false,
  1978. searchKeyword: '',
  1979. monthWorkDataS: [],
  1980. monthNotWorkDateS: [],
  1981. pickDateArray:[],
  1982. WorktimeDatepickValue: [],
  1983. activeName:"first",
  1984. isLeave: 0,
  1985. submitingReport: false,
  1986. importResultMsg:null,
  1987. showImportResult:false,
  1988. importingData: false,
  1989. isDraft: 0,
  1990. timeStamp: 0,
  1991. projectColumns:[],
  1992. checkinLoading:false,
  1993. importWxParam:{date:null,},
  1994. active:0,
  1995. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1996. importWxDialog:false,
  1997. importDialog:false,
  1998. denyForm:null,
  1999. denyReasonDialog:false,
  2000. monthWorkTimeDialog: false,
  2001. isSubstitude:false,
  2002. isFill:false,
  2003. unFillList:[],
  2004. fillList:[],
  2005. fillMembList:[],
  2006. fillMembList_leave: [],
  2007. membListVisible: false,
  2008. isBatch:0,//是否是批量填报
  2009. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2010. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2011. weekDay : [this.$t('weekDay.sunday'), this.$t('weekDay.monday'), this.$t('weekDay.tuesday'), this.$t('weekDay.wednesday'), this.$t('weekDay.thursday'), this.$t('weekDay.friday'), this.$t('weekDay.saturday')],
  2012. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2013. fillStatusList: [],
  2014. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2015. exportDialog:false,
  2016. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2017. subProjectList:[],
  2018. canEdit: true,
  2019. originCanEdit: true,
  2020. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2021. selectTime:null,
  2022. reportTimeType:{},
  2023. curDate:'',
  2024. isAllSelect: false,
  2025. approveDialogVisible:false,
  2026. deptId:null,
  2027. targetUid: null,
  2028. membCount:0,
  2029. selectState:"-1",
  2030. user: JSON.parse(sessionStorage.getItem("user")),
  2031. allUsersList: [],
  2032. showAddMore:false,
  2033. allDate: [],
  2034. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2035. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2036. choseDay: 0,
  2037. tableHeight: 0,
  2038. listLoading: false,
  2039. projectList: [], //项目列表
  2040. fillProjectList: [],
  2041. reportList: [], //日报列表
  2042. reportNames:[], //批量审批列表
  2043. selCon:[], //筛选条件
  2044. selProjectList:[], //筛选后项目列表
  2045. selConShow: true,
  2046. usersList: [], // 全部人员列表
  2047. usersListId: '', // 选中的人员id
  2048. dialogVisible: false, //项目弹窗
  2049. report: '',
  2050. workForm: {
  2051. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2052. domains: [{
  2053. id: null,
  2054. projectId: "",
  2055. workingTime: "",
  2056. timeType:0,
  2057. content: "",
  2058. state: 2,
  2059. multiWorktime:0,
  2060. worktimeList:[],
  2061. degreeId: null,
  2062. auditUserList: [],
  2063. }],
  2064. },
  2065. workRules: {
  2066. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2067. },
  2068. chooseParticipVisible: false,
  2069. logining: false,
  2070. isDisable: false,
  2071. timeType:[],
  2072. deptMembData: [
  2073. ],
  2074. //部门人员树状结构
  2075. data: [
  2076. {
  2077. id: -1,
  2078. label: this.$t('lable.allStaff'),
  2079. membCount:0
  2080. },
  2081. {
  2082. id: 0,
  2083. label: this.$t('lable.unassigned'),
  2084. }
  2085. ],
  2086. allData:{},
  2087. batchShowData:{},
  2088. option: [],
  2089. deptOptionList: [],
  2090. depData: {
  2091. id: -1,
  2092. label: this.$t('lable.allStaff'),
  2093. },
  2094. defaultProps: {
  2095. children: 'children',
  2096. label: 'label'
  2097. },
  2098. isNew: false,
  2099. selected: false,
  2100. valuet: new Date(),
  2101. domObj: null,
  2102. participator:[],
  2103. chosenMembCount:0,
  2104. jsDay: 0,
  2105. jsTime: 0,
  2106. falsss: false,
  2107. weidu: [],
  2108. weiduList: [],
  2109. yonghuUser: [],
  2110. dateAr: [],
  2111. batchSubFillDialog: false,
  2112. isSubstiS: false,
  2113. fillWeekDialogVisi: false,
  2114. fillWeekDialogVisiCustom: false,
  2115. zhoData: [],
  2116. weekDateRange: [],
  2117. btnZho: false,
  2118. weekDataLoading: false,
  2119. changdu: 6,
  2120. tianxieDialogVisible: false,
  2121. scopess: {},
  2122. zhoBao: {
  2123. time: '',
  2124. workingTime: '',
  2125. progress: '',
  2126. con: '',
  2127. subProjectId: '',
  2128. stage: '',
  2129. subProjectList: [],
  2130. stages: [],
  2131. },
  2132. zhoBaoIdx: '',
  2133. zhoBaoName: '',
  2134. zhis: {},
  2135. dealList: [],
  2136. toViewDialogVisible: false,
  2137. toViewList: [],
  2138. toViewloading: true,
  2139. toViewForm: {
  2140. pageIndex: '1',
  2141. pageSize: '20',
  2142. total: 0,
  2143. },
  2144. toViewloadings: false,
  2145. tabPositionss: 'top',
  2146. monthTotal: 0,
  2147. monthTotalPage: 0,
  2148. monthTotalLages: 20,
  2149. monthWorkData: [],
  2150. monthNotWorkDate: [],
  2151. monthWorkDataS1: [],
  2152. monthnotTotal: 0,
  2153. monthnotTotalPage: 0,
  2154. monthnotTotalLages: 20,
  2155. monthNotWorkDateS1: [],
  2156. deptMembDataText: '',
  2157. isFlag: false,
  2158. isMore: false,
  2159. stateKey: '0',
  2160. expandDate: [],
  2161. notifySelList:[],
  2162. departmentList: [],
  2163. approvalProcessDialog: false,
  2164. approvalProcessData: [],
  2165. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2166. leaveTypeName: [this.$t('leave.personalLeave'),this.$t('leave.sickLeave'),this.$t('leave.annualLeave'),this.$t('leave.maternityLeave'),this.$t('leave.marriageLeave'),this.$t('leave.bereavementLeave'),this.$t('leave.leave'),this.$t('leave.paternityLeave'),this.$t('leave.other')],
  2167. isWeekend: false,
  2168. canCancelInDialog: false,
  2169. approveinData: {},
  2170. approveinDialog: false,
  2171. reportCanDelete: false,
  2172. weeklyFilledTimeDialog: false,
  2173. weeklyFilledTimeList: [],
  2174. weeklyFilledTimeLoading: false,
  2175. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2176. weeklyFilledTimeCanDelete: false,
  2177. weeklyFilledTimeDate: null,
  2178. leaveAllNum: 0,
  2179. dataLoading: false,
  2180. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2181. vacationTime: {},
  2182. integrationProjectList: [],
  2183. totalReportHours: 0, // 合计的工时
  2184. workTimeForMinYi:0,
  2185. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2186. weekIndex: 1,
  2187. weekParentData: {},
  2188. deptIdForNoReport:[],
  2189. nameAearch: '', // 企业微信姓名搜索
  2190. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2191. deptMembDataLoading: false,
  2192. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2193. {
  2194. id: 4811,
  2195. // id: 10,
  2196. name: '陕西柘中建设工程有限公司'
  2197. }
  2198. ],
  2199. pushWorkTimeLogDig:false,
  2200. pushWorkTimeLogData:[],
  2201. };
  2202. },
  2203. watch: {
  2204. deptMembDataText(val) {
  2205. this.$refs.chooseMembTree.filter(val);
  2206. }
  2207. },
  2208. filters: {
  2209. // 过滤
  2210. amounts(value) {
  2211. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2212. return 0
  2213. }
  2214. var zhi = +value + 0
  2215. return zhi.toFixed(1)
  2216. },
  2217. // zhoData
  2218. zhoData(value, arr) {
  2219. var dateArray = value.split("-");
  2220. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2221. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2222. // console.log(arr[date.getDay()])
  2223. // return "周" + "日一二三四五六".charAt(date.getDay());
  2224. return arr[date.getDay()]
  2225. },
  2226. // 过滤数字
  2227. numbers(value) {
  2228. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2229. return 0
  2230. }
  2231. return value
  2232. },
  2233. },
  2234. computed: {},
  2235. mounted() {
  2236. var now = new Date();
  2237. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2238. this.today = t;
  2239. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2240. this.exportParam.dateRange = [startStr,t];
  2241. this.getAllDate(1);
  2242. this.getReportList();
  2243. this.getProjectList();
  2244. this.getFillProjectList();
  2245. this.getTimeType();
  2246. this.getDepartment();
  2247. this.scrollFunction()
  2248. this.userssHu();
  2249. if(this.user.timeType.reportAuditType == 3){
  2250. this.getAllUsersList()
  2251. }
  2252. if (this.user.company.packageProject == 1) {
  2253. this.getBasecostItemList();
  2254. }
  2255. if(this.user.timeType.lockWorktime){
  2256. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2257. }
  2258. //设置了下限
  2259. if (this.user.timeType.minReportTime) {
  2260. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2261. }
  2262. const that = this
  2263. if(this.user.userNameNeedTranslate == 1) {
  2264. that.dataLoading = that.$store.state.dataLoading
  2265. this.upDataLoading()
  2266. setTimeout(()=>{
  2267. that.dataLoading = that.$store.state.dataLoading
  2268. }, 1000)
  2269. }
  2270. if (this.user.companyId == this.yuzhongCompId) {
  2271. this.getJobResponList();
  2272. }
  2273. },
  2274. methods: {
  2275. ...mapMutations(['upDataLoading']),
  2276. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2277. isCustomization(userInfo, permissionArray) {
  2278. const { companyId } = userInfo
  2279. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2280. return isReportPictureRequired
  2281. },
  2282. //任务被选中
  2283. onTaskSelected(domainItem) {
  2284. //取服务
  2285. if (domainItem.taskId) {
  2286. var that = this;
  2287. var param = {taskId:domainItem.taskId};
  2288. if (this.isSubstitude) {
  2289. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2290. param.userId = this.workForm.userId[0];
  2291. }
  2292. }
  2293. this.http.post('/task/getMyTaskService',param, res => {
  2294. if (res.code == "ok") {
  2295. // domainItem.workContentList = res.data;
  2296. that.$set(domainItem, 'sapServiceId', null);
  2297. that.$set(domainItem, 'serviceList', res.data);
  2298. } else {
  2299. this.$message({
  2300. message: res.msg,
  2301. type: "error"
  2302. });
  2303. }
  2304. },error => {
  2305. this.$message({
  2306. message: error,
  2307. type: "error"
  2308. });
  2309. }
  2310. );
  2311. } else {
  2312. //清空服务
  2313. }
  2314. },
  2315. onBatchTimeChange() {
  2316. //反向计算每日工作时长
  2317. if (this.workForm.createDate) {
  2318. let sdate = new Date(this.workForm.createDate[0]);
  2319. let edate = new Date(this.workForm.createDate[1]);
  2320. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2321. console.log('days===', days)
  2322. if (days < 0) {
  2323. return;
  2324. }
  2325. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2326. //总时长发生改变,自动按比例计算
  2327. this.workForm.domains.forEach(d=>{
  2328. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2329. });
  2330. }
  2331. },
  2332. //更新工作内容列表
  2333. updateJobContent(domainItem) {
  2334. var that = this;
  2335. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2336. if (res.code == "ok") {
  2337. // domainItem.workContentList = res.data;
  2338. that.$set(domainItem, 'extraField3', null);
  2339. that.$set(domainItem, 'workContentList', res.data);
  2340. } else {
  2341. this.$message({
  2342. message: res.msg,
  2343. type: "error"
  2344. });
  2345. }
  2346. },error => {
  2347. this.$message({
  2348. message: error,
  2349. type: "error"
  2350. });
  2351. }
  2352. );
  2353. },
  2354. updateResponse(domainItem) {
  2355. var that = this;
  2356. var selectPid = domainItem.projectId;
  2357. domainItem.extraField2 = null;
  2358. domainItem.extraField3 = null;
  2359. if (selectPid && domainItem.extraField1) {
  2360. //是否非项目
  2361. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2362. console.log('==========','isPublic=='+isPublic);
  2363. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2364. console.log(filteredRespList);
  2365. domainItem.filteredRespList = filteredRespList;
  2366. }
  2367. },
  2368. getJobResponList() {
  2369. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2370. if (res.code == "ok") {
  2371. this.jobResponseList = res.data;
  2372. } else {
  2373. this.$message({
  2374. message: res.msg,
  2375. type: "error"
  2376. });
  2377. }
  2378. },error => {
  2379. this.$message({
  2380. message: error,
  2381. type: "error"
  2382. });
  2383. }
  2384. );
  2385. },
  2386. openModImportTime(row) {
  2387. this.showModImportTimeDialog = true;
  2388. this.modItemDataId = row.id;
  2389. },
  2390. delImportTime(row) {
  2391. let rowId = row.id;
  2392. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2393. confirmButtonText: this.$t('btn.determine'),
  2394. cancelButtonText: this.$t('btn.cancel'),
  2395. type: "warning"
  2396. })
  2397. .then(() => {
  2398. this.http.post('/report-import-log/delete',{
  2399. id: rowId
  2400. },res => {
  2401. if (res.code == "ok") {
  2402. this.$message({
  2403. message: '删除成功',
  2404. type: "success"
  2405. });
  2406. this.getToView();
  2407. } else {
  2408. this.$message({
  2409. message: res.msg,
  2410. type: "error"
  2411. });
  2412. }
  2413. },error => {
  2414. this.$message({
  2415. message: error,
  2416. type: "error"
  2417. });
  2418. }
  2419. );
  2420. }).catch(() => {this.startDeleting = false});
  2421. },
  2422. confirmChangeModTime() {
  2423. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2424. this.$message({
  2425. message: '请选择时间',
  2426. type: "error"
  2427. });
  2428. return;
  2429. }
  2430. this.http.post('/report-import-log/changeTime',{
  2431. modLogDateTime: this.modImportTime,
  2432. modImportUserId: this.modImportUserId,
  2433. id: this.modItemDataId
  2434. },res => {
  2435. if (res.code == "ok") {
  2436. this.$message({
  2437. message: '修改成功',
  2438. type: "success"
  2439. });
  2440. this.getToView();
  2441. this.showModImportTimeDialog = false;
  2442. } else {
  2443. this.$message({
  2444. message: res.msg,
  2445. type: "error"
  2446. });
  2447. }
  2448. },error => {
  2449. this.$message({
  2450. message: error,
  2451. type: "error"
  2452. });
  2453. }
  2454. );
  2455. },
  2456. confirmBatchApproveReport() {
  2457. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2458. this.$message({
  2459. message: '请选择日期范围',
  2460. type: "error"
  2461. });
  2462. return;
  2463. }
  2464. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2465. confirmButtonText: this.$t('btn.determine'),
  2466. cancelButtonText: this.$t('btn.cancel'),
  2467. type: "warning"
  2468. })
  2469. .then(() => {
  2470. this.startDeleting = true;
  2471. let obj = {
  2472. startDate: this.deleteReportParam.date[0],
  2473. endDate: this.deleteReportParam.date[1]
  2474. }
  2475. if(this.deleteReportParam.departmentId) {
  2476. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2477. } else {
  2478. obj.departmentId = null
  2479. }
  2480. this.http.post('/report/batchApproveByDate',obj,res => {
  2481. if (res.code == "ok") {
  2482. this.$message({
  2483. message: '审核通过',
  2484. type: "success"
  2485. });
  2486. this.getReportList();
  2487. this.getDepartment();
  2488. this.startDeleting = false;
  2489. } else {
  2490. this.$message({
  2491. message: res.msg,
  2492. type: "error"
  2493. });
  2494. }
  2495. },error => {
  2496. this.$message({
  2497. message: error,
  2498. type: "error"
  2499. });
  2500. }
  2501. );
  2502. }).catch(() => {this.startDeleting = false});
  2503. },
  2504. confirmBatchDelReport() {
  2505. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2506. this.$message({
  2507. message: '请选择部门或人员',
  2508. type: "error"
  2509. });
  2510. return;
  2511. }
  2512. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2513. this.$message({
  2514. message: '请选择日期范围',
  2515. type: "error"
  2516. });
  2517. return;
  2518. }
  2519. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2520. confirmButtonText: this.$t('btn.determine'),
  2521. cancelButtonText: this.$t('btn.cancel'),
  2522. type: "warning"
  2523. })
  2524. .then(() => {
  2525. this.startDeleting = true;
  2526. this.http.post('/report/batchDelete',{
  2527. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2528. startDate: this.deleteReportParam.date[0],
  2529. endDate: this.deleteReportParam.date[1],
  2530. deptId: this.deleteReportParam.deptId[0]
  2531. },res => {
  2532. if (res.code == "ok") {
  2533. this.$message({
  2534. message: this.$t('message.successfullyDeleted'),
  2535. type: "success"
  2536. });
  2537. this.getReportList();
  2538. this.getDepartment();
  2539. this.startDeleting = false;
  2540. } else {
  2541. this.$message({
  2542. message: res.msg,
  2543. type: "error"
  2544. });
  2545. }
  2546. },error => {
  2547. this.$message({
  2548. message: error,
  2549. type: "error"
  2550. });
  2551. }
  2552. );
  2553. }).catch(() => {this.startDeleting = false});
  2554. },
  2555. getRecentlyProject() {
  2556. this.http.post('/project/nearProject',{},res => {
  2557. if(res.code == 'ok'){
  2558. let topObj = {
  2559. label: '最近选择项目',
  2560. peojectList: res.data
  2561. }
  2562. let botomObj = {
  2563. label: '全部项目',
  2564. peojectList: this.fillProjectList
  2565. }
  2566. //最近项目如果在fillProjectList中不存在,需要移除
  2567. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2568. this.integrationProjectList = [topObj, botomObj]
  2569. }else {
  2570. this.$message({
  2571. message: res.msg,
  2572. type: 'error'
  2573. })
  2574. }
  2575. },err => {
  2576. this.$message({
  2577. message: err,
  2578. type: 'error'
  2579. })
  2580. })
  2581. },
  2582. handlePictureCardPreview(file, index) {
  2583. console.log(file, index)
  2584. let arr = []
  2585. let imgArr = this.workForm.domains[index].imgListUrl
  2586. for(var i in imgArr) {
  2587. arr.push(imgArr[i].url)
  2588. }
  2589. console.log(arr, '图片数据')
  2590. const $viewer = this.$viewerApi({
  2591. images: arr
  2592. });
  2593. },
  2594. // 图片上传
  2595. addImg(e, index) {
  2596. console.log(e, '数据')
  2597. let formData = new FormData()
  2598. formData.append('multipartFile', e.file)
  2599. this.http.uploadFile('/common/uploadFile', formData,
  2600. res => {
  2601. if (res.code == "ok") {
  2602. this.$message({
  2603. message: this.$t('uploadedsuccessfully'),
  2604. type: "success"
  2605. });
  2606. if(!this.workForm.domains[index].imgList) {
  2607. this.workForm.domains[index].imgList = []
  2608. this.workForm.domains[index].imgListUrl = []
  2609. }
  2610. this.workForm.domains[index].imgList.push(res.data)
  2611. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2612. } else {
  2613. this.$message({message: res.msg,type: "error"});
  2614. }
  2615. console.log(this.workForm.domains[index])
  2616. },
  2617. error => {this.$message({message: error,type: "error"});
  2618. });
  2619. },
  2620. // 删除图片
  2621. delImg(file,fileList, index) {
  2622. console.log(file, fileList)
  2623. let idx = 0
  2624. for(let i in fileList) {
  2625. if(fileList[i].uid == file.uid) {
  2626. idx = i
  2627. }
  2628. }
  2629. this.workForm.domains[index].imgList.splice(idx, 1)
  2630. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2631. console.log(this.workForm.domains[index])
  2632. },
  2633. test(){
  2634. console.log('test',this.workForm.domains);
  2635. },
  2636. getHour(s1, s2) {
  2637. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2638. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2639. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2640. var ms = s2.getTime() - s1.getTime();
  2641. if (ms < 0) return 0;
  2642. let ma = ms / 1000 / 60 / 60
  2643. return ma; //小时
  2644. },
  2645. refreshWXCardTime(workdate) {
  2646. if (!workdate) return;
  2647. this.syncTimeLoading = true;
  2648. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2649. date: workdate,
  2650. },res => {
  2651. this.syncTimeLoading = false;
  2652. if(res.code == 'ok'){
  2653. this.workForm.time = res.data.time;
  2654. }else {
  2655. this.$message({
  2656. message: res.msg,
  2657. type: 'error'
  2658. })
  2659. }
  2660. },err => {
  2661. this.syncTimeLoading = false;
  2662. this.$message({
  2663. message: err,
  2664. type: 'error'
  2665. })
  2666. })
  2667. },
  2668. refreshAttendance(workdate) {
  2669. if (!workdate) return;
  2670. this.syncTimeLoading = true;
  2671. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2672. startDate: workdate[0],
  2673. endDate: workdate[1]
  2674. },res => {
  2675. this.syncTimeLoading = false;
  2676. if(res.code == 'ok'){
  2677. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2678. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2679. this.totalReportHours = this.workTimeForMinYi;
  2680. }else {
  2681. this.$message({
  2682. message: res.msg,
  2683. type: 'error'
  2684. })
  2685. }
  2686. },err => {
  2687. this.syncTimeLoading = false;
  2688. this.$message({
  2689. message: err,
  2690. type: 'error'
  2691. })
  2692. })
  2693. },
  2694. refreshBeiSengAttendance(workdate) {
  2695. if (!workdate) return;
  2696. this.syncTimeLoading = true;
  2697. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2698. createDate: workdate
  2699. },res => {
  2700. this.syncTimeLoading = false;
  2701. if(res.code == 'ok'){
  2702. this.workForm.time = res.data;
  2703. }else {
  2704. this.$message({
  2705. message: res.msg,
  2706. type: 'error'
  2707. })
  2708. }
  2709. },err => {
  2710. this.syncTimeLoading = false;
  2711. this.$message({
  2712. message: err,
  2713. type: 'error'
  2714. })
  2715. })
  2716. },
  2717. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2718. this.weeklyFilledTimeDialog = true
  2719. this.weeklyFilledTimeLoading = true
  2720. this.weeklyFilledTimeDate = parameterDate
  2721. this.http.post('/report/getReportList',{
  2722. date: parameterDate,
  2723. userId: this.user.id
  2724. },res => {
  2725. this.weeklyFilledTimeLoading = false
  2726. if(res.code == 'ok'){
  2727. this.weeklyFilledTimeList = res.data[0].data
  2728. let candelete = true
  2729. for(let i in this.weeklyFilledTimeList){
  2730. if(this.weeklyFilledTimeList[i].state < 2){
  2731. candelete = false
  2732. }
  2733. }
  2734. this.weeklyFilledTimeCanDelete = candelete
  2735. }else {
  2736. this.$message({
  2737. message: res.msg,
  2738. type: 'error'
  2739. })
  2740. }
  2741. },err => {
  2742. this.weeklyFilledTimeLoading = false
  2743. this.$message({
  2744. message: err,
  2745. type: 'error'
  2746. })
  2747. })
  2748. },
  2749. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2750. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2751. confirmButtonText: this.$t('btn.determine'),
  2752. cancelButtonText: this.$t('btn.cancel'),
  2753. type: "warning"
  2754. })
  2755. .then(() => {
  2756. this.http.post('/report/delete',{
  2757. userId: this.user.id,
  2758. date: this.weeklyFilledTimeDate
  2759. },res => {
  2760. if (res.code == "ok") {
  2761. this.$message({
  2762. message: this.$t('message.successfullyDeleted'),
  2763. type: "success"
  2764. });
  2765. this.getWeeklyWorkTime()
  2766. this.getReportList();
  2767. this.getDepartment();
  2768. this.weeklyFilledTimeDialog = false;
  2769. } else {
  2770. this.$message({
  2771. message: res.msg,
  2772. type: "error"
  2773. });
  2774. }
  2775. },error => {
  2776. this.$message({
  2777. message: error,
  2778. type: "error"
  2779. });
  2780. }
  2781. );
  2782. }).catch(() => {});
  2783. },
  2784. getApprovalProcess(item){
  2785. // console.log('this.date',this.choseDate);
  2786. this.http.post('/report-log/get',{
  2787. creatorId: item.id,
  2788. createDate: sessionStorage.msg
  2789. },res => {
  2790. if(res.code == 'ok'){
  2791. this.approvalProcessDialog = true
  2792. if(this.user.userNameNeedTranslate == 1) {
  2793. for(var i in res.data) {
  2794. let obj = {
  2795. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2796. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2797. }
  2798. res.data[i].msgCon = obj
  2799. }
  2800. }
  2801. this.approvalProcessData = res.data
  2802. console.log(this.approvalProcessData, '数据卡看')
  2803. }else{
  2804. this.$message({
  2805. message: res.msg,
  2806. type: 'error'
  2807. })
  2808. }
  2809. },err => {
  2810. this.$message({
  2811. message: err,
  2812. type: 'error'
  2813. })
  2814. })
  2815. },
  2816. filterNode(value, data) {
  2817. if (!value) return true;
  2818. return data.label.indexOf(value) !== -1;
  2819. },
  2820. triggerCalculateOT(index) {
  2821. var str = this.workForm.domains[index].overtimeHours + ''
  2822. if(str.indexOf('.') != '-1') {
  2823. var s = str.split('.')[0]
  2824. var st = str.split('.')[1]
  2825. var sts = st.split('')
  2826. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2827. }
  2828. },
  2829. searchScreen(e){
  2830. if(e){
  2831. this.monthNotWorkDateS1 = []
  2832. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2833. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2834. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2835. }
  2836. }
  2837. if (this.monthNotWorkDateS1.length > 50) {
  2838. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2839. }else{
  2840. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2841. }
  2842. // if (this.monthNotWorkDateS1.length > 0) {
  2843. // setTimeout(() => {
  2844. // this.tableListenernot()
  2845. // }, 1000);
  2846. // }
  2847. }else{
  2848. this.monthWorkDataS1 = []
  2849. for (let i = 0; i < this.monthWorkData.length; i++) {
  2850. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2851. this.monthWorkDataS1.push(this.monthWorkData[i])
  2852. }
  2853. }
  2854. if (this.monthWorkDataS1.length > 50) {
  2855. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2856. }else{
  2857. this.monthWorkDataS = this.monthWorkDataS1
  2858. }
  2859. // if (this.monthWorkDataS1.length > 0) {
  2860. // setTimeout(() => {
  2861. // this.tableListener()
  2862. // }, 1000);
  2863. // }
  2864. }
  2865. },
  2866. addUpload(data) {
  2867. // var zhi = data.fileName.split('.')[0]
  2868. // var sss = zhi + '.xlsx'
  2869. // return
  2870. var filePath = '/upload/' + data.serverName;
  2871. const a = document.createElement('a'); // 创建a标签
  2872. a.setAttribute('download', data.fileName);// download属性
  2873. a.setAttribute('href', filePath);// href链接
  2874. a.click(); //自执行点击事件
  2875. a.remove();
  2876. },
  2877. restrictNumber(targetId) {
  2878. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2879. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2880. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2881. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2882. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2883. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2884. inpu.value = parseFloat(inpu.value);
  2885. }
  2886. },
  2887. //获取项目下的任务分组
  2888. getTaskGroups(domain, index) {
  2889. domain.groupId=null;
  2890. this.http.post('/task-group/listMyJoinGroup',{
  2891. projectId: domain.projectId,
  2892. isSubstitude: this.isSubstitude ? 1 : 0
  2893. },
  2894. res => {
  2895. if (res.code == "ok") {
  2896. this.workForm.domains[index].taskGroups = res.data;
  2897. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2898. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2899. // this.getGroupStages(domain, index);
  2900. // }
  2901. this.$forceUpdate();
  2902. }
  2903. },
  2904. error => {
  2905. this.$message({
  2906. message: error,
  2907. type: "error"
  2908. });
  2909. }
  2910. );
  2911. },
  2912. //下载填报工时占比报表
  2913. downloadProjectRatio() {
  2914. this.exportUserRatio = true;
  2915. // let now = new Date();
  2916. // let month = now.getMonth();//默认看上个月的
  2917. // let monthStr = month<10? ('0'+month): month;
  2918. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2919. const today = new Date();
  2920. const year = today.getFullYear();
  2921. const month = today.getMonth() + 1;
  2922. let lastMonthYear, lastMonth;
  2923. if (month === 1) {
  2924. lastMonthYear = year - 1;
  2925. lastMonth = 12;
  2926. } else {
  2927. lastMonthYear = year;
  2928. lastMonth = month - 1;
  2929. }
  2930. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2931. console.log('赋值 ==>', this.ratioYmonth)
  2932. },
  2933. confirmDownloadRatio() {
  2934. this.startRatioExporting = true;
  2935. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2936. ymonth: this.ratioYmonth
  2937. },
  2938. res => {
  2939. if (res.code == "ok") {
  2940. this.startRatioExporting = false;
  2941. var filePath = res.data;
  2942. const a = document.createElement('a'); // 创建a标签
  2943. var data = filePath.split("/");
  2944. a.setAttribute('download', data[data.length-1]);// download属性
  2945. a.setAttribute('href', filePath);// href链接
  2946. a.click(); //自执行点击事件
  2947. a.remove();
  2948. } else {
  2949. this.startRatioExporting = false;
  2950. this.$message({
  2951. message: res.msg,
  2952. type: "error"
  2953. });
  2954. }
  2955. },
  2956. error => {
  2957. this.checkinLoading = false;
  2958. this.$message({
  2959. message: error,
  2960. type: "error"
  2961. });
  2962. }
  2963. );
  2964. },
  2965. //下载带企业微信考勤数据的工时统计模板
  2966. downloadCheckInExcel() {
  2967. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2968. startDate: this.importWxParam.date[0],
  2969. endDate: this.importWxParam.date[1],
  2970. },
  2971. res => {
  2972. if (res.code == "ok") {
  2973. var filePath = res.data;
  2974. const a = document.createElement('a'); // 创建a标签
  2975. var data = filePath.split("/");
  2976. a.setAttribute('download', data[data.length-1]);// download属性
  2977. a.setAttribute('href', filePath);// href链接
  2978. a.click(); //自执行点击事件
  2979. a.remove();
  2980. } else {
  2981. this.$message({
  2982. message: res.msg,
  2983. type: "error"
  2984. });
  2985. }
  2986. },
  2987. error => {
  2988. this.checkinLoading = false;
  2989. this.$message({
  2990. message: error,
  2991. type: "error"
  2992. });
  2993. }
  2994. );
  2995. },
  2996. pre() {
  2997. if (this.active == 0) return;
  2998. this.active--;
  2999. },
  3000. next() {
  3001. this.active++;
  3002. },
  3003. triggerTotalTime(index) {
  3004. var item = this.checkinList[index];
  3005. var total = 0.0;
  3006. for (var i=0;i<this.projectColumns.length; i++) {
  3007. var key = this.projectColumns[i];
  3008. if (item[key] != null && item[key] != '') {
  3009. total += parseFloat(item[key]);
  3010. }
  3011. }
  3012. item.totalFillTime = total;
  3013. },
  3014. //提交批量代填的数据
  3015. submitBatchSubFillData() {
  3016. var data = JSON.stringify(this.checkinList);
  3017. this.http.post('/user-corpwx-time/submitProjectTime',{
  3018. json: data,
  3019. projectColumns: JSON.stringify(this.projectColumns)
  3020. },
  3021. res => {
  3022. if (res.code == "ok") {
  3023. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3024. this.importWxDialog = false;
  3025. }
  3026. },
  3027. error => {
  3028. this.checkinLoading = false;
  3029. this.$message({
  3030. message: error,
  3031. type: "error"
  3032. });
  3033. }
  3034. );
  3035. },
  3036. loadCheckInData() {
  3037. if (this.importWxParam.date == null) {
  3038. this.checkinList = [];
  3039. return;
  3040. }
  3041. this.checkinLoading = true;
  3042. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3043. startDate: this.importWxParam.date[0],
  3044. endDate: this.importWxParam.date[1],
  3045. },
  3046. res => {
  3047. if (res.code == "ok") {
  3048. this.checkinLoading = false;
  3049. this.checkinList = res.data.list;
  3050. this.projectColumns = res.data.projects;
  3051. // 自定义表格会导致表格错乱,需重新计算表格
  3052. this.$nextTick(()=>{
  3053. this.$refs.tab.doLayout()
  3054. })
  3055. }
  3056. },
  3057. error => {
  3058. this.checkinLoading = false;
  3059. this.$message({
  3060. message: error,
  3061. type: "error"
  3062. });
  3063. }
  3064. );
  3065. },
  3066. importCardTime(item) {
  3067. //首先判断文件类型
  3068. let str = item.file.name.split(".");
  3069. let format = str[str.length - 1];
  3070. if (format != "xls" && format != "xlsx") {
  3071. this.$message({
  3072. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3073. type: "error"
  3074. });
  3075. } else {
  3076. this.importingData = true;
  3077. let formData = new FormData();
  3078. formData.append("multipartFile", item.file);
  3079. formData.append("companyId", this.user.companyId);
  3080. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3081. res => {
  3082. this.$refs.uploadCardTime.clearFiles();
  3083. this.importingData = false;
  3084. if (res.code == "ok") {
  3085. //换成弹出框,以免有人等了半天回来啥也没看到
  3086. this.$message({
  3087. message: '导入考勤时长成功',
  3088. type: "success"
  3089. });
  3090. } else {
  3091. this.$message({
  3092. message: res.msg,
  3093. type: "error"
  3094. });
  3095. }
  3096. },
  3097. error => {
  3098. this.$refs.upload.clearFiles();
  3099. this.listLoading = false;
  3100. this.$message({
  3101. message: error,
  3102. type: "error"
  3103. });
  3104. });
  3105. }
  3106. },
  3107. batchImportWxData(item) {
  3108. //首先判断文件类型
  3109. let str = item.file.name.split(".");
  3110. let format = str[str.length - 1];
  3111. if (format != "xls" && format != "xlsx") {
  3112. this.$message({
  3113. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3114. type: "error"
  3115. });
  3116. } else {
  3117. this.importingData = true;
  3118. let formData = new FormData();
  3119. formData.append("file", item.file);
  3120. formData.append("companyId", this.user.companyId);
  3121. formData.append("withCheckIn", 1);
  3122. this.http.uploadFile('/report/importData', formData,
  3123. res => {
  3124. this.$refs.upload.clearFiles();
  3125. this.showImportResult = true;
  3126. this.importingData = false;
  3127. if (res.code == "ok") {
  3128. //换成弹出框,以免有人等了半天回来啥也没看到
  3129. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3130. this.getReportList();
  3131. this.importWxDialog = false;
  3132. } else {
  3133. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3134. }
  3135. },
  3136. error => {
  3137. this.$refs.upload.clearFiles();
  3138. this.listLoading = false;
  3139. this.$message({
  3140. message: error,
  3141. type: "error"
  3142. });
  3143. });
  3144. }
  3145. },
  3146. batchImportData(item) {
  3147. //首先判断文件类型
  3148. let str = item.file.name.split(".");
  3149. let format = str[str.length - 1];
  3150. if (format != "xls" && format != "xlsx") {
  3151. this.$message({
  3152. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3153. type: "error"
  3154. });
  3155. } else {
  3156. this.importingData = true;
  3157. let formData = new FormData();
  3158. formData.append("file", item.file);
  3159. formData.append("companyId", this.user.companyId);
  3160. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3161. this.http.uploadFile(url, formData,
  3162. res => {
  3163. this.$refs.upload.clearFiles();
  3164. this.importingData = false;
  3165. this.showImportResult = true;
  3166. if (res.code == "ok") {
  3167. //换成弹出框,以免有人等了半天回来啥也没看到
  3168. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3169. this.getReportList();
  3170. this.importWXDialog = false;
  3171. } else {
  3172. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3173. }
  3174. },
  3175. error => {
  3176. this.$refs.upload.clearFiles();
  3177. this.importingData = false;
  3178. this.$message({
  3179. message: error,
  3180. type: "error"
  3181. });
  3182. });
  3183. }
  3184. },
  3185. userssHu() {
  3186. this.http.post('/time-type/getCompanyTimeSetting',{
  3187. companyId: this.user.companyId
  3188. },
  3189. res => {
  3190. if (res.code == "ok") {
  3191. this.yonghuUser = res.data
  3192. }
  3193. },
  3194. error => {
  3195. this.$message({
  3196. message: error,
  3197. type: "error"
  3198. });
  3199. }
  3200. );
  3201. },
  3202. iptBlur(i) {
  3203. if(this.isBatch == 0) {
  3204. return
  3205. }
  3206. var reqParam = {
  3207. startDate: this.workForm.createDate[0],
  3208. endDate: this.workForm.createDate[1]
  3209. };
  3210. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3211. reqParam.userId = this.workForm.userId[0];
  3212. }
  3213. this.http.post('/report/getWorkDays',reqParam,
  3214. res => {
  3215. if (res.code == "ok") {
  3216. this.jsDay = res.data
  3217. this.chuji(i)
  3218. } else {
  3219. this.$message({
  3220. message: res.msg,
  3221. type: "error"
  3222. });
  3223. }
  3224. },
  3225. error => {
  3226. this.$message({
  3227. message: error,
  3228. type: "error"
  3229. });
  3230. }
  3231. );
  3232. //明夷硬编码获取
  3233. if (this.user.company.companyName == this.mingyiName) {
  3234. this.getWorkTimeForMinYi();
  3235. }
  3236. },
  3237. getWorkTimeForMinYi(){
  3238. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3239. startDate: this.workForm.createDate[0],
  3240. endDate: this.workForm.createDate[1]
  3241. },
  3242. res => {
  3243. if (res.code == "ok") {
  3244. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3245. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3246. this.totalReportHours = this.workTimeForMinYi;
  3247. } else {
  3248. this.$message({
  3249. message: res.msg,
  3250. type: "error"
  3251. });
  3252. this.workForm.createDate = [];
  3253. }
  3254. },
  3255. error => {
  3256. this.$message({
  3257. message: error,
  3258. type: "error"
  3259. });
  3260. }
  3261. );
  3262. },
  3263. chuji(i) {
  3264. if(i == 0) {
  3265. this.seleChn(1)
  3266. } else if(i == 1) {
  3267. this.seleChn(0)
  3268. } else if(i == 2) {
  3269. if(this.workForm.domains[0].multiWorktime > 0) {
  3270. this.iptChangs()
  3271. } else {
  3272. this.iptChang()
  3273. }
  3274. } else if(i == 3) {
  3275. this.seleChn(0)
  3276. }
  3277. },
  3278. seleChn(e,domain) {
  3279. if(e == 1) {
  3280. for(var i in this.workForm.domains) {
  3281. if(this.workForm.domains[i].timeType == 0) {
  3282. this.workForm.domains[i].workingTime = 8
  3283. } else {
  3284. this.workForm.domains[i].workingTime = 4
  3285. }
  3286. }
  3287. }
  3288. var quanbu = 0
  3289. var spl = this.workForm.domains
  3290. var zhi = ''
  3291. for(var i in spl) {
  3292. var sp = +spl[i].workingTime + 0
  3293. zhi = this.jsDay * sp
  3294. quanbu = +quanbu + zhi
  3295. }
  3296. this.jsTime = quanbu
  3297. this.totalReportHours = quanbu
  3298. let worktime = this.jsTime
  3299. // 自动计算加班时长
  3300. if(this.isBatch != 0){
  3301. worktime = this.jsTime / this.jsDay
  3302. }
  3303. if(this.user.timeType.fillOvertime && domain){
  3304. let isover = false
  3305. let alltime = 0
  3306. let allover = 0 //此处alltime同上面的worktime
  3307. for(let d in spl){
  3308. if(spl[d].isOvertime){
  3309. isover = true
  3310. allover += spl[d].overtimeHours*1
  3311. }
  3312. alltime += spl[d].workingTime*1
  3313. }
  3314. if(domain.overtimeHours){
  3315. allover = allover - domain.overtimeHours
  3316. }
  3317. if(worktime*1 > this.user.timeType.allday){
  3318. if(isover){
  3319. if(alltime > (allover + this.user.timeType.allday)){
  3320. this.$set(domain,'isOvertime',true)
  3321. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3322. }else{
  3323. this.$set(domain,'isOvertime',false)
  3324. this.$set(domain,'overtimeHours',null)
  3325. if(alltime < (allover + this.user.timeType.allday)){
  3326. let overtime = allover + this.user.timeType.allday - alltime
  3327. for(let pi in spl){
  3328. if(spl[pi].overtimeHours){
  3329. if((overtime - spl[pi].overtimeHours*1) > 0){
  3330. overtime = overtime - spl[pi].overtimeHours*1
  3331. this.$set(spl[pi],'isOvertime',false)
  3332. this.$set(spl[pi],'overtimeHours',null)
  3333. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3334. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3335. break
  3336. }else{
  3337. this.$set(spl[pi],'isOvertime',false)
  3338. this.$set(spl[pi],'overtimeHours',null)
  3339. break
  3340. }
  3341. }
  3342. }
  3343. }
  3344. }
  3345. }else{
  3346. this.$set(domain,'isOvertime',true)
  3347. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3348. }
  3349. }else{
  3350. for(let di in spl){
  3351. this.$set(spl[di],'isOvertime',false)
  3352. this.$set(spl[di],'overtimeHours',null)
  3353. }
  3354. }
  3355. }
  3356. },
  3357. iptChang() {
  3358. var sl = this.workForm.domains
  3359. let timeArr = []
  3360. for(var i in sl) {
  3361. if(sl[i].startTime && sl[i].endTime) {
  3362. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3363. }
  3364. }
  3365. this.getTimeHours(timeArr)
  3366. // for(let j in arrNum) {
  3367. // this.timeJsonStr += arrNum[j]
  3368. // if(flg) {
  3369. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3370. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3371. // }
  3372. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3373. // flg = true
  3374. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3375. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3376. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3377. // }
  3378. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3379. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3380. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3381. // }
  3382. // }
  3383. },
  3384. iptChangs() {
  3385. var sl = this.workForm.domains
  3386. let timeArr = []
  3387. for(var i in sl) {
  3388. for(var j in sl[i].worktimeList){
  3389. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3390. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3391. }
  3392. }
  3393. }
  3394. this.getTimeHours(timeArr)
  3395. },
  3396. // 调用接口或去数据
  3397. getTimeHours(arr) {
  3398. this.http.post('/report/getHoursByTimeRange',{
  3399. timeJsonStr: JSON.stringify(arr)
  3400. },res => {
  3401. if(res.code === 'ok') {
  3402. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3403. } else {
  3404. this.$message({
  3405. message: res.msg,
  3406. type: 'error'
  3407. })
  3408. }
  3409. },err => {
  3410. this.$message({
  3411. message: err,
  3412. type: 'error'
  3413. })
  3414. })
  3415. },
  3416. // 按周填报调用接口计算时间
  3417. async getWeekHoursByTimeRange(timeRange) {
  3418. const url = '/report/getHoursByTimeRange';
  3419. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3420. var that = this;
  3421. return new Promise((resolve, reject) => {
  3422. this.http.post(url, data, function(res) {
  3423. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3424. }, function(err) {
  3425. reject(err);
  3426. });
  3427. });
  3428. },
  3429. removeTimeItem(item, index) {
  3430. item.worktimeList.splice(index, 1);
  3431. this.iptChangs()
  3432. },
  3433. //添加工时
  3434. addNewWorktime(index, item) {
  3435. if(item.worktimeList == null ) {
  3436. item.worktimeList = []
  3437. }
  3438. item.worktimeList.push({});
  3439. },
  3440. //复制项目
  3441. copyProject(index) {
  3442. var leftProgress = 10;
  3443. if (this.reportTimeType.type == 3) {
  3444. //计算已经待分配工时比例
  3445. let array = this.workForm.domains;
  3446. let totalProgress = 0;
  3447. for (var i=0;i<array.length; i++) {
  3448. totalProgress += array[i].progress;
  3449. }
  3450. if (totalProgress < 100) {
  3451. leftProgress = 100 - totalProgress;
  3452. }
  3453. }
  3454. var newIndex = index+1;
  3455. var itemDomain = {
  3456. projectId: this.workForm.domains[index].projectId,
  3457. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3458. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3459. ),
  3460. content: "",
  3461. progress:leftProgress,
  3462. state:2,//2-表示待提交
  3463. };
  3464. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3465. if (this.reportTimeType.type == 0) {
  3466. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3467. var length = this.workForm.domains.length;
  3468. if (length == 2) {
  3469. this.showAddMore = false;
  3470. }
  3471. }
  3472. this.selectProject(itemDomain, newIndex);
  3473. },
  3474. pushWorkTime(reportId){
  3475. let url=''
  3476. if(this.user.timeType.syncSap == 1){
  3477. url='/report/pushProjectReportToSap'
  3478. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3479. var pushDate = this.date + day;
  3480. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3481. confirmButtonText: '确定',
  3482. cancelButtonText: '取消',
  3483. type: 'info'
  3484. }).then(() => {
  3485. const loading = this.$loading({
  3486. lock: true,
  3487. text: '正在推送中,请耐心等待。',
  3488. spinner: 'el-icon-loading',
  3489. background: 'rgba(0, 0, 0, 0.7)'
  3490. });
  3491. this.http.post(url,{
  3492. pushDate: pushDate,
  3493. reportId: reportId
  3494. },res => {
  3495. loading.close();
  3496. if(res.code == 'ok'){
  3497. this.$message({
  3498. type: 'success',
  3499. message: res.data
  3500. });
  3501. }else{
  3502. this.$message({
  3503. type: 'error',
  3504. message: res.msg
  3505. })
  3506. }
  3507. },err => {
  3508. loading.close();
  3509. this.$message({
  3510. type: 'error',
  3511. message: err
  3512. })
  3513. })
  3514. }).catch(() => {
  3515. });
  3516. }else{
  3517. url='/report/pushReportDataToThird'
  3518. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3519. confirmButtonText: '确定',
  3520. cancelButtonText: '取消',
  3521. type: 'info'
  3522. }).then(() => {
  3523. const loading = this.$loading({
  3524. lock: true,
  3525. text: '正在推送中,请耐心等待。',
  3526. spinner: 'el-icon-loading',
  3527. background: 'rgba(0, 0, 0, 0.7)'
  3528. });
  3529. this.http.post(url,{
  3530. yearMonth: this.date
  3531. },res => {
  3532. loading.close();
  3533. if(res.code == 'ok'){
  3534. this.$message({
  3535. type: 'success',
  3536. message: '推送成功!'
  3537. });
  3538. }else{
  3539. this.$message({
  3540. type: 'error',
  3541. message: res.msg
  3542. })
  3543. }
  3544. },err => {
  3545. loading.close();
  3546. this.$message({
  3547. type: 'error',
  3548. message: err
  3549. })
  3550. })
  3551. }).catch(() => {
  3552. });
  3553. }
  3554. },
  3555. showWorkTime(){
  3556. this.monthWorkTimeDialog = true;
  3557. this.searchKeyword = ''
  3558. this.WorktimeDatepickValue = this.istoMonth()
  3559. if(this.WorktimeDatepickValue.length == 0){
  3560. let newdate = new Date();
  3561. let nowdate = newdate.toLocaleDateString();
  3562. let getauto = this.getAutoWeekDate(nowdate)
  3563. let nowwd = [getauto[0],getauto[6]]
  3564. this.WorktimeDatepickValue = nowwd
  3565. }
  3566. this.showMonthWorkTime()
  3567. },
  3568. handleClick(t,e){
  3569. if (t.name == "first") {
  3570. this.showMonthWorkTime()
  3571. }else{
  3572. this.showMonthNotWorkTime()
  3573. }
  3574. },
  3575. //导出员工每日填报工时数
  3576. exportMembWorkHours() {
  3577. this.http.post(
  3578. "/report/exportUserDailyWorkTime",
  3579. {
  3580. // month: this.date,
  3581. startDate: this.WorktimeDatepickValue[0],
  3582. endDate: this.WorktimeDatepickValue[1],
  3583. },
  3584. (res) => {
  3585. if (res.code == "ok") {
  3586. let url = res.data;
  3587. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3588. }
  3589. },
  3590. (error) => {
  3591. this.$message({
  3592. message: error,
  3593. type: "error",
  3594. });
  3595. }
  3596. );
  3597. },
  3598. exportMembNotWorkHours() {
  3599. this.http.post(
  3600. "/report/exportNoReportUserList",
  3601. {
  3602. // month: this.date,
  3603. startDate: this.WorktimeDatepickValue[0],
  3604. endDate: this.WorktimeDatepickValue[1],
  3605. },
  3606. (res) => {
  3607. if (res.code == "ok") {
  3608. let url = res.data;
  3609. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3610. }
  3611. },
  3612. (error) => {
  3613. this.$message({
  3614. message: error,
  3615. type: "error",
  3616. });
  3617. }
  3618. );
  3619. },
  3620. downloadByA(name, url) {
  3621. const a = document.createElement("a"); // 创建a标签
  3622. a.setAttribute("download", name); // download属性
  3623. a.setAttribute("href", url); // href链接
  3624. a.click(); // 自执行点击事件
  3625. a.remove();
  3626. },
  3627. // 是否本月判断
  3628. istoMonth(){
  3629. let todate = new Date()
  3630. let tomonth = todate.getMonth() + 1
  3631. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3632. if(this.date == adate){
  3633. return []
  3634. }else{
  3635. let sedate = new Date(this.date)
  3636. let semonth = sedate.getMonth() + 1
  3637. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3638. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3639. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3640. return [sedates1, sedates2]
  3641. }
  3642. },
  3643. showMonthWorkTime() {
  3644. this.monthTotalPage = 0,
  3645. this.tbload = true
  3646. this.http.post(
  3647. "/report/getUserDailyWorkTime",
  3648. // "/report/getNoReportUserList",
  3649. {
  3650. // month: this.date,
  3651. startDate: this.WorktimeDatepickValue[0],
  3652. endDate: this.WorktimeDatepickValue[1],
  3653. },
  3654. (res) => {
  3655. if (res.code == "ok") {
  3656. this.tbload = false;
  3657. this.pickDateArray = res.data.days;
  3658. // console.log('dataarray',res.data.days);
  3659. this.monthWorkData = res.data.list;
  3660. // this.monthWorkDataS = this.monthWorkData
  3661. // this.monthWorkDataS1 = res.data.list
  3662. this.monthTotal = res.data.list.length
  3663. if (this.monthWorkData.length > 50) {
  3664. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3665. }else{
  3666. this.monthWorkDataS = this.monthWorkData
  3667. }
  3668. this.searchScreen(0)
  3669. // this.monthWorkDataS = infoList
  3670. // 判断
  3671. // if (this.monthWorkDataS1.length > 0) {
  3672. // setTimeout(() => {
  3673. // this.tableListener()
  3674. // }, 1000);
  3675. // }
  3676. this.$nextTick(function(){
  3677. this.$refs.hasworkTbl.doLayout();
  3678. });
  3679. // this.$forceUpdate()
  3680. }
  3681. },
  3682. (error) => {
  3683. this.tbload = false
  3684. this.$message({
  3685. message: error,
  3686. type: "error",
  3687. });
  3688. }
  3689. );
  3690. },
  3691. // tableListener(){
  3692. // let that = this;
  3693. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3694. // // 添加scroll监听事件
  3695. // dom.addEventListener("scroll", function () {
  3696. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3697. // if (scrollDistance < 2) {
  3698. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3699. // that.monthTotalPage++; //当前页数自增
  3700. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3701. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3702. // var infoList = arrList.splice(
  3703. // that.monthTotalPage * that.monthTotalLages,
  3704. // that.monthTotalLages
  3705. // );
  3706. // // 数据添加
  3707. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3708. // }
  3709. // }
  3710. // })
  3711. // },
  3712. showMonthNotWorkTime() {
  3713. this.monthTotalPage = 0,
  3714. this.tbload = true,
  3715. this.http.post(
  3716. "/report/getNoReportUserList",
  3717. {
  3718. startDate: this.WorktimeDatepickValue[0],
  3719. endDate: this.WorktimeDatepickValue[1],
  3720. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3721. },
  3722. (res) => {
  3723. if (res.code == "ok") {
  3724. this.tbload = false
  3725. this.monthNotWorkDate = res.data;
  3726. // this.monthNotWorkDateS1 = res.data
  3727. this.monthnotTotal = res.data.length
  3728. // 2222111
  3729. if (this.monthNotWorkDate.length > 50) {
  3730. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3731. } else {
  3732. this.monthNotWorkDateS = this.monthNotWorkDate
  3733. }
  3734. this.searchScreen(1)
  3735. // 判断
  3736. // if (this.monthnotworkDateS1.length > 0) {
  3737. // setTimeout(() => {
  3738. // this.tableListenernot()
  3739. // }, 1000);
  3740. // }
  3741. this.$nextTick(function(){
  3742. this.$refs.hasworkTbl2.doLayout();
  3743. });
  3744. }
  3745. },
  3746. (error) => {
  3747. this.tbload = false
  3748. this.$message({
  3749. message: error,
  3750. type: "error",
  3751. });
  3752. }
  3753. );
  3754. },
  3755. // tableListenernot(){
  3756. // let that = this;
  3757. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3758. // dom.addEventListener("scroll", function () {
  3759. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3760. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3761. // if (scrollDistance2 < 2) {
  3762. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3763. // that.monthnotTotalPage++; //当前页数自增
  3764. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3765. // var infoList = arrList.splice(
  3766. // that.monthnotTotalPage * that.monthnotTotalLages,
  3767. // that.monthnotTotalLages
  3768. // );
  3769. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3770. // }
  3771. // }
  3772. // })
  3773. // },
  3774. listScroll(){
  3775. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3776. this.isMore = true
  3777. setTimeout(()=>{
  3778. this.isMore = false
  3779. },1000)
  3780. }else {
  3781. this.isFlag = true
  3782. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3783. this.monthWorkDataS = datalist
  3784. setTimeout(()=>{
  3785. this.isFlag = false
  3786. },300)
  3787. }
  3788. },
  3789. notListScroll(){
  3790. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3791. this.isMore = true
  3792. setTimeout(()=>{
  3793. this.isMore = false
  3794. },1000)
  3795. }else {
  3796. this.isFlag = true
  3797. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3798. this.monthNotWorkDateS = datalist
  3799. // console.log('length',this.monthNotWorkDateS.length)
  3800. setTimeout(()=>{
  3801. this.isFlag = false
  3802. },300)
  3803. }
  3804. },
  3805. // 获取默认这zhou日期参数 222
  3806. getLastWeek(e){
  3807. let newdate = new Date()
  3808. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3809. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3810. if(e){
  3811. this.WorktimeDatepickValue = lastwd
  3812. this.showMonthWorkTime()
  3813. }else{
  3814. this.WorktimeDatepickValue = lastwd
  3815. this.showMonthNotWorkTime()
  3816. }
  3817. },
  3818. getThisWeek(e){
  3819. let newdate = new Date();
  3820. let nowdate = newdate.toLocaleDateString();
  3821. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3822. if(e){
  3823. this.WorktimeDatepickValue = nowwd
  3824. this.showMonthWorkTime()
  3825. }else{
  3826. this.WorktimeDatepickValue = nowwd
  3827. this.showMonthNotWorkTime()
  3828. }
  3829. },
  3830. getDoubleLastWeek(e){
  3831. let newdate = new Date()
  3832. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3833. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3834. if(e){
  3835. this.WorktimeDatepickValue = nextwd
  3836. this.showMonthWorkTime()
  3837. }else{
  3838. this.WorktimeDatepickValue = nextwd
  3839. this.showMonthNotWorkTime()
  3840. }
  3841. },
  3842. alreadyAllDate(stime,etime){
  3843. let diffdate = new Array();
  3844. let i=0;
  3845. while(stime<=etime){
  3846. let dateArray = stime.split("-");
  3847. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3848. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3849. let stimewk = this.weekDay[date.getDay()]
  3850. let timedate = (stime.split("-")[1].charAt(0) == 0 ? stime.split("-")[1].charAt(1) : stime.split("-")[1]) + this.$t('weekDay.month') + (stime.split("-")[2].charAt(0) == 0 ? stime.split("-")[2].charAt(1) : stime.split("-")[2]) + this.$t('weekDay.day')
  3851. let timeshowdate = (stime.split("-")[1].charAt(0) == 0 ? stime.split("-")[1].charAt(1) : stime.split("-")[1]) + "." + (stime.split("-")[2].charAt(0) == 0 ? stime.split("-")[2].charAt(1) : stime.split("-")[2])
  3852. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3853. let stime_ts = new Date(stime).getTime();
  3854. let next_date = stime_ts + (24*60*60*1000);
  3855. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3856. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3857. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3858. stime = next_dates_y+next_dates_m+next_dates_d;
  3859. i++;
  3860. }
  3861. return diffdate
  3862. },
  3863. getAutoWeekDate(e) {
  3864. let dateString = e;
  3865. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3866. if (dateString.match(dateStringReg)) {
  3867. let presentDate = new Date(dateString),
  3868. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3869. return Array.from(new Array(7), function (val, index) {
  3870. let formatDate = new Date(
  3871. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3872. );
  3873. return (
  3874. formatDate.getFullYear() +
  3875. "-" +
  3876. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3877. "-" +
  3878. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3879. );
  3880. });
  3881. } else {
  3882. throw new Error(
  3883. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3884. );
  3885. }
  3886. },
  3887. onProgressChange() {
  3888. this.$forceUpdate();
  3889. },
  3890. showChooseMembTree() {
  3891. this.chosenMembCount = this.participator.length;
  3892. this.chooseParticipVisible = true;
  3893. },
  3894. onTreeItemChange() {
  3895. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3896. var list = chosenList.filter(item=>item.isUser == 1);
  3897. this.chosenMembCount = list.length;
  3898. },
  3899. findUserInTree() {
  3900. if (this.filterName == '') {
  3901. this.deptMembData = this.allMembData;
  3902. } else {
  3903. var list = this.findRecursively(this.filterName, this.allMembData);
  3904. this.deptMembData = list;
  3905. }
  3906. },
  3907. findRecursively(username, list) {
  3908. var filterList = [];
  3909. for (var i=0;i<list.length; i++) {
  3910. if (list[i].isUser == 1) {
  3911. if (list[i].label.indexOf(username) >= 0) {
  3912. //匹配上了
  3913. filterList.push(list[i]);
  3914. }
  3915. } else if (list[i].children != null && list[i].children.length > 0) {
  3916. var subList = this.findRecursively(username, list[i].children);
  3917. if (subList.length > 0) {
  3918. subList.forEach(s=>filterList.push(s));
  3919. }
  3920. }
  3921. }
  3922. return filterList;
  3923. },
  3924. //确定选择参与人
  3925. chooseParticip() {
  3926. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3927. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3928. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3929. if (this.user.company.packageProject == 1) {
  3930. if (this.chosenMembList.length > 1) {
  3931. this.$message({
  3932. message: '每次仅支持代填一个人',
  3933. type: "error",
  3934. });
  3935. return;
  3936. }
  3937. }
  3938. this.chooseParticipVisible = false;
  3939. this.workForm.userNames = '';
  3940. this.workForm.userId = [];
  3941. this.participator = [];
  3942. for (var i=0;i<this.chosenMembList.length; i++) {
  3943. this.workForm.userId.push(this.chosenMembList[i].id);
  3944. this.workForm.userNames += this.chosenMembList[i].label+',';
  3945. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3946. this.participator.push(item);
  3947. }
  3948. if (this.workForm.userNames.length > 0) {
  3949. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3950. }
  3951. if(this.user.userNameNeedTranslate == 1) {
  3952. if(this.workForm.userNames) {
  3953. this.workForm.userNames = this.workForm.userNames.split(',')
  3954. }
  3955. }
  3956. },
  3957. notifySel(sel){
  3958. // console.log(sel);
  3959. this.notifySelList = sel
  3960. },
  3961. //微信通知人员填写
  3962. Notify(code) {
  3963. if (this.notifySelList.length == 0) return;
  3964. var ids = '';
  3965. this.notifySelList.forEach(f=>{
  3966. ids += f.id+',';
  3967. })
  3968. this.http.post('/user/pushFillReport',{
  3969. ids: ids, date: this.curDate,
  3970. code: code
  3971. },
  3972. res => {
  3973. if (res.code == "ok") {
  3974. this.$message({
  3975. message: this.$t('message.sentSuccessfully'),
  3976. type: "success"
  3977. });
  3978. }
  3979. },
  3980. error => {
  3981. this.$message({
  3982. message: error,
  3983. type: "error"
  3984. });
  3985. }
  3986. );
  3987. },
  3988. //导出人员列表
  3989. exportMemb() {
  3990. if (this.fillMembList.length == 0) return;
  3991. var ids = '';
  3992. this.fillMembList.forEach(f=>{
  3993. ids += f.id+',';
  3994. })
  3995. this.http.post('/user/exportMembList',{
  3996. ids: ids,isFill: this.isFill, date: this.curDate
  3997. },
  3998. res => {
  3999. if (res.code == "ok") {
  4000. var aTag = document.createElement('a');
  4001. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4002. aTag.href = res.data;
  4003. aTag.click();
  4004. }
  4005. },
  4006. error => {
  4007. this.$message({
  4008. message: error,
  4009. type: "error"
  4010. });
  4011. }
  4012. );
  4013. },
  4014. showMembList(fill) {
  4015. this.membListVisible = true;
  4016. if (fill == 0) {
  4017. this.fillMembList = this.unFillList;
  4018. this.isFill = false;
  4019. let leaveList = []
  4020. let unleaveList = []
  4021. for(let i in this.fillMembList){
  4022. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4023. leaveList.push(this.fillMembList[i])
  4024. }else{
  4025. unleaveList.push(this.fillMembList[i])
  4026. }
  4027. }
  4028. this.fillMembList = unleaveList
  4029. this.fillMembList_leave = leaveList
  4030. } else if(fill == 1){
  4031. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4032. this.isFill = true;
  4033. }else{
  4034. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4035. this.isFill = true;
  4036. }
  4037. },
  4038. //获取自己填写的日报状态
  4039. getReportFillStatus() {
  4040. this.http.post('/report/getReportFillStatus',{
  4041. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4042. },
  4043. res => {
  4044. if (res.code == "ok") {
  4045. this.fillStatusList = res.data;
  4046. this.allDate.forEach(d=>{
  4047. var fillInfo = null;
  4048. d.state = null;
  4049. this.fillStatusList.forEach(s=>{
  4050. // console.log(d)
  4051. var d1 = s.createDate.split('-')[2];
  4052. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4053. // console.log(d2, '我被执行了')
  4054. if (d1.indexOf('0') == 0) {
  4055. d1 = d1.substring(1,d1.length);
  4056. }
  4057. if (d1 == d2) {
  4058. d.state = s.state;
  4059. }
  4060. })
  4061. })
  4062. this.$forceUpdate();
  4063. }
  4064. },
  4065. error => {
  4066. this.$message({
  4067. message: error,
  4068. type: "error"
  4069. });
  4070. }
  4071. );
  4072. },
  4073. scrollFunction () {
  4074. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4075. if (this.domObj.attachEvent) { // IE
  4076. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4077. } else if (this.domObj.addEventListener) {
  4078. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4079. }
  4080. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4081. },
  4082. mouseScroll(event) { // google 浏览器下
  4083. let detail = event.wheelDelta || event.detail
  4084. let moveForwardStep = -1
  4085. let moveBackStep = 1
  4086. let step = 0
  4087. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4088. event.preventDefault() // 阻止浏览器默认事件
  4089. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4090. },
  4091. // //左右滚动
  4092. // wheel(e){
  4093. // var a = document.getElementById("dateScroll");
  4094. // var scroll_width = 80; //滚动一下的距离
  4095. // var e = e || window.event, v;
  4096. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4097. // if(v>3||-v>3) v=-v;
  4098. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4099. // e.preventDefault(); //阻止浏览器的默认滚动
  4100. // },
  4101. showExportDialog() {
  4102. this.exportType = 0
  4103. this.exportDialog = true;
  4104. },
  4105. showExportTimeDialog() {
  4106. this.exportTimeDialog = true;
  4107. },
  4108. changeAllTime() {
  4109. //总时长发生改变,自动按比例计算
  4110. this.workForm.domains.forEach(d=>{
  4111. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4112. });
  4113. //计算jsTime
  4114. if (this.workForm.createDate) {
  4115. let sdate = new Date(this.workForm.createDate[0]);
  4116. let edate = new Date(this.workForm.createDate[1]);
  4117. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4118. console.log('days===', days)
  4119. if (days < 0) {
  4120. days = 0;
  4121. }
  4122. this.jsTime = this.reportTimeType.allday * days;
  4123. }
  4124. },
  4125. // 是否加班的单机事件
  4126. check() {
  4127. this.selected = !this.selected
  4128. this.isNew = this.selected
  4129. },
  4130. updateSubProject() {
  4131. this.$forceUpdate();
  4132. },
  4133. selectDegreeId(domain, index) {
  4134. this.http.post('/report/defaultDegree',{
  4135. projectId: domain.projectId
  4136. },
  4137. res => {
  4138. if (res.code == "ok") {
  4139. if(res.data) {
  4140. this.workForm.domains[index].degreeId = res.data.id + ''
  4141. this.$forceUpdate();
  4142. }
  4143. }
  4144. },
  4145. error => {
  4146. this.$message({
  4147. message: error,
  4148. type: "error"
  4149. });
  4150. }
  4151. );
  4152. },
  4153. //项目选中了, 加载子项目
  4154. selectProject(domain, index) {
  4155. if(!domain.projectId){
  4156. return;
  4157. }
  4158. // 默认选中上次填写的自定义维度
  4159. if(this.yonghuUser.customDegreeActive == 1) {
  4160. this.selectDegreeId(domain, index)
  4161. }
  4162. // console.log('projectId===',domain.projectId);
  4163. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4164. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4165. this.http.post('/sub-project/list',{
  4166. projectId: domain.projectId,
  4167. isReport: true
  4168. },
  4169. res => {
  4170. //清空之前选中的子项目
  4171. // this.workForm.domains[index].subProjectId = 0;
  4172. if (res.code == "ok") {
  4173. this.workForm.domains[index].subProjectList = res.data;
  4174. this.workForm.domains[index].subProjectId = null;
  4175. this.$forceUpdate();
  4176. }
  4177. },
  4178. error => {
  4179. this.$message({
  4180. message: error,
  4181. type: "error"
  4182. });
  4183. }
  4184. );
  4185. //项目相关的近期任务
  4186. if (this.user.company.packageProject == 1) {
  4187. this.getRecentTaskList(domain, index);
  4188. //获取项目相关专业
  4189. if (this.user.company.packageEngineering == 1) {
  4190. this.getProjectProfessions(domain, index);
  4191. }
  4192. //获取项目下的任务分组
  4193. this.getTaskGroups(domain, index);
  4194. }
  4195. // 获取项目相关的维度
  4196. // domain.degreeId = null
  4197. this.$set(domain,'degreeId',null)
  4198. this.$set(domain,'multiDegrIdArray',null)
  4199. this.dimension(domain, index);
  4200. //获取项目审核人
  4201. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4202. this.getProjectAuditorList(domain, index);
  4203. } else {
  4204. //按分组的负责人来审核
  4205. domain.projectAuditorId = null;
  4206. domain.projectAuditorName = null;
  4207. domain.auditUserList = null;
  4208. }
  4209. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4210. if (this.reportTimeType.type == 3) {
  4211. //新增项目时,自动计算
  4212. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4213. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4214. }
  4215. //加载昱众的工作职责
  4216. if (this.user.companyId == this.yuzhongCompId) {
  4217. this.updateResponse(domain);
  4218. }
  4219. },
  4220. getRecentTaskList(domain, index) {
  4221. //刷新任务时,清空服务
  4222. this.$set(domain, 'sapServiceId', null);
  4223. this.$set(domain, 'taskId', null);
  4224. var param = {
  4225. projectId: domain.projectId,
  4226. isSubstitude:this.isSubstitude?1:0,
  4227. };
  4228. if (domain.groupId) {
  4229. param.groupId = domain.groupId;
  4230. }
  4231. if (domain.stage) {
  4232. param.stage = domain.stage;
  4233. }
  4234. //专业版代填,获取代填员工的任务
  4235. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4236. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4237. this.$message({
  4238. message: '请选择代填的员工',
  4239. type: "error"
  4240. });
  4241. return;
  4242. } else {
  4243. param.userId = this.workForm.userId[0];
  4244. }
  4245. }
  4246. this.http.post('/task/getRecentTask',param,
  4247. res => {
  4248. if (res.code == "ok") {
  4249. this.workForm.domains[index].allTaskList = res.data;
  4250. this.workForm.domains[index].taskList = res.data;
  4251. this.$forceUpdate();
  4252. }
  4253. },
  4254. error => {
  4255. this.$message({
  4256. message: error,
  4257. type: "error"
  4258. });
  4259. }
  4260. );
  4261. },
  4262. //获取项目审核人
  4263. getProjectAuditorList(domainItem, index) {
  4264. if(domainItem.projectId == '') {
  4265. return
  4266. }
  4267. domainItem.projectAuditorId = null;
  4268. domainItem.projectAuditorName = null;
  4269. this.http.post('/project-auditor/getList',{
  4270. projectId: domainItem.projectId,
  4271. },
  4272. res => {
  4273. if (res.code == "ok") {
  4274. domainItem.auditUserList = res.data;
  4275. if (res.data.length==0) {
  4276. this.$message({
  4277. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4278. type: "error"
  4279. });
  4280. } else if (res.data.length==1) {
  4281. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4282. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4283. }
  4284. this.$forceUpdate();
  4285. }
  4286. },
  4287. error => {
  4288. this.$message({
  4289. message: error,
  4290. type: "error"
  4291. });
  4292. }
  4293. );
  4294. },
  4295. // 获取维度数据
  4296. dimension(domain, index) {
  4297. if(domain.projectId == '') {
  4298. return
  4299. }
  4300. this.http.post('/project/getDegreeList',{
  4301. projectId: domain.projectId,
  4302. },
  4303. res => {
  4304. if (res.code == "ok") {
  4305. // console.log("维度数据",res.data);
  4306. this.workForm.domains[index].wuduList = res.data
  4307. // this.workForm = this.workForm
  4308. this.$forceUpdate()
  4309. }
  4310. },
  4311. error => {
  4312. this.$message({
  4313. message: error,
  4314. type: "error"
  4315. });
  4316. }
  4317. );
  4318. },
  4319. //切换任务阶段
  4320. changeStages(domain, index) {
  4321. if (domain.stage == null || domain.stage == '') {
  4322. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4323. } else {
  4324. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4325. }
  4326. this.getRecentTaskList(domain, index);
  4327. this.$forceUpdate();
  4328. },
  4329. getGroupStages(domain, index, keepStage) {
  4330. // console.log(domain);
  4331. if(!domain.groupId){
  4332. domain.projectAuditorId = ''
  4333. domain.stages = []
  4334. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4335. domain.taskId = ''
  4336. domain.sapServiceId = ''
  4337. }
  4338. if(this.user.timeType.reportAuditType >= 1){
  4339. domain.auditUserList = []
  4340. }
  4341. this.$forceUpdate();
  4342. return
  4343. }
  4344. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4345. res => {
  4346. if (res.code == "ok") {
  4347. if (!keepStage) {
  4348. domain.stage = '';
  4349. }
  4350. domain.stages = res.data;
  4351. this.getRecentTaskList(domain, index);
  4352. this.$forceUpdate();
  4353. }
  4354. },
  4355. error => {
  4356. this.$message({
  4357. message: error,
  4358. type: "error"
  4359. });
  4360. });
  4361. //检查当前的项目是否需要获取分组的负责人
  4362. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4363. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4364. res => {
  4365. if (res.code == "ok") {
  4366. domain.getProjectAuditorList = res.data;
  4367. domain.auditUserList = res.data;
  4368. if (res.data.length==1) {
  4369. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4370. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4371. } else if (res.data.length==0) {
  4372. domain.projectAuditorId = null;
  4373. domain.projectAuditorName = null;
  4374. }
  4375. this.$forceUpdate();
  4376. }
  4377. },
  4378. error => {
  4379. this.$message({
  4380. message: error,
  4381. type: "error"
  4382. });
  4383. });
  4384. }
  4385. },
  4386. getProjectProfessions(domain, index) {
  4387. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4388. res => {
  4389. if (res.code == "ok") {
  4390. this.workForm.domains[index].professionProgress = res.data;
  4391. this.$forceUpdate();
  4392. }
  4393. },
  4394. error => {
  4395. this.$message({
  4396. message: error,
  4397. type: "error"
  4398. });
  4399. });
  4400. },
  4401. //删除自己的日报
  4402. deleteReport() {
  4403. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4404. confirmButtonText: this.$t('btn.determine'),
  4405. cancelButtonText: this.$t('btn.cancel'),
  4406. type: "warning"
  4407. })
  4408. .then(() => {
  4409. this.listLoading = true;
  4410. this.http.post('/report/delete',{
  4411. userId: this.user.id,
  4412. date: this.workForm.createDate
  4413. },
  4414. res => {
  4415. this.listLoading = false;
  4416. if (res.code == "ok") {
  4417. this.$message({
  4418. message: this.$t('message.successfullyDeleted'),
  4419. type: "success"
  4420. });
  4421. this.getReportList();
  4422. this.getDepartment();
  4423. this.dialogVisible = false;
  4424. } else {
  4425. this.$message({
  4426. message: res.msg,
  4427. type: "error"
  4428. });
  4429. }
  4430. },
  4431. error => {
  4432. this.listLoading = false;
  4433. this.$message({
  4434. message: error,
  4435. type: "error"
  4436. });
  4437. }
  4438. );
  4439. })
  4440. .catch(() => {});
  4441. },
  4442. // 管理员删除日报
  4443. guanli(item) {
  4444. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4445. let param = {date: this.date + day, userId: item.id};
  4446. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4447. confirmButtonText: this.$t('btn.determine'),
  4448. cancelButtonText: this.$t('btn.cancel'),
  4449. type: "warning"
  4450. })
  4451. .then(() => {
  4452. this.listLoading = true;
  4453. this.http.post('/report/delete',param,
  4454. res => {
  4455. this.listLoading = false;
  4456. if (res.code == "ok") {
  4457. this.$message({
  4458. message: this.$t('message.successfullyDeleted'),
  4459. type: "success"
  4460. });
  4461. this.getReportList();
  4462. this.getDepartment();
  4463. this.dialogVisible = false;
  4464. } else {
  4465. this.$message({
  4466. message: res.msg,
  4467. type: "error"
  4468. });
  4469. }
  4470. },
  4471. error => {
  4472. this.listLoading = false;
  4473. this.$message({
  4474. message: error,
  4475. type: "error"
  4476. });
  4477. }
  4478. );
  4479. })
  4480. .catch(() => {});
  4481. },
  4482. selectAll() {
  4483. if (this.isAllSelect) {
  4484. var keys = [];
  4485. this.reportNames.forEach(b=>{
  4486. keys.push(b.id);
  4487. })
  4488. this.$refs.approveTree.setCheckedKeys(keys);
  4489. } else {
  4490. this.$refs.approveTree.setCheckedKeys([]);
  4491. }
  4492. },
  4493. removeEmptyNode(list) {
  4494. for (var i=0;i<list.length;i++) {
  4495. var cnt = 0;
  4496. if (list[i].membCount == 0) {
  4497. list.splice(i, 1);
  4498. i--;
  4499. } else if (list[i].children != null) {
  4500. this.removeEmptyNode(list[i].children);
  4501. }
  4502. }
  4503. },
  4504. calculateMembCount(list) {
  4505. for (var i in list) {
  4506. var cnt = 0;
  4507. if (list[i].children != null) {
  4508. this.calculateMembCount(list[i].children);
  4509. for (var m in list[i].children) {
  4510. cnt += list[i].children[m].membCount;
  4511. }
  4512. }
  4513. if (list[i].isUser == 1) {
  4514. cnt++;
  4515. this.membCount++;
  4516. }
  4517. list[i].membCount = cnt;
  4518. }
  4519. },
  4520. stateChange() {
  4521. // console.log(this.allData,'alldate');
  4522. this.membCount = 0;
  4523. if (this.selectState == -1) {
  4524. //全部状态
  4525. this.data = this.allData;
  4526. } else {
  4527. //未填报
  4528. this.seluserText = ''
  4529. var newData = JSON.parse(JSON.stringify(this.allData));
  4530. this.filterState(this.selectState, newData);
  4531. this.data = newData;
  4532. }
  4533. this.calculateMembCount(this.data);
  4534. this.data[0].membCount = this.membCount;//总人数
  4535. },
  4536. //按状态过滤部门人员
  4537. filterState(state, list) {
  4538. for (var i =0;i<list.length; i++) {
  4539. var obj = list[i];
  4540. if (obj.isUser == 1) {
  4541. var match = false;
  4542. if (state == -2) {
  4543. if (obj.state == null) {
  4544. match = true;
  4545. }
  4546. } else {
  4547. if (obj.state == state) {
  4548. match = true;
  4549. }
  4550. }
  4551. if (!match) {
  4552. list.splice(i, 1);
  4553. i--;
  4554. } else {
  4555. }
  4556. } else {
  4557. if (obj.children != null) {
  4558. this.filterState(state, obj.children);
  4559. }
  4560. }
  4561. }
  4562. },
  4563. //a按名称过滤部门人员
  4564. async seluserforText(){
  4565. const { userNameNeedTranslate } = this.user
  4566. this.membCount = 0;
  4567. var newData = JSON.parse(JSON.stringify(this.allData));
  4568. let textList = [this.seluserText]
  4569. if(userNameNeedTranslate == 1) {
  4570. this.dataLoading = true
  4571. let res = await this.postData('/user/getEmployeeList', {
  4572. keyword: this.seluserText,
  4573. cursor: '',
  4574. departmentId: -1,
  4575. pageIndex: 1,
  4576. pageSize: 1000
  4577. })
  4578. textList = res.data.records.map(item => item.name)
  4579. this.dataLoading = false
  4580. }
  4581. // return
  4582. console.log(textList, '<=== textList')
  4583. this.seluserforTextin(this.seluserText, newData, textList)
  4584. console.log(newData, 'Data')
  4585. this.data = newData;
  4586. this.calculateMembCount(this.data);
  4587. this.data[0].membCount = this.membCount;//总人数
  4588. },
  4589. seluserforTextin(text, list, textList = []){
  4590. for (var i =0;i<list.length; i++) {
  4591. var obj = list[i];
  4592. if (obj.isUser == 1) {
  4593. var match = false;
  4594. // if (obj.label.indexOf(text) != -1) {
  4595. // match = true
  4596. // }
  4597. if(textList.some(item => item.includes(obj.label))) {
  4598. match = true
  4599. }
  4600. if (!match) {
  4601. list.splice(i, 1);
  4602. i--;
  4603. } else {
  4604. }
  4605. } else {
  4606. if (obj.children != null) {
  4607. this.seluserforTextin(text, obj.children, textList);
  4608. }
  4609. }
  4610. }
  4611. },
  4612. // 当节点发生变化时
  4613. nodeChangeExpand(data) {
  4614. // 保存当前展开的节点
  4615. let flag = false
  4616. this.nodeModelData.some(item => {
  4617. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4618. flag = true
  4619. return true
  4620. }
  4621. })
  4622. if (!flag) { // 不存在则存到数组里
  4623. this.nodeModelData.push(data.id)
  4624. }
  4625. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4626. },
  4627. nodeChangeCollapse(data) {
  4628. console.log(this.nodeModelData)
  4629. this.nodeModelData.some((item, i) => {
  4630. if (item === data.id) {
  4631. this.nodeModelData.length = i
  4632. }
  4633. })
  4634. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4635. },
  4636. // 部门列表点击
  4637. handleNodeClick(data) {
  4638. // this.dealList = data
  4639. this.theValues(data.id, this.allData)
  4640. // this.depData = data;
  4641. var list = [];
  4642. if (data.id == -1) {
  4643. this.deptId = null;
  4644. this.targetUid = null;
  4645. list = this.data;
  4646. } else if (data.isUser == 1) {
  4647. this.deptId = null;
  4648. this.targetUid = data.id;
  4649. } else {
  4650. this.deptId = data.id;
  4651. this.targetUid = null;
  4652. list.push(data);
  4653. }
  4654. this.getReportList();
  4655. if (list.length > 0) {
  4656. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4657. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4658. }
  4659. },
  4660. exportPushLog(){
  4661. this.http.post('/sap-sync-log/export',{},
  4662. res => {
  4663. if (res.code == "ok") {
  4664. var filePath = res.data;
  4665. var fName = '推送日志.xlsx'
  4666. const a = document.createElement('a'); // 创建a标签
  4667. a.setAttribute('download', fName);// download属性
  4668. a.setAttribute('href', filePath);// href链接
  4669. a.click(); //自执行点击事件
  4670. a.remove();
  4671. } else {
  4672. this.$message({
  4673. message: res.msg,
  4674. type: "error"
  4675. });
  4676. }
  4677. },
  4678. error => {
  4679. this.$message({
  4680. message: error,
  4681. type: "error"
  4682. });
  4683. });
  4684. },
  4685. theValues(id, item) {
  4686. for(var i in item) {
  4687. if(item[i].id == id) {
  4688. this.depData = item[i]
  4689. if(id == '-1') {
  4690. this.translation = '1'
  4691. } else {
  4692. if(item[i].children) {
  4693. this.translation = '2'
  4694. } else {
  4695. this.translation = '3'
  4696. }
  4697. }
  4698. return
  4699. } else {
  4700. if(item[i].children) {
  4701. this.theValues(id, item[i].children)
  4702. }
  4703. }
  4704. }
  4705. },
  4706. //获取可以选择的代填的人员列表
  4707. getSubstitudeUserDeptList() {
  4708. if (this.deptMembData.length == 0) {
  4709. this.http.post("/department/listMyMembs", {},
  4710. res => {
  4711. if (res.code == "ok") {
  4712. let noAllData = JSON.parse(JSON.stringify(res.data));
  4713. if (noAllData.length > 0) {
  4714. // if (noAllData[0].label == '全部人员') {
  4715. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4716. noAllData.splice(0,1);
  4717. }
  4718. }
  4719. this.setUserToDept(noAllData);
  4720. this.deptMembData = noAllData;
  4721. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4722. console.log(this.deptMembData, '代填人员数据')
  4723. } else {
  4724. this.$message({
  4725. message: res.msg,
  4726. type: "error"
  4727. });
  4728. }
  4729. },
  4730. error => {
  4731. this.$message({
  4732. message: error,
  4733. type: "error"
  4734. });
  4735. });
  4736. }
  4737. },
  4738. // 获取部门列表
  4739. getDepartmentForApprove() {
  4740. this.http.post( this.port.manage.depList, {},
  4741. res => {
  4742. if (res.code == "ok") {
  4743. var list1 = JSON.parse(JSON.stringify(res.data));
  4744. this.deptOptionList = this.changeArr(list1);
  4745. console.log(this.deptOptionList, '部门')
  4746. } else {
  4747. this.$message({
  4748. message: res.msg,
  4749. type: "error"
  4750. });
  4751. }
  4752. },
  4753. error => {
  4754. this.$message({
  4755. message: error,
  4756. type: "error"
  4757. });
  4758. });
  4759. },
  4760. // 获取部门列表
  4761. getDepartment() {
  4762. //如果没有权限,就不需要获取
  4763. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4764. return;
  4765. }
  4766. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4767. var param = {date:this.date + day};
  4768. this.http.post("/report/getMembList", param,
  4769. res => {
  4770. if (res.code == "ok") {
  4771. if(res.data.length == 0){
  4772. return
  4773. }
  4774. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4775. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4776. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4777. // if (this.user.role > 0) {
  4778. // }
  4779. list.splice(0,0,{
  4780. id: -1,
  4781. label: this.$t('lable.allStaff'),
  4782. })
  4783. this.membCount = 0;
  4784. //设置员工到部门下面
  4785. this.setUserToDept(list);
  4786. this.data = list;
  4787. // console.log('data',this.data);
  4788. this.expandDate = [this.data[1].id]
  4789. this.allData = list;
  4790. // if (noAllData.length > 0) {
  4791. // if (noAllData[0].label == '全部人员') {
  4792. // noAllData.splice(0,1);
  4793. // }
  4794. // }
  4795. // this.setUserToDept(noAllData);
  4796. // this.deptMembData = noAllData;
  4797. this.option = this.changeArr(list1);
  4798. list[0].membCount = this.membCount;
  4799. if (this.depData.id == -1) {
  4800. this.depData.membCount = this.membCount;
  4801. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4802. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4803. } else {
  4804. if (this.depData.isUser == null) {
  4805. var dep = this.findTargetDept(this.data, this.depData.id);
  4806. var membDeptList = [];
  4807. membDeptList.push(dep);
  4808. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4809. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4810. }
  4811. }
  4812. if (this.depData.isUser == null) {
  4813. if (this.isFill) {
  4814. this.fillMembList = this.fillList;
  4815. } else {
  4816. this.fillMembList = this.unFillList;
  4817. }
  4818. }
  4819. this.leaveAllNum = 0
  4820. for(let i in this.unFillList){
  4821. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4822. this.leaveAllNum += 1
  4823. }
  4824. }
  4825. this.stateChange()
  4826. } else {
  4827. this.$message({
  4828. message: res.msg,
  4829. type: "error"
  4830. });
  4831. }
  4832. },
  4833. error => {
  4834. this.$message({
  4835. message: error,
  4836. type: "error"
  4837. });
  4838. });
  4839. this.getReportFillStatus();
  4840. },
  4841. findTargetDept(list, deptId) {
  4842. var t = null;
  4843. for (var i=0;i<list.length; i++) {
  4844. if (list[i].isUser == null && list[i].id == deptId) {
  4845. t = list[i];
  4846. break;
  4847. }
  4848. }
  4849. if (t == null) {
  4850. for (var i=0;i<list.length; i++) {
  4851. if (list[i].children != null && list[i].children.length > 0) {
  4852. t = this.findTargetDept(list[i].children, deptId);
  4853. if (t != null) {
  4854. break;
  4855. }
  4856. }
  4857. }
  4858. }
  4859. return t;
  4860. },
  4861. getUserMembListFromDeptList(list, isFill) {
  4862. var membList = [];
  4863. for (var i in list) {
  4864. var deptName = list[i].label;
  4865. if (list[i].userList != null) {
  4866. list[i].userList.forEach(element => {
  4867. if (isFill == 0) {
  4868. //获取未填的
  4869. if (element.state == null) {
  4870. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4871. membList.push(obj);
  4872. }
  4873. } else {
  4874. if (element.state != null) {
  4875. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4876. membList.push(obj);
  4877. }
  4878. }
  4879. });
  4880. }
  4881. if (list[i].children != null) {
  4882. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4883. }
  4884. }
  4885. return membList;
  4886. },
  4887. setUserToDept(list) {
  4888. for (var i in list) {
  4889. var cnt = 0;
  4890. if (list[i].children != null) {
  4891. this.setUserToDept(list[i].children);
  4892. for (var m in list[i].children) {
  4893. cnt += list[i].children[m].membCount;
  4894. }
  4895. }
  4896. if (list[i].userList != null) {
  4897. if (list[i].children == null) {
  4898. list[i].children = [];
  4899. }
  4900. list[i].userList.forEach(element => {
  4901. var obj = {
  4902. id: element.id,
  4903. label:element.name,
  4904. state:element.state,
  4905. parentId:element.departmentId,
  4906. isUser:1,
  4907. workingTime: element.workingTime,
  4908. leaveDays: element.leaveDays,
  4909. leaveTimes: element.leaveTimes
  4910. };
  4911. list[i].children.push(obj);
  4912. this.membCount++;
  4913. cnt++;
  4914. });
  4915. }
  4916. list[i].membCount = cnt;
  4917. }
  4918. },
  4919. // 修改数组
  4920. changeArr(arr) {
  4921. for (var i = 0; i < arr.length; i++) {
  4922. if(arr[i].id != -1 && arr[i].id != 0) {
  4923. if (arr[i].children != null && arr[i].children.length>0) {
  4924. arr[i].children = this.changeArr(arr[i].children);
  4925. }
  4926. arr[i].id && (arr[i].value = arr[i].id);
  4927. delete arr[i].id;
  4928. }
  4929. }
  4930. for(var i in arr) {
  4931. if(arr[i].id == -1 || arr[i].id == 0) {
  4932. arr.splice(i,1)
  4933. }
  4934. }
  4935. return arr;
  4936. },
  4937. //时间段范围设置改动,监听
  4938. onTimeTypeChange(timeType) {
  4939. this.seleChn(1)
  4940. this.showAddMore = true;
  4941. for(var i in this.workForm.domains) {
  4942. if (this.workForm.domains[i].timeType == 0) {
  4943. this.showAddMore = false;
  4944. break;
  4945. }
  4946. }
  4947. if (this.showAddMore) {
  4948. //检测数量
  4949. if (this.workForm.domains.length == 2) {
  4950. this.showAddMore = false;
  4951. } else {
  4952. this.showAddMore = true;
  4953. }
  4954. }
  4955. },
  4956. getTimeType() {
  4957. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4958. res => {
  4959. if (res.code == "ok") {
  4960. var t = res.data;
  4961. this.reportTimeType = t;
  4962. if (this.reportTimeType.type > 0) {
  4963. this.showAddMore = true;
  4964. }
  4965. //转化时间格式
  4966. if (t.allday != null) {
  4967. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4968. }
  4969. if (t.am != null) {
  4970. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4971. }
  4972. if (t.pm != null) {
  4973. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4974. }
  4975. let arr = []
  4976. for(var i in res.data.excludeTimeList) {
  4977. let obj = {
  4978. s: res.data.excludeTimeList[i].startTime,
  4979. e: res.data.excludeTimeList[i].endTime,
  4980. }
  4981. arr.push(obj)
  4982. }
  4983. this.vacationTime = arr
  4984. } else {
  4985. this.$message({
  4986. message: res.msg,
  4987. type: "error"
  4988. });
  4989. }
  4990. },
  4991. error => {
  4992. this.listLoading = false;
  4993. this.$message({
  4994. message: error,
  4995. type: "error"
  4996. });
  4997. });
  4998. },
  4999. // 改变月份 -------
  5000. changeMonthOut() {
  5001. this.getAllDate();
  5002. this.getReportList();
  5003. this.getDepartment();
  5004. },
  5005. // 选择日期
  5006. choseDate(i, item) {
  5007. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5008. return
  5009. }
  5010. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5011. this.choseDay = i;
  5012. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5013. sessionStorage.msg = this.date + day,
  5014. this.getReportList();
  5015. this.getDepartment();
  5016. this.curDate = item.date;
  5017. },
  5018. canClick(i, item){
  5019. let nowDate = new Date()
  5020. let nowDateYear = nowDate.getFullYear()
  5021. let itemYear = parseInt(this.date.split('-')[0])
  5022. let nowDateMonth = nowDate.getMonth() + 1
  5023. let itemMonth = parseInt(this.date.split('-')[1])
  5024. let nowDateDay = nowDate.getDate()
  5025. let itemDay = parseInt(item.showDate.split('.')[1])
  5026. if(nowDateYear < itemYear){
  5027. return false
  5028. }else if(nowDateYear == itemYear){
  5029. if(nowDateMonth < itemMonth){
  5030. return false
  5031. }else if(nowDateMonth == itemMonth){
  5032. if(nowDateDay < itemDay){
  5033. return false
  5034. }
  5035. }
  5036. }
  5037. },
  5038. // 获取日期列表
  5039. getAllDate(e) {
  5040. var dayArry = [];
  5041. var day = this.getCountDays();
  5042. let curMonthDay = null;
  5043. for (var k = 1; k <= day; k++) {
  5044. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5045. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5046. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5047. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5048. if(sessionStorage.msg) {
  5049. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5050. this.choseDay = k - 1;
  5051. curMonthDay = str;
  5052. }
  5053. } else {
  5054. if (new Date().getDate() == k) {
  5055. this.choseDay = k - 1;
  5056. }
  5057. }
  5058. } else {
  5059. this.choseDay = 0;
  5060. }
  5061. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5062. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5063. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5064. }
  5065. this.allDate = dayArry;
  5066. //不能超过最大日期
  5067. if (this.choseDay > day-1) {
  5068. this.choseDay = day-1;
  5069. }
  5070. if(sessionStorage.from != 1){
  5071. let nowmonth = new Date().getMonth() + 1
  5072. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5073. let nowdate = new Date().getDate()
  5074. if(nowd == this.date){
  5075. if(e && sessionStorage.msg){
  5076. }else{
  5077. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5078. }
  5079. let nowday = new Date(sessionStorage.msg).getDate()
  5080. this.choseDay = nowday - 1
  5081. let monthdate = new Date(sessionStorage.msg)
  5082. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5083. }else{
  5084. if(e && sessionStorage.msg){
  5085. }else{
  5086. sessionStorage.msg = this.date + '-01'
  5087. }
  5088. let monthdate = new Date(sessionStorage.msg)
  5089. this.choseDay = monthdate.getDate() - 1
  5090. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5091. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5092. }
  5093. }else{
  5094. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5095. }
  5096. //从消息点击跳转过来的,直接加载指定日期
  5097. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5098. this.curDate = sessionStorage.msg;
  5099. sessionStorage.from = 0;
  5100. } else {
  5101. // if (curMonthDay != null) {
  5102. // // this.curDate = curMonthDay;
  5103. // let d = new Date(sessionStorage.msg)
  5104. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5105. // } else {
  5106. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5107. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5108. // }
  5109. }
  5110. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5111. // if(!sessionStorage.msg){
  5112. // let msgday = this.choseDay + 1
  5113. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5114. // }
  5115. this.getReportFillStatus();
  5116. },
  5117. getCountDays() {
  5118. var newstr = this.date.replace(/-/g, "/");
  5119. var curDate = new Date(newstr+'/01');
  5120. var curMonth = curDate.getMonth();
  5121. curDate.setMonth(curMonth + 1);
  5122. curDate.setDate(0);
  5123. return curDate.getDate();
  5124. },
  5125. reqMore() {
  5126. if (this.hasMore) {
  5127. this.pageIndex++;
  5128. this.requestHttpReports();
  5129. }
  5130. },
  5131. //加载日报数据
  5132. requestHttpReports() {
  5133. //请求数据
  5134. this.listLoading = true;
  5135. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5136. let param = {date: this.date + day};
  5137. if (this.deptId) {
  5138. param.deptId = this.deptId;
  5139. }
  5140. if (this.targetUid) {
  5141. param.userId = this.targetUid;
  5142. }
  5143. //传页码
  5144. if (this.hasMore) {
  5145. param.pageIndex = this.pageIndex;
  5146. }
  5147. this.http.post( this.port.report.list, param,
  5148. res => {
  5149. this.listLoading = false;
  5150. if (res.code == "ok") {
  5151. //扩增
  5152. this.reportList = this.reportList.concat(res.data.data);
  5153. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5154. if(document.querySelector("#day"+this.choseDay)){
  5155. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5156. }
  5157. } else {
  5158. this.$message({
  5159. message: res.msg,
  5160. type: "error"
  5161. });
  5162. }
  5163. },
  5164. error => {
  5165. this.listLoading = false;
  5166. this.$message({
  5167. message: error,
  5168. type: "error"
  5169. });
  5170. });
  5171. },
  5172. //获取日报列表
  5173. getReportList() {
  5174. //初始化,重置数据
  5175. this.pageIndex = 0;
  5176. this.hasMore = true;
  5177. this.reportList = [];
  5178. this.requestHttpReports();
  5179. },
  5180. //刷新日报状态,用于审核后更新
  5181. refreshReportData(reportId) {
  5182. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5183. res => {
  5184. if (res.code == "ok") {
  5185. for (var m=0;m<this.reportList.length; m++) {
  5186. var d = this.reportList[m].data;
  5187. var find = d.filter(r=>r.id == reportId);
  5188. if (find.length > 0) {
  5189. find[0].state = res.data.state;
  5190. if (find[0].state == 2) {//被驳回,要可以编辑
  5191. this.reportList[m].state = 2;
  5192. }
  5193. find[0].isDeptAudit = res.data.isDeptAudit;
  5194. find[0].departmentAuditState = res.data.departmentAuditState;
  5195. find[0].projectAuditorName = res.data.projectAuditorName;
  5196. find[0].projectAuditorId = res.data.projectAuditorId;
  5197. find[0].projectAuditState = res.data.projectAuditState;
  5198. find[0].rejectUserid = res.data.rejectUserid;
  5199. find[0].rejectUsername = res.data.rejectUsername;
  5200. find[0].rejectReason = res.data.rejectReason;
  5201. this.$forceUpdate();
  5202. break;
  5203. }
  5204. }
  5205. } else {
  5206. this.$message({
  5207. message: res.msg,
  5208. type: "error"
  5209. });
  5210. }
  5211. },
  5212. error => {
  5213. this.listLoading = false;
  5214. this.$message({
  5215. message: error,
  5216. type: "error"
  5217. });
  5218. });
  5219. },
  5220. //导出员工工时统计
  5221. exportUserTime() {
  5222. this.listLoading = true;
  5223. var param = {};
  5224. if (this.exportParam.dateRange != null) {
  5225. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5226. }
  5227. this.http.post('/department/exportDeptStatistic', param,
  5228. res => {
  5229. this.listLoading = false;
  5230. if (res.code == "ok") {
  5231. location.href = res.data;
  5232. this.exportTimeDialog = false;
  5233. } else {
  5234. this.$message({
  5235. message: res.msg,
  5236. type: "error"
  5237. });
  5238. }
  5239. },
  5240. error => {
  5241. this.listLoading = false;
  5242. this.$message({
  5243. message: error,
  5244. type: "error"
  5245. });
  5246. });
  5247. },
  5248. //导出日报
  5249. exportReport() {
  5250. this.exportingData = true;
  5251. var param = {};
  5252. if (this.exportParam.dateRange != null) {
  5253. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5254. }
  5255. if (this.exportParam.projectId != null) {
  5256. param.projectId = this.exportParam.projectId;
  5257. }
  5258. if (this.exportParam.departmentId != null) {
  5259. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5260. }
  5261. param.stateKey = this.stateKey
  5262. // param.departmentId = this.user.departmentId
  5263. console.log(param, '《=== 导出传的参数');
  5264. console.log('开始调用exportReport接口');
  5265. this.http.post(this.port.report.export, param,
  5266. res => {
  5267. this.exportingData = false;
  5268. if (res.code == "ok") {
  5269. location.href = res.data;
  5270. this.exportDialog = false;
  5271. } else {
  5272. this.$message({
  5273. message: res.msg,
  5274. type: "error"
  5275. });
  5276. }
  5277. },
  5278. error => {
  5279. this.exportingData = false;
  5280. this.$message({
  5281. message: error,
  5282. type: "error"
  5283. });
  5284. });
  5285. },
  5286. //获取项目列表
  5287. getProjectList() {
  5288. this.listLoading = true;
  5289. this.http.post( this.port.project.list, {},
  5290. res => {
  5291. this.listLoading = false;
  5292. if (res.code == "ok") {
  5293. for(var i in res.data) {
  5294. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5295. res.data[i].projectCode = ''
  5296. }
  5297. }
  5298. this.projectList = res.data;
  5299. console.log("项目列表",this.projectList);
  5300. } else {
  5301. this.$message({
  5302. message: res.msg,
  5303. type: "error"
  5304. });
  5305. }
  5306. },
  5307. error => {
  5308. this.listLoading = false;
  5309. this.$message({
  5310. message: error,
  5311. type: "error"
  5312. });
  5313. });
  5314. },
  5315. // 获取填报日报的项目下拉列表
  5316. getFillProjectList() {
  5317. this.http.post( this.port.project.list, {
  5318. forReport: 1
  5319. },res => {
  5320. if (res.code == "ok") {
  5321. for(var i in res.data) {
  5322. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5323. res.data[i].projectCode = ''
  5324. }
  5325. }
  5326. this.fillProjectList = res.data;
  5327. this.getRecentlyProject()
  5328. } else {
  5329. this.$message({
  5330. message: res.msg,
  5331. type: "error"
  5332. });
  5333. }
  5334. },
  5335. error => {
  5336. this.$message({
  5337. message: error,
  5338. type: "error"
  5339. });
  5340. });
  5341. },
  5342. getBasecostItemList() {
  5343. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5344. companyId: this.user.companyId
  5345. },
  5346. res => {
  5347. if (res.code == "ok") {
  5348. this.timeBasecostList = res.data;
  5349. }
  5350. });
  5351. },
  5352. getAIReport(createDate) {
  5353. this.http.post('/report/getAIReport', {},
  5354. res => {
  5355. if (res.code == "ok") {
  5356. var quanbu = 0
  5357. this.jsDay = 1
  5358. var zhi = ''
  5359. var slp = res.data
  5360. for(var i in slp) {
  5361. var sp = +slp[i].workingTime + 0
  5362. zhi = this.jsDay * sp
  5363. quanbu = +quanbu + zhi
  5364. }
  5365. this.jsTime = quanbu
  5366. var aiReportData = res.data;
  5367. this.canCancelInDialog = false
  5368. if(aiReportData.length != 0) {
  5369. var arr = [];
  5370. for(var i in aiReportData) {
  5371. arr.push({
  5372. id: null,
  5373. projectId: aiReportData[i].projectId,
  5374. workingTime: aiReportData[i].workingTime,
  5375. content: '',
  5376. progress:100,
  5377. state: 2,
  5378. timeType: aiReportData[i].timeType,
  5379. subProjectList: aiReportData[i].subProjectList,
  5380. taskList: aiReportData[i].taskList,
  5381. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5382. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5383. taskId: aiReportData[i].taskId,
  5384. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5385. startTime: aiReportData[i].startTime,
  5386. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5387. endTime: aiReportData[i].endTime,
  5388. isOvertime: 0,
  5389. progress:aiReportData[i].progress,
  5390. professionProgress: aiReportData[i].professionProgressList,
  5391. stages:aiReportData[i].stages,
  5392. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5393. pics: null,
  5394. multiWorktime: aiReportData[i].multiWorktime,
  5395. worktimeList: [{}],
  5396. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5397. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5398. wuduList: aiReportData[i].degreeList,
  5399. taskGroups:aiReportData[i].taskGroups,
  5400. customData: aiReportData[i].customData,//自定义的数值
  5401. auditUserList: aiReportData[i].auditUserList,
  5402. projectAuditorId: aiReportData[i].projectAuditorId,
  5403. projectAuditorName: aiReportData[i].projectAuditorName,
  5404. overtimeHours: aiReportData[i].overtimeHours,
  5405. customText: aiReportData[i].customText,
  5406. basecostId: aiReportData[i].basecostId,
  5407. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5408. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5409. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5410. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5411. canEdit: true
  5412. })
  5413. }
  5414. this.workForm.domains = arr;
  5415. } else {
  5416. }
  5417. this.canEdit = true;
  5418. this.originCanEdit = true;
  5419. this.seleChn()
  5420. } else {
  5421. this.$message({
  5422. message: res.msg,
  5423. type: "error"
  5424. });
  5425. }
  5426. },
  5427. error => {
  5428. this.$message({
  5429. message: error,
  5430. type: "error"
  5431. });
  5432. });
  5433. },
  5434. // 获取个人某天的日报 111111
  5435. getReport() {
  5436. this.http.post( this.port.report.getPort, {
  5437. date: this.workForm.createDate
  5438. },
  5439. res => {
  5440. if (res.code == "ok") {
  5441. var quanbu = 0
  5442. this.jsDay = 1
  5443. var zhi = ''
  5444. var slp = res.data.report
  5445. for(var i in slp) {
  5446. var sp = +slp[i].workingTime + 0
  5447. zhi = this.jsDay * sp
  5448. quanbu = +quanbu + zhi
  5449. }
  5450. this.jsTime = quanbu
  5451. var list = res.data;
  5452. this.report = list;
  5453. this.reportTimeType = this.report.timeType;
  5454. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5455. this.isWeekend = !this.report.isWorkDay;
  5456. this.canCancelInDialog = false;
  5457. this.hasWrittenReport = list.report.length != 0;
  5458. if(list.report.length != 0) {
  5459. var arr = [];
  5460. this.canEdit = false;
  5461. let candelete = true
  5462. for(var i in list.report) {
  5463. var flg = null
  5464. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5465. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5466. var filteredRespList = null
  5467. if (targetP.length > 0) {
  5468. var isPublic = targetP[0].isPublic;
  5469. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5470. }
  5471. arr.push({
  5472. id: list.report[i].id,
  5473. projectId: list.report[i].projectId,
  5474. workingTime: list.report[i].workingTime,
  5475. content: list.report[i].content,
  5476. state: list.report[i].state,
  5477. timeType: list.report[i].timeType,
  5478. subProjectList: list.report[i].subProjectList,
  5479. taskList: list.report[i].taskList,
  5480. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5481. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5482. taskId: list.report[i].taskId,
  5483. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5484. startTime: list.report[i].startTime,
  5485. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5486. endTime: list.report[i].endTime,
  5487. isOvertime: flg,
  5488. progress:list.report[i].progress,
  5489. professionProgress: list.report[i].professionProgressList,
  5490. stages:list.report[i].stages,
  5491. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5492. pics: list.report[i].pics,
  5493. multiWorktime: list.report[i].multiWorktime,
  5494. worktimeList: list.report[i].worktimeList,
  5495. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5496. multiDegrIdArray: list.report[i].multiDegrIdList,
  5497. wuduList: list.report[i].degreeList,
  5498. taskGroups:list.report[i].taskGroups,
  5499. customData: list.report[i].customData,//自定义的数值
  5500. auditUserList: list.report[i].auditUserList,
  5501. projectAuditorId: list.report[i].projectAuditorId,
  5502. projectAuditorName: list.report[i].projectAuditorName,
  5503. overtimeHours: list.report[i].overtimeHours,
  5504. customText: list.report[i].customText,
  5505. basecostId: list.report[i].basecostId,
  5506. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5507. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5508. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5509. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5510. canEdit: list.report[i].state >= 2 ? true : false,
  5511. extraField1: list.report[i].extraField1,
  5512. extraField2: list.report[i].extraField2,
  5513. extraField3: list.report[i].extraField3,
  5514. workContentList: list.report[i].workContentList,
  5515. filteredRespList: filteredRespList,
  5516. serviceList: list.report[i].serviceList,
  5517. sapServiceId: list.report[i].sapServiceId,
  5518. })
  5519. if (list.report[i].state >= 2) {
  5520. this.canEdit = true;
  5521. }
  5522. if(list.report[i].state < 2){
  5523. candelete = false
  5524. }
  5525. if (list.report[i].state == 0){
  5526. this.canCancelInDialog = true
  5527. }
  5528. // 加判断
  5529. if(this.user.timeType.choseFromAlbum == 1) {
  5530. let arrList = []
  5531. for(var k in list.report[i].pics) {
  5532. let obj = {
  5533. name: k,
  5534. url: list.report[i].pics[k]
  5535. }
  5536. arrList.push(obj)
  5537. }
  5538. arr[i].imgListUrl = arrList
  5539. arr[i].imgList = list.report[i].pics
  5540. }
  5541. }
  5542. this.reportCanDelete = candelete
  5543. this.workForm = {
  5544. createDate: this.workForm.createDate,
  5545. domains: arr,
  5546. userNames:null,
  5547. userId:null,
  5548. time: list.time
  5549. }
  5550. console.log('workForm', this.workForm)
  5551. } else {
  5552. this.workForm = {
  5553. createDate: this.workForm.createDate,
  5554. domains: [{
  5555. id: null,
  5556. projectId: "",
  5557. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5558. content: "",
  5559. progress:100,
  5560. state: 2,
  5561. timeType:0,
  5562. multiWorktime: this.reportTimeType.multiWorktime,
  5563. worktimeList:[{}],
  5564. canEdit: true,
  5565. auditorFirst: '',
  5566. auditorSec: '',
  5567. auditorThird: '',
  5568. ccUserid: ''
  5569. }],
  5570. userId:null,
  5571. userNames:null,
  5572. time: this.report.time
  5573. }
  5574. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5575. this.$set(this.workForm.domains[0],'isOvertime',true)
  5576. if(this.reportTimeType.type != 2){
  5577. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5578. }
  5579. }
  5580. if(this.user.timeType.type == 1) {
  5581. var shuzhi = this.user.timeType.allday + ''
  5582. // console.log('执行一次', shuzhi.indexOf('.'))
  5583. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5584. }
  5585. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5586. //默认给第一个,必填字段
  5587. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5588. }
  5589. this.canEdit = true;
  5590. }
  5591. this.originCanEdit = this.canEdit;
  5592. this.seleChn()
  5593. } else {
  5594. this.$message({
  5595. message: res.msg,
  5596. type: "error"
  5597. });
  5598. }
  5599. },
  5600. error => {
  5601. this.$message({
  5602. message: error,
  5603. type: "error"
  5604. });
  5605. });
  5606. },
  5607. guanbi() {
  5608. this.falsss = false,
  5609. this.workTimeForMinYi=0
  5610. },
  5611. // 打开日报填写
  5612. fillInReport(i, isBatch) {
  5613. this.isWeekend = false
  5614. this.reportCanDelete = false
  5615. // console.log(this.user.timeType.type, '选择时长')
  5616. if(i != 1) {
  5617. this.falsss = false
  5618. } else {
  5619. this.falsss = true
  5620. }
  5621. if (this.isSubstitude) {
  5622. this.getSubstitudeUserDeptList();
  5623. }
  5624. if(i == -1 || this.isSubstitude) {
  5625. this.isDisable = false;
  5626. } else {
  5627. this.isDisable = true;
  5628. }
  5629. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5630. this.isBatch = isBatch;
  5631. if (this.isBatch == 0 && !this.isSubstitude) {
  5632. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5633. let weekday = new Date(this.workForm.createDate).getDay()
  5634. if(this.user.companyId == 817){
  5635. if(weekday == 0){
  5636. this.isWeekend = true
  5637. }
  5638. }else{
  5639. if(weekday == 0 || weekday == 6){
  5640. this.isWeekend = true
  5641. }
  5642. }
  5643. this.getReport(i);
  5644. } else {
  5645. // console.log('执行到了这里')
  5646. this.jsTime = 0
  5647. this.jsDay = 0
  5648. this.workForm = {
  5649. createDate: null,//批量填报没有日期
  5650. domains: [{
  5651. id: null,
  5652. projectId: "",
  5653. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5654. content: "",
  5655. progress:100,
  5656. state: 2,
  5657. timeType:0,
  5658. multiWorktime: this.reportTimeType.multiWorktime,
  5659. worktimeList:[{}],
  5660. canEdit: true,
  5661. }],
  5662. }
  5663. if(this.user.timeType.type == 1) {
  5664. var shuzhi = this.user.timeType.allday + ''
  5665. // console.log('执行二次')
  5666. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5667. }
  5668. // console.log(this.workForm)
  5669. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5670. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5671. }
  5672. this.canEdit = true;
  5673. }
  5674. this.dialogVisible = true;
  5675. },
  5676. //按周填报的弹窗口中编辑单项目相关数据
  5677. setWeekFormReportItem(reportId, i, names, row,sss) {
  5678. console.log(sss)
  5679. this.http.post('/report/getReportById', {
  5680. reportId: reportId
  5681. },
  5682. res => {
  5683. if (res.code == "ok") {
  5684. var data = res.data.report;
  5685. sss.subProjectId = data.subProjectId
  5686. sss.subProjectList = data.subProjectList;
  5687. sss.stage = data.stage
  5688. sss.subProjectList = data.subProjectList
  5689. sss.stages = data.stages
  5690. sss.taskGroups = data.taskGroups;
  5691. sss.auditUserList = data.auditUserList;
  5692. sss.degreeId = data.degreeId;
  5693. sss.customData = data.customData;
  5694. sss.wuduList = data.degreeList;
  5695. this.zhoBaoIdx = i
  5696. this.zhoBaoName = names
  5697. this.zhoBao = sss
  5698. this.zhis = row
  5699. if (sss.groupId) {
  5700. //最后一个参数表示是否保留stage的值,不要重置为空
  5701. this.getGroupStages(this.zhoBao, 0, true)
  5702. }
  5703. this.$forceUpdate();
  5704. }
  5705. });
  5706. },
  5707. // 按周填报里内容的填写
  5708. tianxies(item, i, names, row) {
  5709. if (item.state == 0) {
  5710. this.$message({
  5711. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5712. type: "error"
  5713. });
  5714. return;
  5715. }
  5716. if (item.state == 1) {
  5717. this.$message({
  5718. message: '已通过状态不可修改',
  5719. type: "error"
  5720. });
  5721. return;
  5722. }
  5723. if(this.user.timeType.notAllowedNoAttendance == 1){
  5724. if(this.zhoData[i].corpTime){
  5725. if(this.zhoData[i].corpTime.workHours == 0){
  5726. this.$message({
  5727. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5728. type: 'error'
  5729. })
  5730. return
  5731. }
  5732. }else{
  5733. this.$message({
  5734. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5735. type: 'error'
  5736. })
  5737. return
  5738. }
  5739. }
  5740. var idd = ''
  5741. var obj = {}
  5742. for(var l in this.projectList) {
  5743. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5744. }
  5745. obj.projectId = idd
  5746. this.tianxieDialogVisible = true
  5747. this.scopess = item
  5748. console.log(item, '《==== 当前的对象')
  5749. var sss = {}
  5750. if (item.id != null) {
  5751. sss.id = item.id;
  5752. sss.state = item.state;
  5753. } else {
  5754. sss.id = -1;
  5755. sss.state = 3;
  5756. }
  5757. sss.projectId = idd;
  5758. sss.progress = item.progress
  5759. sss.time = item.time
  5760. sss.content = item.content;
  5761. console.log('333', sss.content)
  5762. if (sss.time == '' && this.reportTimeType.type == 2) {
  5763. //取已填时间范围中最大的一个作为开始时间
  5764. var startTime = '09:00';
  5765. var fillStartTime = '00:00';
  5766. for (var t in this.selProjectList) {
  5767. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5768. if (fillItem.time) {
  5769. if (fillItem.time[1] > fillStartTime) {
  5770. fillStartTime = fillItem.time[1];
  5771. }
  5772. }
  5773. }
  5774. if (fillStartTime == '00:00') {
  5775. fillStartTime = '09:00';
  5776. }
  5777. var fillEndMax = '18:00';
  5778. if (fillStartTime >= '18:00') {
  5779. fillEndMax = '23:59';
  5780. }
  5781. sss.time = [fillStartTime, fillEndMax];
  5782. }
  5783. sss.groupId = item.groupId
  5784. sss.stage = item.stage;
  5785. sss.workingTime = item.workingTime
  5786. sss.projectAuditorId = item.projectAuditorId;
  5787. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5788. //默认选中第一个
  5789. sss.basecostId = this.timeBasecostList[0].id;
  5790. }
  5791. var hasEdited = this.zhoData[i][names].hasEdited;
  5792. if (hasEdited) {
  5793. sss = { ...item }
  5794. //编辑过了
  5795. sss.subProjectId = item.subProjectId
  5796. sss.stage = item.stage
  5797. sss.subProjectList = item.subProjectList
  5798. sss.stages = item.stages
  5799. sss.taskGroups = item.taskGroups;
  5800. console.log(sss.taskGroups, '33333');
  5801. sss.auditUserList = obj.auditUserList;
  5802. sss.degreeId = item.degreeId;
  5803. sss.customData = item.customData;
  5804. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5805. //只有一个审核人,自动设置上去
  5806. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5807. }
  5808. sss.wuduList = item.wuduList;
  5809. this.zhoBaoIdx = i
  5810. this.zhoBaoName = names
  5811. this.zhoBao = sss
  5812. this.zhis = row
  5813. if (sss.groupId) {
  5814. //最后一个参数表示是否保留stage的值,不要重置为空
  5815. this.getGroupStages(this.zhoBao, 0, true)
  5816. }
  5817. this.$forceUpdate();
  5818. this.getWeeklyTaskList(sss)
  5819. console.log('最后的周报 ===>', this.zhoBao)
  5820. } else {
  5821. //第一次打开,获取数据
  5822. if (sss.id == -1) {
  5823. //新填报的
  5824. this.selectProject(obj, 0);
  5825. var that = this
  5826. setTimeout(() =>{
  5827. sss.subProjectId = that.workForm.domains[0].subProjectId
  5828. sss.subProjectList = item.subProjectList;
  5829. sss.stage = that.workForm.domains[0].stage
  5830. sss.subProjectList = that.workForm.domains[0].subProjectList
  5831. sss.stages = that.workForm.domains[0].stages
  5832. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5833. sss.auditUserList = obj.auditUserList;
  5834. sss.degreeId = item.degreeId;
  5835. sss.customData = item.customData;
  5836. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5837. //只有一个审核人,自动设置上去
  5838. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5839. }
  5840. sss.wuduList = row[0].wuduList
  5841. that.zhoBaoIdx = i
  5842. that.zhoBaoName = names
  5843. that.zhoBao = sss
  5844. that.zhis = row
  5845. if (sss.groupId) {
  5846. //最后一个参数表示是否保留stage的值,不要重置为空
  5847. this.getGroupStages(that.zhoBao, 0, false)
  5848. }
  5849. that.$forceUpdate();
  5850. this.getWeeklyTaskList(sss)
  5851. },600);
  5852. } else {
  5853. //编辑填报过的;数据库已经存在的
  5854. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5855. }
  5856. }
  5857. },
  5858. // 按周填报里内容的填写点击确定
  5859. setWeekProItemData() {
  5860. //专业版模式下,任务分组和阶段必填
  5861. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5862. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5863. this.$message({
  5864. message: '任务分组和阶段必填,请检查',
  5865. type: "error"
  5866. });
  5867. return;
  5868. }
  5869. }
  5870. // 检查任务分组
  5871. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  5872. this.$message({
  5873. message: '任务分组必填,请检查',
  5874. type: "error"
  5875. });
  5876. return
  5877. }
  5878. //检查子项目是否必填
  5879. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5880. this.$message({
  5881. message: '子项目必填,请检查',
  5882. type: "error"
  5883. });
  5884. return;
  5885. }
  5886. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5887. this.$message({
  5888. message: this.$t('message.Pleaseselectareviewer'),
  5889. type: "error"
  5890. });
  5891. return
  5892. }
  5893. if(this.user.timeType.reportAuditType == 3){
  5894. let auditTips = ''
  5895. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5896. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5897. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5898. if(auditTips){
  5899. auditTips = auditTips.substring(0,auditTips.length - 1)
  5900. this.$message({
  5901. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5902. type: 'error'
  5903. })
  5904. return
  5905. }
  5906. }
  5907. let errtips = ''
  5908. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5909. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5910. errtips += this.user.timeType.customDegreeName + '、'
  5911. }
  5912. }
  5913. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5914. errtips += this.user.timeType.customDataName + '、'
  5915. }
  5916. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5917. errtips += this.user.timeType.customTextName + '、'
  5918. }
  5919. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5920. errtips += this.$t('other.workMatters') +'、'
  5921. }
  5922. if(errtips){
  5923. errtips = errtips.substring(0,errtips.length - 1)
  5924. this.$message({
  5925. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5926. type: 'error'
  5927. })
  5928. return
  5929. }
  5930. this.tianxieDialogVisible = false
  5931. var zhong = this.zhoData
  5932. this.zhoBao.hasEdited = true;
  5933. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5934. this.zhoData = zhong
  5935. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5936. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5937. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5938. },
  5939. // 获取本周
  5940. getCurrentWeek() {
  5941. //今天
  5942. this.targetWeekDate = new Date();
  5943. this.initWeekFormData();
  5944. // this.jiazai()
  5945. },
  5946. // 获取上周
  5947. handleGetPrevWeek() {
  5948. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5949. this.initWeekFormData();
  5950. // this.jiazai()
  5951. },
  5952. // 获取下周
  5953. handleGetNextvWeek() {
  5954. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5955. this.initWeekFormData()
  5956. },
  5957. // 加载动画
  5958. jiazai() {
  5959. this.weekDataLoading = true
  5960. var that = this
  5961. setTimeout(() =>{
  5962. that.weekDataLoading = false
  5963. },1000);
  5964. },
  5965. // 转时间格式
  5966. dealdate(date) {
  5967. const dt = new Date(date)
  5968. const y = dt.getFullYear()
  5969. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5970. const d = (dt.getDate() + '').padStart(2, '0')
  5971. return `${y}-${m}-${d}`
  5972. },
  5973. // 按周填报
  5974. fillInReportss() {
  5975. window.addEventListener('scroll', this.handleScroll, true)
  5976. // this.jiazai()
  5977. this.fillWeekDialogVisi = true
  5978. this.getCurrentWeek();
  5979. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5980. //重新获取工时预警类型的预算项
  5981. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5982. companyId: this.user.companyId
  5983. },
  5984. res => {
  5985. if (res.code == "ok") {
  5986. this.timeBasecostList = res.data;
  5987. }
  5988. });
  5989. }
  5990. },
  5991. fillInReportCustom() {
  5992. this.weekIndex++
  5993. this.weekParentData = {
  5994. isSubstitude: this.isSubstitude
  5995. }
  5996. this.fillWeekDialogVisiCustom = true
  5997. },
  5998. // 按周填报的项目筛选
  5999. selListFun(){
  6000. this.selProjectList = []
  6001. if(this.selCon.length){
  6002. for (let i = 0; i < this.selCon.length; i++) {
  6003. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6004. }
  6005. this.selConShow = false ;
  6006. for (let i in this.zhoData) {
  6007. var obj = this.zhoData[i];
  6008. for(var j in this.selProjectList) {
  6009. var xinzhi = this.selProjectList[j].projectName
  6010. obj[xinzhi] = {}
  6011. obj[xinzhi].time = ''
  6012. obj[xinzhi].content = ''
  6013. obj[xinzhi].progress = 0
  6014. obj[xinzhi].workingTime = 0
  6015. }
  6016. }
  6017. this.initWeekFormData();
  6018. }else{
  6019. this.$message({
  6020. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6021. type:'error'
  6022. })
  6023. }
  6024. },
  6025. setWeekCardTimeData(list) {
  6026. for(let i in list){
  6027. let datei = '';
  6028. if (this.user.timeType.showDdCardtime == 1) {
  6029. datei = list[i].workDate;
  6030. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6031. datei = list[i].createDate;
  6032. } else if (this.user.timeType.syncFanwei == 1) {
  6033. datei = list[i].workDate;
  6034. }
  6035. for(let m in this.zhoData) {
  6036. if(datei == this.zhoData[m].zhoDataTime){
  6037. let item = {
  6038. startTime: list[i].startTime,
  6039. endTime: list[i].endTime,
  6040. workHours: list[i].workHours
  6041. }
  6042. this.$set(this.zhoData[m],'corpTime',item)
  6043. }
  6044. }
  6045. }
  6046. },
  6047. getWeeklyCardTime(){ //按周填报获取考勤信息
  6048. let dateStr = []
  6049. for(let i in this.zhoData){
  6050. dateStr.push(this.zhoData[i].zhoDataTime)
  6051. }
  6052. this.http.post('/report/getWeeklyCardTime',{
  6053. dateStr: JSON.stringify(dateStr)
  6054. },res => {
  6055. if(res.code == 'ok'){
  6056. for(let i in res.data){
  6057. let datei = '';
  6058. if (this.user.timeType.showDdCardtime == 1) {
  6059. datei = res.data[i].workDate.split('-');
  6060. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6061. datei = res.data[i].createDate.split('-');
  6062. }
  6063. for(let m in this.zhoData){
  6064. let datem = new Date(this.zhoData[m].zhoDataTime)
  6065. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6066. let item = {
  6067. startTime: res.data[i].startTime,
  6068. endTime: res.data[i].endTime,
  6069. workHours: res.data[i].workHours
  6070. }
  6071. this.$set(this.zhoData[m],'corpTime',item)
  6072. }
  6073. }
  6074. }
  6075. }else{
  6076. this.$message({
  6077. message: res.msg,
  6078. type: 'error'
  6079. })
  6080. }
  6081. },err => {
  6082. this.$message({
  6083. message: err,
  6084. type: 'error'
  6085. })
  6086. })
  6087. },
  6088. selListqx(){
  6089. this.fillWeekDialogVisi = false
  6090. this.selProjectList = []
  6091. this.selCon = []
  6092. },
  6093. handleScroll() {
  6094. this.changdu = this.projectList.length + 1
  6095. },
  6096. // 自动选择时间点的事件
  6097. // async zhoTimes(item, i) {
  6098. // var iss = i
  6099. // if(item.time == null) {
  6100. // return
  6101. // } else {
  6102. // const zhi = this.zhoData[iss];
  6103. // let he = 0;
  6104. // const timeArr = Object.values(zhi)
  6105. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6106. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6107. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6108. // console.log(data, 'data');
  6109. // zhi.he = `${he}h`;
  6110. // }
  6111. // },
  6112. async zhoTimes(item, index) {
  6113. const zho = this.zhoData[index];
  6114. if (!item.time) {
  6115. return;
  6116. }
  6117. const timeArr = Object.values(zho)
  6118. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6119. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6120. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6121. zho.he = `${totalHours[0]}h`;
  6122. },
  6123. // 判断两个时间段是否重叠
  6124. timeOverlap(idx, dateAr) {
  6125. let zhi = 0
  6126. for (let k in dateAr) {
  6127. if (idx !== k) {
  6128. if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
  6129. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6130. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6131. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6132. }
  6133. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6134. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6135. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6136. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6137. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6138. } else {
  6139. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6140. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6141. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6142. }
  6143. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6144. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6145. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6146. }
  6147. }
  6148. }
  6149. }
  6150. }
  6151. return zhi
  6152. },
  6153. // 计算时间
  6154. getHourMinutes(str, end) {
  6155. var he = 0
  6156. var date2 = '2021/12/12 ' + end +':00'
  6157. var date1 = '2021/12/12 ' + str +':00'
  6158. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6159. var leave1=date3%(24*3600*1000)
  6160. var hours=Math.floor(leave1/(3600*1000))
  6161. var leave2=leave1%(3600*1000)
  6162. var minutes=Math.floor(leave2/(60*1000))
  6163. var shi = hours+'.'+ minutes
  6164. return he += +shi
  6165. },
  6166. // 自动选择事件长度的事件
  6167. zhoXuan(item, i) {
  6168. var iss = i
  6169. if(item.time == null) {
  6170. return
  6171. } else {
  6172. var zhi = this.zhoData[iss]
  6173. var he = 0
  6174. for(var i in zhi) {
  6175. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6176. he += +zhi[i].workingTime
  6177. }
  6178. }
  6179. zhi.he = he + 'h'
  6180. }
  6181. },
  6182. getPushWorkLogData(){
  6183. this.http.post('/sap-sync-log/list', {},
  6184. res => {
  6185. if (res.code == "ok") {
  6186. this.pushWorkTimeLogData = res.data;
  6187. } else {
  6188. this.$message({
  6189. message: res.msg,
  6190. type: "error"
  6191. });
  6192. }
  6193. },
  6194. error => {
  6195. this.$message({
  6196. message: error,
  6197. type: "error"
  6198. });
  6199. });
  6200. },
  6201. // 获取全部人员
  6202. getUsers() {
  6203. this.http.post('/user/getSimpleActiveUserList', {},
  6204. res => {
  6205. if (res.code == "ok") {
  6206. this.usersList = res.data;
  6207. } else {
  6208. this.$message({
  6209. message: res.msg,
  6210. type: "error"
  6211. });
  6212. }
  6213. },
  6214. error => {
  6215. this.$message({
  6216. message: error,
  6217. type: "error"
  6218. });
  6219. });
  6220. },
  6221. // 按时间比例
  6222. addBli(item, i) {
  6223. var iss = i
  6224. if(item.time == null) {
  6225. return
  6226. } else {
  6227. var zhi = this.zhoData[iss]
  6228. var he = 0
  6229. for(var i in zhi) {
  6230. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6231. he += +zhi[i].workingTime
  6232. }
  6233. }
  6234. zhi.he = he.toFixed(1) + 'h'
  6235. }
  6236. },
  6237. //按周填报选择的项目发生变化,需要设置列
  6238. onSelProjectChange() {
  6239. for (let i = 0; i < this.selCon.length; i++) {
  6240. var exists = false;
  6241. for (let j = 0; j < this.selProjectList.length; j++) {
  6242. if (this.selProjectList[j].id == this.selCon[i]) {
  6243. exists = true;
  6244. break;
  6245. }
  6246. }
  6247. if (!exists) {
  6248. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6249. this.selProjectList.push(newProject);
  6250. //添加新项目
  6251. for (var w in this.zhoData) {
  6252. var dayItem = this.zhoData[w];
  6253. var pName = newProject.projectName;
  6254. dayItem[pName] = {};
  6255. dayItem[pName].time = ''
  6256. dayItem[pName].content = ''
  6257. dayItem[pName].progress = 0
  6258. dayItem[pName].workingTime = 0
  6259. }
  6260. }
  6261. }
  6262. //去掉
  6263. for (let j = 0; j < this.selProjectList.length; j++) {
  6264. var exists = false;
  6265. for (let i = 0; i < this.selCon.length; i++) {
  6266. if (this.selProjectList[j].id == this.selCon[i]) {
  6267. exists = true;
  6268. break;
  6269. }
  6270. }
  6271. if (!exists) {
  6272. this.selProjectList.splice(j, 1);
  6273. j--;
  6274. }
  6275. }
  6276. this.loadFilledWeekReportItem();
  6277. //刷新表格
  6278. // this.$refs.weekTable.doLayout();
  6279. },
  6280. //根据选中的项目来刷新填写表格
  6281. loadFilledWeekReportItem() {
  6282. for (var w in this.zhoData) {
  6283. var dayItem = this.zhoData[w];
  6284. for (var i = 0; i < this.selProjectList.length; i++) {
  6285. var curColumnProject = this.selProjectList[i];
  6286. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6287. for (var t in dayItem.reportList) {
  6288. //有日报的项目,不能取消选择
  6289. for (var p in this.fillProjectList) {
  6290. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6291. }
  6292. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6293. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6294. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6295. if (this.reportTimeType.type == 2) {
  6296. //时间段模式
  6297. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6298. }
  6299. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6300. break;
  6301. }
  6302. }
  6303. // dayItem[curColumnProject.projectName] = matchReportItem;
  6304. }
  6305. }
  6306. this.$nextTick(()=>{
  6307. this.$refs.weekTable.doLayout();
  6308. });
  6309. },
  6310. initWeekFormData() {
  6311. this.weekDataLoading = true;
  6312. for (var p in this.fillProjectList) {
  6313. this.fillProjectList[p].canCancel = 1;
  6314. }
  6315. this.http.post('/report/getWeeklyReportData',{
  6316. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6317. },res => {
  6318. this.weekDataLoading = false;
  6319. if(res.code == 'ok'){
  6320. let projectList = res.data.projectList;
  6321. if (projectList.length > 0) {
  6322. //有选择过项目进行填报,直接选中
  6323. this.selProjectList = projectList;
  6324. this.selCon = [];
  6325. for (let i = 0; i < projectList.length; i++) {
  6326. this.selCon.push(projectList[i].id);
  6327. }
  6328. }
  6329. //设置日期
  6330. this.weekDateRange = res.data.dateList;
  6331. this.zhoData = [];
  6332. var arrst = []
  6333. for(var i in this.weekDateRange) {
  6334. var obj = {}
  6335. obj.zhoDataTime = this.weekDateRange[i].date
  6336. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6337. obj.he = this.weekDateRange[i].filledTime;
  6338. obj.canFill = this.weekDateRange[i].canFill;
  6339. // obj.filledTime = this.weekDateRange[i].filledTime;
  6340. obj.reportList = this.weekDateRange[i].reportList;
  6341. //初始化,防止渲染报错
  6342. for (var j = 0; j < this.selProjectList.length; j++) {
  6343. var pName = this.selProjectList[j].projectName
  6344. obj[pName] = {}
  6345. obj[pName].time = ''
  6346. obj[pName].content = ''
  6347. obj[pName].progress = 0
  6348. obj[pName].workingTime = 0
  6349. }
  6350. arrst.push(obj)
  6351. }
  6352. this.zhoData = arrst
  6353. this.setWeekCardTimeData(res.data.cardTimeList);
  6354. this.loadFilledWeekReportItem();
  6355. }else{
  6356. this.$message({
  6357. message: res.msg,
  6358. type: 'error'
  6359. })
  6360. }
  6361. },err => {
  6362. this.$message({
  6363. message: err,
  6364. type: 'error'
  6365. })
  6366. })
  6367. },
  6368. zhoZhi(res, i) {
  6369. var zhi = 0
  6370. for(var i in res) {
  6371. if(i != 'zhoDataTime' && i != 'he') {
  6372. zhi += +res[i]
  6373. }
  6374. }
  6375. res.he = zhi
  6376. },
  6377. zhoBtn(i) {
  6378. // this.zhoData.split(i, 1)
  6379. var arr = this.zhoData
  6380. arr.splice(i, 1)
  6381. },
  6382. zhoAddlast(){
  6383. this.selConShow = true
  6384. },
  6385. closeAddWeeklyReport(){
  6386. this.fillWeekDialogVisi = false
  6387. this.selConShow = true
  6388. this.selProjectList = []
  6389. this.selCon = []
  6390. },
  6391. // 提交按周填报
  6392. submitWeekReport(isDraft) {
  6393. var zhi = this.zhoData
  6394. var ll = 0
  6395. if(this.reportTimeType.type == 2) {
  6396. for(var i in zhi) {
  6397. this.dateAr = []
  6398. var alp = []
  6399. var zhis = zhi[i]
  6400. console.log(zhis)
  6401. for(var j in zhis) {
  6402. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6403. let objs = {}
  6404. objs.s = zhis[j].time[0]
  6405. objs.e = zhis[j].time[1]
  6406. objs.p = j
  6407. alp.push(objs)
  6408. }
  6409. }
  6410. console.log(alp)
  6411. this.dateAr = alp
  6412. if (this.reportTimeType.timeCanOverlap == 0) {
  6413. let str = this.$t('message.Filledtimeperiodsoverlap')
  6414. if(this.dateAr.length > 0) {
  6415. const trus = this.fns();
  6416. const overlapDataTime = this.getOverlapData(alp);
  6417. if (overlapDataTime.length > 0) {
  6418. const arrList = overlapDataTime.map((item) => item.p);
  6419. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6420. }
  6421. ll += 1
  6422. if(!trus) {
  6423. this.$message({
  6424. message: str,
  6425. type: 'error'
  6426. })
  6427. return false
  6428. }
  6429. }
  6430. } else {
  6431. if(this.dateAr.length > 0) {
  6432. ll +=1 ;
  6433. }
  6434. }
  6435. }
  6436. if(ll == 0) {
  6437. this.$message({
  6438. message: this.$t('message.Pleasefillinthetime'),
  6439. type: 'error'
  6440. })
  6441. return false
  6442. }
  6443. } else if(this.reportTimeType.type == 1){
  6444. for(var i in zhi) {
  6445. var zhis = zhi[i]
  6446. for(var j in zhis) {
  6447. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6448. ll += 1
  6449. }
  6450. }
  6451. }
  6452. if(ll == 0) {
  6453. this.$message({
  6454. message: this.$t('message.Pleaseselectatime'),
  6455. type: 'error'
  6456. })
  6457. return false
  6458. }
  6459. let overcorp = ''
  6460. for(let n in zhi){
  6461. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6462. overcorp += zhi[n].zhoDataTime + ','
  6463. }
  6464. }
  6465. if(overcorp != ''){
  6466. overcorp = overcorp.substring(0,overcorp.length - 1)
  6467. this.$message({
  6468. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6469. type: 'error'
  6470. })
  6471. return
  6472. }
  6473. }
  6474. var submits = []
  6475. let formData = new FormData();
  6476. formData.append("draft", isDraft);
  6477. if(this.reportTimeType.multiWorktime == 1){
  6478. for (var i in this.zhoData) {
  6479. var zhoD = this.zhoData[i]
  6480. var flgs = false
  6481. for(var j in zhoD) {
  6482. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6483. flgs = true
  6484. // formData.append("degreeId", "-1");
  6485. formData.append("id", '-1');
  6486. for(var s in this.projectList) {
  6487. if(j == this.projectList[s].projectName) {
  6488. formData.append("projectId", this.projectList[s].id);
  6489. }
  6490. }
  6491. if(this.user.timeType.reportAuditType == 3){
  6492. let audItem = {}
  6493. if(this.user.timeType.auditLevel > 0){
  6494. audItem.auditorFirst = zhoD[j].auditorFirst
  6495. }
  6496. if(this.user.timeType.auditLevel > 1){
  6497. audItem.auditorSec = zhoD[j].auditorSec
  6498. }
  6499. if(this.user.timeType.auditLevel > 2){
  6500. audItem.auditorThird = zhoD[j].auditorThird
  6501. }
  6502. if(zhoD[j].ccUserid){
  6503. audItem.ccUserid = zhoD[j].ccUserid
  6504. }
  6505. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6506. }
  6507. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6508. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6509. formData.append("reportTimeType", this.reportTimeType.type);
  6510. formData.append("endTime", '');
  6511. formData.append("startTime", '');
  6512. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6513. var lix = []
  6514. var objjs = {}
  6515. objjs.startTime = zhoD[j].time[0]
  6516. objjs.endTime = zhoD[j].time[1]
  6517. if (zhoD[j].content == null || zhoD[j].content == '') {
  6518. zhoD[j].content == '-'
  6519. }
  6520. objjs.content = zhoD[j].content
  6521. lix.push(objjs)
  6522. var zhiZhi = JSON.stringify(lix)
  6523. zhiZhi = zhiZhi.replace(/,/g,"@");
  6524. formData.append("content", zhiZhi)
  6525. formData.append("isOvertime", 0)
  6526. formData.append("professionProgress", "[]")
  6527. if (zhoD[j].groupId) {
  6528. formData.append("groupId",zhoD[j].groupId)
  6529. } else {
  6530. //解决后台groupId数组越界的问题
  6531. formData.append("groupId",0)
  6532. }
  6533. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6534. formData.append("createDate",zhoD.zhoDataTime)
  6535. if (zhoD[j].projectAuditorId) {
  6536. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6537. }
  6538. if(zhoD[j].basecostId) {
  6539. formData.append("basecostId", zhoD[j].basecostId);
  6540. } else {
  6541. formData.append("basecostId", 0);
  6542. }
  6543. if(this.user.timeType.customDegreeActive){
  6544. if (this.user.timeType.customDegreeMultiple) {
  6545. if (zhoD[j].multiDegrIdArray) {
  6546. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6547. } else {
  6548. formData.append('multiDegrId','[]')
  6549. }
  6550. } else {
  6551. if (zhoD[j].degreeId) {
  6552. formData.append('degreeId',zhoD[j].degreeId)
  6553. } else {
  6554. formData.append('degreeId','-1')
  6555. }
  6556. }
  6557. }else{
  6558. formData.append("degreeId", "-1");
  6559. }
  6560. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6561. formData.append('customData',zhoD[j].customData)
  6562. }else if(this.user.timeType.customDataActive){
  6563. formData.append('customData',0)
  6564. }
  6565. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6566. formData.append('customText',zhoD[j].customText)
  6567. }else if(this.user.timeType.customTextActive){
  6568. formData.append('customText','-')
  6569. }
  6570. }
  6571. }
  6572. }
  6573. } else {
  6574. for (var i in this.zhoData) {
  6575. var zhoD = this.zhoData[i]
  6576. var flgs = false
  6577. if(this.reportTimeType.type == 2) {
  6578. for(var k in this.selProjectList) {
  6579. var pItem = this.selProjectList[k];
  6580. var pName = pItem.projectName;
  6581. var j = pName;
  6582. console.log('j==周报中的项目='+j);
  6583. if(zhoD[j].time && zhoD[j].time != 'null') {
  6584. flgs = true
  6585. // formData.append("degreeId", "-1");
  6586. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6587. for(var s in this.projectList) {
  6588. if(j == this.projectList[s].projectName) {
  6589. formData.append("projectId", this.projectList[s].id);
  6590. }
  6591. }
  6592. if(this.user.timeType.reportAuditType == 3){
  6593. let audItem = {}
  6594. if(this.user.timeType.auditLevel > 0){
  6595. audItem.auditorFirst = zhoD[j].auditorFirst
  6596. }
  6597. if(this.user.timeType.auditLevel > 1){
  6598. audItem.auditorSec = zhoD[j].auditorSec
  6599. }
  6600. if(this.user.timeType.auditLevel > 2){
  6601. audItem.auditorThird = zhoD[j].auditorThird
  6602. }
  6603. if(zhoD[j].ccUserid){
  6604. audItem.ccUserid = zhoD[j].ccUserid
  6605. }
  6606. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6607. }
  6608. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6609. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6610. formData.append("reportTimeType", this.reportTimeType.type);
  6611. formData.append("endTime", zhoD[j].time[1]);
  6612. formData.append("startTime", zhoD[j].time[0]);
  6613. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6614. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6615. formData.append("isOvertime", 0)
  6616. formData.append("professionProgress", "[]")
  6617. if (zhoD[j].groupId) {
  6618. formData.append("groupId",zhoD[j].groupId)
  6619. } else {
  6620. //解决后台groupId数组越界的问题
  6621. formData.append("groupId",0)
  6622. }
  6623. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6624. formData.append("createDate",zhoD.zhoDataTime)
  6625. if (zhoD[j].projectAuditorId) {
  6626. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6627. }
  6628. if(zhoD[j].basecostId) {
  6629. formData.append("basecostId", zhoD[j].basecostId);
  6630. } else {
  6631. formData.append("basecostId", 0);
  6632. }
  6633. if(this.user.timeType.customDegreeActive){
  6634. if (this.user.timeType.customDegreeMultiple) {
  6635. if (zhoD[j].multiDegrIdArray) {
  6636. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6637. } else {
  6638. formData.append("multiDegrId", "[]");
  6639. }
  6640. } else {
  6641. if (zhoD[j].degreeId) {
  6642. formData.append('degreeId',zhoD[j].degreeId)
  6643. } else {
  6644. formData.append("degreeId", "-1");
  6645. }
  6646. }
  6647. }else{
  6648. formData.append("degreeId", "-1");
  6649. }
  6650. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6651. formData.append('customData',zhoD[j].customData)
  6652. }else if(this.user.timeType.customDataActive){
  6653. formData.append('customData',0)
  6654. }
  6655. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6656. formData.append('customText',zhoD[j].customText)
  6657. }else if(this.user.timeType.customTextActive){
  6658. formData.append('customText','-')
  6659. }
  6660. }
  6661. }
  6662. } else {
  6663. for(var k in this.selProjectList) {
  6664. var pItem = this.selProjectList[k];
  6665. var pName = pItem.projectName;
  6666. var j = pName;
  6667. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6668. flgs = true
  6669. // formData.append("degreeId", "-1");
  6670. console.log('进入了workFpppp==='+j);
  6671. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6672. for(var s in this.projectList) {
  6673. if(j == this.projectList[s].projectName) {
  6674. formData.append("projectId", this.projectList[s].id);
  6675. }
  6676. }
  6677. if(this.user.timeType.reportAuditType == 3){
  6678. let audItem = {}
  6679. if(this.user.timeType.auditLevel > 0){
  6680. audItem.auditorFirst = zhoD[j].auditorFirst
  6681. }
  6682. if(this.user.timeType.auditLevel > 1){
  6683. audItem.auditorSec = zhoD[j].auditorSec
  6684. }
  6685. if(this.user.timeType.auditLevel > 2){
  6686. audItem.auditorThird = zhoD[j].auditorThird
  6687. }
  6688. if(zhoD[j].ccUserid){
  6689. audItem.ccUserid = zhoD[j].ccUserid
  6690. }
  6691. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6692. }
  6693. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6694. // formData.append("subProjectId", zhoD[j].subProjectId);
  6695. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6696. formData.append("reportTimeType", this.reportTimeType.type);
  6697. if(this.reportTimeType.type == 1) {
  6698. formData.append("workingTime", zhoD[j].workingTime);
  6699. } else if(this.reportTimeType.type == 2) {
  6700. formData.append("endTime", zhoD[j].time[1]);
  6701. formData.append("startTime", zhoD[j].time[0]);
  6702. } else if(this.reportTimeType.type == 3) {
  6703. formData.append("progress", zhoD[j].progress);
  6704. formData.append("workingTime", zhoD[j].workingTime);
  6705. }
  6706. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6707. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6708. formData.append("isOvertime", 0)
  6709. formData.append("professionProgress", "[]")
  6710. if (zhoD[j].groupId) {
  6711. formData.append("groupId",zhoD[j].groupId)
  6712. } else {
  6713. //解决后台groupId数组越界的问题
  6714. formData.append("groupId",0)
  6715. }
  6716. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6717. formData.append("createDate",zhoD.zhoDataTime)
  6718. if (zhoD[j].projectAuditorId) {
  6719. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6720. }
  6721. if(zhoD[j].basecostId) {
  6722. formData.append("basecostId", zhoD[j].basecostId);
  6723. } else {
  6724. formData.append("basecostId", 0);
  6725. }
  6726. if(this.user.timeType.customDegreeActive){
  6727. if (this.user.timeType.customDegreeMultiple) {
  6728. if (zhoD[j].multiDegrIdArray) {
  6729. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6730. } else {
  6731. formData.append("multiDegrId", "[]");
  6732. }
  6733. } else {
  6734. if (zhoD[j].degreeId) {
  6735. formData.append('degreeId',zhoD[j].degreeId)
  6736. } else {
  6737. formData.append("degreeId", "-1");
  6738. }
  6739. }
  6740. }else{
  6741. formData.append("degreeId", "-1");
  6742. }
  6743. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6744. formData.append('customData',zhoD[j].customData)
  6745. }else if(this.user.timeType.customDataActive){
  6746. formData.append('customData',0)
  6747. }
  6748. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6749. formData.append('customText',zhoD[j].customText)
  6750. }else if(this.user.timeType.customTextActive){
  6751. formData.append('customText','-')
  6752. }
  6753. }
  6754. }
  6755. }
  6756. }
  6757. }
  6758. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6759. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6760. if(!next) {
  6761. this.$message({
  6762. message: `【${error.join('、')}】请填写任务分组`,
  6763. type: 'error'
  6764. })
  6765. return
  6766. }
  6767. // 自定义维度
  6768. this.submitingReport = true;
  6769. this.http.uploadFile( this.port.report.editPort, formData,
  6770. res => {
  6771. // this.listLoading = false;
  6772. this.submitingReport = false;
  6773. if (res.code == "ok") {
  6774. this.$message({
  6775. message: this.$t('message.fillinsuccessfully'),
  6776. type: "success"
  6777. });
  6778. this.fillWeekDialogVisi = false
  6779. this.selConShow = true
  6780. this.zhoData = []
  6781. this.weekDateRange = ''
  6782. this.getReportList();
  6783. this.getDepartment();
  6784. // 关闭弹窗 并 清空
  6785. this.selProjectList = []
  6786. this.selCon = []
  6787. this.getRecentlyProject()
  6788. } else {
  6789. this.$message({
  6790. message: res.msg,
  6791. type: "error"
  6792. });
  6793. }
  6794. },
  6795. error => {
  6796. this.submitingReport = false;
  6797. this.$message({
  6798. message: error,
  6799. type: "error"
  6800. });
  6801. });
  6802. },
  6803. handleGroupAuditorData(data) {
  6804. const { reportAuditType } = this.user.timeType
  6805. if(reportAuditType != 1 && reportAuditType != 2) {
  6806. return {next: true}
  6807. }
  6808. let arrList = [];
  6809. Object.entries(data).forEach(([key, obj]) => {
  6810. Object.entries(obj).forEach(([projectName, projectData]) => {
  6811. if (projectData.workingTime && !projectData.groupId) {
  6812. arrList.push({
  6813. projectName,
  6814. date: obj.zhoDataTime,
  6815. dateText: obj.zhoDataTimeTxt
  6816. });
  6817. }
  6818. });
  6819. });
  6820. if(arrList.length > 0) {
  6821. return {
  6822. next: false,
  6823. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6824. }
  6825. } else {
  6826. return {
  6827. next: true,
  6828. error: [],
  6829. }
  6830. }
  6831. },
  6832. ChangeHourMinutestr (str) {
  6833. if (str !== "0" && str !== "" && str !== null) {
  6834. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6835. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6836. } else {
  6837. return "";
  6838. }
  6839. },
  6840. // 得到两个日期中间的日期
  6841. getdiffdate(stime,etime){
  6842. //初始化日期列表,数组
  6843. var diffdate = new Array();
  6844. var i=0;
  6845. //开始日期小于等于结束日期,并循环
  6846. while(stime<=etime){
  6847. diffdate[i] = stime;
  6848. //获取开始日期时间戳
  6849. var stime_ts = new Date(stime).getTime();
  6850. //增加一天时间戳后的日期
  6851. var next_date = stime_ts + (24*60*60*1000);
  6852. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6853. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6854. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6855. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6856. stime = next_dates_y+next_dates_m+next_dates_d;
  6857. //增加数组key
  6858. i++;
  6859. }
  6860. return diffdate;
  6861. },
  6862. // 添加模块
  6863. addDomain(i) {
  6864. var leftProgress = 10;
  6865. if (this.reportTimeType.type == 3) {
  6866. //计算已经待分配工时比例
  6867. let array = this.workForm.domains;
  6868. let totalProgress = 0;
  6869. for (var i=0;i<array.length; i++) {
  6870. totalProgress += array[i].progress;
  6871. }
  6872. if (totalProgress < 100) {
  6873. leftProgress = 100 - totalProgress;
  6874. }
  6875. }
  6876. var addItem = {
  6877. projectId: "",
  6878. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6879. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6880. ),
  6881. content: "",
  6882. progress:leftProgress,
  6883. state:2,//2-表示待提交
  6884. multiWorktime: this.reportTimeType.multiWorktime,
  6885. worktimeList:[{}],
  6886. canEdit: true,
  6887. auditorFirst: '',
  6888. auditorSec: '',
  6889. auditorThird: '',
  6890. ccUserid: ''
  6891. // degreeId: '',
  6892. };
  6893. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6894. this.$set(addItem,'isOvertime',true)
  6895. if(this.reportTimeType.type == 3){
  6896. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6897. }
  6898. }
  6899. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6900. //默认给第一个,必填字段
  6901. addItem.basecostId = this.timeBasecostList[0].id;
  6902. }
  6903. this.workForm.domains.push(addItem);
  6904. document.getElementById('workFormsItemBottom').scrollIntoView()
  6905. this.canEdit = true
  6906. if (this.reportTimeType.type == 0) {
  6907. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6908. var length = this.workForm.domains.length;
  6909. if (length == 2) {
  6910. this.showAddMore = false;
  6911. }
  6912. }
  6913. this.chuji()
  6914. this.seleChn()
  6915. },
  6916. // 移除模块
  6917. delDomain(i) {
  6918. this.workForm.domains.splice(i,1)
  6919. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6920. if (!this.originCanEdit) {
  6921. let iscan = false
  6922. for(let i in this.workForm.domains){
  6923. if(this.workForm.domains[i].canEdit){
  6924. iscan = true
  6925. }
  6926. }
  6927. this.canEdit = iscan
  6928. }
  6929. //检测当前剩下的一个,时间类型是否是全天
  6930. if (this.reportTimeType.type == 0) {
  6931. if (this.workForm.domains[0].timeType == 0) {
  6932. this.showAddMore = false;
  6933. } else {
  6934. this.showAddMore = true;
  6935. }
  6936. }
  6937. if(this.user.timeType.multiWorktime == 1) {
  6938. this.iptChangs()
  6939. } else {
  6940. this.seleChn(0)
  6941. }
  6942. },
  6943. // 改变月份
  6944. changeMonth() {
  6945. this.isWeekend = false
  6946. let date = new Date()
  6947. let nowmon = date.getMonth() + 1
  6948. let nowday = date.getDate()
  6949. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6950. if (this.isBatch == 0) {
  6951. if(this.user.timeType.fillAhead == 0){
  6952. let date_a = new Date(this.workForm.createDate)
  6953. if(date_a.getTime() > date.getTime()){
  6954. this.workForm.createDate = nowdate
  6955. }
  6956. }
  6957. //只有按天填报才能获取当天的日报
  6958. if(!this.isSubstitude){
  6959. let weekday = new Date(this.workForm.createDate).getDay()
  6960. if(this.user.companyId == 817){
  6961. if(weekday == 0){
  6962. this.isWeekend = true
  6963. }
  6964. }else{
  6965. if(weekday == 0 || weekday == 6){
  6966. this.isWeekend = true
  6967. }
  6968. }
  6969. this.getReport()
  6970. }
  6971. }else {
  6972. if(this.user.timeType.fillAhead == 0){
  6973. let date_a = new Date(this.workForm.createDate[1])
  6974. if(date_a.getTime() > date.getTime()){
  6975. this.workForm.createDate[1] = nowdate
  6976. let sdate = new Date(this.workForm.createDate[0])
  6977. let edate = new Date(this.workForm.createDate[1])
  6978. if(sdate > edate){
  6979. this.workForm.createDate[0] = this.workForm.createDate[1]
  6980. }
  6981. }
  6982. }
  6983. }
  6984. },
  6985. // 判断时间段
  6986. fns() {
  6987. for (let k in this.dateAr) {
  6988. if (!this.judege(k)) {
  6989. return false
  6990. }
  6991. }
  6992. return true
  6993. },
  6994. judege(idx){
  6995. for (let k in this.dateAr) {
  6996. if (idx !== k) {
  6997. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6998. return false
  6999. }
  7000. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7001. return false
  7002. }
  7003. }
  7004. }
  7005. return true
  7006. },
  7007. getOverlapData(data) {
  7008. let overlapData = [];
  7009. for (let i = 0; i < data.length; i++) {
  7010. for (let j = i + 1; j < data.length; j++) {
  7011. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7012. overlapData.push(data[i], data[j]);
  7013. }
  7014. }
  7015. }
  7016. return overlapData;
  7017. },
  7018. // 保存日报111111
  7019. submitReport(isDraft) {
  7020. this.isDraft = isDraft;
  7021. this.$refs.workForm.validate(valid => {
  7022. if (valid) {
  7023. if(this.totalReportHours < this.user.timeType.allday){
  7024. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7025. confirmButtonText: '确定',
  7026. cancelButtonText: '取消',
  7027. type: 'warning'
  7028. }).then(() => {
  7029. this.submitReportSon()
  7030. }).catch(() => {
  7031. });
  7032. }else{
  7033. this.submitReportSon()
  7034. }
  7035. }
  7036. });
  7037. },
  7038. submitReportSon() {
  7039. this.dateAr = []
  7040. //检查重叠
  7041. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7042. let alp = []
  7043. if(this.user.timeType.multiWorktime != 1) {
  7044. for(var p in this.workForm.domains) {
  7045. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7046. let objs = {}
  7047. objs.s = this.workForm.domains[p].startTime
  7048. objs.e = this.workForm.domains[p].endTime
  7049. alp.push(objs)
  7050. }
  7051. }
  7052. this.dateAr = alp
  7053. if(this.dateAr.length > 0) {
  7054. let trus = this.fns()
  7055. if(!trus) {
  7056. this.$message({
  7057. message: this.$t('message.Filledtimeperiodsoverlap'),
  7058. type: "error"
  7059. });
  7060. return
  7061. }
  7062. }
  7063. } else {
  7064. for(var p in this.workForm.domains) {
  7065. var slll = this.workForm.domains[p]
  7066. for(var o in slll.worktimeList) {
  7067. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7068. let objs = {}
  7069. objs.s = slll.worktimeList[o].startTime
  7070. objs.e = slll.worktimeList[o].endTime
  7071. alp.push(objs)
  7072. }
  7073. }
  7074. }
  7075. this.dateAr = alp
  7076. if(this.dateAr.length > 0) {
  7077. let trus = this.fns()
  7078. if(!trus) {
  7079. this.$message({
  7080. message: this.$t('message.Filledtimeperiodsoverlap'),
  7081. type: "error"
  7082. });
  7083. return
  7084. }
  7085. }
  7086. }
  7087. }
  7088. //检查子项目
  7089. if (this.user.timeType.subProMustFill == 1) {
  7090. for(var p in this.workForm.domains) {
  7091. var oneProItem = this.workForm.domains[p]
  7092. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7093. //没有选择子项目
  7094. this.$message({
  7095. message: '子项目必填,请检查',
  7096. type: "error"
  7097. });
  7098. return
  7099. }
  7100. }
  7101. }
  7102. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7103. if (this.user.companyId == this.yuzhongCompId) {
  7104. for(var p in this.workForm.domains) {
  7105. var oneProItem = this.workForm.domains[p]
  7106. if (!oneProItem.extraField1) {
  7107. this.$message({
  7108. message: '角色必填,请检查',
  7109. type: "error"
  7110. });
  7111. return
  7112. }
  7113. if (!oneProItem.extraField2) {
  7114. this.$message({
  7115. message: '工作职责必填,请检查',
  7116. type: "error"
  7117. });
  7118. return
  7119. }
  7120. if (!oneProItem.extraField3) {
  7121. this.$message({
  7122. message: '工作内容必填,请检查',
  7123. type: "error"
  7124. });
  7125. return
  7126. }
  7127. }
  7128. }
  7129. // return
  7130. //代填的情况,检查人员是否已经选择
  7131. if (this.isSubstitude) {
  7132. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7133. this.$message({
  7134. message: this.$t('message.pleaseselectthepersontofillin'),
  7135. type: "error"
  7136. });
  7137. return;
  7138. }
  7139. }
  7140. //检查时间,全天和上下午不能同时存在
  7141. if (this.reportTimeType.type == 0) {
  7142. var alldayNum = 0;
  7143. var amNum = 0;
  7144. var pmNum = 0;
  7145. for(var i in this.workForm.domains) {
  7146. if (this.workForm.domains[i].timeType == 0) {
  7147. alldayNum ++;
  7148. } else if (this.workForm.domains[i].timeType == 1) {
  7149. amNum++;
  7150. } else if (this.workForm.domains[i].timeType == 2) {
  7151. pmNum++;
  7152. }
  7153. }
  7154. if (alldayNum > 1) {
  7155. this.$message({
  7156. // message: "工作时间-全天,只能选择一次",
  7157. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7158. type: "error"
  7159. });
  7160. return;
  7161. }
  7162. if (amNum > 1) {
  7163. this.$message({
  7164. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7165. type: "error"
  7166. });
  7167. return;
  7168. }
  7169. if (pmNum > 1) {
  7170. this.$message({
  7171. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7172. type: "error"
  7173. });
  7174. return;
  7175. }
  7176. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7177. this.$message({
  7178. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7179. type: "error"
  7180. });
  7181. return;
  7182. }
  7183. } else if (this.reportTimeType.type == 3) {
  7184. //总百分比不能超过100%
  7185. let total = 0;
  7186. this.workForm.domains.forEach(w=>{total += w.progress});
  7187. if (total > 100) {
  7188. this.$message({
  7189. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7190. type: "error"
  7191. });
  7192. return;
  7193. } else if (total < 100) {
  7194. this.$message({
  7195. message: this.$t('message.cannotbesubmitted'),
  7196. type: "error"
  7197. });
  7198. return;
  7199. }
  7200. }
  7201. this.listLoading = true;
  7202. let formData = new FormData();
  7203. formData.append("draft", this.isDraft);
  7204. var totalTime = 0;
  7205. for (var t=0;t<this.workForm.domains.length; t++) {
  7206. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7207. }
  7208. //批量填报不校验考勤时长,交给后台校验
  7209. if (!this.isBatch) {
  7210. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7211. if (this.workForm.time){
  7212. if (this.workForm.time.workHours == 0){
  7213. this.$message({
  7214. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7215. type: 'error'
  7216. })
  7217. return
  7218. }
  7219. }else{
  7220. this.$message({
  7221. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7222. type: 'error'
  7223. })
  7224. return
  7225. }
  7226. }
  7227. }
  7228. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7229. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7230. this.$message({
  7231. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7232. type: "error"
  7233. });
  7234. return;
  7235. }
  7236. }
  7237. for(var i in this.workForm.domains) {
  7238. // 检查任务/里程碑是否为必填
  7239. let taskRequired = this.user.timeType.taskRequired
  7240. if(taskRequired == 1) {
  7241. if(!this.workForm.domains[i].taskId) {
  7242. this.$message({
  7243. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7244. type: "error"
  7245. });
  7246. return
  7247. }
  7248. }
  7249. if(this.user.timeType.reportAuditType == 3){
  7250. let audItem = {}
  7251. let auditRule = ''
  7252. if(this.workForm.domains[i].id){
  7253. audItem.reportId = this.workForm.domains[i].id
  7254. }
  7255. if(this.user.timeType.auditLevel > 0){
  7256. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7257. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7258. }
  7259. if(this.user.timeType.auditLevel > 1){
  7260. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7261. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7262. }
  7263. if(this.user.timeType.auditLevel > 2){
  7264. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7265. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7266. }
  7267. if(this.workForm.domains[i].ccUserid){
  7268. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7269. }
  7270. if(auditRule){
  7271. auditRule = auditRule.substring(0,auditRule.length - 1)
  7272. this.$message({
  7273. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7274. type: 'error'
  7275. })
  7276. return
  7277. }
  7278. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7279. }
  7280. if (this.user.timeType.customDegreeActive) {
  7281. if (this.user.timeType.customDegreeMultiple) {
  7282. //多选
  7283. if (this.workForm.domains[i].multiDegrIdArray) {
  7284. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7285. degreeArray = degreeArray.replace(/,/g,"@");
  7286. formData.append("multiDegrId", degreeArray);
  7287. } else {
  7288. formData.append("multiDegrId", '[]');
  7289. }
  7290. } else {
  7291. //单选
  7292. if (this.workForm.domains[i].degreeId) {
  7293. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7294. } else {
  7295. formData.append("degreeId", -1);
  7296. }
  7297. }
  7298. } else {
  7299. formData.append("degreeId", -1);
  7300. }
  7301. if(this.workForm.domains[i].customData) {
  7302. // var sss = this.workForm.domains[i].degreeId.toString()
  7303. formData.append("customData", this.workForm.domains[i].customData);
  7304. } else {
  7305. formData.append("customData", 0);
  7306. }
  7307. if(this.workForm.domains[i].customText) {
  7308. formData.append("customText", this.workForm.domains[i].customText);
  7309. } else {
  7310. formData.append("customText", '-');
  7311. }
  7312. if (this.workForm.domains[i].id) {
  7313. formData.append("id", this.workForm.domains[i].id);
  7314. } else {
  7315. formData.append("id", -1);
  7316. }
  7317. formData.append("projectId", this.workForm.domains[i].projectId);
  7318. if (this.workForm.domains[i].subProjectId) {
  7319. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7320. } else {
  7321. formData.append("subProjectId", 0);
  7322. }
  7323. if (this.workForm.domains[i].groupId) {
  7324. formData.append("groupId", this.workForm.domains[i].groupId);
  7325. } else {
  7326. formData.append("groupId", 0);
  7327. }
  7328. if (this.workForm.domains[i].taskId) {
  7329. formData.append("taskId", this.workForm.domains[i].taskId);
  7330. } else {
  7331. formData.append("taskId", 0);
  7332. }
  7333. if (this.workForm.domains[i].taskFinish == true) {
  7334. formData.append("taskFinish", 1);
  7335. } else {
  7336. formData.append("taskFinish", 0);
  7337. }
  7338. formData.append("reportTimeType", this.reportTimeType.type);
  7339. if (this.reportTimeType.type == 0) {
  7340. formData.append("timeType", this.workForm.domains[i].timeType);
  7341. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7342. formData.append("workingTime", workingTime);
  7343. } else if (this.reportTimeType.type == 1){
  7344. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7345. } else if (this.reportTimeType.type == 2) {
  7346. formData.append("endTime", this.workForm.domains[i].endTime);
  7347. formData.append("startTime", this.workForm.domains[i].startTime);
  7348. } else if (this.reportTimeType.type == 3) {
  7349. //按比例分配
  7350. formData.append("progress", this.workForm.domains[i].progress);
  7351. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7352. }
  7353. if(this.user.timeType.choseFromAlbum == 1 ) {
  7354. console.log(this.workForm.domains[i].imgList)
  7355. if(this.workForm.domains[i].imgList) {
  7356. let imgListFor = this.workForm.domains[i].imgList
  7357. for(var b in imgListFor) {
  7358. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7359. }
  7360. console.log(imgListFor)
  7361. let m = JSON.stringify(imgListFor);
  7362. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7363. formData.append("picStr", m);
  7364. } else {
  7365. formData.append("picStr", '[]');
  7366. }
  7367. }
  7368. //处理多个时间事项
  7369. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7370. if (this.reportTimeType.multiWorktime == 1) {
  7371. //检查时间是否有重叠
  7372. var workList = this.workForm.domains[i].worktimeList;
  7373. for (var j=0;j<workList.length; j++) {
  7374. var curItem = workList[j];
  7375. //检查开始时间是否大于结束时间
  7376. if (curItem.startTime >= curItem.endTime) {
  7377. this.$message({
  7378. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7379. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7380. type: "error"
  7381. });
  7382. return;
  7383. }
  7384. //时间不可重叠
  7385. if (this.reportTimeType.timeCanOverlap == 0) {
  7386. for (var p = j+1;p<workList.length; p++) {
  7387. var jItem = workList[p];
  7388. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7389. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7390. this.$message({
  7391. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7392. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7393. type: "error"
  7394. });
  7395. return;
  7396. }
  7397. }
  7398. }
  7399. }
  7400. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7401. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7402. formData.append("content", m);
  7403. } else {
  7404. if (this.workForm.domains[i].content) {
  7405. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7406. m = m.replace(/,/g,",");
  7407. console.log(m, '需要传值的数据')
  7408. // formData.append("content", this.workForm.domains[i].content);
  7409. formData.append("content", m);
  7410. } else {
  7411. formData.append("content", '-');
  7412. }
  7413. }
  7414. if (this.isBatch == 0) {
  7415. formData.append("createDate", this.workForm.createDate);
  7416. } else {
  7417. //批量填报,时间范围
  7418. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7419. }
  7420. if(this.workForm.domains[i].isOvertime) {
  7421. formData.append("isOvertime", 1);
  7422. } else {
  7423. formData.append("isOvertime", 0);
  7424. }
  7425. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7426. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7427. } else {
  7428. formData.append("overtimeHours", 0);
  7429. }
  7430. if(this.workForm.domains[i].basecostId) {
  7431. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7432. } else {
  7433. formData.append("basecostId", 0);
  7434. }
  7435. if (this.workForm.userId != null) {
  7436. var targetUids = '';
  7437. this.workForm.userId.forEach(u=>{
  7438. targetUids += u + '@';
  7439. });
  7440. if (targetUids.length > 0) {
  7441. targetUids = targetUids.substring(0, targetUids.length -1);
  7442. formData.append("targetUids", targetUids);
  7443. }
  7444. }
  7445. //项目专业进度
  7446. if (this.workForm.domains[i].professionProgress) {
  7447. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7448. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7449. formData.append("professionProgress", m);
  7450. } else {
  7451. formData.append("professionProgress", "[]");
  7452. }
  7453. if (this.workForm.domains[i].stage) {
  7454. formData.append("stage", this.workForm.domains[i].stage);
  7455. } else {
  7456. formData.append("stage", "-");
  7457. }
  7458. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7459. if (this.workForm.domains[i].projectAuditorId) {
  7460. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7461. } else {
  7462. // console.log('执行到了这里')
  7463. // console.log(this.user.timeType.reportAuditType)
  7464. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7465. this.$message({
  7466. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7467. type: "error"
  7468. });
  7469. return;
  7470. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7471. //分组负责人先审核, 确定是选择了任务分组
  7472. if (this.workForm.domains[i].taskGroups.length == 0) {
  7473. this.$message({
  7474. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7475. type: "error"
  7476. });
  7477. } else if (!this.workForm.domains[i].groupId) {
  7478. // console.log(this.workForm.domains[i]);
  7479. this.$message({
  7480. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7481. type: "error"
  7482. });
  7483. } else {
  7484. this.$message({
  7485. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7486. type: "error"
  7487. });
  7488. }
  7489. return;
  7490. }
  7491. }
  7492. if (this.user.companyId == this.yuzhongCompId) {
  7493. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7494. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7495. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7496. }
  7497. //依斯贝的服务Id
  7498. if (this.user.companyId == this.yisibeiCompId) {
  7499. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7500. }
  7501. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7502. this.$message({
  7503. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7504. type: "error"
  7505. });
  7506. return
  7507. }
  7508. }
  7509. this.submitingReport = true;
  7510. this.http.uploadFile( this.port.report.editPort, formData,
  7511. res => {
  7512. this.listLoading = false;
  7513. this.submitingReport = false;
  7514. if (res.code == "ok") {
  7515. if(res.msg!=null){
  7516. this.$message({
  7517. dangerouslyUseHTMLString: true,
  7518. message: res.msg,
  7519. type: "warning",
  7520. showClose: true,
  7521. duration: 0
  7522. });
  7523. }else{
  7524. this.$message({
  7525. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7526. type: "success"
  7527. });
  7528. }
  7529. this.dialogVisible = false;
  7530. this.jsDay = 0
  7531. this.jsTime = 0
  7532. this.getReportList();
  7533. this.getDepartment();
  7534. this.getRecentlyProject()
  7535. } else {
  7536. this.$message({
  7537. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7538. type: "error"
  7539. });
  7540. }
  7541. },
  7542. error => {
  7543. this.listLoading = false;
  7544. this.submitingReport = false;
  7545. this.$message({
  7546. message: error,
  7547. type: "error"
  7548. });
  7549. });
  7550. },
  7551. // 判断是展示那个工时导入
  7552. imports() {
  7553. if(this.user.timeType.syncCorpwxTime == 0) {
  7554. this.importDialog = true
  7555. } else {
  7556. this.importWxDialog = true
  7557. }
  7558. },
  7559. // 跳转
  7560. junpToDeskTop(id) {
  7561. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7562. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7563. },
  7564. // 通过日报
  7565. approve(id, item) {
  7566. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7567. this.approveinData = {
  7568. id: id,
  7569. date: this.date +day,
  7570. reportIds: item.id
  7571. }
  7572. if(this.user.timeType.needEvaluate == 1){
  7573. this.$set(this.approveinData,'evaluate','')
  7574. this.approveinDialog = true
  7575. }else{
  7576. this.logining = true;
  7577. this.approveinfun()
  7578. }
  7579. },
  7580. approveinfun(){
  7581. this.http.post( this.port.report.approve, this.approveinData,
  7582. res => {
  7583. this.logining = false;
  7584. if (res.code == "ok") {
  7585. this.approveinDialog = false
  7586. this.$message({
  7587. message: this.$t('message.Reviewsucceeded'),
  7588. type: "success"
  7589. });
  7590. this.refreshReportData(this.approveinData.reportIds);
  7591. this.getDepartment();
  7592. } else {
  7593. this.$message({
  7594. message: res.msg,
  7595. type: "error"
  7596. });
  7597. }
  7598. },
  7599. error => {
  7600. this.logining = false;
  7601. this.$message({
  7602. message: error,
  7603. type: "error"
  7604. });
  7605. });
  7606. },
  7607. //撤回日报
  7608. cancel(item,e) {
  7609. // console.log('can can need',item);
  7610. this.logining = true;
  7611. var ids = '';
  7612. var data = e ? item : item.data;
  7613. data.forEach(element => {
  7614. if(element.id){
  7615. ids +=(element.id+',');
  7616. }
  7617. });
  7618. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7619. res => {
  7620. this.logining = false;
  7621. if (res.code == "ok") {
  7622. this.$message({
  7623. message:this.$t('message.Withdrawalsucceeded'),
  7624. type: "success"
  7625. });
  7626. this.getReportList();
  7627. if(e){this.getReport()}
  7628. this.getDepartment();
  7629. } else {
  7630. this.$message({
  7631. message: res.msg,
  7632. type: "error"
  7633. });
  7634. }
  7635. },
  7636. error => {
  7637. this.logining = false;
  7638. this.$message({
  7639. message: error,
  7640. type: "error"
  7641. });
  7642. });
  7643. },
  7644. showDenyDialog(id,i, item) {
  7645. this.denyReasonDialog = true;
  7646. this.isDenying = false;
  7647. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7648. var ids = item.id;
  7649. // var data = item.data;
  7650. // data.forEach(element => {
  7651. // ids +=(element.id+',');
  7652. // });
  7653. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7654. },
  7655. // 未通过日报
  7656. deny() {
  7657. this.logining = true;
  7658. this.isDenying = true;
  7659. this.http.post( this.port.report.deny, this.denyForm,
  7660. res => {
  7661. this.logining = false;
  7662. this.isDenying = false;
  7663. if (res.code == "ok") {
  7664. this.$message({
  7665. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7666. type: "success"
  7667. });
  7668. this.refreshReportData(this.denyForm.reportIds);
  7669. this.getDepartment();
  7670. this.denyReasonDialog = false;
  7671. } else {
  7672. this.$message({
  7673. message: res.msg,
  7674. type: "error"
  7675. });
  7676. }
  7677. },
  7678. error => {
  7679. this.logining = false;
  7680. this.$message({
  7681. message: error,
  7682. type: "error"
  7683. });
  7684. });
  7685. },
  7686. // 查看工时记录弹窗
  7687. toView() {
  7688. this.toViewDialogVisible = true
  7689. this.toViewloading = true
  7690. this.getToView()
  7691. },
  7692. getToView() {
  7693. this.http.post( '/report-import-log/getList', this.toViewForm,
  7694. res => {
  7695. this.toViewloading = false;
  7696. if (res.code == "ok") {
  7697. // console.log(res.data, '数据数据')
  7698. this.toViewList = res.data.records
  7699. this.toViewForm.total = res.data.total
  7700. } else {
  7701. this.toViewloading = false;
  7702. this.$message({
  7703. message: res.msg,
  7704. type: "error"
  7705. });
  7706. }
  7707. })
  7708. },
  7709. // 触发 selectCat 组件更改他的值
  7710. selectCatCli(obj) {
  7711. // console.log(obj, '看看')
  7712. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7713. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7714. },
  7715. vueCasader(obj) {
  7716. console.log(obj, '看看值')
  7717. if(obj.distinction == 1 && obj.item) {
  7718. let arr = []
  7719. arr.push(obj.item.value)
  7720. this.exportParam.departmentId = arr
  7721. }
  7722. },
  7723. //分页
  7724. handleCurrentChange(val) {
  7725. this.toViewForm.pageIndex = val;
  7726. this.getToView();
  7727. },
  7728. handleSizeChange(val) {
  7729. this.toViewForm.pageSize = val;
  7730. this.getToView();
  7731. },
  7732. getAllUsersList(){
  7733. this.http.post('/user/getSimpleActiveUserList',{
  7734. },res => {
  7735. if(res.code == 'ok'){
  7736. this.allUsersList = res.data
  7737. }else{
  7738. this.$message({
  7739. message: res.msg,
  7740. type: 'error'
  7741. })
  7742. }
  7743. },err => {
  7744. this.$message({
  7745. message: err,
  7746. type: 'error'
  7747. })
  7748. })
  7749. },
  7750. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7751. fillWeekCustomClne() {
  7752. this.fillWeekDialogVisiCustom = false
  7753. },
  7754. fillWeekCustomSubmit() {
  7755. this.getReportList();
  7756. this.getDepartment();
  7757. this.getRecentlyProject()
  7758. },
  7759. // 待填日报姓名搜索
  7760. nameAearchSeek(flg) {
  7761. if(!this.nameAearch) {
  7762. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7763. return
  7764. }
  7765. if(flg) {
  7766. this.enterpriseWechatgetUser()
  7767. }
  7768. },
  7769. handleThreeData(userList) {
  7770. console.log(userList, '人员数据')
  7771. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7772. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7773. },
  7774. // 过滤树节点
  7775. filterTreeNodes(treeData, filterKeywords) {
  7776. return treeData.filter((node) => {
  7777. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7778. if (node.children && node.children.length > 0) {
  7779. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7780. }
  7781. return true;
  7782. }
  7783. if (node.children && node.children.length > 0) {
  7784. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7785. return node.children.length > 0;
  7786. }
  7787. return false;
  7788. });
  7789. },
  7790. // 企业微信获取人员
  7791. enterpriseWechatgetUser() {
  7792. this.deptMembDataLoading = true
  7793. this.http.post('/user/getEmployeeList',{
  7794. departmentId: -1,
  7795. pageIndex: 1,
  7796. pageSize: 100,
  7797. keyword: this.nameAearch,
  7798. status: '',
  7799. roleId: '',
  7800. cursor: '',
  7801. onlyDirect: '',
  7802. matchingType: ''
  7803. },res => {
  7804. if(res.code == 'ok'){
  7805. this.deptMembDataLoading = false
  7806. const userListName = res.data.records.map(item => item.name)
  7807. this.handleThreeData(userListName)
  7808. }else{
  7809. this.deptMembDataLoading = false
  7810. this.$message({
  7811. message: res.msg,
  7812. type: 'error'
  7813. })
  7814. }
  7815. },err => {
  7816. this.deptMembDataLoading = false
  7817. this.$message({
  7818. message: err,
  7819. type: 'error'
  7820. })
  7821. })
  7822. },
  7823. // 按周填报获取相关任务
  7824. async getWeeklyTaskList(item) {
  7825. console.log(item, '<=== 数据')
  7826. const { projectId, groupId, stage, taskId } = item
  7827. console.log(projectId, groupId, stage)
  7828. let parms = { projectId, isSubstitude: 0 }
  7829. groupId ? parms.groupId = groupId : ''
  7830. stage ? parms.stage = stage : ''
  7831. const { data } = await this.postData('/task/getRecentTask', parms)
  7832. this.zhoBao.taskId = taskId
  7833. this.$set(this.zhoBao, 'taskList', data)
  7834. console.log(this.zhoBao)
  7835. },
  7836. // 封装 post 请求
  7837. postData(url, params) {
  7838. return new Promise((resolve, reject) => {
  7839. this.http.post(url, { ...params },
  7840. res => {
  7841. resolve(res)
  7842. },
  7843. error => {
  7844. this.$message({
  7845. message: error,
  7846. type: "error"
  7847. });
  7848. reject(error)
  7849. })
  7850. })
  7851. },
  7852. // 自定义事件
  7853. selectCal(obj) {
  7854. console.log(obj, '传数据来源')
  7855. if(obj.distinction == '1') {
  7856. this.zhoBao.projectAuditorId = obj.id
  7857. } else if(obj.distinction == '2') {
  7858. this.zhoBao.auditorFirst = obj.id
  7859. } else if(obj.distinction == '3') {
  7860. this.zhoBao.auditorSec = obj.id
  7861. } else if(obj.distinction == '4') {
  7862. this.zhoBao.auditorThird = obj.id
  7863. } else if(obj.distinction == '5') {
  7864. this.zhoBao.ccUserid = obj.id
  7865. } else if(obj.distinction == '12') {
  7866. this.usersListId = obj.id
  7867. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7868. this.searchKeyword = obj.name
  7869. } else {
  7870. this.searchKeyword = ''
  7871. }
  7872. this.searchScreen(0)
  7873. } else if(obj.distinction == '13') {
  7874. this.usersListId = obj.id
  7875. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7876. this.searchKeyword = obj.name
  7877. } else {
  7878. this.searchKeyword = ''
  7879. }
  7880. this.searchScreen(1)
  7881. }
  7882. }
  7883. },
  7884. created() {
  7885. this.getUsers()
  7886. let height = window.innerHeight;
  7887. this.tableHeight = height - 178;
  7888. const that = this;
  7889. window.onresize = function temp() {
  7890. that.tableHeight = window.innerHeight - 178;
  7891. };
  7892. this.toViewForm.companyId = this.user.companyId
  7893. this.initDrag([{
  7894. type: "LR",
  7895. domClass: {
  7896. // 中间分割线的名字
  7897. resize: "line-line",
  7898. // 左侧盒子的名字
  7899. left: "box-left",
  7900. // 右侧盒子的名字
  7901. right: "box-right",
  7902. // 父级的名字
  7903. box: "box-father",
  7904. },
  7905. otherInfo: {
  7906. // 限制左边栏最低宽度
  7907. leftWidth: 120,
  7908. },
  7909. },
  7910. {
  7911. type: "LR",
  7912. domClass: {
  7913. // 中间分割线的名字
  7914. resize: "line-second",
  7915. // 左侧盒子的名字
  7916. left: "left-laowang",
  7917. // 右侧盒子的名字
  7918. right: "box-second-father",
  7919. // 父级的名字
  7920. box: "grand",
  7921. },
  7922. otherInfo: {
  7923. // 限制左边栏最低宽度
  7924. leftWidth: 120,
  7925. },
  7926. },
  7927. ]);
  7928. }
  7929. };
  7930. </script>
  7931. <style lang="scss" scoped>
  7932. .fillWeekDialogVisiCustom {
  7933. width: 100%;
  7934. height: 70vh;
  7935. }
  7936. .fillWeekCustom {
  7937. .el-dialog__body {
  7938. padding: 20px 20px !important;
  7939. }
  7940. }
  7941. .photos {
  7942. position: relative;
  7943. display: flex;
  7944. flex-wrap: wrap;
  7945. }
  7946. .photos_img {
  7947. width: 120px;
  7948. height: 120px;
  7949. margin-right: 20px;
  7950. margin-bottom: 20px;
  7951. cursor: pointer;
  7952. img {
  7953. width: 100%;
  7954. height: 100%;
  7955. }
  7956. }
  7957. .paginatis {
  7958. padding: 10px 10px;
  7959. background: #f2f2f2;
  7960. }
  7961. .waiting {
  7962. color:orange;
  7963. }
  7964. .filledReportStyle {
  7965. color:#32CD32;
  7966. }
  7967. .RejectStyle {
  7968. color:red;
  7969. }
  7970. .waitSubmitStyle{
  7971. color: #409eff;
  7972. }
  7973. .chooseDate {
  7974. .waiting {
  7975. color: #20a0ff;
  7976. }
  7977. .filledReportStyle {
  7978. color:#20a0ff;
  7979. }
  7980. .RejectStyle {
  7981. color: #20a0ff;
  7982. }
  7983. .waitSubmitStyle{
  7984. color: #20a0ff;
  7985. }
  7986. }
  7987. .allDaily {
  7988. width:100%;
  7989. }
  7990. .report_title {
  7991. padding:10px 0;
  7992. color:#666;
  7993. }
  7994. .clearfix {
  7995. overflow-x: auto;
  7996. white-space: nowrap;
  7997. padding: 15px 0 10px 0;
  7998. // overflow-y: hidden;
  7999. .date_item {
  8000. padding: 0 3px;
  8001. cursor: pointer;
  8002. position: relative;
  8003. }
  8004. .chooseDate {
  8005. position: absolute;
  8006. bottom: -3px;
  8007. width: 37px;
  8008. height: 2px;
  8009. left: 14px;
  8010. background: #20a0ff;
  8011. }
  8012. }
  8013. .one_daily {
  8014. i {
  8015. color: #9ed0ff;
  8016. margin-right: 5px;
  8017. }
  8018. .one_daily_body {
  8019. padding: 10px 0px;
  8020. p {
  8021. margin: 0;
  8022. line-height: 30px;
  8023. }
  8024. }
  8025. ul {
  8026. padding: 0;
  8027. }
  8028. }
  8029. .checkbtn {
  8030. float: right;
  8031. margin-top: -10px;
  8032. }
  8033. .selConStyle{
  8034. margin-top:9rem;
  8035. margin-bottom:11rem;
  8036. .selConStyle_title{
  8037. height: 3rem;
  8038. text-align: center;
  8039. font-size: 17px;
  8040. }
  8041. .el-select{
  8042. margin: 0 15%;
  8043. width: 70%;
  8044. }
  8045. }
  8046. </style>
  8047. <style lang="scss">
  8048. /*去除upload组件过渡效果*/
  8049. .photos .el-upload-list__item {
  8050. transition: none !important;
  8051. }
  8052. .daily {
  8053. .el-card__body {
  8054. height: 80%;
  8055. overflow-y: auto;
  8056. }
  8057. .el-card__header {
  8058. padding: 0 20px;
  8059. }
  8060. }
  8061. .membListClass{
  8062. .el-dialog__body{
  8063. padding-top: 10px;
  8064. }
  8065. }
  8066. // .editReportDialog .el-dialog__footer{
  8067. // position: sticky;
  8068. // bottom: 0;
  8069. // background: #fff;
  8070. // height: 70px;
  8071. // z-index: 1010;
  8072. // }
  8073. .editReportDialog{
  8074. min-width: 800px;
  8075. }
  8076. .touruxiangmu{
  8077. max-width: 1000px;
  8078. }
  8079. </style>
  8080. <style scoped>
  8081. /* 项目标签的样式 */
  8082. .el-tag + .el-tag {
  8083. margin-left: 10px;
  8084. }
  8085. .button-new-tag {
  8086. margin-left: 10px;
  8087. height: 32px;
  8088. line-height: 30px;
  8089. padding-top: 0;
  8090. padding-bottom: 0;
  8091. }
  8092. .input-new-tag {
  8093. width: 90px;
  8094. margin-left: 10px;
  8095. vertical-align: bottom;
  8096. }
  8097. .selectworktime .el-table__fixed-body-wrapper{
  8098. top: 48px !important;
  8099. }
  8100. .selectworktime_export .selectworktime_export_l{
  8101. width: 650px;
  8102. float: left;
  8103. height: 42px;
  8104. }
  8105. .approvalProcessBox{
  8106. margin-left: 30px;
  8107. font-size: 14px;
  8108. line-height: 16px;
  8109. cursor: pointer;
  8110. }
  8111. .approvalProcessBox i {
  8112. margin-right: 0;
  8113. height: 16px;
  8114. width: 16px;
  8115. display: inline-block;
  8116. transform: scale(1.2);
  8117. position: relative;
  8118. top: 0.5px;
  8119. color: #409eff;
  8120. }
  8121. .approvalProcessBox .approvalProcessClick{
  8122. cursor: pointer;
  8123. color: #409eff;
  8124. font-size: 14px;
  8125. }
  8126. .approvalProcessBox:hover .approvalProcessClick{
  8127. color: #3485fb;
  8128. }
  8129. </style>
  8130. <style lang="scss" scoped>
  8131. // 加班样式
  8132. .overtime {
  8133. display: inline-block;
  8134. margin-left: 20px;
  8135. input {
  8136. display: inline-block;
  8137. margin-top: 5px;
  8138. }
  8139. }
  8140. .plus {
  8141. display: inline-block;
  8142. }
  8143. // .tages {
  8144. // float: right;
  8145. // }
  8146. .overtime {
  8147. display: inline-block;
  8148. margin-left: 30px;
  8149. }
  8150. .bloks {
  8151. display: inline-block;
  8152. width: 380px;
  8153. }
  8154. .zhiss {
  8155. display: flex;
  8156. justify-content: space-around;
  8157. align-items: center;
  8158. }
  8159. .zhoFel {
  8160. display: flex;
  8161. justify-content: space-between;
  8162. align-items: center;
  8163. }
  8164. // 左右滑动样式
  8165. .line {
  8166. width: 30px;
  8167. /* height: 500px; */
  8168. background: #f2f2f2;
  8169. cursor: w-resize;
  8170. }
  8171. .box-father {
  8172. border: 8px solid #000;
  8173. }
  8174. .line-second {
  8175. width: 10px;
  8176. /* background: red; */
  8177. }
  8178. .flex {
  8179. display: flex;
  8180. width: 100%;
  8181. }
  8182. .box-left {
  8183. flex: 0 0 400px;
  8184. /* height: 600px; */
  8185. /* background: blue; */
  8186. }
  8187. .box-right {
  8188. /* height: 600px; */
  8189. /* background: green; */
  8190. flex: 1;
  8191. }
  8192. .box-postion {
  8193. width: 200px;
  8194. /* height: 400px; */
  8195. background: #ccc;
  8196. }
  8197. .custom-tree-node {
  8198. flex: 1;
  8199. display: flex;
  8200. align-items: center;
  8201. justify-content: space-between;
  8202. font-size: 14px;
  8203. padding-right: 8px;
  8204. }
  8205. .daitianrbao {
  8206. width: 100%;
  8207. box-sizing: border-box;
  8208. height: 40px;
  8209. border-radius: 4px;
  8210. border: 1px solid #DCDFE6;
  8211. overflow: hidden;
  8212. text-overflow: ellipsis;
  8213. display: flex;
  8214. // align-items: center;
  8215. }
  8216. .daitianrbao .spnn {
  8217. display: inline-block;
  8218. box-sizing: border-box;
  8219. padding: 0 15px;
  8220. overflow: hidden;
  8221. text-overflow: ellipsis;
  8222. }
  8223. .daitianrbao .hover {
  8224. color: #DCDFE6 !important;
  8225. }
  8226. </style>