daily.vue 422 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994
  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')" v-if="user.userNameNeedTranslate != 1" 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-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  143. </span>
  144. </div>
  145. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  146. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  147. <i class="fa fa-circle"></i>
  148. <!-- {{item1.name}} -->
  149. <span v-if="user.userNameNeedTranslate == '1'">
  150. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  151. </span>
  152. <span v-if="user.userNameNeedTranslate != '1'">
  153. {{item1.name}}
  154. </span>
  155. <span style="margin-left:30px;">
  156. <span style="margin-right:20px;">
  157. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  158. <!-- 工作总时长: -->
  159. {{$t('other.totalWorkingHours')}}
  160. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  161. <span >{{item1.reportTime | amounts}}</span>h
  162. </span>
  163. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  164. <i class="iconfont firerock-iconliucheng1"></i>
  165. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  166. <!-- 审批流程 -->
  167. {{$t('other.approvalProcess')}}
  168. </span>
  169. </span>
  170. </span>
  171. <div class="checkbtn" style="padding-right:20px;">
  172. <!--编辑和删除日报-->
  173. <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>
  174. <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>
  175. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  176. </div>
  177. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  178. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  179. </div>
  180. <div class="one_daily_body">
  181. <el-timeline>
  182. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  183. <el-card shadow="never">
  184. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  185. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  186. <span v-if="user.company.packageEngineering == 0">
  187. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  188. <span v-if="item2.isDeptAudit==0">
  189. <span v-if="item2.projectAuditState==0">
  190. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  191. <span v-if="item2.projectAuditorName != null">(
  192. <!-- {{item2.projectAuditorName}} -->
  193. <span v-if="user.userNameNeedTranslate == '1'">
  194. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  195. </span>
  196. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  197. )</span>
  198. <!-- 审核 --> {{$t('other.audit')}}
  199. </span>
  200. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  201. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  202. <span v-if="item2.projectAuditorName != null">(
  203. <!-- {{item2.projectAuditorName}} -->
  204. <span v-if="user.userNameNeedTranslate == '1'">
  205. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  206. </span>
  207. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  208. )</span>
  209. <!-- 审核通过 --> {{$t('state.approved')}}
  210. </span>
  211. </span>
  212. <span v-else-if="item2.isDeptAudit==1">
  213. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  214. ({{$t('other.await')}}
  215. <span v-if="user.userNameNeedTranslate == '1'">
  216. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  217. </span>
  218. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  219. {{$t('other.audit')}})
  220. </span>
  221. ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  223. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  224. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  225. </span>
  226. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  228. </span>
  229. <!-- <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> -->
  230. <span v-if="user.company.packageEngineering == 1">
  231. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  235. (
  236. <span v-if="user.userNameNeedTranslate != 1">
  237. {{item2.projectAuditorName}}
  238. </span>
  239. <span v-if="user.userNameNeedTranslate == 1">
  240. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  241. </span>
  242. )
  243. </span>{{$t('other.audit')}} ]</span>
  244. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  245. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  247. </span>
  248. <!--每个项目上单独审核 -->
  249. <span style="float:right;">
  250. <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"
  251. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</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="danger" :loading="logining"
  253. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  254. <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"
  255. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  256. <!--自己可以撤回待审核状态的报告 -->
  257. <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>
  258. </span>
  259. </p>
  260. <p v-if="user.companyId == yuzhongCompId">
  261. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  262. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  263. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  264. <!--任务分组和阶段 -->
  265. <p v-if="item2.groupId != 0">
  266. {{$t('other.taskGroup')}}:{{item2.groupName}}
  267. <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>
  268. </p>
  269. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  270. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  271. <!-- 自定义日报文本 -->
  272. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  273. <p v-if="user.company.packageEngineering == 1">
  274. {{$t('other.professionalProgress')}}:
  275. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  276. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  277. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  278. </el-tooltip>
  279. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  280. <i class="iconfont firerock-iconshenhetongguo"></i>
  281. </el-tooltip>
  282. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  283. <i class="iconfont firerock-iconshenhebohui"></i>
  284. </el-tooltip>
  285. </span>
  286. </p>
  287. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  288. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  289. </p>
  290. <div v-if="item2.multiWorktime==0">
  291. <p style="display: inline-block;">{{$t('time.duration')}}:
  292. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  293. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  294. {{item2.time.toFixed(1)}}h
  295. <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>
  296. </p>
  297. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  298. </div>
  299. <div v-if="item2.multiWorktime==1" >
  300. <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>
  301. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  302. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  303. <p style="display: inline-block;">{{$t('time.duration')}}:
  304. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  305. {{timeItem.time.toFixed(1)}}h
  306. </p>
  307. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  308. </div>
  309. </div>
  310. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  311. <!--照片的显示 -->
  312. <p v-if="item2.pics != null && item2.pics.length > 0">
  313. <el-image v-for="(pic, index) in item2.pics" :key="index"
  314. style="width: 100px; height: 100px; margin-right:10px;"
  315. :src="pic"
  316. :preview-src-list="item2.pics">
  317. </el-image>
  318. </p>
  319. </el-card>
  320. </el-timeline-item>
  321. </el-timeline>
  322. </div>
  323. </div>
  324. <!-- 简陋的无报告提示 -->
  325. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  326. </div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </el-card>
  332. </div>
  333. <!-- 填写日报的dialog -->
  334. <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">
  335. <div style="height: 65vh;overflow: auto;">
  336. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  337. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  338. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  339. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  340. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  341. <span class="spnn" v-if="workForm.userNames">
  342. <span v-for="(item, index) in workForm.userNames" :key="index">
  343. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  344. <span v-if="index < workForm.userNames.length - 1">,</span>
  345. </span>
  346. </span>
  347. <span class="spnn hover" v-else>
  348. {{$t('defaultText.pleaseSelectAsubstitute')}}
  349. </span>
  350. </div>
  351. </el-form-item>
  352. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  353. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  354. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  355. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  356. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  357. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  358. <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>
  359. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  360. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  361. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  362. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  363. <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>
  364. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  365. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  366. </span>
  367. <!--批量填报和批量代填不显示考勤记录-->
  368. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  369. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  370. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  371. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  372. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  373. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  374. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  375. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  376. @click="refreshAttendance(workForm.createDate)"></el-button>
  377. <!-- AI智能填报 -->
  378. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  379. </el-form-item>
  380. <!-- 000000 -->
  381. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  382. <div v-if="reportTimeType.multiWorktime==0">
  383. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  384. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  385. <el-select v-model="domain.timeType" style="width:200px;"
  386. v-if="reportTimeType.type == 0"
  387. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  388. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  389. @change="onTimeTypeChange(domain.timeType)">
  390. <el-option
  391. v-for="item in timeType"
  392. :key="item.value"
  393. :label="item.label"
  394. :value="item.value">
  395. </el-option>
  396. </el-select>
  397. <!-- 数字时长选择 -->
  398. <el-select v-model="domain.workingTime" style="width:200px;"
  399. v-if="reportTimeType.type == 1"
  400. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  401. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  402. @change="seleChn(0,domain)">
  403. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  404. </el-select>
  405. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  406. <span v-if="reportTimeType.type == 2">
  407. <!--时间范围选择 -->
  408. <el-time-picker
  409. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  410. v-model="domain.startTime"
  411. :placeholder="$t('time.startTime')"
  412. style="width:120px;"
  413. format="HH:mm"
  414. value-format="HH:mm"
  415. :picker-options="{
  416. start: '08:00',
  417. end: '23:30'
  418. }"
  419. @change="iptChang()">
  420. </el-time-picker> - <el-time-picker
  421. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  422. v-model="domain.endTime"
  423. :placeholder="$t('time.endTime')"
  424. style="width:120px;"
  425. format="HH:mm"
  426. value-format="HH:mm"
  427. :picker-options="{
  428. start: '08:00',
  429. end: '23:30',
  430. minTime: domain.startTime
  431. }"
  432. @change="iptChang()">
  433. </el-time-picker>
  434. </span>
  435. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  436. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  437. <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>
  438. </div>
  439. </el-form-item>
  440. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  441. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  442. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  443. @change="selectProject(domain, index)"
  444. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  445. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  446. <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">
  447. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  448. <span style="float: right;">{{ item.projectName }}</span>
  449. </el-option>
  450. </el-option-group>
  451. </el-select>
  452. <!--昱众不显示子项目-->
  453. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  454. <span style="margin-left:45px;">
  455. {{$t('lable.subproject')}}</span>
  456. <!--子项目 -->
  457. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  459. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  460. </el-select>
  461. </template>
  462. <template v-if="user.companyId == yuzhongCompId">
  463. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  464. <!--角色选择 -->
  465. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  466. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  467. <el-option
  468. v-for="item in roleList"
  469. :key="item.value"
  470. :label="item.label"
  471. :value="item.value">
  472. </el-option>
  473. </el-select>
  474. </template>
  475. <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%;"
  476. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  477. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  478. </el-link>
  479. <!-- <el-link type="primary" v-if="canEdit"
  480. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  481. </el-form-item>
  482. <el-form-item :label="user.companyId==781? $t('other.describe'):$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">
  483. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  484. </el-form-item>
  485. <!--如果设置了工时成本预警的预算成本项-->
  486. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  487. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  488. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  489. </el-select>
  490. </el-form-item>
  491. <el-form-item v-if="user.company.packageProject == 1">
  492. <template slot="label">
  493. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  494. <span >{{$t('lable.taskGrouping')}}</span>
  495. </template>
  496. <!-- 任务分组 -->
  497. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  498. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  499. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  500. </el-select>
  501. <template v-if="user.companyId == yuzhongCompId">
  502. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  503. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  504. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  505. <el-option
  506. v-for="item in domain.filteredRespList"
  507. :key="item.id"
  508. :label="item.jobRespon"
  509. :value="item.id">
  510. </el-option>
  511. </el-select>
  512. </template>
  513. <template v-else><!-- 项目的阶段 -->
  514. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  515. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  516. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  517. @change="changeStages(domain, index)"
  518. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  519. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  520. </el-select>
  521. </template>
  522. </el-form-item>
  523. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  524. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  525. <template slot="label">
  526. <span style="color:#FF0000;">*</span>
  527. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  528. </template>
  529. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  530. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  531. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  532. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  533. </el-option>
  534. </el-select>
  535. <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>
  536. </el-form-item>
  537. </div>
  538. <el-form-item v-if="user.companyId == yuzhongCompId">
  539. <template slot="label">
  540. <span style="color:#FF0000;">*</span>
  541. <span >工作内容</span>
  542. </template>
  543. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  544. :disabled="(workForm.domains[index].state>=2?false:true)" >
  545. <el-option
  546. v-for="item in domain.workContentList"
  547. :key="item.id"
  548. :label="item.workContext"
  549. :value="item.id">
  550. </el-option>
  551. </el-select>
  552. </el-form-item>
  553. <!-- 111111 -->
  554. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  555. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  556. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  557. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  558. <span v-else>{{item.name}}</span>
  559. </el-option>
  560. </el-select>
  561. <template v-if="user.timeType.auditLevel > 1">
  562. <i class="el-icon-right"></i>
  563. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  564. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  565. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  566. <span v-else>{{item.name}}</span>
  567. </el-option>
  568. </el-select>
  569. </template>
  570. <template v-if="user.timeType.auditLevel > 2">
  571. <i class="el-icon-right"></i>
  572. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  573. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  574. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  575. <span v-else>{{item.name}}</span>
  576. </el-option>
  577. </el-select>
  578. </template>
  579. </el-form-item>
  580. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  581. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  582. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  583. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  584. <span v-else>{{item.name}}</span>
  585. </el-option>
  586. </el-select>
  587. </el-form-item>
  588. <!-- 相关维度/自定义维度 -->
  589. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :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'">
  590. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  591. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  592. </el-option>
  593. </el-select>
  594. </el-form-item>
  595. <!-- 相关数值 -->
  596. <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">
  597. <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>
  598. </el-form-item>
  599. <!-- 自定义文本 -->
  600. <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">
  601. <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>
  602. </el-form-item>
  603. <!--按比例填报-->
  604. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  605. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  606. <div style="width:400px;">
  607. <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>
  608. <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>
  609. </div>
  610. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  611. <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>
  612. </div>
  613. </el-form-item>
  614. <!--工程专业版本模式下, 各个专业的进度填报 -->
  615. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  616. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  617. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  618. <el-input size="mini" style="width:60px;" v-model="item.progress"
  619. @keyup.native="onProgressChange"
  620. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  621. </span>
  622. </el-form-item>
  623. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  624. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  625. <template slot="label" v-if="user.companyId == 3092">
  626. <span style="color:#FF0000;">*</span>
  627. <span >任务</span>
  628. </template>
  629. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  630. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  631. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  632. </el-select>
  633. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  634. </el-form-item>
  635. <!--针对依斯贝的SAP服务-->
  636. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  637. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  638. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  639. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  640. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  641. </el-select>
  642. </el-form-item>
  643. <!--工作事项-->
  644. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  645. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  646. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  647. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  648. </el-form-item>
  649. <!-- 拍照上传 -->
  650. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1">
  651. <div class="photos">
  652. <div>
  653. <el-upload
  654. list-type="picture-card"
  655. :http-request="(file) => {return addImg(file, index)}"
  656. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  657. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  658. :file-list="domain.imgListUrl" :limit="9"
  659. :disabled="workForm.domains[index].state>=2?false:true">
  660. <i class="el-icon-plus"></i>
  661. </el-upload>
  662. </div>
  663. </div>
  664. </el-form-item>
  665. </div>
  666. <!--多个工作事项填报的情况 -->
  667. <div v-if="reportTimeType.multiWorktime==1">
  668. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  669. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  670. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  671. @change="selectProject(domain, index)"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  673. <!-- <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">
  674. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  675. <span style="float: right;">{{ item.projectName }}</span>
  676. </el-option> -->
  677. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  678. <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">
  679. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  680. <span style="float: right;">{{ item.projectName }}</span>
  681. </el-option>
  682. </el-option-group>
  683. </el-select>
  684. <template v-if="user.timeType.mainProjectState != 1">
  685. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  686. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  687. <!--子项目 -->
  688. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  689. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  690. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  691. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  692. </el-select>
  693. </template>
  694. <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;"
  695. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  696. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  697. </el-link>
  698. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  699. <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>
  700. </div>
  701. <!-- <el-link type="primary" v-if="canEdit"
  702. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  703. </el-form-item>
  704. <el-form-item :label="user.companyId==781?$t('other.describe'):$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">
  705. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  706. </el-form-item>
  707. <!--如果设置了工时成本预警的预算成本项-->
  708. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  709. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  710. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  711. </el-select>
  712. </el-form-item>
  713. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  714. <!-- 任务分组 -->
  715. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  716. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  717. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  718. </el-select>
  719. <!-- 项目的阶段 -->
  720. <span v-if="domain.stages != null && domain.stages.length> 0"
  721. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  722. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  723. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  724. @change="changeStages(domain, index)"
  725. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  726. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  727. </el-select>
  728. </el-form-item>
  729. <el-form-item :label="$t('other.projectAuditor')" >
  730. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  731. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  732. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  733. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  734. </el-option>
  735. </el-select>
  736. <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>
  737. </el-form-item>
  738. <!--工程专业版本模式下, 各个专业的进度填报 -->
  739. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  740. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  741. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  742. <el-input size="mini" style="width:60px;" v-model="item.progress"
  743. @keyup.native="onProgressChange"
  744. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  745. </span>
  746. </el-form-item>
  747. <!-- 相关维度 -->
  748. <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'">
  749. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  750. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  751. </el-option>
  752. </el-select>
  753. </el-form-item>
  754. <!-- 相关数值 -->
  755. <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">
  756. <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>
  757. </el-form-item>
  758. <!-- 自定义文本 -->
  759. <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">
  760. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  761. </el-form-item>
  762. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  763. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  764. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  765. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  766. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  767. </el-select>
  768. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  769. </el-form-item>
  770. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  771. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  772. <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>
  773. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  774. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  775. <span v-if="reportTimeType.type == 2">
  776. <!-- <span> -->
  777. <!--时间范围选择 -->
  778. <el-time-picker
  779. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  780. v-model="timeItem.startTime"
  781. :placeholder="$t('time.startTime')"
  782. style="width:120px;"
  783. format="HH:mm"
  784. value-format="HH:mm"
  785. :picker-options="{
  786. start: '00:00',
  787. end: '23:59',
  788. }"
  789. @change="iptChangs()">
  790. </el-time-picker> - <el-time-picker
  791. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  792. v-model="timeItem.endTime"
  793. :placeholder="$t('time.endTime')"
  794. style="width:120px;"
  795. format="HH:mm"
  796. value-format="HH:mm"
  797. :picker-options="{
  798. start: '00:00',
  799. end: '23:59',
  800. minTime: timeItem.startTime
  801. }"
  802. @change="iptChangs()">
  803. </el-time-picker>
  804. </span>
  805. </el-form-item>
  806. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  807. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  808. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  809. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  810. ></el-input>
  811. </el-form-item>
  812. </div>
  813. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  814. </div>
  815. <!--照片的显示 -->
  816. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  817. <el-image v-for="(pic, index) in domain.pics" :key="index"
  818. style="width: 100px; height: 100px; margin-right:10px;"
  819. :src="pic"
  820. :preview-src-list="domain.pics">
  821. </el-image>
  822. </p>
  823. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  824. </div>
  825. <span id="workFormsItemBottom"></span>
  826. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  827. </el-form>
  828. </div>
  829. <span slot="footer" class="dialog-footer">
  830. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  831. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  832. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  833. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  834. <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>
  835. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  836. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  837. </span>
  838. </el-dialog>
  839. <!-- 按周填报 -->
  840. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  841. <!-- 按周填报-已填工时-点击 -->
  842. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  843. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  844. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  845. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  846. <el-table-column prop="state" :label="$t('state.states')">
  847. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  848. </el-table-column>
  849. <!-- <el-table-column label="操作">
  850. <template slot-scope="scope">
  851. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  852. </template>
  853. </el-table-column> -->
  854. </el-table>
  855. <span slot="footer" class="dialog-footer">
  856. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  857. </span>
  858. </el-dialog>
  859. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  860. <el-form-item style="height:30px;margin-top:-72px;">
  861. <!-- <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> -->
  862. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  863. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  864. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  865. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  866. <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>
  867. <el-option
  868. v-for="item in fillProjectList"
  869. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  870. :key="item.id"
  871. :label="item.projectName + '\u3000' + item.projectCode"
  872. :value="item.id">
  873. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  874. <span style="float: right">{{ item.projectName }}</span>
  875. </el-option>
  876. </el-select>
  877. <span style="float:right;margin-right:10px;">选择项目</span>
  878. </el-form-item>
  879. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  880. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  881. <template slot-scope="scope">
  882. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  883. </template>
  884. </el-table-column>
  885. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  886. <template slot-scope="scope">
  887. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  888. <p v-else></p>
  889. </template>
  890. </el-table-column> -->
  891. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  892. <template slot-scope="scope">
  893. <div v-if="scope.row.canFill == 1">
  894. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  895. <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>
  896. <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>
  897. <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>
  898. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  899. </div>
  900. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  901. <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>
  902. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  903. </div>
  904. </div>
  905. <div v-else >
  906. <span style="color:#999999;">不可超前填报</span>
  907. </div>
  908. </template>
  909. </el-table-column>
  910. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  911. <template slot-scope="scope">
  912. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  913. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  914. </template>
  915. </el-table-column>
  916. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  917. <template slot-scope="scope">
  918. <div class="zhiss">
  919. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  920. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  921. </div>
  922. </template>
  923. </el-table-column>
  924. </el-table>
  925. </el-form>
  926. <span slot="footer" class="dialog-footer" >
  927. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  928. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  929. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  930. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  931. </span>
  932. </el-dialog>
  933. <!-- 重庆物奇私人定制的按周填报 -->
  934. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  935. <div class="fillWeekDialogVisiCustom">
  936. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  937. </div>
  938. </el-dialog>
  939. <!-- 选择时间 -->
  940. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  941. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  942. <span slot="footer" class="dialog-footer">
  943. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  944. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  945. </span>
  946. </el-dialog>
  947. <!-- 按周填报弹窗 -->
  948. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  949. <div>
  950. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  951. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  952. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  953. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  954. </el-select>
  955. </div>
  956. <!--如果设置了工时成本预警的预算成本项-->
  957. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  958. <p>{{$t('lable.budgetSource')}}</p>
  959. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  960. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  961. </el-select>
  962. </div>
  963. <!-- 任务分组 -->
  964. <div class="zhoFel" v-if="user.company.packageProject == 1">
  965. <p>{{$t('lable.taskGrouping')}}</p>
  966. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  967. @change="getGroupStages(zhoBao, 0)">
  968. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  969. </el-select>
  970. </div>
  971. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  972. <p>{{$t('other.inputStage')}}</p>
  973. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  974. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  975. </el-select>
  976. </div>
  977. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  978. <p>{{$t('other.reviewer')}}</p>
  979. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  980. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  981. </el-select>
  982. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  983. </div>
  984. <template v-if="user.timeType.reportAuditType == 3">
  985. <div class="zhoFel">
  986. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  987. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  988. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  989. </el-select>
  990. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  991. </div>
  992. <div class="zhoFel">
  993. <p>{{ $t('di-er-shen-he-ren') }}</p>
  994. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  995. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  996. </el-select>
  997. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  998. </div>
  999. <div class="zhoFel">
  1000. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1001. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1002. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1003. </el-select>
  1004. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1005. </div>
  1006. <div class="zhoFel">
  1007. <p>{{ $t('chao-song-ren') }}</p>
  1008. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1009. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1010. </el-select>
  1011. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1012. </div>
  1013. </template>
  1014. <!-- 自定义维度 -->
  1015. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1016. <p>{{user.timeType.customDegreeName}}</p>
  1017. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1018. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1019. </el-select>
  1020. </div>
  1021. <!-- 自定义数值 -->
  1022. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1023. <p>{{user.timeType.customDataName}}</p>
  1024. <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>
  1025. </div>
  1026. <!-- 自定义文本 -->
  1027. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1028. <p>{{user.timeType.customTextName}}</p>
  1029. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1030. </div>
  1031. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1032. <p>{{$t('other.timeSelection')}}</p>
  1033. <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>
  1034. </div>
  1035. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1036. <p>{{$t('other.chooseDuration')}}</p>
  1037. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1038. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1039. </el-select>
  1040. </div>
  1041. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1042. <p>{{$t('lable.percentageOfTime')}}</p>
  1043. <div style="width:400px;display: flex;align-items: center;">
  1044. <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>
  1045. <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>
  1046. </div>
  1047. </div>
  1048. <div class="zhoFel">
  1049. <p>{{$t('other.workMatters')}}</p>
  1050. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1051. </div>
  1052. </div>
  1053. <span slot="footer" class="dialog-footer">
  1054. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1055. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1056. </span>
  1057. </el-dialog>
  1058. <!--导出报表条件选择 -->
  1059. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1060. <el-form ref="form3" :model="exportParam" >
  1061. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1062. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1063. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1064. </el-select>
  1065. </el-form-item>
  1066. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1067. <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>
  1068. <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>
  1069. </el-form-item>
  1070. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1071. <el-date-picker
  1072. v-model="exportParam.dateRange" :editable="false"
  1073. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1074. :range-separator="$t('other.to')"
  1075. type="daterange"
  1076. :start-placeholder="$t('time.startDate')"
  1077. :end-placeholder="$t('time.endDate')"
  1078. ></el-date-picker>
  1079. </el-form-item>
  1080. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1081. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1082. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1083. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1084. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1085. </el-select>
  1086. </el-form-item>
  1087. </el-form>
  1088. <div slot="footer" class="dialog-footer">
  1089. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  1090. </div>
  1091. </el-dialog>
  1092. <!--导出报表条件选择 -->
  1093. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1094. <el-form ref="form3" :model="exportParam" >
  1095. <el-form-item prop="range" :label="$t('time.dateRange')">
  1096. <el-date-picker
  1097. v-model="exportParam.dateRange" :editable="false"
  1098. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1099. :clearable="true"
  1100. :range-separator="$t('other.to')"
  1101. type="daterange"
  1102. :start-placeholder="$t('time.startDate')"
  1103. :end-placeholder="$t('time.endDate')"
  1104. ></el-date-picker>
  1105. </el-form-item>
  1106. </el-form>
  1107. <div slot="footer" class="dialog-footer">
  1108. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1109. </div>
  1110. </el-dialog>
  1111. <!--人员列表 -->
  1112. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1113. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1114. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1115. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1116. <el-table-column type="selection"></el-table-column>
  1117. <el-table-column prop="label" :label="$t('lable.name')" >
  1118. <template slot-scope="scope">
  1119. <span>
  1120. <!-- {{(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}} -->
  1121. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1122. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1123. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1124. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1125. </span>
  1126. <span v-else>
  1127. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1128. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1129. </span>
  1130. </span>
  1131. </template>
  1132. </el-table-column>
  1133. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1134. <template slot-scope="scope">
  1135. <div>
  1136. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1137. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1138. </div>
  1139. </template>
  1140. </el-table-column>
  1141. </el-table>
  1142. </el-tab-pane>
  1143. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1144. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1145. <el-table-column prop="label" :label="$t('lable.name')" >
  1146. <template slot-scope="scope">
  1147. <!-- <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> -->
  1148. <!-- <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> -->
  1149. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1150. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1151. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1152. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1153. </span>
  1154. <span v-else>
  1155. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1156. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1157. </span>
  1158. </template>
  1159. </el-table-column>
  1160. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1161. <template slot-scope="scope">
  1162. <div>
  1163. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1164. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1165. </div>
  1166. </template>
  1167. </el-table-column>
  1168. </el-table>
  1169. </el-tab-pane>
  1170. </el-tabs>
  1171. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1172. <el-table-column type="selection"></el-table-column>
  1173. <el-table-column prop="label" :label="$t('lable.name')" >
  1174. <template slot-scope="scope">
  1175. <div>
  1176. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1177. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1178. </div>
  1179. </template>
  1180. </el-table-column>
  1181. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1182. <template slot-scope="scope">
  1183. <div>
  1184. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1185. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1186. </div>
  1187. </template>
  1188. </el-table-column>
  1189. </el-table>
  1190. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1191. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1192. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1193. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1194. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1195. </div>
  1196. </el-dialog>
  1197. <!-- 按部门选择人员 -->
  1198. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1199. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1200. <div class="tree" style="height:400px">
  1201. <el-scrollbar style="height:100%">
  1202. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1203. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1204. highlight-current :filter-node-method="filterNode">
  1205. <span class="custom-tree-node" slot-scope="{ node }">
  1206. <span v-if="user.userNameNeedTranslate == '1'">
  1207. <span v-if="node.data.children">
  1208. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1209. </span>
  1210. <span v-else>
  1211. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1212. </span>
  1213. </span>
  1214. <span v-if="user.userNameNeedTranslate != '1'">
  1215. {{ node.label }}
  1216. </span>
  1217. </span>
  1218. </el-tree>
  1219. </el-scrollbar>
  1220. </div>
  1221. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1222. <div slot="footer" class="dialog-footer">
  1223. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1224. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1225. </div>
  1226. </el-dialog>
  1227. <el-dialog
  1228. v-if="monthWorkTimeDialog"
  1229. :visible.sync="monthWorkTimeDialog"
  1230. :close-on-click-modal="false"
  1231. customClass="customWidth selectworktime"
  1232. width="63%"
  1233. title=""
  1234. >
  1235. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1236. <el-tabs v-model="activeName" @tab-click="handleClick">
  1237. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1238. <div class="selectworktime_export" style="margin-top:10px;">
  1239. <div class="selectworktime_export_l">
  1240. <el-date-picker
  1241. class="selecteworktime_datapick"
  1242. v-model="WorktimeDatepickValue"
  1243. value-format="yyyy-MM-dd"
  1244. type="daterange"
  1245. align="right"
  1246. unlink-panels
  1247. :range-separator="$t('other.to')"
  1248. :start-placeholder="$t('time.startDate')"
  1249. :end-placeholder="$t('time.endDate')"
  1250. :default-time="['12:00:00', '12:00:00']"
  1251. size="small"
  1252. popper-class="selecteorktime_datapick_popper"
  1253. @change="showMonthWorkTime()"
  1254. >
  1255. </el-date-picker>
  1256. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1257. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1258. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1259. <!-- 222 -->
  1260. </div>
  1261. <div>
  1262. <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">
  1263. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1264. </el-input>
  1265. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1266. </div>
  1267. <el-link
  1268. type="primary"
  1269. style="float: right; vertical-align: middle;height:32px"
  1270. @click="exportMembWorkHours()"
  1271. >{{$t('export.exportData')}}</el-link
  1272. >
  1273. </div>
  1274. <el-table ref="hasworkTbl"
  1275. :data="monthWorkDataS"
  1276. v-el-table-infinite-scroll="listScroll"
  1277. border
  1278. :height="500"
  1279. highlight-current-row
  1280. style="width: 100%"
  1281. v-loading="tbload"
  1282. :lazy="true"
  1283. >
  1284. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1285. <template slot-scope="scope">
  1286. {{ scope.$index + 1 }}
  1287. </template>
  1288. </el-table-column>
  1289. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1290. <template slot-scope="scope">
  1291. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1292. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1293. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1294. <!-- {{scope.row.name}} -->
  1295. </span>
  1296. </template>
  1297. </el-table-column>
  1298. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1299. <template slot-scope="scope">
  1300. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1301. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1302. </template>
  1303. </el-table-column>
  1304. <el-table-column
  1305. min-width="105"
  1306. v-for="(item, index) in pickDateArray"
  1307. :key="index"
  1308. :label="item.label"
  1309. align="center"
  1310. >
  1311. <template slot-scope="scope">
  1312. <div
  1313. style="color: red"
  1314. v-if="
  1315. scope.row.worktimeList.filter(
  1316. (w) =>
  1317. w.createDate==item.date
  1318. ).length > 0 &&
  1319. scope.row.worktimeList.filter(
  1320. (w) =>w.createDate==item.date
  1321. )[0].workingTime < reportTimeType.allday
  1322. "
  1323. >
  1324. {{
  1325. scope.row.worktimeList.filter(
  1326. (w) =>w.createDate==item.date
  1327. )[0].workingTime.toFixed(1)
  1328. }}
  1329. </div>
  1330. <div
  1331. style="color: #20a0ff"
  1332. v-if="
  1333. scope.row.worktimeList.filter(
  1334. (w) =>w.createDate==item.date
  1335. ).length > 0 &&
  1336. scope.row.worktimeList.filter(
  1337. (w) =>w.createDate==item.date
  1338. )[0].workingTime > reportTimeType.allday
  1339. "
  1340. >
  1341. {{
  1342. scope.row.worktimeList.filter(
  1343. (w) =>w.createDate==item.date
  1344. )[0].workingTime.toFixed(1)
  1345. }}
  1346. </div>
  1347. <div
  1348. v-if="
  1349. scope.row.worktimeList.filter(
  1350. (w) =>w.createDate==item.date
  1351. ).length > 0 &&
  1352. scope.row.worktimeList.filter(
  1353. (w) =>w.createDate==item.date
  1354. )[0].workingTime == reportTimeType.allday
  1355. "
  1356. >
  1357. {{
  1358. scope.row.worktimeList.filter(
  1359. (w) =>w.createDate==item.date
  1360. )[0].workingTime
  1361. }}
  1362. </div>
  1363. <div
  1364. v-if="
  1365. scope.row.worktimeList.filter(
  1366. (w) =>w.createDate==item.date
  1367. ).length == 0
  1368. "
  1369. >
  1370. 0
  1371. </div>
  1372. <div
  1373. v-if="
  1374. scope.row.worktimeList.filter(
  1375. (w) =>w.createDate==item.date
  1376. ).length > 0 &&
  1377. typeof scope.row.worktimeList.filter(
  1378. (w) =>w.createDate==item.date
  1379. )[0].workingTime == 'string'
  1380. "
  1381. >
  1382. {{
  1383. scope.row.worktimeList.filter(
  1384. (w) =>w.createDate==item.date
  1385. )[0].workingTime
  1386. }}
  1387. </div>
  1388. </template>
  1389. </el-table-column>
  1390. </el-table>
  1391. <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>
  1392. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1393. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1394. <label style="font-size: 16px">员工每日已填报工时数</label>
  1395. <el-link
  1396. type="primary"
  1397. style="float: right; margin-right: 60px"
  1398. @click="exportMembWorkHours()"
  1399. >导出已填报数据</el-link
  1400. > -->
  1401. <!-- <el-button >导出</el-button> -->
  1402. <!-- </div> -->
  1403. </el-tab-pane>
  1404. <el-tab-pane label="未提交人员列表" name="second" >
  1405. <div class="selectworktime_export" style="margin-top:10px">
  1406. <div class="selectworktime_export_l">
  1407. <el-date-picker
  1408. class="selecteworktime_datapick"
  1409. v-model="WorktimeDatepickValue"
  1410. value-format="yyyy-MM-dd"
  1411. type="daterange"
  1412. align="right"
  1413. unlink-panels
  1414. :range-separator="$t('other.to')"
  1415. :start-placeholder="$t('time.startDate')"
  1416. :end-placeholder="$t('time.endDate')"
  1417. :default-time="['12:00:00', '12:00:00']"
  1418. size="small"
  1419. popper-class="selecteorktime_datapick_popper"
  1420. @change="showMonthNotWorkTime()"
  1421. >
  1422. </el-date-picker>
  1423. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1424. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1425. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1426. </div>
  1427. <div>
  1428. <div style="margin-top:10px;">
  1429. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;" @change="showMonthNotWorkTime()"></el-cascader>
  1430. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1431. </div>
  1432. <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">
  1433. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1434. </el-input>
  1435. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1436. </div>
  1437. <el-link
  1438. type="primary"
  1439. style="float: right; vertical-align: middle;height:32px"
  1440. @click="exportMembNotWorkHours()"
  1441. >{{$t('export.exportData')}}</el-link
  1442. >
  1443. </div>
  1444. <el-table
  1445. ref="hasworkTbl2"
  1446. :data="monthNotWorkDateS"
  1447. v-el-table-infinite-scroll="notListScroll"
  1448. border
  1449. :height="500"
  1450. highlight-current-row
  1451. style="width: 100%"
  1452. v-loading="tbload"
  1453. lazy
  1454. >
  1455. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1456. <template slot-scope="scope">
  1457. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1458. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1459. </template>
  1460. </el-table-column>
  1461. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1462. <template slot-scope="scope">
  1463. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1464. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1465. </template>
  1466. </el-table-column>
  1467. <el-table-column
  1468. min-width="200"
  1469. :label="$t('weekDay.date')"
  1470. align="center"
  1471. prop="createDate"
  1472. >
  1473. </el-table-column>
  1474. <el-table-column
  1475. min-width="200"
  1476. :label="$t('state.states')"
  1477. align="center"
  1478. prop="status"
  1479. />
  1480. <el-table-column
  1481. min-width="200"
  1482. :label="$t('other.attendanceData')"
  1483. prop="cardTime"
  1484. align="center"
  1485. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1486. </el-table>
  1487. <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>
  1488. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1489. </el-tab-pane>
  1490. </el-tabs>
  1491. </el-dialog>
  1492. <!--驳回弹出框 -->
  1493. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1494. <div>
  1495. <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')" />
  1496. </div>
  1497. <div slot="footer" class="dialog-footer">
  1498. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1499. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1500. </div>
  1501. </el-dialog>
  1502. <!-- 通过弹出框 -->
  1503. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1504. <div>
  1505. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1506. </div>
  1507. <div slot="footer" class="dialog-footer">
  1508. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1509. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1510. </div>
  1511. </el-dialog>
  1512. <!--批量导入日报 -->
  1513. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1514. <p>1. {{$t('other.download')}}
  1515. <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>
  1516. </p>
  1517. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1518. <p style="display: flex;justify-content: center;">
  1519. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1520. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1521. </el-upload>
  1522. </p>
  1523. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1524. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1525. </div>
  1526. </el-dialog>
  1527. <!-- 工时导入记录弹窗 -->
  1528. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1529. <div style="height: 452px">
  1530. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1531. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1532. <el-table-column prop="userName" :label="$t('other.operator')">
  1533. <template slot-scope="scope">
  1534. <div>
  1535. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1536. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1537. </div>
  1538. </template>
  1539. </el-table-column>
  1540. <el-table-column prop="datel" :label="$t('other.document')">
  1541. <template slot-scope="scope">
  1542. <div>
  1543. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1544. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1545. </div>
  1546. </template>
  1547. </el-table-column>
  1548. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1549. <template slot-scope="scope">
  1550. <div>
  1551. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1552. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1553. </div>
  1554. </template>
  1555. </el-table-column>
  1556. </el-table>
  1557. <el-col :span="24" class="paginatis">
  1558. <el-pagination
  1559. @size-change="handleSizeChange"
  1560. @current-change="handleCurrentChange"
  1561. :page-sizes="[20 , 50 , 80 , 100]"
  1562. :page-size="20"
  1563. layout="total, sizes, prev, pager, next"
  1564. :total="toViewForm.total"
  1565. style="float:right;"
  1566. ></el-pagination>
  1567. </el-col>
  1568. </div>
  1569. </el-dialog>
  1570. <!--基于企业微信考勤数据的工时导入 -->
  1571. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1572. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1573. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1574. </el-step>
  1575. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1576. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1577. </el-steps>
  1578. <div v-if="active==0" style="padding:30px;height:360px;">
  1579. <div style="margin-top:50px;margin-left:280px;">
  1580. <el-date-picker
  1581. v-model="importWxParam.date" :editable="false"
  1582. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1583. :clearable="true"
  1584. :range-separator="$t('other.to')"
  1585. type="daterange"
  1586. :start-placeholder="$t('time.startDate')"
  1587. :end-placeholder="$t('time.endDate')"
  1588. @change="loadCheckInData"
  1589. ></el-date-picker>
  1590. </div>
  1591. </div>
  1592. <div v-if="active==1" style="padding:10px;">
  1593. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1594. style="width: 100%;margin-top:5px;" >
  1595. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1596. <template slot-scope="scope">
  1597. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1598. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1599. </template>
  1600. </el-table-column>
  1601. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1602. </el-table-column>
  1603. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1604. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1605. <template slot-scope="scope">
  1606. <div>
  1607. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1608. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1609. </div>
  1610. </template>
  1611. </el-table-column>
  1612. <el-table-column prop="departmentName" label="部门" >
  1613. <template slot-scope="scope">
  1614. <div>
  1615. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1616. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1617. </div>
  1618. </template>
  1619. </el-table-column>
  1620. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1621. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1622. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1623. <template slot-scope="scope">
  1624. {{scope.row.workHours.toFixed(1)}}h
  1625. </template>
  1626. </el-table-column>
  1627. </el-table>
  1628. </div>
  1629. <div v-if="active==2" >
  1630. <p style="display: flex;justify-content: center;height:390px;">
  1631. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1632. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1633. </el-upload>
  1634. </p>
  1635. </div>
  1636. <div slot="title">
  1637. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1638. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1639. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1640. <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>
  1641. <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>
  1642. <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>
  1643. </div>
  1644. <span slot="footer">
  1645. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1646. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1647. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1648. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1649. </span>
  1650. </el-dialog>
  1651. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1652. <p style="display: flex;justify-content: center;height:100px;">
  1653. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1654. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1655. </el-upload>
  1656. </p>
  1657. </el-dialog>
  1658. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1659. <div>
  1660. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1661. v-model="deleteReportParam.date" :editable="false"
  1662. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1663. :clearable="true"
  1664. :range-separator="$t('other.to')"
  1665. type="daterange"
  1666. :start-placeholder="$t('time.startDate')"
  1667. :end-placeholder="$t('time.endDate')"
  1668. ></el-date-picker>
  1669. </div>
  1670. <div style="margin-top:10px;">
  1671. <span>请选择部门:</span>
  1672. <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>
  1673. <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>
  1674. </div>
  1675. <div style="margin-top:10px;">
  1676. <span>请选择员工:</span>
  1677. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1678. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1679. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1680. <span v-else>{{item.name}}</span>
  1681. </el-option>
  1682. </el-select>
  1683. </div>
  1684. <span slot="footer">
  1685. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1686. </span>
  1687. </el-dialog>
  1688. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1689. <div>
  1690. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1691. v-model="deleteReportParam.date" :editable="false"
  1692. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1693. :clearable="true"
  1694. :range-separator="$t('other.to')"
  1695. type="daterange"
  1696. :start-placeholder="$t('time.startDate')"
  1697. :end-placeholder="$t('time.endDate')"
  1698. ></el-date-picker>
  1699. </div>
  1700. <div style="margin-top:15px;">
  1701. <span>选择部门:</span>
  1702. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1703. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1704. size="small" v-if="user.userNameNeedTranslate != 1"
  1705. ></el-cascader>
  1706. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1707. </div>
  1708. <span slot="footer">
  1709. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1710. </span>
  1711. </el-dialog>
  1712. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1713. <div>
  1714. <span>选择时间:</span><el-date-picker
  1715. v-model="modImportTime"
  1716. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1717. :clearable="true"
  1718. type="datetime"
  1719. ></el-date-picker>
  1720. <span>选择导入人员:</span><el-select
  1721. v-model="modImportUserId"
  1722. >
  1723. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1724. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1725. <span v-else>{{item.name}}</span>
  1726. </el-option>
  1727. </el-select>
  1728. </div>
  1729. <span slot="footer">
  1730. <el-button @click="confirmChangeModTime" >确认</el-button>
  1731. </span>
  1732. </el-dialog>
  1733. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1734. <div>
  1735. <span>请选择年月:</span>
  1736. <el-date-picker
  1737. v-model="ratioYmonth" :editable="false"
  1738. format="yyyyMM" value-format="yyyyMM"
  1739. type="month"
  1740. ></el-date-picker>
  1741. </div>
  1742. <span slot="footer">
  1743. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1744. </span>
  1745. </el-dialog>
  1746. <!--工时批量代填 -->
  1747. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1748. <div>
  1749. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1750. v-model="importWxParam.date" :editable="false"
  1751. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1752. :clearable="true"
  1753. :range-separator="$t('other.to')"
  1754. type="daterange"
  1755. :start-placeholder="$t('time.startDate')"
  1756. :end-placeholder="$t('time.endDate')"
  1757. @change="loadCheckInData"
  1758. ></el-date-picker>
  1759. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1760. </div>
  1761. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1762. :key="timeStamp"
  1763. style="width: 100%;margin-top:5px;" ref="tab">
  1764. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1765. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1766. <template slot-scope="scope">
  1767. <div>
  1768. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1769. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1770. </div>
  1771. </template>
  1772. </el-table-column>
  1773. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1774. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1775. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1776. <template slot-scope="scope">
  1777. {{scope.row.workHours.toFixed(1)}}h
  1778. </template>
  1779. </el-table-column>
  1780. <!--项目名称列表 -->
  1781. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1782. <template slot-scope="scope">
  1783. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1784. </template>
  1785. </el-table-column>
  1786. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1787. <template slot-scope="scope">
  1788. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1789. </template>
  1790. </el-table-column>
  1791. </el-table>
  1792. </el-dialog>
  1793. <!--基于企业微信考勤数据的工时导入 -->
  1794. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1795. <div style="padding-bottom:10px;">
  1796. <p>{{importResultMsg}}</p>
  1797. </div>
  1798. <!-- <span slot="footer" class="dialog-footer">
  1799. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1800. </span> -->
  1801. </el-dialog>
  1802. <!-- 审核流程展示 -->
  1803. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1804. <div style="padding:20px 40px 20px 0">
  1805. <el-timeline :reverse="false">
  1806. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1807. <!-- {{item.msg}} -->
  1808. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1809. <span v-if="user.userNameNeedTranslate == 1">
  1810. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1811. <span>{{item.msgCon.two}}</span>
  1812. </span>
  1813. </el-timeline-item>
  1814. </el-timeline>
  1815. </div>
  1816. </el-dialog>
  1817. </section>
  1818. </template>
  1819. <script>
  1820. // 左右滑动
  1821. import dragMixin from "@/common/js/tensile.js";
  1822. import util from "../../common/js/util";
  1823. // 自定义select组件
  1824. import selectCat from "@/components/select.vue"
  1825. // 引入自定义级联组件
  1826. import vueCascader from "@/components/cascader.vue"
  1827. // 重庆物奇定制组件
  1828. import WeeklyCustomization from "./weeklyCustomization.vue"
  1829. import { mapMutations } from 'vuex'
  1830. let _that = this
  1831. export default {
  1832. mixins: [dragMixin],
  1833. components: {
  1834. selectCat,
  1835. vueCascader,
  1836. WeeklyCustomization
  1837. },
  1838. data() {
  1839. return {
  1840. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1841. jobResponseList:[],
  1842. yisibeiCompId: 3092,
  1843. yuzhongCompId: 3385,
  1844. mingyiName : '成都明夷电子科技有限公司',
  1845. // mingyiName : '明夷',
  1846. modItemDataId: null,
  1847. modImportTime: null,
  1848. modImportUserId: null,
  1849. showModImportTimeDialog: false,
  1850. showBatchSimpleApproveReport: false,
  1851. startDeleting: false,
  1852. showBatchDeleteReport: false,
  1853. deleteReportParam: {date:null, userIds:[]},
  1854. isDenying: false,
  1855. targetWeekDate: null,//填写周报中的周日期
  1856. importCardTimeVisi: false,
  1857. startRatioExporting: false,
  1858. exportUserRatio: false,
  1859. ratioYmonth:null,
  1860. hasWrittenReport: false,
  1861. today:null,
  1862. syncTimeLoading: false,
  1863. seluserText: '',
  1864. translation: '1', // 1、文字, 2、部门, 3、人员
  1865. exportLoad: false,
  1866. getPickerOptions: {
  1867. disabledDate: (time) => {
  1868. var date = new Date();
  1869. var year = date.getFullYear();
  1870. var month = date.getMonth() + 1;
  1871. if (month >= 1 && month <= 9) {
  1872. month = "0" + month;
  1873. }
  1874. var currentdate = year.toString() + month.toString();
  1875. var timeyear = time.getFullYear();
  1876. var timemonth = time.getMonth() + 1;
  1877. if (timemonth >= 1 && timemonth <= 9) {
  1878. timemonth = "0" + timemonth;
  1879. }
  1880. var timedate = timeyear.toString() + timemonth.toString();
  1881. if(this.user.timeType.fillAhead == 0){
  1882. return currentdate < timedate;
  1883. }else{
  1884. return false
  1885. }
  1886. }
  1887. },
  1888. alalal: '8.0',
  1889. timeBasecostList:null,
  1890. tbload: false,
  1891. exportTimeDialog: false,
  1892. searchKeyword: '',
  1893. monthWorkDataS: [],
  1894. monthNotWorkDateS: [],
  1895. pickDateArray:[],
  1896. WorktimeDatepickValue: [],
  1897. activeName:"first",
  1898. isLeave: 0,
  1899. submitingReport: false,
  1900. importResultMsg:null,
  1901. showImportResult:false,
  1902. importingData: false,
  1903. isDraft: 0,
  1904. timeStamp: 0,
  1905. projectColumns:[],
  1906. checkinLoading:false,
  1907. importWxParam:{date:null,},
  1908. active:0,
  1909. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1910. importWxDialog:false,
  1911. importDialog:false,
  1912. denyForm:null,
  1913. denyReasonDialog:false,
  1914. monthWorkTimeDialog: false,
  1915. isSubstitude:false,
  1916. isFill:false,
  1917. unFillList:[],
  1918. fillList:[],
  1919. fillMembList:[],
  1920. fillMembList_leave: [],
  1921. membListVisible: false,
  1922. isBatch:0,//是否是批量填报
  1923. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1924. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1925. 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')],
  1926. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1927. fillStatusList: [],
  1928. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1929. exportDialog:false,
  1930. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1931. subProjectList:[],
  1932. canEdit: true,
  1933. originCanEdit: true,
  1934. timeRange:[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],
  1935. selectTime:null,
  1936. reportTimeType:{},
  1937. curDate:'',
  1938. isAllSelect: false,
  1939. approveDialogVisible:false,
  1940. deptId:null,
  1941. targetUid: null,
  1942. membCount:0,
  1943. selectState:"-1",
  1944. user: JSON.parse(sessionStorage.getItem("user")),
  1945. allUsersList: [],
  1946. showAddMore:false,
  1947. allDate: [],
  1948. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1949. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1950. choseDay: 0,
  1951. tableHeight: 0,
  1952. listLoading: false,
  1953. projectList: [], //项目列表
  1954. fillProjectList: [],
  1955. reportList: [], //日报列表
  1956. reportNames:[], //批量审批列表
  1957. selCon:[], //筛选条件
  1958. selProjectList:[], //筛选后项目列表
  1959. selConShow: true,
  1960. usersList: [], // 全部人员列表
  1961. usersListId: '', // 选中的人员id
  1962. dialogVisible: false, //项目弹窗
  1963. report: '',
  1964. workForm: {
  1965. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1966. domains: [{
  1967. id: null,
  1968. projectId: "",
  1969. workingTime: "",
  1970. timeType:0,
  1971. content: "",
  1972. state: 2,
  1973. multiWorktime:0,
  1974. worktimeList:[],
  1975. degreeId: null,
  1976. auditUserList: [],
  1977. }],
  1978. },
  1979. workRules: {
  1980. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  1981. },
  1982. chooseParticipVisible: false,
  1983. logining: false,
  1984. isDisable: false,
  1985. timeType:[],
  1986. deptMembData: [
  1987. ],
  1988. //部门人员树状结构
  1989. data: [
  1990. {
  1991. id: -1,
  1992. label: this.$t('lable.allStaff'),
  1993. membCount:0
  1994. },
  1995. {
  1996. id: 0,
  1997. label: this.$t('lable.unassigned'),
  1998. }
  1999. ],
  2000. allData:{},
  2001. batchShowData:{},
  2002. option: [],
  2003. deptOptionList: [],
  2004. depData: {
  2005. id: -1,
  2006. label: this.$t('lable.allStaff'),
  2007. },
  2008. defaultProps: {
  2009. children: 'children',
  2010. label: 'label'
  2011. },
  2012. isNew: false,
  2013. selected: false,
  2014. valuet: new Date(),
  2015. domObj: null,
  2016. participator:[],
  2017. chosenMembCount:0,
  2018. jsDay: 0,
  2019. jsTime: 0,
  2020. falsss: false,
  2021. weidu: [],
  2022. weiduList: [],
  2023. yonghuUser: [],
  2024. dateAr: [],
  2025. batchSubFillDialog: false,
  2026. isSubstiS: false,
  2027. fillWeekDialogVisi: false,
  2028. fillWeekDialogVisiCustom: false,
  2029. zhoData: [],
  2030. weekDateRange: [],
  2031. btnZho: false,
  2032. weekDataLoading: false,
  2033. changdu: 6,
  2034. tianxieDialogVisible: false,
  2035. scopess: {},
  2036. zhoBao: {
  2037. time: '',
  2038. workingTime: '',
  2039. progress: '',
  2040. con: '',
  2041. subProjectId: '',
  2042. stage: '',
  2043. subProjectList: [],
  2044. stages: [],
  2045. },
  2046. zhoBaoIdx: '',
  2047. zhoBaoName: '',
  2048. zhis: {},
  2049. dealList: [],
  2050. toViewDialogVisible: false,
  2051. toViewList: [],
  2052. toViewloading: true,
  2053. toViewForm: {
  2054. pageIndex: '1',
  2055. pageSize: '20',
  2056. total: 0,
  2057. },
  2058. toViewloadings: false,
  2059. tabPositionss: 'top',
  2060. monthTotal: 0,
  2061. monthTotalPage: 0,
  2062. monthTotalLages: 20,
  2063. monthWorkData: [],
  2064. monthNotWorkDate: [],
  2065. monthWorkDataS1: [],
  2066. monthnotTotal: 0,
  2067. monthnotTotalPage: 0,
  2068. monthnotTotalLages: 20,
  2069. monthNotWorkDateS1: [],
  2070. deptMembDataText: '',
  2071. isFlag: false,
  2072. isMore: false,
  2073. stateKey: '0',
  2074. expandDate: [],
  2075. notifySelList:[],
  2076. departmentList: [],
  2077. approvalProcessDialog: false,
  2078. approvalProcessData: [],
  2079. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2080. 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')],
  2081. isWeekend: false,
  2082. canCancelInDialog: false,
  2083. approveinData: {},
  2084. approveinDialog: false,
  2085. reportCanDelete: false,
  2086. weeklyFilledTimeDialog: false,
  2087. weeklyFilledTimeList: [],
  2088. weeklyFilledTimeLoading: false,
  2089. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2090. weeklyFilledTimeCanDelete: false,
  2091. weeklyFilledTimeDate: null,
  2092. leaveAllNum: 0,
  2093. dataLoading: false,
  2094. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2095. vacationTime: {},
  2096. integrationProjectList: [],
  2097. totalReportHours: 0, // 合计的工时
  2098. workTimeForMinYi:0,
  2099. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2100. weekIndex: 1,
  2101. weekParentData: {},
  2102. deptIdForNoReport:[],
  2103. };
  2104. },
  2105. watch: {
  2106. deptMembDataText(val) {
  2107. this.$refs.chooseMembTree.filter(val);
  2108. }
  2109. },
  2110. filters: {
  2111. // 过滤
  2112. amounts(value) {
  2113. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2114. return 0
  2115. }
  2116. var zhi = +value + 0
  2117. return zhi.toFixed(1)
  2118. },
  2119. // zhoData
  2120. zhoData(value, arr) {
  2121. var dateArray = value.split("-");
  2122. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2123. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2124. // console.log(arr[date.getDay()])
  2125. // return "周" + "日一二三四五六".charAt(date.getDay());
  2126. return arr[date.getDay()]
  2127. },
  2128. // 过滤数字
  2129. numbers(value) {
  2130. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2131. return 0
  2132. }
  2133. return value
  2134. },
  2135. },
  2136. computed: {},
  2137. mounted() {
  2138. var now = new Date();
  2139. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2140. this.today = t;
  2141. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2142. this.exportParam.dateRange = [startStr,t];
  2143. this.getAllDate(1);
  2144. this.getReportList();
  2145. this.getProjectList();
  2146. this.getFillProjectList();
  2147. this.getTimeType();
  2148. this.getDepartment();
  2149. this.scrollFunction()
  2150. this.userssHu();
  2151. if(this.user.timeType.reportAuditType == 3){
  2152. this.getAllUsersList()
  2153. }
  2154. if (this.user.company.packageProject == 1) {
  2155. this.getBasecostItemList();
  2156. }
  2157. if(this.user.timeType.lockWorktime){
  2158. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2159. }
  2160. const that = this
  2161. if(this.user.userNameNeedTranslate == 1) {
  2162. that.dataLoading = that.$store.state.dataLoading
  2163. this.upDataLoading()
  2164. setTimeout(()=>{
  2165. that.dataLoading = that.$store.state.dataLoading
  2166. }, 1000)
  2167. }
  2168. if (this.user.companyId == this.yuzhongCompId) {
  2169. this.getJobResponList();
  2170. }
  2171. },
  2172. methods: {
  2173. ...mapMutations(['upDataLoading']),
  2174. //任务被选中
  2175. onTaskSelected(domainItem) {
  2176. //取服务
  2177. if (domainItem.taskId) {
  2178. var that = this;
  2179. this.http.post('/task/getMyTaskService',{taskId:domainItem.taskId},res => {
  2180. if (res.code == "ok") {
  2181. // domainItem.workContentList = res.data;
  2182. that.$set(domainItem, 'serviceList', null);
  2183. that.$set(domainItem, 'serviceList', res.data);
  2184. } else {
  2185. this.$message({
  2186. message: res.msg,
  2187. type: "error"
  2188. });
  2189. }
  2190. },error => {
  2191. this.$message({
  2192. message: error,
  2193. type: "error"
  2194. });
  2195. }
  2196. );
  2197. } else {
  2198. //清空服务
  2199. }
  2200. },
  2201. onBatchTimeChange() {
  2202. //反向计算每日工作时长
  2203. if (this.workForm.createDate) {
  2204. let sdate = new Date(this.workForm.createDate[0]);
  2205. let edate = new Date(this.workForm.createDate[1]);
  2206. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2207. console.log('days===', days)
  2208. if (days < 0) {
  2209. return;
  2210. }
  2211. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2212. //总时长发生改变,自动按比例计算
  2213. this.workForm.domains.forEach(d=>{
  2214. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2215. });
  2216. }
  2217. },
  2218. //更新工作内容列表
  2219. updateJobContent(domainItem) {
  2220. var that = this;
  2221. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2222. if (res.code == "ok") {
  2223. // domainItem.workContentList = res.data;
  2224. that.$set(domainItem, 'extraField3', null);
  2225. that.$set(domainItem, 'workContentList', res.data);
  2226. } else {
  2227. this.$message({
  2228. message: res.msg,
  2229. type: "error"
  2230. });
  2231. }
  2232. },error => {
  2233. this.$message({
  2234. message: error,
  2235. type: "error"
  2236. });
  2237. }
  2238. );
  2239. },
  2240. updateResponse(domainItem) {
  2241. var that = this;
  2242. var selectPid = domainItem.projectId;
  2243. domainItem.extraField2 = null;
  2244. domainItem.extraField3 = null;
  2245. if (selectPid && domainItem.extraField1) {
  2246. //是否非项目
  2247. var isPublic = this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2248. console.log('==========','isPublic=='+isPublic);
  2249. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2250. console.log(filteredRespList);
  2251. domainItem.filteredRespList = filteredRespList;
  2252. }
  2253. },
  2254. getJobResponList() {
  2255. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2256. if (res.code == "ok") {
  2257. this.jobResponseList = res.data;
  2258. } else {
  2259. this.$message({
  2260. message: res.msg,
  2261. type: "error"
  2262. });
  2263. }
  2264. },error => {
  2265. this.$message({
  2266. message: error,
  2267. type: "error"
  2268. });
  2269. }
  2270. );
  2271. },
  2272. openModImportTime(row) {
  2273. this.showModImportTimeDialog = true;
  2274. this.modItemDataId = row.id;
  2275. },
  2276. delImportTime(row) {
  2277. let rowId = row.id;
  2278. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2279. confirmButtonText: this.$t('btn.determine'),
  2280. cancelButtonText: this.$t('btn.cancel'),
  2281. type: "warning"
  2282. })
  2283. .then(() => {
  2284. this.http.post('/report-import-log/delete',{
  2285. id: rowId
  2286. },res => {
  2287. if (res.code == "ok") {
  2288. this.$message({
  2289. message: '删除成功',
  2290. type: "success"
  2291. });
  2292. this.getToView();
  2293. } else {
  2294. this.$message({
  2295. message: res.msg,
  2296. type: "error"
  2297. });
  2298. }
  2299. },error => {
  2300. this.$message({
  2301. message: error,
  2302. type: "error"
  2303. });
  2304. }
  2305. );
  2306. }).catch(() => {this.startDeleting = false});
  2307. },
  2308. confirmChangeModTime() {
  2309. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2310. this.$message({
  2311. message: '请选择时间',
  2312. type: "error"
  2313. });
  2314. return;
  2315. }
  2316. this.http.post('/report-import-log/changeTime',{
  2317. modLogDateTime: this.modImportTime,
  2318. modImportUserId: this.modImportUserId,
  2319. id: this.modItemDataId
  2320. },res => {
  2321. if (res.code == "ok") {
  2322. this.$message({
  2323. message: '修改成功',
  2324. type: "success"
  2325. });
  2326. this.getToView();
  2327. this.showModImportTimeDialog = false;
  2328. } else {
  2329. this.$message({
  2330. message: res.msg,
  2331. type: "error"
  2332. });
  2333. }
  2334. },error => {
  2335. this.$message({
  2336. message: error,
  2337. type: "error"
  2338. });
  2339. }
  2340. );
  2341. },
  2342. confirmBatchApproveReport() {
  2343. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2344. this.$message({
  2345. message: '请选择日期范围',
  2346. type: "error"
  2347. });
  2348. return;
  2349. }
  2350. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2351. confirmButtonText: this.$t('btn.determine'),
  2352. cancelButtonText: this.$t('btn.cancel'),
  2353. type: "warning"
  2354. })
  2355. .then(() => {
  2356. this.startDeleting = true;
  2357. let obj = {
  2358. startDate: this.deleteReportParam.date[0],
  2359. endDate: this.deleteReportParam.date[1]
  2360. }
  2361. if(this.deleteReportParam.departmentId) {
  2362. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2363. } else {
  2364. obj.departmentId = null
  2365. }
  2366. this.http.post('/report/batchApproveByDate',obj,res => {
  2367. if (res.code == "ok") {
  2368. this.$message({
  2369. message: '审核通过',
  2370. type: "success"
  2371. });
  2372. this.getReportList();
  2373. this.getDepartment();
  2374. this.startDeleting = false;
  2375. } else {
  2376. this.$message({
  2377. message: res.msg,
  2378. type: "error"
  2379. });
  2380. }
  2381. },error => {
  2382. this.$message({
  2383. message: error,
  2384. type: "error"
  2385. });
  2386. }
  2387. );
  2388. }).catch(() => {this.startDeleting = false});
  2389. },
  2390. confirmBatchDelReport() {
  2391. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2392. this.$message({
  2393. message: '请选择部门或人员',
  2394. type: "error"
  2395. });
  2396. return;
  2397. }
  2398. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2399. this.$message({
  2400. message: '请选择日期范围',
  2401. type: "error"
  2402. });
  2403. return;
  2404. }
  2405. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2406. confirmButtonText: this.$t('btn.determine'),
  2407. cancelButtonText: this.$t('btn.cancel'),
  2408. type: "warning"
  2409. })
  2410. .then(() => {
  2411. this.startDeleting = true;
  2412. this.http.post('/report/batchDelete',{
  2413. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2414. startDate: this.deleteReportParam.date[0],
  2415. endDate: this.deleteReportParam.date[1],
  2416. deptId: this.deleteReportParam.deptId[0]
  2417. },res => {
  2418. if (res.code == "ok") {
  2419. this.$message({
  2420. message: this.$t('message.successfullyDeleted'),
  2421. type: "success"
  2422. });
  2423. this.getReportList();
  2424. this.getDepartment();
  2425. this.startDeleting = false;
  2426. } else {
  2427. this.$message({
  2428. message: res.msg,
  2429. type: "error"
  2430. });
  2431. }
  2432. },error => {
  2433. this.$message({
  2434. message: error,
  2435. type: "error"
  2436. });
  2437. }
  2438. );
  2439. }).catch(() => {this.startDeleting = false});
  2440. },
  2441. getRecentlyProject() {
  2442. this.http.post('/project/nearProject',{},res => {
  2443. if(res.code == 'ok'){
  2444. let topObj = {
  2445. label: '最近选择项目',
  2446. peojectList: res.data
  2447. }
  2448. let botomObj = {
  2449. label: '全部项目',
  2450. peojectList: this.fillProjectList
  2451. }
  2452. //最近项目如果在fillProjectList中不存在,需要移除
  2453. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2454. this.integrationProjectList = [topObj, botomObj]
  2455. }else {
  2456. this.$message({
  2457. message: res.msg,
  2458. type: 'error'
  2459. })
  2460. }
  2461. },err => {
  2462. this.$message({
  2463. message: err,
  2464. type: 'error'
  2465. })
  2466. })
  2467. },
  2468. handlePictureCardPreview(file, index) {
  2469. console.log(file, index)
  2470. let arr = []
  2471. let imgArr = this.workForm.domains[index].imgListUrl
  2472. for(var i in imgArr) {
  2473. arr.push(imgArr[i].url)
  2474. }
  2475. console.log(arr, '图片数据')
  2476. const $viewer = this.$viewerApi({
  2477. images: arr
  2478. });
  2479. },
  2480. // 图片上传
  2481. addImg(e, index) {
  2482. console.log(e, '数据')
  2483. let formData = new FormData()
  2484. formData.append('multipartFile', e.file)
  2485. this.http.uploadFile('/common/uploadFile', formData,
  2486. res => {
  2487. if (res.code == "ok") {
  2488. this.$message({
  2489. message: this.$t('uploadedsuccessfully'),
  2490. type: "success"
  2491. });
  2492. if(!this.workForm.domains[index].imgList) {
  2493. this.workForm.domains[index].imgList = []
  2494. this.workForm.domains[index].imgListUrl = []
  2495. }
  2496. this.workForm.domains[index].imgList.push(res.data)
  2497. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2498. } else {
  2499. this.$message({message: res.msg,type: "error"});
  2500. }
  2501. console.log(this.workForm.domains[index])
  2502. },
  2503. error => {this.$message({message: error,type: "error"});
  2504. });
  2505. },
  2506. // 删除图片
  2507. delImg(file,fileList, index) {
  2508. console.log(file, fileList)
  2509. let idx = 0
  2510. for(let i in fileList) {
  2511. if(fileList[i].uid == file.uid) {
  2512. idx = i
  2513. }
  2514. }
  2515. this.workForm.domains[index].imgList.splice(idx, 1)
  2516. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2517. console.log(this.workForm.domains[index])
  2518. },
  2519. test(){
  2520. console.log('test',this.workForm.domains);
  2521. },
  2522. getHour(s1, s2) {
  2523. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2524. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2525. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2526. var ms = s2.getTime() - s1.getTime();
  2527. if (ms < 0) return 0;
  2528. let ma = ms / 1000 / 60 / 60
  2529. return ma; //小时
  2530. },
  2531. refreshWXCardTime(workdate) {
  2532. if (!workdate) return;
  2533. this.syncTimeLoading = true;
  2534. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2535. date: workdate,
  2536. },res => {
  2537. this.syncTimeLoading = false;
  2538. if(res.code == 'ok'){
  2539. this.workForm.time = res.data.time;
  2540. }else {
  2541. this.$message({
  2542. message: res.msg,
  2543. type: 'error'
  2544. })
  2545. }
  2546. },err => {
  2547. this.syncTimeLoading = false;
  2548. this.$message({
  2549. message: err,
  2550. type: 'error'
  2551. })
  2552. })
  2553. },
  2554. refreshAttendance(workdate) {
  2555. if (!workdate) return;
  2556. this.syncTimeLoading = true;
  2557. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2558. startDate: workdate[0],
  2559. endDate: workdate[1]
  2560. },res => {
  2561. this.syncTimeLoading = false;
  2562. if(res.code == 'ok'){
  2563. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2564. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2565. this.totalReportHours = this.workTimeForMinYi;
  2566. }else {
  2567. this.$message({
  2568. message: res.msg,
  2569. type: 'error'
  2570. })
  2571. }
  2572. },err => {
  2573. this.syncTimeLoading = false;
  2574. this.$message({
  2575. message: err,
  2576. type: 'error'
  2577. })
  2578. })
  2579. },
  2580. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2581. this.weeklyFilledTimeDialog = true
  2582. this.weeklyFilledTimeLoading = true
  2583. this.weeklyFilledTimeDate = parameterDate
  2584. this.http.post('/report/getReportList',{
  2585. date: parameterDate,
  2586. userId: this.user.id
  2587. },res => {
  2588. this.weeklyFilledTimeLoading = false
  2589. if(res.code == 'ok'){
  2590. this.weeklyFilledTimeList = res.data[0].data
  2591. let candelete = true
  2592. for(let i in this.weeklyFilledTimeList){
  2593. if(this.weeklyFilledTimeList[i].state < 2){
  2594. candelete = false
  2595. }
  2596. }
  2597. this.weeklyFilledTimeCanDelete = candelete
  2598. }else {
  2599. this.$message({
  2600. message: res.msg,
  2601. type: 'error'
  2602. })
  2603. }
  2604. },err => {
  2605. this.weeklyFilledTimeLoading = false
  2606. this.$message({
  2607. message: err,
  2608. type: 'error'
  2609. })
  2610. })
  2611. },
  2612. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2613. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2614. confirmButtonText: this.$t('btn.determine'),
  2615. cancelButtonText: this.$t('btn.cancel'),
  2616. type: "warning"
  2617. })
  2618. .then(() => {
  2619. this.http.post('/report/delete',{
  2620. userId: this.user.id,
  2621. date: this.weeklyFilledTimeDate
  2622. },res => {
  2623. if (res.code == "ok") {
  2624. this.$message({
  2625. message: this.$t('message.successfullyDeleted'),
  2626. type: "success"
  2627. });
  2628. this.getWeeklyWorkTime()
  2629. this.getReportList();
  2630. this.getDepartment();
  2631. this.weeklyFilledTimeDialog = false;
  2632. } else {
  2633. this.$message({
  2634. message: res.msg,
  2635. type: "error"
  2636. });
  2637. }
  2638. },error => {
  2639. this.$message({
  2640. message: error,
  2641. type: "error"
  2642. });
  2643. }
  2644. );
  2645. }).catch(() => {});
  2646. },
  2647. getApprovalProcess(item){
  2648. // console.log('this.date',this.choseDate);
  2649. this.http.post('/report-log/get',{
  2650. creatorId: item.id,
  2651. createDate: sessionStorage.msg
  2652. },res => {
  2653. if(res.code == 'ok'){
  2654. this.approvalProcessDialog = true
  2655. if(this.user.userNameNeedTranslate == 1) {
  2656. for(var i in res.data) {
  2657. let obj = {
  2658. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2659. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2660. }
  2661. res.data[i].msgCon = obj
  2662. }
  2663. }
  2664. this.approvalProcessData = res.data
  2665. console.log(this.approvalProcessData, '数据卡看')
  2666. }else{
  2667. this.$message({
  2668. message: res.msg,
  2669. type: 'error'
  2670. })
  2671. }
  2672. },err => {
  2673. this.$message({
  2674. message: err,
  2675. type: 'error'
  2676. })
  2677. })
  2678. },
  2679. filterNode(value, data) {
  2680. if (!value) return true;
  2681. return data.label.indexOf(value) !== -1;
  2682. },
  2683. triggerCalculateOT(index) {
  2684. var str = this.workForm.domains[index].overtimeHours + ''
  2685. if(str.indexOf('.') != '-1') {
  2686. var s = str.split('.')[0]
  2687. var st = str.split('.')[1]
  2688. var sts = st.split('')
  2689. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2690. }
  2691. },
  2692. searchScreen(e){
  2693. if(e){
  2694. this.monthNotWorkDateS1 = []
  2695. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2696. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2697. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2698. }
  2699. }
  2700. if (this.monthNotWorkDateS1.length > 50) {
  2701. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2702. }else{
  2703. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2704. }
  2705. // if (this.monthNotWorkDateS1.length > 0) {
  2706. // setTimeout(() => {
  2707. // this.tableListenernot()
  2708. // }, 1000);
  2709. // }
  2710. }else{
  2711. this.monthWorkDataS1 = []
  2712. for (let i = 0; i < this.monthWorkData.length; i++) {
  2713. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2714. this.monthWorkDataS1.push(this.monthWorkData[i])
  2715. }
  2716. }
  2717. if (this.monthWorkDataS1.length > 50) {
  2718. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2719. }else{
  2720. this.monthWorkDataS = this.monthWorkDataS1
  2721. }
  2722. // if (this.monthWorkDataS1.length > 0) {
  2723. // setTimeout(() => {
  2724. // this.tableListener()
  2725. // }, 1000);
  2726. // }
  2727. }
  2728. },
  2729. addUpload(data) {
  2730. // var zhi = data.fileName.split('.')[0]
  2731. // var sss = zhi + '.xlsx'
  2732. // return
  2733. var filePath = '/upload/' + data.serverName;
  2734. const a = document.createElement('a'); // 创建a标签
  2735. a.setAttribute('download', data.fileName);// download属性
  2736. a.setAttribute('href', filePath);// href链接
  2737. a.click(); //自执行点击事件
  2738. a.remove();
  2739. },
  2740. restrictNumber(targetId) {
  2741. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2742. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2743. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2744. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2745. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2746. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2747. inpu.value = parseFloat(inpu.value);
  2748. }
  2749. },
  2750. //获取项目下的任务分组
  2751. getTaskGroups(domain, index) {
  2752. domain.groupId=null;
  2753. this.http.post('/task-group/listMyJoinGroup',{
  2754. projectId: domain.projectId,
  2755. isSubstitude: this.isSubstitude ? 1 : 0
  2756. },
  2757. res => {
  2758. if (res.code == "ok") {
  2759. this.workForm.domains[index].taskGroups = res.data;
  2760. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2761. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2762. // this.getGroupStages(domain, index);
  2763. // }
  2764. this.$forceUpdate();
  2765. }
  2766. },
  2767. error => {
  2768. this.$message({
  2769. message: error,
  2770. type: "error"
  2771. });
  2772. }
  2773. );
  2774. },
  2775. //下载填报工时占比报表
  2776. downloadProjectRatio() {
  2777. this.exportUserRatio = true;
  2778. let now = new Date();
  2779. let month = now.getMonth();//默认看上个月的
  2780. let monthStr = month<10? ('0'+month): month;
  2781. this.ratioYmonth = now.getFullYear()+''+monthStr;
  2782. },
  2783. confirmDownloadRatio() {
  2784. this.startRatioExporting = true;
  2785. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2786. ymonth: this.ratioYmonth
  2787. },
  2788. res => {
  2789. if (res.code == "ok") {
  2790. this.startRatioExporting = false;
  2791. var filePath = res.data;
  2792. const a = document.createElement('a'); // 创建a标签
  2793. var data = filePath.split("/");
  2794. a.setAttribute('download', data[data.length-1]);// download属性
  2795. a.setAttribute('href', filePath);// href链接
  2796. a.click(); //自执行点击事件
  2797. a.remove();
  2798. } else {
  2799. this.startRatioExporting = false;
  2800. this.$message({
  2801. message: res.msg,
  2802. type: "error"
  2803. });
  2804. }
  2805. },
  2806. error => {
  2807. this.checkinLoading = false;
  2808. this.$message({
  2809. message: error,
  2810. type: "error"
  2811. });
  2812. }
  2813. );
  2814. },
  2815. //下载带企业微信考勤数据的工时统计模板
  2816. downloadCheckInExcel() {
  2817. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2818. startDate: this.importWxParam.date[0],
  2819. endDate: this.importWxParam.date[1],
  2820. },
  2821. res => {
  2822. if (res.code == "ok") {
  2823. var filePath = res.data;
  2824. const a = document.createElement('a'); // 创建a标签
  2825. var data = filePath.split("/");
  2826. a.setAttribute('download', data[data.length-1]);// download属性
  2827. a.setAttribute('href', filePath);// href链接
  2828. a.click(); //自执行点击事件
  2829. a.remove();
  2830. } else {
  2831. this.$message({
  2832. message: res.msg,
  2833. type: "error"
  2834. });
  2835. }
  2836. },
  2837. error => {
  2838. this.checkinLoading = false;
  2839. this.$message({
  2840. message: error,
  2841. type: "error"
  2842. });
  2843. }
  2844. );
  2845. },
  2846. pre() {
  2847. if (this.active == 0) return;
  2848. this.active--;
  2849. },
  2850. next() {
  2851. this.active++;
  2852. },
  2853. triggerTotalTime(index) {
  2854. var item = this.checkinList[index];
  2855. var total = 0.0;
  2856. for (var i=0;i<this.projectColumns.length; i++) {
  2857. var key = this.projectColumns[i];
  2858. if (item[key] != null && item[key] != '') {
  2859. total += parseFloat(item[key]);
  2860. }
  2861. }
  2862. item.totalFillTime = total;
  2863. },
  2864. //提交批量代填的数据
  2865. submitBatchSubFillData() {
  2866. var data = JSON.stringify(this.checkinList);
  2867. this.http.post('/user-corpwx-time/submitProjectTime',{
  2868. json: data,
  2869. projectColumns: JSON.stringify(this.projectColumns)
  2870. },
  2871. res => {
  2872. if (res.code == "ok") {
  2873. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2874. this.importWxDialog = false;
  2875. }
  2876. },
  2877. error => {
  2878. this.checkinLoading = false;
  2879. this.$message({
  2880. message: error,
  2881. type: "error"
  2882. });
  2883. }
  2884. );
  2885. },
  2886. loadCheckInData() {
  2887. if (this.importWxParam.date == null) {
  2888. this.checkinList = [];
  2889. return;
  2890. }
  2891. this.checkinLoading = true;
  2892. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2893. startDate: this.importWxParam.date[0],
  2894. endDate: this.importWxParam.date[1],
  2895. },
  2896. res => {
  2897. if (res.code == "ok") {
  2898. this.checkinLoading = false;
  2899. this.checkinList = res.data.list;
  2900. this.projectColumns = res.data.projects;
  2901. // 自定义表格会导致表格错乱,需重新计算表格
  2902. this.$nextTick(()=>{
  2903. this.$refs.tab.doLayout()
  2904. })
  2905. }
  2906. },
  2907. error => {
  2908. this.checkinLoading = false;
  2909. this.$message({
  2910. message: error,
  2911. type: "error"
  2912. });
  2913. }
  2914. );
  2915. },
  2916. importCardTime(item) {
  2917. //首先判断文件类型
  2918. let str = item.file.name.split(".");
  2919. let format = str[str.length - 1];
  2920. if (format != "xls" && format != "xlsx") {
  2921. this.$message({
  2922. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2923. type: "error"
  2924. });
  2925. } else {
  2926. this.importingData = true;
  2927. let formData = new FormData();
  2928. formData.append("multipartFile", item.file);
  2929. formData.append("companyId", this.user.companyId);
  2930. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  2931. res => {
  2932. this.$refs.uploadCardTime.clearFiles();
  2933. this.importingData = false;
  2934. if (res.code == "ok") {
  2935. //换成弹出框,以免有人等了半天回来啥也没看到
  2936. this.$message({
  2937. message: '导入考勤时长成功',
  2938. type: "success"
  2939. });
  2940. } else {
  2941. this.$message({
  2942. message: res.msg,
  2943. type: "error"
  2944. });
  2945. }
  2946. },
  2947. error => {
  2948. this.$refs.upload.clearFiles();
  2949. this.listLoading = false;
  2950. this.$message({
  2951. message: error,
  2952. type: "error"
  2953. });
  2954. });
  2955. }
  2956. },
  2957. batchImportWxData(item) {
  2958. //首先判断文件类型
  2959. let str = item.file.name.split(".");
  2960. let format = str[str.length - 1];
  2961. if (format != "xls" && format != "xlsx") {
  2962. this.$message({
  2963. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2964. type: "error"
  2965. });
  2966. } else {
  2967. this.importingData = true;
  2968. let formData = new FormData();
  2969. formData.append("file", item.file);
  2970. formData.append("companyId", this.user.companyId);
  2971. formData.append("withCheckIn", 1);
  2972. this.http.uploadFile('/report/importData', formData,
  2973. res => {
  2974. this.$refs.upload.clearFiles();
  2975. this.showImportResult = true;
  2976. this.importingData = false;
  2977. if (res.code == "ok") {
  2978. //换成弹出框,以免有人等了半天回来啥也没看到
  2979. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  2980. this.getReportList();
  2981. this.importWxDialog = false;
  2982. } else {
  2983. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2984. }
  2985. },
  2986. error => {
  2987. this.$refs.upload.clearFiles();
  2988. this.listLoading = false;
  2989. this.$message({
  2990. message: error,
  2991. type: "error"
  2992. });
  2993. });
  2994. }
  2995. },
  2996. batchImportData(item) {
  2997. //首先判断文件类型
  2998. let str = item.file.name.split(".");
  2999. let format = str[str.length - 1];
  3000. if (format != "xls" && format != "xlsx") {
  3001. this.$message({
  3002. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3003. type: "error"
  3004. });
  3005. } else {
  3006. this.importingData = true;
  3007. let formData = new FormData();
  3008. formData.append("file", item.file);
  3009. formData.append("companyId", this.user.companyId);
  3010. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId==10)?'/report/importNewData':'/report/importData'
  3011. this.http.uploadFile(url, formData,
  3012. res => {
  3013. this.$refs.upload.clearFiles();
  3014. this.importingData = false;
  3015. this.showImportResult = true;
  3016. if (res.code == "ok") {
  3017. //换成弹出框,以免有人等了半天回来啥也没看到
  3018. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3019. this.getReportList();
  3020. this.importWXDialog = false;
  3021. } else {
  3022. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3023. }
  3024. },
  3025. error => {
  3026. this.$refs.upload.clearFiles();
  3027. this.importingData = false;
  3028. this.$message({
  3029. message: error,
  3030. type: "error"
  3031. });
  3032. });
  3033. }
  3034. },
  3035. userssHu() {
  3036. this.http.post('/time-type/getCompanyTimeSetting',{
  3037. companyId: this.user.companyId
  3038. },
  3039. res => {
  3040. if (res.code == "ok") {
  3041. this.yonghuUser = res.data
  3042. }
  3043. },
  3044. error => {
  3045. this.$message({
  3046. message: error,
  3047. type: "error"
  3048. });
  3049. }
  3050. );
  3051. },
  3052. iptBlur(i) {
  3053. if(this.isBatch == 0) {
  3054. return
  3055. }
  3056. this.http.post('/report/getWorkDays',{
  3057. startDate: this.workForm.createDate[0],
  3058. endDate: this.workForm.createDate[1]
  3059. },
  3060. res => {
  3061. if (res.code == "ok") {
  3062. this.jsDay = res.data
  3063. this.chuji(i)
  3064. } else {
  3065. this.$message({
  3066. message: res.msg,
  3067. type: "error"
  3068. });
  3069. }
  3070. },
  3071. error => {
  3072. this.$message({
  3073. message: error,
  3074. type: "error"
  3075. });
  3076. }
  3077. );
  3078. //明夷硬编码获取
  3079. if (this.user.company.companyName == this.mingyiName) {
  3080. this.getWorkTimeForMinYi();
  3081. }
  3082. },
  3083. getWorkTimeForMinYi(){
  3084. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3085. startDate: this.workForm.createDate[0],
  3086. endDate: this.workForm.createDate[1]
  3087. },
  3088. res => {
  3089. if (res.code == "ok") {
  3090. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3091. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3092. this.totalReportHours = this.workTimeForMinYi;
  3093. } else {
  3094. this.$message({
  3095. message: res.msg,
  3096. type: "error"
  3097. });
  3098. this.workForm.createDate = [];
  3099. }
  3100. },
  3101. error => {
  3102. this.$message({
  3103. message: error,
  3104. type: "error"
  3105. });
  3106. }
  3107. );
  3108. },
  3109. chuji(i) {
  3110. if(i == 0) {
  3111. this.seleChn(1)
  3112. } else if(i == 1) {
  3113. this.seleChn(0)
  3114. } else if(i == 2) {
  3115. if(this.workForm.domains[0].multiWorktime > 0) {
  3116. this.iptChangs()
  3117. } else {
  3118. this.iptChang()
  3119. }
  3120. } else if(i == 3) {
  3121. this.seleChn(0)
  3122. }
  3123. },
  3124. seleChn(e,domain) {
  3125. if(e == 1) {
  3126. for(var i in this.workForm.domains) {
  3127. if(this.workForm.domains[i].timeType == 0) {
  3128. this.workForm.domains[i].workingTime = 8
  3129. } else {
  3130. this.workForm.domains[i].workingTime = 4
  3131. }
  3132. }
  3133. }
  3134. var quanbu = 0
  3135. var spl = this.workForm.domains
  3136. var zhi = ''
  3137. for(var i in spl) {
  3138. var sp = +spl[i].workingTime + 0
  3139. zhi = this.jsDay * sp
  3140. quanbu = +quanbu + zhi
  3141. }
  3142. this.jsTime = quanbu
  3143. this.totalReportHours = quanbu
  3144. let worktime = this.jsTime
  3145. // 自动计算加班时长
  3146. if(this.isBatch != 0){
  3147. worktime = this.jsTime / this.jsDay
  3148. }
  3149. if(this.user.timeType.fillOvertime && domain){
  3150. let isover = false
  3151. let alltime = 0
  3152. let allover = 0 //此处alltime同上面的worktime
  3153. for(let d in spl){
  3154. if(spl[d].isOvertime){
  3155. isover = true
  3156. allover += spl[d].overtimeHours*1
  3157. }
  3158. alltime += spl[d].workingTime*1
  3159. }
  3160. if(domain.overtimeHours){
  3161. allover = allover - domain.overtimeHours
  3162. }
  3163. if(worktime*1 > this.user.timeType.allday){
  3164. if(isover){
  3165. if(alltime > (allover + this.user.timeType.allday)){
  3166. this.$set(domain,'isOvertime',true)
  3167. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3168. }else{
  3169. this.$set(domain,'isOvertime',false)
  3170. this.$set(domain,'overtimeHours',null)
  3171. if(alltime < (allover + this.user.timeType.allday)){
  3172. let overtime = allover + this.user.timeType.allday - alltime
  3173. for(let pi in spl){
  3174. if(spl[pi].overtimeHours){
  3175. if((overtime - spl[pi].overtimeHours*1) > 0){
  3176. overtime = overtime - spl[pi].overtimeHours*1
  3177. this.$set(spl[pi],'isOvertime',false)
  3178. this.$set(spl[pi],'overtimeHours',null)
  3179. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3180. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3181. break
  3182. }else{
  3183. this.$set(spl[pi],'isOvertime',false)
  3184. this.$set(spl[pi],'overtimeHours',null)
  3185. break
  3186. }
  3187. }
  3188. }
  3189. }
  3190. }
  3191. }else{
  3192. this.$set(domain,'isOvertime',true)
  3193. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3194. }
  3195. }else{
  3196. for(let di in spl){
  3197. this.$set(spl[di],'isOvertime',false)
  3198. this.$set(spl[di],'overtimeHours',null)
  3199. }
  3200. }
  3201. }
  3202. },
  3203. iptChang() {
  3204. var sl = this.workForm.domains
  3205. let timeArr = []
  3206. for(var i in sl) {
  3207. if(sl[i].startTime && sl[i].endTime) {
  3208. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3209. }
  3210. }
  3211. this.getTimeHours(timeArr)
  3212. // for(let j in arrNum) {
  3213. // this.timeJsonStr += arrNum[j]
  3214. // if(flg) {
  3215. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3216. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3217. // }
  3218. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3219. // flg = true
  3220. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3221. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3222. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3223. // }
  3224. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3225. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3226. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3227. // }
  3228. // }
  3229. },
  3230. iptChangs() {
  3231. var sl = this.workForm.domains
  3232. let timeArr = []
  3233. for(var i in sl) {
  3234. for(var j in sl[i].worktimeList){
  3235. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3236. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3237. }
  3238. }
  3239. }
  3240. this.getTimeHours(timeArr)
  3241. },
  3242. // 调用接口或去数据
  3243. getTimeHours(arr) {
  3244. this.http.post('/report/getHoursByTimeRange',{
  3245. timeJsonStr: JSON.stringify(arr)
  3246. },res => {
  3247. if(res.code === 'ok') {
  3248. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3249. } else {
  3250. this.$message({
  3251. message: res.msg,
  3252. type: 'error'
  3253. })
  3254. }
  3255. },err => {
  3256. this.$message({
  3257. message: err,
  3258. type: 'error'
  3259. })
  3260. })
  3261. },
  3262. // 按周填报调用接口计算时间
  3263. async getWeekHoursByTimeRange(timeRange) {
  3264. const url = '/report/getHoursByTimeRange';
  3265. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3266. var that = this;
  3267. return new Promise((resolve, reject) => {
  3268. this.http.post(url, data, function(res) {
  3269. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3270. }, function(err) {
  3271. reject(err);
  3272. });
  3273. });
  3274. },
  3275. removeTimeItem(item, index) {
  3276. item.worktimeList.splice(index, 1);
  3277. this.iptChangs()
  3278. },
  3279. //添加工时
  3280. addNewWorktime(index, item) {
  3281. if(item.worktimeList == null ) {
  3282. item.worktimeList = []
  3283. }
  3284. item.worktimeList.push({});
  3285. },
  3286. //复制项目
  3287. copyProject(index) {
  3288. var leftProgress = 10;
  3289. if (this.reportTimeType.type == 3) {
  3290. //计算已经待分配工时比例
  3291. let array = this.workForm.domains;
  3292. let totalProgress = 0;
  3293. for (var i=0;i<array.length; i++) {
  3294. totalProgress += array[i].progress;
  3295. }
  3296. if (totalProgress < 100) {
  3297. leftProgress = 100 - totalProgress;
  3298. }
  3299. }
  3300. var newIndex = index+1;
  3301. var itemDomain = {
  3302. projectId: this.workForm.domains[index].projectId,
  3303. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3304. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3305. ),
  3306. content: "",
  3307. progress:leftProgress,
  3308. state:2,//2-表示待提交
  3309. };
  3310. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3311. if (this.reportTimeType.type == 0) {
  3312. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3313. var length = this.workForm.domains.length;
  3314. if (length == 2) {
  3315. this.showAddMore = false;
  3316. }
  3317. }
  3318. this.selectProject(itemDomain, newIndex);
  3319. },
  3320. pushWorkTime(){
  3321. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3322. confirmButtonText: '确定',
  3323. cancelButtonText: '取消',
  3324. type: 'info'
  3325. }).then(() => {
  3326. const loading = this.$loading({
  3327. lock: true,
  3328. text: '正在推送中,请耐心等待。',
  3329. spinner: 'el-icon-loading',
  3330. background: 'rgba(0, 0, 0, 0.7)'
  3331. });
  3332. this.http.post('/report/pushReportDataToThird',{
  3333. yearMonth: this.date
  3334. },res => {
  3335. loading.close();
  3336. if(res.code == 'ok'){
  3337. this.$message({
  3338. type: 'success',
  3339. message: '推送成功!'
  3340. });
  3341. }else{
  3342. this.$message({
  3343. type: 'error',
  3344. message: res.msg
  3345. })
  3346. }
  3347. },err => {
  3348. loading.close();
  3349. this.$message({
  3350. type: 'error',
  3351. message: err
  3352. })
  3353. })
  3354. }).catch(() => {
  3355. });
  3356. },
  3357. showWorkTime(){
  3358. this.monthWorkTimeDialog = true;
  3359. this.searchKeyword = ''
  3360. this.WorktimeDatepickValue = this.istoMonth()
  3361. if(this.WorktimeDatepickValue.length == 0){
  3362. let newdate = new Date();
  3363. let nowdate = newdate.toLocaleDateString();
  3364. let getauto = this.getAutoWeekDate(nowdate)
  3365. let nowwd = [getauto[0],getauto[6]]
  3366. this.WorktimeDatepickValue = nowwd
  3367. }
  3368. this.showMonthWorkTime()
  3369. },
  3370. handleClick(t,e){
  3371. if (t.name == "first") {
  3372. this.showMonthWorkTime()
  3373. }else{
  3374. this.showMonthNotWorkTime()
  3375. }
  3376. },
  3377. //导出员工每日填报工时数
  3378. exportMembWorkHours() {
  3379. this.http.post(
  3380. "/report/exportUserDailyWorkTime",
  3381. {
  3382. // month: this.date,
  3383. startDate: this.WorktimeDatepickValue[0],
  3384. endDate: this.WorktimeDatepickValue[1],
  3385. },
  3386. (res) => {
  3387. if (res.code == "ok") {
  3388. let url = res.data;
  3389. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3390. }
  3391. },
  3392. (error) => {
  3393. this.$message({
  3394. message: error,
  3395. type: "error",
  3396. });
  3397. }
  3398. );
  3399. },
  3400. exportMembNotWorkHours() {
  3401. this.http.post(
  3402. "/report/exportNoReportUserList",
  3403. {
  3404. // month: this.date,
  3405. startDate: this.WorktimeDatepickValue[0],
  3406. endDate: this.WorktimeDatepickValue[1],
  3407. },
  3408. (res) => {
  3409. if (res.code == "ok") {
  3410. let url = res.data;
  3411. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3412. }
  3413. },
  3414. (error) => {
  3415. this.$message({
  3416. message: error,
  3417. type: "error",
  3418. });
  3419. }
  3420. );
  3421. },
  3422. downloadByA(name, url) {
  3423. const a = document.createElement("a"); // 创建a标签
  3424. a.setAttribute("download", name); // download属性
  3425. a.setAttribute("href", url); // href链接
  3426. a.click(); // 自执行点击事件
  3427. a.remove();
  3428. },
  3429. // 是否本月判断
  3430. istoMonth(){
  3431. let todate = new Date()
  3432. let tomonth = todate.getMonth() + 1
  3433. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3434. if(this.date == adate){
  3435. return []
  3436. }else{
  3437. let sedate = new Date(this.date)
  3438. let semonth = sedate.getMonth() + 1
  3439. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3440. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3441. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3442. return [sedates1, sedates2]
  3443. }
  3444. },
  3445. showMonthWorkTime() {
  3446. this.monthTotalPage = 0,
  3447. this.tbload = true
  3448. this.http.post(
  3449. "/report/getUserDailyWorkTime",
  3450. // "/report/getNoReportUserList",
  3451. {
  3452. // month: this.date,
  3453. startDate: this.WorktimeDatepickValue[0],
  3454. endDate: this.WorktimeDatepickValue[1],
  3455. },
  3456. (res) => {
  3457. if (res.code == "ok") {
  3458. this.tbload = false;
  3459. this.pickDateArray = res.data.days;
  3460. // console.log('dataarray',res.data.days);
  3461. this.monthWorkData = res.data.list;
  3462. // this.monthWorkDataS = this.monthWorkData
  3463. // this.monthWorkDataS1 = res.data.list
  3464. this.monthTotal = res.data.list.length
  3465. if (this.monthWorkData.length > 50) {
  3466. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3467. }else{
  3468. this.monthWorkDataS = this.monthWorkData
  3469. }
  3470. this.searchScreen(0)
  3471. // this.monthWorkDataS = infoList
  3472. // 判断
  3473. // if (this.monthWorkDataS1.length > 0) {
  3474. // setTimeout(() => {
  3475. // this.tableListener()
  3476. // }, 1000);
  3477. // }
  3478. this.$nextTick(function(){
  3479. this.$refs.hasworkTbl.doLayout();
  3480. });
  3481. // this.$forceUpdate()
  3482. }
  3483. },
  3484. (error) => {
  3485. this.tbload = false
  3486. this.$message({
  3487. message: error,
  3488. type: "error",
  3489. });
  3490. }
  3491. );
  3492. },
  3493. // tableListener(){
  3494. // let that = this;
  3495. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3496. // // 添加scroll监听事件
  3497. // dom.addEventListener("scroll", function () {
  3498. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3499. // if (scrollDistance < 2) {
  3500. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3501. // that.monthTotalPage++; //当前页数自增
  3502. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3503. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3504. // var infoList = arrList.splice(
  3505. // that.monthTotalPage * that.monthTotalLages,
  3506. // that.monthTotalLages
  3507. // );
  3508. // // 数据添加
  3509. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3510. // }
  3511. // }
  3512. // })
  3513. // },
  3514. showMonthNotWorkTime() {
  3515. this.monthTotalPage = 0,
  3516. this.tbload = true,
  3517. this.http.post(
  3518. "/report/getNoReportUserList",
  3519. {
  3520. startDate: this.WorktimeDatepickValue[0],
  3521. endDate: this.WorktimeDatepickValue[1],
  3522. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3523. },
  3524. (res) => {
  3525. if (res.code == "ok") {
  3526. this.tbload = false
  3527. this.monthNotWorkDate = res.data;
  3528. // this.monthNotWorkDateS1 = res.data
  3529. this.monthnotTotal = res.data.length
  3530. // 2222111
  3531. if (this.monthNotWorkDate.length > 50) {
  3532. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3533. } else {
  3534. this.monthNotWorkDateS = this.monthNotWorkDate
  3535. }
  3536. this.searchScreen(1)
  3537. // 判断
  3538. // if (this.monthnotworkDateS1.length > 0) {
  3539. // setTimeout(() => {
  3540. // this.tableListenernot()
  3541. // }, 1000);
  3542. // }
  3543. this.$nextTick(function(){
  3544. this.$refs.hasworkTbl2.doLayout();
  3545. });
  3546. }
  3547. },
  3548. (error) => {
  3549. this.tbload = false
  3550. this.$message({
  3551. message: error,
  3552. type: "error",
  3553. });
  3554. }
  3555. );
  3556. },
  3557. // tableListenernot(){
  3558. // let that = this;
  3559. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3560. // dom.addEventListener("scroll", function () {
  3561. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3562. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3563. // if (scrollDistance2 < 2) {
  3564. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3565. // that.monthnotTotalPage++; //当前页数自增
  3566. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3567. // var infoList = arrList.splice(
  3568. // that.monthnotTotalPage * that.monthnotTotalLages,
  3569. // that.monthnotTotalLages
  3570. // );
  3571. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3572. // }
  3573. // }
  3574. // })
  3575. // },
  3576. listScroll(){
  3577. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3578. this.isMore = true
  3579. setTimeout(()=>{
  3580. this.isMore = false
  3581. },1000)
  3582. }else {
  3583. this.isFlag = true
  3584. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3585. this.monthWorkDataS = datalist
  3586. setTimeout(()=>{
  3587. this.isFlag = false
  3588. },300)
  3589. }
  3590. },
  3591. notListScroll(){
  3592. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3593. this.isMore = true
  3594. setTimeout(()=>{
  3595. this.isMore = false
  3596. },1000)
  3597. }else {
  3598. this.isFlag = true
  3599. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3600. this.monthNotWorkDateS = datalist
  3601. // console.log('length',this.monthNotWorkDateS.length)
  3602. setTimeout(()=>{
  3603. this.isFlag = false
  3604. },300)
  3605. }
  3606. },
  3607. // 获取默认这zhou日期参数 222
  3608. getLastWeek(e){
  3609. let newdate = new Date()
  3610. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3611. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3612. if(e){
  3613. this.WorktimeDatepickValue = lastwd
  3614. this.showMonthWorkTime()
  3615. }else{
  3616. this.WorktimeDatepickValue = lastwd
  3617. this.showMonthNotWorkTime()
  3618. }
  3619. },
  3620. getThisWeek(e){
  3621. let newdate = new Date();
  3622. let nowdate = newdate.toLocaleDateString();
  3623. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3624. if(e){
  3625. this.WorktimeDatepickValue = nowwd
  3626. this.showMonthWorkTime()
  3627. }else{
  3628. this.WorktimeDatepickValue = nowwd
  3629. this.showMonthNotWorkTime()
  3630. }
  3631. },
  3632. getDoubleLastWeek(e){
  3633. let newdate = new Date()
  3634. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3635. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3636. if(e){
  3637. this.WorktimeDatepickValue = nextwd
  3638. this.showMonthWorkTime()
  3639. }else{
  3640. this.WorktimeDatepickValue = nextwd
  3641. this.showMonthNotWorkTime()
  3642. }
  3643. },
  3644. alreadyAllDate(stime,etime){
  3645. let diffdate = new Array();
  3646. let i=0;
  3647. while(stime<=etime){
  3648. let dateArray = stime.split("-");
  3649. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3650. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3651. let stimewk = this.weekDay[date.getDay()]
  3652. 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')
  3653. 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])
  3654. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3655. let stime_ts = new Date(stime).getTime();
  3656. let next_date = stime_ts + (24*60*60*1000);
  3657. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3658. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3659. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3660. stime = next_dates_y+next_dates_m+next_dates_d;
  3661. i++;
  3662. }
  3663. return diffdate
  3664. },
  3665. getAutoWeekDate(e) {
  3666. let dateString = e;
  3667. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3668. if (dateString.match(dateStringReg)) {
  3669. let presentDate = new Date(dateString),
  3670. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3671. return Array.from(new Array(7), function (val, index) {
  3672. let formatDate = new Date(
  3673. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3674. );
  3675. return (
  3676. formatDate.getFullYear() +
  3677. "-" +
  3678. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3679. "-" +
  3680. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3681. );
  3682. });
  3683. } else {
  3684. throw new Error(
  3685. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3686. );
  3687. }
  3688. },
  3689. onProgressChange() {
  3690. this.$forceUpdate();
  3691. },
  3692. showChooseMembTree() {
  3693. this.chosenMembCount = this.participator.length;
  3694. this.chooseParticipVisible = true;
  3695. },
  3696. onTreeItemChange() {
  3697. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3698. var list = chosenList.filter(item=>item.isUser == 1);
  3699. this.chosenMembCount = list.length;
  3700. },
  3701. findUserInTree() {
  3702. if (this.filterName == '') {
  3703. this.deptMembData = this.allMembData;
  3704. } else {
  3705. var list = this.findRecursively(this.filterName, this.allMembData);
  3706. this.deptMembData = list;
  3707. }
  3708. },
  3709. findRecursively(username, list) {
  3710. var filterList = [];
  3711. for (var i=0;i<list.length; i++) {
  3712. if (list[i].isUser == 1) {
  3713. if (list[i].label.indexOf(username) >= 0) {
  3714. //匹配上了
  3715. filterList.push(list[i]);
  3716. }
  3717. } else if (list[i].children != null && list[i].children.length > 0) {
  3718. var subList = this.findRecursively(username, list[i].children);
  3719. if (subList.length > 0) {
  3720. subList.forEach(s=>filterList.push(s));
  3721. }
  3722. }
  3723. }
  3724. return filterList;
  3725. },
  3726. //确定选择参与人
  3727. chooseParticip() {
  3728. this.chooseParticipVisible = false;
  3729. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3730. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3731. this.workForm.userNames = '';
  3732. this.workForm.userId = [];
  3733. this.participator = [];
  3734. for (var i=0;i<this.chosenMembList.length; i++) {
  3735. this.workForm.userId.push(this.chosenMembList[i].id);
  3736. this.workForm.userNames += this.chosenMembList[i].label+',';
  3737. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3738. this.participator.push(item);
  3739. }
  3740. if (this.workForm.userNames.length > 0) {
  3741. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3742. }
  3743. if(this.user.userNameNeedTranslate == 1) {
  3744. if(this.workForm.userNames) {
  3745. this.workForm.userNames = this.workForm.userNames.split(',')
  3746. }
  3747. }
  3748. },
  3749. notifySel(sel){
  3750. // console.log(sel);
  3751. this.notifySelList = sel
  3752. },
  3753. //微信通知人员填写
  3754. Notify(code) {
  3755. if (this.notifySelList.length == 0) return;
  3756. var ids = '';
  3757. this.notifySelList.forEach(f=>{
  3758. ids += f.id+',';
  3759. })
  3760. this.http.post('/user/pushFillReport',{
  3761. ids: ids, date: this.curDate,
  3762. code: code
  3763. },
  3764. res => {
  3765. if (res.code == "ok") {
  3766. this.$message({
  3767. message: this.$t('message.sentSuccessfully'),
  3768. type: "success"
  3769. });
  3770. }
  3771. },
  3772. error => {
  3773. this.$message({
  3774. message: error,
  3775. type: "error"
  3776. });
  3777. }
  3778. );
  3779. },
  3780. //导出人员列表
  3781. exportMemb() {
  3782. if (this.fillMembList.length == 0) return;
  3783. var ids = '';
  3784. this.fillMembList.forEach(f=>{
  3785. ids += f.id+',';
  3786. })
  3787. this.http.post('/user/exportMembList',{
  3788. ids: ids,isFill: this.isFill, date: this.curDate
  3789. },
  3790. res => {
  3791. if (res.code == "ok") {
  3792. var aTag = document.createElement('a');
  3793. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3794. aTag.href = res.data;
  3795. aTag.click();
  3796. }
  3797. },
  3798. error => {
  3799. this.$message({
  3800. message: error,
  3801. type: "error"
  3802. });
  3803. }
  3804. );
  3805. },
  3806. showMembList(fill) {
  3807. this.membListVisible = true;
  3808. if (fill == 0) {
  3809. this.fillMembList = this.unFillList;
  3810. this.isFill = false;
  3811. let leaveList = []
  3812. let unleaveList = []
  3813. for(let i in this.fillMembList){
  3814. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3815. leaveList.push(this.fillMembList[i])
  3816. }else{
  3817. unleaveList.push(this.fillMembList[i])
  3818. }
  3819. }
  3820. this.fillMembList = unleaveList
  3821. this.fillMembList_leave = leaveList
  3822. } else if(fill == 1){
  3823. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3824. this.isFill = true;
  3825. }else{
  3826. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3827. this.isFill = true;
  3828. }
  3829. },
  3830. //获取自己填写的日报状态
  3831. getReportFillStatus() {
  3832. this.http.post('/report/getReportFillStatus',{
  3833. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3834. },
  3835. res => {
  3836. if (res.code == "ok") {
  3837. this.fillStatusList = res.data;
  3838. this.allDate.forEach(d=>{
  3839. var fillInfo = null;
  3840. d.state = null;
  3841. this.fillStatusList.forEach(s=>{
  3842. // console.log(d)
  3843. var d1 = s.createDate.split('-')[2];
  3844. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  3845. // console.log(d2, '我被执行了')
  3846. if (d1.indexOf('0') == 0) {
  3847. d1 = d1.substring(1,d1.length);
  3848. }
  3849. if (d1 == d2) {
  3850. d.state = s.state;
  3851. }
  3852. })
  3853. })
  3854. this.$forceUpdate();
  3855. }
  3856. },
  3857. error => {
  3858. this.$message({
  3859. message: error,
  3860. type: "error"
  3861. });
  3862. }
  3863. );
  3864. },
  3865. scrollFunction () {
  3866. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  3867. if (this.domObj.attachEvent) { // IE
  3868. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  3869. } else if (this.domObj.addEventListener) {
  3870. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  3871. }
  3872. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  3873. },
  3874. mouseScroll(event) { // google 浏览器下
  3875. let detail = event.wheelDelta || event.detail
  3876. let moveForwardStep = -1
  3877. let moveBackStep = 1
  3878. let step = 0
  3879. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  3880. event.preventDefault() // 阻止浏览器默认事件
  3881. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  3882. },
  3883. // //左右滚动
  3884. // wheel(e){
  3885. // var a = document.getElementById("dateScroll");
  3886. // var scroll_width = 80; //滚动一下的距离
  3887. // var e = e || window.event, v;
  3888. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  3889. // if(v>3||-v>3) v=-v;
  3890. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  3891. // e.preventDefault(); //阻止浏览器的默认滚动
  3892. // },
  3893. showExportDialog() {
  3894. this.exportDialog = true;
  3895. },
  3896. showExportTimeDialog() {
  3897. this.exportTimeDialog = true;
  3898. },
  3899. changeAllTime() {
  3900. //总时长发生改变,自动按比例计算
  3901. this.workForm.domains.forEach(d=>{
  3902. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  3903. });
  3904. //计算jsTime
  3905. if (this.workForm.createDate) {
  3906. let sdate = new Date(this.workForm.createDate[0]);
  3907. let edate = new Date(this.workForm.createDate[1]);
  3908. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  3909. console.log('days===', days)
  3910. if (days < 0) {
  3911. days = 0;
  3912. }
  3913. this.jsTime = this.reportTimeType.allday * days;
  3914. }
  3915. },
  3916. // 是否加班的单机事件
  3917. check() {
  3918. this.selected = !this.selected
  3919. this.isNew = this.selected
  3920. },
  3921. updateSubProject() {
  3922. this.$forceUpdate();
  3923. },
  3924. selectDegreeId(domain, index) {
  3925. this.http.post('/report/defaultDegree',{
  3926. projectId: domain.projectId
  3927. },
  3928. res => {
  3929. if (res.code == "ok") {
  3930. if(res.data) {
  3931. this.workForm.domains[index].degreeId = res.data.id + ''
  3932. this.$forceUpdate();
  3933. }
  3934. }
  3935. },
  3936. error => {
  3937. this.$message({
  3938. message: error,
  3939. type: "error"
  3940. });
  3941. }
  3942. );
  3943. },
  3944. //项目选中了, 加载子项目
  3945. selectProject(domain, index) {
  3946. if(!domain.projectId){
  3947. return;
  3948. }
  3949. // 默认选中上次填写的自定义维度
  3950. if(this.yonghuUser.customDegreeActive == 1) {
  3951. this.selectDegreeId(domain, index)
  3952. }
  3953. // console.log('projectId===',domain.projectId);
  3954. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  3955. this.http.post('/sub-project/list',{
  3956. projectId: domain.projectId,
  3957. isReport: true
  3958. },
  3959. res => {
  3960. //清空之前选中的子项目
  3961. // this.workForm.domains[index].subProjectId = 0;
  3962. if (res.code == "ok") {
  3963. this.workForm.domains[index].subProjectList = res.data;
  3964. this.workForm.domains[index].subProjectId = null;
  3965. this.$forceUpdate();
  3966. }
  3967. },
  3968. error => {
  3969. this.$message({
  3970. message: error,
  3971. type: "error"
  3972. });
  3973. }
  3974. );
  3975. //项目相关的近期任务
  3976. if (this.user.company.packageProject == 1) {
  3977. this.getRecentTaskList(domain, index);
  3978. //获取项目相关专业
  3979. if (this.user.company.packageEngineering == 1) {
  3980. this.getProjectProfessions(domain, index);
  3981. }
  3982. //获取项目下的任务分组
  3983. this.getTaskGroups(domain, index);
  3984. }
  3985. // 获取项目相关的维度
  3986. // domain.degreeId = null
  3987. this.$set(domain,'degreeId',null)
  3988. this.dimension(domain, index);
  3989. //获取项目审核人
  3990. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  3991. this.getProjectAuditorList(domain, index);
  3992. } else {
  3993. //按分组的负责人来审核
  3994. domain.projectAuditorId = null;
  3995. domain.projectAuditorName = null;
  3996. domain.auditUserList = null;
  3997. }
  3998. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  3999. if (this.reportTimeType.type == 3) {
  4000. //新增项目时,自动计算
  4001. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4002. domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
  4003. }
  4004. //加载昱众的工作职责
  4005. if (this.user.companyId == this.yuzhongCompId) {
  4006. this.updateResponse(domain);
  4007. }
  4008. },
  4009. getRecentTaskList(domain, index) {
  4010. var param = {
  4011. projectId: domain.projectId,
  4012. isSubstitude:this.isSubstitude?1:0
  4013. };
  4014. if (domain.groupId) {
  4015. param.groupId = domain.groupId;
  4016. }
  4017. if (domain.stage) {
  4018. param.stage = domain.stage;
  4019. }
  4020. this.http.post('/task/getRecentTask',param,
  4021. res => {
  4022. if (res.code == "ok") {
  4023. this.workForm.domains[index].allTaskList = res.data;
  4024. this.workForm.domains[index].taskList = res.data;
  4025. this.$forceUpdate();
  4026. }
  4027. },
  4028. error => {
  4029. this.$message({
  4030. message: error,
  4031. type: "error"
  4032. });
  4033. }
  4034. );
  4035. },
  4036. //获取项目审核人
  4037. getProjectAuditorList(domainItem, index) {
  4038. if(domainItem.projectId == '') {
  4039. return
  4040. }
  4041. domainItem.projectAuditorId = null;
  4042. domainItem.projectAuditorName = null;
  4043. this.http.post('/project-auditor/getList',{
  4044. projectId: domainItem.projectId,
  4045. },
  4046. res => {
  4047. if (res.code == "ok") {
  4048. domainItem.auditUserList = res.data;
  4049. if (res.data.length==0) {
  4050. this.$message({
  4051. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4052. type: "error"
  4053. });
  4054. } else if (res.data.length==1) {
  4055. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4056. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4057. }
  4058. this.$forceUpdate();
  4059. }
  4060. },
  4061. error => {
  4062. this.$message({
  4063. message: error,
  4064. type: "error"
  4065. });
  4066. }
  4067. );
  4068. },
  4069. // 获取维度数据
  4070. dimension(domain, index) {
  4071. if(domain.projectId == '') {
  4072. return
  4073. }
  4074. this.http.post('/project/getDegreeList',{
  4075. projectId: domain.projectId,
  4076. },
  4077. res => {
  4078. if (res.code == "ok") {
  4079. // console.log("维度数据",res.data);
  4080. this.workForm.domains[index].wuduList = res.data
  4081. // this.workForm = this.workForm
  4082. this.$forceUpdate()
  4083. }
  4084. },
  4085. error => {
  4086. this.$message({
  4087. message: error,
  4088. type: "error"
  4089. });
  4090. }
  4091. );
  4092. },
  4093. //切换任务阶段
  4094. changeStages(domain, index) {
  4095. if (domain.stage == null || domain.stage == '') {
  4096. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4097. } else {
  4098. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4099. }
  4100. this.$forceUpdate();
  4101. },
  4102. getGroupStages(domain, index, keepStage) {
  4103. // console.log(domain);
  4104. if(!domain.groupId){
  4105. domain.projectAuditorId = ''
  4106. domain.stages = []
  4107. if(this.user.timeType.reportAuditType >= 1){
  4108. domain.auditUserList = []
  4109. }
  4110. this.$forceUpdate();
  4111. return
  4112. }
  4113. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4114. res => {
  4115. if (res.code == "ok") {
  4116. if (!keepStage) {
  4117. domain.stage = '';
  4118. }
  4119. domain.stages = res.data;
  4120. this.$forceUpdate();
  4121. }
  4122. },
  4123. error => {
  4124. this.$message({
  4125. message: error,
  4126. type: "error"
  4127. });
  4128. });
  4129. //检查当前的项目是否需要获取分组的负责人
  4130. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4131. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4132. res => {
  4133. if (res.code == "ok") {
  4134. domain.getProjectAuditorList = res.data;
  4135. domain.auditUserList = res.data;
  4136. if (res.data.length==1) {
  4137. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4138. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4139. } else if (res.data.length==0) {
  4140. domain.projectAuditorId = null;
  4141. domain.projectAuditorName = null;
  4142. }
  4143. this.$forceUpdate();
  4144. }
  4145. },
  4146. error => {
  4147. this.$message({
  4148. message: error,
  4149. type: "error"
  4150. });
  4151. });
  4152. }
  4153. },
  4154. getProjectProfessions(domain, index) {
  4155. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4156. res => {
  4157. if (res.code == "ok") {
  4158. this.workForm.domains[index].professionProgress = res.data;
  4159. this.$forceUpdate();
  4160. }
  4161. },
  4162. error => {
  4163. this.$message({
  4164. message: error,
  4165. type: "error"
  4166. });
  4167. });
  4168. },
  4169. //删除自己的日报
  4170. deleteReport() {
  4171. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4172. confirmButtonText: this.$t('btn.determine'),
  4173. cancelButtonText: this.$t('btn.cancel'),
  4174. type: "warning"
  4175. })
  4176. .then(() => {
  4177. this.listLoading = true;
  4178. this.http.post('/report/delete',{
  4179. userId: this.user.id,
  4180. date: this.workForm.createDate
  4181. },
  4182. res => {
  4183. this.listLoading = false;
  4184. if (res.code == "ok") {
  4185. this.$message({
  4186. message: this.$t('message.successfullyDeleted'),
  4187. type: "success"
  4188. });
  4189. this.getReportList();
  4190. this.getDepartment();
  4191. this.dialogVisible = false;
  4192. } else {
  4193. this.$message({
  4194. message: res.msg,
  4195. type: "error"
  4196. });
  4197. }
  4198. },
  4199. error => {
  4200. this.listLoading = false;
  4201. this.$message({
  4202. message: error,
  4203. type: "error"
  4204. });
  4205. }
  4206. );
  4207. })
  4208. .catch(() => {});
  4209. },
  4210. // 管理员删除日报
  4211. guanli(item) {
  4212. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4213. let param = {date: this.date + day, userId: item.id};
  4214. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4215. confirmButtonText: this.$t('btn.determine'),
  4216. cancelButtonText: this.$t('btn.cancel'),
  4217. type: "warning"
  4218. })
  4219. .then(() => {
  4220. this.listLoading = true;
  4221. this.http.post('/report/delete',param,
  4222. res => {
  4223. this.listLoading = false;
  4224. if (res.code == "ok") {
  4225. this.$message({
  4226. message: this.$t('message.successfullyDeleted'),
  4227. type: "success"
  4228. });
  4229. this.getReportList();
  4230. this.getDepartment();
  4231. this.dialogVisible = false;
  4232. } else {
  4233. this.$message({
  4234. message: res.msg,
  4235. type: "error"
  4236. });
  4237. }
  4238. },
  4239. error => {
  4240. this.listLoading = false;
  4241. this.$message({
  4242. message: error,
  4243. type: "error"
  4244. });
  4245. }
  4246. );
  4247. })
  4248. .catch(() => {});
  4249. },
  4250. selectAll() {
  4251. if (this.isAllSelect) {
  4252. var keys = [];
  4253. this.reportNames.forEach(b=>{
  4254. keys.push(b.id);
  4255. })
  4256. this.$refs.approveTree.setCheckedKeys(keys);
  4257. } else {
  4258. this.$refs.approveTree.setCheckedKeys([]);
  4259. }
  4260. },
  4261. removeEmptyNode(list) {
  4262. for (var i=0;i<list.length;i++) {
  4263. var cnt = 0;
  4264. if (list[i].membCount == 0) {
  4265. list.splice(i, 1);
  4266. i--;
  4267. } else if (list[i].children != null) {
  4268. this.removeEmptyNode(list[i].children);
  4269. }
  4270. }
  4271. },
  4272. calculateMembCount(list) {
  4273. for (var i in list) {
  4274. var cnt = 0;
  4275. if (list[i].children != null) {
  4276. this.calculateMembCount(list[i].children);
  4277. for (var m in list[i].children) {
  4278. cnt += list[i].children[m].membCount;
  4279. }
  4280. }
  4281. if (list[i].isUser == 1) {
  4282. cnt++;
  4283. this.membCount++;
  4284. }
  4285. list[i].membCount = cnt;
  4286. }
  4287. },
  4288. stateChange() {
  4289. // console.log(this.allData,'alldate');
  4290. this.membCount = 0;
  4291. if (this.selectState == -1) {
  4292. //全部状态
  4293. this.data = this.allData;
  4294. } else {
  4295. //未填报
  4296. this.seluserText = ''
  4297. var newData = JSON.parse(JSON.stringify(this.allData));
  4298. this.filterState(this.selectState, newData);
  4299. this.data = newData;
  4300. }
  4301. this.calculateMembCount(this.data);
  4302. this.data[0].membCount = this.membCount;//总人数
  4303. },
  4304. //按状态过滤部门人员
  4305. filterState(state, list) {
  4306. for (var i =0;i<list.length; i++) {
  4307. var obj = list[i];
  4308. if (obj.isUser == 1) {
  4309. var match = false;
  4310. if (state == -2) {
  4311. if (obj.state == null) {
  4312. match = true;
  4313. }
  4314. } else {
  4315. if (obj.state == state) {
  4316. match = true;
  4317. }
  4318. }
  4319. if (!match) {
  4320. list.splice(i, 1);
  4321. i--;
  4322. } else {
  4323. }
  4324. } else {
  4325. if (obj.children != null) {
  4326. this.filterState(state, obj.children);
  4327. }
  4328. }
  4329. }
  4330. },
  4331. //a按名称过滤部门人员
  4332. seluserforText(){
  4333. this.membCount = 0;
  4334. var newData = JSON.parse(JSON.stringify(this.allData));
  4335. this.seluserforTextin(this.seluserText, newData)
  4336. this.data = newData;
  4337. this.calculateMembCount(this.data);
  4338. this.data[0].membCount = this.membCount;//总人数
  4339. },
  4340. seluserforTextin(text, list){
  4341. for (var i =0;i<list.length; i++) {
  4342. var obj = list[i];
  4343. if (obj.isUser == 1) {
  4344. var match = false;
  4345. if (obj.label.indexOf(text) != -1) {
  4346. match = true
  4347. }
  4348. if (!match) {
  4349. list.splice(i, 1);
  4350. i--;
  4351. } else {
  4352. }
  4353. } else {
  4354. if (obj.children != null) {
  4355. this.seluserforTextin(text, obj.children);
  4356. }
  4357. }
  4358. }
  4359. },
  4360. // 当节点发生变化时
  4361. nodeChangeExpand(data) {
  4362. // 保存当前展开的节点
  4363. let flag = false
  4364. this.nodeModelData.some(item => {
  4365. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4366. flag = true
  4367. return true
  4368. }
  4369. })
  4370. if (!flag) { // 不存在则存到数组里
  4371. this.nodeModelData.push(data.id)
  4372. }
  4373. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4374. },
  4375. nodeChangeCollapse(data) {
  4376. console.log(this.nodeModelData)
  4377. this.nodeModelData.some((item, i) => {
  4378. if (item === data.id) {
  4379. this.nodeModelData.length = i
  4380. }
  4381. })
  4382. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4383. },
  4384. // 部门列表点击
  4385. handleNodeClick(data) {
  4386. // this.dealList = data
  4387. this.theValues(data.id, this.allData)
  4388. // this.depData = data;
  4389. var list = [];
  4390. if (data.id == -1) {
  4391. this.deptId = null;
  4392. this.targetUid = null;
  4393. list = this.data;
  4394. } else if (data.isUser == 1) {
  4395. this.deptId = null;
  4396. this.targetUid = data.id;
  4397. } else {
  4398. this.deptId = data.id;
  4399. this.targetUid = null;
  4400. list.push(data);
  4401. }
  4402. this.getReportList();
  4403. if (list.length > 0) {
  4404. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4405. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4406. }
  4407. },
  4408. theValues(id, item) {
  4409. for(var i in item) {
  4410. if(item[i].id == id) {
  4411. this.depData = item[i]
  4412. if(id == '-1') {
  4413. this.translation = '1'
  4414. } else {
  4415. if(item[i].children) {
  4416. this.translation = '2'
  4417. } else {
  4418. this.translation = '3'
  4419. }
  4420. }
  4421. return
  4422. } else {
  4423. if(item[i].children) {
  4424. this.theValues(id, item[i].children)
  4425. }
  4426. }
  4427. }
  4428. },
  4429. //获取可以选择的代填的人员列表
  4430. getSubstitudeUserDeptList() {
  4431. if (this.deptMembData.length == 0) {
  4432. this.http.post("/department/listMyMembs", {},
  4433. res => {
  4434. if (res.code == "ok") {
  4435. let noAllData = JSON.parse(JSON.stringify(res.data));
  4436. if (noAllData.length > 0) {
  4437. // if (noAllData[0].label == '全部人员') {
  4438. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4439. noAllData.splice(0,1);
  4440. }
  4441. }
  4442. this.setUserToDept(noAllData);
  4443. this.deptMembData = noAllData;
  4444. } else {
  4445. this.$message({
  4446. message: res.msg,
  4447. type: "error"
  4448. });
  4449. }
  4450. },
  4451. error => {
  4452. this.$message({
  4453. message: error,
  4454. type: "error"
  4455. });
  4456. });
  4457. }
  4458. },
  4459. // 获取部门列表
  4460. getDepartmentForApprove() {
  4461. this.http.post( this.port.manage.depList, {},
  4462. res => {
  4463. if (res.code == "ok") {
  4464. var list1 = JSON.parse(JSON.stringify(res.data));
  4465. this.deptOptionList = this.changeArr(list1);
  4466. console.log(this.deptOptionList, '部门')
  4467. } else {
  4468. this.$message({
  4469. message: res.msg,
  4470. type: "error"
  4471. });
  4472. }
  4473. },
  4474. error => {
  4475. this.$message({
  4476. message: error,
  4477. type: "error"
  4478. });
  4479. });
  4480. },
  4481. // 获取部门列表
  4482. getDepartment() {
  4483. //如果没有权限,就不需要获取
  4484. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4485. return;
  4486. }
  4487. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4488. var param = {date:this.date + day};
  4489. this.http.post("/report/getMembList", param,
  4490. res => {
  4491. if (res.code == "ok") {
  4492. if(res.data.length == 0){
  4493. return
  4494. }
  4495. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4496. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4497. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4498. // if (this.user.role > 0) {
  4499. // }
  4500. list.splice(0,0,{
  4501. id: -1,
  4502. label: this.$t('lable.allStaff'),
  4503. })
  4504. this.membCount = 0;
  4505. //设置员工到部门下面
  4506. this.setUserToDept(list);
  4507. this.data = list;
  4508. // console.log('data',this.data);
  4509. this.expandDate = [this.data[1].id]
  4510. this.allData = list;
  4511. // if (noAllData.length > 0) {
  4512. // if (noAllData[0].label == '全部人员') {
  4513. // noAllData.splice(0,1);
  4514. // }
  4515. // }
  4516. // this.setUserToDept(noAllData);
  4517. // this.deptMembData = noAllData;
  4518. this.option = this.changeArr(list1);
  4519. list[0].membCount = this.membCount;
  4520. if (this.depData.id == -1) {
  4521. this.depData.membCount = this.membCount;
  4522. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4523. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4524. } else {
  4525. if (this.depData.isUser == null) {
  4526. var dep = this.findTargetDept(this.data, this.depData.id);
  4527. var membDeptList = [];
  4528. membDeptList.push(dep);
  4529. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4530. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4531. }
  4532. }
  4533. if (this.depData.isUser == null) {
  4534. if (this.isFill) {
  4535. this.fillMembList = this.fillList;
  4536. } else {
  4537. this.fillMembList = this.unFillList;
  4538. }
  4539. }
  4540. this.leaveAllNum = 0
  4541. for(let i in this.unFillList){
  4542. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4543. this.leaveAllNum += 1
  4544. }
  4545. }
  4546. this.stateChange()
  4547. } else {
  4548. this.$message({
  4549. message: res.msg,
  4550. type: "error"
  4551. });
  4552. }
  4553. },
  4554. error => {
  4555. this.$message({
  4556. message: error,
  4557. type: "error"
  4558. });
  4559. });
  4560. this.getReportFillStatus();
  4561. },
  4562. findTargetDept(list, deptId) {
  4563. var t = null;
  4564. for (var i=0;i<list.length; i++) {
  4565. if (list[i].isUser == null && list[i].id == deptId) {
  4566. t = list[i];
  4567. break;
  4568. }
  4569. }
  4570. if (t == null) {
  4571. for (var i=0;i<list.length; i++) {
  4572. if (list[i].children != null && list[i].children.length > 0) {
  4573. t = this.findTargetDept(list[i].children, deptId);
  4574. if (t != null) {
  4575. break;
  4576. }
  4577. }
  4578. }
  4579. }
  4580. return t;
  4581. },
  4582. getUserMembListFromDeptList(list, isFill) {
  4583. var membList = [];
  4584. for (var i in list) {
  4585. var deptName = list[i].label;
  4586. if (list[i].userList != null) {
  4587. list[i].userList.forEach(element => {
  4588. if (isFill == 0) {
  4589. //获取未填的
  4590. if (element.state == null) {
  4591. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4592. membList.push(obj);
  4593. }
  4594. } else {
  4595. if (element.state != null) {
  4596. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4597. membList.push(obj);
  4598. }
  4599. }
  4600. });
  4601. }
  4602. if (list[i].children != null) {
  4603. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4604. }
  4605. }
  4606. return membList;
  4607. },
  4608. setUserToDept(list) {
  4609. for (var i in list) {
  4610. var cnt = 0;
  4611. if (list[i].children != null) {
  4612. this.setUserToDept(list[i].children);
  4613. for (var m in list[i].children) {
  4614. cnt += list[i].children[m].membCount;
  4615. }
  4616. }
  4617. if (list[i].userList != null) {
  4618. if (list[i].children == null) {
  4619. list[i].children = [];
  4620. }
  4621. list[i].userList.forEach(element => {
  4622. var obj = {
  4623. id: element.id,
  4624. label:element.name,
  4625. state:element.state,
  4626. parentId:element.departmentId,
  4627. isUser:1,
  4628. workingTime: element.workingTime,
  4629. leaveDays: element.leaveDays,
  4630. leaveTimes: element.leaveTimes
  4631. };
  4632. list[i].children.push(obj);
  4633. this.membCount++;
  4634. cnt++;
  4635. });
  4636. }
  4637. list[i].membCount = cnt;
  4638. }
  4639. },
  4640. // 修改数组
  4641. changeArr(arr) {
  4642. for (var i = 0; i < arr.length; i++) {
  4643. if(arr[i].id != -1 && arr[i].id != 0) {
  4644. if (arr[i].children != null && arr[i].children.length>0) {
  4645. arr[i].children = this.changeArr(arr[i].children);
  4646. }
  4647. arr[i].id && (arr[i].value = arr[i].id);
  4648. delete arr[i].id;
  4649. }
  4650. }
  4651. for(var i in arr) {
  4652. if(arr[i].id == -1 || arr[i].id == 0) {
  4653. arr.splice(i,1)
  4654. }
  4655. }
  4656. return arr;
  4657. },
  4658. //时间段范围设置改动,监听
  4659. onTimeTypeChange(timeType) {
  4660. this.seleChn(1)
  4661. this.showAddMore = true;
  4662. for(var i in this.workForm.domains) {
  4663. if (this.workForm.domains[i].timeType == 0) {
  4664. this.showAddMore = false;
  4665. break;
  4666. }
  4667. }
  4668. if (this.showAddMore) {
  4669. //检测数量
  4670. if (this.workForm.domains.length == 2) {
  4671. this.showAddMore = false;
  4672. } else {
  4673. this.showAddMore = true;
  4674. }
  4675. }
  4676. },
  4677. getTimeType() {
  4678. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4679. res => {
  4680. if (res.code == "ok") {
  4681. var t = res.data;
  4682. this.reportTimeType = t;
  4683. if (this.reportTimeType.type > 0) {
  4684. this.showAddMore = true;
  4685. }
  4686. //转化时间格式
  4687. if (t.allday != null) {
  4688. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4689. }
  4690. if (t.am != null) {
  4691. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4692. }
  4693. if (t.pm != null) {
  4694. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4695. }
  4696. let arr = []
  4697. for(var i in res.data.excludeTimeList) {
  4698. let obj = {
  4699. s: res.data.excludeTimeList[i].startTime,
  4700. e: res.data.excludeTimeList[i].endTime,
  4701. }
  4702. arr.push(obj)
  4703. }
  4704. this.vacationTime = arr
  4705. } else {
  4706. this.$message({
  4707. message: res.msg,
  4708. type: "error"
  4709. });
  4710. }
  4711. },
  4712. error => {
  4713. this.listLoading = false;
  4714. this.$message({
  4715. message: error,
  4716. type: "error"
  4717. });
  4718. });
  4719. },
  4720. // 改变月份 -------
  4721. changeMonthOut() {
  4722. this.getAllDate();
  4723. this.getReportList();
  4724. this.getDepartment();
  4725. },
  4726. // 选择日期
  4727. choseDate(i, item) {
  4728. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4729. return
  4730. }
  4731. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4732. this.choseDay = i;
  4733. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4734. sessionStorage.msg = this.date + day,
  4735. this.getReportList();
  4736. this.getDepartment();
  4737. this.curDate = item.date;
  4738. },
  4739. canClick(i, item){
  4740. let nowDate = new Date()
  4741. let nowDateYear = nowDate.getFullYear()
  4742. let itemYear = parseInt(this.date.split('-')[0])
  4743. let nowDateMonth = nowDate.getMonth() + 1
  4744. let itemMonth = parseInt(this.date.split('-')[1])
  4745. let nowDateDay = nowDate.getDate()
  4746. let itemDay = parseInt(item.showDate.split('.')[1])
  4747. if(nowDateYear < itemYear){
  4748. return false
  4749. }else if(nowDateYear == itemYear){
  4750. if(nowDateMonth < itemMonth){
  4751. return false
  4752. }else if(nowDateMonth == itemMonth){
  4753. if(nowDateDay < itemDay){
  4754. return false
  4755. }
  4756. }
  4757. }
  4758. },
  4759. // 获取日期列表
  4760. getAllDate(e) {
  4761. var dayArry = [];
  4762. var day = this.getCountDays();
  4763. let curMonthDay = null;
  4764. for (var k = 1; k <= day; k++) {
  4765. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4766. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4767. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4768. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4769. if(sessionStorage.msg) {
  4770. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4771. this.choseDay = k - 1;
  4772. curMonthDay = str;
  4773. }
  4774. } else {
  4775. if (new Date().getDate() == k) {
  4776. this.choseDay = k - 1;
  4777. }
  4778. }
  4779. } else {
  4780. this.choseDay = 0;
  4781. }
  4782. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  4783. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  4784. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  4785. }
  4786. this.allDate = dayArry;
  4787. //不能超过最大日期
  4788. if (this.choseDay > day-1) {
  4789. this.choseDay = day-1;
  4790. }
  4791. if(sessionStorage.from != 1){
  4792. let nowmonth = new Date().getMonth() + 1
  4793. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  4794. let nowdate = new Date().getDate()
  4795. if(nowd == this.date){
  4796. if(e && sessionStorage.msg){
  4797. }else{
  4798. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  4799. }
  4800. let nowday = new Date(sessionStorage.msg).getDate()
  4801. this.choseDay = nowday - 1
  4802. let monthdate = new Date(sessionStorage.msg)
  4803. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  4804. }else{
  4805. if(e && sessionStorage.msg){
  4806. }else{
  4807. sessionStorage.msg = this.date + '-01'
  4808. }
  4809. let monthdate = new Date(sessionStorage.msg)
  4810. this.choseDay = monthdate.getDate() - 1
  4811. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  4812. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  4813. }
  4814. }else{
  4815. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  4816. }
  4817. //从消息点击跳转过来的,直接加载指定日期
  4818. if (sessionStorage.from == 1 && sessionStorage.msg) {
  4819. this.curDate = sessionStorage.msg;
  4820. sessionStorage.from = 0;
  4821. } else {
  4822. // if (curMonthDay != null) {
  4823. // // this.curDate = curMonthDay;
  4824. // let d = new Date(sessionStorage.msg)
  4825. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  4826. // } else {
  4827. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  4828. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  4829. // }
  4830. }
  4831. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  4832. // if(!sessionStorage.msg){
  4833. // let msgday = this.choseDay + 1
  4834. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  4835. // }
  4836. this.getReportFillStatus();
  4837. },
  4838. getCountDays() {
  4839. var newstr = this.date.replace(/-/g, "/");
  4840. var curDate = new Date(newstr+'/01');
  4841. var curMonth = curDate.getMonth();
  4842. curDate.setMonth(curMonth + 1);
  4843. curDate.setDate(0);
  4844. return curDate.getDate();
  4845. },
  4846. //获取日报列表
  4847. getReportList() {
  4848. this.listLoading = true;
  4849. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4850. let param = {date: this.date + day};
  4851. if (this.deptId) {
  4852. param.deptId = this.deptId;
  4853. }
  4854. if (this.targetUid) {
  4855. param.userId = this.targetUid;
  4856. }
  4857. this.http.post( this.port.report.list, param,
  4858. res => {
  4859. this.listLoading = false;
  4860. if (res.code == "ok") {
  4861. this.reportList = res.data;
  4862. if(document.querySelector("#day"+this.choseDay)){
  4863. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  4864. }
  4865. } else {
  4866. this.$message({
  4867. message: res.msg,
  4868. type: "error"
  4869. });
  4870. }
  4871. },
  4872. error => {
  4873. this.listLoading = false;
  4874. this.$message({
  4875. message: error,
  4876. type: "error"
  4877. });
  4878. });
  4879. },
  4880. // 处理数据
  4881. // dealWith() {
  4882. // var tianxie = 0
  4883. // var weixtianxie = 0
  4884. // if(this.selectState == -1) {
  4885. // } else {
  4886. // var arr = []
  4887. // for (var i in this.reportList) {
  4888. // arr.push(this.reportList[i].id)
  4889. // }
  4890. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  4891. // }
  4892. // },
  4893. // getDealWith(item, tx, wtx, arr) {
  4894. // for(var i in item) {
  4895. // if(item[i].children) {
  4896. // this.getDealWith(item[i].children, tx, wtx, arr)
  4897. // } else {
  4898. // if(arr.indexOf(item[i].id) != '-1') {
  4899. // tx = +tx + 1
  4900. // }
  4901. // }
  4902. // }
  4903. // },
  4904. //导出员工工时统计
  4905. exportUserTime() {
  4906. this.listLoading = true;
  4907. var param = {};
  4908. if (this.exportParam.dateRange != null) {
  4909. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  4910. }
  4911. this.http.post('/department/exportDeptStatistic', param,
  4912. res => {
  4913. this.listLoading = false;
  4914. if (res.code == "ok") {
  4915. location.href = res.data;
  4916. this.exportTimeDialog = false;
  4917. } else {
  4918. this.$message({
  4919. message: res.msg,
  4920. type: "error"
  4921. });
  4922. }
  4923. },
  4924. error => {
  4925. this.listLoading = false;
  4926. this.$message({
  4927. message: error,
  4928. type: "error"
  4929. });
  4930. });
  4931. },
  4932. //导出日报
  4933. exportReport() {
  4934. this.listLoading = true;
  4935. var param = {};
  4936. if (this.exportParam.dateRange != null) {
  4937. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  4938. }
  4939. if (this.exportParam.projectId != null) {
  4940. param.projectId = this.exportParam.projectId;
  4941. }
  4942. if (this.exportParam.departmentId != null) {
  4943. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  4944. }
  4945. param.stateKey = this.stateKey
  4946. // param.departmentId = this.user.departmentId
  4947. this.http.post( this.port.report.export, param,
  4948. res => {
  4949. this.listLoading = false;
  4950. if (res.code == "ok") {
  4951. location.href = res.data;
  4952. this.exportDialog = false;
  4953. } else {
  4954. this.$message({
  4955. message: res.msg,
  4956. type: "error"
  4957. });
  4958. }
  4959. },
  4960. error => {
  4961. this.listLoading = false;
  4962. this.$message({
  4963. message: error,
  4964. type: "error"
  4965. });
  4966. });
  4967. },
  4968. //获取项目列表
  4969. getProjectList() {
  4970. this.listLoading = true;
  4971. this.http.post( this.port.project.list, {},
  4972. res => {
  4973. this.listLoading = false;
  4974. if (res.code == "ok") {
  4975. for(var i in res.data) {
  4976. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  4977. res.data[i].projectCode = ''
  4978. }
  4979. }
  4980. this.projectList = res.data;
  4981. console.log("项目列表",this.projectList);
  4982. } else {
  4983. this.$message({
  4984. message: res.msg,
  4985. type: "error"
  4986. });
  4987. }
  4988. },
  4989. error => {
  4990. this.listLoading = false;
  4991. this.$message({
  4992. message: error,
  4993. type: "error"
  4994. });
  4995. });
  4996. },
  4997. // 获取填报日报的项目下拉列表
  4998. getFillProjectList() {
  4999. this.http.post( this.port.project.list, {
  5000. forReport: 1
  5001. },res => {
  5002. if (res.code == "ok") {
  5003. for(var i in res.data) {
  5004. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5005. res.data[i].projectCode = ''
  5006. }
  5007. }
  5008. this.fillProjectList = res.data;
  5009. this.getRecentlyProject()
  5010. } else {
  5011. this.$message({
  5012. message: res.msg,
  5013. type: "error"
  5014. });
  5015. }
  5016. },
  5017. error => {
  5018. this.$message({
  5019. message: error,
  5020. type: "error"
  5021. });
  5022. });
  5023. },
  5024. getBasecostItemList() {
  5025. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5026. companyId: this.user.companyId
  5027. },
  5028. res => {
  5029. if (res.code == "ok") {
  5030. this.timeBasecostList = res.data;
  5031. }
  5032. });
  5033. },
  5034. getAIReport(createDate) {
  5035. this.http.post('/report/getAIReport', {},
  5036. res => {
  5037. if (res.code == "ok") {
  5038. var quanbu = 0
  5039. this.jsDay = 1
  5040. var zhi = ''
  5041. var slp = res.data
  5042. for(var i in slp) {
  5043. var sp = +slp[i].workingTime + 0
  5044. zhi = this.jsDay * sp
  5045. quanbu = +quanbu + zhi
  5046. }
  5047. this.jsTime = quanbu
  5048. var aiReportData = res.data;
  5049. this.canCancelInDialog = false
  5050. if(aiReportData.length != 0) {
  5051. var arr = [];
  5052. for(var i in aiReportData) {
  5053. arr.push({
  5054. id: null,
  5055. projectId: aiReportData[i].projectId,
  5056. workingTime: aiReportData[i].workingTime,
  5057. content: '',
  5058. progress:100,
  5059. state: 2,
  5060. timeType: aiReportData[i].timeType,
  5061. subProjectList: aiReportData[i].subProjectList,
  5062. taskList: aiReportData[i].taskList,
  5063. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5064. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5065. taskId: aiReportData[i].taskId,
  5066. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5067. startTime: aiReportData[i].startTime,
  5068. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5069. endTime: aiReportData[i].endTime,
  5070. isOvertime: 0,
  5071. progress:aiReportData[i].progress,
  5072. professionProgress: aiReportData[i].professionProgressList,
  5073. stages:aiReportData[i].stages,
  5074. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5075. pics: null,
  5076. multiWorktime: aiReportData[i].multiWorktime,
  5077. worktimeList: [{}],
  5078. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5079. wuduList: aiReportData[i].degreeList,
  5080. taskGroups:aiReportData[i].taskGroups,
  5081. customData: aiReportData[i].customData,//自定义的数值
  5082. auditUserList: aiReportData[i].auditUserList,
  5083. projectAuditorId: aiReportData[i].projectAuditorId,
  5084. projectAuditorName: aiReportData[i].projectAuditorName,
  5085. overtimeHours: aiReportData[i].overtimeHours,
  5086. customText: aiReportData[i].customText,
  5087. basecostId: aiReportData[i].basecostId,
  5088. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5089. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5090. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5091. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5092. canEdit: true
  5093. })
  5094. }
  5095. this.workForm.domains = arr;
  5096. } else {
  5097. }
  5098. this.canEdit = true;
  5099. this.originCanEdit = true;
  5100. this.seleChn()
  5101. } else {
  5102. this.$message({
  5103. message: res.msg,
  5104. type: "error"
  5105. });
  5106. }
  5107. },
  5108. error => {
  5109. this.$message({
  5110. message: error,
  5111. type: "error"
  5112. });
  5113. });
  5114. },
  5115. // 获取个人某天的日报 111111
  5116. getReport() {
  5117. this.http.post( this.port.report.getPort, {
  5118. date: this.workForm.createDate
  5119. },
  5120. res => {
  5121. if (res.code == "ok") {
  5122. var quanbu = 0
  5123. this.jsDay = 1
  5124. var zhi = ''
  5125. var slp = res.data.report
  5126. for(var i in slp) {
  5127. var sp = +slp[i].workingTime + 0
  5128. zhi = this.jsDay * sp
  5129. quanbu = +quanbu + zhi
  5130. }
  5131. this.jsTime = quanbu
  5132. var list = res.data;
  5133. this.report = list;
  5134. this.reportTimeType = this.report.timeType;
  5135. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5136. this.isWeekend = !this.report.isWorkDay;
  5137. this.canCancelInDialog = false;
  5138. this.hasWrittenReport = list.report.length != 0;
  5139. if(list.report.length != 0) {
  5140. var arr = [];
  5141. this.canEdit = false;
  5142. let candelete = true
  5143. for(var i in list.report) {
  5144. var flg = null
  5145. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5146. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5147. var filteredRespList = null
  5148. if (targetP.length > 0) {
  5149. var isPublic = targetP[0].isPublic;
  5150. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5151. }
  5152. arr.push({
  5153. id: list.report[i].id,
  5154. projectId: list.report[i].projectId,
  5155. workingTime: list.report[i].workingTime,
  5156. content: list.report[i].content,
  5157. state: list.report[i].state,
  5158. timeType: list.report[i].timeType,
  5159. subProjectList: list.report[i].subProjectList,
  5160. taskList: list.report[i].taskList,
  5161. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5162. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5163. taskId: list.report[i].taskId,
  5164. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5165. startTime: list.report[i].startTime,
  5166. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5167. endTime: list.report[i].endTime,
  5168. isOvertime: flg,
  5169. progress:list.report[i].progress,
  5170. professionProgress: list.report[i].professionProgressList,
  5171. stages:list.report[i].stages,
  5172. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5173. pics: list.report[i].pics,
  5174. multiWorktime: list.report[i].multiWorktime,
  5175. worktimeList: list.report[i].worktimeList,
  5176. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5177. wuduList: list.report[i].degreeList,
  5178. taskGroups:list.report[i].taskGroups,
  5179. customData: list.report[i].customData,//自定义的数值
  5180. auditUserList: list.report[i].auditUserList,
  5181. projectAuditorId: list.report[i].projectAuditorId,
  5182. projectAuditorName: list.report[i].projectAuditorName,
  5183. overtimeHours: list.report[i].overtimeHours,
  5184. customText: list.report[i].customText,
  5185. basecostId: list.report[i].basecostId,
  5186. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5187. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5188. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5189. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5190. canEdit: list.report[i].state >= 2 ? true : false,
  5191. extraField1: list.report[i].extraField1,
  5192. extraField2: list.report[i].extraField2,
  5193. extraField3: list.report[i].extraField3,
  5194. workContentList: list.report[i].workContentList,
  5195. filteredRespList: filteredRespList
  5196. })
  5197. if (list.report[i].state >= 2) {
  5198. this.canEdit = true;
  5199. }
  5200. if(list.report[i].state < 2){
  5201. candelete = false
  5202. }
  5203. if (list.report[i].state == 0){
  5204. this.canCancelInDialog = true
  5205. }
  5206. // 加判断
  5207. if(this.user.timeType.choseFromAlbum == 1) {
  5208. let arrList = []
  5209. for(var k in list.report[i].pics) {
  5210. let obj = {
  5211. name: k,
  5212. url: list.report[i].pics[k]
  5213. }
  5214. arrList.push(obj)
  5215. }
  5216. arr[i].imgListUrl = arrList
  5217. arr[i].imgList = list.report[i].pics
  5218. }
  5219. }
  5220. this.reportCanDelete = candelete
  5221. this.workForm = {
  5222. createDate: this.workForm.createDate,
  5223. domains: arr,
  5224. userNames:null,
  5225. userId:null,
  5226. time: list.time
  5227. }
  5228. console.log('workForm', this.workForm)
  5229. } else {
  5230. this.workForm = {
  5231. createDate: this.workForm.createDate,
  5232. domains: [{
  5233. id: null,
  5234. projectId: "",
  5235. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5236. content: "",
  5237. progress:100,
  5238. state: 2,
  5239. timeType:0,
  5240. multiWorktime: this.reportTimeType.multiWorktime,
  5241. worktimeList:[{}],
  5242. canEdit: true,
  5243. auditorFirst: '',
  5244. auditorSec: '',
  5245. auditorThird: '',
  5246. ccUserid: ''
  5247. }],
  5248. userId:null,
  5249. userNames:null,
  5250. time: this.report.time
  5251. }
  5252. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5253. this.$set(this.workForm.domains[0],'isOvertime',true)
  5254. if(this.reportTimeType.type != 2){
  5255. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5256. }
  5257. }
  5258. if(this.user.timeType.type == 1) {
  5259. var shuzhi = this.user.timeType.allday + ''
  5260. // console.log('执行一次', shuzhi.indexOf('.'))
  5261. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5262. }
  5263. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5264. //默认给第一个,必填字段
  5265. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5266. }
  5267. this.canEdit = true;
  5268. }
  5269. this.originCanEdit = this.canEdit;
  5270. this.seleChn()
  5271. } else {
  5272. this.$message({
  5273. message: res.msg,
  5274. type: "error"
  5275. });
  5276. }
  5277. },
  5278. error => {
  5279. this.$message({
  5280. message: error,
  5281. type: "error"
  5282. });
  5283. });
  5284. },
  5285. guanbi() {
  5286. this.falsss = false,
  5287. this.workTimeForMinYi=0
  5288. },
  5289. // 打开日报填写
  5290. fillInReport(i, isBatch) {
  5291. this.isWeekend = false
  5292. this.reportCanDelete = false
  5293. // console.log(this.user.timeType.type, '选择时长')
  5294. if(i != 1) {
  5295. this.falsss = false
  5296. } else {
  5297. this.falsss = true
  5298. }
  5299. if (this.isSubstitude) {
  5300. this.getSubstitudeUserDeptList();
  5301. }
  5302. if(i == -1 || this.isSubstitude) {
  5303. this.isDisable = false;
  5304. } else {
  5305. this.isDisable = true;
  5306. }
  5307. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5308. this.isBatch = isBatch;
  5309. if (this.isBatch == 0 && !this.isSubstitude) {
  5310. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5311. let weekday = new Date(this.workForm.createDate).getDay()
  5312. if(this.user.companyId == 817){
  5313. if(weekday == 0){
  5314. this.isWeekend = true
  5315. }
  5316. }else{
  5317. if(weekday == 0 || weekday == 6){
  5318. this.isWeekend = true
  5319. }
  5320. }
  5321. this.getReport(i);
  5322. } else {
  5323. // console.log('执行到了这里')
  5324. this.jsTime = 0
  5325. this.jsDay = 0
  5326. this.workForm = {
  5327. createDate: null,//批量填报没有日期
  5328. domains: [{
  5329. id: null,
  5330. projectId: "",
  5331. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5332. content: "",
  5333. progress:100,
  5334. state: 2,
  5335. timeType:0,
  5336. multiWorktime: this.reportTimeType.multiWorktime,
  5337. worktimeList:[{}],
  5338. canEdit: true,
  5339. }],
  5340. }
  5341. if(this.user.timeType.type == 1) {
  5342. var shuzhi = this.user.timeType.allday + ''
  5343. // console.log('执行二次')
  5344. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5345. }
  5346. // console.log(this.workForm)
  5347. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5348. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5349. }
  5350. this.canEdit = true;
  5351. }
  5352. this.dialogVisible = true;
  5353. },
  5354. //按周填报的弹窗口中编辑单项目相关数据
  5355. setWeekFormReportItem(reportId, i, names, row,sss) {
  5356. console.log(sss)
  5357. this.http.post('/report/getReportById', {
  5358. reportId: reportId
  5359. },
  5360. res => {
  5361. if (res.code == "ok") {
  5362. var data = res.data.report;
  5363. sss.subProjectId = data.subProjectId
  5364. sss.subProjectList = data.subProjectList;
  5365. sss.stage = data.stage
  5366. sss.subProjectList = data.subProjectList
  5367. sss.stages = data.stages
  5368. sss.taskGroups = data.taskGroups;
  5369. sss.auditUserList = data.auditUserList;
  5370. sss.degreeId = data.degreeId;
  5371. sss.customData = data.customData;
  5372. sss.wuduList = data.degreeList;
  5373. this.zhoBaoIdx = i
  5374. this.zhoBaoName = names
  5375. this.zhoBao = sss
  5376. this.zhis = row
  5377. if (sss.groupId) {
  5378. //最后一个参数表示是否保留stage的值,不要重置为空
  5379. this.getGroupStages(this.zhoBao, 0, true)
  5380. }
  5381. this.$forceUpdate();
  5382. }
  5383. });
  5384. },
  5385. // 按周填报里内容的填写
  5386. tianxies(item, i, names, row) {
  5387. if (item.state == 0) {
  5388. this.$message({
  5389. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5390. type: "error"
  5391. });
  5392. return;
  5393. }
  5394. if (item.state == 1) {
  5395. this.$message({
  5396. message: '已通过状态不可修改',
  5397. type: "error"
  5398. });
  5399. return;
  5400. }
  5401. if(this.user.timeType.notAllowedNoAttendance == 1){
  5402. if(this.zhoData[i].corpTime){
  5403. if(this.zhoData[i].corpTime.workHours == 0){
  5404. this.$message({
  5405. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5406. type: 'error'
  5407. })
  5408. return
  5409. }
  5410. }else{
  5411. this.$message({
  5412. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5413. type: 'error'
  5414. })
  5415. return
  5416. }
  5417. }
  5418. var idd = ''
  5419. var obj = {}
  5420. for(var l in this.projectList) {
  5421. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5422. }
  5423. obj.projectId = idd
  5424. this.tianxieDialogVisible = true
  5425. this.scopess = item
  5426. var sss = {}
  5427. if (item.id != null) {
  5428. sss.id = item.id;
  5429. sss.state = item.state;
  5430. } else {
  5431. sss.id = -1;
  5432. sss.state = 3;
  5433. }
  5434. sss.projectId = idd;
  5435. sss.progress = item.progress
  5436. sss.time = item.time
  5437. sss.content = item.content;
  5438. console.log('333', sss.content)
  5439. if (sss.time == '' && this.reportTimeType.type == 2) {
  5440. //取已填时间范围中最大的一个作为开始时间
  5441. var startTime = '09:00';
  5442. var fillStartTime = '00:00';
  5443. for (var t in this.selProjectList) {
  5444. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5445. if (fillItem.time) {
  5446. if (fillItem.time[1] > fillStartTime) {
  5447. fillStartTime = fillItem.time[1];
  5448. }
  5449. }
  5450. }
  5451. if (fillStartTime == '00:00') {
  5452. fillStartTime = '09:00';
  5453. }
  5454. var fillEndMax = '18:00';
  5455. if (fillStartTime >= '18:00') {
  5456. fillEndMax = '23:59';
  5457. }
  5458. sss.time = [fillStartTime, fillEndMax];
  5459. }
  5460. sss.groupId = item.groupId
  5461. sss.stage = item.stage;
  5462. sss.workingTime = item.workingTime
  5463. sss.projectAuditorId = item.projectAuditorId;
  5464. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5465. //默认选中第一个
  5466. sss.basecostId = this.timeBasecostList[0].id;
  5467. }
  5468. var hasEdited = this.zhoData[i][names].hasEdited;
  5469. if (hasEdited) {
  5470. //编辑过了
  5471. sss.subProjectId = item.subProjectId
  5472. sss.stage = item.stage
  5473. sss.subProjectList = item.subProjectList
  5474. sss.stages = item.stages
  5475. sss.taskGroups = item.taskGroups;
  5476. console.log(sss.taskGroups, '33333');
  5477. sss.auditUserList = obj.auditUserList;
  5478. sss.degreeId = item.degreeId;
  5479. sss.customData = item.customData;
  5480. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5481. //只有一个审核人,自动设置上去
  5482. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5483. }
  5484. sss.wuduList = item.wuduList;
  5485. this.zhoBaoIdx = i
  5486. this.zhoBaoName = names
  5487. this.zhoBao = sss
  5488. this.zhis = row
  5489. if (sss.groupId) {
  5490. //最后一个参数表示是否保留stage的值,不要重置为空
  5491. this.getGroupStages(this.zhoBao, 0, true)
  5492. }
  5493. this.$forceUpdate();
  5494. } else {
  5495. //第一次打开,获取数据
  5496. if (sss.id == -1) {
  5497. //新填报的
  5498. this.selectProject(obj, 0);
  5499. var that = this
  5500. setTimeout(() =>{
  5501. sss.subProjectId = that.workForm.domains[0].subProjectId
  5502. sss.subProjectList = item.subProjectList;
  5503. sss.stage = that.workForm.domains[0].stage
  5504. sss.subProjectList = that.workForm.domains[0].subProjectList
  5505. sss.stages = that.workForm.domains[0].stages
  5506. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5507. sss.auditUserList = obj.auditUserList;
  5508. sss.degreeId = item.degreeId;
  5509. sss.customData = item.customData;
  5510. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5511. //只有一个审核人,自动设置上去
  5512. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5513. }
  5514. sss.wuduList = row[0].wuduList
  5515. that.zhoBaoIdx = i
  5516. that.zhoBaoName = names
  5517. that.zhoBao = sss
  5518. that.zhis = row
  5519. if (sss.groupId) {
  5520. //最后一个参数表示是否保留stage的值,不要重置为空
  5521. this.getGroupStages(that.zhoBao, 0, false)
  5522. }
  5523. that.$forceUpdate();
  5524. },600);
  5525. } else {
  5526. //编辑填报过的;数据库已经存在的
  5527. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5528. }
  5529. }
  5530. },
  5531. // 按周填报里内容的填写点击确定
  5532. setWeekProItemData() {
  5533. //专业版模式下,任务分组和阶段必填
  5534. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5535. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5536. this.$message({
  5537. message: '任务分组和阶段必填,请检查',
  5538. type: "error"
  5539. });
  5540. return;
  5541. }
  5542. }
  5543. //检查子项目是否必填
  5544. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5545. this.$message({
  5546. message: '子项目必填,请检查',
  5547. type: "error"
  5548. });
  5549. return;
  5550. }
  5551. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5552. this.$message({
  5553. message: this.$t('message.Pleaseselectareviewer'),
  5554. type: "error"
  5555. });
  5556. return
  5557. }
  5558. if(this.user.timeType.reportAuditType == 3){
  5559. let auditTips = ''
  5560. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5561. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5562. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5563. if(auditTips){
  5564. auditTips = auditTips.substring(0,auditTips.length - 1)
  5565. this.$message({
  5566. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5567. type: 'error'
  5568. })
  5569. return
  5570. }
  5571. }
  5572. let errtips = ''
  5573. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  5574. errtips += this.user.timeType.customDegreeName + '、'
  5575. }
  5576. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5577. errtips += this.user.timeType.customDataName + '、'
  5578. }
  5579. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5580. errtips += this.user.timeType.customTextName + '、'
  5581. }
  5582. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5583. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5584. }
  5585. if(errtips){
  5586. errtips = errtips.substring(0,errtips.length - 1)
  5587. this.$message({
  5588. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5589. type: 'error'
  5590. })
  5591. return
  5592. }
  5593. this.tianxieDialogVisible = false
  5594. var zhong = this.zhoData
  5595. this.zhoBao.hasEdited = true;
  5596. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5597. this.zhoData = zhong
  5598. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5599. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5600. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5601. },
  5602. // 获取本周
  5603. getCurrentWeek() {
  5604. //今天
  5605. this.targetWeekDate = new Date();
  5606. this.initWeekFormData();
  5607. // this.jiazai()
  5608. },
  5609. // 获取上周
  5610. handleGetPrevWeek() {
  5611. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5612. this.initWeekFormData();
  5613. // this.jiazai()
  5614. },
  5615. // 获取下周
  5616. handleGetNextvWeek() {
  5617. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5618. this.initWeekFormData()
  5619. },
  5620. // 加载动画
  5621. jiazai() {
  5622. this.weekDataLoading = true
  5623. var that = this
  5624. setTimeout(() =>{
  5625. that.weekDataLoading = false
  5626. },1000);
  5627. },
  5628. // 转时间格式
  5629. dealdate(date) {
  5630. const dt = new Date(date)
  5631. const y = dt.getFullYear()
  5632. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5633. const d = (dt.getDate() + '').padStart(2, '0')
  5634. return `${y}-${m}-${d}`
  5635. },
  5636. // 按周填报
  5637. fillInReportss() {
  5638. window.addEventListener('scroll', this.handleScroll, true)
  5639. // this.jiazai()
  5640. this.fillWeekDialogVisi = true
  5641. this.getCurrentWeek();
  5642. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5643. //重新获取工时预警类型的预算项
  5644. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5645. companyId: this.user.companyId
  5646. },
  5647. res => {
  5648. if (res.code == "ok") {
  5649. this.timeBasecostList = res.data;
  5650. }
  5651. });
  5652. }
  5653. },
  5654. fillInReportCustom() {
  5655. this.weekIndex++
  5656. this.weekParentData = {
  5657. isSubstitude: this.isSubstitude
  5658. }
  5659. this.fillWeekDialogVisiCustom = true
  5660. },
  5661. // 按周填报的项目筛选
  5662. selListFun(){
  5663. this.selProjectList = []
  5664. if(this.selCon.length){
  5665. for (let i = 0; i < this.selCon.length; i++) {
  5666. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5667. }
  5668. this.selConShow = false ;
  5669. for (let i in this.zhoData) {
  5670. var obj = this.zhoData[i];
  5671. for(var j in this.selProjectList) {
  5672. var xinzhi = this.selProjectList[j].projectName
  5673. obj[xinzhi] = {}
  5674. obj[xinzhi].time = ''
  5675. obj[xinzhi].content = ''
  5676. obj[xinzhi].progress = 0
  5677. obj[xinzhi].workingTime = 0
  5678. }
  5679. }
  5680. this.initWeekFormData();
  5681. }else{
  5682. this.$message({
  5683. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5684. type:'error'
  5685. })
  5686. }
  5687. },
  5688. setWeekCardTimeData(list) {
  5689. for(let i in list){
  5690. let datei = '';
  5691. if (this.user.timeType.showDdCardtime == 1) {
  5692. datei = list[i].workDate;
  5693. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5694. datei = list[i].createDate;
  5695. } else if (this.user.timeType.syncFanwei == 1) {
  5696. datei = list[i].workDate;
  5697. }
  5698. for(let m in this.zhoData) {
  5699. if(datei == this.zhoData[m].zhoDataTime){
  5700. let item = {
  5701. startTime: list[i].startTime,
  5702. endTime: list[i].endTime,
  5703. workHours: list[i].workHours
  5704. }
  5705. this.$set(this.zhoData[m],'corpTime',item)
  5706. }
  5707. }
  5708. }
  5709. },
  5710. getWeeklyCardTime(){ //按周填报获取考勤信息
  5711. let dateStr = []
  5712. for(let i in this.zhoData){
  5713. dateStr.push(this.zhoData[i].zhoDataTime)
  5714. }
  5715. this.http.post('/report/getWeeklyCardTime',{
  5716. dateStr: JSON.stringify(dateStr)
  5717. },res => {
  5718. if(res.code == 'ok'){
  5719. for(let i in res.data){
  5720. let datei = '';
  5721. if (this.user.timeType.showDdCardtime == 1) {
  5722. datei = res.data[i].workDate.split('-');
  5723. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5724. datei = res.data[i].createDate.split('-');
  5725. }
  5726. for(let m in this.zhoData){
  5727. let datem = new Date(this.zhoData[m].zhoDataTime)
  5728. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5729. let item = {
  5730. startTime: res.data[i].startTime,
  5731. endTime: res.data[i].endTime,
  5732. workHours: res.data[i].workHours
  5733. }
  5734. this.$set(this.zhoData[m],'corpTime',item)
  5735. }
  5736. }
  5737. }
  5738. }else{
  5739. this.$message({
  5740. message: res.msg,
  5741. type: 'error'
  5742. })
  5743. }
  5744. },err => {
  5745. this.$message({
  5746. message: err,
  5747. type: 'error'
  5748. })
  5749. })
  5750. },
  5751. selListqx(){
  5752. this.fillWeekDialogVisi = false
  5753. this.selProjectList = []
  5754. this.selCon = []
  5755. },
  5756. handleScroll() {
  5757. this.changdu = this.projectList.length + 1
  5758. },
  5759. // 自动选择时间点的事件
  5760. // async zhoTimes(item, i) {
  5761. // var iss = i
  5762. // if(item.time == null) {
  5763. // return
  5764. // } else {
  5765. // const zhi = this.zhoData[iss];
  5766. // let he = 0;
  5767. // const timeArr = Object.values(zhi)
  5768. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  5769. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  5770. // const data = await this.getWeekHoursByTimeRange(timeArr);
  5771. // console.log(data, 'data');
  5772. // zhi.he = `${he}h`;
  5773. // }
  5774. // },
  5775. async zhoTimes(item, index) {
  5776. const zho = this.zhoData[index];
  5777. if (!item.time) {
  5778. return;
  5779. }
  5780. const timeArr = Object.values(zho)
  5781. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  5782. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  5783. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  5784. zho.he = `${totalHours[0]}h`;
  5785. },
  5786. // 判断两个时间段是否重叠
  5787. timeOverlap(idx, dateAr) {
  5788. let zhi = 0
  5789. for (let k in dateAr) {
  5790. if (idx !== k) {
  5791. 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))) {
  5792. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  5793. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  5794. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  5795. }
  5796. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  5797. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  5798. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  5799. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  5800. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  5801. } else {
  5802. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  5803. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  5804. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  5805. }
  5806. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  5807. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  5808. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  5809. }
  5810. }
  5811. }
  5812. }
  5813. }
  5814. return zhi
  5815. },
  5816. // 计算时间
  5817. getHourMinutes(str, end) {
  5818. var he = 0
  5819. var date2 = '2021/12/12 ' + end +':00'
  5820. var date1 = '2021/12/12 ' + str +':00'
  5821. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  5822. var leave1=date3%(24*3600*1000)
  5823. var hours=Math.floor(leave1/(3600*1000))
  5824. var leave2=leave1%(3600*1000)
  5825. var minutes=Math.floor(leave2/(60*1000))
  5826. var shi = hours+'.'+ minutes
  5827. return he += +shi
  5828. },
  5829. // 自动选择事件长度的事件
  5830. zhoXuan(item, i) {
  5831. var iss = i
  5832. if(item.time == null) {
  5833. return
  5834. } else {
  5835. var zhi = this.zhoData[iss]
  5836. var he = 0
  5837. for(var i in zhi) {
  5838. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  5839. he += +zhi[i].workingTime
  5840. }
  5841. }
  5842. zhi.he = he + 'h'
  5843. }
  5844. },
  5845. // 获取全部人员
  5846. getUsers() {
  5847. this.http.post('/user/getSimpleActiveUserList', {},
  5848. res => {
  5849. if (res.code == "ok") {
  5850. this.usersList = res.data;
  5851. } else {
  5852. this.$message({
  5853. message: res.msg,
  5854. type: "error"
  5855. });
  5856. }
  5857. },
  5858. error => {
  5859. this.$message({
  5860. message: error,
  5861. type: "error"
  5862. });
  5863. });
  5864. },
  5865. // 按时间比例
  5866. addBli(item, i) {
  5867. var iss = i
  5868. if(item.time == null) {
  5869. return
  5870. } else {
  5871. var zhi = this.zhoData[iss]
  5872. var he = 0
  5873. for(var i in zhi) {
  5874. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  5875. he += +zhi[i].workingTime
  5876. }
  5877. }
  5878. zhi.he = he.toFixed(1) + 'h'
  5879. }
  5880. },
  5881. //按周填报选择的项目发生变化,需要设置列
  5882. onSelProjectChange() {
  5883. for (let i = 0; i < this.selCon.length; i++) {
  5884. var exists = false;
  5885. for (let j = 0; j < this.selProjectList.length; j++) {
  5886. if (this.selProjectList[j].id == this.selCon[i]) {
  5887. exists = true;
  5888. break;
  5889. }
  5890. }
  5891. if (!exists) {
  5892. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  5893. this.selProjectList.push(newProject);
  5894. //添加新项目
  5895. for (var w in this.zhoData) {
  5896. var dayItem = this.zhoData[w];
  5897. var pName = newProject.projectName;
  5898. dayItem[pName] = {};
  5899. dayItem[pName].time = ''
  5900. dayItem[pName].content = ''
  5901. dayItem[pName].progress = 0
  5902. dayItem[pName].workingTime = 0
  5903. }
  5904. }
  5905. }
  5906. //去掉
  5907. for (let j = 0; j < this.selProjectList.length; j++) {
  5908. var exists = false;
  5909. for (let i = 0; i < this.selCon.length; i++) {
  5910. if (this.selProjectList[j].id == this.selCon[i]) {
  5911. exists = true;
  5912. break;
  5913. }
  5914. }
  5915. if (!exists) {
  5916. this.selProjectList.splice(j, 1);
  5917. j--;
  5918. }
  5919. }
  5920. this.loadFilledWeekReportItem();
  5921. //刷新表格
  5922. // this.$refs.weekTable.doLayout();
  5923. },
  5924. //根据选中的项目来刷新填写表格
  5925. loadFilledWeekReportItem() {
  5926. for (var w in this.zhoData) {
  5927. var dayItem = this.zhoData[w];
  5928. for (var i = 0; i < this.selProjectList.length; i++) {
  5929. var curColumnProject = this.selProjectList[i];
  5930. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  5931. for (var t in dayItem.reportList) {
  5932. //有日报的项目,不能取消选择
  5933. for (var p in this.fillProjectList) {
  5934. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  5935. }
  5936. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  5937. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  5938. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  5939. if (this.reportTimeType.type == 2) {
  5940. //时间段模式
  5941. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  5942. }
  5943. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  5944. break;
  5945. }
  5946. }
  5947. // dayItem[curColumnProject.projectName] = matchReportItem;
  5948. }
  5949. }
  5950. this.$nextTick(()=>{
  5951. this.$refs.weekTable.doLayout();
  5952. });
  5953. },
  5954. initWeekFormData() {
  5955. this.weekDataLoading = true;
  5956. for (var p in this.fillProjectList) {
  5957. this.fillProjectList[p].canCancel = 1;
  5958. }
  5959. this.http.post('/report/getWeeklyReportData',{
  5960. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  5961. },res => {
  5962. this.weekDataLoading = false;
  5963. if(res.code == 'ok'){
  5964. let projectList = res.data.projectList;
  5965. if (projectList.length > 0) {
  5966. //有选择过项目进行填报,直接选中
  5967. this.selProjectList = projectList;
  5968. this.selCon = [];
  5969. for (let i = 0; i < projectList.length; i++) {
  5970. this.selCon.push(projectList[i].id);
  5971. }
  5972. }
  5973. //设置日期
  5974. this.weekDateRange = res.data.dateList;
  5975. this.zhoData = [];
  5976. var arrst = []
  5977. for(var i in this.weekDateRange) {
  5978. var obj = {}
  5979. obj.zhoDataTime = this.weekDateRange[i].date
  5980. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  5981. obj.he = this.weekDateRange[i].filledTime;
  5982. obj.canFill = this.weekDateRange[i].canFill;
  5983. // obj.filledTime = this.weekDateRange[i].filledTime;
  5984. obj.reportList = this.weekDateRange[i].reportList;
  5985. //初始化,防止渲染报错
  5986. for (var j = 0; j < this.selProjectList.length; j++) {
  5987. var pName = this.selProjectList[j].projectName
  5988. obj[pName] = {}
  5989. obj[pName].time = ''
  5990. obj[pName].content = ''
  5991. obj[pName].progress = 0
  5992. obj[pName].workingTime = 0
  5993. }
  5994. arrst.push(obj)
  5995. }
  5996. this.zhoData = arrst
  5997. this.setWeekCardTimeData(res.data.cardTimeList);
  5998. this.loadFilledWeekReportItem();
  5999. }else{
  6000. this.$message({
  6001. message: res.msg,
  6002. type: 'error'
  6003. })
  6004. }
  6005. },err => {
  6006. this.$message({
  6007. message: err,
  6008. type: 'error'
  6009. })
  6010. })
  6011. },
  6012. zhoZhi(res, i) {
  6013. var zhi = 0
  6014. for(var i in res) {
  6015. if(i != 'zhoDataTime' && i != 'he') {
  6016. zhi += +res[i]
  6017. }
  6018. }
  6019. res.he = zhi
  6020. },
  6021. zhoBtn(i) {
  6022. // this.zhoData.split(i, 1)
  6023. var arr = this.zhoData
  6024. arr.splice(i, 1)
  6025. },
  6026. zhoAddlast(){
  6027. this.selConShow = true
  6028. },
  6029. closeAddWeeklyReport(){
  6030. this.fillWeekDialogVisi = false
  6031. this.selConShow = true
  6032. this.selProjectList = []
  6033. this.selCon = []
  6034. },
  6035. // 提交按周填报
  6036. submitWeekReport(isDraft) {
  6037. var zhi = this.zhoData
  6038. var ll = 0
  6039. if(this.reportTimeType.type == 2) {
  6040. for(var i in zhi) {
  6041. this.dateAr = []
  6042. var alp = []
  6043. var zhis = zhi[i]
  6044. console.log(zhis)
  6045. for(var j in zhis) {
  6046. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6047. let objs = {}
  6048. objs.s = zhis[j].time[0]
  6049. objs.e = zhis[j].time[1]
  6050. objs.p = j
  6051. alp.push(objs)
  6052. }
  6053. }
  6054. // if(zhis.reportTimes){
  6055. // for(let k in zhis.reportTimes){
  6056. // let objs = {}
  6057. // objs.s = zhis.reportTimes[k].split('-')[0]
  6058. // objs.e = zhis.reportTimes[k].split('-')[1]
  6059. // alp.push(objs)
  6060. // }
  6061. // }
  6062. console.log(alp)
  6063. this.dateAr = alp
  6064. let str = this.$t('message.Filledtimeperiodsoverlap')
  6065. if(this.dateAr.length > 0) {
  6066. const trus = this.fns();
  6067. const overlapDataTime = this.getOverlapData(alp);
  6068. if (overlapDataTime.length > 0) {
  6069. const arrList = overlapDataTime.map((item) => item.p);
  6070. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6071. }
  6072. ll += 1
  6073. if(!trus) {
  6074. this.$message({
  6075. message: str,
  6076. type: 'error'
  6077. })
  6078. return false
  6079. }
  6080. }
  6081. }
  6082. if(ll == 0) {
  6083. this.$message({
  6084. message: this.$t('message.Pleasefillinthetime'),
  6085. type: 'error'
  6086. })
  6087. return false
  6088. }
  6089. } else if(this.reportTimeType.type == 1){
  6090. for(var i in zhi) {
  6091. var zhis = zhi[i]
  6092. for(var j in zhis) {
  6093. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6094. ll += 1
  6095. }
  6096. }
  6097. }
  6098. if(ll == 0) {
  6099. this.$message({
  6100. message: this.$t('message.Pleaseselectatime'),
  6101. type: 'error'
  6102. })
  6103. return false
  6104. }
  6105. let overcorp = ''
  6106. for(let n in zhi){
  6107. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6108. overcorp += zhi[n].zhoDataTime + ','
  6109. }
  6110. }
  6111. if(overcorp != ''){
  6112. overcorp = overcorp.substring(0,overcorp.length - 1)
  6113. this.$message({
  6114. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6115. type: 'error'
  6116. })
  6117. return
  6118. }
  6119. }
  6120. var submits = []
  6121. let formData = new FormData();
  6122. formData.append("draft", isDraft);
  6123. if(this.reportTimeType.multiWorktime == 1){
  6124. for (var i in this.zhoData) {
  6125. var zhoD = this.zhoData[i]
  6126. var flgs = false
  6127. for(var j in zhoD) {
  6128. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6129. flgs = true
  6130. // formData.append("degreeId", "-1");
  6131. formData.append("id", '-1');
  6132. for(var s in this.projectList) {
  6133. if(j == this.projectList[s].projectName) {
  6134. formData.append("projectId", this.projectList[s].id);
  6135. }
  6136. }
  6137. if(this.user.timeType.reportAuditType == 3){
  6138. let audItem = {}
  6139. if(this.user.timeType.auditLevel > 0){
  6140. audItem.auditorFirst = zhoD[j].auditorFirst
  6141. }
  6142. if(this.user.timeType.auditLevel > 1){
  6143. audItem.auditorSec = zhoD[j].auditorSec
  6144. }
  6145. if(this.user.timeType.auditLevel > 2){
  6146. audItem.auditorThird = zhoD[j].auditorThird
  6147. }
  6148. if(zhoD[j].ccUserid){
  6149. audItem.ccUserid = zhoD[j].ccUserid
  6150. }
  6151. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6152. }
  6153. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6154. formData.append("taskId", 0);
  6155. formData.append("reportTimeType", this.reportTimeType.type);
  6156. formData.append("endTime", '');
  6157. formData.append("startTime", '');
  6158. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6159. var lix = []
  6160. var objjs = {}
  6161. objjs.startTime = zhoD[j].time[0]
  6162. objjs.endTime = zhoD[j].time[1]
  6163. if (zhoD[j].content == null || zhoD[j].content == '') {
  6164. zhoD[j].content == '-'
  6165. }
  6166. objjs.content = zhoD[j].content
  6167. lix.push(objjs)
  6168. var zhiZhi = JSON.stringify(lix)
  6169. zhiZhi = zhiZhi.replace(/,/g,"@");
  6170. formData.append("content", zhiZhi)
  6171. formData.append("isOvertime", 0)
  6172. formData.append("professionProgress", "[]")
  6173. if (zhoD[j].groupId) {
  6174. formData.append("groupId",zhoD[j].groupId)
  6175. } else {
  6176. //解决后台groupId数组越界的问题
  6177. formData.append("groupId",0)
  6178. }
  6179. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6180. formData.append("createDate",zhoD.zhoDataTime)
  6181. if (zhoD[j].projectAuditorId) {
  6182. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6183. }
  6184. if(zhoD[j].basecostId) {
  6185. formData.append("basecostId", zhoD[j].basecostId);
  6186. } else {
  6187. formData.append("basecostId", 0);
  6188. }
  6189. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6190. formData.append('degreeId',zhoD[j].degreeId)
  6191. }else{
  6192. formData.append("degreeId", "-1");
  6193. }
  6194. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6195. formData.append('customData',zhoD[j].customData)
  6196. }else if(this.user.timeType.customDataActive){
  6197. formData.append('customData',0)
  6198. }
  6199. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6200. formData.append('customText',zhoD[j].customText)
  6201. }else if(this.user.timeType.customTextActive){
  6202. formData.append('customText','-')
  6203. }
  6204. }
  6205. }
  6206. }
  6207. } else {
  6208. for (var i in this.zhoData) {
  6209. var zhoD = this.zhoData[i]
  6210. var flgs = false
  6211. if(this.reportTimeType.type == 2) {
  6212. for(var k in this.selProjectList) {
  6213. var pItem = this.selProjectList[k];
  6214. var pName = pItem.projectName;
  6215. var j = pName;
  6216. console.log('j==周报中的项目='+j);
  6217. if(zhoD[j].time && zhoD[j].time != 'null') {
  6218. flgs = true
  6219. // formData.append("degreeId", "-1");
  6220. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6221. for(var s in this.projectList) {
  6222. if(j == this.projectList[s].projectName) {
  6223. formData.append("projectId", this.projectList[s].id);
  6224. }
  6225. }
  6226. if(this.user.timeType.reportAuditType == 3){
  6227. let audItem = {}
  6228. if(this.user.timeType.auditLevel > 0){
  6229. audItem.auditorFirst = zhoD[j].auditorFirst
  6230. }
  6231. if(this.user.timeType.auditLevel > 1){
  6232. audItem.auditorSec = zhoD[j].auditorSec
  6233. }
  6234. if(this.user.timeType.auditLevel > 2){
  6235. audItem.auditorThird = zhoD[j].auditorThird
  6236. }
  6237. if(zhoD[j].ccUserid){
  6238. audItem.ccUserid = zhoD[j].ccUserid
  6239. }
  6240. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6241. }
  6242. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6243. formData.append("taskId", 0);
  6244. formData.append("reportTimeType", this.reportTimeType.type);
  6245. formData.append("endTime", zhoD[j].time[1]);
  6246. formData.append("startTime", zhoD[j].time[0]);
  6247. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6248. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6249. formData.append("isOvertime", 0)
  6250. formData.append("professionProgress", "[]")
  6251. if (zhoD[j].groupId) {
  6252. formData.append("groupId",zhoD[j].groupId)
  6253. } else {
  6254. //解决后台groupId数组越界的问题
  6255. formData.append("groupId",0)
  6256. }
  6257. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6258. formData.append("createDate",zhoD.zhoDataTime)
  6259. if (zhoD[j].projectAuditorId) {
  6260. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6261. }
  6262. if(zhoD[j].basecostId) {
  6263. formData.append("basecostId", zhoD[j].basecostId);
  6264. } else {
  6265. formData.append("basecostId", 0);
  6266. }
  6267. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6268. formData.append('degreeId',zhoD[j].degreeId)
  6269. }else{
  6270. formData.append("degreeId", "-1");
  6271. }
  6272. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6273. formData.append('customData',zhoD[j].customData)
  6274. }else if(this.user.timeType.customDataActive){
  6275. formData.append('customData',0)
  6276. }
  6277. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6278. formData.append('customText',zhoD[j].customText)
  6279. }else if(this.user.timeType.customTextActive){
  6280. formData.append('customText','-')
  6281. }
  6282. }
  6283. }
  6284. } else {
  6285. for(var k in this.selProjectList) {
  6286. var pItem = this.selProjectList[k];
  6287. var pName = pItem.projectName;
  6288. var j = pName;
  6289. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6290. flgs = true
  6291. // formData.append("degreeId", "-1");
  6292. console.log('进入了workFpppp==='+j);
  6293. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6294. for(var s in this.projectList) {
  6295. if(j == this.projectList[s].projectName) {
  6296. formData.append("projectId", this.projectList[s].id);
  6297. }
  6298. }
  6299. if(this.user.timeType.reportAuditType == 3){
  6300. let audItem = {}
  6301. if(this.user.timeType.auditLevel > 0){
  6302. audItem.auditorFirst = zhoD[j].auditorFirst
  6303. }
  6304. if(this.user.timeType.auditLevel > 1){
  6305. audItem.auditorSec = zhoD[j].auditorSec
  6306. }
  6307. if(this.user.timeType.auditLevel > 2){
  6308. audItem.auditorThird = zhoD[j].auditorThird
  6309. }
  6310. if(zhoD[j].ccUserid){
  6311. audItem.ccUserid = zhoD[j].ccUserid
  6312. }
  6313. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6314. }
  6315. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6316. // formData.append("subProjectId", zhoD[j].subProjectId);
  6317. formData.append("taskId", 0);
  6318. formData.append("reportTimeType", this.reportTimeType.type);
  6319. if(this.reportTimeType.type == 1) {
  6320. formData.append("workingTime", zhoD[j].workingTime);
  6321. } else if(this.reportTimeType.type == 2) {
  6322. formData.append("endTime", zhoD[j].time[1]);
  6323. formData.append("startTime", zhoD[j].time[0]);
  6324. } else if(this.reportTimeType.type == 3) {
  6325. formData.append("progress", zhoD[j].progress);
  6326. formData.append("workingTime", zhoD[j].workingTime);
  6327. }
  6328. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6329. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6330. formData.append("isOvertime", 0)
  6331. formData.append("professionProgress", "[]")
  6332. if (zhoD[j].groupId) {
  6333. formData.append("groupId",zhoD[j].groupId)
  6334. } else {
  6335. //解决后台groupId数组越界的问题
  6336. formData.append("groupId",0)
  6337. }
  6338. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6339. formData.append("createDate",zhoD.zhoDataTime)
  6340. if (zhoD[j].projectAuditorId) {
  6341. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6342. }
  6343. if(zhoD[j].basecostId) {
  6344. formData.append("basecostId", zhoD[j].basecostId);
  6345. } else {
  6346. formData.append("basecostId", 0);
  6347. }
  6348. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6349. formData.append('degreeId',zhoD[j].degreeId)
  6350. }else{
  6351. formData.append("degreeId", "-1");
  6352. }
  6353. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6354. formData.append('customData',zhoD[j].customData)
  6355. }else if(this.user.timeType.customDataActive){
  6356. formData.append('customData',0)
  6357. }
  6358. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6359. formData.append('customText',zhoD[j].customText)
  6360. }else if(this.user.timeType.customTextActive){
  6361. formData.append('customText','-')
  6362. }
  6363. }
  6364. }
  6365. }
  6366. }
  6367. }
  6368. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6369. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6370. if(!next) {
  6371. this.$message({
  6372. message: `【${error.join('、')}】请填写任务分组`,
  6373. type: 'error'
  6374. })
  6375. return
  6376. }
  6377. // 自定义维度
  6378. this.submitingReport = true;
  6379. this.http.uploadFile( this.port.report.editPort, formData,
  6380. res => {
  6381. // this.listLoading = false;
  6382. this.submitingReport = false;
  6383. if (res.code == "ok") {
  6384. this.$message({
  6385. message: this.$t('message.fillinsuccessfully'),
  6386. type: "success"
  6387. });
  6388. this.fillWeekDialogVisi = false
  6389. this.selConShow = true
  6390. this.zhoData = []
  6391. this.weekDateRange = ''
  6392. this.getReportList();
  6393. this.getDepartment();
  6394. // 关闭弹窗 并 清空
  6395. this.selProjectList = []
  6396. this.selCon = []
  6397. this.getRecentlyProject()
  6398. } else {
  6399. this.$message({
  6400. message: res.msg,
  6401. type: "error"
  6402. });
  6403. }
  6404. },
  6405. error => {
  6406. this.submitingReport = false;
  6407. this.$message({
  6408. message: error,
  6409. type: "error"
  6410. });
  6411. });
  6412. },
  6413. handleGroupAuditorData(data) {
  6414. const { reportAuditType } = this.user.timeType
  6415. if(reportAuditType != 1 && reportAuditType != 2) {
  6416. return {next: true}
  6417. }
  6418. let arrList = [];
  6419. Object.entries(data).forEach(([key, obj]) => {
  6420. Object.entries(obj).forEach(([projectName, projectData]) => {
  6421. if (projectData.workingTime && !projectData.groupId) {
  6422. arrList.push({
  6423. projectName,
  6424. date: obj.zhoDataTime,
  6425. dateText: obj.zhoDataTimeTxt
  6426. });
  6427. }
  6428. });
  6429. });
  6430. if(arrList.length > 0) {
  6431. return {
  6432. next: false,
  6433. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6434. }
  6435. } else {
  6436. return {
  6437. next: true,
  6438. error: [],
  6439. }
  6440. }
  6441. },
  6442. ChangeHourMinutestr (str) {
  6443. if (str !== "0" && str !== "" && str !== null) {
  6444. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6445. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6446. } else {
  6447. return "";
  6448. }
  6449. },
  6450. // 得到两个日期中间的日期
  6451. getdiffdate(stime,etime){
  6452. //初始化日期列表,数组
  6453. var diffdate = new Array();
  6454. var i=0;
  6455. //开始日期小于等于结束日期,并循环
  6456. while(stime<=etime){
  6457. diffdate[i] = stime;
  6458. //获取开始日期时间戳
  6459. var stime_ts = new Date(stime).getTime();
  6460. //增加一天时间戳后的日期
  6461. var next_date = stime_ts + (24*60*60*1000);
  6462. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6463. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6464. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6465. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6466. stime = next_dates_y+next_dates_m+next_dates_d;
  6467. //增加数组key
  6468. i++;
  6469. }
  6470. return diffdate;
  6471. },
  6472. // 添加模块
  6473. addDomain(i) {
  6474. var leftProgress = 10;
  6475. if (this.reportTimeType.type == 3) {
  6476. //计算已经待分配工时比例
  6477. let array = this.workForm.domains;
  6478. let totalProgress = 0;
  6479. for (var i=0;i<array.length; i++) {
  6480. totalProgress += array[i].progress;
  6481. }
  6482. if (totalProgress < 100) {
  6483. leftProgress = 100 - totalProgress;
  6484. }
  6485. }
  6486. var addItem = {
  6487. projectId: "",
  6488. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6489. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6490. ),
  6491. content: "",
  6492. progress:leftProgress,
  6493. state:2,//2-表示待提交
  6494. multiWorktime: this.reportTimeType.multiWorktime,
  6495. worktimeList:[{}],
  6496. canEdit: true,
  6497. auditorFirst: '',
  6498. auditorSec: '',
  6499. auditorThird: '',
  6500. ccUserid: ''
  6501. // degreeId: '',
  6502. };
  6503. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6504. this.$set(addItem,'isOvertime',true)
  6505. if(this.reportTimeType.type == 3){
  6506. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6507. }
  6508. }
  6509. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6510. //默认给第一个,必填字段
  6511. addItem.basecostId = this.timeBasecostList[0].id;
  6512. }
  6513. this.workForm.domains.push(addItem);
  6514. document.getElementById('workFormsItemBottom').scrollIntoView()
  6515. this.canEdit = true
  6516. if (this.reportTimeType.type == 0) {
  6517. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6518. var length = this.workForm.domains.length;
  6519. if (length == 2) {
  6520. this.showAddMore = false;
  6521. }
  6522. }
  6523. this.chuji()
  6524. this.seleChn()
  6525. },
  6526. // 移除模块
  6527. delDomain(i) {
  6528. this.workForm.domains.splice(i,1)
  6529. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6530. if (!this.originCanEdit) {
  6531. let iscan = false
  6532. for(let i in this.workForm.domains){
  6533. if(this.workForm.domains[i].canEdit){
  6534. iscan = true
  6535. }
  6536. }
  6537. this.canEdit = iscan
  6538. }
  6539. //检测当前剩下的一个,时间类型是否是全天
  6540. if (this.reportTimeType.type == 0) {
  6541. if (this.workForm.domains[0].timeType == 0) {
  6542. this.showAddMore = false;
  6543. } else {
  6544. this.showAddMore = true;
  6545. }
  6546. }
  6547. if(this.user.timeType.multiWorktime == 1) {
  6548. this.iptChangs()
  6549. } else {
  6550. this.seleChn(0)
  6551. }
  6552. },
  6553. // 改变月份
  6554. changeMonth() {
  6555. this.isWeekend = false
  6556. let date = new Date()
  6557. let nowmon = date.getMonth() + 1
  6558. let nowday = date.getDate()
  6559. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6560. if (this.isBatch == 0) {
  6561. if(this.user.timeType.fillAhead == 0){
  6562. let date_a = new Date(this.workForm.createDate)
  6563. if(date_a.getTime() > date.getTime()){
  6564. this.workForm.createDate = nowdate
  6565. }
  6566. }
  6567. //只有按天填报才能获取当天的日报
  6568. if(!this.isSubstitude){
  6569. let weekday = new Date(this.workForm.createDate).getDay()
  6570. if(this.user.companyId == 817){
  6571. if(weekday == 0){
  6572. this.isWeekend = true
  6573. }
  6574. }else{
  6575. if(weekday == 0 || weekday == 6){
  6576. this.isWeekend = true
  6577. }
  6578. }
  6579. this.getReport()
  6580. }
  6581. }else {
  6582. if(this.user.timeType.fillAhead == 0){
  6583. let date_a = new Date(this.workForm.createDate[1])
  6584. if(date_a.getTime() > date.getTime()){
  6585. this.workForm.createDate[1] = nowdate
  6586. let sdate = new Date(this.workForm.createDate[0])
  6587. let edate = new Date(this.workForm.createDate[1])
  6588. if(sdate > edate){
  6589. this.workForm.createDate[0] = this.workForm.createDate[1]
  6590. }
  6591. }
  6592. }
  6593. }
  6594. },
  6595. // 判断时间段
  6596. fns() {
  6597. for (let k in this.dateAr) {
  6598. if (!this.judege(k)) {
  6599. return false
  6600. }
  6601. }
  6602. return true
  6603. },
  6604. judege(idx){
  6605. for (let k in this.dateAr) {
  6606. if (idx !== k) {
  6607. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6608. return false
  6609. }
  6610. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6611. return false
  6612. }
  6613. }
  6614. }
  6615. return true
  6616. },
  6617. getOverlapData(data) {
  6618. let overlapData = [];
  6619. for (let i = 0; i < data.length; i++) {
  6620. for (let j = i + 1; j < data.length; j++) {
  6621. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6622. overlapData.push(data[i], data[j]);
  6623. }
  6624. }
  6625. }
  6626. return overlapData;
  6627. },
  6628. // 保存日报111111
  6629. submitReport(isDraft) {
  6630. this.isDraft = isDraft;
  6631. this.$refs.workForm.validate(valid => {
  6632. if (valid) {
  6633. if(this.totalReportHours < this.user.timeType.allday){
  6634. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6635. confirmButtonText: '确定',
  6636. cancelButtonText: '取消',
  6637. type: 'warning'
  6638. }).then(() => {
  6639. this.submitReportSon()
  6640. }).catch(() => {
  6641. });
  6642. }else{
  6643. this.submitReportSon()
  6644. }
  6645. }
  6646. });
  6647. },
  6648. submitReportSon() {
  6649. this.dateAr = []
  6650. let alp = []
  6651. if(this.user.timeType.multiWorktime != 1) {
  6652. for(var p in this.workForm.domains) {
  6653. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6654. let objs = {}
  6655. objs.s = this.workForm.domains[p].startTime
  6656. objs.e = this.workForm.domains[p].endTime
  6657. alp.push(objs)
  6658. }
  6659. }
  6660. this.dateAr = alp
  6661. if(this.dateAr.length > 0) {
  6662. let trus = this.fns()
  6663. if(!trus) {
  6664. this.$message({
  6665. message: this.$t('message.Filledtimeperiodsoverlap'),
  6666. type: "error"
  6667. });
  6668. return
  6669. }
  6670. }
  6671. } else {
  6672. for(var p in this.workForm.domains) {
  6673. var slll = this.workForm.domains[p]
  6674. for(var o in slll.worktimeList) {
  6675. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6676. let objs = {}
  6677. objs.s = slll.worktimeList[o].startTime
  6678. objs.e = slll.worktimeList[o].endTime
  6679. alp.push(objs)
  6680. }
  6681. }
  6682. }
  6683. this.dateAr = alp
  6684. if(this.dateAr.length > 0) {
  6685. let trus = this.fns()
  6686. if(!trus) {
  6687. this.$message({
  6688. message: this.$t('message.Filledtimeperiodsoverlap'),
  6689. type: "error"
  6690. });
  6691. return
  6692. }
  6693. }
  6694. }
  6695. //检查子项目
  6696. if (this.user.timeType.subProMustFill == 1) {
  6697. for(var p in this.workForm.domains) {
  6698. var oneProItem = this.workForm.domains[p]
  6699. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6700. //没有选择子项目
  6701. this.$message({
  6702. message: '子项目必填,请检查',
  6703. type: "error"
  6704. });
  6705. return
  6706. }
  6707. }
  6708. }
  6709. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  6710. if (this.user.companyId == this.yuzhongCompId) {
  6711. for(var p in this.workForm.domains) {
  6712. var oneProItem = this.workForm.domains[p]
  6713. if (!oneProItem.extraField1) {
  6714. this.$message({
  6715. message: '角色必填,请检查',
  6716. type: "error"
  6717. });
  6718. return
  6719. }
  6720. if (!oneProItem.extraField2) {
  6721. this.$message({
  6722. message: '工作职责必填,请检查',
  6723. type: "error"
  6724. });
  6725. return
  6726. }
  6727. if (!oneProItem.extraField3) {
  6728. this.$message({
  6729. message: '工作内容必填,请检查',
  6730. type: "error"
  6731. });
  6732. return
  6733. }
  6734. }
  6735. }
  6736. // return
  6737. //代填的情况,检查人员是否已经选择
  6738. if (this.isSubstitude) {
  6739. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  6740. this.$message({
  6741. message: this.$t('message.pleaseselectthepersontofillin'),
  6742. type: "error"
  6743. });
  6744. return;
  6745. }
  6746. }
  6747. //检查时间,全天和上下午不能同时存在
  6748. if (this.reportTimeType.type == 0) {
  6749. var alldayNum = 0;
  6750. var amNum = 0;
  6751. var pmNum = 0;
  6752. for(var i in this.workForm.domains) {
  6753. if (this.workForm.domains[i].timeType == 0) {
  6754. alldayNum ++;
  6755. } else if (this.workForm.domains[i].timeType == 1) {
  6756. amNum++;
  6757. } else if (this.workForm.domains[i].timeType == 2) {
  6758. pmNum++;
  6759. }
  6760. }
  6761. if (alldayNum > 1) {
  6762. this.$message({
  6763. // message: "工作时间-全天,只能选择一次",
  6764. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  6765. type: "error"
  6766. });
  6767. return;
  6768. }
  6769. if (amNum > 1) {
  6770. this.$message({
  6771. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  6772. type: "error"
  6773. });
  6774. return;
  6775. }
  6776. if (pmNum > 1) {
  6777. this.$message({
  6778. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  6779. type: "error"
  6780. });
  6781. return;
  6782. }
  6783. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  6784. this.$message({
  6785. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  6786. type: "error"
  6787. });
  6788. return;
  6789. }
  6790. } else if (this.reportTimeType.type == 3) {
  6791. //总百分比不能超过100%
  6792. let total = 0;
  6793. this.workForm.domains.forEach(w=>{total += w.progress});
  6794. if (total > 100) {
  6795. this.$message({
  6796. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  6797. type: "error"
  6798. });
  6799. return;
  6800. } else if (total < 100) {
  6801. this.$message({
  6802. message: this.$t('message.cannotbesubmitted'),
  6803. type: "error"
  6804. });
  6805. return;
  6806. }
  6807. }
  6808. this.listLoading = true;
  6809. let formData = new FormData();
  6810. formData.append("draft", this.isDraft);
  6811. var totalTime = 0;
  6812. for (var t=0;t<this.workForm.domains.length; t++) {
  6813. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  6814. }
  6815. //批量填报不校验考勤时长,交给后台校验
  6816. if (!this.isBatch) {
  6817. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  6818. if (this.workForm.time){
  6819. if (this.workForm.time.workHours == 0){
  6820. this.$message({
  6821. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6822. type: 'error'
  6823. })
  6824. return
  6825. }
  6826. }else{
  6827. this.$message({
  6828. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6829. type: 'error'
  6830. })
  6831. return
  6832. }
  6833. }
  6834. }
  6835. if (this.reportTimeType.type == 1 && this.workForm.time) {
  6836. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  6837. this.$message({
  6838. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  6839. type: "error"
  6840. });
  6841. return;
  6842. }
  6843. }
  6844. for(var i in this.workForm.domains) {
  6845. if(this.user.timeType.reportAuditType == 3){
  6846. let audItem = {}
  6847. let auditRule = ''
  6848. if(this.workForm.domains[i].id){
  6849. audItem.reportId = this.workForm.domains[i].id
  6850. }
  6851. if(this.user.timeType.auditLevel > 0){
  6852. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  6853. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  6854. }
  6855. if(this.user.timeType.auditLevel > 1){
  6856. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  6857. audItem.auditorSec = this.workForm.domains[i].auditorSec
  6858. }
  6859. if(this.user.timeType.auditLevel > 2){
  6860. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  6861. audItem.auditorThird = this.workForm.domains[i].auditorThird
  6862. }
  6863. if(this.workForm.domains[i].ccUserid){
  6864. audItem.ccUserid = this.workForm.domains[i].ccUserid
  6865. }
  6866. if(auditRule){
  6867. auditRule = auditRule.substring(0,auditRule.length - 1)
  6868. this.$message({
  6869. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  6870. type: 'error'
  6871. })
  6872. return
  6873. }
  6874. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6875. }
  6876. if(this.workForm.domains[i].degreeId) {
  6877. // var sss = this.workForm.domains[i].degreeId.toString()
  6878. formData.append("degreeId", this.workForm.domains[i].degreeId);
  6879. } else {
  6880. formData.append("degreeId", -1);
  6881. }
  6882. if(this.workForm.domains[i].customData) {
  6883. // var sss = this.workForm.domains[i].degreeId.toString()
  6884. formData.append("customData", this.workForm.domains[i].customData);
  6885. } else {
  6886. formData.append("customData", 0);
  6887. }
  6888. if(this.workForm.domains[i].customText) {
  6889. formData.append("customText", this.workForm.domains[i].customText);
  6890. } else {
  6891. formData.append("customText", '-');
  6892. }
  6893. if (this.workForm.domains[i].id) {
  6894. formData.append("id", this.workForm.domains[i].id);
  6895. } else {
  6896. formData.append("id", -1);
  6897. }
  6898. formData.append("projectId", this.workForm.domains[i].projectId);
  6899. if (this.workForm.domains[i].subProjectId) {
  6900. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  6901. } else {
  6902. formData.append("subProjectId", 0);
  6903. }
  6904. if (this.workForm.domains[i].groupId) {
  6905. formData.append("groupId", this.workForm.domains[i].groupId);
  6906. } else {
  6907. formData.append("groupId", 0);
  6908. }
  6909. if (this.workForm.domains[i].taskId) {
  6910. formData.append("taskId", this.workForm.domains[i].taskId);
  6911. } else {
  6912. formData.append("taskId", 0);
  6913. }
  6914. if (this.workForm.domains[i].taskFinish == true) {
  6915. formData.append("taskFinish", 1);
  6916. } else {
  6917. formData.append("taskFinish", 0);
  6918. }
  6919. formData.append("reportTimeType", this.reportTimeType.type);
  6920. if (this.reportTimeType.type == 0) {
  6921. formData.append("timeType", this.workForm.domains[i].timeType);
  6922. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  6923. formData.append("workingTime", workingTime);
  6924. } else if (this.reportTimeType.type == 1){
  6925. formData.append("workingTime", this.workForm.domains[i].workingTime);
  6926. } else if (this.reportTimeType.type == 2) {
  6927. formData.append("endTime", this.workForm.domains[i].endTime);
  6928. formData.append("startTime", this.workForm.domains[i].startTime);
  6929. } else if (this.reportTimeType.type == 3) {
  6930. //按比例分配
  6931. formData.append("progress", this.workForm.domains[i].progress);
  6932. formData.append("workingTime", this.workForm.domains[i].workingTime);
  6933. }
  6934. if(this.user.timeType.choseFromAlbum == 1 ) {
  6935. console.log(this.workForm.domains[i].imgList)
  6936. if(this.workForm.domains[i].imgList) {
  6937. let imgListFor = this.workForm.domains[i].imgList
  6938. for(var b in imgListFor) {
  6939. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  6940. }
  6941. console.log(imgListFor)
  6942. let m = JSON.stringify(imgListFor);
  6943. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  6944. formData.append("picStr", m);
  6945. } else {
  6946. formData.append("picStr", '[]');
  6947. }
  6948. }
  6949. //处理多个时间事项
  6950. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  6951. if (this.reportTimeType.multiWorktime == 1) {
  6952. //检查时间是否有重叠
  6953. var workList = this.workForm.domains[i].worktimeList;
  6954. for (var j=0;j<workList.length; j++) {
  6955. var curItem = workList[j];
  6956. //检查开始时间是否大于结束时间
  6957. if (curItem.startTime >= curItem.endTime) {
  6958. this.$message({
  6959. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  6960. this.$t('message.Endtimemustbegreaterthanstarttime'),
  6961. type: "error"
  6962. });
  6963. return;
  6964. }
  6965. for (var p = j+1;p<workList.length; p++) {
  6966. var jItem = workList[p];
  6967. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  6968. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  6969. this.$message({
  6970. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  6971. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  6972. type: "error"
  6973. });
  6974. return;
  6975. }
  6976. }
  6977. }
  6978. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  6979. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  6980. formData.append("content", m);
  6981. } else {
  6982. if (this.workForm.domains[i].content) {
  6983. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  6984. m = m.replace(/,/g,",");
  6985. console.log(m, '需要传值的数据')
  6986. // formData.append("content", this.workForm.domains[i].content);
  6987. formData.append("content", m);
  6988. } else {
  6989. formData.append("content", '-');
  6990. }
  6991. }
  6992. if (this.isBatch == 0) {
  6993. formData.append("createDate", this.workForm.createDate);
  6994. } else {
  6995. //批量填报,时间范围
  6996. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  6997. }
  6998. if(this.workForm.domains[i].isOvertime) {
  6999. formData.append("isOvertime", 1);
  7000. } else {
  7001. formData.append("isOvertime", 0);
  7002. }
  7003. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7004. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7005. } else {
  7006. formData.append("overtimeHours", 0);
  7007. }
  7008. if(this.workForm.domains[i].basecostId) {
  7009. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7010. } else {
  7011. formData.append("basecostId", 0);
  7012. }
  7013. if (this.workForm.userId != null) {
  7014. var targetUids = '';
  7015. this.workForm.userId.forEach(u=>{
  7016. targetUids += u + '@';
  7017. });
  7018. if (targetUids.length > 0) {
  7019. targetUids = targetUids.substring(0, targetUids.length -1);
  7020. formData.append("targetUids", targetUids);
  7021. }
  7022. }
  7023. //项目专业进度
  7024. if (this.workForm.domains[i].professionProgress) {
  7025. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7026. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7027. formData.append("professionProgress", m);
  7028. } else {
  7029. formData.append("professionProgress", "[]");
  7030. }
  7031. if (this.workForm.domains[i].stage) {
  7032. formData.append("stage", this.workForm.domains[i].stage);
  7033. } else {
  7034. formData.append("stage", "-");
  7035. }
  7036. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7037. if (this.workForm.domains[i].projectAuditorId) {
  7038. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7039. } else {
  7040. // console.log('执行到了这里')
  7041. // console.log(this.user.timeType.reportAuditType)
  7042. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7043. this.$message({
  7044. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7045. type: "error"
  7046. });
  7047. return;
  7048. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7049. //分组负责人先审核, 确定是选择了任务分组
  7050. if (this.workForm.domains[i].taskGroups.length == 0) {
  7051. this.$message({
  7052. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7053. type: "error"
  7054. });
  7055. } else if (!this.workForm.domains[i].groupId) {
  7056. // console.log(this.workForm.domains[i]);
  7057. this.$message({
  7058. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7059. type: "error"
  7060. });
  7061. } else {
  7062. this.$message({
  7063. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7064. type: "error"
  7065. });
  7066. }
  7067. return;
  7068. }
  7069. }
  7070. if (this.user.companyId == this.yuzhongCompId) {
  7071. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7072. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7073. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7074. }
  7075. //依斯贝的服务Id
  7076. if (this.user.companyId == this.yisibeiCompId || this.user.companyId == 10) {
  7077. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7078. }
  7079. }
  7080. this.submitingReport = true;
  7081. this.http.uploadFile( this.port.report.editPort, formData,
  7082. res => {
  7083. this.listLoading = false;
  7084. this.submitingReport = false;
  7085. if (res.code == "ok") {
  7086. if(res.msg!=null){
  7087. this.$message({
  7088. dangerouslyUseHTMLString: true,
  7089. message: res.msg,
  7090. type: "warning",
  7091. showClose: true,
  7092. duration: 0
  7093. });
  7094. }else{
  7095. this.$message({
  7096. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7097. type: "success"
  7098. });
  7099. }
  7100. this.dialogVisible = false;
  7101. this.jsDay = 0
  7102. this.jsTime = 0
  7103. this.getReportList();
  7104. this.getDepartment();
  7105. this.getRecentlyProject()
  7106. } else {
  7107. this.$message({
  7108. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7109. type: "error"
  7110. });
  7111. }
  7112. },
  7113. error => {
  7114. this.listLoading = false;
  7115. this.submitingReport = false;
  7116. this.$message({
  7117. message: error,
  7118. type: "error"
  7119. });
  7120. });
  7121. },
  7122. // 判断是展示那个工时导入
  7123. imports() {
  7124. if(this.user.timeType.syncCorpwxTime == 0) {
  7125. this.importDialog = true
  7126. } else {
  7127. this.importWxDialog = true
  7128. }
  7129. },
  7130. // 跳转
  7131. junpToDeskTop(id) {
  7132. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7133. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7134. },
  7135. // 通过日报
  7136. approve(id, item) {
  7137. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7138. this.approveinData = {
  7139. id: id,
  7140. date: this.date +day,
  7141. reportIds: item.id
  7142. }
  7143. if(this.user.timeType.needEvaluate == 1){
  7144. this.$set(this.approveinData,'evaluate','')
  7145. this.approveinDialog = true
  7146. }else{
  7147. this.logining = true;
  7148. this.approveinfun()
  7149. }
  7150. },
  7151. approveinfun(){
  7152. this.http.post( this.port.report.approve, this.approveinData,
  7153. res => {
  7154. this.logining = false;
  7155. if (res.code == "ok") {
  7156. this.approveinDialog = false
  7157. this.$message({
  7158. message: this.$t('message.Reviewsucceeded'),
  7159. type: "success"
  7160. });
  7161. this.getReportList();
  7162. this.getDepartment();
  7163. } else {
  7164. this.$message({
  7165. message: res.msg,
  7166. type: "error"
  7167. });
  7168. }
  7169. },
  7170. error => {
  7171. this.logining = false;
  7172. this.$message({
  7173. message: error,
  7174. type: "error"
  7175. });
  7176. });
  7177. },
  7178. //撤回日报
  7179. cancel(item,e) {
  7180. // console.log('can can need',item);
  7181. this.logining = true;
  7182. var ids = '';
  7183. var data = e ? item : item.data;
  7184. data.forEach(element => {
  7185. if(element.id){
  7186. ids +=(element.id+',');
  7187. }
  7188. });
  7189. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7190. res => {
  7191. this.logining = false;
  7192. if (res.code == "ok") {
  7193. this.$message({
  7194. message:this.$t('message.Withdrawalsucceeded'),
  7195. type: "success"
  7196. });
  7197. this.getReportList();
  7198. if(e){this.getReport()}
  7199. this.getDepartment();
  7200. } else {
  7201. this.$message({
  7202. message: res.msg,
  7203. type: "error"
  7204. });
  7205. }
  7206. },
  7207. error => {
  7208. this.logining = false;
  7209. this.$message({
  7210. message: error,
  7211. type: "error"
  7212. });
  7213. });
  7214. },
  7215. showDenyDialog(id,i, item) {
  7216. this.denyReasonDialog = true;
  7217. this.isDenying = false;
  7218. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7219. var ids = item.id;
  7220. // var data = item.data;
  7221. // data.forEach(element => {
  7222. // ids +=(element.id+',');
  7223. // });
  7224. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7225. },
  7226. // 未通过日报
  7227. deny() {
  7228. this.logining = true;
  7229. this.isDenying = true;
  7230. this.http.post( this.port.report.deny, this.denyForm,
  7231. res => {
  7232. this.logining = false;
  7233. this.isDenying = false;
  7234. if (res.code == "ok") {
  7235. this.$message({
  7236. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7237. type: "success"
  7238. });
  7239. this.getReportList();
  7240. this.getDepartment();
  7241. this.denyReasonDialog = false;
  7242. } else {
  7243. this.$message({
  7244. message: res.msg,
  7245. type: "error"
  7246. });
  7247. }
  7248. },
  7249. error => {
  7250. this.logining = false;
  7251. this.$message({
  7252. message: error,
  7253. type: "error"
  7254. });
  7255. });
  7256. },
  7257. // 查看工时记录弹窗
  7258. toView() {
  7259. this.toViewDialogVisible = true
  7260. this.toViewloading = true
  7261. this.getToView()
  7262. },
  7263. getToView() {
  7264. this.http.post( '/report-import-log/getList', this.toViewForm,
  7265. res => {
  7266. this.toViewloading = false;
  7267. if (res.code == "ok") {
  7268. // console.log(res.data, '数据数据')
  7269. this.toViewList = res.data.records
  7270. this.toViewForm.total = res.data.total
  7271. } else {
  7272. this.toViewloading = false;
  7273. this.$message({
  7274. message: res.msg,
  7275. type: "error"
  7276. });
  7277. }
  7278. })
  7279. },
  7280. // 触发 selectCat 组件更改他的值
  7281. selectCatCli(obj) {
  7282. // console.log(obj, '看看')
  7283. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7284. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7285. },
  7286. vueCasader(obj) {
  7287. // console.log(obj, '看看值')
  7288. if(obj.distinction == 1) {
  7289. let arr = []
  7290. arr.push(obj.item.id)
  7291. this.exportParam.departmentId = arr
  7292. }
  7293. },
  7294. //分页
  7295. handleCurrentChange(val) {
  7296. this.toViewForm.pageIndex = val;
  7297. this.getToView();
  7298. },
  7299. handleSizeChange(val) {
  7300. this.toViewForm.pageSize = val;
  7301. this.getToView();
  7302. },
  7303. getAllUsersList(){
  7304. this.http.post('/user/getSimpleActiveUserList',{
  7305. },res => {
  7306. if(res.code == 'ok'){
  7307. this.allUsersList = res.data
  7308. }else{
  7309. this.$message({
  7310. message: res.msg,
  7311. type: 'error'
  7312. })
  7313. }
  7314. },err => {
  7315. this.$message({
  7316. message: err,
  7317. type: 'error'
  7318. })
  7319. })
  7320. },
  7321. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7322. fillWeekCustomClne() {
  7323. this.fillWeekDialogVisiCustom = false
  7324. },
  7325. fillWeekCustomSubmit() {
  7326. this.getReportList();
  7327. this.getDepartment();
  7328. this.getRecentlyProject()
  7329. },
  7330. // 自定义事件
  7331. selectCal(obj) {
  7332. console.log(obj, '传数据来源')
  7333. if(obj.distinction == '1') {
  7334. this.zhoBao.projectAuditorId = obj.id
  7335. } else if(obj.distinction == '2') {
  7336. this.zhoBao.auditorFirst = obj.id
  7337. } else if(obj.distinction == '3') {
  7338. this.zhoBao.auditorSec = obj.id
  7339. } else if(obj.distinction == '4') {
  7340. this.zhoBao.auditorThird = obj.id
  7341. } else if(obj.distinction == '5') {
  7342. this.zhoBao.ccUserid = obj.id
  7343. } else if(obj.distinction == '12') {
  7344. this.usersListId = obj.id
  7345. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7346. this.searchKeyword = obj.name
  7347. } else {
  7348. this.searchKeyword = ''
  7349. }
  7350. this.searchScreen(0)
  7351. } else if(obj.distinction == '13') {
  7352. this.usersListId = obj.id
  7353. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7354. this.searchKeyword = obj.name
  7355. } else {
  7356. this.searchKeyword = ''
  7357. }
  7358. this.searchScreen(1)
  7359. }
  7360. }
  7361. },
  7362. created() {
  7363. this.getUsers()
  7364. let height = window.innerHeight;
  7365. this.tableHeight = height - 178;
  7366. const that = this;
  7367. window.onresize = function temp() {
  7368. that.tableHeight = window.innerHeight - 178;
  7369. };
  7370. this.toViewForm.companyId = this.user.companyId
  7371. this.initDrag([{
  7372. type: "LR",
  7373. domClass: {
  7374. // 中间分割线的名字
  7375. resize: "line-line",
  7376. // 左侧盒子的名字
  7377. left: "box-left",
  7378. // 右侧盒子的名字
  7379. right: "box-right",
  7380. // 父级的名字
  7381. box: "box-father",
  7382. },
  7383. otherInfo: {
  7384. // 限制左边栏最低宽度
  7385. leftWidth: 120,
  7386. },
  7387. },
  7388. {
  7389. type: "LR",
  7390. domClass: {
  7391. // 中间分割线的名字
  7392. resize: "line-second",
  7393. // 左侧盒子的名字
  7394. left: "left-laowang",
  7395. // 右侧盒子的名字
  7396. right: "box-second-father",
  7397. // 父级的名字
  7398. box: "grand",
  7399. },
  7400. otherInfo: {
  7401. // 限制左边栏最低宽度
  7402. leftWidth: 120,
  7403. },
  7404. },
  7405. ]);
  7406. }
  7407. };
  7408. </script>
  7409. <style lang="scss" scoped>
  7410. .fillWeekDialogVisiCustom {
  7411. width: 100%;
  7412. height: 70vh;
  7413. }
  7414. .fillWeekCustom {
  7415. .el-dialog__body {
  7416. padding: 20px 20px !important;
  7417. }
  7418. }
  7419. .photos {
  7420. position: relative;
  7421. display: flex;
  7422. flex-wrap: wrap;
  7423. }
  7424. .photos_img {
  7425. width: 120px;
  7426. height: 120px;
  7427. margin-right: 20px;
  7428. margin-bottom: 20px;
  7429. cursor: pointer;
  7430. img {
  7431. width: 100%;
  7432. height: 100%;
  7433. }
  7434. }
  7435. .paginatis {
  7436. padding: 10px 10px;
  7437. background: #f2f2f2;
  7438. }
  7439. .waiting {
  7440. color:orange;
  7441. }
  7442. .filledReportStyle {
  7443. color:#32CD32;
  7444. }
  7445. .RejectStyle {
  7446. color:red;
  7447. }
  7448. .waitSubmitStyle{
  7449. color: #409eff;
  7450. }
  7451. .chooseDate {
  7452. .waiting {
  7453. color: #20a0ff;
  7454. }
  7455. .filledReportStyle {
  7456. color:#20a0ff;
  7457. }
  7458. .RejectStyle {
  7459. color: #20a0ff;
  7460. }
  7461. .waitSubmitStyle{
  7462. color: #20a0ff;
  7463. }
  7464. }
  7465. .allDaily {
  7466. width:100%;
  7467. }
  7468. .report_title {
  7469. padding:10px 0;
  7470. color:#666;
  7471. }
  7472. .clearfix {
  7473. overflow-x: auto;
  7474. white-space: nowrap;
  7475. padding: 15px 0 10px 0;
  7476. // overflow-y: hidden;
  7477. .date_item {
  7478. padding: 0 3px;
  7479. cursor: pointer;
  7480. position: relative;
  7481. }
  7482. .chooseDate {
  7483. position: absolute;
  7484. bottom: -3px;
  7485. width: 37px;
  7486. height: 2px;
  7487. left: 14px;
  7488. background: #20a0ff;
  7489. }
  7490. }
  7491. .one_daily {
  7492. i {
  7493. color: #9ed0ff;
  7494. margin-right: 5px;
  7495. }
  7496. .one_daily_body {
  7497. padding: 10px 0px;
  7498. p {
  7499. margin: 0;
  7500. line-height: 30px;
  7501. }
  7502. }
  7503. ul {
  7504. padding: 0;
  7505. }
  7506. }
  7507. .checkbtn {
  7508. float: right;
  7509. margin-top: -10px;
  7510. }
  7511. .selConStyle{
  7512. margin-top:9rem;
  7513. margin-bottom:11rem;
  7514. .selConStyle_title{
  7515. height: 3rem;
  7516. text-align: center;
  7517. font-size: 17px;
  7518. }
  7519. .el-select{
  7520. margin: 0 15%;
  7521. width: 70%;
  7522. }
  7523. }
  7524. </style>
  7525. <style lang="scss">
  7526. /*去除upload组件过渡效果*/
  7527. .photos .el-upload-list__item {
  7528. transition: none !important;
  7529. }
  7530. .daily {
  7531. .el-card__body {
  7532. height: 80%;
  7533. overflow-y: auto;
  7534. }
  7535. .el-card__header {
  7536. padding: 0 20px;
  7537. }
  7538. }
  7539. .membListClass{
  7540. .el-dialog__body{
  7541. padding-top: 10px;
  7542. }
  7543. }
  7544. // .editReportDialog .el-dialog__footer{
  7545. // position: sticky;
  7546. // bottom: 0;
  7547. // background: #fff;
  7548. // height: 70px;
  7549. // z-index: 1010;
  7550. // }
  7551. .editReportDialog{
  7552. min-width: 800px;
  7553. }
  7554. .touruxiangmu{
  7555. max-width: 1000px;
  7556. }
  7557. </style>
  7558. <style scoped>
  7559. /* 项目标签的样式 */
  7560. .el-tag + .el-tag {
  7561. margin-left: 10px;
  7562. }
  7563. .button-new-tag {
  7564. margin-left: 10px;
  7565. height: 32px;
  7566. line-height: 30px;
  7567. padding-top: 0;
  7568. padding-bottom: 0;
  7569. }
  7570. .input-new-tag {
  7571. width: 90px;
  7572. margin-left: 10px;
  7573. vertical-align: bottom;
  7574. }
  7575. .selectworktime .el-table__fixed-body-wrapper{
  7576. top: 48px !important;
  7577. }
  7578. .selectworktime_export .selectworktime_export_l{
  7579. width: 65%;
  7580. float: left;
  7581. height: 42px;
  7582. }
  7583. .approvalProcessBox{
  7584. margin-left: 30px;
  7585. font-size: 14px;
  7586. line-height: 16px;
  7587. cursor: pointer;
  7588. }
  7589. .approvalProcessBox i {
  7590. margin-right: 0;
  7591. height: 16px;
  7592. width: 16px;
  7593. display: inline-block;
  7594. transform: scale(1.2);
  7595. position: relative;
  7596. top: 0.5px;
  7597. color: #409eff;
  7598. }
  7599. .approvalProcessBox .approvalProcessClick{
  7600. cursor: pointer;
  7601. color: #409eff;
  7602. font-size: 14px;
  7603. }
  7604. .approvalProcessBox:hover .approvalProcessClick{
  7605. color: #3485fb;
  7606. }
  7607. </style>
  7608. <style lang="scss" scoped>
  7609. // 加班样式
  7610. .overtime {
  7611. display: inline-block;
  7612. margin-left: 20px;
  7613. input {
  7614. display: inline-block;
  7615. margin-top: 5px;
  7616. }
  7617. }
  7618. .plus {
  7619. display: inline-block;
  7620. }
  7621. // .tages {
  7622. // float: right;
  7623. // }
  7624. .overtime {
  7625. display: inline-block;
  7626. margin-left: 30px;
  7627. }
  7628. .bloks {
  7629. display: inline-block;
  7630. width: 380px;
  7631. }
  7632. .zhiss {
  7633. display: flex;
  7634. justify-content: space-around;
  7635. align-items: center;
  7636. }
  7637. .zhoFel {
  7638. display: flex;
  7639. justify-content: space-between;
  7640. align-items: center;
  7641. }
  7642. // 左右滑动样式
  7643. .line {
  7644. width: 30px;
  7645. /* height: 500px; */
  7646. background: #f2f2f2;
  7647. cursor: w-resize;
  7648. }
  7649. .box-father {
  7650. border: 8px solid #000;
  7651. }
  7652. .line-second {
  7653. width: 10px;
  7654. /* background: red; */
  7655. }
  7656. .flex {
  7657. display: flex;
  7658. width: 100%;
  7659. }
  7660. .box-left {
  7661. flex: 0 0 400px;
  7662. /* height: 600px; */
  7663. /* background: blue; */
  7664. }
  7665. .box-right {
  7666. /* height: 600px; */
  7667. /* background: green; */
  7668. flex: 1;
  7669. }
  7670. .box-postion {
  7671. width: 200px;
  7672. /* height: 400px; */
  7673. background: #ccc;
  7674. }
  7675. .custom-tree-node {
  7676. flex: 1;
  7677. display: flex;
  7678. align-items: center;
  7679. justify-content: space-between;
  7680. font-size: 14px;
  7681. padding-right: 8px;
  7682. }
  7683. .daitianrbao {
  7684. width: 100%;
  7685. box-sizing: border-box;
  7686. height: 40px;
  7687. border-radius: 4px;
  7688. border: 1px solid #DCDFE6;
  7689. overflow: hidden;
  7690. text-overflow: ellipsis;
  7691. display: flex;
  7692. // align-items: center;
  7693. }
  7694. .daitianrbao .spnn {
  7695. display: inline-block;
  7696. box-sizing: border-box;
  7697. padding: 0 15px;
  7698. overflow: hidden;
  7699. text-overflow: ellipsis;
  7700. }
  7701. .daitianrbao .hover {
  7702. color: #DCDFE6 !important;
  7703. }
  7704. </style>