daily.vue 447 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456
  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. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <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">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <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'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{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)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <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">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <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')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <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')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <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')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <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>
  132. <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>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <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>
  136. <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>
  137. <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>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <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>
  175. <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>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <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> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <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>
  252. <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"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <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"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <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"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <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>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <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>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <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>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <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>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <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>
  327. <!-- 简陋的无报告提示 -->
  328. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </el-card>
  335. </div>
  336. <!-- 工时推送日志弹窗 -->
  337. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  338. <template>
  339. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  340. </template>
  341. <template>
  342. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  343. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  344. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  345. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  346. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  347. <el-table-column prop="result" label="推送结果" width="250">
  348. <template slot-scope="scope">
  349. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  350. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  354. </el-table>
  355. </template>
  356. <span slot="footer" class="dialog-footer">
  357. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  358. </span>
  359. </el-dialog>
  360. <!-- 填写日报的dialog -->
  361. <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">
  362. <div style="height: 65vh;overflow: auto;">
  363. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  364. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  365. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  366. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  367. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  368. <span class="spnn" v-if="workForm.userNames">
  369. <span v-for="(item, index) in workForm.userNames" :key="index">
  370. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  371. <span v-if="index < workForm.userNames.length - 1">,</span>
  372. </span>
  373. </span>
  374. <span class="spnn hover" v-else>
  375. {{$t('defaultText.pleaseSelectAsubstitute')}}
  376. </span>
  377. </div>
  378. </el-form-item>
  379. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  380. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  381. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  382. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  383. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  384. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  385. <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>
  386. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  387. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  389. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  390. <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>
  391. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  392. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  393. </span>
  394. <!--批量填报和批量代填不显示考勤记录-->
  395. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  396. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  397. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  398. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  399. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  400. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  401. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  402. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  403. @click="refreshAttendance(workForm.createDate)"></el-button>
  404. <!-- AI智能填报 -->
  405. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  406. </el-form-item>
  407. <!-- 000000 -->
  408. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  409. <div v-if="reportTimeType.multiWorktime==0">
  410. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  411. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  412. <el-select v-model="domain.timeType" style="width:200px;"
  413. v-if="reportTimeType.type == 0"
  414. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  415. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  416. @change="onTimeTypeChange(domain.timeType)">
  417. <el-option
  418. v-for="item in timeType"
  419. :key="item.value"
  420. :label="item.label"
  421. :value="item.value">
  422. </el-option>
  423. </el-select>
  424. <!-- 数字时长选择 -->
  425. <el-select v-model="domain.workingTime" style="width:200px;"
  426. v-if="reportTimeType.type == 1"
  427. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  428. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  429. @change="seleChn(0,domain)">
  430. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  431. </el-select>
  432. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  433. <span v-if="reportTimeType.type == 2">
  434. <!--时间范围选择 -->
  435. <el-time-picker
  436. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  437. v-model="domain.startTime"
  438. :placeholder="$t('time.startTime')"
  439. style="width:120px;"
  440. format="HH:mm"
  441. value-format="HH:mm"
  442. :picker-options="{
  443. start: '08:00',
  444. end: '23:30'
  445. }"
  446. @change="iptChang()">
  447. </el-time-picker> - <el-time-picker
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  449. v-model="domain.endTime"
  450. :placeholder="$t('time.endTime')"
  451. style="width:120px;"
  452. format="HH:mm"
  453. value-format="HH:mm"
  454. :picker-options="{
  455. start: '08:00',
  456. end: '23:30',
  457. minTime: domain.startTime
  458. }"
  459. @change="iptChang()">
  460. </el-time-picker>
  461. </span>
  462. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  463. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  464. <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>
  465. </div>
  466. </el-form-item>
  467. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  468. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  469. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  470. @change="selectProject(domain, index)"
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  472. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  473. <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">
  474. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  475. <span style="float: right;">{{ item.projectName }}</span>
  476. </el-option>
  477. </el-option-group>
  478. </el-select>
  479. <!--昱众不显示子项目-->
  480. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  481. <span style="margin-left:45px;">
  482. {{$t('lable.subproject')}}</span>
  483. <!--子项目 -->
  484. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  485. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  486. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </template>
  489. <template v-if="user.companyId == yuzhongCompId">
  490. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  491. <!--角色选择 -->
  492. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  493. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  494. <el-option
  495. v-for="item in roleList"
  496. :key="item.value"
  497. :label="item.label"
  498. :value="item.value">
  499. </el-option>
  500. </el-select>
  501. </template>
  502. <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%;"
  503. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  504. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  505. </el-link>
  506. <!-- <el-link type="primary" v-if="canEdit"
  507. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  508. </el-form-item>
  509. <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">
  510. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  511. </el-form-item>
  512. <!--如果设置了工时成本预警的预算成本项-->
  513. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  514. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  515. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  516. </el-select>
  517. </el-form-item>
  518. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  519. <template slot="label">
  520. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  521. <span >{{$t('lable.taskGrouping')}}</span>
  522. </template>
  523. <!-- 任务分组 -->
  524. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  526. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  527. </el-select>
  528. <template v-if="user.companyId == yuzhongCompId">
  529. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  530. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  531. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  532. <el-option
  533. v-for="item in domain.filteredRespList"
  534. :key="item.id"
  535. :label="item.jobRespon"
  536. :value="item.id">
  537. </el-option>
  538. </el-select>
  539. </template>
  540. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  541. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  542. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  543. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  544. @change="changeStages(domain, index)"
  545. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  546. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  547. </el-select>
  548. </template>
  549. </el-form-item>
  550. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  551. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  552. <template slot="label">
  553. <span style="color:#FF0000;">*</span>
  554. <span >{{$t('other.projectAuditor')}}</span>
  555. </template>
  556. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  557. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  558. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  559. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  560. </el-option>
  561. </el-select>
  562. <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>
  563. </el-form-item>
  564. </div>
  565. <el-form-item v-if="user.companyId == yuzhongCompId">
  566. <template slot="label">
  567. <span style="color:#FF0000;">*</span>
  568. <span >工作内容</span>
  569. </template>
  570. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  571. :disabled="(workForm.domains[index].state>=2?false:true)" >
  572. <el-option
  573. v-for="item in domain.workContentList"
  574. :key="item.id"
  575. :label="item.workContext"
  576. :value="item.id">
  577. </el-option>
  578. </el-select>
  579. </el-form-item>
  580. <!-- 111111 -->
  581. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  582. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  583. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  584. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  585. <span v-else>{{item.name}}</span>
  586. </el-option>
  587. </el-select>
  588. <template v-if="user.timeType.auditLevel > 1">
  589. <i class="el-icon-right"></i>
  590. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  591. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  592. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  593. <span v-else>{{item.name}}</span>
  594. </el-option>
  595. </el-select>
  596. </template>
  597. <template v-if="user.timeType.auditLevel > 2">
  598. <i class="el-icon-right"></i>
  599. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  600. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  601. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  602. <span v-else>{{item.name}}</span>
  603. </el-option>
  604. </el-select>
  605. </template>
  606. </el-form-item>
  607. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  608. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  609. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  610. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  611. <span v-else>{{item.name}}</span>
  612. </el-option>
  613. </el-select>
  614. </el-form-item>
  615. <!-- 相关维度/自定义维度 -->
  616. <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'">
  617. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  618. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <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'">
  623. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  624. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  625. </el-option>
  626. </el-select>
  627. </el-form-item>
  628. <!-- 相关数值 -->
  629. <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">
  630. <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>
  631. </el-form-item>
  632. <!-- 自定义文本 -->
  633. <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">
  634. <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>
  635. </el-form-item>
  636. <!--按比例填报-->
  637. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  638. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  639. <div style="width:400px;">
  640. <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>
  641. <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>
  642. </div>
  643. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  644. <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>
  645. </div>
  646. </el-form-item>
  647. <!--工程专业版本模式下, 各个专业的进度填报 -->
  648. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  649. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  650. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  651. <el-input size="mini" style="width:60px;" v-model="item.progress"
  652. @keyup.native="onProgressChange"
  653. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  654. </span>
  655. </el-form-item>
  656. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  657. <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))" >
  658. <template slot="label" v-if="user.timeType.taskRequired == 1">
  659. <span style="color:#FF0000;">*</span>
  660. <span >任务</span>
  661. </template>
  662. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  664. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  665. </el-select>
  666. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  667. </el-form-item>
  668. <!--针对依斯贝的SAP服务-->
  669. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  670. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  671. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  673. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  674. </el-select>
  675. </el-form-item>
  676. <!--工作事项-->
  677. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  678. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  679. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  681. </el-form-item>
  682. <!-- 拍照上传 -->
  683. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  684. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  685. <div class="photos">
  686. <div>
  687. <el-upload
  688. list-type="picture-card"
  689. :http-request="(file) => {return addImg(file, index)}"
  690. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  691. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  692. :file-list="domain.imgListUrl" :limit="9"
  693. :disabled="workForm.domains[index].state>=2?false:true">
  694. <i class="el-icon-plus"></i>
  695. </el-upload>
  696. </div>
  697. </div>
  698. </el-form-item>
  699. </div>
  700. <!--多个工作事项填报的情况 -->
  701. <div v-if="reportTimeType.multiWorktime==1">
  702. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  703. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  704. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  705. @change="selectProject(domain, index)"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  707. <!-- <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">
  708. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  709. <span style="float: right;">{{ item.projectName }}</span>
  710. </el-option> -->
  711. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  712. <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">
  713. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  714. <span style="float: right;">{{ item.projectName }}</span>
  715. </el-option>
  716. </el-option-group>
  717. </el-select>
  718. <template v-if="user.timeType.mainProjectState != 1">
  719. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  720. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  721. <!--子项目 -->
  722. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  723. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  724. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  725. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  726. </el-select>
  727. </template>
  728. <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;"
  729. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  730. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  731. </el-link>
  732. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  733. <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>
  734. </div>
  735. <!-- <el-link type="primary" v-if="canEdit"
  736. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  737. </el-form-item>
  738. <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">
  739. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  740. </el-form-item>
  741. <!--如果设置了工时成本预警的预算成本项-->
  742. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  743. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  744. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  745. </el-select>
  746. </el-form-item>
  747. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  748. <!-- 任务分组 -->
  749. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  750. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  751. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  752. </el-select>
  753. <!-- 项目的阶段 -->
  754. <span v-if="domain.stages != null && domain.stages.length> 0"
  755. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  756. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  757. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  758. @change="changeStages(domain, index)"
  759. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  760. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  761. </el-select>
  762. </el-form-item>
  763. <el-form-item :label="$t('other.projectAuditor')" >
  764. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  765. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  766. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  767. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  768. </el-option>
  769. </el-select>
  770. <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>
  771. </el-form-item>
  772. <!--工程专业版本模式下, 各个专业的进度填报 -->
  773. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  774. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  775. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  776. <el-input size="mini" style="width:60px;" v-model="item.progress"
  777. @keyup.native="onProgressChange"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  779. </span>
  780. </el-form-item>
  781. <!-- 相关维度 -->
  782. <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'">
  783. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  784. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  785. </el-option>
  786. </el-select>
  787. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  788. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  789. </el-option>
  790. </el-select>
  791. </el-form-item>
  792. <!-- 相关数值 -->
  793. <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">
  794. <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>
  795. </el-form-item>
  796. <!-- 自定义文本 -->
  797. <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">
  798. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  799. </el-form-item>
  800. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  801. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  802. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  803. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  804. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  805. </el-select>
  806. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  807. </el-form-item>
  808. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  809. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  810. <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>
  811. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  812. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  813. <span v-if="reportTimeType.type == 2">
  814. <!-- <span> -->
  815. <!--时间范围选择 -->
  816. <el-time-picker
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  818. v-model="timeItem.startTime"
  819. :placeholder="$t('time.startTime')"
  820. style="width:120px;"
  821. format="HH:mm"
  822. value-format="HH:mm"
  823. :picker-options="{
  824. start: '00:00',
  825. end: '23:59',
  826. }"
  827. @change="iptChangs()">
  828. </el-time-picker> - <el-time-picker
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  830. v-model="timeItem.endTime"
  831. :placeholder="$t('time.endTime')"
  832. style="width:120px;"
  833. format="HH:mm"
  834. value-format="HH:mm"
  835. :picker-options="{
  836. start: '00:00',
  837. end: '23:59',
  838. minTime: timeItem.startTime
  839. }"
  840. @change="iptChangs()">
  841. </el-time-picker>
  842. </span>
  843. </el-form-item>
  844. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  845. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  846. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  847. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  848. ></el-input>
  849. </el-form-item>
  850. </div>
  851. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  852. </div>
  853. <!--照片的显示 -->
  854. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  855. <el-image v-for="(pic, index) in domain.pics" :key="index"
  856. style="width: 100px; height: 100px; margin-right:10px;"
  857. :src="pic"
  858. :preview-src-list="domain.pics">
  859. </el-image>
  860. </p>
  861. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  862. </div>
  863. <span id="workFormsItemBottom"></span>
  864. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  865. </el-form>
  866. </div>
  867. <span slot="footer" class="dialog-footer">
  868. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  869. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  870. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  871. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  872. <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>
  873. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  874. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  875. </span>
  876. </el-dialog>
  877. <!-- 按周填报 -->
  878. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  879. <!-- 按周填报-已填工时-点击 -->
  880. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  881. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  882. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  883. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  884. <el-table-column prop="state" :label="$t('state.states')">
  885. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  886. </el-table-column>
  887. <!-- <el-table-column label="操作">
  888. <template slot-scope="scope">
  889. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  890. </template>
  891. </el-table-column> -->
  892. </el-table>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  895. </span>
  896. </el-dialog>
  897. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  898. <el-form-item style="height:30px;margin-top:-72px;">
  899. <!-- <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> -->
  900. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  901. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  902. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  903. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  904. <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>
  905. <el-option
  906. v-for="item in fillProjectList"
  907. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  908. :key="item.id"
  909. :label="item.projectName + '\u3000' + item.projectCode"
  910. :value="item.id">
  911. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  912. <span style="float: right">{{ item.projectName }}</span>
  913. </el-option>
  914. </el-select>
  915. <span style="float:right;margin-right:10px;">选择项目</span>
  916. </el-form-item>
  917. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  918. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  919. <template slot-scope="scope">
  920. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  921. </template>
  922. </el-table-column>
  923. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  924. <template slot-scope="scope">
  925. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  926. <p v-else></p>
  927. </template>
  928. </el-table-column> -->
  929. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  930. <template slot-scope="scope">
  931. <div v-if="scope.row.canFill == 1">
  932. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  933. <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>
  934. <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>
  935. <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>
  936. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  937. </div>
  938. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  939. <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>
  940. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  941. </div>
  942. </div>
  943. <div v-else >
  944. <span style="color:#999999;">不可超前填报</span>
  945. </div>
  946. </template>
  947. </el-table-column>
  948. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  949. <template slot-scope="scope">
  950. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  951. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  952. </template>
  953. </el-table-column>
  954. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  955. <template slot-scope="scope">
  956. <div class="zhiss">
  957. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  958. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. </el-table>
  963. </el-form>
  964. <span slot="footer" class="dialog-footer" >
  965. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  966. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  967. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  968. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  969. </span>
  970. </el-dialog>
  971. <!-- 重庆物奇私人定制的按周填报 -->
  972. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  973. <div class="fillWeekDialogVisiCustom">
  974. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  975. </div>
  976. </el-dialog>
  977. <!-- 选择时间 -->
  978. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  979. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  980. <span slot="footer" class="dialog-footer">
  981. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  982. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 按周填报弹窗 -->
  986. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  987. <div>
  988. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  989. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  990. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  991. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <!--如果设置了工时成本预警的预算成本项-->
  995. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  996. <p>{{$t('lable.budgetSource')}}</p>
  997. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  998. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  999. </el-select>
  1000. </div>
  1001. <!-- 任务分组 -->
  1002. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1003. <p>{{$t('lable.taskGrouping')}}</p>
  1004. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1005. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1006. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1007. </el-select>
  1008. </div>
  1009. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1010. <p>{{$t('other.inputStage')}}</p>
  1011. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1012. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1016. <p>{{$t('other.reviewer')}}</p>
  1017. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1018. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <template v-if="user.timeType.reportAuditType == 3">
  1023. <div class="zhoFel">
  1024. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1025. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1026. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1027. </el-select>
  1028. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1029. </div>
  1030. <div class="zhoFel">
  1031. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1032. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1033. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1034. </el-select>
  1035. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1036. </div>
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-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.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('chao-song-ren') }}</p>
  1046. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" 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.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. </template>
  1052. <!-- 自定义维度 -->
  1053. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1054. <p>{{user.timeType.customDegreeName}}</p>
  1055. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1056. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1059. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1060. </el-select>
  1061. </div>
  1062. <!-- 自定义数值 -->
  1063. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1064. <p>{{user.timeType.customDataName}}</p>
  1065. <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>
  1066. </div>
  1067. <!-- 自定义文本 -->
  1068. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1069. <p>{{user.timeType.customTextName}}</p>
  1070. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1071. </div>
  1072. <!-- 选择任务 -->
  1073. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1074. <p>任务 / 里程碑</p>
  1075. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1076. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1080. <p>{{$t('other.timeSelection')}}</p>
  1081. <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>
  1082. </div>
  1083. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1084. <p>{{$t('other.chooseDuration')}}</p>
  1085. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1086. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1087. </el-select>
  1088. </div>
  1089. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1090. <p>{{$t('lable.percentageOfTime')}}</p>
  1091. <div style="width:400px;display: flex;align-items: center;">
  1092. <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>
  1093. <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>
  1094. </div>
  1095. </div>
  1096. <div class="zhoFel">
  1097. <p>{{$t('other.workMatters')}}</p>
  1098. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1099. </div>
  1100. </div>
  1101. <span slot="footer" class="dialog-footer">
  1102. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1103. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1104. </span>
  1105. </el-dialog>
  1106. <!--导出报表条件选择 -->
  1107. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1108. <el-form ref="form3" :model="exportParam" >
  1109. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1110. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1111. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1112. </el-select>
  1113. </el-form-item>
  1114. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1115. <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>
  1116. <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>
  1117. </el-form-item>
  1118. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :range-separator="$t('other.to')"
  1123. type="daterange"
  1124. :start-placeholder="$t('time.startDate')"
  1125. :end-placeholder="$t('time.endDate')"
  1126. ></el-date-picker>
  1127. </el-form-item>
  1128. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1129. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1130. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1131. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1132. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1136. <div class="exportReportRadio">
  1137. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1138. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1139. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1140. <i class="el-icon-question"></i>
  1141. </el-tooltip>
  1142. </div>
  1143. </el-form-item>
  1144. </el-form>
  1145. <div slot="footer" class="dialog-footer">
  1146. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1147. </div>
  1148. </el-dialog>
  1149. <!--导出报表条件选择 -->
  1150. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" :model="exportParam" >
  1152. <el-form-item prop="range" :label="$t('time.dateRange')">
  1153. <el-date-picker
  1154. v-model="exportParam.dateRange" :editable="false"
  1155. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1156. :clearable="true"
  1157. :range-separator="$t('other.to')"
  1158. type="daterange"
  1159. :start-placeholder="$t('time.startDate')"
  1160. :end-placeholder="$t('time.endDate')"
  1161. ></el-date-picker>
  1162. </el-form-item>
  1163. </el-form>
  1164. <div slot="footer" class="dialog-footer">
  1165. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1166. </div>
  1167. </el-dialog>
  1168. <!--人员列表 -->
  1169. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1170. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1171. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1172. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1173. <el-table-column type="selection"></el-table-column>
  1174. <el-table-column prop="label" :label="$t('lable.name')" >
  1175. <template slot-scope="scope">
  1176. <span>
  1177. <!-- {{(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}} -->
  1178. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1179. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1180. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1181. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1182. </span>
  1183. <span v-else>
  1184. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1185. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1186. </span>
  1187. </span>
  1188. </template>
  1189. </el-table-column>
  1190. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1191. <template slot-scope="scope">
  1192. <div>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1194. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1195. </div>
  1196. </template>
  1197. </el-table-column>
  1198. </el-table>
  1199. </el-tab-pane>
  1200. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1201. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1202. <el-table-column prop="label" :label="$t('lable.name')" >
  1203. <template slot-scope="scope">
  1204. <!-- <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> -->
  1205. <!-- <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> -->
  1206. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1208. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1209. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1210. </span>
  1211. <span v-else>
  1212. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1213. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1214. </span>
  1215. </template>
  1216. </el-table-column>
  1217. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1218. <template slot-scope="scope">
  1219. <div>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1222. </div>
  1223. </template>
  1224. </el-table-column>
  1225. </el-table>
  1226. </el-tab-pane>
  1227. </el-tabs>
  1228. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1229. <el-table-column type="selection"></el-table-column>
  1230. <el-table-column prop="label" :label="$t('lable.name')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1239. <template slot-scope="scope">
  1240. <div>
  1241. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1242. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1243. </div>
  1244. </template>
  1245. </el-table-column>
  1246. </el-table>
  1247. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1248. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1249. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1250. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1251. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <!-- 按部门选择人员 -->
  1255. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1256. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1257. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1258. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1259. </el-input>
  1260. <div class="tree" style="height:400px">
  1261. <el-scrollbar style="height:100%">
  1262. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1263. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1264. highlight-current :filter-node-method="filterNode">
  1265. <span class="custom-tree-node" slot-scope="{ node }">
  1266. <span v-if="user.userNameNeedTranslate == '1'">
  1267. <span v-if="node.data.children">
  1268. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1269. </span>
  1270. <span v-else>
  1271. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1272. </span>
  1273. </span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">
  1275. {{ node.label }}
  1276. </span>
  1277. <!-- {{ node.label }} -->
  1278. </span>
  1279. </el-tree>
  1280. </el-scrollbar>
  1281. </div>
  1282. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1283. <div slot="footer" class="dialog-footer">
  1284. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1285. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1286. </div>
  1287. </el-dialog>
  1288. <el-dialog
  1289. v-if="monthWorkTimeDialog"
  1290. :visible.sync="monthWorkTimeDialog"
  1291. :close-on-click-modal="false"
  1292. customClass="customWidth selectworktime"
  1293. width="1200px"
  1294. title=""
  1295. >
  1296. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1297. <el-tabs v-model="activeName" @tab-click="handleClick">
  1298. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1299. <div class="selectworktime_export" style="margin-top:10px;">
  1300. <div class="selectworktime_export_l">
  1301. <el-date-picker
  1302. class="selecteworktime_datapick"
  1303. v-model="WorktimeDatepickValue"
  1304. value-format="yyyy-MM-dd"
  1305. type="daterange"
  1306. align="right"
  1307. unlink-panels
  1308. :range-separator="$t('other.to')"
  1309. :start-placeholder="$t('time.startDate')"
  1310. :end-placeholder="$t('time.endDate')"
  1311. :default-time="['12:00:00', '12:00:00']"
  1312. size="small"
  1313. popper-class="selecteorktime_datapick_popper"
  1314. @change="showMonthWorkTime()"
  1315. >
  1316. </el-date-picker>
  1317. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1318. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1319. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1320. <!-- 222 -->
  1321. </div>
  1322. <div>
  1323. <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">
  1324. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1325. </el-input>
  1326. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1327. </div>
  1328. <el-link
  1329. type="primary"
  1330. style="float: right; vertical-align: middle;height:32px"
  1331. @click="exportMembWorkHours()"
  1332. >{{$t('export.exportData')}}</el-link
  1333. >
  1334. </div>
  1335. <el-table ref="hasworkTbl"
  1336. :data="monthWorkDataS"
  1337. v-el-table-infinite-scroll="listScroll"
  1338. border
  1339. :height="500"
  1340. highlight-current-row
  1341. style="width: 100%"
  1342. v-loading="tbload"
  1343. :lazy="true"
  1344. >
  1345. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1346. <template slot-scope="scope">
  1347. {{ scope.$index + 1 }}
  1348. </template>
  1349. </el-table-column>
  1350. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1351. <template slot-scope="scope">
  1352. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1353. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1354. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1355. <!-- {{scope.row.name}} -->
  1356. </span>
  1357. </template>
  1358. </el-table-column>
  1359. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1360. <template slot-scope="scope">
  1361. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1362. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1363. </template>
  1364. </el-table-column>
  1365. <el-table-column
  1366. min-width="105"
  1367. v-for="(item, index) in pickDateArray"
  1368. :key="index"
  1369. :label="item.label"
  1370. align="center"
  1371. >
  1372. <template slot-scope="scope">
  1373. <div
  1374. style="color: red"
  1375. v-if="
  1376. scope.row.worktimeList.filter(
  1377. (w) =>
  1378. w.createDate==item.date
  1379. ).length > 0 &&
  1380. scope.row.worktimeList.filter(
  1381. (w) =>w.createDate==item.date
  1382. )[0].workingTime < reportTimeType.allday
  1383. "
  1384. >
  1385. {{
  1386. scope.row.worktimeList.filter(
  1387. (w) =>w.createDate==item.date
  1388. )[0].workingTime.toFixed(1)
  1389. }}
  1390. </div>
  1391. <div
  1392. style="color: #20a0ff"
  1393. v-if="
  1394. scope.row.worktimeList.filter(
  1395. (w) =>w.createDate==item.date
  1396. ).length > 0 &&
  1397. scope.row.worktimeList.filter(
  1398. (w) =>w.createDate==item.date
  1399. )[0].workingTime > reportTimeType.allday
  1400. "
  1401. >
  1402. {{
  1403. scope.row.worktimeList.filter(
  1404. (w) =>w.createDate==item.date
  1405. )[0].workingTime.toFixed(1)
  1406. }}
  1407. </div>
  1408. <div
  1409. v-if="
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. ).length > 0 &&
  1413. scope.row.worktimeList.filter(
  1414. (w) =>w.createDate==item.date
  1415. )[0].workingTime == reportTimeType.allday
  1416. "
  1417. >
  1418. {{
  1419. scope.row.worktimeList.filter(
  1420. (w) =>w.createDate==item.date
  1421. )[0].workingTime
  1422. }}
  1423. </div>
  1424. <div
  1425. v-if="
  1426. scope.row.worktimeList.filter(
  1427. (w) =>w.createDate==item.date
  1428. ).length == 0
  1429. "
  1430. >
  1431. 0
  1432. </div>
  1433. <div
  1434. v-if="
  1435. scope.row.worktimeList.filter(
  1436. (w) =>w.createDate==item.date
  1437. ).length > 0 &&
  1438. typeof scope.row.worktimeList.filter(
  1439. (w) =>w.createDate==item.date
  1440. )[0].workingTime == 'string'
  1441. "
  1442. >
  1443. {{
  1444. scope.row.worktimeList.filter(
  1445. (w) =>w.createDate==item.date
  1446. )[0].workingTime
  1447. }}
  1448. </div>
  1449. </template>
  1450. </el-table-column>
  1451. </el-table>
  1452. <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>
  1453. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1454. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1455. <label style="font-size: 16px">员工每日已填报工时数</label>
  1456. <el-link
  1457. type="primary"
  1458. style="float: right; margin-right: 60px"
  1459. @click="exportMembWorkHours()"
  1460. >导出已填报数据</el-link
  1461. > -->
  1462. <!-- <el-button >导出</el-button> -->
  1463. <!-- </div> -->
  1464. </el-tab-pane>
  1465. <el-tab-pane label="未提交人员列表" name="second" >
  1466. <div class="selectworktime_export" style="margin-top:10px">
  1467. <div class="selectworktime_export_l">
  1468. <el-date-picker
  1469. class="selecteworktime_datapick"
  1470. v-model="WorktimeDatepickValue"
  1471. value-format="yyyy-MM-dd"
  1472. type="daterange"
  1473. align="right"
  1474. unlink-panels
  1475. :range-separator="$t('other.to')"
  1476. :start-placeholder="$t('time.startDate')"
  1477. :end-placeholder="$t('time.endDate')"
  1478. :default-time="['12:00:00', '12:00:00']"
  1479. size="small"
  1480. popper-class="selecteorktime_datapick_popper"
  1481. @change="showMonthNotWorkTime()"
  1482. >
  1483. </el-date-picker>
  1484. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1485. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1486. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1487. </div>
  1488. <div>
  1489. <div style="margin-top:10px;">
  1490. <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>
  1491. <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>
  1492. <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">
  1493. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1494. </el-input>
  1495. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1496. <el-link
  1497. type="primary"
  1498. style="float: right; vertical-align: middle;height:32px"
  1499. @click="exportMembNotWorkHours()"
  1500. >{{$t('export.exportData')}}</el-link
  1501. >
  1502. </div>
  1503. </div>
  1504. </div>
  1505. <el-table
  1506. ref="hasworkTbl2"
  1507. :data="monthNotWorkDateS"
  1508. v-el-table-infinite-scroll="notListScroll"
  1509. border
  1510. :height="500"
  1511. highlight-current-row
  1512. style="width: 100%"
  1513. v-loading="tbload"
  1514. lazy
  1515. >
  1516. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1517. <template slot-scope="scope">
  1518. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1519. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1520. </template>
  1521. </el-table-column>
  1522. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1523. <template slot-scope="scope">
  1524. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1525. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1526. </template>
  1527. </el-table-column>
  1528. <el-table-column
  1529. min-width="200"
  1530. :label="$t('weekDay.date')"
  1531. align="center"
  1532. prop="createDate"
  1533. >
  1534. </el-table-column>
  1535. <el-table-column
  1536. min-width="200"
  1537. :label="$t('state.states')"
  1538. align="center"
  1539. prop="status"
  1540. />
  1541. <el-table-column
  1542. min-width="200"
  1543. :label="$t('other.attendanceData')"
  1544. prop="cardTime"
  1545. align="center"
  1546. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1547. </el-table>
  1548. <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>
  1549. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1550. </el-tab-pane>
  1551. </el-tabs>
  1552. </el-dialog>
  1553. <!--驳回弹出框 -->
  1554. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1555. <div>
  1556. <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')" />
  1557. </div>
  1558. <div slot="footer" class="dialog-footer">
  1559. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1560. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1561. </div>
  1562. </el-dialog>
  1563. <!-- 通过弹出框 -->
  1564. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1565. <div>
  1566. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1567. </div>
  1568. <div slot="footer" class="dialog-footer">
  1569. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1570. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1571. </div>
  1572. </el-dialog>
  1573. <!--批量导入日报 -->
  1574. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1575. <p>1. {{$t('other.download')}}
  1576. <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>
  1577. </p>
  1578. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1579. <p style="display: flex;justify-content: center;">
  1580. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1581. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1582. </el-upload>
  1583. </p>
  1584. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1585. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1586. </div>
  1587. </el-dialog>
  1588. <!-- 工时导入记录弹窗 -->
  1589. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1590. <div style="height: 452px">
  1591. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1592. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1593. <el-table-column prop="userName" :label="$t('other.operator')">
  1594. <template slot-scope="scope">
  1595. <div>
  1596. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1597. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1598. </div>
  1599. </template>
  1600. </el-table-column>
  1601. <el-table-column prop="datel" :label="$t('other.document')">
  1602. <template slot-scope="scope">
  1603. <div>
  1604. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1605. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1606. </div>
  1607. </template>
  1608. </el-table-column>
  1609. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1610. <template slot-scope="scope">
  1611. <div>
  1612. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1613. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1614. </div>
  1615. </template>
  1616. </el-table-column>
  1617. </el-table>
  1618. <el-col :span="24" class="paginatis">
  1619. <el-pagination
  1620. @size-change="handleSizeChange"
  1621. @current-change="handleCurrentChange"
  1622. :page-sizes="[20 , 50 , 80 , 100]"
  1623. :page-size="20"
  1624. layout="total, sizes, prev, pager, next"
  1625. :total="toViewForm.total"
  1626. style="float:right;"
  1627. ></el-pagination>
  1628. </el-col>
  1629. </div>
  1630. </el-dialog>
  1631. <!--基于企业微信考勤数据的工时导入 -->
  1632. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1633. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1634. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1635. </el-step>
  1636. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1637. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1638. </el-steps>
  1639. <div v-if="active==0" style="padding:30px;height:360px;">
  1640. <div style="margin-top:50px;margin-left:280px;">
  1641. <el-date-picker
  1642. v-model="importWxParam.date" :editable="false"
  1643. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1644. :clearable="true"
  1645. :range-separator="$t('other.to')"
  1646. type="daterange"
  1647. :start-placeholder="$t('time.startDate')"
  1648. :end-placeholder="$t('time.endDate')"
  1649. @change="loadCheckInData"
  1650. ></el-date-picker>
  1651. </div>
  1652. </div>
  1653. <div v-if="active==1" style="padding:10px;">
  1654. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1655. style="width: 100%;margin-top:5px;" >
  1656. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1657. <template slot-scope="scope">
  1658. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1659. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1660. </template>
  1661. </el-table-column>
  1662. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1663. </el-table-column>
  1664. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1665. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1666. <template slot-scope="scope">
  1667. <div>
  1668. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1669. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1670. </div>
  1671. </template>
  1672. </el-table-column>
  1673. <el-table-column prop="departmentName" label="部门" >
  1674. <template slot-scope="scope">
  1675. <div>
  1676. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1677. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1678. </div>
  1679. </template>
  1680. </el-table-column>
  1681. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1682. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1683. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1684. <template slot-scope="scope">
  1685. {{scope.row.workHours.toFixed(1)}}h
  1686. </template>
  1687. </el-table-column>
  1688. </el-table>
  1689. </div>
  1690. <div v-if="active==2" >
  1691. <p style="display: flex;justify-content: center;height:390px;">
  1692. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1693. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1694. </el-upload>
  1695. </p>
  1696. </div>
  1697. <div slot="title">
  1698. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1699. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1700. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1701. <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>
  1702. <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>
  1703. <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>
  1704. </div>
  1705. <span slot="footer">
  1706. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1707. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1708. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1709. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1710. </span>
  1711. </el-dialog>
  1712. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1713. <p style="display: flex;justify-content: center;height:100px;">
  1714. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1715. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1716. </el-upload>
  1717. </p>
  1718. </el-dialog>
  1719. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1720. <div>
  1721. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1722. v-model="deleteReportParam.date" :editable="false"
  1723. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1724. :clearable="true"
  1725. :range-separator="$t('other.to')"
  1726. type="daterange"
  1727. :start-placeholder="$t('time.startDate')"
  1728. :end-placeholder="$t('time.endDate')"
  1729. ></el-date-picker>
  1730. </div>
  1731. <div style="margin-top:10px;">
  1732. <span>请选择部门:</span>
  1733. <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>
  1734. <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>
  1735. </div>
  1736. <div style="margin-top:10px;">
  1737. <span>请选择员工:</span>
  1738. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1739. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1740. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1741. <span v-else>{{item.name}}</span>
  1742. </el-option>
  1743. </el-select>
  1744. </div>
  1745. <span slot="footer">
  1746. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1747. </span>
  1748. </el-dialog>
  1749. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1750. <div>
  1751. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1752. v-model="deleteReportParam.date" :editable="false"
  1753. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1754. :clearable="true"
  1755. :range-separator="$t('other.to')"
  1756. type="daterange"
  1757. :start-placeholder="$t('time.startDate')"
  1758. :end-placeholder="$t('time.endDate')"
  1759. ></el-date-picker>
  1760. </div>
  1761. <div style="margin-top:15px;">
  1762. <span>选择部门:</span>
  1763. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1764. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1765. size="small" v-if="user.userNameNeedTranslate != 1"
  1766. ></el-cascader>
  1767. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1768. </div>
  1769. <span slot="footer">
  1770. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1771. </span>
  1772. </el-dialog>
  1773. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1774. <div>
  1775. <span>选择时间:</span><el-date-picker
  1776. v-model="modImportTime"
  1777. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1778. :clearable="true"
  1779. type="datetime"
  1780. ></el-date-picker>
  1781. <span>选择导入人员:</span><el-select
  1782. v-model="modImportUserId"
  1783. >
  1784. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1785. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1786. <span v-else>{{item.name}}</span>
  1787. </el-option>
  1788. </el-select>
  1789. </div>
  1790. <span slot="footer">
  1791. <el-button @click="confirmChangeModTime" >确认</el-button>
  1792. </span>
  1793. </el-dialog>
  1794. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1795. <div>
  1796. <span>请选择年月:</span>
  1797. <el-date-picker
  1798. v-model="ratioYmonth" :editable="false"
  1799. format="yyyyMM" value-format="yyyyMM"
  1800. type="month"
  1801. ></el-date-picker>
  1802. </div>
  1803. <span slot="footer">
  1804. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1805. </span>
  1806. </el-dialog>
  1807. <!--工时批量代填 -->
  1808. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1809. <div>
  1810. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1811. v-model="importWxParam.date" :editable="false"
  1812. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1813. :clearable="true"
  1814. :range-separator="$t('other.to')"
  1815. type="daterange"
  1816. :start-placeholder="$t('time.startDate')"
  1817. :end-placeholder="$t('time.endDate')"
  1818. @change="loadCheckInData"
  1819. ></el-date-picker>
  1820. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1821. </div>
  1822. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1823. :key="timeStamp"
  1824. style="width: 100%;margin-top:5px;" ref="tab">
  1825. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1826. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1827. <template slot-scope="scope">
  1828. <div>
  1829. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1830. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1831. </div>
  1832. </template>
  1833. </el-table-column>
  1834. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1835. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1836. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1837. <template slot-scope="scope">
  1838. {{scope.row.workHours.toFixed(1)}}h
  1839. </template>
  1840. </el-table-column>
  1841. <!--项目名称列表 -->
  1842. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1843. <template slot-scope="scope">
  1844. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1845. </template>
  1846. </el-table-column>
  1847. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1848. <template slot-scope="scope">
  1849. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1850. </template>
  1851. </el-table-column>
  1852. </el-table>
  1853. </el-dialog>
  1854. <!--基于企业微信考勤数据的工时导入 -->
  1855. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1856. <div style="padding-bottom:10px;">
  1857. <p>{{importResultMsg}}</p>
  1858. </div>
  1859. <!-- <span slot="footer" class="dialog-footer">
  1860. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1861. </span> -->
  1862. </el-dialog>
  1863. <!-- 审核流程展示 -->
  1864. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1865. <div style="padding:20px 40px 20px 0">
  1866. <el-timeline :reverse="false">
  1867. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1868. <!-- {{item.msg}} -->
  1869. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1870. <span v-if="user.userNameNeedTranslate == 1">
  1871. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1872. <span>{{item.msgCon.two}}</span>
  1873. </span>
  1874. </el-timeline-item>
  1875. </el-timeline>
  1876. </div>
  1877. </el-dialog>
  1878. </section>
  1879. </template>
  1880. <script>
  1881. // 左右滑动
  1882. import dragMixin from "@/common/js/tensile.js";
  1883. import util from "../../common/js/util";
  1884. // 自定义select组件
  1885. import selectCat from "@/components/select.vue"
  1886. // 引入自定义级联组件
  1887. import vueCascader from "@/components/cascader.vue"
  1888. // 重庆物奇定制组件
  1889. import WeeklyCustomization from "./weeklyCustomization.vue"
  1890. import { mapMutations } from 'vuex'
  1891. let _that = this
  1892. export default {
  1893. mixins: [dragMixin],
  1894. components: {
  1895. selectCat,
  1896. vueCascader,
  1897. WeeklyCustomization
  1898. },
  1899. data() {
  1900. return {
  1901. pageIndex: 0,
  1902. hasMore: true,
  1903. exportType: 0,
  1904. exportingData: false,
  1905. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1906. jobResponseList:[],
  1907. yisibeiCompId: 3092,
  1908. yuzhongCompId: 3385,
  1909. mingyiName : '成都明夷电子科技有限公司',
  1910. // mingyiName : '明夷',
  1911. modItemDataId: null,
  1912. modImportTime: null,
  1913. modImportUserId: null,
  1914. showModImportTimeDialog: false,
  1915. showBatchSimpleApproveReport: false,
  1916. startDeleting: false,
  1917. showBatchDeleteReport: false,
  1918. deleteReportParam: {date:null, userIds:[]},
  1919. isDenying: false,
  1920. targetWeekDate: null,//填写周报中的周日期
  1921. importCardTimeVisi: false,
  1922. startRatioExporting: false,
  1923. exportUserRatio: false,
  1924. ratioYmonth:null,
  1925. hasWrittenReport: false,
  1926. today:null,
  1927. syncTimeLoading: false,
  1928. seluserText: '',
  1929. translation: '1', // 1、文字, 2、部门, 3、人员
  1930. exportLoad: false,
  1931. getPickerOptions: {
  1932. disabledDate: (time) => {
  1933. var date = new Date();
  1934. var year = date.getFullYear();
  1935. var month = date.getMonth() + 1;
  1936. if (month >= 1 && month <= 9) {
  1937. month = "0" + month;
  1938. }
  1939. var currentdate = year.toString() + month.toString();
  1940. var timeyear = time.getFullYear();
  1941. var timemonth = time.getMonth() + 1;
  1942. if (timemonth >= 1 && timemonth <= 9) {
  1943. timemonth = "0" + timemonth;
  1944. }
  1945. var timedate = timeyear.toString() + timemonth.toString();
  1946. if(this.user.timeType.fillAhead == 0){
  1947. return currentdate < timedate;
  1948. }else{
  1949. return false
  1950. }
  1951. }
  1952. },
  1953. alalal: '8.0',
  1954. timeBasecostList:null,
  1955. tbload: false,
  1956. exportTimeDialog: false,
  1957. searchKeyword: '',
  1958. monthWorkDataS: [],
  1959. monthNotWorkDateS: [],
  1960. pickDateArray:[],
  1961. WorktimeDatepickValue: [],
  1962. activeName:"first",
  1963. isLeave: 0,
  1964. submitingReport: false,
  1965. importResultMsg:null,
  1966. showImportResult:false,
  1967. importingData: false,
  1968. isDraft: 0,
  1969. timeStamp: 0,
  1970. projectColumns:[],
  1971. checkinLoading:false,
  1972. importWxParam:{date:null,},
  1973. active:0,
  1974. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1975. importWxDialog:false,
  1976. importDialog:false,
  1977. denyForm:null,
  1978. denyReasonDialog:false,
  1979. monthWorkTimeDialog: false,
  1980. isSubstitude:false,
  1981. isFill:false,
  1982. unFillList:[],
  1983. fillList:[],
  1984. fillMembList:[],
  1985. fillMembList_leave: [],
  1986. membListVisible: false,
  1987. isBatch:0,//是否是批量填报
  1988. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1989. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1990. 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')],
  1991. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1992. fillStatusList: [],
  1993. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1994. exportDialog:false,
  1995. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1996. subProjectList:[],
  1997. canEdit: true,
  1998. originCanEdit: true,
  1999. 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],
  2000. selectTime:null,
  2001. reportTimeType:{},
  2002. curDate:'',
  2003. isAllSelect: false,
  2004. approveDialogVisible:false,
  2005. deptId:null,
  2006. targetUid: null,
  2007. membCount:0,
  2008. selectState:"-1",
  2009. user: JSON.parse(sessionStorage.getItem("user")),
  2010. allUsersList: [],
  2011. showAddMore:false,
  2012. allDate: [],
  2013. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2014. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2015. choseDay: 0,
  2016. tableHeight: 0,
  2017. listLoading: false,
  2018. projectList: [], //项目列表
  2019. fillProjectList: [],
  2020. reportList: [], //日报列表
  2021. reportNames:[], //批量审批列表
  2022. selCon:[], //筛选条件
  2023. selProjectList:[], //筛选后项目列表
  2024. selConShow: true,
  2025. usersList: [], // 全部人员列表
  2026. usersListId: '', // 选中的人员id
  2027. dialogVisible: false, //项目弹窗
  2028. report: '',
  2029. workForm: {
  2030. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2031. domains: [{
  2032. id: null,
  2033. projectId: "",
  2034. workingTime: "",
  2035. timeType:0,
  2036. content: "",
  2037. state: 2,
  2038. multiWorktime:0,
  2039. worktimeList:[],
  2040. degreeId: null,
  2041. auditUserList: [],
  2042. }],
  2043. },
  2044. workRules: {
  2045. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2046. },
  2047. chooseParticipVisible: false,
  2048. logining: false,
  2049. isDisable: false,
  2050. timeType:[],
  2051. deptMembData: [
  2052. ],
  2053. //部门人员树状结构
  2054. data: [
  2055. {
  2056. id: -1,
  2057. label: this.$t('lable.allStaff'),
  2058. membCount:0
  2059. },
  2060. {
  2061. id: 0,
  2062. label: this.$t('lable.unassigned'),
  2063. }
  2064. ],
  2065. allData:{},
  2066. batchShowData:{},
  2067. option: [],
  2068. deptOptionList: [],
  2069. depData: {
  2070. id: -1,
  2071. label: this.$t('lable.allStaff'),
  2072. },
  2073. defaultProps: {
  2074. children: 'children',
  2075. label: 'label'
  2076. },
  2077. isNew: false,
  2078. selected: false,
  2079. valuet: new Date(),
  2080. domObj: null,
  2081. participator:[],
  2082. chosenMembCount:0,
  2083. jsDay: 0,
  2084. jsTime: 0,
  2085. falsss: false,
  2086. weidu: [],
  2087. weiduList: [],
  2088. yonghuUser: [],
  2089. dateAr: [],
  2090. batchSubFillDialog: false,
  2091. isSubstiS: false,
  2092. fillWeekDialogVisi: false,
  2093. fillWeekDialogVisiCustom: false,
  2094. zhoData: [],
  2095. weekDateRange: [],
  2096. btnZho: false,
  2097. weekDataLoading: false,
  2098. changdu: 6,
  2099. tianxieDialogVisible: false,
  2100. scopess: {},
  2101. zhoBao: {
  2102. time: '',
  2103. workingTime: '',
  2104. progress: '',
  2105. con: '',
  2106. subProjectId: '',
  2107. stage: '',
  2108. subProjectList: [],
  2109. stages: [],
  2110. },
  2111. zhoBaoIdx: '',
  2112. zhoBaoName: '',
  2113. zhis: {},
  2114. dealList: [],
  2115. toViewDialogVisible: false,
  2116. toViewList: [],
  2117. toViewloading: true,
  2118. toViewForm: {
  2119. pageIndex: '1',
  2120. pageSize: '20',
  2121. total: 0,
  2122. },
  2123. toViewloadings: false,
  2124. tabPositionss: 'top',
  2125. monthTotal: 0,
  2126. monthTotalPage: 0,
  2127. monthTotalLages: 20,
  2128. monthWorkData: [],
  2129. monthNotWorkDate: [],
  2130. monthWorkDataS1: [],
  2131. monthnotTotal: 0,
  2132. monthnotTotalPage: 0,
  2133. monthnotTotalLages: 20,
  2134. monthNotWorkDateS1: [],
  2135. deptMembDataText: '',
  2136. isFlag: false,
  2137. isMore: false,
  2138. stateKey: '0',
  2139. expandDate: [],
  2140. notifySelList:[],
  2141. departmentList: [],
  2142. approvalProcessDialog: false,
  2143. approvalProcessData: [],
  2144. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2145. 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')],
  2146. isWeekend: false,
  2147. canCancelInDialog: false,
  2148. approveinData: {},
  2149. approveinDialog: false,
  2150. reportCanDelete: false,
  2151. weeklyFilledTimeDialog: false,
  2152. weeklyFilledTimeList: [],
  2153. weeklyFilledTimeLoading: false,
  2154. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2155. weeklyFilledTimeCanDelete: false,
  2156. weeklyFilledTimeDate: null,
  2157. leaveAllNum: 0,
  2158. dataLoading: false,
  2159. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2160. vacationTime: {},
  2161. integrationProjectList: [],
  2162. totalReportHours: 0, // 合计的工时
  2163. workTimeForMinYi:0,
  2164. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2165. weekIndex: 1,
  2166. weekParentData: {},
  2167. deptIdForNoReport:[],
  2168. nameAearch: '', // 企业微信姓名搜索
  2169. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2170. deptMembDataLoading: false,
  2171. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2172. {
  2173. id: 4811,
  2174. // id: 10,
  2175. name: '陕西柘中建设工程有限公司'
  2176. }
  2177. ],
  2178. pushWorkTimeLogDig:false,
  2179. pushWorkTimeLogData:[],
  2180. };
  2181. },
  2182. watch: {
  2183. deptMembDataText(val) {
  2184. this.$refs.chooseMembTree.filter(val);
  2185. }
  2186. },
  2187. filters: {
  2188. // 过滤
  2189. amounts(value) {
  2190. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2191. return 0
  2192. }
  2193. var zhi = +value + 0
  2194. return zhi.toFixed(1)
  2195. },
  2196. // zhoData
  2197. zhoData(value, arr) {
  2198. var dateArray = value.split("-");
  2199. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2200. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2201. // console.log(arr[date.getDay()])
  2202. // return "周" + "日一二三四五六".charAt(date.getDay());
  2203. return arr[date.getDay()]
  2204. },
  2205. // 过滤数字
  2206. numbers(value) {
  2207. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2208. return 0
  2209. }
  2210. return value
  2211. },
  2212. },
  2213. computed: {},
  2214. mounted() {
  2215. var now = new Date();
  2216. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2217. this.today = t;
  2218. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2219. this.exportParam.dateRange = [startStr,t];
  2220. this.getAllDate(1);
  2221. this.getReportList();
  2222. this.getProjectList();
  2223. this.getFillProjectList();
  2224. this.getTimeType();
  2225. this.getDepartment();
  2226. this.scrollFunction()
  2227. this.userssHu();
  2228. if(this.user.timeType.reportAuditType == 3){
  2229. this.getAllUsersList()
  2230. }
  2231. if (this.user.company.packageProject == 1) {
  2232. this.getBasecostItemList();
  2233. }
  2234. if(this.user.timeType.lockWorktime){
  2235. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2236. }
  2237. //设置了下限
  2238. if (this.user.timeType.minReportTime) {
  2239. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2240. }
  2241. const that = this
  2242. if(this.user.userNameNeedTranslate == 1) {
  2243. that.dataLoading = that.$store.state.dataLoading
  2244. this.upDataLoading()
  2245. setTimeout(()=>{
  2246. that.dataLoading = that.$store.state.dataLoading
  2247. }, 1000)
  2248. }
  2249. if (this.user.companyId == this.yuzhongCompId) {
  2250. this.getJobResponList();
  2251. }
  2252. },
  2253. methods: {
  2254. ...mapMutations(['upDataLoading']),
  2255. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2256. isCustomization(userInfo, permissionArray) {
  2257. const { companyId } = userInfo
  2258. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2259. return isReportPictureRequired
  2260. },
  2261. //任务被选中
  2262. onTaskSelected(domainItem) {
  2263. //取服务
  2264. if (domainItem.taskId) {
  2265. var that = this;
  2266. var param = {taskId:domainItem.taskId};
  2267. if (this.isSubstitude) {
  2268. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2269. param.userId = this.workForm.userId[0];
  2270. }
  2271. }
  2272. this.http.post('/task/getMyTaskService',param, res => {
  2273. if (res.code == "ok") {
  2274. // domainItem.workContentList = res.data;
  2275. that.$set(domainItem, 'sapServiceId', null);
  2276. that.$set(domainItem, 'serviceList', res.data);
  2277. } else {
  2278. this.$message({
  2279. message: res.msg,
  2280. type: "error"
  2281. });
  2282. }
  2283. },error => {
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. }
  2289. );
  2290. } else {
  2291. //清空服务
  2292. }
  2293. },
  2294. onBatchTimeChange() {
  2295. //反向计算每日工作时长
  2296. if (this.workForm.createDate) {
  2297. let sdate = new Date(this.workForm.createDate[0]);
  2298. let edate = new Date(this.workForm.createDate[1]);
  2299. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2300. console.log('days===', days)
  2301. if (days < 0) {
  2302. return;
  2303. }
  2304. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2305. //总时长发生改变,自动按比例计算
  2306. this.workForm.domains.forEach(d=>{
  2307. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2308. });
  2309. }
  2310. },
  2311. //更新工作内容列表
  2312. updateJobContent(domainItem) {
  2313. var that = this;
  2314. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2315. if (res.code == "ok") {
  2316. // domainItem.workContentList = res.data;
  2317. that.$set(domainItem, 'extraField3', null);
  2318. that.$set(domainItem, 'workContentList', res.data);
  2319. } else {
  2320. this.$message({
  2321. message: res.msg,
  2322. type: "error"
  2323. });
  2324. }
  2325. },error => {
  2326. this.$message({
  2327. message: error,
  2328. type: "error"
  2329. });
  2330. }
  2331. );
  2332. },
  2333. updateResponse(domainItem) {
  2334. var that = this;
  2335. var selectPid = domainItem.projectId;
  2336. domainItem.extraField2 = null;
  2337. domainItem.extraField3 = null;
  2338. if (selectPid && domainItem.extraField1) {
  2339. //是否非项目
  2340. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2341. console.log('==========','isPublic=='+isPublic);
  2342. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2343. console.log(filteredRespList);
  2344. domainItem.filteredRespList = filteredRespList;
  2345. }
  2346. },
  2347. getJobResponList() {
  2348. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2349. if (res.code == "ok") {
  2350. this.jobResponseList = res.data;
  2351. } else {
  2352. this.$message({
  2353. message: res.msg,
  2354. type: "error"
  2355. });
  2356. }
  2357. },error => {
  2358. this.$message({
  2359. message: error,
  2360. type: "error"
  2361. });
  2362. }
  2363. );
  2364. },
  2365. openModImportTime(row) {
  2366. this.showModImportTimeDialog = true;
  2367. this.modItemDataId = row.id;
  2368. },
  2369. delImportTime(row) {
  2370. let rowId = row.id;
  2371. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2372. confirmButtonText: this.$t('btn.determine'),
  2373. cancelButtonText: this.$t('btn.cancel'),
  2374. type: "warning"
  2375. })
  2376. .then(() => {
  2377. this.http.post('/report-import-log/delete',{
  2378. id: rowId
  2379. },res => {
  2380. if (res.code == "ok") {
  2381. this.$message({
  2382. message: '删除成功',
  2383. type: "success"
  2384. });
  2385. this.getToView();
  2386. } else {
  2387. this.$message({
  2388. message: res.msg,
  2389. type: "error"
  2390. });
  2391. }
  2392. },error => {
  2393. this.$message({
  2394. message: error,
  2395. type: "error"
  2396. });
  2397. }
  2398. );
  2399. }).catch(() => {this.startDeleting = false});
  2400. },
  2401. confirmChangeModTime() {
  2402. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2403. this.$message({
  2404. message: '请选择时间',
  2405. type: "error"
  2406. });
  2407. return;
  2408. }
  2409. this.http.post('/report-import-log/changeTime',{
  2410. modLogDateTime: this.modImportTime,
  2411. modImportUserId: this.modImportUserId,
  2412. id: this.modItemDataId
  2413. },res => {
  2414. if (res.code == "ok") {
  2415. this.$message({
  2416. message: '修改成功',
  2417. type: "success"
  2418. });
  2419. this.getToView();
  2420. this.showModImportTimeDialog = false;
  2421. } else {
  2422. this.$message({
  2423. message: res.msg,
  2424. type: "error"
  2425. });
  2426. }
  2427. },error => {
  2428. this.$message({
  2429. message: error,
  2430. type: "error"
  2431. });
  2432. }
  2433. );
  2434. },
  2435. confirmBatchApproveReport() {
  2436. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2437. this.$message({
  2438. message: '请选择日期范围',
  2439. type: "error"
  2440. });
  2441. return;
  2442. }
  2443. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2444. confirmButtonText: this.$t('btn.determine'),
  2445. cancelButtonText: this.$t('btn.cancel'),
  2446. type: "warning"
  2447. })
  2448. .then(() => {
  2449. this.startDeleting = true;
  2450. let obj = {
  2451. startDate: this.deleteReportParam.date[0],
  2452. endDate: this.deleteReportParam.date[1]
  2453. }
  2454. if(this.deleteReportParam.departmentId) {
  2455. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2456. } else {
  2457. obj.departmentId = null
  2458. }
  2459. this.http.post('/report/batchApproveByDate',obj,res => {
  2460. if (res.code == "ok") {
  2461. this.$message({
  2462. message: '审核通过',
  2463. type: "success"
  2464. });
  2465. this.getReportList();
  2466. this.getDepartment();
  2467. this.startDeleting = false;
  2468. } else {
  2469. this.$message({
  2470. message: res.msg,
  2471. type: "error"
  2472. });
  2473. }
  2474. },error => {
  2475. this.$message({
  2476. message: error,
  2477. type: "error"
  2478. });
  2479. }
  2480. );
  2481. }).catch(() => {this.startDeleting = false});
  2482. },
  2483. confirmBatchDelReport() {
  2484. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2485. this.$message({
  2486. message: '请选择部门或人员',
  2487. type: "error"
  2488. });
  2489. return;
  2490. }
  2491. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2492. this.$message({
  2493. message: '请选择日期范围',
  2494. type: "error"
  2495. });
  2496. return;
  2497. }
  2498. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2499. confirmButtonText: this.$t('btn.determine'),
  2500. cancelButtonText: this.$t('btn.cancel'),
  2501. type: "warning"
  2502. })
  2503. .then(() => {
  2504. this.startDeleting = true;
  2505. this.http.post('/report/batchDelete',{
  2506. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2507. startDate: this.deleteReportParam.date[0],
  2508. endDate: this.deleteReportParam.date[1],
  2509. deptId: this.deleteReportParam.deptId[0]
  2510. },res => {
  2511. if (res.code == "ok") {
  2512. this.$message({
  2513. message: this.$t('message.successfullyDeleted'),
  2514. type: "success"
  2515. });
  2516. this.getReportList();
  2517. this.getDepartment();
  2518. this.startDeleting = false;
  2519. } else {
  2520. this.$message({
  2521. message: res.msg,
  2522. type: "error"
  2523. });
  2524. }
  2525. },error => {
  2526. this.$message({
  2527. message: error,
  2528. type: "error"
  2529. });
  2530. }
  2531. );
  2532. }).catch(() => {this.startDeleting = false});
  2533. },
  2534. getRecentlyProject() {
  2535. this.http.post('/project/nearProject',{},res => {
  2536. if(res.code == 'ok'){
  2537. let topObj = {
  2538. label: '最近选择项目',
  2539. peojectList: res.data
  2540. }
  2541. let botomObj = {
  2542. label: '全部项目',
  2543. peojectList: this.fillProjectList
  2544. }
  2545. //最近项目如果在fillProjectList中不存在,需要移除
  2546. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2547. this.integrationProjectList = [topObj, botomObj]
  2548. }else {
  2549. this.$message({
  2550. message: res.msg,
  2551. type: 'error'
  2552. })
  2553. }
  2554. },err => {
  2555. this.$message({
  2556. message: err,
  2557. type: 'error'
  2558. })
  2559. })
  2560. },
  2561. handlePictureCardPreview(file, index) {
  2562. console.log(file, index)
  2563. let arr = []
  2564. let imgArr = this.workForm.domains[index].imgListUrl
  2565. for(var i in imgArr) {
  2566. arr.push(imgArr[i].url)
  2567. }
  2568. console.log(arr, '图片数据')
  2569. const $viewer = this.$viewerApi({
  2570. images: arr
  2571. });
  2572. },
  2573. // 图片上传
  2574. addImg(e, index) {
  2575. console.log(e, '数据')
  2576. let formData = new FormData()
  2577. formData.append('multipartFile', e.file)
  2578. this.http.uploadFile('/common/uploadFile', formData,
  2579. res => {
  2580. if (res.code == "ok") {
  2581. this.$message({
  2582. message: this.$t('uploadedsuccessfully'),
  2583. type: "success"
  2584. });
  2585. if(!this.workForm.domains[index].imgList) {
  2586. this.workForm.domains[index].imgList = []
  2587. this.workForm.domains[index].imgListUrl = []
  2588. }
  2589. this.workForm.domains[index].imgList.push(res.data)
  2590. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2591. } else {
  2592. this.$message({message: res.msg,type: "error"});
  2593. }
  2594. console.log(this.workForm.domains[index])
  2595. },
  2596. error => {this.$message({message: error,type: "error"});
  2597. });
  2598. },
  2599. // 删除图片
  2600. delImg(file,fileList, index) {
  2601. console.log(file, fileList)
  2602. let idx = 0
  2603. for(let i in fileList) {
  2604. if(fileList[i].uid == file.uid) {
  2605. idx = i
  2606. }
  2607. }
  2608. this.workForm.domains[index].imgList.splice(idx, 1)
  2609. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2610. console.log(this.workForm.domains[index])
  2611. },
  2612. test(){
  2613. console.log('test',this.workForm.domains);
  2614. },
  2615. getHour(s1, s2) {
  2616. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2617. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2618. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2619. var ms = s2.getTime() - s1.getTime();
  2620. if (ms < 0) return 0;
  2621. let ma = ms / 1000 / 60 / 60
  2622. return ma; //小时
  2623. },
  2624. refreshWXCardTime(workdate) {
  2625. if (!workdate) return;
  2626. this.syncTimeLoading = true;
  2627. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2628. date: workdate,
  2629. },res => {
  2630. this.syncTimeLoading = false;
  2631. if(res.code == 'ok'){
  2632. this.workForm.time = res.data.time;
  2633. }else {
  2634. this.$message({
  2635. message: res.msg,
  2636. type: 'error'
  2637. })
  2638. }
  2639. },err => {
  2640. this.syncTimeLoading = false;
  2641. this.$message({
  2642. message: err,
  2643. type: 'error'
  2644. })
  2645. })
  2646. },
  2647. refreshAttendance(workdate) {
  2648. if (!workdate) return;
  2649. this.syncTimeLoading = true;
  2650. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2651. startDate: workdate[0],
  2652. endDate: workdate[1]
  2653. },res => {
  2654. this.syncTimeLoading = false;
  2655. if(res.code == 'ok'){
  2656. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2657. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2658. this.totalReportHours = this.workTimeForMinYi;
  2659. }else {
  2660. this.$message({
  2661. message: res.msg,
  2662. type: 'error'
  2663. })
  2664. }
  2665. },err => {
  2666. this.syncTimeLoading = false;
  2667. this.$message({
  2668. message: err,
  2669. type: 'error'
  2670. })
  2671. })
  2672. },
  2673. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2674. this.weeklyFilledTimeDialog = true
  2675. this.weeklyFilledTimeLoading = true
  2676. this.weeklyFilledTimeDate = parameterDate
  2677. this.http.post('/report/getReportList',{
  2678. date: parameterDate,
  2679. userId: this.user.id
  2680. },res => {
  2681. this.weeklyFilledTimeLoading = false
  2682. if(res.code == 'ok'){
  2683. this.weeklyFilledTimeList = res.data[0].data
  2684. let candelete = true
  2685. for(let i in this.weeklyFilledTimeList){
  2686. if(this.weeklyFilledTimeList[i].state < 2){
  2687. candelete = false
  2688. }
  2689. }
  2690. this.weeklyFilledTimeCanDelete = candelete
  2691. }else {
  2692. this.$message({
  2693. message: res.msg,
  2694. type: 'error'
  2695. })
  2696. }
  2697. },err => {
  2698. this.weeklyFilledTimeLoading = false
  2699. this.$message({
  2700. message: err,
  2701. type: 'error'
  2702. })
  2703. })
  2704. },
  2705. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2706. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2707. confirmButtonText: this.$t('btn.determine'),
  2708. cancelButtonText: this.$t('btn.cancel'),
  2709. type: "warning"
  2710. })
  2711. .then(() => {
  2712. this.http.post('/report/delete',{
  2713. userId: this.user.id,
  2714. date: this.weeklyFilledTimeDate
  2715. },res => {
  2716. if (res.code == "ok") {
  2717. this.$message({
  2718. message: this.$t('message.successfullyDeleted'),
  2719. type: "success"
  2720. });
  2721. this.getWeeklyWorkTime()
  2722. this.getReportList();
  2723. this.getDepartment();
  2724. this.weeklyFilledTimeDialog = false;
  2725. } else {
  2726. this.$message({
  2727. message: res.msg,
  2728. type: "error"
  2729. });
  2730. }
  2731. },error => {
  2732. this.$message({
  2733. message: error,
  2734. type: "error"
  2735. });
  2736. }
  2737. );
  2738. }).catch(() => {});
  2739. },
  2740. getApprovalProcess(item){
  2741. // console.log('this.date',this.choseDate);
  2742. this.http.post('/report-log/get',{
  2743. creatorId: item.id,
  2744. createDate: sessionStorage.msg
  2745. },res => {
  2746. if(res.code == 'ok'){
  2747. this.approvalProcessDialog = true
  2748. if(this.user.userNameNeedTranslate == 1) {
  2749. for(var i in res.data) {
  2750. let obj = {
  2751. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2752. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2753. }
  2754. res.data[i].msgCon = obj
  2755. }
  2756. }
  2757. this.approvalProcessData = res.data
  2758. console.log(this.approvalProcessData, '数据卡看')
  2759. }else{
  2760. this.$message({
  2761. message: res.msg,
  2762. type: 'error'
  2763. })
  2764. }
  2765. },err => {
  2766. this.$message({
  2767. message: err,
  2768. type: 'error'
  2769. })
  2770. })
  2771. },
  2772. filterNode(value, data) {
  2773. if (!value) return true;
  2774. return data.label.indexOf(value) !== -1;
  2775. },
  2776. triggerCalculateOT(index) {
  2777. var str = this.workForm.domains[index].overtimeHours + ''
  2778. if(str.indexOf('.') != '-1') {
  2779. var s = str.split('.')[0]
  2780. var st = str.split('.')[1]
  2781. var sts = st.split('')
  2782. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2783. }
  2784. },
  2785. searchScreen(e){
  2786. if(e){
  2787. this.monthNotWorkDateS1 = []
  2788. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2789. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2790. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2791. }
  2792. }
  2793. if (this.monthNotWorkDateS1.length > 50) {
  2794. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2795. }else{
  2796. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2797. }
  2798. // if (this.monthNotWorkDateS1.length > 0) {
  2799. // setTimeout(() => {
  2800. // this.tableListenernot()
  2801. // }, 1000);
  2802. // }
  2803. }else{
  2804. this.monthWorkDataS1 = []
  2805. for (let i = 0; i < this.monthWorkData.length; i++) {
  2806. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2807. this.monthWorkDataS1.push(this.monthWorkData[i])
  2808. }
  2809. }
  2810. if (this.monthWorkDataS1.length > 50) {
  2811. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2812. }else{
  2813. this.monthWorkDataS = this.monthWorkDataS1
  2814. }
  2815. // if (this.monthWorkDataS1.length > 0) {
  2816. // setTimeout(() => {
  2817. // this.tableListener()
  2818. // }, 1000);
  2819. // }
  2820. }
  2821. },
  2822. addUpload(data) {
  2823. // var zhi = data.fileName.split('.')[0]
  2824. // var sss = zhi + '.xlsx'
  2825. // return
  2826. var filePath = '/upload/' + data.serverName;
  2827. const a = document.createElement('a'); // 创建a标签
  2828. a.setAttribute('download', data.fileName);// download属性
  2829. a.setAttribute('href', filePath);// href链接
  2830. a.click(); //自执行点击事件
  2831. a.remove();
  2832. },
  2833. restrictNumber(targetId) {
  2834. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2835. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2836. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2837. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2838. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2839. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2840. inpu.value = parseFloat(inpu.value);
  2841. }
  2842. },
  2843. //获取项目下的任务分组
  2844. getTaskGroups(domain, index) {
  2845. domain.groupId=null;
  2846. this.http.post('/task-group/listMyJoinGroup',{
  2847. projectId: domain.projectId,
  2848. isSubstitude: this.isSubstitude ? 1 : 0
  2849. },
  2850. res => {
  2851. if (res.code == "ok") {
  2852. this.workForm.domains[index].taskGroups = res.data;
  2853. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2854. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2855. // this.getGroupStages(domain, index);
  2856. // }
  2857. this.$forceUpdate();
  2858. }
  2859. },
  2860. error => {
  2861. this.$message({
  2862. message: error,
  2863. type: "error"
  2864. });
  2865. }
  2866. );
  2867. },
  2868. //下载填报工时占比报表
  2869. downloadProjectRatio() {
  2870. this.exportUserRatio = true;
  2871. // let now = new Date();
  2872. // let month = now.getMonth();//默认看上个月的
  2873. // let monthStr = month<10? ('0'+month): month;
  2874. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2875. const today = new Date();
  2876. const year = today.getFullYear();
  2877. const month = today.getMonth() + 1;
  2878. let lastMonthYear, lastMonth;
  2879. if (month === 1) {
  2880. lastMonthYear = year - 1;
  2881. lastMonth = 12;
  2882. } else {
  2883. lastMonthYear = year;
  2884. lastMonth = month - 1;
  2885. }
  2886. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2887. console.log('赋值 ==>', this.ratioYmonth)
  2888. },
  2889. confirmDownloadRatio() {
  2890. this.startRatioExporting = true;
  2891. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2892. ymonth: this.ratioYmonth
  2893. },
  2894. res => {
  2895. if (res.code == "ok") {
  2896. this.startRatioExporting = false;
  2897. var filePath = res.data;
  2898. const a = document.createElement('a'); // 创建a标签
  2899. var data = filePath.split("/");
  2900. a.setAttribute('download', data[data.length-1]);// download属性
  2901. a.setAttribute('href', filePath);// href链接
  2902. a.click(); //自执行点击事件
  2903. a.remove();
  2904. } else {
  2905. this.startRatioExporting = false;
  2906. this.$message({
  2907. message: res.msg,
  2908. type: "error"
  2909. });
  2910. }
  2911. },
  2912. error => {
  2913. this.checkinLoading = false;
  2914. this.$message({
  2915. message: error,
  2916. type: "error"
  2917. });
  2918. }
  2919. );
  2920. },
  2921. //下载带企业微信考勤数据的工时统计模板
  2922. downloadCheckInExcel() {
  2923. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2924. startDate: this.importWxParam.date[0],
  2925. endDate: this.importWxParam.date[1],
  2926. },
  2927. res => {
  2928. if (res.code == "ok") {
  2929. var filePath = res.data;
  2930. const a = document.createElement('a'); // 创建a标签
  2931. var data = filePath.split("/");
  2932. a.setAttribute('download', data[data.length-1]);// download属性
  2933. a.setAttribute('href', filePath);// href链接
  2934. a.click(); //自执行点击事件
  2935. a.remove();
  2936. } else {
  2937. this.$message({
  2938. message: res.msg,
  2939. type: "error"
  2940. });
  2941. }
  2942. },
  2943. error => {
  2944. this.checkinLoading = false;
  2945. this.$message({
  2946. message: error,
  2947. type: "error"
  2948. });
  2949. }
  2950. );
  2951. },
  2952. pre() {
  2953. if (this.active == 0) return;
  2954. this.active--;
  2955. },
  2956. next() {
  2957. this.active++;
  2958. },
  2959. triggerTotalTime(index) {
  2960. var item = this.checkinList[index];
  2961. var total = 0.0;
  2962. for (var i=0;i<this.projectColumns.length; i++) {
  2963. var key = this.projectColumns[i];
  2964. if (item[key] != null && item[key] != '') {
  2965. total += parseFloat(item[key]);
  2966. }
  2967. }
  2968. item.totalFillTime = total;
  2969. },
  2970. //提交批量代填的数据
  2971. submitBatchSubFillData() {
  2972. var data = JSON.stringify(this.checkinList);
  2973. this.http.post('/user-corpwx-time/submitProjectTime',{
  2974. json: data,
  2975. projectColumns: JSON.stringify(this.projectColumns)
  2976. },
  2977. res => {
  2978. if (res.code == "ok") {
  2979. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2980. this.importWxDialog = false;
  2981. }
  2982. },
  2983. error => {
  2984. this.checkinLoading = false;
  2985. this.$message({
  2986. message: error,
  2987. type: "error"
  2988. });
  2989. }
  2990. );
  2991. },
  2992. loadCheckInData() {
  2993. if (this.importWxParam.date == null) {
  2994. this.checkinList = [];
  2995. return;
  2996. }
  2997. this.checkinLoading = true;
  2998. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2999. startDate: this.importWxParam.date[0],
  3000. endDate: this.importWxParam.date[1],
  3001. },
  3002. res => {
  3003. if (res.code == "ok") {
  3004. this.checkinLoading = false;
  3005. this.checkinList = res.data.list;
  3006. this.projectColumns = res.data.projects;
  3007. // 自定义表格会导致表格错乱,需重新计算表格
  3008. this.$nextTick(()=>{
  3009. this.$refs.tab.doLayout()
  3010. })
  3011. }
  3012. },
  3013. error => {
  3014. this.checkinLoading = false;
  3015. this.$message({
  3016. message: error,
  3017. type: "error"
  3018. });
  3019. }
  3020. );
  3021. },
  3022. importCardTime(item) {
  3023. //首先判断文件类型
  3024. let str = item.file.name.split(".");
  3025. let format = str[str.length - 1];
  3026. if (format != "xls" && format != "xlsx") {
  3027. this.$message({
  3028. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3029. type: "error"
  3030. });
  3031. } else {
  3032. this.importingData = true;
  3033. let formData = new FormData();
  3034. formData.append("multipartFile", item.file);
  3035. formData.append("companyId", this.user.companyId);
  3036. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3037. res => {
  3038. this.$refs.uploadCardTime.clearFiles();
  3039. this.importingData = false;
  3040. if (res.code == "ok") {
  3041. //换成弹出框,以免有人等了半天回来啥也没看到
  3042. this.$message({
  3043. message: '导入考勤时长成功',
  3044. type: "success"
  3045. });
  3046. } else {
  3047. this.$message({
  3048. message: res.msg,
  3049. type: "error"
  3050. });
  3051. }
  3052. },
  3053. error => {
  3054. this.$refs.upload.clearFiles();
  3055. this.listLoading = false;
  3056. this.$message({
  3057. message: error,
  3058. type: "error"
  3059. });
  3060. });
  3061. }
  3062. },
  3063. batchImportWxData(item) {
  3064. //首先判断文件类型
  3065. let str = item.file.name.split(".");
  3066. let format = str[str.length - 1];
  3067. if (format != "xls" && format != "xlsx") {
  3068. this.$message({
  3069. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3070. type: "error"
  3071. });
  3072. } else {
  3073. this.importingData = true;
  3074. let formData = new FormData();
  3075. formData.append("file", item.file);
  3076. formData.append("companyId", this.user.companyId);
  3077. formData.append("withCheckIn", 1);
  3078. this.http.uploadFile('/report/importData', formData,
  3079. res => {
  3080. this.$refs.upload.clearFiles();
  3081. this.showImportResult = true;
  3082. this.importingData = false;
  3083. if (res.code == "ok") {
  3084. //换成弹出框,以免有人等了半天回来啥也没看到
  3085. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3086. this.getReportList();
  3087. this.importWxDialog = false;
  3088. } else {
  3089. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3090. }
  3091. },
  3092. error => {
  3093. this.$refs.upload.clearFiles();
  3094. this.listLoading = false;
  3095. this.$message({
  3096. message: error,
  3097. type: "error"
  3098. });
  3099. });
  3100. }
  3101. },
  3102. batchImportData(item) {
  3103. //首先判断文件类型
  3104. let str = item.file.name.split(".");
  3105. let format = str[str.length - 1];
  3106. if (format != "xls" && format != "xlsx") {
  3107. this.$message({
  3108. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3109. type: "error"
  3110. });
  3111. } else {
  3112. this.importingData = true;
  3113. let formData = new FormData();
  3114. formData.append("file", item.file);
  3115. formData.append("companyId", this.user.companyId);
  3116. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3117. this.http.uploadFile(url, formData,
  3118. res => {
  3119. this.$refs.upload.clearFiles();
  3120. this.importingData = false;
  3121. this.showImportResult = true;
  3122. if (res.code == "ok") {
  3123. //换成弹出框,以免有人等了半天回来啥也没看到
  3124. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3125. this.getReportList();
  3126. this.importWXDialog = false;
  3127. } else {
  3128. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3129. }
  3130. },
  3131. error => {
  3132. this.$refs.upload.clearFiles();
  3133. this.importingData = false;
  3134. this.$message({
  3135. message: error,
  3136. type: "error"
  3137. });
  3138. });
  3139. }
  3140. },
  3141. userssHu() {
  3142. this.http.post('/time-type/getCompanyTimeSetting',{
  3143. companyId: this.user.companyId
  3144. },
  3145. res => {
  3146. if (res.code == "ok") {
  3147. this.yonghuUser = res.data
  3148. }
  3149. },
  3150. error => {
  3151. this.$message({
  3152. message: error,
  3153. type: "error"
  3154. });
  3155. }
  3156. );
  3157. },
  3158. iptBlur(i) {
  3159. if(this.isBatch == 0) {
  3160. return
  3161. }
  3162. var reqParam = {
  3163. startDate: this.workForm.createDate[0],
  3164. endDate: this.workForm.createDate[1]
  3165. };
  3166. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3167. reqParam.userId = this.workForm.userId[0];
  3168. }
  3169. this.http.post('/report/getWorkDays',reqParam,
  3170. res => {
  3171. if (res.code == "ok") {
  3172. this.jsDay = res.data
  3173. this.chuji(i)
  3174. } else {
  3175. this.$message({
  3176. message: res.msg,
  3177. type: "error"
  3178. });
  3179. }
  3180. },
  3181. error => {
  3182. this.$message({
  3183. message: error,
  3184. type: "error"
  3185. });
  3186. }
  3187. );
  3188. //明夷硬编码获取
  3189. if (this.user.company.companyName == this.mingyiName) {
  3190. this.getWorkTimeForMinYi();
  3191. }
  3192. },
  3193. getWorkTimeForMinYi(){
  3194. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3195. startDate: this.workForm.createDate[0],
  3196. endDate: this.workForm.createDate[1]
  3197. },
  3198. res => {
  3199. if (res.code == "ok") {
  3200. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3201. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3202. this.totalReportHours = this.workTimeForMinYi;
  3203. } else {
  3204. this.$message({
  3205. message: res.msg,
  3206. type: "error"
  3207. });
  3208. this.workForm.createDate = [];
  3209. }
  3210. },
  3211. error => {
  3212. this.$message({
  3213. message: error,
  3214. type: "error"
  3215. });
  3216. }
  3217. );
  3218. },
  3219. chuji(i) {
  3220. if(i == 0) {
  3221. this.seleChn(1)
  3222. } else if(i == 1) {
  3223. this.seleChn(0)
  3224. } else if(i == 2) {
  3225. if(this.workForm.domains[0].multiWorktime > 0) {
  3226. this.iptChangs()
  3227. } else {
  3228. this.iptChang()
  3229. }
  3230. } else if(i == 3) {
  3231. this.seleChn(0)
  3232. }
  3233. },
  3234. seleChn(e,domain) {
  3235. if(e == 1) {
  3236. for(var i in this.workForm.domains) {
  3237. if(this.workForm.domains[i].timeType == 0) {
  3238. this.workForm.domains[i].workingTime = 8
  3239. } else {
  3240. this.workForm.domains[i].workingTime = 4
  3241. }
  3242. }
  3243. }
  3244. var quanbu = 0
  3245. var spl = this.workForm.domains
  3246. var zhi = ''
  3247. for(var i in spl) {
  3248. var sp = +spl[i].workingTime + 0
  3249. zhi = this.jsDay * sp
  3250. quanbu = +quanbu + zhi
  3251. }
  3252. this.jsTime = quanbu
  3253. this.totalReportHours = quanbu
  3254. let worktime = this.jsTime
  3255. // 自动计算加班时长
  3256. if(this.isBatch != 0){
  3257. worktime = this.jsTime / this.jsDay
  3258. }
  3259. if(this.user.timeType.fillOvertime && domain){
  3260. let isover = false
  3261. let alltime = 0
  3262. let allover = 0 //此处alltime同上面的worktime
  3263. for(let d in spl){
  3264. if(spl[d].isOvertime){
  3265. isover = true
  3266. allover += spl[d].overtimeHours*1
  3267. }
  3268. alltime += spl[d].workingTime*1
  3269. }
  3270. if(domain.overtimeHours){
  3271. allover = allover - domain.overtimeHours
  3272. }
  3273. if(worktime*1 > this.user.timeType.allday){
  3274. if(isover){
  3275. if(alltime > (allover + this.user.timeType.allday)){
  3276. this.$set(domain,'isOvertime',true)
  3277. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3278. }else{
  3279. this.$set(domain,'isOvertime',false)
  3280. this.$set(domain,'overtimeHours',null)
  3281. if(alltime < (allover + this.user.timeType.allday)){
  3282. let overtime = allover + this.user.timeType.allday - alltime
  3283. for(let pi in spl){
  3284. if(spl[pi].overtimeHours){
  3285. if((overtime - spl[pi].overtimeHours*1) > 0){
  3286. overtime = overtime - spl[pi].overtimeHours*1
  3287. this.$set(spl[pi],'isOvertime',false)
  3288. this.$set(spl[pi],'overtimeHours',null)
  3289. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3290. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3291. break
  3292. }else{
  3293. this.$set(spl[pi],'isOvertime',false)
  3294. this.$set(spl[pi],'overtimeHours',null)
  3295. break
  3296. }
  3297. }
  3298. }
  3299. }
  3300. }
  3301. }else{
  3302. this.$set(domain,'isOvertime',true)
  3303. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3304. }
  3305. }else{
  3306. for(let di in spl){
  3307. this.$set(spl[di],'isOvertime',false)
  3308. this.$set(spl[di],'overtimeHours',null)
  3309. }
  3310. }
  3311. }
  3312. },
  3313. iptChang() {
  3314. var sl = this.workForm.domains
  3315. let timeArr = []
  3316. for(var i in sl) {
  3317. if(sl[i].startTime && sl[i].endTime) {
  3318. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3319. }
  3320. }
  3321. this.getTimeHours(timeArr)
  3322. // for(let j in arrNum) {
  3323. // this.timeJsonStr += arrNum[j]
  3324. // if(flg) {
  3325. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3326. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3327. // }
  3328. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3329. // flg = true
  3330. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3331. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3332. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3333. // }
  3334. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3335. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3336. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3337. // }
  3338. // }
  3339. },
  3340. iptChangs() {
  3341. var sl = this.workForm.domains
  3342. let timeArr = []
  3343. for(var i in sl) {
  3344. for(var j in sl[i].worktimeList){
  3345. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3346. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3347. }
  3348. }
  3349. }
  3350. this.getTimeHours(timeArr)
  3351. },
  3352. // 调用接口或去数据
  3353. getTimeHours(arr) {
  3354. this.http.post('/report/getHoursByTimeRange',{
  3355. timeJsonStr: JSON.stringify(arr)
  3356. },res => {
  3357. if(res.code === 'ok') {
  3358. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3359. } else {
  3360. this.$message({
  3361. message: res.msg,
  3362. type: 'error'
  3363. })
  3364. }
  3365. },err => {
  3366. this.$message({
  3367. message: err,
  3368. type: 'error'
  3369. })
  3370. })
  3371. },
  3372. // 按周填报调用接口计算时间
  3373. async getWeekHoursByTimeRange(timeRange) {
  3374. const url = '/report/getHoursByTimeRange';
  3375. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3376. var that = this;
  3377. return new Promise((resolve, reject) => {
  3378. this.http.post(url, data, function(res) {
  3379. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3380. }, function(err) {
  3381. reject(err);
  3382. });
  3383. });
  3384. },
  3385. removeTimeItem(item, index) {
  3386. item.worktimeList.splice(index, 1);
  3387. this.iptChangs()
  3388. },
  3389. //添加工时
  3390. addNewWorktime(index, item) {
  3391. if(item.worktimeList == null ) {
  3392. item.worktimeList = []
  3393. }
  3394. item.worktimeList.push({});
  3395. },
  3396. //复制项目
  3397. copyProject(index) {
  3398. var leftProgress = 10;
  3399. if (this.reportTimeType.type == 3) {
  3400. //计算已经待分配工时比例
  3401. let array = this.workForm.domains;
  3402. let totalProgress = 0;
  3403. for (var i=0;i<array.length; i++) {
  3404. totalProgress += array[i].progress;
  3405. }
  3406. if (totalProgress < 100) {
  3407. leftProgress = 100 - totalProgress;
  3408. }
  3409. }
  3410. var newIndex = index+1;
  3411. var itemDomain = {
  3412. projectId: this.workForm.domains[index].projectId,
  3413. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3414. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3415. ),
  3416. content: "",
  3417. progress:leftProgress,
  3418. state:2,//2-表示待提交
  3419. };
  3420. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3421. if (this.reportTimeType.type == 0) {
  3422. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3423. var length = this.workForm.domains.length;
  3424. if (length == 2) {
  3425. this.showAddMore = false;
  3426. }
  3427. }
  3428. this.selectProject(itemDomain, newIndex);
  3429. },
  3430. pushWorkTime(reportId){
  3431. let url=''
  3432. if(this.user.timeType.syncSap == 1){
  3433. url='/report/pushProjectReportToSap'
  3434. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3435. var pushDate = this.date + day;
  3436. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3437. confirmButtonText: '确定',
  3438. cancelButtonText: '取消',
  3439. type: 'info'
  3440. }).then(() => {
  3441. const loading = this.$loading({
  3442. lock: true,
  3443. text: '正在推送中,请耐心等待。',
  3444. spinner: 'el-icon-loading',
  3445. background: 'rgba(0, 0, 0, 0.7)'
  3446. });
  3447. this.http.post(url,{
  3448. pushDate: pushDate,
  3449. reportId: reportId
  3450. },res => {
  3451. loading.close();
  3452. if(res.code == 'ok'){
  3453. this.$message({
  3454. type: 'success',
  3455. message: res.data
  3456. });
  3457. }else{
  3458. this.$message({
  3459. type: 'error',
  3460. message: res.msg
  3461. })
  3462. }
  3463. },err => {
  3464. loading.close();
  3465. this.$message({
  3466. type: 'error',
  3467. message: err
  3468. })
  3469. })
  3470. }).catch(() => {
  3471. });
  3472. }else{
  3473. url='/report/pushReportDataToThird'
  3474. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3475. confirmButtonText: '确定',
  3476. cancelButtonText: '取消',
  3477. type: 'info'
  3478. }).then(() => {
  3479. const loading = this.$loading({
  3480. lock: true,
  3481. text: '正在推送中,请耐心等待。',
  3482. spinner: 'el-icon-loading',
  3483. background: 'rgba(0, 0, 0, 0.7)'
  3484. });
  3485. this.http.post(url,{
  3486. yearMonth: this.date
  3487. },res => {
  3488. loading.close();
  3489. if(res.code == 'ok'){
  3490. this.$message({
  3491. type: 'success',
  3492. message: '推送成功!'
  3493. });
  3494. }else{
  3495. this.$message({
  3496. type: 'error',
  3497. message: res.msg
  3498. })
  3499. }
  3500. },err => {
  3501. loading.close();
  3502. this.$message({
  3503. type: 'error',
  3504. message: err
  3505. })
  3506. })
  3507. }).catch(() => {
  3508. });
  3509. }
  3510. },
  3511. showWorkTime(){
  3512. this.monthWorkTimeDialog = true;
  3513. this.searchKeyword = ''
  3514. this.WorktimeDatepickValue = this.istoMonth()
  3515. if(this.WorktimeDatepickValue.length == 0){
  3516. let newdate = new Date();
  3517. let nowdate = newdate.toLocaleDateString();
  3518. let getauto = this.getAutoWeekDate(nowdate)
  3519. let nowwd = [getauto[0],getauto[6]]
  3520. this.WorktimeDatepickValue = nowwd
  3521. }
  3522. this.showMonthWorkTime()
  3523. },
  3524. handleClick(t,e){
  3525. if (t.name == "first") {
  3526. this.showMonthWorkTime()
  3527. }else{
  3528. this.showMonthNotWorkTime()
  3529. }
  3530. },
  3531. //导出员工每日填报工时数
  3532. exportMembWorkHours() {
  3533. this.http.post(
  3534. "/report/exportUserDailyWorkTime",
  3535. {
  3536. // month: this.date,
  3537. startDate: this.WorktimeDatepickValue[0],
  3538. endDate: this.WorktimeDatepickValue[1],
  3539. },
  3540. (res) => {
  3541. if (res.code == "ok") {
  3542. let url = res.data;
  3543. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3544. }
  3545. },
  3546. (error) => {
  3547. this.$message({
  3548. message: error,
  3549. type: "error",
  3550. });
  3551. }
  3552. );
  3553. },
  3554. exportMembNotWorkHours() {
  3555. this.http.post(
  3556. "/report/exportNoReportUserList",
  3557. {
  3558. // month: this.date,
  3559. startDate: this.WorktimeDatepickValue[0],
  3560. endDate: this.WorktimeDatepickValue[1],
  3561. },
  3562. (res) => {
  3563. if (res.code == "ok") {
  3564. let url = res.data;
  3565. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3566. }
  3567. },
  3568. (error) => {
  3569. this.$message({
  3570. message: error,
  3571. type: "error",
  3572. });
  3573. }
  3574. );
  3575. },
  3576. downloadByA(name, url) {
  3577. const a = document.createElement("a"); // 创建a标签
  3578. a.setAttribute("download", name); // download属性
  3579. a.setAttribute("href", url); // href链接
  3580. a.click(); // 自执行点击事件
  3581. a.remove();
  3582. },
  3583. // 是否本月判断
  3584. istoMonth(){
  3585. let todate = new Date()
  3586. let tomonth = todate.getMonth() + 1
  3587. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3588. if(this.date == adate){
  3589. return []
  3590. }else{
  3591. let sedate = new Date(this.date)
  3592. let semonth = sedate.getMonth() + 1
  3593. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3594. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3595. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3596. return [sedates1, sedates2]
  3597. }
  3598. },
  3599. showMonthWorkTime() {
  3600. this.monthTotalPage = 0,
  3601. this.tbload = true
  3602. this.http.post(
  3603. "/report/getUserDailyWorkTime",
  3604. // "/report/getNoReportUserList",
  3605. {
  3606. // month: this.date,
  3607. startDate: this.WorktimeDatepickValue[0],
  3608. endDate: this.WorktimeDatepickValue[1],
  3609. },
  3610. (res) => {
  3611. if (res.code == "ok") {
  3612. this.tbload = false;
  3613. this.pickDateArray = res.data.days;
  3614. // console.log('dataarray',res.data.days);
  3615. this.monthWorkData = res.data.list;
  3616. // this.monthWorkDataS = this.monthWorkData
  3617. // this.monthWorkDataS1 = res.data.list
  3618. this.monthTotal = res.data.list.length
  3619. if (this.monthWorkData.length > 50) {
  3620. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3621. }else{
  3622. this.monthWorkDataS = this.monthWorkData
  3623. }
  3624. this.searchScreen(0)
  3625. // this.monthWorkDataS = infoList
  3626. // 判断
  3627. // if (this.monthWorkDataS1.length > 0) {
  3628. // setTimeout(() => {
  3629. // this.tableListener()
  3630. // }, 1000);
  3631. // }
  3632. this.$nextTick(function(){
  3633. this.$refs.hasworkTbl.doLayout();
  3634. });
  3635. // this.$forceUpdate()
  3636. }
  3637. },
  3638. (error) => {
  3639. this.tbload = false
  3640. this.$message({
  3641. message: error,
  3642. type: "error",
  3643. });
  3644. }
  3645. );
  3646. },
  3647. // tableListener(){
  3648. // let that = this;
  3649. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3650. // // 添加scroll监听事件
  3651. // dom.addEventListener("scroll", function () {
  3652. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3653. // if (scrollDistance < 2) {
  3654. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3655. // that.monthTotalPage++; //当前页数自增
  3656. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3657. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3658. // var infoList = arrList.splice(
  3659. // that.monthTotalPage * that.monthTotalLages,
  3660. // that.monthTotalLages
  3661. // );
  3662. // // 数据添加
  3663. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3664. // }
  3665. // }
  3666. // })
  3667. // },
  3668. showMonthNotWorkTime() {
  3669. this.monthTotalPage = 0,
  3670. this.tbload = true,
  3671. this.http.post(
  3672. "/report/getNoReportUserList",
  3673. {
  3674. startDate: this.WorktimeDatepickValue[0],
  3675. endDate: this.WorktimeDatepickValue[1],
  3676. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3677. },
  3678. (res) => {
  3679. if (res.code == "ok") {
  3680. this.tbload = false
  3681. this.monthNotWorkDate = res.data;
  3682. // this.monthNotWorkDateS1 = res.data
  3683. this.monthnotTotal = res.data.length
  3684. // 2222111
  3685. if (this.monthNotWorkDate.length > 50) {
  3686. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3687. } else {
  3688. this.monthNotWorkDateS = this.monthNotWorkDate
  3689. }
  3690. this.searchScreen(1)
  3691. // 判断
  3692. // if (this.monthnotworkDateS1.length > 0) {
  3693. // setTimeout(() => {
  3694. // this.tableListenernot()
  3695. // }, 1000);
  3696. // }
  3697. this.$nextTick(function(){
  3698. this.$refs.hasworkTbl2.doLayout();
  3699. });
  3700. }
  3701. },
  3702. (error) => {
  3703. this.tbload = false
  3704. this.$message({
  3705. message: error,
  3706. type: "error",
  3707. });
  3708. }
  3709. );
  3710. },
  3711. // tableListenernot(){
  3712. // let that = this;
  3713. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3714. // dom.addEventListener("scroll", function () {
  3715. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3716. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3717. // if (scrollDistance2 < 2) {
  3718. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3719. // that.monthnotTotalPage++; //当前页数自增
  3720. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3721. // var infoList = arrList.splice(
  3722. // that.monthnotTotalPage * that.monthnotTotalLages,
  3723. // that.monthnotTotalLages
  3724. // );
  3725. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3726. // }
  3727. // }
  3728. // })
  3729. // },
  3730. listScroll(){
  3731. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3732. this.isMore = true
  3733. setTimeout(()=>{
  3734. this.isMore = false
  3735. },1000)
  3736. }else {
  3737. this.isFlag = true
  3738. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3739. this.monthWorkDataS = datalist
  3740. setTimeout(()=>{
  3741. this.isFlag = false
  3742. },300)
  3743. }
  3744. },
  3745. notListScroll(){
  3746. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3747. this.isMore = true
  3748. setTimeout(()=>{
  3749. this.isMore = false
  3750. },1000)
  3751. }else {
  3752. this.isFlag = true
  3753. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3754. this.monthNotWorkDateS = datalist
  3755. // console.log('length',this.monthNotWorkDateS.length)
  3756. setTimeout(()=>{
  3757. this.isFlag = false
  3758. },300)
  3759. }
  3760. },
  3761. // 获取默认这zhou日期参数 222
  3762. getLastWeek(e){
  3763. let newdate = new Date()
  3764. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3765. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3766. if(e){
  3767. this.WorktimeDatepickValue = lastwd
  3768. this.showMonthWorkTime()
  3769. }else{
  3770. this.WorktimeDatepickValue = lastwd
  3771. this.showMonthNotWorkTime()
  3772. }
  3773. },
  3774. getThisWeek(e){
  3775. let newdate = new Date();
  3776. let nowdate = newdate.toLocaleDateString();
  3777. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3778. if(e){
  3779. this.WorktimeDatepickValue = nowwd
  3780. this.showMonthWorkTime()
  3781. }else{
  3782. this.WorktimeDatepickValue = nowwd
  3783. this.showMonthNotWorkTime()
  3784. }
  3785. },
  3786. getDoubleLastWeek(e){
  3787. let newdate = new Date()
  3788. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3789. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3790. if(e){
  3791. this.WorktimeDatepickValue = nextwd
  3792. this.showMonthWorkTime()
  3793. }else{
  3794. this.WorktimeDatepickValue = nextwd
  3795. this.showMonthNotWorkTime()
  3796. }
  3797. },
  3798. alreadyAllDate(stime,etime){
  3799. let diffdate = new Array();
  3800. let i=0;
  3801. while(stime<=etime){
  3802. let dateArray = stime.split("-");
  3803. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3804. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3805. let stimewk = this.weekDay[date.getDay()]
  3806. 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')
  3807. 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])
  3808. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3809. let stime_ts = new Date(stime).getTime();
  3810. let next_date = stime_ts + (24*60*60*1000);
  3811. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3812. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3813. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3814. stime = next_dates_y+next_dates_m+next_dates_d;
  3815. i++;
  3816. }
  3817. return diffdate
  3818. },
  3819. getAutoWeekDate(e) {
  3820. let dateString = e;
  3821. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3822. if (dateString.match(dateStringReg)) {
  3823. let presentDate = new Date(dateString),
  3824. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3825. return Array.from(new Array(7), function (val, index) {
  3826. let formatDate = new Date(
  3827. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3828. );
  3829. return (
  3830. formatDate.getFullYear() +
  3831. "-" +
  3832. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3833. "-" +
  3834. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3835. );
  3836. });
  3837. } else {
  3838. throw new Error(
  3839. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3840. );
  3841. }
  3842. },
  3843. onProgressChange() {
  3844. this.$forceUpdate();
  3845. },
  3846. showChooseMembTree() {
  3847. this.chosenMembCount = this.participator.length;
  3848. this.chooseParticipVisible = true;
  3849. },
  3850. onTreeItemChange() {
  3851. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3852. var list = chosenList.filter(item=>item.isUser == 1);
  3853. this.chosenMembCount = list.length;
  3854. },
  3855. findUserInTree() {
  3856. if (this.filterName == '') {
  3857. this.deptMembData = this.allMembData;
  3858. } else {
  3859. var list = this.findRecursively(this.filterName, this.allMembData);
  3860. this.deptMembData = list;
  3861. }
  3862. },
  3863. findRecursively(username, list) {
  3864. var filterList = [];
  3865. for (var i=0;i<list.length; i++) {
  3866. if (list[i].isUser == 1) {
  3867. if (list[i].label.indexOf(username) >= 0) {
  3868. //匹配上了
  3869. filterList.push(list[i]);
  3870. }
  3871. } else if (list[i].children != null && list[i].children.length > 0) {
  3872. var subList = this.findRecursively(username, list[i].children);
  3873. if (subList.length > 0) {
  3874. subList.forEach(s=>filterList.push(s));
  3875. }
  3876. }
  3877. }
  3878. return filterList;
  3879. },
  3880. //确定选择参与人
  3881. chooseParticip() {
  3882. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3883. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3884. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3885. if (this.user.company.packageProject == 1) {
  3886. if (this.chosenMembList.length > 1) {
  3887. this.$message({
  3888. message: '每次仅支持代填一个人',
  3889. type: "error",
  3890. });
  3891. return;
  3892. }
  3893. }
  3894. this.chooseParticipVisible = false;
  3895. this.workForm.userNames = '';
  3896. this.workForm.userId = [];
  3897. this.participator = [];
  3898. for (var i=0;i<this.chosenMembList.length; i++) {
  3899. this.workForm.userId.push(this.chosenMembList[i].id);
  3900. this.workForm.userNames += this.chosenMembList[i].label+',';
  3901. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3902. this.participator.push(item);
  3903. }
  3904. if (this.workForm.userNames.length > 0) {
  3905. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3906. }
  3907. if(this.user.userNameNeedTranslate == 1) {
  3908. if(this.workForm.userNames) {
  3909. this.workForm.userNames = this.workForm.userNames.split(',')
  3910. }
  3911. }
  3912. },
  3913. notifySel(sel){
  3914. // console.log(sel);
  3915. this.notifySelList = sel
  3916. },
  3917. //微信通知人员填写
  3918. Notify(code) {
  3919. if (this.notifySelList.length == 0) return;
  3920. var ids = '';
  3921. this.notifySelList.forEach(f=>{
  3922. ids += f.id+',';
  3923. })
  3924. this.http.post('/user/pushFillReport',{
  3925. ids: ids, date: this.curDate,
  3926. code: code
  3927. },
  3928. res => {
  3929. if (res.code == "ok") {
  3930. this.$message({
  3931. message: this.$t('message.sentSuccessfully'),
  3932. type: "success"
  3933. });
  3934. }
  3935. },
  3936. error => {
  3937. this.$message({
  3938. message: error,
  3939. type: "error"
  3940. });
  3941. }
  3942. );
  3943. },
  3944. //导出人员列表
  3945. exportMemb() {
  3946. if (this.fillMembList.length == 0) return;
  3947. var ids = '';
  3948. this.fillMembList.forEach(f=>{
  3949. ids += f.id+',';
  3950. })
  3951. this.http.post('/user/exportMembList',{
  3952. ids: ids,isFill: this.isFill, date: this.curDate
  3953. },
  3954. res => {
  3955. if (res.code == "ok") {
  3956. var aTag = document.createElement('a');
  3957. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3958. aTag.href = res.data;
  3959. aTag.click();
  3960. }
  3961. },
  3962. error => {
  3963. this.$message({
  3964. message: error,
  3965. type: "error"
  3966. });
  3967. }
  3968. );
  3969. },
  3970. showMembList(fill) {
  3971. this.membListVisible = true;
  3972. if (fill == 0) {
  3973. this.fillMembList = this.unFillList;
  3974. this.isFill = false;
  3975. let leaveList = []
  3976. let unleaveList = []
  3977. for(let i in this.fillMembList){
  3978. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3979. leaveList.push(this.fillMembList[i])
  3980. }else{
  3981. unleaveList.push(this.fillMembList[i])
  3982. }
  3983. }
  3984. this.fillMembList = unleaveList
  3985. this.fillMembList_leave = leaveList
  3986. } else if(fill == 1){
  3987. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3988. this.isFill = true;
  3989. }else{
  3990. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3991. this.isFill = true;
  3992. }
  3993. },
  3994. //获取自己填写的日报状态
  3995. getReportFillStatus() {
  3996. this.http.post('/report/getReportFillStatus',{
  3997. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3998. },
  3999. res => {
  4000. if (res.code == "ok") {
  4001. this.fillStatusList = res.data;
  4002. this.allDate.forEach(d=>{
  4003. var fillInfo = null;
  4004. d.state = null;
  4005. this.fillStatusList.forEach(s=>{
  4006. // console.log(d)
  4007. var d1 = s.createDate.split('-')[2];
  4008. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4009. // console.log(d2, '我被执行了')
  4010. if (d1.indexOf('0') == 0) {
  4011. d1 = d1.substring(1,d1.length);
  4012. }
  4013. if (d1 == d2) {
  4014. d.state = s.state;
  4015. }
  4016. })
  4017. })
  4018. this.$forceUpdate();
  4019. }
  4020. },
  4021. error => {
  4022. this.$message({
  4023. message: error,
  4024. type: "error"
  4025. });
  4026. }
  4027. );
  4028. },
  4029. scrollFunction () {
  4030. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4031. if (this.domObj.attachEvent) { // IE
  4032. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4033. } else if (this.domObj.addEventListener) {
  4034. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4035. }
  4036. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4037. },
  4038. mouseScroll(event) { // google 浏览器下
  4039. let detail = event.wheelDelta || event.detail
  4040. let moveForwardStep = -1
  4041. let moveBackStep = 1
  4042. let step = 0
  4043. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4044. event.preventDefault() // 阻止浏览器默认事件
  4045. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4046. },
  4047. // //左右滚动
  4048. // wheel(e){
  4049. // var a = document.getElementById("dateScroll");
  4050. // var scroll_width = 80; //滚动一下的距离
  4051. // var e = e || window.event, v;
  4052. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4053. // if(v>3||-v>3) v=-v;
  4054. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4055. // e.preventDefault(); //阻止浏览器的默认滚动
  4056. // },
  4057. showExportDialog() {
  4058. this.exportType = 0
  4059. this.exportDialog = true;
  4060. },
  4061. showExportTimeDialog() {
  4062. this.exportTimeDialog = true;
  4063. },
  4064. changeAllTime() {
  4065. //总时长发生改变,自动按比例计算
  4066. this.workForm.domains.forEach(d=>{
  4067. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4068. });
  4069. //计算jsTime
  4070. if (this.workForm.createDate) {
  4071. let sdate = new Date(this.workForm.createDate[0]);
  4072. let edate = new Date(this.workForm.createDate[1]);
  4073. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4074. console.log('days===', days)
  4075. if (days < 0) {
  4076. days = 0;
  4077. }
  4078. this.jsTime = this.reportTimeType.allday * days;
  4079. }
  4080. },
  4081. // 是否加班的单机事件
  4082. check() {
  4083. this.selected = !this.selected
  4084. this.isNew = this.selected
  4085. },
  4086. updateSubProject() {
  4087. this.$forceUpdate();
  4088. },
  4089. selectDegreeId(domain, index) {
  4090. this.http.post('/report/defaultDegree',{
  4091. projectId: domain.projectId
  4092. },
  4093. res => {
  4094. if (res.code == "ok") {
  4095. if(res.data) {
  4096. this.workForm.domains[index].degreeId = res.data.id + ''
  4097. this.$forceUpdate();
  4098. }
  4099. }
  4100. },
  4101. error => {
  4102. this.$message({
  4103. message: error,
  4104. type: "error"
  4105. });
  4106. }
  4107. );
  4108. },
  4109. //项目选中了, 加载子项目
  4110. selectProject(domain, index) {
  4111. if(!domain.projectId){
  4112. return;
  4113. }
  4114. // 默认选中上次填写的自定义维度
  4115. if(this.yonghuUser.customDegreeActive == 1) {
  4116. this.selectDegreeId(domain, index)
  4117. }
  4118. // console.log('projectId===',domain.projectId);
  4119. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4120. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4121. this.http.post('/sub-project/list',{
  4122. projectId: domain.projectId,
  4123. isReport: true
  4124. },
  4125. res => {
  4126. //清空之前选中的子项目
  4127. // this.workForm.domains[index].subProjectId = 0;
  4128. if (res.code == "ok") {
  4129. this.workForm.domains[index].subProjectList = res.data;
  4130. this.workForm.domains[index].subProjectId = null;
  4131. this.$forceUpdate();
  4132. }
  4133. },
  4134. error => {
  4135. this.$message({
  4136. message: error,
  4137. type: "error"
  4138. });
  4139. }
  4140. );
  4141. //项目相关的近期任务
  4142. if (this.user.company.packageProject == 1) {
  4143. this.getRecentTaskList(domain, index);
  4144. //获取项目相关专业
  4145. if (this.user.company.packageEngineering == 1) {
  4146. this.getProjectProfessions(domain, index);
  4147. }
  4148. //获取项目下的任务分组
  4149. this.getTaskGroups(domain, index);
  4150. }
  4151. // 获取项目相关的维度
  4152. // domain.degreeId = null
  4153. this.$set(domain,'degreeId',null)
  4154. this.$set(domain,'multiDegrIdArray',null)
  4155. this.dimension(domain, index);
  4156. //获取项目审核人
  4157. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4158. this.getProjectAuditorList(domain, index);
  4159. } else {
  4160. //按分组的负责人来审核
  4161. domain.projectAuditorId = null;
  4162. domain.projectAuditorName = null;
  4163. domain.auditUserList = null;
  4164. }
  4165. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4166. if (this.reportTimeType.type == 3) {
  4167. //新增项目时,自动计算
  4168. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4169. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4170. }
  4171. //加载昱众的工作职责
  4172. if (this.user.companyId == this.yuzhongCompId) {
  4173. this.updateResponse(domain);
  4174. }
  4175. },
  4176. getRecentTaskList(domain, index) {
  4177. //刷新任务时,清空服务
  4178. this.$set(domain, 'sapServiceId', null);
  4179. this.$set(domain, 'taskId', null);
  4180. var param = {
  4181. projectId: domain.projectId,
  4182. isSubstitude:this.isSubstitude?1:0,
  4183. };
  4184. if (domain.groupId) {
  4185. param.groupId = domain.groupId;
  4186. }
  4187. if (domain.stage) {
  4188. param.stage = domain.stage;
  4189. }
  4190. //专业版代填,获取代填员工的任务
  4191. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4192. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4193. this.$message({
  4194. message: '请选择代填的员工',
  4195. type: "error"
  4196. });
  4197. return;
  4198. } else {
  4199. param.userId = this.workForm.userId[0];
  4200. }
  4201. }
  4202. this.http.post('/task/getRecentTask',param,
  4203. res => {
  4204. if (res.code == "ok") {
  4205. this.workForm.domains[index].allTaskList = res.data;
  4206. this.workForm.domains[index].taskList = res.data;
  4207. this.$forceUpdate();
  4208. }
  4209. },
  4210. error => {
  4211. this.$message({
  4212. message: error,
  4213. type: "error"
  4214. });
  4215. }
  4216. );
  4217. },
  4218. //获取项目审核人
  4219. getProjectAuditorList(domainItem, index) {
  4220. if(domainItem.projectId == '') {
  4221. return
  4222. }
  4223. domainItem.projectAuditorId = null;
  4224. domainItem.projectAuditorName = null;
  4225. this.http.post('/project-auditor/getList',{
  4226. projectId: domainItem.projectId,
  4227. },
  4228. res => {
  4229. if (res.code == "ok") {
  4230. domainItem.auditUserList = res.data;
  4231. if (res.data.length==0) {
  4232. this.$message({
  4233. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4234. type: "error"
  4235. });
  4236. } else if (res.data.length==1) {
  4237. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4238. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4239. }
  4240. this.$forceUpdate();
  4241. }
  4242. },
  4243. error => {
  4244. this.$message({
  4245. message: error,
  4246. type: "error"
  4247. });
  4248. }
  4249. );
  4250. },
  4251. // 获取维度数据
  4252. dimension(domain, index) {
  4253. if(domain.projectId == '') {
  4254. return
  4255. }
  4256. this.http.post('/project/getDegreeList',{
  4257. projectId: domain.projectId,
  4258. },
  4259. res => {
  4260. if (res.code == "ok") {
  4261. // console.log("维度数据",res.data);
  4262. this.workForm.domains[index].wuduList = res.data
  4263. // this.workForm = this.workForm
  4264. this.$forceUpdate()
  4265. }
  4266. },
  4267. error => {
  4268. this.$message({
  4269. message: error,
  4270. type: "error"
  4271. });
  4272. }
  4273. );
  4274. },
  4275. //切换任务阶段
  4276. changeStages(domain, index) {
  4277. if (domain.stage == null || domain.stage == '') {
  4278. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4279. } else {
  4280. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4281. }
  4282. this.getRecentTaskList(domain, index);
  4283. this.$forceUpdate();
  4284. },
  4285. getGroupStages(domain, index, keepStage) {
  4286. // console.log(domain);
  4287. if(!domain.groupId){
  4288. domain.projectAuditorId = ''
  4289. domain.stages = []
  4290. if(this.user.timeType.reportAuditType >= 1){
  4291. domain.auditUserList = []
  4292. }
  4293. this.$forceUpdate();
  4294. return
  4295. }
  4296. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4297. res => {
  4298. if (res.code == "ok") {
  4299. if (!keepStage) {
  4300. domain.stage = '';
  4301. }
  4302. domain.stages = res.data;
  4303. this.getRecentTaskList(domain, index);
  4304. this.$forceUpdate();
  4305. }
  4306. },
  4307. error => {
  4308. this.$message({
  4309. message: error,
  4310. type: "error"
  4311. });
  4312. });
  4313. //检查当前的项目是否需要获取分组的负责人
  4314. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4315. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4316. res => {
  4317. if (res.code == "ok") {
  4318. domain.getProjectAuditorList = res.data;
  4319. domain.auditUserList = res.data;
  4320. if (res.data.length==1) {
  4321. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4322. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4323. } else if (res.data.length==0) {
  4324. domain.projectAuditorId = null;
  4325. domain.projectAuditorName = null;
  4326. }
  4327. this.$forceUpdate();
  4328. }
  4329. },
  4330. error => {
  4331. this.$message({
  4332. message: error,
  4333. type: "error"
  4334. });
  4335. });
  4336. }
  4337. },
  4338. getProjectProfessions(domain, index) {
  4339. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4340. res => {
  4341. if (res.code == "ok") {
  4342. this.workForm.domains[index].professionProgress = res.data;
  4343. this.$forceUpdate();
  4344. }
  4345. },
  4346. error => {
  4347. this.$message({
  4348. message: error,
  4349. type: "error"
  4350. });
  4351. });
  4352. },
  4353. //删除自己的日报
  4354. deleteReport() {
  4355. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4356. confirmButtonText: this.$t('btn.determine'),
  4357. cancelButtonText: this.$t('btn.cancel'),
  4358. type: "warning"
  4359. })
  4360. .then(() => {
  4361. this.listLoading = true;
  4362. this.http.post('/report/delete',{
  4363. userId: this.user.id,
  4364. date: this.workForm.createDate
  4365. },
  4366. res => {
  4367. this.listLoading = false;
  4368. if (res.code == "ok") {
  4369. this.$message({
  4370. message: this.$t('message.successfullyDeleted'),
  4371. type: "success"
  4372. });
  4373. this.getReportList();
  4374. this.getDepartment();
  4375. this.dialogVisible = false;
  4376. } else {
  4377. this.$message({
  4378. message: res.msg,
  4379. type: "error"
  4380. });
  4381. }
  4382. },
  4383. error => {
  4384. this.listLoading = false;
  4385. this.$message({
  4386. message: error,
  4387. type: "error"
  4388. });
  4389. }
  4390. );
  4391. })
  4392. .catch(() => {});
  4393. },
  4394. // 管理员删除日报
  4395. guanli(item) {
  4396. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4397. let param = {date: this.date + day, userId: item.id};
  4398. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4399. confirmButtonText: this.$t('btn.determine'),
  4400. cancelButtonText: this.$t('btn.cancel'),
  4401. type: "warning"
  4402. })
  4403. .then(() => {
  4404. this.listLoading = true;
  4405. this.http.post('/report/delete',param,
  4406. res => {
  4407. this.listLoading = false;
  4408. if (res.code == "ok") {
  4409. this.$message({
  4410. message: this.$t('message.successfullyDeleted'),
  4411. type: "success"
  4412. });
  4413. this.getReportList();
  4414. this.getDepartment();
  4415. this.dialogVisible = false;
  4416. } else {
  4417. this.$message({
  4418. message: res.msg,
  4419. type: "error"
  4420. });
  4421. }
  4422. },
  4423. error => {
  4424. this.listLoading = false;
  4425. this.$message({
  4426. message: error,
  4427. type: "error"
  4428. });
  4429. }
  4430. );
  4431. })
  4432. .catch(() => {});
  4433. },
  4434. selectAll() {
  4435. if (this.isAllSelect) {
  4436. var keys = [];
  4437. this.reportNames.forEach(b=>{
  4438. keys.push(b.id);
  4439. })
  4440. this.$refs.approveTree.setCheckedKeys(keys);
  4441. } else {
  4442. this.$refs.approveTree.setCheckedKeys([]);
  4443. }
  4444. },
  4445. removeEmptyNode(list) {
  4446. for (var i=0;i<list.length;i++) {
  4447. var cnt = 0;
  4448. if (list[i].membCount == 0) {
  4449. list.splice(i, 1);
  4450. i--;
  4451. } else if (list[i].children != null) {
  4452. this.removeEmptyNode(list[i].children);
  4453. }
  4454. }
  4455. },
  4456. calculateMembCount(list) {
  4457. for (var i in list) {
  4458. var cnt = 0;
  4459. if (list[i].children != null) {
  4460. this.calculateMembCount(list[i].children);
  4461. for (var m in list[i].children) {
  4462. cnt += list[i].children[m].membCount;
  4463. }
  4464. }
  4465. if (list[i].isUser == 1) {
  4466. cnt++;
  4467. this.membCount++;
  4468. }
  4469. list[i].membCount = cnt;
  4470. }
  4471. },
  4472. stateChange() {
  4473. // console.log(this.allData,'alldate');
  4474. this.membCount = 0;
  4475. if (this.selectState == -1) {
  4476. //全部状态
  4477. this.data = this.allData;
  4478. } else {
  4479. //未填报
  4480. this.seluserText = ''
  4481. var newData = JSON.parse(JSON.stringify(this.allData));
  4482. this.filterState(this.selectState, newData);
  4483. this.data = newData;
  4484. }
  4485. this.calculateMembCount(this.data);
  4486. this.data[0].membCount = this.membCount;//总人数
  4487. },
  4488. //按状态过滤部门人员
  4489. filterState(state, list) {
  4490. for (var i =0;i<list.length; i++) {
  4491. var obj = list[i];
  4492. if (obj.isUser == 1) {
  4493. var match = false;
  4494. if (state == -2) {
  4495. if (obj.state == null) {
  4496. match = true;
  4497. }
  4498. } else {
  4499. if (obj.state == state) {
  4500. match = true;
  4501. }
  4502. }
  4503. if (!match) {
  4504. list.splice(i, 1);
  4505. i--;
  4506. } else {
  4507. }
  4508. } else {
  4509. if (obj.children != null) {
  4510. this.filterState(state, obj.children);
  4511. }
  4512. }
  4513. }
  4514. },
  4515. //a按名称过滤部门人员
  4516. async seluserforText(){
  4517. const { userNameNeedTranslate } = this.user
  4518. this.membCount = 0;
  4519. var newData = JSON.parse(JSON.stringify(this.allData));
  4520. let textList = [this.seluserText]
  4521. if(userNameNeedTranslate == 1) {
  4522. this.dataLoading = true
  4523. let res = await this.postData('/user/getEmployeeList', {
  4524. keyword: this.seluserText,
  4525. cursor: '',
  4526. departmentId: -1,
  4527. pageIndex: 1,
  4528. pageSize: 1000
  4529. })
  4530. textList = res.data.records.map(item => item.name)
  4531. this.dataLoading = false
  4532. }
  4533. // return
  4534. console.log(textList, '<=== textList')
  4535. this.seluserforTextin(this.seluserText, newData, textList)
  4536. console.log(newData, 'Data')
  4537. this.data = newData;
  4538. this.calculateMembCount(this.data);
  4539. this.data[0].membCount = this.membCount;//总人数
  4540. },
  4541. seluserforTextin(text, list, textList = []){
  4542. for (var i =0;i<list.length; i++) {
  4543. var obj = list[i];
  4544. if (obj.isUser == 1) {
  4545. var match = false;
  4546. // if (obj.label.indexOf(text) != -1) {
  4547. // match = true
  4548. // }
  4549. if(textList.some(item => item.includes(obj.label))) {
  4550. match = true
  4551. }
  4552. if (!match) {
  4553. list.splice(i, 1);
  4554. i--;
  4555. } else {
  4556. }
  4557. } else {
  4558. if (obj.children != null) {
  4559. this.seluserforTextin(text, obj.children, textList);
  4560. }
  4561. }
  4562. }
  4563. },
  4564. // 当节点发生变化时
  4565. nodeChangeExpand(data) {
  4566. // 保存当前展开的节点
  4567. let flag = false
  4568. this.nodeModelData.some(item => {
  4569. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4570. flag = true
  4571. return true
  4572. }
  4573. })
  4574. if (!flag) { // 不存在则存到数组里
  4575. this.nodeModelData.push(data.id)
  4576. }
  4577. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4578. },
  4579. nodeChangeCollapse(data) {
  4580. console.log(this.nodeModelData)
  4581. this.nodeModelData.some((item, i) => {
  4582. if (item === data.id) {
  4583. this.nodeModelData.length = i
  4584. }
  4585. })
  4586. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4587. },
  4588. // 部门列表点击
  4589. handleNodeClick(data) {
  4590. // this.dealList = data
  4591. this.theValues(data.id, this.allData)
  4592. // this.depData = data;
  4593. var list = [];
  4594. if (data.id == -1) {
  4595. this.deptId = null;
  4596. this.targetUid = null;
  4597. list = this.data;
  4598. } else if (data.isUser == 1) {
  4599. this.deptId = null;
  4600. this.targetUid = data.id;
  4601. } else {
  4602. this.deptId = data.id;
  4603. this.targetUid = null;
  4604. list.push(data);
  4605. }
  4606. this.getReportList();
  4607. if (list.length > 0) {
  4608. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4609. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4610. }
  4611. },
  4612. exportPushLog(){
  4613. this.http.post('/sap-sync-log/export',{},
  4614. res => {
  4615. if (res.code == "ok") {
  4616. var filePath = res.data;
  4617. var fName = '推送日志.xlsx'
  4618. const a = document.createElement('a'); // 创建a标签
  4619. a.setAttribute('download', fName);// download属性
  4620. a.setAttribute('href', filePath);// href链接
  4621. a.click(); //自执行点击事件
  4622. a.remove();
  4623. } else {
  4624. this.$message({
  4625. message: res.msg,
  4626. type: "error"
  4627. });
  4628. }
  4629. },
  4630. error => {
  4631. this.$message({
  4632. message: error,
  4633. type: "error"
  4634. });
  4635. });
  4636. },
  4637. theValues(id, item) {
  4638. for(var i in item) {
  4639. if(item[i].id == id) {
  4640. this.depData = item[i]
  4641. if(id == '-1') {
  4642. this.translation = '1'
  4643. } else {
  4644. if(item[i].children) {
  4645. this.translation = '2'
  4646. } else {
  4647. this.translation = '3'
  4648. }
  4649. }
  4650. return
  4651. } else {
  4652. if(item[i].children) {
  4653. this.theValues(id, item[i].children)
  4654. }
  4655. }
  4656. }
  4657. },
  4658. //获取可以选择的代填的人员列表
  4659. getSubstitudeUserDeptList() {
  4660. if (this.deptMembData.length == 0) {
  4661. this.http.post("/department/listMyMembs", {},
  4662. res => {
  4663. if (res.code == "ok") {
  4664. let noAllData = JSON.parse(JSON.stringify(res.data));
  4665. if (noAllData.length > 0) {
  4666. // if (noAllData[0].label == '全部人员') {
  4667. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4668. noAllData.splice(0,1);
  4669. }
  4670. }
  4671. this.setUserToDept(noAllData);
  4672. this.deptMembData = noAllData;
  4673. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4674. console.log(this.deptMembData, '代填人员数据')
  4675. } else {
  4676. this.$message({
  4677. message: res.msg,
  4678. type: "error"
  4679. });
  4680. }
  4681. },
  4682. error => {
  4683. this.$message({
  4684. message: error,
  4685. type: "error"
  4686. });
  4687. });
  4688. }
  4689. },
  4690. // 获取部门列表
  4691. getDepartmentForApprove() {
  4692. this.http.post( this.port.manage.depList, {},
  4693. res => {
  4694. if (res.code == "ok") {
  4695. var list1 = JSON.parse(JSON.stringify(res.data));
  4696. this.deptOptionList = this.changeArr(list1);
  4697. console.log(this.deptOptionList, '部门')
  4698. } else {
  4699. this.$message({
  4700. message: res.msg,
  4701. type: "error"
  4702. });
  4703. }
  4704. },
  4705. error => {
  4706. this.$message({
  4707. message: error,
  4708. type: "error"
  4709. });
  4710. });
  4711. },
  4712. // 获取部门列表
  4713. getDepartment() {
  4714. //如果没有权限,就不需要获取
  4715. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4716. return;
  4717. }
  4718. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4719. var param = {date:this.date + day};
  4720. this.http.post("/report/getMembList", param,
  4721. res => {
  4722. if (res.code == "ok") {
  4723. if(res.data.length == 0){
  4724. return
  4725. }
  4726. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4727. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4728. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4729. // if (this.user.role > 0) {
  4730. // }
  4731. list.splice(0,0,{
  4732. id: -1,
  4733. label: this.$t('lable.allStaff'),
  4734. })
  4735. this.membCount = 0;
  4736. //设置员工到部门下面
  4737. this.setUserToDept(list);
  4738. this.data = list;
  4739. // console.log('data',this.data);
  4740. this.expandDate = [this.data[1].id]
  4741. this.allData = list;
  4742. // if (noAllData.length > 0) {
  4743. // if (noAllData[0].label == '全部人员') {
  4744. // noAllData.splice(0,1);
  4745. // }
  4746. // }
  4747. // this.setUserToDept(noAllData);
  4748. // this.deptMembData = noAllData;
  4749. this.option = this.changeArr(list1);
  4750. list[0].membCount = this.membCount;
  4751. if (this.depData.id == -1) {
  4752. this.depData.membCount = this.membCount;
  4753. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4754. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4755. } else {
  4756. if (this.depData.isUser == null) {
  4757. var dep = this.findTargetDept(this.data, this.depData.id);
  4758. var membDeptList = [];
  4759. membDeptList.push(dep);
  4760. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4761. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4762. }
  4763. }
  4764. if (this.depData.isUser == null) {
  4765. if (this.isFill) {
  4766. this.fillMembList = this.fillList;
  4767. } else {
  4768. this.fillMembList = this.unFillList;
  4769. }
  4770. }
  4771. this.leaveAllNum = 0
  4772. for(let i in this.unFillList){
  4773. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4774. this.leaveAllNum += 1
  4775. }
  4776. }
  4777. this.stateChange()
  4778. } else {
  4779. this.$message({
  4780. message: res.msg,
  4781. type: "error"
  4782. });
  4783. }
  4784. },
  4785. error => {
  4786. this.$message({
  4787. message: error,
  4788. type: "error"
  4789. });
  4790. });
  4791. this.getReportFillStatus();
  4792. },
  4793. findTargetDept(list, deptId) {
  4794. var t = null;
  4795. for (var i=0;i<list.length; i++) {
  4796. if (list[i].isUser == null && list[i].id == deptId) {
  4797. t = list[i];
  4798. break;
  4799. }
  4800. }
  4801. if (t == null) {
  4802. for (var i=0;i<list.length; i++) {
  4803. if (list[i].children != null && list[i].children.length > 0) {
  4804. t = this.findTargetDept(list[i].children, deptId);
  4805. if (t != null) {
  4806. break;
  4807. }
  4808. }
  4809. }
  4810. }
  4811. return t;
  4812. },
  4813. getUserMembListFromDeptList(list, isFill) {
  4814. var membList = [];
  4815. for (var i in list) {
  4816. var deptName = list[i].label;
  4817. if (list[i].userList != null) {
  4818. list[i].userList.forEach(element => {
  4819. if (isFill == 0) {
  4820. //获取未填的
  4821. if (element.state == null) {
  4822. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4823. membList.push(obj);
  4824. }
  4825. } else {
  4826. if (element.state != null) {
  4827. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4828. membList.push(obj);
  4829. }
  4830. }
  4831. });
  4832. }
  4833. if (list[i].children != null) {
  4834. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4835. }
  4836. }
  4837. return membList;
  4838. },
  4839. setUserToDept(list) {
  4840. for (var i in list) {
  4841. var cnt = 0;
  4842. if (list[i].children != null) {
  4843. this.setUserToDept(list[i].children);
  4844. for (var m in list[i].children) {
  4845. cnt += list[i].children[m].membCount;
  4846. }
  4847. }
  4848. if (list[i].userList != null) {
  4849. if (list[i].children == null) {
  4850. list[i].children = [];
  4851. }
  4852. list[i].userList.forEach(element => {
  4853. var obj = {
  4854. id: element.id,
  4855. label:element.name,
  4856. state:element.state,
  4857. parentId:element.departmentId,
  4858. isUser:1,
  4859. workingTime: element.workingTime,
  4860. leaveDays: element.leaveDays,
  4861. leaveTimes: element.leaveTimes
  4862. };
  4863. list[i].children.push(obj);
  4864. this.membCount++;
  4865. cnt++;
  4866. });
  4867. }
  4868. list[i].membCount = cnt;
  4869. }
  4870. },
  4871. // 修改数组
  4872. changeArr(arr) {
  4873. for (var i = 0; i < arr.length; i++) {
  4874. if(arr[i].id != -1 && arr[i].id != 0) {
  4875. if (arr[i].children != null && arr[i].children.length>0) {
  4876. arr[i].children = this.changeArr(arr[i].children);
  4877. }
  4878. arr[i].id && (arr[i].value = arr[i].id);
  4879. delete arr[i].id;
  4880. }
  4881. }
  4882. for(var i in arr) {
  4883. if(arr[i].id == -1 || arr[i].id == 0) {
  4884. arr.splice(i,1)
  4885. }
  4886. }
  4887. return arr;
  4888. },
  4889. //时间段范围设置改动,监听
  4890. onTimeTypeChange(timeType) {
  4891. this.seleChn(1)
  4892. this.showAddMore = true;
  4893. for(var i in this.workForm.domains) {
  4894. if (this.workForm.domains[i].timeType == 0) {
  4895. this.showAddMore = false;
  4896. break;
  4897. }
  4898. }
  4899. if (this.showAddMore) {
  4900. //检测数量
  4901. if (this.workForm.domains.length == 2) {
  4902. this.showAddMore = false;
  4903. } else {
  4904. this.showAddMore = true;
  4905. }
  4906. }
  4907. },
  4908. getTimeType() {
  4909. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4910. res => {
  4911. if (res.code == "ok") {
  4912. var t = res.data;
  4913. this.reportTimeType = t;
  4914. if (this.reportTimeType.type > 0) {
  4915. this.showAddMore = true;
  4916. }
  4917. //转化时间格式
  4918. if (t.allday != null) {
  4919. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4920. }
  4921. if (t.am != null) {
  4922. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4923. }
  4924. if (t.pm != null) {
  4925. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4926. }
  4927. let arr = []
  4928. for(var i in res.data.excludeTimeList) {
  4929. let obj = {
  4930. s: res.data.excludeTimeList[i].startTime,
  4931. e: res.data.excludeTimeList[i].endTime,
  4932. }
  4933. arr.push(obj)
  4934. }
  4935. this.vacationTime = arr
  4936. } else {
  4937. this.$message({
  4938. message: res.msg,
  4939. type: "error"
  4940. });
  4941. }
  4942. },
  4943. error => {
  4944. this.listLoading = false;
  4945. this.$message({
  4946. message: error,
  4947. type: "error"
  4948. });
  4949. });
  4950. },
  4951. // 改变月份 -------
  4952. changeMonthOut() {
  4953. this.getAllDate();
  4954. this.getReportList();
  4955. this.getDepartment();
  4956. },
  4957. // 选择日期
  4958. choseDate(i, item) {
  4959. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4960. return
  4961. }
  4962. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4963. this.choseDay = i;
  4964. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4965. sessionStorage.msg = this.date + day,
  4966. this.getReportList();
  4967. this.getDepartment();
  4968. this.curDate = item.date;
  4969. },
  4970. canClick(i, item){
  4971. let nowDate = new Date()
  4972. let nowDateYear = nowDate.getFullYear()
  4973. let itemYear = parseInt(this.date.split('-')[0])
  4974. let nowDateMonth = nowDate.getMonth() + 1
  4975. let itemMonth = parseInt(this.date.split('-')[1])
  4976. let nowDateDay = nowDate.getDate()
  4977. let itemDay = parseInt(item.showDate.split('.')[1])
  4978. if(nowDateYear < itemYear){
  4979. return false
  4980. }else if(nowDateYear == itemYear){
  4981. if(nowDateMonth < itemMonth){
  4982. return false
  4983. }else if(nowDateMonth == itemMonth){
  4984. if(nowDateDay < itemDay){
  4985. return false
  4986. }
  4987. }
  4988. }
  4989. },
  4990. // 获取日期列表
  4991. getAllDate(e) {
  4992. var dayArry = [];
  4993. var day = this.getCountDays();
  4994. let curMonthDay = null;
  4995. for (var k = 1; k <= day; k++) {
  4996. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4997. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4998. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4999. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5000. if(sessionStorage.msg) {
  5001. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5002. this.choseDay = k - 1;
  5003. curMonthDay = str;
  5004. }
  5005. } else {
  5006. if (new Date().getDate() == k) {
  5007. this.choseDay = k - 1;
  5008. }
  5009. }
  5010. } else {
  5011. this.choseDay = 0;
  5012. }
  5013. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5014. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5015. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5016. }
  5017. this.allDate = dayArry;
  5018. //不能超过最大日期
  5019. if (this.choseDay > day-1) {
  5020. this.choseDay = day-1;
  5021. }
  5022. if(sessionStorage.from != 1){
  5023. let nowmonth = new Date().getMonth() + 1
  5024. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5025. let nowdate = new Date().getDate()
  5026. if(nowd == this.date){
  5027. if(e && sessionStorage.msg){
  5028. }else{
  5029. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5030. }
  5031. let nowday = new Date(sessionStorage.msg).getDate()
  5032. this.choseDay = nowday - 1
  5033. let monthdate = new Date(sessionStorage.msg)
  5034. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5035. }else{
  5036. if(e && sessionStorage.msg){
  5037. }else{
  5038. sessionStorage.msg = this.date + '-01'
  5039. }
  5040. let monthdate = new Date(sessionStorage.msg)
  5041. this.choseDay = monthdate.getDate() - 1
  5042. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5043. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5044. }
  5045. }else{
  5046. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5047. }
  5048. //从消息点击跳转过来的,直接加载指定日期
  5049. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5050. this.curDate = sessionStorage.msg;
  5051. sessionStorage.from = 0;
  5052. } else {
  5053. // if (curMonthDay != null) {
  5054. // // this.curDate = curMonthDay;
  5055. // let d = new Date(sessionStorage.msg)
  5056. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5057. // } else {
  5058. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5059. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5060. // }
  5061. }
  5062. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5063. // if(!sessionStorage.msg){
  5064. // let msgday = this.choseDay + 1
  5065. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5066. // }
  5067. this.getReportFillStatus();
  5068. },
  5069. getCountDays() {
  5070. var newstr = this.date.replace(/-/g, "/");
  5071. var curDate = new Date(newstr+'/01');
  5072. var curMonth = curDate.getMonth();
  5073. curDate.setMonth(curMonth + 1);
  5074. curDate.setDate(0);
  5075. return curDate.getDate();
  5076. },
  5077. reqMore() {
  5078. if (this.hasMore) {
  5079. this.pageIndex++;
  5080. this.requestHttpReports();
  5081. }
  5082. },
  5083. //加载日报数据
  5084. requestHttpReports() {
  5085. //请求数据
  5086. this.listLoading = true;
  5087. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5088. let param = {date: this.date + day};
  5089. if (this.deptId) {
  5090. param.deptId = this.deptId;
  5091. }
  5092. if (this.targetUid) {
  5093. param.userId = this.targetUid;
  5094. }
  5095. //传页码
  5096. if (this.hasMore) {
  5097. param.pageIndex = this.pageIndex;
  5098. }
  5099. this.http.post( this.port.report.list, param,
  5100. res => {
  5101. this.listLoading = false;
  5102. if (res.code == "ok") {
  5103. //扩增
  5104. this.reportList = this.reportList.concat(res.data.data);
  5105. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5106. if(document.querySelector("#day"+this.choseDay)){
  5107. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5108. }
  5109. } else {
  5110. this.$message({
  5111. message: res.msg,
  5112. type: "error"
  5113. });
  5114. }
  5115. },
  5116. error => {
  5117. this.listLoading = false;
  5118. this.$message({
  5119. message: error,
  5120. type: "error"
  5121. });
  5122. });
  5123. },
  5124. //获取日报列表
  5125. getReportList() {
  5126. //初始化,重置数据
  5127. this.pageIndex = 0;
  5128. this.hasMore = true;
  5129. this.reportList = [];
  5130. this.requestHttpReports();
  5131. },
  5132. //刷新日报状态,用于审核后更新
  5133. refreshReportData(reportId) {
  5134. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5135. res => {
  5136. if (res.code == "ok") {
  5137. for (var m=0;m<this.reportList.length; m++) {
  5138. var d = this.reportList[m].data;
  5139. var find = d.filter(r=>r.id == reportId);
  5140. if (find.length > 0) {
  5141. find[0].state = res.data.state;
  5142. if (find[0].state == 2) {//被驳回,要可以编辑
  5143. this.reportList[m].state = 2;
  5144. }
  5145. find[0].isDeptAudit = res.data.isDeptAudit;
  5146. find[0].departmentAuditState = res.data.departmentAuditState;
  5147. find[0].projectAuditorName = res.data.projectAuditorName;
  5148. find[0].projectAuditorId = res.data.projectAuditorId;
  5149. find[0].projectAuditState = res.data.projectAuditState;
  5150. find[0].rejectUserid = res.data.rejectUserid;
  5151. find[0].rejectUsername = res.data.rejectUsername;
  5152. find[0].rejectReason = res.data.rejectReason;
  5153. this.$forceUpdate();
  5154. break;
  5155. }
  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. exportUserTime() {
  5174. this.listLoading = true;
  5175. var param = {};
  5176. if (this.exportParam.dateRange != null) {
  5177. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5178. }
  5179. this.http.post('/department/exportDeptStatistic', param,
  5180. res => {
  5181. this.listLoading = false;
  5182. if (res.code == "ok") {
  5183. location.href = res.data;
  5184. this.exportTimeDialog = false;
  5185. } else {
  5186. this.$message({
  5187. message: res.msg,
  5188. type: "error"
  5189. });
  5190. }
  5191. },
  5192. error => {
  5193. this.listLoading = false;
  5194. this.$message({
  5195. message: error,
  5196. type: "error"
  5197. });
  5198. });
  5199. },
  5200. //导出日报
  5201. exportReport() {
  5202. this.exportingData = true;
  5203. var param = {};
  5204. if (this.exportParam.dateRange != null) {
  5205. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5206. }
  5207. if (this.exportParam.projectId != null) {
  5208. param.projectId = this.exportParam.projectId;
  5209. }
  5210. if (this.exportParam.departmentId != null) {
  5211. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5212. }
  5213. param.stateKey = this.stateKey
  5214. // param.departmentId = this.user.departmentId
  5215. console.log(param, '《=== 导出传的参数');
  5216. console.log('开始调用exportReport接口');
  5217. this.http.post(this.port.report.export, param,
  5218. res => {
  5219. this.exportingData = false;
  5220. if (res.code == "ok") {
  5221. location.href = res.data;
  5222. this.exportDialog = false;
  5223. } else {
  5224. this.$message({
  5225. message: res.msg,
  5226. type: "error"
  5227. });
  5228. }
  5229. },
  5230. error => {
  5231. this.exportingData = false;
  5232. this.$message({
  5233. message: error,
  5234. type: "error"
  5235. });
  5236. });
  5237. },
  5238. //获取项目列表
  5239. getProjectList() {
  5240. this.listLoading = true;
  5241. this.http.post( this.port.project.list, {},
  5242. res => {
  5243. this.listLoading = false;
  5244. if (res.code == "ok") {
  5245. for(var i in res.data) {
  5246. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5247. res.data[i].projectCode = ''
  5248. }
  5249. }
  5250. this.projectList = res.data;
  5251. console.log("项目列表",this.projectList);
  5252. } else {
  5253. this.$message({
  5254. message: res.msg,
  5255. type: "error"
  5256. });
  5257. }
  5258. },
  5259. error => {
  5260. this.listLoading = false;
  5261. this.$message({
  5262. message: error,
  5263. type: "error"
  5264. });
  5265. });
  5266. },
  5267. // 获取填报日报的项目下拉列表
  5268. getFillProjectList() {
  5269. this.http.post( this.port.project.list, {
  5270. forReport: 1
  5271. },res => {
  5272. if (res.code == "ok") {
  5273. for(var i in res.data) {
  5274. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5275. res.data[i].projectCode = ''
  5276. }
  5277. }
  5278. this.fillProjectList = res.data;
  5279. this.getRecentlyProject()
  5280. } else {
  5281. this.$message({
  5282. message: res.msg,
  5283. type: "error"
  5284. });
  5285. }
  5286. },
  5287. error => {
  5288. this.$message({
  5289. message: error,
  5290. type: "error"
  5291. });
  5292. });
  5293. },
  5294. getBasecostItemList() {
  5295. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5296. companyId: this.user.companyId
  5297. },
  5298. res => {
  5299. if (res.code == "ok") {
  5300. this.timeBasecostList = res.data;
  5301. }
  5302. });
  5303. },
  5304. getAIReport(createDate) {
  5305. this.http.post('/report/getAIReport', {},
  5306. res => {
  5307. if (res.code == "ok") {
  5308. var quanbu = 0
  5309. this.jsDay = 1
  5310. var zhi = ''
  5311. var slp = res.data
  5312. for(var i in slp) {
  5313. var sp = +slp[i].workingTime + 0
  5314. zhi = this.jsDay * sp
  5315. quanbu = +quanbu + zhi
  5316. }
  5317. this.jsTime = quanbu
  5318. var aiReportData = res.data;
  5319. this.canCancelInDialog = false
  5320. if(aiReportData.length != 0) {
  5321. var arr = [];
  5322. for(var i in aiReportData) {
  5323. arr.push({
  5324. id: null,
  5325. projectId: aiReportData[i].projectId,
  5326. workingTime: aiReportData[i].workingTime,
  5327. content: '',
  5328. progress:100,
  5329. state: 2,
  5330. timeType: aiReportData[i].timeType,
  5331. subProjectList: aiReportData[i].subProjectList,
  5332. taskList: aiReportData[i].taskList,
  5333. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5334. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5335. taskId: aiReportData[i].taskId,
  5336. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5337. startTime: aiReportData[i].startTime,
  5338. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5339. endTime: aiReportData[i].endTime,
  5340. isOvertime: 0,
  5341. progress:aiReportData[i].progress,
  5342. professionProgress: aiReportData[i].professionProgressList,
  5343. stages:aiReportData[i].stages,
  5344. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5345. pics: null,
  5346. multiWorktime: aiReportData[i].multiWorktime,
  5347. worktimeList: [{}],
  5348. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5349. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5350. wuduList: aiReportData[i].degreeList,
  5351. taskGroups:aiReportData[i].taskGroups,
  5352. customData: aiReportData[i].customData,//自定义的数值
  5353. auditUserList: aiReportData[i].auditUserList,
  5354. projectAuditorId: aiReportData[i].projectAuditorId,
  5355. projectAuditorName: aiReportData[i].projectAuditorName,
  5356. overtimeHours: aiReportData[i].overtimeHours,
  5357. customText: aiReportData[i].customText,
  5358. basecostId: aiReportData[i].basecostId,
  5359. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5360. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5361. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5362. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5363. canEdit: true
  5364. })
  5365. }
  5366. this.workForm.domains = arr;
  5367. } else {
  5368. }
  5369. this.canEdit = true;
  5370. this.originCanEdit = true;
  5371. this.seleChn()
  5372. } else {
  5373. this.$message({
  5374. message: res.msg,
  5375. type: "error"
  5376. });
  5377. }
  5378. },
  5379. error => {
  5380. this.$message({
  5381. message: error,
  5382. type: "error"
  5383. });
  5384. });
  5385. },
  5386. // 获取个人某天的日报 111111
  5387. getReport() {
  5388. this.http.post( this.port.report.getPort, {
  5389. date: this.workForm.createDate
  5390. },
  5391. res => {
  5392. if (res.code == "ok") {
  5393. var quanbu = 0
  5394. this.jsDay = 1
  5395. var zhi = ''
  5396. var slp = res.data.report
  5397. for(var i in slp) {
  5398. var sp = +slp[i].workingTime + 0
  5399. zhi = this.jsDay * sp
  5400. quanbu = +quanbu + zhi
  5401. }
  5402. this.jsTime = quanbu
  5403. var list = res.data;
  5404. this.report = list;
  5405. this.reportTimeType = this.report.timeType;
  5406. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5407. this.isWeekend = !this.report.isWorkDay;
  5408. this.canCancelInDialog = false;
  5409. this.hasWrittenReport = list.report.length != 0;
  5410. if(list.report.length != 0) {
  5411. var arr = [];
  5412. this.canEdit = false;
  5413. let candelete = true
  5414. for(var i in list.report) {
  5415. var flg = null
  5416. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5417. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5418. var filteredRespList = null
  5419. if (targetP.length > 0) {
  5420. var isPublic = targetP[0].isPublic;
  5421. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5422. }
  5423. arr.push({
  5424. id: list.report[i].id,
  5425. projectId: list.report[i].projectId,
  5426. workingTime: list.report[i].workingTime,
  5427. content: list.report[i].content,
  5428. state: list.report[i].state,
  5429. timeType: list.report[i].timeType,
  5430. subProjectList: list.report[i].subProjectList,
  5431. taskList: list.report[i].taskList,
  5432. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5433. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5434. taskId: list.report[i].taskId,
  5435. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5436. startTime: list.report[i].startTime,
  5437. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5438. endTime: list.report[i].endTime,
  5439. isOvertime: flg,
  5440. progress:list.report[i].progress,
  5441. professionProgress: list.report[i].professionProgressList,
  5442. stages:list.report[i].stages,
  5443. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5444. pics: list.report[i].pics,
  5445. multiWorktime: list.report[i].multiWorktime,
  5446. worktimeList: list.report[i].worktimeList,
  5447. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5448. multiDegrIdArray: list.report[i].multiDegrIdList,
  5449. wuduList: list.report[i].degreeList,
  5450. taskGroups:list.report[i].taskGroups,
  5451. customData: list.report[i].customData,//自定义的数值
  5452. auditUserList: list.report[i].auditUserList,
  5453. projectAuditorId: list.report[i].projectAuditorId,
  5454. projectAuditorName: list.report[i].projectAuditorName,
  5455. overtimeHours: list.report[i].overtimeHours,
  5456. customText: list.report[i].customText,
  5457. basecostId: list.report[i].basecostId,
  5458. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5459. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5460. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5461. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5462. canEdit: list.report[i].state >= 2 ? true : false,
  5463. extraField1: list.report[i].extraField1,
  5464. extraField2: list.report[i].extraField2,
  5465. extraField3: list.report[i].extraField3,
  5466. workContentList: list.report[i].workContentList,
  5467. filteredRespList: filteredRespList,
  5468. serviceList: list.report[i].serviceList,
  5469. sapServiceId: list.report[i].sapServiceId,
  5470. })
  5471. if (list.report[i].state >= 2) {
  5472. this.canEdit = true;
  5473. }
  5474. if(list.report[i].state < 2){
  5475. candelete = false
  5476. }
  5477. if (list.report[i].state == 0){
  5478. this.canCancelInDialog = true
  5479. }
  5480. // 加判断
  5481. if(this.user.timeType.choseFromAlbum == 1) {
  5482. let arrList = []
  5483. for(var k in list.report[i].pics) {
  5484. let obj = {
  5485. name: k,
  5486. url: list.report[i].pics[k]
  5487. }
  5488. arrList.push(obj)
  5489. }
  5490. arr[i].imgListUrl = arrList
  5491. arr[i].imgList = list.report[i].pics
  5492. }
  5493. }
  5494. this.reportCanDelete = candelete
  5495. this.workForm = {
  5496. createDate: this.workForm.createDate,
  5497. domains: arr,
  5498. userNames:null,
  5499. userId:null,
  5500. time: list.time
  5501. }
  5502. console.log('workForm', this.workForm)
  5503. } else {
  5504. this.workForm = {
  5505. createDate: this.workForm.createDate,
  5506. domains: [{
  5507. id: null,
  5508. projectId: "",
  5509. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5510. content: "",
  5511. progress:100,
  5512. state: 2,
  5513. timeType:0,
  5514. multiWorktime: this.reportTimeType.multiWorktime,
  5515. worktimeList:[{}],
  5516. canEdit: true,
  5517. auditorFirst: '',
  5518. auditorSec: '',
  5519. auditorThird: '',
  5520. ccUserid: ''
  5521. }],
  5522. userId:null,
  5523. userNames:null,
  5524. time: this.report.time
  5525. }
  5526. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5527. this.$set(this.workForm.domains[0],'isOvertime',true)
  5528. if(this.reportTimeType.type != 2){
  5529. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5530. }
  5531. }
  5532. if(this.user.timeType.type == 1) {
  5533. var shuzhi = this.user.timeType.allday + ''
  5534. // console.log('执行一次', shuzhi.indexOf('.'))
  5535. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5536. }
  5537. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5538. //默认给第一个,必填字段
  5539. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5540. }
  5541. this.canEdit = true;
  5542. }
  5543. this.originCanEdit = this.canEdit;
  5544. this.seleChn()
  5545. } else {
  5546. this.$message({
  5547. message: res.msg,
  5548. type: "error"
  5549. });
  5550. }
  5551. },
  5552. error => {
  5553. this.$message({
  5554. message: error,
  5555. type: "error"
  5556. });
  5557. });
  5558. },
  5559. guanbi() {
  5560. this.falsss = false,
  5561. this.workTimeForMinYi=0
  5562. },
  5563. // 打开日报填写
  5564. fillInReport(i, isBatch) {
  5565. this.isWeekend = false
  5566. this.reportCanDelete = false
  5567. // console.log(this.user.timeType.type, '选择时长')
  5568. if(i != 1) {
  5569. this.falsss = false
  5570. } else {
  5571. this.falsss = true
  5572. }
  5573. if (this.isSubstitude) {
  5574. this.getSubstitudeUserDeptList();
  5575. }
  5576. if(i == -1 || this.isSubstitude) {
  5577. this.isDisable = false;
  5578. } else {
  5579. this.isDisable = true;
  5580. }
  5581. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5582. this.isBatch = isBatch;
  5583. if (this.isBatch == 0 && !this.isSubstitude) {
  5584. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5585. let weekday = new Date(this.workForm.createDate).getDay()
  5586. if(this.user.companyId == 817){
  5587. if(weekday == 0){
  5588. this.isWeekend = true
  5589. }
  5590. }else{
  5591. if(weekday == 0 || weekday == 6){
  5592. this.isWeekend = true
  5593. }
  5594. }
  5595. this.getReport(i);
  5596. } else {
  5597. // console.log('执行到了这里')
  5598. this.jsTime = 0
  5599. this.jsDay = 0
  5600. this.workForm = {
  5601. createDate: null,//批量填报没有日期
  5602. domains: [{
  5603. id: null,
  5604. projectId: "",
  5605. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5606. content: "",
  5607. progress:100,
  5608. state: 2,
  5609. timeType:0,
  5610. multiWorktime: this.reportTimeType.multiWorktime,
  5611. worktimeList:[{}],
  5612. canEdit: true,
  5613. }],
  5614. }
  5615. if(this.user.timeType.type == 1) {
  5616. var shuzhi = this.user.timeType.allday + ''
  5617. // console.log('执行二次')
  5618. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5619. }
  5620. // console.log(this.workForm)
  5621. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5622. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5623. }
  5624. this.canEdit = true;
  5625. }
  5626. this.dialogVisible = true;
  5627. },
  5628. //按周填报的弹窗口中编辑单项目相关数据
  5629. setWeekFormReportItem(reportId, i, names, row,sss) {
  5630. console.log(sss)
  5631. this.http.post('/report/getReportById', {
  5632. reportId: reportId
  5633. },
  5634. res => {
  5635. if (res.code == "ok") {
  5636. var data = res.data.report;
  5637. sss.subProjectId = data.subProjectId
  5638. sss.subProjectList = data.subProjectList;
  5639. sss.stage = data.stage
  5640. sss.subProjectList = data.subProjectList
  5641. sss.stages = data.stages
  5642. sss.taskGroups = data.taskGroups;
  5643. sss.auditUserList = data.auditUserList;
  5644. sss.degreeId = data.degreeId;
  5645. sss.customData = data.customData;
  5646. sss.wuduList = data.degreeList;
  5647. this.zhoBaoIdx = i
  5648. this.zhoBaoName = names
  5649. this.zhoBao = sss
  5650. this.zhis = row
  5651. if (sss.groupId) {
  5652. //最后一个参数表示是否保留stage的值,不要重置为空
  5653. this.getGroupStages(this.zhoBao, 0, true)
  5654. }
  5655. this.$forceUpdate();
  5656. }
  5657. });
  5658. },
  5659. // 按周填报里内容的填写
  5660. tianxies(item, i, names, row) {
  5661. if (item.state == 0) {
  5662. this.$message({
  5663. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5664. type: "error"
  5665. });
  5666. return;
  5667. }
  5668. if (item.state == 1) {
  5669. this.$message({
  5670. message: '已通过状态不可修改',
  5671. type: "error"
  5672. });
  5673. return;
  5674. }
  5675. if(this.user.timeType.notAllowedNoAttendance == 1){
  5676. if(this.zhoData[i].corpTime){
  5677. if(this.zhoData[i].corpTime.workHours == 0){
  5678. this.$message({
  5679. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5680. type: 'error'
  5681. })
  5682. return
  5683. }
  5684. }else{
  5685. this.$message({
  5686. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5687. type: 'error'
  5688. })
  5689. return
  5690. }
  5691. }
  5692. var idd = ''
  5693. var obj = {}
  5694. for(var l in this.projectList) {
  5695. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5696. }
  5697. obj.projectId = idd
  5698. this.tianxieDialogVisible = true
  5699. this.scopess = item
  5700. console.log(item, '《==== 当前的对象')
  5701. var sss = {}
  5702. if (item.id != null) {
  5703. sss.id = item.id;
  5704. sss.state = item.state;
  5705. } else {
  5706. sss.id = -1;
  5707. sss.state = 3;
  5708. }
  5709. sss.projectId = idd;
  5710. sss.progress = item.progress
  5711. sss.time = item.time
  5712. sss.content = item.content;
  5713. console.log('333', sss.content)
  5714. if (sss.time == '' && this.reportTimeType.type == 2) {
  5715. //取已填时间范围中最大的一个作为开始时间
  5716. var startTime = '09:00';
  5717. var fillStartTime = '00:00';
  5718. for (var t in this.selProjectList) {
  5719. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5720. if (fillItem.time) {
  5721. if (fillItem.time[1] > fillStartTime) {
  5722. fillStartTime = fillItem.time[1];
  5723. }
  5724. }
  5725. }
  5726. if (fillStartTime == '00:00') {
  5727. fillStartTime = '09:00';
  5728. }
  5729. var fillEndMax = '18:00';
  5730. if (fillStartTime >= '18:00') {
  5731. fillEndMax = '23:59';
  5732. }
  5733. sss.time = [fillStartTime, fillEndMax];
  5734. }
  5735. sss.groupId = item.groupId
  5736. sss.stage = item.stage;
  5737. sss.workingTime = item.workingTime
  5738. sss.projectAuditorId = item.projectAuditorId;
  5739. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5740. //默认选中第一个
  5741. sss.basecostId = this.timeBasecostList[0].id;
  5742. }
  5743. var hasEdited = this.zhoData[i][names].hasEdited;
  5744. if (hasEdited) {
  5745. sss = { ...item }
  5746. //编辑过了
  5747. sss.subProjectId = item.subProjectId
  5748. sss.stage = item.stage
  5749. sss.subProjectList = item.subProjectList
  5750. sss.stages = item.stages
  5751. sss.taskGroups = item.taskGroups;
  5752. console.log(sss.taskGroups, '33333');
  5753. sss.auditUserList = obj.auditUserList;
  5754. sss.degreeId = item.degreeId;
  5755. sss.customData = item.customData;
  5756. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5757. //只有一个审核人,自动设置上去
  5758. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5759. }
  5760. sss.wuduList = item.wuduList;
  5761. this.zhoBaoIdx = i
  5762. this.zhoBaoName = names
  5763. this.zhoBao = sss
  5764. this.zhis = row
  5765. if (sss.groupId) {
  5766. //最后一个参数表示是否保留stage的值,不要重置为空
  5767. this.getGroupStages(this.zhoBao, 0, true)
  5768. }
  5769. this.$forceUpdate();
  5770. this.getWeeklyTaskList(sss)
  5771. console.log('最后的周报 ===>', this.zhoBao)
  5772. } else {
  5773. //第一次打开,获取数据
  5774. if (sss.id == -1) {
  5775. //新填报的
  5776. this.selectProject(obj, 0);
  5777. var that = this
  5778. setTimeout(() =>{
  5779. sss.subProjectId = that.workForm.domains[0].subProjectId
  5780. sss.subProjectList = item.subProjectList;
  5781. sss.stage = that.workForm.domains[0].stage
  5782. sss.subProjectList = that.workForm.domains[0].subProjectList
  5783. sss.stages = that.workForm.domains[0].stages
  5784. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5785. sss.auditUserList = obj.auditUserList;
  5786. sss.degreeId = item.degreeId;
  5787. sss.customData = item.customData;
  5788. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5789. //只有一个审核人,自动设置上去
  5790. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5791. }
  5792. sss.wuduList = row[0].wuduList
  5793. that.zhoBaoIdx = i
  5794. that.zhoBaoName = names
  5795. that.zhoBao = sss
  5796. that.zhis = row
  5797. if (sss.groupId) {
  5798. //最后一个参数表示是否保留stage的值,不要重置为空
  5799. this.getGroupStages(that.zhoBao, 0, false)
  5800. }
  5801. that.$forceUpdate();
  5802. this.getWeeklyTaskList(sss)
  5803. },600);
  5804. } else {
  5805. //编辑填报过的;数据库已经存在的
  5806. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5807. }
  5808. }
  5809. },
  5810. // 按周填报里内容的填写点击确定
  5811. setWeekProItemData() {
  5812. //专业版模式下,任务分组和阶段必填
  5813. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5814. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5815. this.$message({
  5816. message: '任务分组和阶段必填,请检查',
  5817. type: "error"
  5818. });
  5819. return;
  5820. }
  5821. }
  5822. //检查子项目是否必填
  5823. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5824. this.$message({
  5825. message: '子项目必填,请检查',
  5826. type: "error"
  5827. });
  5828. return;
  5829. }
  5830. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5831. this.$message({
  5832. message: this.$t('message.Pleaseselectareviewer'),
  5833. type: "error"
  5834. });
  5835. return
  5836. }
  5837. if(this.user.timeType.reportAuditType == 3){
  5838. let auditTips = ''
  5839. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5840. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5841. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5842. if(auditTips){
  5843. auditTips = auditTips.substring(0,auditTips.length - 1)
  5844. this.$message({
  5845. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5846. type: 'error'
  5847. })
  5848. return
  5849. }
  5850. }
  5851. let errtips = ''
  5852. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5853. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5854. errtips += this.user.timeType.customDegreeName + '、'
  5855. }
  5856. }
  5857. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5858. errtips += this.user.timeType.customDataName + '、'
  5859. }
  5860. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5861. errtips += this.user.timeType.customTextName + '、'
  5862. }
  5863. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5864. errtips += this.$t('other.workMatters') +'、'
  5865. }
  5866. if(errtips){
  5867. errtips = errtips.substring(0,errtips.length - 1)
  5868. this.$message({
  5869. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5870. type: 'error'
  5871. })
  5872. return
  5873. }
  5874. this.tianxieDialogVisible = false
  5875. var zhong = this.zhoData
  5876. this.zhoBao.hasEdited = true;
  5877. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5878. this.zhoData = zhong
  5879. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5880. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5881. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5882. },
  5883. // 获取本周
  5884. getCurrentWeek() {
  5885. //今天
  5886. this.targetWeekDate = new Date();
  5887. this.initWeekFormData();
  5888. // this.jiazai()
  5889. },
  5890. // 获取上周
  5891. handleGetPrevWeek() {
  5892. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5893. this.initWeekFormData();
  5894. // this.jiazai()
  5895. },
  5896. // 获取下周
  5897. handleGetNextvWeek() {
  5898. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5899. this.initWeekFormData()
  5900. },
  5901. // 加载动画
  5902. jiazai() {
  5903. this.weekDataLoading = true
  5904. var that = this
  5905. setTimeout(() =>{
  5906. that.weekDataLoading = false
  5907. },1000);
  5908. },
  5909. // 转时间格式
  5910. dealdate(date) {
  5911. const dt = new Date(date)
  5912. const y = dt.getFullYear()
  5913. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5914. const d = (dt.getDate() + '').padStart(2, '0')
  5915. return `${y}-${m}-${d}`
  5916. },
  5917. // 按周填报
  5918. fillInReportss() {
  5919. window.addEventListener('scroll', this.handleScroll, true)
  5920. // this.jiazai()
  5921. this.fillWeekDialogVisi = true
  5922. this.getCurrentWeek();
  5923. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5924. //重新获取工时预警类型的预算项
  5925. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5926. companyId: this.user.companyId
  5927. },
  5928. res => {
  5929. if (res.code == "ok") {
  5930. this.timeBasecostList = res.data;
  5931. }
  5932. });
  5933. }
  5934. },
  5935. fillInReportCustom() {
  5936. this.weekIndex++
  5937. this.weekParentData = {
  5938. isSubstitude: this.isSubstitude
  5939. }
  5940. this.fillWeekDialogVisiCustom = true
  5941. },
  5942. // 按周填报的项目筛选
  5943. selListFun(){
  5944. this.selProjectList = []
  5945. if(this.selCon.length){
  5946. for (let i = 0; i < this.selCon.length; i++) {
  5947. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5948. }
  5949. this.selConShow = false ;
  5950. for (let i in this.zhoData) {
  5951. var obj = this.zhoData[i];
  5952. for(var j in this.selProjectList) {
  5953. var xinzhi = this.selProjectList[j].projectName
  5954. obj[xinzhi] = {}
  5955. obj[xinzhi].time = ''
  5956. obj[xinzhi].content = ''
  5957. obj[xinzhi].progress = 0
  5958. obj[xinzhi].workingTime = 0
  5959. }
  5960. }
  5961. this.initWeekFormData();
  5962. }else{
  5963. this.$message({
  5964. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5965. type:'error'
  5966. })
  5967. }
  5968. },
  5969. setWeekCardTimeData(list) {
  5970. for(let i in list){
  5971. let datei = '';
  5972. if (this.user.timeType.showDdCardtime == 1) {
  5973. datei = list[i].workDate;
  5974. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5975. datei = list[i].createDate;
  5976. } else if (this.user.timeType.syncFanwei == 1) {
  5977. datei = list[i].workDate;
  5978. }
  5979. for(let m in this.zhoData) {
  5980. if(datei == this.zhoData[m].zhoDataTime){
  5981. let item = {
  5982. startTime: list[i].startTime,
  5983. endTime: list[i].endTime,
  5984. workHours: list[i].workHours
  5985. }
  5986. this.$set(this.zhoData[m],'corpTime',item)
  5987. }
  5988. }
  5989. }
  5990. },
  5991. getWeeklyCardTime(){ //按周填报获取考勤信息
  5992. let dateStr = []
  5993. for(let i in this.zhoData){
  5994. dateStr.push(this.zhoData[i].zhoDataTime)
  5995. }
  5996. this.http.post('/report/getWeeklyCardTime',{
  5997. dateStr: JSON.stringify(dateStr)
  5998. },res => {
  5999. if(res.code == 'ok'){
  6000. for(let i in res.data){
  6001. let datei = '';
  6002. if (this.user.timeType.showDdCardtime == 1) {
  6003. datei = res.data[i].workDate.split('-');
  6004. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6005. datei = res.data[i].createDate.split('-');
  6006. }
  6007. for(let m in this.zhoData){
  6008. let datem = new Date(this.zhoData[m].zhoDataTime)
  6009. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6010. let item = {
  6011. startTime: res.data[i].startTime,
  6012. endTime: res.data[i].endTime,
  6013. workHours: res.data[i].workHours
  6014. }
  6015. this.$set(this.zhoData[m],'corpTime',item)
  6016. }
  6017. }
  6018. }
  6019. }else{
  6020. this.$message({
  6021. message: res.msg,
  6022. type: 'error'
  6023. })
  6024. }
  6025. },err => {
  6026. this.$message({
  6027. message: err,
  6028. type: 'error'
  6029. })
  6030. })
  6031. },
  6032. selListqx(){
  6033. this.fillWeekDialogVisi = false
  6034. this.selProjectList = []
  6035. this.selCon = []
  6036. },
  6037. handleScroll() {
  6038. this.changdu = this.projectList.length + 1
  6039. },
  6040. // 自动选择时间点的事件
  6041. // async zhoTimes(item, i) {
  6042. // var iss = i
  6043. // if(item.time == null) {
  6044. // return
  6045. // } else {
  6046. // const zhi = this.zhoData[iss];
  6047. // let he = 0;
  6048. // const timeArr = Object.values(zhi)
  6049. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6050. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6051. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6052. // console.log(data, 'data');
  6053. // zhi.he = `${he}h`;
  6054. // }
  6055. // },
  6056. async zhoTimes(item, index) {
  6057. const zho = this.zhoData[index];
  6058. if (!item.time) {
  6059. return;
  6060. }
  6061. const timeArr = Object.values(zho)
  6062. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6063. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6064. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6065. zho.he = `${totalHours[0]}h`;
  6066. },
  6067. // 判断两个时间段是否重叠
  6068. timeOverlap(idx, dateAr) {
  6069. let zhi = 0
  6070. for (let k in dateAr) {
  6071. if (idx !== k) {
  6072. 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))) {
  6073. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6074. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6075. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6076. }
  6077. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6078. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6079. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6080. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6081. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6082. } else {
  6083. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6084. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6085. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6086. }
  6087. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6088. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6089. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6090. }
  6091. }
  6092. }
  6093. }
  6094. }
  6095. return zhi
  6096. },
  6097. // 计算时间
  6098. getHourMinutes(str, end) {
  6099. var he = 0
  6100. var date2 = '2021/12/12 ' + end +':00'
  6101. var date1 = '2021/12/12 ' + str +':00'
  6102. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6103. var leave1=date3%(24*3600*1000)
  6104. var hours=Math.floor(leave1/(3600*1000))
  6105. var leave2=leave1%(3600*1000)
  6106. var minutes=Math.floor(leave2/(60*1000))
  6107. var shi = hours+'.'+ minutes
  6108. return he += +shi
  6109. },
  6110. // 自动选择事件长度的事件
  6111. zhoXuan(item, i) {
  6112. var iss = i
  6113. if(item.time == null) {
  6114. return
  6115. } else {
  6116. var zhi = this.zhoData[iss]
  6117. var he = 0
  6118. for(var i in zhi) {
  6119. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6120. he += +zhi[i].workingTime
  6121. }
  6122. }
  6123. zhi.he = he + 'h'
  6124. }
  6125. },
  6126. getPushWorkLogData(){
  6127. this.http.post('/sap-sync-log/list', {},
  6128. res => {
  6129. if (res.code == "ok") {
  6130. this.pushWorkTimeLogData = res.data;
  6131. } else {
  6132. this.$message({
  6133. message: res.msg,
  6134. type: "error"
  6135. });
  6136. }
  6137. },
  6138. error => {
  6139. this.$message({
  6140. message: error,
  6141. type: "error"
  6142. });
  6143. });
  6144. },
  6145. // 获取全部人员
  6146. getUsers() {
  6147. this.http.post('/user/getSimpleActiveUserList', {},
  6148. res => {
  6149. if (res.code == "ok") {
  6150. this.usersList = res.data;
  6151. } else {
  6152. this.$message({
  6153. message: res.msg,
  6154. type: "error"
  6155. });
  6156. }
  6157. },
  6158. error => {
  6159. this.$message({
  6160. message: error,
  6161. type: "error"
  6162. });
  6163. });
  6164. },
  6165. // 按时间比例
  6166. addBli(item, i) {
  6167. var iss = i
  6168. if(item.time == null) {
  6169. return
  6170. } else {
  6171. var zhi = this.zhoData[iss]
  6172. var he = 0
  6173. for(var i in zhi) {
  6174. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6175. he += +zhi[i].workingTime
  6176. }
  6177. }
  6178. zhi.he = he.toFixed(1) + 'h'
  6179. }
  6180. },
  6181. //按周填报选择的项目发生变化,需要设置列
  6182. onSelProjectChange() {
  6183. for (let i = 0; i < this.selCon.length; i++) {
  6184. var exists = false;
  6185. for (let j = 0; j < this.selProjectList.length; j++) {
  6186. if (this.selProjectList[j].id == this.selCon[i]) {
  6187. exists = true;
  6188. break;
  6189. }
  6190. }
  6191. if (!exists) {
  6192. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6193. this.selProjectList.push(newProject);
  6194. //添加新项目
  6195. for (var w in this.zhoData) {
  6196. var dayItem = this.zhoData[w];
  6197. var pName = newProject.projectName;
  6198. dayItem[pName] = {};
  6199. dayItem[pName].time = ''
  6200. dayItem[pName].content = ''
  6201. dayItem[pName].progress = 0
  6202. dayItem[pName].workingTime = 0
  6203. }
  6204. }
  6205. }
  6206. //去掉
  6207. for (let j = 0; j < this.selProjectList.length; j++) {
  6208. var exists = false;
  6209. for (let i = 0; i < this.selCon.length; i++) {
  6210. if (this.selProjectList[j].id == this.selCon[i]) {
  6211. exists = true;
  6212. break;
  6213. }
  6214. }
  6215. if (!exists) {
  6216. this.selProjectList.splice(j, 1);
  6217. j--;
  6218. }
  6219. }
  6220. this.loadFilledWeekReportItem();
  6221. //刷新表格
  6222. // this.$refs.weekTable.doLayout();
  6223. },
  6224. //根据选中的项目来刷新填写表格
  6225. loadFilledWeekReportItem() {
  6226. for (var w in this.zhoData) {
  6227. var dayItem = this.zhoData[w];
  6228. for (var i = 0; i < this.selProjectList.length; i++) {
  6229. var curColumnProject = this.selProjectList[i];
  6230. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6231. for (var t in dayItem.reportList) {
  6232. //有日报的项目,不能取消选择
  6233. for (var p in this.fillProjectList) {
  6234. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6235. }
  6236. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6237. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6238. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6239. if (this.reportTimeType.type == 2) {
  6240. //时间段模式
  6241. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6242. }
  6243. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6244. break;
  6245. }
  6246. }
  6247. // dayItem[curColumnProject.projectName] = matchReportItem;
  6248. }
  6249. }
  6250. this.$nextTick(()=>{
  6251. this.$refs.weekTable.doLayout();
  6252. });
  6253. },
  6254. initWeekFormData() {
  6255. this.weekDataLoading = true;
  6256. for (var p in this.fillProjectList) {
  6257. this.fillProjectList[p].canCancel = 1;
  6258. }
  6259. this.http.post('/report/getWeeklyReportData',{
  6260. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6261. },res => {
  6262. this.weekDataLoading = false;
  6263. if(res.code == 'ok'){
  6264. let projectList = res.data.projectList;
  6265. if (projectList.length > 0) {
  6266. //有选择过项目进行填报,直接选中
  6267. this.selProjectList = projectList;
  6268. this.selCon = [];
  6269. for (let i = 0; i < projectList.length; i++) {
  6270. this.selCon.push(projectList[i].id);
  6271. }
  6272. }
  6273. //设置日期
  6274. this.weekDateRange = res.data.dateList;
  6275. this.zhoData = [];
  6276. var arrst = []
  6277. for(var i in this.weekDateRange) {
  6278. var obj = {}
  6279. obj.zhoDataTime = this.weekDateRange[i].date
  6280. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6281. obj.he = this.weekDateRange[i].filledTime;
  6282. obj.canFill = this.weekDateRange[i].canFill;
  6283. // obj.filledTime = this.weekDateRange[i].filledTime;
  6284. obj.reportList = this.weekDateRange[i].reportList;
  6285. //初始化,防止渲染报错
  6286. for (var j = 0; j < this.selProjectList.length; j++) {
  6287. var pName = this.selProjectList[j].projectName
  6288. obj[pName] = {}
  6289. obj[pName].time = ''
  6290. obj[pName].content = ''
  6291. obj[pName].progress = 0
  6292. obj[pName].workingTime = 0
  6293. }
  6294. arrst.push(obj)
  6295. }
  6296. this.zhoData = arrst
  6297. this.setWeekCardTimeData(res.data.cardTimeList);
  6298. this.loadFilledWeekReportItem();
  6299. }else{
  6300. this.$message({
  6301. message: res.msg,
  6302. type: 'error'
  6303. })
  6304. }
  6305. },err => {
  6306. this.$message({
  6307. message: err,
  6308. type: 'error'
  6309. })
  6310. })
  6311. },
  6312. zhoZhi(res, i) {
  6313. var zhi = 0
  6314. for(var i in res) {
  6315. if(i != 'zhoDataTime' && i != 'he') {
  6316. zhi += +res[i]
  6317. }
  6318. }
  6319. res.he = zhi
  6320. },
  6321. zhoBtn(i) {
  6322. // this.zhoData.split(i, 1)
  6323. var arr = this.zhoData
  6324. arr.splice(i, 1)
  6325. },
  6326. zhoAddlast(){
  6327. this.selConShow = true
  6328. },
  6329. closeAddWeeklyReport(){
  6330. this.fillWeekDialogVisi = false
  6331. this.selConShow = true
  6332. this.selProjectList = []
  6333. this.selCon = []
  6334. },
  6335. // 提交按周填报
  6336. submitWeekReport(isDraft) {
  6337. var zhi = this.zhoData
  6338. var ll = 0
  6339. if(this.reportTimeType.type == 2) {
  6340. for(var i in zhi) {
  6341. this.dateAr = []
  6342. var alp = []
  6343. var zhis = zhi[i]
  6344. console.log(zhis)
  6345. for(var j in zhis) {
  6346. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6347. let objs = {}
  6348. objs.s = zhis[j].time[0]
  6349. objs.e = zhis[j].time[1]
  6350. objs.p = j
  6351. alp.push(objs)
  6352. }
  6353. }
  6354. console.log(alp)
  6355. this.dateAr = alp
  6356. if (this.reportTimeType.timeCanOverlap == 0) {
  6357. let str = this.$t('message.Filledtimeperiodsoverlap')
  6358. if(this.dateAr.length > 0) {
  6359. const trus = this.fns();
  6360. const overlapDataTime = this.getOverlapData(alp);
  6361. if (overlapDataTime.length > 0) {
  6362. const arrList = overlapDataTime.map((item) => item.p);
  6363. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6364. }
  6365. ll += 1
  6366. if(!trus) {
  6367. this.$message({
  6368. message: str,
  6369. type: 'error'
  6370. })
  6371. return false
  6372. }
  6373. }
  6374. } else {
  6375. if(this.dateAr.length > 0) {
  6376. ll +=1 ;
  6377. }
  6378. }
  6379. }
  6380. if(ll == 0) {
  6381. this.$message({
  6382. message: this.$t('message.Pleasefillinthetime'),
  6383. type: 'error'
  6384. })
  6385. return false
  6386. }
  6387. } else if(this.reportTimeType.type == 1){
  6388. for(var i in zhi) {
  6389. var zhis = zhi[i]
  6390. for(var j in zhis) {
  6391. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6392. ll += 1
  6393. }
  6394. }
  6395. }
  6396. if(ll == 0) {
  6397. this.$message({
  6398. message: this.$t('message.Pleaseselectatime'),
  6399. type: 'error'
  6400. })
  6401. return false
  6402. }
  6403. let overcorp = ''
  6404. for(let n in zhi){
  6405. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6406. overcorp += zhi[n].zhoDataTime + ','
  6407. }
  6408. }
  6409. if(overcorp != ''){
  6410. overcorp = overcorp.substring(0,overcorp.length - 1)
  6411. this.$message({
  6412. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6413. type: 'error'
  6414. })
  6415. return
  6416. }
  6417. }
  6418. var submits = []
  6419. let formData = new FormData();
  6420. formData.append("draft", isDraft);
  6421. if(this.reportTimeType.multiWorktime == 1){
  6422. for (var i in this.zhoData) {
  6423. var zhoD = this.zhoData[i]
  6424. var flgs = false
  6425. for(var j in zhoD) {
  6426. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6427. flgs = true
  6428. // formData.append("degreeId", "-1");
  6429. formData.append("id", '-1');
  6430. for(var s in this.projectList) {
  6431. if(j == this.projectList[s].projectName) {
  6432. formData.append("projectId", this.projectList[s].id);
  6433. }
  6434. }
  6435. if(this.user.timeType.reportAuditType == 3){
  6436. let audItem = {}
  6437. if(this.user.timeType.auditLevel > 0){
  6438. audItem.auditorFirst = zhoD[j].auditorFirst
  6439. }
  6440. if(this.user.timeType.auditLevel > 1){
  6441. audItem.auditorSec = zhoD[j].auditorSec
  6442. }
  6443. if(this.user.timeType.auditLevel > 2){
  6444. audItem.auditorThird = zhoD[j].auditorThird
  6445. }
  6446. if(zhoD[j].ccUserid){
  6447. audItem.ccUserid = zhoD[j].ccUserid
  6448. }
  6449. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6450. }
  6451. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6452. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6453. formData.append("reportTimeType", this.reportTimeType.type);
  6454. formData.append("endTime", '');
  6455. formData.append("startTime", '');
  6456. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6457. var lix = []
  6458. var objjs = {}
  6459. objjs.startTime = zhoD[j].time[0]
  6460. objjs.endTime = zhoD[j].time[1]
  6461. if (zhoD[j].content == null || zhoD[j].content == '') {
  6462. zhoD[j].content == '-'
  6463. }
  6464. objjs.content = zhoD[j].content
  6465. lix.push(objjs)
  6466. var zhiZhi = JSON.stringify(lix)
  6467. zhiZhi = zhiZhi.replace(/,/g,"@");
  6468. formData.append("content", zhiZhi)
  6469. formData.append("isOvertime", 0)
  6470. formData.append("professionProgress", "[]")
  6471. if (zhoD[j].groupId) {
  6472. formData.append("groupId",zhoD[j].groupId)
  6473. } else {
  6474. //解决后台groupId数组越界的问题
  6475. formData.append("groupId",0)
  6476. }
  6477. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6478. formData.append("createDate",zhoD.zhoDataTime)
  6479. if (zhoD[j].projectAuditorId) {
  6480. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6481. }
  6482. if(zhoD[j].basecostId) {
  6483. formData.append("basecostId", zhoD[j].basecostId);
  6484. } else {
  6485. formData.append("basecostId", 0);
  6486. }
  6487. if(this.user.timeType.customDegreeActive){
  6488. if (this.user.timeType.customDegreeMultiple) {
  6489. if (zhoD[j].multiDegrIdArray) {
  6490. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6491. } else {
  6492. formData.append('multiDegrId','[]')
  6493. }
  6494. } else {
  6495. if (zhoD[j].degreeId) {
  6496. formData.append('degreeId',zhoD[j].degreeId)
  6497. } else {
  6498. formData.append('degreeId','-1')
  6499. }
  6500. }
  6501. }else{
  6502. formData.append("degreeId", "-1");
  6503. }
  6504. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6505. formData.append('customData',zhoD[j].customData)
  6506. }else if(this.user.timeType.customDataActive){
  6507. formData.append('customData',0)
  6508. }
  6509. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6510. formData.append('customText',zhoD[j].customText)
  6511. }else if(this.user.timeType.customTextActive){
  6512. formData.append('customText','-')
  6513. }
  6514. }
  6515. }
  6516. }
  6517. } else {
  6518. for (var i in this.zhoData) {
  6519. var zhoD = this.zhoData[i]
  6520. var flgs = false
  6521. if(this.reportTimeType.type == 2) {
  6522. for(var k in this.selProjectList) {
  6523. var pItem = this.selProjectList[k];
  6524. var pName = pItem.projectName;
  6525. var j = pName;
  6526. console.log('j==周报中的项目='+j);
  6527. if(zhoD[j].time && zhoD[j].time != 'null') {
  6528. flgs = true
  6529. // formData.append("degreeId", "-1");
  6530. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6531. for(var s in this.projectList) {
  6532. if(j == this.projectList[s].projectName) {
  6533. formData.append("projectId", this.projectList[s].id);
  6534. }
  6535. }
  6536. if(this.user.timeType.reportAuditType == 3){
  6537. let audItem = {}
  6538. if(this.user.timeType.auditLevel > 0){
  6539. audItem.auditorFirst = zhoD[j].auditorFirst
  6540. }
  6541. if(this.user.timeType.auditLevel > 1){
  6542. audItem.auditorSec = zhoD[j].auditorSec
  6543. }
  6544. if(this.user.timeType.auditLevel > 2){
  6545. audItem.auditorThird = zhoD[j].auditorThird
  6546. }
  6547. if(zhoD[j].ccUserid){
  6548. audItem.ccUserid = zhoD[j].ccUserid
  6549. }
  6550. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6551. }
  6552. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6553. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6554. formData.append("reportTimeType", this.reportTimeType.type);
  6555. formData.append("endTime", zhoD[j].time[1]);
  6556. formData.append("startTime", zhoD[j].time[0]);
  6557. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6558. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6559. formData.append("isOvertime", 0)
  6560. formData.append("professionProgress", "[]")
  6561. if (zhoD[j].groupId) {
  6562. formData.append("groupId",zhoD[j].groupId)
  6563. } else {
  6564. //解决后台groupId数组越界的问题
  6565. formData.append("groupId",0)
  6566. }
  6567. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6568. formData.append("createDate",zhoD.zhoDataTime)
  6569. if (zhoD[j].projectAuditorId) {
  6570. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6571. }
  6572. if(zhoD[j].basecostId) {
  6573. formData.append("basecostId", zhoD[j].basecostId);
  6574. } else {
  6575. formData.append("basecostId", 0);
  6576. }
  6577. if(this.user.timeType.customDegreeActive){
  6578. if (this.user.timeType.customDegreeMultiple) {
  6579. if (zhoD[j].multiDegrIdArray) {
  6580. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6581. } else {
  6582. formData.append("multiDegrId", "[]");
  6583. }
  6584. } else {
  6585. if (zhoD[j].degreeId) {
  6586. formData.append('degreeId',zhoD[j].degreeId)
  6587. } else {
  6588. formData.append("degreeId", "-1");
  6589. }
  6590. }
  6591. }else{
  6592. formData.append("degreeId", "-1");
  6593. }
  6594. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6595. formData.append('customData',zhoD[j].customData)
  6596. }else if(this.user.timeType.customDataActive){
  6597. formData.append('customData',0)
  6598. }
  6599. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6600. formData.append('customText',zhoD[j].customText)
  6601. }else if(this.user.timeType.customTextActive){
  6602. formData.append('customText','-')
  6603. }
  6604. }
  6605. }
  6606. } else {
  6607. for(var k in this.selProjectList) {
  6608. var pItem = this.selProjectList[k];
  6609. var pName = pItem.projectName;
  6610. var j = pName;
  6611. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6612. flgs = true
  6613. // formData.append("degreeId", "-1");
  6614. console.log('进入了workFpppp==='+j);
  6615. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6616. for(var s in this.projectList) {
  6617. if(j == this.projectList[s].projectName) {
  6618. formData.append("projectId", this.projectList[s].id);
  6619. }
  6620. }
  6621. if(this.user.timeType.reportAuditType == 3){
  6622. let audItem = {}
  6623. if(this.user.timeType.auditLevel > 0){
  6624. audItem.auditorFirst = zhoD[j].auditorFirst
  6625. }
  6626. if(this.user.timeType.auditLevel > 1){
  6627. audItem.auditorSec = zhoD[j].auditorSec
  6628. }
  6629. if(this.user.timeType.auditLevel > 2){
  6630. audItem.auditorThird = zhoD[j].auditorThird
  6631. }
  6632. if(zhoD[j].ccUserid){
  6633. audItem.ccUserid = zhoD[j].ccUserid
  6634. }
  6635. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6636. }
  6637. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6638. // formData.append("subProjectId", zhoD[j].subProjectId);
  6639. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6640. formData.append("reportTimeType", this.reportTimeType.type);
  6641. if(this.reportTimeType.type == 1) {
  6642. formData.append("workingTime", zhoD[j].workingTime);
  6643. } else if(this.reportTimeType.type == 2) {
  6644. formData.append("endTime", zhoD[j].time[1]);
  6645. formData.append("startTime", zhoD[j].time[0]);
  6646. } else if(this.reportTimeType.type == 3) {
  6647. formData.append("progress", zhoD[j].progress);
  6648. formData.append("workingTime", zhoD[j].workingTime);
  6649. }
  6650. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6651. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6652. formData.append("isOvertime", 0)
  6653. formData.append("professionProgress", "[]")
  6654. if (zhoD[j].groupId) {
  6655. formData.append("groupId",zhoD[j].groupId)
  6656. } else {
  6657. //解决后台groupId数组越界的问题
  6658. formData.append("groupId",0)
  6659. }
  6660. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6661. formData.append("createDate",zhoD.zhoDataTime)
  6662. if (zhoD[j].projectAuditorId) {
  6663. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6664. }
  6665. if(zhoD[j].basecostId) {
  6666. formData.append("basecostId", zhoD[j].basecostId);
  6667. } else {
  6668. formData.append("basecostId", 0);
  6669. }
  6670. if(this.user.timeType.customDegreeActive){
  6671. if (this.user.timeType.customDegreeMultiple) {
  6672. if (zhoD[j].multiDegrIdArray) {
  6673. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6674. } else {
  6675. formData.append("multiDegrId", "[]");
  6676. }
  6677. } else {
  6678. if (zhoD[j].degreeId) {
  6679. formData.append('degreeId',zhoD[j].degreeId)
  6680. } else {
  6681. formData.append("degreeId", "-1");
  6682. }
  6683. }
  6684. }else{
  6685. formData.append("degreeId", "-1");
  6686. }
  6687. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6688. formData.append('customData',zhoD[j].customData)
  6689. }else if(this.user.timeType.customDataActive){
  6690. formData.append('customData',0)
  6691. }
  6692. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6693. formData.append('customText',zhoD[j].customText)
  6694. }else if(this.user.timeType.customTextActive){
  6695. formData.append('customText','-')
  6696. }
  6697. }
  6698. }
  6699. }
  6700. }
  6701. }
  6702. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6703. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6704. if(!next) {
  6705. this.$message({
  6706. message: `【${error.join('、')}】请填写任务分组`,
  6707. type: 'error'
  6708. })
  6709. return
  6710. }
  6711. // 自定义维度
  6712. this.submitingReport = true;
  6713. this.http.uploadFile( this.port.report.editPort, formData,
  6714. res => {
  6715. // this.listLoading = false;
  6716. this.submitingReport = false;
  6717. if (res.code == "ok") {
  6718. this.$message({
  6719. message: this.$t('message.fillinsuccessfully'),
  6720. type: "success"
  6721. });
  6722. this.fillWeekDialogVisi = false
  6723. this.selConShow = true
  6724. this.zhoData = []
  6725. this.weekDateRange = ''
  6726. this.getReportList();
  6727. this.getDepartment();
  6728. // 关闭弹窗 并 清空
  6729. this.selProjectList = []
  6730. this.selCon = []
  6731. this.getRecentlyProject()
  6732. } else {
  6733. this.$message({
  6734. message: res.msg,
  6735. type: "error"
  6736. });
  6737. }
  6738. },
  6739. error => {
  6740. this.submitingReport = false;
  6741. this.$message({
  6742. message: error,
  6743. type: "error"
  6744. });
  6745. });
  6746. },
  6747. handleGroupAuditorData(data) {
  6748. const { reportAuditType } = this.user.timeType
  6749. if(reportAuditType != 1 && reportAuditType != 2) {
  6750. return {next: true}
  6751. }
  6752. let arrList = [];
  6753. Object.entries(data).forEach(([key, obj]) => {
  6754. Object.entries(obj).forEach(([projectName, projectData]) => {
  6755. if (projectData.workingTime && !projectData.groupId) {
  6756. arrList.push({
  6757. projectName,
  6758. date: obj.zhoDataTime,
  6759. dateText: obj.zhoDataTimeTxt
  6760. });
  6761. }
  6762. });
  6763. });
  6764. if(arrList.length > 0) {
  6765. return {
  6766. next: false,
  6767. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6768. }
  6769. } else {
  6770. return {
  6771. next: true,
  6772. error: [],
  6773. }
  6774. }
  6775. },
  6776. ChangeHourMinutestr (str) {
  6777. if (str !== "0" && str !== "" && str !== null) {
  6778. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6779. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6780. } else {
  6781. return "";
  6782. }
  6783. },
  6784. // 得到两个日期中间的日期
  6785. getdiffdate(stime,etime){
  6786. //初始化日期列表,数组
  6787. var diffdate = new Array();
  6788. var i=0;
  6789. //开始日期小于等于结束日期,并循环
  6790. while(stime<=etime){
  6791. diffdate[i] = stime;
  6792. //获取开始日期时间戳
  6793. var stime_ts = new Date(stime).getTime();
  6794. //增加一天时间戳后的日期
  6795. var next_date = stime_ts + (24*60*60*1000);
  6796. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6797. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6798. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6799. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6800. stime = next_dates_y+next_dates_m+next_dates_d;
  6801. //增加数组key
  6802. i++;
  6803. }
  6804. return diffdate;
  6805. },
  6806. // 添加模块
  6807. addDomain(i) {
  6808. var leftProgress = 10;
  6809. if (this.reportTimeType.type == 3) {
  6810. //计算已经待分配工时比例
  6811. let array = this.workForm.domains;
  6812. let totalProgress = 0;
  6813. for (var i=0;i<array.length; i++) {
  6814. totalProgress += array[i].progress;
  6815. }
  6816. if (totalProgress < 100) {
  6817. leftProgress = 100 - totalProgress;
  6818. }
  6819. }
  6820. var addItem = {
  6821. projectId: "",
  6822. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6823. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6824. ),
  6825. content: "",
  6826. progress:leftProgress,
  6827. state:2,//2-表示待提交
  6828. multiWorktime: this.reportTimeType.multiWorktime,
  6829. worktimeList:[{}],
  6830. canEdit: true,
  6831. auditorFirst: '',
  6832. auditorSec: '',
  6833. auditorThird: '',
  6834. ccUserid: ''
  6835. // degreeId: '',
  6836. };
  6837. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6838. this.$set(addItem,'isOvertime',true)
  6839. if(this.reportTimeType.type == 3){
  6840. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6841. }
  6842. }
  6843. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6844. //默认给第一个,必填字段
  6845. addItem.basecostId = this.timeBasecostList[0].id;
  6846. }
  6847. this.workForm.domains.push(addItem);
  6848. document.getElementById('workFormsItemBottom').scrollIntoView()
  6849. this.canEdit = true
  6850. if (this.reportTimeType.type == 0) {
  6851. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6852. var length = this.workForm.domains.length;
  6853. if (length == 2) {
  6854. this.showAddMore = false;
  6855. }
  6856. }
  6857. this.chuji()
  6858. this.seleChn()
  6859. },
  6860. // 移除模块
  6861. delDomain(i) {
  6862. this.workForm.domains.splice(i,1)
  6863. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6864. if (!this.originCanEdit) {
  6865. let iscan = false
  6866. for(let i in this.workForm.domains){
  6867. if(this.workForm.domains[i].canEdit){
  6868. iscan = true
  6869. }
  6870. }
  6871. this.canEdit = iscan
  6872. }
  6873. //检测当前剩下的一个,时间类型是否是全天
  6874. if (this.reportTimeType.type == 0) {
  6875. if (this.workForm.domains[0].timeType == 0) {
  6876. this.showAddMore = false;
  6877. } else {
  6878. this.showAddMore = true;
  6879. }
  6880. }
  6881. if(this.user.timeType.multiWorktime == 1) {
  6882. this.iptChangs()
  6883. } else {
  6884. this.seleChn(0)
  6885. }
  6886. },
  6887. // 改变月份
  6888. changeMonth() {
  6889. this.isWeekend = false
  6890. let date = new Date()
  6891. let nowmon = date.getMonth() + 1
  6892. let nowday = date.getDate()
  6893. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6894. if (this.isBatch == 0) {
  6895. if(this.user.timeType.fillAhead == 0){
  6896. let date_a = new Date(this.workForm.createDate)
  6897. if(date_a.getTime() > date.getTime()){
  6898. this.workForm.createDate = nowdate
  6899. }
  6900. }
  6901. //只有按天填报才能获取当天的日报
  6902. if(!this.isSubstitude){
  6903. let weekday = new Date(this.workForm.createDate).getDay()
  6904. if(this.user.companyId == 817){
  6905. if(weekday == 0){
  6906. this.isWeekend = true
  6907. }
  6908. }else{
  6909. if(weekday == 0 || weekday == 6){
  6910. this.isWeekend = true
  6911. }
  6912. }
  6913. this.getReport()
  6914. }
  6915. }else {
  6916. if(this.user.timeType.fillAhead == 0){
  6917. let date_a = new Date(this.workForm.createDate[1])
  6918. if(date_a.getTime() > date.getTime()){
  6919. this.workForm.createDate[1] = nowdate
  6920. let sdate = new Date(this.workForm.createDate[0])
  6921. let edate = new Date(this.workForm.createDate[1])
  6922. if(sdate > edate){
  6923. this.workForm.createDate[0] = this.workForm.createDate[1]
  6924. }
  6925. }
  6926. }
  6927. }
  6928. },
  6929. // 判断时间段
  6930. fns() {
  6931. for (let k in this.dateAr) {
  6932. if (!this.judege(k)) {
  6933. return false
  6934. }
  6935. }
  6936. return true
  6937. },
  6938. judege(idx){
  6939. for (let k in this.dateAr) {
  6940. if (idx !== k) {
  6941. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6942. return false
  6943. }
  6944. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6945. return false
  6946. }
  6947. }
  6948. }
  6949. return true
  6950. },
  6951. getOverlapData(data) {
  6952. let overlapData = [];
  6953. for (let i = 0; i < data.length; i++) {
  6954. for (let j = i + 1; j < data.length; j++) {
  6955. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6956. overlapData.push(data[i], data[j]);
  6957. }
  6958. }
  6959. }
  6960. return overlapData;
  6961. },
  6962. // 保存日报111111
  6963. submitReport(isDraft) {
  6964. this.isDraft = isDraft;
  6965. this.$refs.workForm.validate(valid => {
  6966. if (valid) {
  6967. if(this.totalReportHours < this.user.timeType.allday){
  6968. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6969. confirmButtonText: '确定',
  6970. cancelButtonText: '取消',
  6971. type: 'warning'
  6972. }).then(() => {
  6973. this.submitReportSon()
  6974. }).catch(() => {
  6975. });
  6976. }else{
  6977. this.submitReportSon()
  6978. }
  6979. }
  6980. });
  6981. },
  6982. submitReportSon() {
  6983. this.dateAr = []
  6984. //检查重叠
  6985. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6986. let alp = []
  6987. if(this.user.timeType.multiWorktime != 1) {
  6988. for(var p in this.workForm.domains) {
  6989. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6990. let objs = {}
  6991. objs.s = this.workForm.domains[p].startTime
  6992. objs.e = this.workForm.domains[p].endTime
  6993. alp.push(objs)
  6994. }
  6995. }
  6996. this.dateAr = alp
  6997. if(this.dateAr.length > 0) {
  6998. let trus = this.fns()
  6999. if(!trus) {
  7000. this.$message({
  7001. message: this.$t('message.Filledtimeperiodsoverlap'),
  7002. type: "error"
  7003. });
  7004. return
  7005. }
  7006. }
  7007. } else {
  7008. for(var p in this.workForm.domains) {
  7009. var slll = this.workForm.domains[p]
  7010. for(var o in slll.worktimeList) {
  7011. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7012. let objs = {}
  7013. objs.s = slll.worktimeList[o].startTime
  7014. objs.e = slll.worktimeList[o].endTime
  7015. alp.push(objs)
  7016. }
  7017. }
  7018. }
  7019. this.dateAr = alp
  7020. if(this.dateAr.length > 0) {
  7021. let trus = this.fns()
  7022. if(!trus) {
  7023. this.$message({
  7024. message: this.$t('message.Filledtimeperiodsoverlap'),
  7025. type: "error"
  7026. });
  7027. return
  7028. }
  7029. }
  7030. }
  7031. }
  7032. //检查子项目
  7033. if (this.user.timeType.subProMustFill == 1) {
  7034. for(var p in this.workForm.domains) {
  7035. var oneProItem = this.workForm.domains[p]
  7036. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7037. //没有选择子项目
  7038. this.$message({
  7039. message: '子项目必填,请检查',
  7040. type: "error"
  7041. });
  7042. return
  7043. }
  7044. }
  7045. }
  7046. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7047. if (this.user.companyId == this.yuzhongCompId) {
  7048. for(var p in this.workForm.domains) {
  7049. var oneProItem = this.workForm.domains[p]
  7050. if (!oneProItem.extraField1) {
  7051. this.$message({
  7052. message: '角色必填,请检查',
  7053. type: "error"
  7054. });
  7055. return
  7056. }
  7057. if (!oneProItem.extraField2) {
  7058. this.$message({
  7059. message: '工作职责必填,请检查',
  7060. type: "error"
  7061. });
  7062. return
  7063. }
  7064. if (!oneProItem.extraField3) {
  7065. this.$message({
  7066. message: '工作内容必填,请检查',
  7067. type: "error"
  7068. });
  7069. return
  7070. }
  7071. }
  7072. }
  7073. // return
  7074. //代填的情况,检查人员是否已经选择
  7075. if (this.isSubstitude) {
  7076. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7077. this.$message({
  7078. message: this.$t('message.pleaseselectthepersontofillin'),
  7079. type: "error"
  7080. });
  7081. return;
  7082. }
  7083. }
  7084. //检查时间,全天和上下午不能同时存在
  7085. if (this.reportTimeType.type == 0) {
  7086. var alldayNum = 0;
  7087. var amNum = 0;
  7088. var pmNum = 0;
  7089. for(var i in this.workForm.domains) {
  7090. if (this.workForm.domains[i].timeType == 0) {
  7091. alldayNum ++;
  7092. } else if (this.workForm.domains[i].timeType == 1) {
  7093. amNum++;
  7094. } else if (this.workForm.domains[i].timeType == 2) {
  7095. pmNum++;
  7096. }
  7097. }
  7098. if (alldayNum > 1) {
  7099. this.$message({
  7100. // message: "工作时间-全天,只能选择一次",
  7101. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7102. type: "error"
  7103. });
  7104. return;
  7105. }
  7106. if (amNum > 1) {
  7107. this.$message({
  7108. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7109. type: "error"
  7110. });
  7111. return;
  7112. }
  7113. if (pmNum > 1) {
  7114. this.$message({
  7115. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7116. type: "error"
  7117. });
  7118. return;
  7119. }
  7120. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7121. this.$message({
  7122. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7123. type: "error"
  7124. });
  7125. return;
  7126. }
  7127. } else if (this.reportTimeType.type == 3) {
  7128. //总百分比不能超过100%
  7129. let total = 0;
  7130. this.workForm.domains.forEach(w=>{total += w.progress});
  7131. if (total > 100) {
  7132. this.$message({
  7133. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7134. type: "error"
  7135. });
  7136. return;
  7137. } else if (total < 100) {
  7138. this.$message({
  7139. message: this.$t('message.cannotbesubmitted'),
  7140. type: "error"
  7141. });
  7142. return;
  7143. }
  7144. }
  7145. this.listLoading = true;
  7146. let formData = new FormData();
  7147. formData.append("draft", this.isDraft);
  7148. var totalTime = 0;
  7149. for (var t=0;t<this.workForm.domains.length; t++) {
  7150. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7151. }
  7152. //批量填报不校验考勤时长,交给后台校验
  7153. if (!this.isBatch) {
  7154. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7155. if (this.workForm.time){
  7156. if (this.workForm.time.workHours == 0){
  7157. this.$message({
  7158. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7159. type: 'error'
  7160. })
  7161. return
  7162. }
  7163. }else{
  7164. this.$message({
  7165. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7166. type: 'error'
  7167. })
  7168. return
  7169. }
  7170. }
  7171. }
  7172. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7173. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7174. this.$message({
  7175. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7176. type: "error"
  7177. });
  7178. return;
  7179. }
  7180. }
  7181. for(var i in this.workForm.domains) {
  7182. // 检查任务/里程碑是否为必填
  7183. let taskRequired = this.user.timeType.taskRequired
  7184. if(taskRequired == 1) {
  7185. if(!this.workForm.domains[i].taskId) {
  7186. this.$message({
  7187. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7188. type: "error"
  7189. });
  7190. return
  7191. }
  7192. }
  7193. if(this.user.timeType.reportAuditType == 3){
  7194. let audItem = {}
  7195. let auditRule = ''
  7196. if(this.workForm.domains[i].id){
  7197. audItem.reportId = this.workForm.domains[i].id
  7198. }
  7199. if(this.user.timeType.auditLevel > 0){
  7200. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7201. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7202. }
  7203. if(this.user.timeType.auditLevel > 1){
  7204. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7205. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7206. }
  7207. if(this.user.timeType.auditLevel > 2){
  7208. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7209. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7210. }
  7211. if(this.workForm.domains[i].ccUserid){
  7212. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7213. }
  7214. if(auditRule){
  7215. auditRule = auditRule.substring(0,auditRule.length - 1)
  7216. this.$message({
  7217. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7218. type: 'error'
  7219. })
  7220. return
  7221. }
  7222. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7223. }
  7224. if (this.user.timeType.customDegreeActive) {
  7225. if (this.user.timeType.customDegreeMultiple) {
  7226. //多选
  7227. if (this.workForm.domains[i].multiDegrIdArray) {
  7228. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7229. degreeArray = degreeArray.replace(/,/g,"@");
  7230. formData.append("multiDegrId", degreeArray);
  7231. } else {
  7232. formData.append("multiDegrId", '[]');
  7233. }
  7234. } else {
  7235. //单选
  7236. if (this.workForm.domains[i].degreeId) {
  7237. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7238. } else {
  7239. formData.append("degreeId", -1);
  7240. }
  7241. }
  7242. } else {
  7243. formData.append("degreeId", -1);
  7244. }
  7245. if(this.workForm.domains[i].customData) {
  7246. // var sss = this.workForm.domains[i].degreeId.toString()
  7247. formData.append("customData", this.workForm.domains[i].customData);
  7248. } else {
  7249. formData.append("customData", 0);
  7250. }
  7251. if(this.workForm.domains[i].customText) {
  7252. formData.append("customText", this.workForm.domains[i].customText);
  7253. } else {
  7254. formData.append("customText", '-');
  7255. }
  7256. if (this.workForm.domains[i].id) {
  7257. formData.append("id", this.workForm.domains[i].id);
  7258. } else {
  7259. formData.append("id", -1);
  7260. }
  7261. formData.append("projectId", this.workForm.domains[i].projectId);
  7262. if (this.workForm.domains[i].subProjectId) {
  7263. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7264. } else {
  7265. formData.append("subProjectId", 0);
  7266. }
  7267. if (this.workForm.domains[i].groupId) {
  7268. formData.append("groupId", this.workForm.domains[i].groupId);
  7269. } else {
  7270. formData.append("groupId", 0);
  7271. }
  7272. if (this.workForm.domains[i].taskId) {
  7273. formData.append("taskId", this.workForm.domains[i].taskId);
  7274. } else {
  7275. formData.append("taskId", 0);
  7276. }
  7277. if (this.workForm.domains[i].taskFinish == true) {
  7278. formData.append("taskFinish", 1);
  7279. } else {
  7280. formData.append("taskFinish", 0);
  7281. }
  7282. formData.append("reportTimeType", this.reportTimeType.type);
  7283. if (this.reportTimeType.type == 0) {
  7284. formData.append("timeType", this.workForm.domains[i].timeType);
  7285. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7286. formData.append("workingTime", workingTime);
  7287. } else if (this.reportTimeType.type == 1){
  7288. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7289. } else if (this.reportTimeType.type == 2) {
  7290. formData.append("endTime", this.workForm.domains[i].endTime);
  7291. formData.append("startTime", this.workForm.domains[i].startTime);
  7292. } else if (this.reportTimeType.type == 3) {
  7293. //按比例分配
  7294. formData.append("progress", this.workForm.domains[i].progress);
  7295. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7296. }
  7297. if(this.user.timeType.choseFromAlbum == 1 ) {
  7298. console.log(this.workForm.domains[i].imgList)
  7299. if(this.workForm.domains[i].imgList) {
  7300. let imgListFor = this.workForm.domains[i].imgList
  7301. for(var b in imgListFor) {
  7302. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7303. }
  7304. console.log(imgListFor)
  7305. let m = JSON.stringify(imgListFor);
  7306. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7307. formData.append("picStr", m);
  7308. } else {
  7309. formData.append("picStr", '[]');
  7310. }
  7311. }
  7312. //处理多个时间事项
  7313. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7314. if (this.reportTimeType.multiWorktime == 1) {
  7315. //检查时间是否有重叠
  7316. var workList = this.workForm.domains[i].worktimeList;
  7317. for (var j=0;j<workList.length; j++) {
  7318. var curItem = workList[j];
  7319. //检查开始时间是否大于结束时间
  7320. if (curItem.startTime >= curItem.endTime) {
  7321. this.$message({
  7322. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7323. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7324. type: "error"
  7325. });
  7326. return;
  7327. }
  7328. //时间不可重叠
  7329. if (this.reportTimeType.timeCanOverlap == 0) {
  7330. for (var p = j+1;p<workList.length; p++) {
  7331. var jItem = workList[p];
  7332. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7333. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7334. this.$message({
  7335. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7336. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7337. type: "error"
  7338. });
  7339. return;
  7340. }
  7341. }
  7342. }
  7343. }
  7344. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7345. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7346. formData.append("content", m);
  7347. } else {
  7348. if (this.workForm.domains[i].content) {
  7349. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7350. m = m.replace(/,/g,",");
  7351. console.log(m, '需要传值的数据')
  7352. // formData.append("content", this.workForm.domains[i].content);
  7353. formData.append("content", m);
  7354. } else {
  7355. formData.append("content", '-');
  7356. }
  7357. }
  7358. if (this.isBatch == 0) {
  7359. formData.append("createDate", this.workForm.createDate);
  7360. } else {
  7361. //批量填报,时间范围
  7362. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7363. }
  7364. if(this.workForm.domains[i].isOvertime) {
  7365. formData.append("isOvertime", 1);
  7366. } else {
  7367. formData.append("isOvertime", 0);
  7368. }
  7369. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7370. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7371. } else {
  7372. formData.append("overtimeHours", 0);
  7373. }
  7374. if(this.workForm.domains[i].basecostId) {
  7375. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7376. } else {
  7377. formData.append("basecostId", 0);
  7378. }
  7379. if (this.workForm.userId != null) {
  7380. var targetUids = '';
  7381. this.workForm.userId.forEach(u=>{
  7382. targetUids += u + '@';
  7383. });
  7384. if (targetUids.length > 0) {
  7385. targetUids = targetUids.substring(0, targetUids.length -1);
  7386. formData.append("targetUids", targetUids);
  7387. }
  7388. }
  7389. //项目专业进度
  7390. if (this.workForm.domains[i].professionProgress) {
  7391. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7392. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7393. formData.append("professionProgress", m);
  7394. } else {
  7395. formData.append("professionProgress", "[]");
  7396. }
  7397. if (this.workForm.domains[i].stage) {
  7398. formData.append("stage", this.workForm.domains[i].stage);
  7399. } else {
  7400. formData.append("stage", "-");
  7401. }
  7402. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7403. if (this.workForm.domains[i].projectAuditorId) {
  7404. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7405. } else {
  7406. // console.log('执行到了这里')
  7407. // console.log(this.user.timeType.reportAuditType)
  7408. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7409. this.$message({
  7410. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7411. type: "error"
  7412. });
  7413. return;
  7414. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7415. //分组负责人先审核, 确定是选择了任务分组
  7416. if (this.workForm.domains[i].taskGroups.length == 0) {
  7417. this.$message({
  7418. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7419. type: "error"
  7420. });
  7421. } else if (!this.workForm.domains[i].groupId) {
  7422. // console.log(this.workForm.domains[i]);
  7423. this.$message({
  7424. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7425. type: "error"
  7426. });
  7427. } else {
  7428. this.$message({
  7429. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7430. type: "error"
  7431. });
  7432. }
  7433. return;
  7434. }
  7435. }
  7436. if (this.user.companyId == this.yuzhongCompId) {
  7437. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7438. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7439. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7440. }
  7441. //依斯贝的服务Id
  7442. if (this.user.companyId == this.yisibeiCompId) {
  7443. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7444. }
  7445. }
  7446. this.submitingReport = true;
  7447. this.http.uploadFile( this.port.report.editPort, formData,
  7448. res => {
  7449. this.listLoading = false;
  7450. this.submitingReport = false;
  7451. if (res.code == "ok") {
  7452. if(res.msg!=null){
  7453. this.$message({
  7454. dangerouslyUseHTMLString: true,
  7455. message: res.msg,
  7456. type: "warning",
  7457. showClose: true,
  7458. duration: 0
  7459. });
  7460. }else{
  7461. this.$message({
  7462. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7463. type: "success"
  7464. });
  7465. }
  7466. this.dialogVisible = false;
  7467. this.jsDay = 0
  7468. this.jsTime = 0
  7469. this.getReportList();
  7470. this.getDepartment();
  7471. this.getRecentlyProject()
  7472. } else {
  7473. this.$message({
  7474. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7475. type: "error"
  7476. });
  7477. }
  7478. },
  7479. error => {
  7480. this.listLoading = false;
  7481. this.submitingReport = false;
  7482. this.$message({
  7483. message: error,
  7484. type: "error"
  7485. });
  7486. });
  7487. },
  7488. // 判断是展示那个工时导入
  7489. imports() {
  7490. if(this.user.timeType.syncCorpwxTime == 0) {
  7491. this.importDialog = true
  7492. } else {
  7493. this.importWxDialog = true
  7494. }
  7495. },
  7496. // 跳转
  7497. junpToDeskTop(id) {
  7498. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7499. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7500. },
  7501. // 通过日报
  7502. approve(id, item) {
  7503. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7504. this.approveinData = {
  7505. id: id,
  7506. date: this.date +day,
  7507. reportIds: item.id
  7508. }
  7509. if(this.user.timeType.needEvaluate == 1){
  7510. this.$set(this.approveinData,'evaluate','')
  7511. this.approveinDialog = true
  7512. }else{
  7513. this.logining = true;
  7514. this.approveinfun()
  7515. }
  7516. },
  7517. approveinfun(){
  7518. this.http.post( this.port.report.approve, this.approveinData,
  7519. res => {
  7520. this.logining = false;
  7521. if (res.code == "ok") {
  7522. this.approveinDialog = false
  7523. this.$message({
  7524. message: this.$t('message.Reviewsucceeded'),
  7525. type: "success"
  7526. });
  7527. this.refreshReportData(this.approveinData.reportIds);
  7528. this.getDepartment();
  7529. } else {
  7530. this.$message({
  7531. message: res.msg,
  7532. type: "error"
  7533. });
  7534. }
  7535. },
  7536. error => {
  7537. this.logining = false;
  7538. this.$message({
  7539. message: error,
  7540. type: "error"
  7541. });
  7542. });
  7543. },
  7544. //撤回日报
  7545. cancel(item,e) {
  7546. // console.log('can can need',item);
  7547. this.logining = true;
  7548. var ids = '';
  7549. var data = e ? item : item.data;
  7550. data.forEach(element => {
  7551. if(element.id){
  7552. ids +=(element.id+',');
  7553. }
  7554. });
  7555. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7556. res => {
  7557. this.logining = false;
  7558. if (res.code == "ok") {
  7559. this.$message({
  7560. message:this.$t('message.Withdrawalsucceeded'),
  7561. type: "success"
  7562. });
  7563. this.getReportList();
  7564. if(e){this.getReport()}
  7565. this.getDepartment();
  7566. } else {
  7567. this.$message({
  7568. message: res.msg,
  7569. type: "error"
  7570. });
  7571. }
  7572. },
  7573. error => {
  7574. this.logining = false;
  7575. this.$message({
  7576. message: error,
  7577. type: "error"
  7578. });
  7579. });
  7580. },
  7581. showDenyDialog(id,i, item) {
  7582. this.denyReasonDialog = true;
  7583. this.isDenying = false;
  7584. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7585. var ids = item.id;
  7586. // var data = item.data;
  7587. // data.forEach(element => {
  7588. // ids +=(element.id+',');
  7589. // });
  7590. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7591. },
  7592. // 未通过日报
  7593. deny() {
  7594. this.logining = true;
  7595. this.isDenying = true;
  7596. this.http.post( this.port.report.deny, this.denyForm,
  7597. res => {
  7598. this.logining = false;
  7599. this.isDenying = false;
  7600. if (res.code == "ok") {
  7601. this.$message({
  7602. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7603. type: "success"
  7604. });
  7605. this.refreshReportData(this.denyForm.reportIds);
  7606. this.getDepartment();
  7607. this.denyReasonDialog = false;
  7608. } else {
  7609. this.$message({
  7610. message: res.msg,
  7611. type: "error"
  7612. });
  7613. }
  7614. },
  7615. error => {
  7616. this.logining = false;
  7617. this.$message({
  7618. message: error,
  7619. type: "error"
  7620. });
  7621. });
  7622. },
  7623. // 查看工时记录弹窗
  7624. toView() {
  7625. this.toViewDialogVisible = true
  7626. this.toViewloading = true
  7627. this.getToView()
  7628. },
  7629. getToView() {
  7630. this.http.post( '/report-import-log/getList', this.toViewForm,
  7631. res => {
  7632. this.toViewloading = false;
  7633. if (res.code == "ok") {
  7634. // console.log(res.data, '数据数据')
  7635. this.toViewList = res.data.records
  7636. this.toViewForm.total = res.data.total
  7637. } else {
  7638. this.toViewloading = false;
  7639. this.$message({
  7640. message: res.msg,
  7641. type: "error"
  7642. });
  7643. }
  7644. })
  7645. },
  7646. // 触发 selectCat 组件更改他的值
  7647. selectCatCli(obj) {
  7648. // console.log(obj, '看看')
  7649. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7650. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7651. },
  7652. vueCasader(obj) {
  7653. console.log(obj, '看看值')
  7654. if(obj.distinction == 1 && obj.item) {
  7655. let arr = []
  7656. arr.push(obj.item.value)
  7657. this.exportParam.departmentId = arr
  7658. }
  7659. },
  7660. //分页
  7661. handleCurrentChange(val) {
  7662. this.toViewForm.pageIndex = val;
  7663. this.getToView();
  7664. },
  7665. handleSizeChange(val) {
  7666. this.toViewForm.pageSize = val;
  7667. this.getToView();
  7668. },
  7669. getAllUsersList(){
  7670. this.http.post('/user/getSimpleActiveUserList',{
  7671. },res => {
  7672. if(res.code == 'ok'){
  7673. this.allUsersList = res.data
  7674. }else{
  7675. this.$message({
  7676. message: res.msg,
  7677. type: 'error'
  7678. })
  7679. }
  7680. },err => {
  7681. this.$message({
  7682. message: err,
  7683. type: 'error'
  7684. })
  7685. })
  7686. },
  7687. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7688. fillWeekCustomClne() {
  7689. this.fillWeekDialogVisiCustom = false
  7690. },
  7691. fillWeekCustomSubmit() {
  7692. this.getReportList();
  7693. this.getDepartment();
  7694. this.getRecentlyProject()
  7695. },
  7696. // 待填日报姓名搜索
  7697. nameAearchSeek(flg) {
  7698. if(!this.nameAearch) {
  7699. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7700. return
  7701. }
  7702. if(flg) {
  7703. this.enterpriseWechatgetUser()
  7704. }
  7705. },
  7706. handleThreeData(userList) {
  7707. console.log(userList, '人员数据')
  7708. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7709. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7710. },
  7711. // 过滤树节点
  7712. filterTreeNodes(treeData, filterKeywords) {
  7713. return treeData.filter((node) => {
  7714. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7715. if (node.children && node.children.length > 0) {
  7716. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7717. }
  7718. return true;
  7719. }
  7720. if (node.children && node.children.length > 0) {
  7721. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7722. return node.children.length > 0;
  7723. }
  7724. return false;
  7725. });
  7726. },
  7727. // 企业微信获取人员
  7728. enterpriseWechatgetUser() {
  7729. this.deptMembDataLoading = true
  7730. this.http.post('/user/getEmployeeList',{
  7731. departmentId: -1,
  7732. pageIndex: 1,
  7733. pageSize: 100,
  7734. keyword: this.nameAearch,
  7735. status: '',
  7736. roleId: '',
  7737. cursor: '',
  7738. onlyDirect: '',
  7739. matchingType: ''
  7740. },res => {
  7741. if(res.code == 'ok'){
  7742. this.deptMembDataLoading = false
  7743. const userListName = res.data.records.map(item => item.name)
  7744. this.handleThreeData(userListName)
  7745. }else{
  7746. this.deptMembDataLoading = false
  7747. this.$message({
  7748. message: res.msg,
  7749. type: 'error'
  7750. })
  7751. }
  7752. },err => {
  7753. this.deptMembDataLoading = false
  7754. this.$message({
  7755. message: err,
  7756. type: 'error'
  7757. })
  7758. })
  7759. },
  7760. // 按周填报获取相关任务
  7761. async getWeeklyTaskList(item) {
  7762. console.log(item, '<=== 数据')
  7763. const { projectId, groupId, stage, taskId } = item
  7764. console.log(projectId, groupId, stage)
  7765. let parms = { projectId, isSubstitude: 0 }
  7766. groupId ? parms.groupId = groupId : ''
  7767. stage ? parms.stage = stage : ''
  7768. const { data } = await this.postData('/task/getRecentTask', parms)
  7769. this.zhoBao.taskId = taskId
  7770. this.$set(this.zhoBao, 'taskList', data)
  7771. console.log(this.zhoBao)
  7772. },
  7773. // 封装 post 请求
  7774. postData(url, params) {
  7775. return new Promise((resolve, reject) => {
  7776. this.http.post(url, { ...params },
  7777. res => {
  7778. resolve(res)
  7779. },
  7780. error => {
  7781. this.$message({
  7782. message: error,
  7783. type: "error"
  7784. });
  7785. reject(error)
  7786. })
  7787. })
  7788. },
  7789. // 自定义事件
  7790. selectCal(obj) {
  7791. console.log(obj, '传数据来源')
  7792. if(obj.distinction == '1') {
  7793. this.zhoBao.projectAuditorId = obj.id
  7794. } else if(obj.distinction == '2') {
  7795. this.zhoBao.auditorFirst = obj.id
  7796. } else if(obj.distinction == '3') {
  7797. this.zhoBao.auditorSec = obj.id
  7798. } else if(obj.distinction == '4') {
  7799. this.zhoBao.auditorThird = obj.id
  7800. } else if(obj.distinction == '5') {
  7801. this.zhoBao.ccUserid = obj.id
  7802. } else if(obj.distinction == '12') {
  7803. this.usersListId = obj.id
  7804. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7805. this.searchKeyword = obj.name
  7806. } else {
  7807. this.searchKeyword = ''
  7808. }
  7809. this.searchScreen(0)
  7810. } else if(obj.distinction == '13') {
  7811. this.usersListId = obj.id
  7812. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7813. this.searchKeyword = obj.name
  7814. } else {
  7815. this.searchKeyword = ''
  7816. }
  7817. this.searchScreen(1)
  7818. }
  7819. }
  7820. },
  7821. created() {
  7822. this.getUsers()
  7823. let height = window.innerHeight;
  7824. this.tableHeight = height - 178;
  7825. const that = this;
  7826. window.onresize = function temp() {
  7827. that.tableHeight = window.innerHeight - 178;
  7828. };
  7829. this.toViewForm.companyId = this.user.companyId
  7830. this.initDrag([{
  7831. type: "LR",
  7832. domClass: {
  7833. // 中间分割线的名字
  7834. resize: "line-line",
  7835. // 左侧盒子的名字
  7836. left: "box-left",
  7837. // 右侧盒子的名字
  7838. right: "box-right",
  7839. // 父级的名字
  7840. box: "box-father",
  7841. },
  7842. otherInfo: {
  7843. // 限制左边栏最低宽度
  7844. leftWidth: 120,
  7845. },
  7846. },
  7847. {
  7848. type: "LR",
  7849. domClass: {
  7850. // 中间分割线的名字
  7851. resize: "line-second",
  7852. // 左侧盒子的名字
  7853. left: "left-laowang",
  7854. // 右侧盒子的名字
  7855. right: "box-second-father",
  7856. // 父级的名字
  7857. box: "grand",
  7858. },
  7859. otherInfo: {
  7860. // 限制左边栏最低宽度
  7861. leftWidth: 120,
  7862. },
  7863. },
  7864. ]);
  7865. }
  7866. };
  7867. </script>
  7868. <style lang="scss" scoped>
  7869. .fillWeekDialogVisiCustom {
  7870. width: 100%;
  7871. height: 70vh;
  7872. }
  7873. .fillWeekCustom {
  7874. .el-dialog__body {
  7875. padding: 20px 20px !important;
  7876. }
  7877. }
  7878. .photos {
  7879. position: relative;
  7880. display: flex;
  7881. flex-wrap: wrap;
  7882. }
  7883. .photos_img {
  7884. width: 120px;
  7885. height: 120px;
  7886. margin-right: 20px;
  7887. margin-bottom: 20px;
  7888. cursor: pointer;
  7889. img {
  7890. width: 100%;
  7891. height: 100%;
  7892. }
  7893. }
  7894. .paginatis {
  7895. padding: 10px 10px;
  7896. background: #f2f2f2;
  7897. }
  7898. .waiting {
  7899. color:orange;
  7900. }
  7901. .filledReportStyle {
  7902. color:#32CD32;
  7903. }
  7904. .RejectStyle {
  7905. color:red;
  7906. }
  7907. .waitSubmitStyle{
  7908. color: #409eff;
  7909. }
  7910. .chooseDate {
  7911. .waiting {
  7912. color: #20a0ff;
  7913. }
  7914. .filledReportStyle {
  7915. color:#20a0ff;
  7916. }
  7917. .RejectStyle {
  7918. color: #20a0ff;
  7919. }
  7920. .waitSubmitStyle{
  7921. color: #20a0ff;
  7922. }
  7923. }
  7924. .allDaily {
  7925. width:100%;
  7926. }
  7927. .report_title {
  7928. padding:10px 0;
  7929. color:#666;
  7930. }
  7931. .clearfix {
  7932. overflow-x: auto;
  7933. white-space: nowrap;
  7934. padding: 15px 0 10px 0;
  7935. // overflow-y: hidden;
  7936. .date_item {
  7937. padding: 0 3px;
  7938. cursor: pointer;
  7939. position: relative;
  7940. }
  7941. .chooseDate {
  7942. position: absolute;
  7943. bottom: -3px;
  7944. width: 37px;
  7945. height: 2px;
  7946. left: 14px;
  7947. background: #20a0ff;
  7948. }
  7949. }
  7950. .one_daily {
  7951. i {
  7952. color: #9ed0ff;
  7953. margin-right: 5px;
  7954. }
  7955. .one_daily_body {
  7956. padding: 10px 0px;
  7957. p {
  7958. margin: 0;
  7959. line-height: 30px;
  7960. }
  7961. }
  7962. ul {
  7963. padding: 0;
  7964. }
  7965. }
  7966. .checkbtn {
  7967. float: right;
  7968. margin-top: -10px;
  7969. }
  7970. .selConStyle{
  7971. margin-top:9rem;
  7972. margin-bottom:11rem;
  7973. .selConStyle_title{
  7974. height: 3rem;
  7975. text-align: center;
  7976. font-size: 17px;
  7977. }
  7978. .el-select{
  7979. margin: 0 15%;
  7980. width: 70%;
  7981. }
  7982. }
  7983. </style>
  7984. <style lang="scss">
  7985. /*去除upload组件过渡效果*/
  7986. .photos .el-upload-list__item {
  7987. transition: none !important;
  7988. }
  7989. .daily {
  7990. .el-card__body {
  7991. height: 80%;
  7992. overflow-y: auto;
  7993. }
  7994. .el-card__header {
  7995. padding: 0 20px;
  7996. }
  7997. }
  7998. .membListClass{
  7999. .el-dialog__body{
  8000. padding-top: 10px;
  8001. }
  8002. }
  8003. // .editReportDialog .el-dialog__footer{
  8004. // position: sticky;
  8005. // bottom: 0;
  8006. // background: #fff;
  8007. // height: 70px;
  8008. // z-index: 1010;
  8009. // }
  8010. .editReportDialog{
  8011. min-width: 800px;
  8012. }
  8013. .touruxiangmu{
  8014. max-width: 1000px;
  8015. }
  8016. </style>
  8017. <style scoped>
  8018. /* 项目标签的样式 */
  8019. .el-tag + .el-tag {
  8020. margin-left: 10px;
  8021. }
  8022. .button-new-tag {
  8023. margin-left: 10px;
  8024. height: 32px;
  8025. line-height: 30px;
  8026. padding-top: 0;
  8027. padding-bottom: 0;
  8028. }
  8029. .input-new-tag {
  8030. width: 90px;
  8031. margin-left: 10px;
  8032. vertical-align: bottom;
  8033. }
  8034. .selectworktime .el-table__fixed-body-wrapper{
  8035. top: 48px !important;
  8036. }
  8037. .selectworktime_export .selectworktime_export_l{
  8038. width: 650px;
  8039. float: left;
  8040. height: 42px;
  8041. }
  8042. .approvalProcessBox{
  8043. margin-left: 30px;
  8044. font-size: 14px;
  8045. line-height: 16px;
  8046. cursor: pointer;
  8047. }
  8048. .approvalProcessBox i {
  8049. margin-right: 0;
  8050. height: 16px;
  8051. width: 16px;
  8052. display: inline-block;
  8053. transform: scale(1.2);
  8054. position: relative;
  8055. top: 0.5px;
  8056. color: #409eff;
  8057. }
  8058. .approvalProcessBox .approvalProcessClick{
  8059. cursor: pointer;
  8060. color: #409eff;
  8061. font-size: 14px;
  8062. }
  8063. .approvalProcessBox:hover .approvalProcessClick{
  8064. color: #3485fb;
  8065. }
  8066. </style>
  8067. <style lang="scss" scoped>
  8068. // 加班样式
  8069. .overtime {
  8070. display: inline-block;
  8071. margin-left: 20px;
  8072. input {
  8073. display: inline-block;
  8074. margin-top: 5px;
  8075. }
  8076. }
  8077. .plus {
  8078. display: inline-block;
  8079. }
  8080. // .tages {
  8081. // float: right;
  8082. // }
  8083. .overtime {
  8084. display: inline-block;
  8085. margin-left: 30px;
  8086. }
  8087. .bloks {
  8088. display: inline-block;
  8089. width: 380px;
  8090. }
  8091. .zhiss {
  8092. display: flex;
  8093. justify-content: space-around;
  8094. align-items: center;
  8095. }
  8096. .zhoFel {
  8097. display: flex;
  8098. justify-content: space-between;
  8099. align-items: center;
  8100. }
  8101. // 左右滑动样式
  8102. .line {
  8103. width: 30px;
  8104. /* height: 500px; */
  8105. background: #f2f2f2;
  8106. cursor: w-resize;
  8107. }
  8108. .box-father {
  8109. border: 8px solid #000;
  8110. }
  8111. .line-second {
  8112. width: 10px;
  8113. /* background: red; */
  8114. }
  8115. .flex {
  8116. display: flex;
  8117. width: 100%;
  8118. }
  8119. .box-left {
  8120. flex: 0 0 400px;
  8121. /* height: 600px; */
  8122. /* background: blue; */
  8123. }
  8124. .box-right {
  8125. /* height: 600px; */
  8126. /* background: green; */
  8127. flex: 1;
  8128. }
  8129. .box-postion {
  8130. width: 200px;
  8131. /* height: 400px; */
  8132. background: #ccc;
  8133. }
  8134. .custom-tree-node {
  8135. flex: 1;
  8136. display: flex;
  8137. align-items: center;
  8138. justify-content: space-between;
  8139. font-size: 14px;
  8140. padding-right: 8px;
  8141. }
  8142. .daitianrbao {
  8143. width: 100%;
  8144. box-sizing: border-box;
  8145. height: 40px;
  8146. border-radius: 4px;
  8147. border: 1px solid #DCDFE6;
  8148. overflow: hidden;
  8149. text-overflow: ellipsis;
  8150. display: flex;
  8151. // align-items: center;
  8152. }
  8153. .daitianrbao .spnn {
  8154. display: inline-block;
  8155. box-sizing: border-box;
  8156. padding: 0 15px;
  8157. overflow: hidden;
  8158. text-overflow: ellipsis;
  8159. }
  8160. .daitianrbao .hover {
  8161. color: #DCDFE6 !important;
  8162. }
  8163. </style>