daily.vue 421 KB

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