daily.vue 475 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032
  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. <!--针对景昱-->
  22. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  23. <i class="el-icon-warning" style="color:red;"></i>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </span>
  28. </div>
  29. </div>
  30. <div style="display:flex;">
  31. <div class="grand flex">
  32. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  34. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  35. </div> -->
  36. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  37. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  38. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  39. </el-input>
  40. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  41. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  42. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  43. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  44. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  45. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  46. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  47. </el-select>
  48. </div>
  49. <div>
  50. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  53. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  54. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  55. </span>
  56. <div style="position: absolute;right: 15px;">
  57. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  58. <!-- 未填报 -->
  59. {{$t('state.DidNotFillIn')}}
  60. </span>
  61. <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'">
  62. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  63. {{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)')}}
  64. </span>
  65. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  66. <!-- 待审核 -->
  67. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  70. <!-- 已通过 -->
  71. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  74. <!-- 未通过 -->
  75. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  78. <!-- 待提交 -->
  79. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. </div>
  82. </span>
  83. </el-tree>
  84. </div>
  85. </div>
  86. </div>
  87. <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">
  88. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  89. -
  90. -
  91. -
  92. </div>
  93. </div>
  94. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  95. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  96. <div class="allDaily" style="float:left;flex-grow:1">
  97. <!--系统管理员和部门负责人 -->
  98. <div class="report_title" style="display:flex;justify-content: space-between;">
  99. <span>
  100. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  101. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  102. <!-- {{depData != null ?depData.label:""}} -->
  103. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  104. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  105. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  106. </span>
  107. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  108. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  109. </span>
  110. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="targetUid == null">
  112. <!-- - 已提交 -->
  113. -{{$t('state.hasBeenSubmitted')}}
  114. <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')}},
  115. <!-- 待提交 -->
  116. {{$t('state.waitingsubmit')}}
  117. <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')}},
  118. <!-- 漏填 -->
  119. <!-- {{$t('state.missFillReport')}} -->
  120. 未填
  121. <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')}}
  122. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  123. </span>
  124. </span>
  125. </span>
  126. <span style="float:right;">
  127. <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>
  128. <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>
  129. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  130. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  131. <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>
  132. <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>
  133. <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>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  138. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  139. <el-link type="primary" v-if="user.roleName == '超级管理员' && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">日报审核修改</el-link>
  140. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  141. </span>
  142. </div>
  143. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  144. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  145. <i class="fa fa-circle"></i>
  146. <!-- {{item1.name}} -->
  147. <span v-if="user.userNameNeedTranslate == '1'">
  148. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  149. </span>
  150. <span v-if="user.userNameNeedTranslate != '1'">
  151. {{item1.name}}
  152. </span>
  153. <span style="margin-left:30px;">
  154. <span style="margin-right:20px;">
  155. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  156. <!-- 工作总时长: -->
  157. {{$t('other.totalWorkingHours')}}
  158. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  159. <span >{{item1.reportTime | amounts}}</span>h
  160. </span>
  161. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  162. <i class="iconfont firerock-iconliucheng1"></i>
  163. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  164. <!-- 审批流程 -->
  165. {{$t('other.approvalProcess')}}
  166. </span>
  167. </span>
  168. </span>
  169. <div class="checkbtn" style="padding-right:20px;">
  170. <!--编辑和删除日报-->
  171. <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>
  172. <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>
  173. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  174. </div>
  175. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  176. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  177. </div>
  178. <div class="one_daily_body">
  179. <el-timeline>
  180. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  181. <el-card shadow="never">
  182. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  183. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  184. <span v-if="user.company.packageEngineering == 0">
  185. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  186. <span v-if="item2.isDeptAudit==0">
  187. <span v-if="item2.projectAuditState==0">
  188. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  189. <span v-if="item2.projectAuditorName != null">(
  190. <!-- {{item2.projectAuditorName}} -->
  191. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  192. )</span>
  193. <!-- 审核 --> {{$t('other.audit')}}
  194. </span>
  195. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  196. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  197. <span v-if="item2.projectAuditorName != null">(
  198. <!-- {{item2.projectAuditorName}} -->
  199. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  200. )</span>
  201. <!-- 审核通过 --> {{$t('state.approved')}}
  202. </span>
  203. </span>
  204. <span v-else-if="item2.isDeptAudit==1">
  205. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  206. ({{$t('other.await')}}
  207. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  208. {{$t('other.audit')}})
  209. </span>
  210. ]</span>
  211. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  212. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  213. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  214. </span>
  215. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  216. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  217. </span>
  218. <!-- <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> -->
  219. <span v-if="user.company.packageEngineering == 1">
  220. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  221. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  224. (
  225. <!-- <span v-if="user.userNameNeedTranslate != 1">
  226. {{item2.projectAuditorName}}
  227. </span>
  228. <span v-if="user.userNameNeedTranslate == 1">
  229. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  230. </span> -->
  231. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  232. )
  233. </span>{{$t('other.audit')}} ]</span>
  234. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  235. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  236. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  237. </span>
  238. <!--每个项目上单独审核 -->
  239. <span style="float:right;">
  240. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  241. <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"
  242. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  243. <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"
  244. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  245. <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"
  246. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  247. <!--自己可以撤回待审核状态的报告 -->
  248. <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>
  249. </span>
  250. </p>
  251. <p v-if="user.companyId == yuzhongCompId">
  252. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  253. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  254. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  255. <!--任务分组和阶段 -->
  256. <p v-if="item2.groupId != 0">
  257. {{$t('other.taskGroup')}}:{{item2.groupName}}
  258. <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>
  259. </p>
  260. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  261. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  262. <!-- 自定义日报文本 -->
  263. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  264. <p v-if="user.company.packageEngineering == 1">
  265. {{$t('other.professionalProgress')}}:
  266. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  267. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  268. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  269. </el-tooltip>
  270. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  271. <i class="iconfont firerock-iconshenhetongguo"></i>
  272. </el-tooltip>
  273. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  274. <i class="iconfont firerock-iconshenhebohui"></i>
  275. </el-tooltip>
  276. </span>
  277. </p>
  278. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  279. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  280. </p>
  281. <div v-if="item2.multiWorktime==0">
  282. <p style="display: inline-block;">{{$t('time.duration')}}:
  283. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  284. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  285. {{item2.time.toFixed(1)}}h
  286. <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>
  287. </p>
  288. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  289. </div>
  290. <div v-if="item2.multiWorktime==1" >
  291. <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>
  292. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  293. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  294. <p style="display: inline-block;">{{$t('time.duration')}}:
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  296. {{timeItem.time.toFixed(1)}}h
  297. </p>
  298. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  299. </div>
  300. </div>
  301. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  302. <!--照片的显示 -->
  303. <p v-if="item2.pics != null && item2.pics.length > 0">
  304. <el-image v-for="(pic, index) in item2.pics" :key="index"
  305. style="width: 100px; height: 100px; margin-right:10px;"
  306. :src="pic"
  307. :preview-src-list="item2.pics">
  308. </el-image>
  309. </p>
  310. </el-card>
  311. </el-timeline-item>
  312. </el-timeline>
  313. </div>
  314. </div>
  315. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  316. <!-- 简陋的无报告提示 -->
  317. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. </el-card>
  324. </div>
  325. <!-- 工时推送日志弹窗 -->
  326. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  327. <template>
  328. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  329. </template>
  330. <template>
  331. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  332. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  333. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  334. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  335. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  336. <el-table-column prop="result" label="推送结果" width="250">
  337. <template slot-scope="scope">
  338. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  339. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  340. </template>
  341. </el-table-column>
  342. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  343. </el-table>
  344. </template>
  345. <span slot="footer" class="dialog-footer">
  346. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  347. </span>
  348. </el-dialog>
  349. <!-- 填写日报的dialog -->
  350. <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">
  351. <div style="height: 65vh;overflow: auto;">
  352. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  353. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  354. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  355. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  356. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  357. <span class="spnn" v-if="workForm.userNames">
  358. <span v-for="(item, index) in workForm.userNames" :key="index">
  359. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  360. <span v-if="index < workForm.userNames.length - 1">,</span>
  361. </span>
  362. </span>
  363. <span class="spnn hover" v-else>
  364. {{$t('defaultText.pleaseSelectAsubstitute')}}
  365. </span>
  366. </div>
  367. </el-form-item>
  368. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  369. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  370. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  371. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  372. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  373. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  374. <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>
  375. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  376. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  377. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  378. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  379. <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>
  380. <!-- AI智能填报 -->
  381. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  382. </el-form-item>
  383. <!--考勤时长显示-->
  384. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  385. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  386. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  387. </span>
  388. <!--批量填报和批量代填不显示考勤记录-->
  389. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  390. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  391. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  392. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  393. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  394. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  395. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  396. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  397. @click="refreshAttendance(workForm.createDate)"></el-button>
  398. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  399. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  400. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  401. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  402. </el-form-item>
  403. <!-- 000000 -->
  404. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  405. <div v-if="reportTimeType.multiWorktime==0">
  406. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  407. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  408. <el-select v-model="domain.timeType" style="width:200px;"
  409. v-if="reportTimeType.type == 0"
  410. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  411. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  412. @change="onTimeTypeChange(domain.timeType)">
  413. <el-option
  414. v-for="item in timeType"
  415. :key="item.value"
  416. :label="item.label"
  417. :value="item.value">
  418. </el-option>
  419. </el-select>
  420. <!-- 数字时长选择 -->
  421. <el-select v-model="domain.workingTime" style="width:200px;"
  422. v-if="reportTimeType.type == 1"
  423. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  424. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  425. @change="seleChn(0,domain)">
  426. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  427. </el-select>
  428. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  429. <span v-if="reportTimeType.type == 2">
  430. <!--时间范围选择 -->
  431. <el-time-picker
  432. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  433. v-model="domain.startTime"
  434. :placeholder="$t('time.startTime')"
  435. style="width:120px;"
  436. format="HH:mm"
  437. value-format="HH:mm"
  438. :picker-options="{
  439. start: '08:00',
  440. end: '23:30'
  441. }"
  442. @change="iptChang()">
  443. </el-time-picker> - <el-time-picker
  444. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  445. v-model="domain.endTime"
  446. :placeholder="$t('time.endTime')"
  447. style="width:120px;"
  448. format="HH:mm"
  449. value-format="HH:mm"
  450. :picker-options="{
  451. start: '08:00',
  452. end: '23:30',
  453. minTime: domain.startTime
  454. }"
  455. @change="iptChang()">
  456. </el-time-picker>
  457. </span>
  458. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  459. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  460. <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>
  461. </div>
  462. </el-form-item>
  463. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  464. :prop="'domains.' + index + '.reportTargetDeptId'"
  465. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  466. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  467. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  468. <span style="float: left">
  469. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  470. </span>
  471. </el-option>
  472. </el-select>
  473. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  474. </el-form-item>
  475. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  476. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  477. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  478. @change="selectProject(domain, index)"
  479. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  480. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  481. <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">
  482. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  483. <span style="float: right;">{{ item.projectName }}</span>
  484. </el-option>
  485. </el-option-group>
  486. </el-select>
  487. <!--昱众不显示子项目-->
  488. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  489. <span style="margin-left:45px;">
  490. {{$t('lable.subproject')}}</span>
  491. <!--子项目 -->
  492. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  493. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  494. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  495. </el-select>
  496. </template>
  497. <template v-if="user.companyId == yuzhongCompId">
  498. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  499. <!--角色选择 -->
  500. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  501. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  502. <el-option
  503. v-for="item in roleList"
  504. :key="item.value"
  505. :label="item.label"
  506. :value="item.value">
  507. </el-option>
  508. </el-select>
  509. </template>
  510. <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%;"
  511. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  512. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  513. </el-link>
  514. <!-- <el-link type="primary" v-if="canEdit"
  515. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  516. </el-form-item>
  517. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  518. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  519. </el-form-item>
  520. <!--如果设置了工时成本预警的预算成本项-->
  521. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  522. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  523. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  524. </el-select>
  525. </el-form-item>
  526. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  527. <template slot="label">
  528. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  529. <span >{{$t('lable.taskGrouping')}}</span>
  530. </template>
  531. <!-- 任务分组 -->
  532. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  533. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  534. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  535. </el-select>
  536. <template v-if="user.companyId == yuzhongCompId">
  537. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  538. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  539. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  540. <el-option
  541. v-for="item in domain.filteredRespList"
  542. :key="item.id"
  543. :label="item.jobRespon"
  544. :value="item.id">
  545. </el-option>
  546. </el-select>
  547. </template>
  548. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  549. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  550. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  551. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  552. @change="changeStages(domain, index)"
  553. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  554. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  555. </el-select>
  556. </template>
  557. </el-form-item>
  558. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  559. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  560. <template slot="label">
  561. <span style="color:#FF0000;">*</span>
  562. <span >{{$t('other.projectAuditor')}}</span>
  563. </template>
  564. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  565. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  566. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  567. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  568. </el-option>
  569. </el-select>
  570. <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>
  571. </el-form-item>
  572. </div>
  573. <el-form-item v-if="user.companyId == yuzhongCompId">
  574. <template slot="label">
  575. <span style="color:#FF0000;">*</span>
  576. <span >工作内容</span>
  577. </template>
  578. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  579. :disabled="(workForm.domains[index].state>=2?false:true)" >
  580. <el-option
  581. v-for="item in domain.workContentList"
  582. :key="item.id"
  583. :label="item.workContext"
  584. :value="item.id">
  585. </el-option>
  586. </el-select>
  587. </el-form-item>
  588. <!-- 111111 -->
  589. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  590. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  591. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  592. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  593. <span v-else>{{item.name}}</span>
  594. </el-option>
  595. </el-select>
  596. <template v-if="user.timeType.auditLevel > 1">
  597. <i class="el-icon-right"></i>
  598. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  599. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  600. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  601. <span v-else>{{item.name}}</span>
  602. </el-option>
  603. </el-select>
  604. </template>
  605. <template v-if="user.timeType.auditLevel > 2">
  606. <i class="el-icon-right"></i>
  607. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  608. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  609. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  610. <span v-else>{{item.name}}</span>
  611. </el-option>
  612. </el-select>
  613. </template>
  614. </el-form-item>
  615. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  616. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  617. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  618. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  619. <span v-else>{{item.name}}</span>
  620. </el-option>
  621. </el-select>
  622. </el-form-item>
  623. <!-- 相关维度/自定义维度 -->
  624. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  625. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  626. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  627. </el-option>
  628. </el-select>
  629. </el-form-item>
  630. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  631. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  632. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  633. </el-option>
  634. </el-select>
  635. </el-form-item>
  636. <!-- 相关数值 -->
  637. <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">
  638. <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>
  639. </el-form-item>
  640. <!-- 自定义文本 -->
  641. <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">
  642. <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>
  643. </el-form-item>
  644. <!--按比例填报-->
  645. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  646. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  647. <div style="width:400px;">
  648. <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>
  649. <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>
  650. </div>
  651. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  652. <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>
  653. </div>
  654. </el-form-item>
  655. <!--工程专业版本模式下, 各个专业的进度填报 -->
  656. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  657. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  658. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  659. <el-input size="mini" style="width:60px;" v-model="item.progress"
  660. @keyup.native="onProgressChange"
  661. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  662. </span>
  663. </el-form-item>
  664. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  665. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  666. <template slot="label" v-if="user.timeType.taskRequired == 1">
  667. <span style="color:#FF0000;">*</span>
  668. <span >任务</span>
  669. </template>
  670. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  671. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  672. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  673. </el-select>
  674. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  675. </el-form-item>
  676. <!--针对依斯贝的SAP服务-->
  677. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  678. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  679. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  681. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  682. </el-select>
  683. </el-form-item>
  684. <!--工作事项-->
  685. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  686. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  687. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  688. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  689. </el-form-item>
  690. <!-- 拍照上传 -->
  691. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  692. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  693. <div class="photos">
  694. <div>
  695. <el-upload
  696. list-type="picture-card"
  697. :http-request="(file) => {return addImg(file, index)}"
  698. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  699. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  700. :file-list="domain.imgListUrl" :limit="9"
  701. :disabled="workForm.domains[index].state>=2?false:true">
  702. <i class="el-icon-plus"></i>
  703. </el-upload>
  704. </div>
  705. </div>
  706. </el-form-item>
  707. </div>
  708. <!--多个工作事项填报的情况 -->
  709. <div v-if="reportTimeType.multiWorktime==1">
  710. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  711. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  712. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  713. @change="selectProject(domain, index)"
  714. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  715. <!-- <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">
  716. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  717. <span style="float: right;">{{ item.projectName }}</span>
  718. </el-option> -->
  719. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  720. <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">
  721. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  722. <span style="float: right;">{{ item.projectName }}</span>
  723. </el-option>
  724. </el-option-group>
  725. </el-select>
  726. <template v-if="user.timeType.mainProjectState != 1">
  727. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  728. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  729. <!--子项目 -->
  730. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  731. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  732. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  733. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  734. </el-select>
  735. </template>
  736. <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;"
  737. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  738. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  739. </el-link>
  740. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  741. <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>
  742. </div>
  743. <!-- <el-link type="primary" v-if="canEdit"
  744. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  745. </el-form-item>
  746. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  747. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  748. </el-form-item>
  749. <!--如果设置了工时成本预警的预算成本项-->
  750. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  751. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  752. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  753. </el-select>
  754. </el-form-item>
  755. <el-form-item v-if="user.company.packageProject == 1">
  756. <template slot="label">
  757. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  758. <span >{{$t('lable.taskGrouping')}}</span>
  759. </template>
  760. <!-- 任务分组 -->
  761. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  762. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  763. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  764. </el-select>
  765. <!-- 项目的阶段 -->
  766. <span v-if="domain.stages != null && domain.stages.length> 0"
  767. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  768. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  769. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  770. @change="changeStages(domain, index)"
  771. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  772. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  773. </el-select>
  774. </el-form-item>
  775. <el-form-item :label="$t('other.projectAuditor')" >
  776. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  777. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  778. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  779. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  780. </el-option>
  781. </el-select>
  782. <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>
  783. </el-form-item>
  784. <!--工程专业版本模式下, 各个专业的进度填报 -->
  785. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  786. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  787. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  788. <el-input size="mini" style="width:60px;" v-model="item.progress"
  789. @keyup.native="onProgressChange"
  790. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  791. </span>
  792. </el-form-item>
  793. <!-- 相关维度 -->
  794. <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'">
  795. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  796. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  797. </el-option>
  798. </el-select>
  799. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  800. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  801. </el-option>
  802. </el-select>
  803. </el-form-item>
  804. <!-- 相关数值 -->
  805. <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">
  806. <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>
  807. </el-form-item>
  808. <!-- 自定义文本 -->
  809. <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">
  810. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  811. </el-form-item>
  812. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  813. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  814. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  815. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  816. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  817. </el-select>
  818. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  819. </el-form-item>
  820. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  821. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  822. <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>
  823. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  824. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  825. <span v-if="reportTimeType.type == 2">
  826. <!-- <span> -->
  827. <!--时间范围选择 -->
  828. <el-time-picker
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  830. v-model="timeItem.startTime"
  831. :placeholder="$t('time.startTime')"
  832. style="width:120px;"
  833. format="HH:mm"
  834. value-format="HH:mm"
  835. :picker-options="{
  836. start: '00:00',
  837. end: '23:59',
  838. }"
  839. @change="iptChangs()">
  840. </el-time-picker> - <el-time-picker
  841. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  842. v-model="timeItem.endTime"
  843. :placeholder="$t('time.endTime')"
  844. style="width:120px;"
  845. format="HH:mm"
  846. value-format="HH:mm"
  847. :picker-options="{
  848. start: '00:00',
  849. end: '23:59',
  850. minTime: timeItem.startTime
  851. }"
  852. @change="iptChangs()">
  853. </el-time-picker>
  854. </span>
  855. </el-form-item>
  856. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  857. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  858. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  859. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  860. ></el-input>
  861. </el-form-item>
  862. </div>
  863. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  864. </div>
  865. <!--照片的显示 -->
  866. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  867. <el-image v-for="(pic, index) in domain.pics" :key="index"
  868. style="width: 100px; height: 100px; margin-right:10px;"
  869. :src="pic"
  870. :preview-src-list="domain.pics">
  871. </el-image>
  872. </p>
  873. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  874. </div>
  875. <span id="workFormsItemBottom"></span>
  876. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  877. </el-form>
  878. </div>
  879. <span slot="footer" class="dialog-footer">
  880. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  881. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  882. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  883. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  884. <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>
  885. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  886. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  887. </span>
  888. </el-dialog>
  889. <!-- 按周填报 -->
  890. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  891. <!-- 按周填报-已填工时-点击 -->
  892. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  893. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  894. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  895. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  896. <el-table-column prop="state" :label="$t('state.states')">
  897. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  898. </el-table-column>
  899. <!-- <el-table-column label="操作">
  900. <template slot-scope="scope">
  901. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  902. </template>
  903. </el-table-column> -->
  904. </el-table>
  905. <span slot="footer" class="dialog-footer">
  906. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  907. </span>
  908. </el-dialog>
  909. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  910. <el-form-item style="height:30px;margin-top:-72px;">
  911. <!-- <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> -->
  912. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  913. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  914. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  915. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  916. <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>
  917. <el-option
  918. v-for="item in fillProjectList"
  919. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  920. :key="item.id"
  921. :label="item.projectName + '\u3000' + item.projectCode"
  922. :value="item.id">
  923. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  924. <span style="float: right">{{ item.projectName }}</span>
  925. </el-option>
  926. </el-select>
  927. <span style="float:right;margin-right:10px;">选择项目</span>
  928. </el-form-item>
  929. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  930. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  931. <template slot-scope="scope">
  932. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  933. </template>
  934. </el-table-column>
  935. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  936. <template slot-scope="scope">
  937. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  938. <p v-else></p>
  939. </template>
  940. </el-table-column> -->
  941. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  942. <template slot-scope="scope">
  943. <div v-if="scope.row.canFill == 1">
  944. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  945. <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>
  946. <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>
  947. <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>
  948. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  949. </div>
  950. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  951. <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>
  952. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  953. </div>
  954. </div>
  955. <div v-else >
  956. <span style="color:#999999;">不可超前填报</span>
  957. </div>
  958. </template>
  959. </el-table-column>
  960. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  961. <template slot-scope="scope">
  962. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  963. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  964. </template>
  965. </el-table-column>
  966. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  967. <template slot-scope="scope">
  968. <div class="zhiss">
  969. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  970. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  971. </div>
  972. </template>
  973. </el-table-column>
  974. </el-table>
  975. </el-form>
  976. <span slot="footer" class="dialog-footer" >
  977. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  978. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  979. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  980. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  981. <!--针对景昱,先检查工时是否存在异常-->
  982. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 重庆物奇私人定制的按周填报 -->
  986. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  987. <div class="fillWeekDialogVisiCustom">
  988. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  989. </div>
  990. </el-dialog>
  991. <!-- 选择时间 -->
  992. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  993. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  994. <span slot="footer" class="dialog-footer">
  995. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  996. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  997. </span>
  998. </el-dialog>
  999. <!-- 按周填报弹窗 -->
  1000. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1001. <div>
  1002. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1003. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1004. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1005. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1006. </el-select>
  1007. </div>
  1008. <!--如果设置了工时成本预警的预算成本项-->
  1009. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1010. <p>{{$t('lable.budgetSource')}}</p>
  1011. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1012. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <!-- 任务分组 -->
  1016. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1017. <p>{{$t('lable.taskGrouping')}}</p>
  1018. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1019. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1020. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1021. </el-select>
  1022. </div>
  1023. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1024. <p>{{$t('other.inputStage')}}</p>
  1025. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1026. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1027. </el-select>
  1028. </div>
  1029. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1030. <p>{{$t('other.reviewer')}}</p>
  1031. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1032. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. <template v-if="user.timeType.reportAuditType == 3">
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1046. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. <div class="zhoFel">
  1052. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1053. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1054. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1055. </el-select>
  1056. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1057. </div>
  1058. <div class="zhoFel">
  1059. <p>{{ $t('chao-song-ren') }}</p>
  1060. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1061. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. </template>
  1066. <!-- 自定义维度 -->
  1067. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1068. <p>{{user.timeType.customDegreeName}}</p>
  1069. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1070. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1071. </el-select>
  1072. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1073. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1074. </el-select>
  1075. </div>
  1076. <!-- 自定义数值 -->
  1077. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1078. <p>{{user.timeType.customDataName}}</p>
  1079. <el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  1080. </div>
  1081. <!-- 自定义文本 -->
  1082. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1083. <p>{{user.timeType.customTextName}}</p>
  1084. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1085. </div>
  1086. <!-- 选择任务 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1088. <p>任务 / 里程碑</p>
  1089. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1090. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1091. </el-select>
  1092. </div>
  1093. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1094. <p>{{$t('other.timeSelection')}}</p>
  1095. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" @change="$forceUpdate()" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  1096. </div>
  1097. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1098. <p>{{$t('other.chooseDuration')}}</p>
  1099. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1100. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1101. </el-select>
  1102. </div>
  1103. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1104. <p>{{$t('lable.percentageOfTime')}}</p>
  1105. <div style="width:400px;display: flex;align-items: center;">
  1106. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1107. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}{{$t('time.hour')}}</span></el-col>
  1108. </div>
  1109. </div>
  1110. <div class="zhoFel">
  1111. <p>{{$t('other.workMatters')}}</p>
  1112. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1113. </div>
  1114. </div>
  1115. <span slot="footer" class="dialog-footer">
  1116. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1117. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1118. </span>
  1119. </el-dialog>
  1120. <!--导出报表条件选择 -->
  1121. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1122. <el-form ref="form3" :model="exportParam" >
  1123. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1124. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1125. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1126. </el-select>
  1127. </el-form-item>
  1128. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1129. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1130. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1131. </el-form-item>
  1132. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1133. <el-date-picker
  1134. v-model="exportParam.dateRange" :editable="false"
  1135. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1136. :range-separator="$t('other.to')"
  1137. type="daterange"
  1138. :start-placeholder="$t('time.startDate')"
  1139. :end-placeholder="$t('time.endDate')"
  1140. ></el-date-picker>
  1141. </el-form-item>
  1142. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1143. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1144. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1145. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1146. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1147. </el-select>
  1148. </el-form-item>
  1149. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1150. <div class="exportReportRadio">
  1151. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1152. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1153. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1154. <i class="el-icon-question"></i>
  1155. </el-tooltip>
  1156. </div>
  1157. </el-form-item>
  1158. </el-form>
  1159. <div slot="footer" class="dialog-footer">
  1160. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1161. </div>
  1162. </el-dialog>
  1163. <!--导出报表条件选择 -->
  1164. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1165. <el-form ref="form3" :model="exportParam" >
  1166. <el-form-item prop="range" :label="$t('time.dateRange')">
  1167. <el-date-picker
  1168. v-model="exportParam.dateRange" :editable="false"
  1169. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1170. :clearable="true"
  1171. :range-separator="$t('other.to')"
  1172. type="daterange"
  1173. :start-placeholder="$t('time.startDate')"
  1174. :end-placeholder="$t('time.endDate')"
  1175. ></el-date-picker>
  1176. </el-form-item>
  1177. </el-form>
  1178. <div slot="footer" class="dialog-footer">
  1179. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1180. </div>
  1181. </el-dialog>
  1182. <!--人员列表 -->
  1183. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1184. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1185. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1186. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1187. <el-table-column type="selection"></el-table-column>
  1188. <el-table-column prop="label" :label="$t('lable.name')" >
  1189. <template slot-scope="scope">
  1190. <span>
  1191. <!-- {{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}} -->
  1192. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1193. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1194. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1195. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1196. </span>
  1197. <span v-else>
  1198. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1199. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1200. </span>
  1201. </span>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1205. <template slot-scope="scope">
  1206. <div>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1209. </div>
  1210. </template>
  1211. </el-table-column>
  1212. </el-table>
  1213. </el-tab-pane>
  1214. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1215. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1216. <el-table-column prop="label" :label="$t('lable.name')" >
  1217. <template slot-scope="scope">
  1218. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天 - ' + leaveTypeName[scope.row.leaveType] + ')' : '(请假' + scope.row.leaveTimes + 'h - ' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1219. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1220. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1222. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1223. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1224. </span>
  1225. <span v-else>
  1226. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1227. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1228. </span>
  1229. </template>
  1230. </el-table-column>
  1231. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1232. <template slot-scope="scope">
  1233. <div>
  1234. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1236. </div>
  1237. </template>
  1238. </el-table-column>
  1239. </el-table>
  1240. </el-tab-pane>
  1241. </el-tabs>
  1242. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1243. <el-table-column type="selection"></el-table-column>
  1244. <el-table-column prop="label" :label="$t('lable.name')" >
  1245. <template slot-scope="scope">
  1246. <div>
  1247. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1248. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1249. </div>
  1250. </template>
  1251. </el-table-column>
  1252. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1253. <template slot-scope="scope">
  1254. <div>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1257. </div>
  1258. </template>
  1259. </el-table-column>
  1260. </el-table>
  1261. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1262. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1263. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1264. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1265. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1266. </div>
  1267. </el-dialog>
  1268. <!-- 日报审核修改 -->
  1269. <el-dialog
  1270. title="日报审核修改"
  1271. :visible.sync="reportLogCheckDialog"
  1272. width="30%"
  1273. :before-close="handleClose">
  1274. <el-form ref="form3" :model="exportReportLogParam" >
  1275. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1276. <el-date-picker
  1277. v-model="exportReportLogParam.dateRange" :editable="false"
  1278. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1279. :range-separator="$t('other.to')"
  1280. type="daterange"
  1281. :start-placeholder="$t('time.startDate')"
  1282. :end-placeholder="$t('time.endDate')"
  1283. ></el-date-picker>
  1284. </el-form-item>
  1285. </el-form>
  1286. <el-link type="primary" @click="exportReportLog">导出日报审核记录数据</el-link>
  1287. <br>
  1288. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1289. <el-link type="primary" @click="importReportLog">导入日报审核记录修改数据</el-link></el-upload>
  1290. <span slot="footer" class="dialog-footer">
  1291. <el-button type="primary" @click="reportLogCheckDialog = false">关闭</el-button>
  1292. </span>
  1293. </el-dialog>
  1294. <!-- 按部门选择人员 -->
  1295. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1296. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1297. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1298. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1299. </el-input>
  1300. <div class="tree" style="height:400px">
  1301. <el-scrollbar style="height:100%">
  1302. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1303. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1304. highlight-current :filter-node-method="filterNode">
  1305. <span class="custom-tree-node" slot-scope="{ node }">
  1306. <span v-if="user.userNameNeedTranslate == '1'">
  1307. <span v-if="node.data.children">
  1308. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1309. </span>
  1310. <span v-else>
  1311. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1312. </span>
  1313. </span>
  1314. <span v-if="user.userNameNeedTranslate != '1'">
  1315. {{ node.label }}
  1316. </span>
  1317. <!-- {{ node.label }} -->
  1318. </span>
  1319. </el-tree>
  1320. </el-scrollbar>
  1321. </div>
  1322. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1323. <div slot="footer" class="dialog-footer">
  1324. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1325. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1326. </div>
  1327. </el-dialog>
  1328. <el-dialog
  1329. v-if="monthWorkTimeDialog"
  1330. :visible.sync="monthWorkTimeDialog"
  1331. :close-on-click-modal="false"
  1332. customClass="customWidth selectworktime"
  1333. width="1200px"
  1334. title=""
  1335. >
  1336. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1337. <el-tabs v-model="activeName" @tab-click="handleClick">
  1338. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1339. <div class="selectworktime_export" style="margin-top:10px;">
  1340. <div class="selectworktime_export_l">
  1341. <el-date-picker
  1342. class="selecteworktime_datapick"
  1343. v-model="WorktimeDatepickValue"
  1344. value-format="yyyy-MM-dd"
  1345. type="daterange"
  1346. align="right"
  1347. unlink-panels
  1348. :range-separator="$t('other.to')"
  1349. :start-placeholder="$t('time.startDate')"
  1350. :end-placeholder="$t('time.endDate')"
  1351. :default-time="['12:00:00', '12:00:00']"
  1352. size="small"
  1353. popper-class="selecteorktime_datapick_popper"
  1354. @change="showMonthWorkTime()"
  1355. >
  1356. </el-date-picker>
  1357. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1358. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1359. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1360. <!-- 222 -->
  1361. </div>
  1362. <div>
  1363. <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">
  1364. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1365. </el-input>
  1366. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1367. </div>
  1368. <div style="float: right; vertical-align: middle;height:32px">
  1369. <el-link
  1370. type="primary"
  1371. @click="exportMembWorkHours()"
  1372. >{{$t('export.exportData')}}</el-link
  1373. >
  1374. </div>
  1375. </div>
  1376. <el-table ref="hasworkTbl"
  1377. :data="monthWorkDataS"
  1378. v-el-table-infinite-scroll="listScroll"
  1379. border
  1380. :height="500"
  1381. highlight-current-row
  1382. style="width: 100%"
  1383. v-loading="tbload"
  1384. :lazy="true"
  1385. >
  1386. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1387. <template slot-scope="scope">
  1388. {{ scope.$index + 1 }}
  1389. </template>
  1390. </el-table-column>
  1391. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1392. <template slot-scope="scope">
  1393. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1394. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1395. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1396. <!-- {{scope.row.name}} -->
  1397. </span>
  1398. </template>
  1399. </el-table-column>
  1400. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1401. <template slot-scope="scope">
  1402. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1403. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1404. </template>
  1405. </el-table-column>
  1406. <el-table-column
  1407. min-width="105"
  1408. v-for="(item, index) in pickDateArray"
  1409. :key="index"
  1410. :label="item.label"
  1411. align="center"
  1412. >
  1413. <template slot-scope="scope">
  1414. <div
  1415. style="color: red"
  1416. v-if="
  1417. scope.row.worktimeList.filter(
  1418. (w) =>
  1419. w.createDate==item.date
  1420. ).length > 0 &&
  1421. scope.row.worktimeList.filter(
  1422. (w) =>w.createDate==item.date
  1423. )[0].workingTime < reportTimeType.allday
  1424. "
  1425. >
  1426. {{
  1427. scope.row.worktimeList.filter(
  1428. (w) =>w.createDate==item.date
  1429. )[0].workingTime.toFixed(1)
  1430. }}
  1431. </div>
  1432. <div
  1433. style="color: #20a0ff"
  1434. v-if="
  1435. scope.row.worktimeList.filter(
  1436. (w) =>w.createDate==item.date
  1437. ).length > 0 &&
  1438. scope.row.worktimeList.filter(
  1439. (w) =>w.createDate==item.date
  1440. )[0].workingTime > reportTimeType.allday
  1441. "
  1442. >
  1443. {{
  1444. scope.row.worktimeList.filter(
  1445. (w) =>w.createDate==item.date
  1446. )[0].workingTime.toFixed(1)
  1447. }}
  1448. </div>
  1449. <div
  1450. v-if="
  1451. scope.row.worktimeList.filter(
  1452. (w) =>w.createDate==item.date
  1453. ).length > 0 &&
  1454. scope.row.worktimeList.filter(
  1455. (w) =>w.createDate==item.date
  1456. )[0].workingTime == reportTimeType.allday
  1457. "
  1458. >
  1459. {{
  1460. scope.row.worktimeList.filter(
  1461. (w) =>w.createDate==item.date
  1462. )[0].workingTime
  1463. }}
  1464. </div>
  1465. <div
  1466. v-if="
  1467. scope.row.worktimeList.filter(
  1468. (w) =>w.createDate==item.date
  1469. ).length == 0
  1470. "
  1471. >
  1472. 0
  1473. </div>
  1474. <div
  1475. v-if="
  1476. scope.row.worktimeList.filter(
  1477. (w) =>w.createDate==item.date
  1478. ).length > 0 &&
  1479. typeof scope.row.worktimeList.filter(
  1480. (w) =>w.createDate==item.date
  1481. )[0].workingTime == 'string'
  1482. "
  1483. >
  1484. {{
  1485. scope.row.worktimeList.filter(
  1486. (w) =>w.createDate==item.date
  1487. )[0].workingTime
  1488. }}
  1489. </div>
  1490. </template>
  1491. </el-table-column>
  1492. </el-table>
  1493. <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>
  1494. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1495. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1496. <label style="font-size: 16px">员工每日已填报工时数</label>
  1497. <el-link
  1498. type="primary"
  1499. style="float: right; margin-right: 60px"
  1500. @click="exportMembWorkHours()"
  1501. >导出已填报数据</el-link
  1502. > -->
  1503. <!-- <el-button >导出</el-button> -->
  1504. <!-- </div> -->
  1505. </el-tab-pane>
  1506. <el-tab-pane label="未提交人员列表" name="second" >
  1507. <div class="selectworktime_export" style="margin-top:10px">
  1508. <div class="selectworktime_export_l">
  1509. <el-date-picker
  1510. class="selecteworktime_datapick"
  1511. v-model="WorktimeDatepickValue"
  1512. value-format="yyyy-MM-dd"
  1513. type="daterange"
  1514. align="right"
  1515. unlink-panels
  1516. :range-separator="$t('other.to')"
  1517. :start-placeholder="$t('time.startDate')"
  1518. :end-placeholder="$t('time.endDate')"
  1519. :default-time="['12:00:00', '12:00:00']"
  1520. size="small"
  1521. popper-class="selecteorktime_datapick_popper"
  1522. @change="showMonthNotWorkTime()"
  1523. >
  1524. </el-date-picker>
  1525. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1526. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1527. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1528. </div>
  1529. <div>
  1530. <div style="margin-top:10px;">
  1531. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1532. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1533. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1534. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1535. </el-input>
  1536. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1537. <el-link
  1538. type="primary"
  1539. style="float: right; vertical-align: middle;height:32px"
  1540. @click="exportMembNotWorkHours()"
  1541. >{{$t('export.exportData')}}</el-link
  1542. >
  1543. </div>
  1544. </div>
  1545. </div>
  1546. <el-table
  1547. ref="hasworkTbl2"
  1548. :data="monthNotWorkDateS"
  1549. v-el-table-infinite-scroll="notListScroll"
  1550. border
  1551. :height="500"
  1552. highlight-current-row
  1553. style="width: 100%"
  1554. v-loading="tbload"
  1555. lazy
  1556. >
  1557. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1558. <template slot-scope="scope">
  1559. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1560. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1561. </template>
  1562. </el-table-column>
  1563. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1564. <template slot-scope="scope">
  1565. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1566. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1567. </template>
  1568. </el-table-column>
  1569. <el-table-column
  1570. min-width="200"
  1571. :label="$t('weekDay.date')"
  1572. align="center"
  1573. prop="createDate"
  1574. >
  1575. </el-table-column>
  1576. <el-table-column
  1577. min-width="200"
  1578. :label="$t('state.states')"
  1579. align="center"
  1580. prop="status"
  1581. />
  1582. <el-table-column
  1583. min-width="200"
  1584. :label="$t('other.attendanceData')"
  1585. prop="cardTime"
  1586. align="center"
  1587. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1588. </el-table>
  1589. <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>
  1590. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1591. </el-tab-pane>
  1592. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1593. <div class="selectworktime_export" style="margin-top:10px;">
  1594. <div class="selectworktime_export_l">
  1595. <el-date-picker
  1596. class="selecteworktime_datapick"
  1597. v-model="WorktimeDatepickValue"
  1598. value-format="yyyy-MM-dd"
  1599. type="daterange"
  1600. align="right"
  1601. unlink-panels
  1602. :range-separator="$t('other.to')"
  1603. :start-placeholder="$t('time.startDate')"
  1604. :end-placeholder="$t('time.endDate')"
  1605. :default-time="['12:00:00', '12:00:00']"
  1606. size="small"
  1607. popper-class="selecteorktime_datapick_popper"
  1608. @change="showMonthWorkTimeReminder()"
  1609. >
  1610. </el-date-picker>
  1611. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1612. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1613. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1614. </div>
  1615. <div>
  1616. <div style="margin-top:10px;">
  1617. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1618. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1619. </el-input>
  1620. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1621. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1622. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthWorkTimeReminder()"></vueCascader>
  1623. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1624. </div>
  1625. </div>
  1626. <div style="float: right; vertical-align: middle;height:32px">
  1627. <el-link
  1628. type="primary"
  1629. @click="changeReminder()"
  1630. >{{'变更提醒'}}</el-link
  1631. >
  1632. <el-link
  1633. type="primary"
  1634. @click="exportMembWorkHoursReminder()"
  1635. >{{$t('export.exportData')}}</el-link
  1636. >
  1637. </div>
  1638. </div>
  1639. <el-table ref="hasworkTbl"
  1640. :data="monthWorkDataS"
  1641. v-el-table-infinite-scroll="listScroll"
  1642. border
  1643. :height="500"
  1644. highlight-current-row
  1645. style="width: 100%"
  1646. v-loading="tbload"
  1647. :lazy="true"
  1648. >
  1649. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1650. <template slot-scope="scope">
  1651. {{ scope.row.createDate}}
  1652. </template>
  1653. </el-table-column>
  1654. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1655. <template slot-scope="scope">
  1656. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1657. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1658. <!-- {{scope.row.name}} -->
  1659. </template>
  1660. </el-table-column>
  1661. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1662. <template slot-scope="scope">
  1663. {{scope.row.invokeValue}}
  1664. </template>
  1665. </el-table-column>
  1666. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1667. <template slot-scope="scope">
  1668. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1669. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1670. </template>
  1671. </el-table-column>
  1672. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1673. <template slot-scope="scope">
  1674. {{ scope.row.workingTime}}
  1675. </template>
  1676. </el-table-column>
  1677. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1678. <template slot-scope="scope">
  1679. {{ scope.row.cardTime}}
  1680. </template>
  1681. </el-table-column>
  1682. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1683. <template slot-scope="scope">
  1684. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1685. </template>
  1686. </el-table-column>
  1687. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1688. <template slot-scope="scope">
  1689. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1690. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1691. </template>
  1692. </el-table-column>
  1693. </el-table>
  1694. <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>
  1695. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1696. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1697. <label style="font-size: 16px">员工每日已填报工时数</label>
  1698. <el-link
  1699. type="primary"
  1700. style="float: right; margin-right: 60px"
  1701. @click="exportMembWorkHours()"
  1702. >导出已填报数据</el-link
  1703. > -->
  1704. <!-- <el-button >导出</el-button> -->
  1705. <!-- </div> -->
  1706. </el-tab-pane>
  1707. </el-tabs>
  1708. </el-dialog>
  1709. <!--驳回弹出框 -->
  1710. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1711. <div>
  1712. <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')" />
  1713. </div>
  1714. <div slot="footer" class="dialog-footer">
  1715. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1716. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1717. </div>
  1718. </el-dialog>
  1719. <!-- 通过弹出框 -->
  1720. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1721. <div>
  1722. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1723. </div>
  1724. <div slot="footer" class="dialog-footer">
  1725. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1726. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1727. </div>
  1728. </el-dialog>
  1729. <!--批量导入日报 -->
  1730. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1731. <p>1. {{$t('other.download')}}
  1732. <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>
  1733. </p>
  1734. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1735. <p style="display: flex;justify-content: center;">
  1736. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1737. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1738. </el-upload>
  1739. </p>
  1740. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1741. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1742. </div>
  1743. </el-dialog>
  1744. <!-- 工时导入记录弹窗 -->
  1745. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1746. <div style="height: 452px">
  1747. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1748. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1749. <el-table-column prop="userName" :label="$t('other.operator')">
  1750. <template slot-scope="scope">
  1751. <div>
  1752. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1753. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1754. </div>
  1755. </template>
  1756. </el-table-column>
  1757. <el-table-column prop="datel" :label="$t('other.document')">
  1758. <template slot-scope="scope">
  1759. <div>
  1760. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1761. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1762. </div>
  1763. </template>
  1764. </el-table-column>
  1765. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1766. <template slot-scope="scope">
  1767. <div>
  1768. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1769. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1770. </div>
  1771. </template>
  1772. </el-table-column>
  1773. </el-table>
  1774. <el-col :span="24" class="paginatis">
  1775. <el-pagination
  1776. @size-change="handleSizeChange"
  1777. @current-change="handleCurrentChange"
  1778. :page-sizes="[20 , 50 , 80 , 100]"
  1779. :page-size="20"
  1780. layout="total, sizes, prev, pager, next"
  1781. :total="toViewForm.total"
  1782. style="float:right;"
  1783. ></el-pagination>
  1784. </el-col>
  1785. </div>
  1786. </el-dialog>
  1787. <!--基于企业微信考勤数据的工时导入 -->
  1788. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1789. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1790. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1791. </el-step>
  1792. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1793. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1794. </el-steps>
  1795. <div v-if="active==0" style="padding:30px;height:360px;">
  1796. <div style="margin-top:50px;margin-left:280px;">
  1797. <el-date-picker
  1798. v-model="importWxParam.date" :editable="false"
  1799. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1800. :clearable="true"
  1801. :range-separator="$t('other.to')"
  1802. type="daterange"
  1803. :start-placeholder="$t('time.startDate')"
  1804. :end-placeholder="$t('time.endDate')"
  1805. @change="loadCheckInData"
  1806. ></el-date-picker>
  1807. </div>
  1808. </div>
  1809. <div v-if="active==1" style="padding:10px;">
  1810. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1811. style="width: 100%;margin-top:5px;" >
  1812. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1813. <template slot-scope="scope">
  1814. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1815. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1816. </template>
  1817. </el-table-column>
  1818. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1819. </el-table-column>
  1820. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1821. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1822. <template slot-scope="scope">
  1823. <div>
  1824. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1825. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1826. </div>
  1827. </template>
  1828. </el-table-column>
  1829. <el-table-column prop="departmentName" label="部门" >
  1830. <template slot-scope="scope">
  1831. <div>
  1832. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1833. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1834. </div>
  1835. </template>
  1836. </el-table-column>
  1837. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1838. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1839. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1840. <template slot-scope="scope">
  1841. {{scope.row.workHours.toFixed(1)}}h
  1842. </template>
  1843. </el-table-column>
  1844. </el-table>
  1845. </div>
  1846. <div v-if="active==2" >
  1847. <p style="display: flex;justify-content: center;height:390px;">
  1848. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1849. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1850. </el-upload>
  1851. </p>
  1852. </div>
  1853. <div slot="title">
  1854. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1855. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1856. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1857. <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>
  1858. <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>
  1859. <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>
  1860. </div>
  1861. <span slot="footer">
  1862. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1863. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1864. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1865. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1866. </span>
  1867. </el-dialog>
  1868. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1869. <p style="display: flex;justify-content: center;height:100px;">
  1870. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1871. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1872. </el-upload>
  1873. </p>
  1874. </el-dialog>
  1875. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1876. <div>
  1877. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1878. v-model="deleteReportParam.date" :editable="false"
  1879. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1880. :clearable="true"
  1881. :range-separator="$t('other.to')"
  1882. type="daterange"
  1883. :start-placeholder="$t('time.startDate')"
  1884. :end-placeholder="$t('time.endDate')"
  1885. ></el-date-picker>
  1886. </div>
  1887. <div style="margin-top:10px;">
  1888. <span>请选择部门:</span>
  1889. <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>
  1890. <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>
  1891. </div>
  1892. <div style="margin-top:10px;">
  1893. <span>请选择员工:</span>
  1894. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1895. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1896. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1897. <span v-else>{{item.name}}</span>
  1898. </el-option>
  1899. </el-select>
  1900. </div>
  1901. <span slot="footer">
  1902. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1903. </span>
  1904. </el-dialog>
  1905. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1906. <div>
  1907. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1908. v-model="deleteReportParam.date" :editable="false"
  1909. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1910. :clearable="true"
  1911. :range-separator="$t('other.to')"
  1912. type="daterange"
  1913. :start-placeholder="$t('time.startDate')"
  1914. :end-placeholder="$t('time.endDate')"
  1915. ></el-date-picker>
  1916. </div>
  1917. <div style="margin-top:15px;">
  1918. <span>选择部门:</span>
  1919. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1920. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1921. size="small" v-if="user.userNameNeedTranslate != 1"
  1922. ></el-cascader>
  1923. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1924. </div>
  1925. <span slot="footer">
  1926. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1927. </span>
  1928. </el-dialog>
  1929. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1930. <div>
  1931. <span>选择时间:</span><el-date-picker
  1932. v-model="modImportTime"
  1933. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1934. :clearable="true"
  1935. type="datetime"
  1936. ></el-date-picker>
  1937. <span>选择导入人员:</span><el-select
  1938. v-model="modImportUserId"
  1939. >
  1940. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1941. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1942. <span v-else>{{item.name}}</span>
  1943. </el-option>
  1944. </el-select>
  1945. </div>
  1946. <span slot="footer">
  1947. <el-button @click="confirmChangeModTime" >确认</el-button>
  1948. </span>
  1949. </el-dialog>
  1950. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1951. <div>
  1952. <span>请选择年月:</span>
  1953. <el-date-picker
  1954. v-model="ratioYmonth" :editable="false"
  1955. format="yyyyMM" value-format="yyyyMM"
  1956. type="month"
  1957. ></el-date-picker>
  1958. </div>
  1959. <span slot="footer">
  1960. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1961. </span>
  1962. </el-dialog>
  1963. <!--工时批量代填 -->
  1964. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1965. <div>
  1966. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1967. v-model="importWxParam.date" :editable="false"
  1968. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1969. :clearable="true"
  1970. :range-separator="$t('other.to')"
  1971. type="daterange"
  1972. :start-placeholder="$t('time.startDate')"
  1973. :end-placeholder="$t('time.endDate')"
  1974. @change="loadCheckInData"
  1975. ></el-date-picker>
  1976. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1977. </div>
  1978. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1979. :key="timeStamp"
  1980. style="width: 100%;margin-top:5px;" ref="tab">
  1981. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1982. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1983. <template slot-scope="scope">
  1984. <div>
  1985. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1986. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1987. </div>
  1988. </template>
  1989. </el-table-column>
  1990. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1991. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1992. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1993. <template slot-scope="scope">
  1994. {{scope.row.workHours.toFixed(1)}}h
  1995. </template>
  1996. </el-table-column>
  1997. <!--项目名称列表 -->
  1998. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1999. <template slot-scope="scope">
  2000. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2001. </template>
  2002. </el-table-column>
  2003. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2004. <template slot-scope="scope">
  2005. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2006. </template>
  2007. </el-table-column>
  2008. </el-table>
  2009. </el-dialog>
  2010. <!--基于企业微信考勤数据的工时导入 -->
  2011. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2012. <div style="padding-bottom:10px;">
  2013. <p>{{importResultMsg}}</p>
  2014. </div>
  2015. <!-- <span slot="footer" class="dialog-footer">
  2016. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2017. </span> -->
  2018. </el-dialog>
  2019. <!-- 审核流程展示 -->
  2020. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2021. <div style="padding:20px 40px 20px 0">
  2022. <el-timeline :reverse="false">
  2023. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2024. <!-- {{item.msg}} -->
  2025. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2026. <span v-if="user.userNameNeedTranslate == 1">
  2027. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2028. <span>{{item.msgCon.two}}</span>
  2029. </span>
  2030. </el-timeline-item>
  2031. </el-timeline>
  2032. </div>
  2033. </el-dialog>
  2034. </section>
  2035. </template>
  2036. <script>
  2037. // 左右滑动
  2038. import dragMixin from "@/common/js/tensile.js";
  2039. import util from "../../common/js/util";
  2040. // 自定义select组件
  2041. import selectCat from "@/components/select.vue"
  2042. // 引入自定义级联组件
  2043. import vueCascader from "@/components/cascader.vue"
  2044. // 重庆物奇定制组件
  2045. import WeeklyCustomization from "./weeklyCustomization.vue"
  2046. import { mapMutations } from 'vuex'
  2047. let _that = this
  2048. export default {
  2049. mixins: [dragMixin],
  2050. components: {
  2051. selectCat,
  2052. vueCascader,
  2053. WeeklyCustomization
  2054. },
  2055. data() {
  2056. return {
  2057. pageIndex: 0,
  2058. hasMore: true,
  2059. exportType: 0,
  2060. exportingData: false,
  2061. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2062. jobResponseList:[],
  2063. yisibeiCompId: 3092,
  2064. yuzhongCompId: 3385,
  2065. mingyiName : '成都明夷电子科技有限公司',
  2066. // mingyiName : '明夷',
  2067. modItemDataId: null,
  2068. modImportTime: null,
  2069. modImportUserId: null,
  2070. showModImportTimeDialog: false,
  2071. showBatchSimpleApproveReport: false,
  2072. startDeleting: false,
  2073. showBatchDeleteReport: false,
  2074. deleteReportParam: {date:null, userIds:[]},
  2075. isDenying: false,
  2076. targetWeekDate: null,//填写周报中的周日期
  2077. importCardTimeVisi: false,
  2078. startRatioExporting: false,
  2079. exportUserRatio: false,
  2080. ratioYmonth:null,
  2081. hasWrittenReport: false,
  2082. today:null,
  2083. syncTimeLoading: false,
  2084. seluserText: '',
  2085. translation: '1', // 1、文字, 2、部门, 3、人员
  2086. exportLoad: false,
  2087. getPickerOptions: {
  2088. disabledDate: (time) => {
  2089. var date = new Date();
  2090. var year = date.getFullYear();
  2091. var month = date.getMonth() + 1;
  2092. if (month >= 1 && month <= 9) {
  2093. month = "0" + month;
  2094. }
  2095. var currentdate = year.toString() + month.toString();
  2096. var timeyear = time.getFullYear();
  2097. var timemonth = time.getMonth() + 1;
  2098. if (timemonth >= 1 && timemonth <= 9) {
  2099. timemonth = "0" + timemonth;
  2100. }
  2101. var timedate = timeyear.toString() + timemonth.toString();
  2102. if(this.user.timeType.fillAhead == 0){
  2103. return currentdate < timedate;
  2104. }else{
  2105. return false
  2106. }
  2107. }
  2108. },
  2109. alalal: '8.0',
  2110. timeBasecostList:null,
  2111. tbload: false,
  2112. exportTimeDialog: false,
  2113. searchKeyword: '',
  2114. monthWorkDataS: [],
  2115. monthNotWorkDateS: [],
  2116. pickDateArray:[],
  2117. WorktimeDatepickValue: [],
  2118. activeName:"first",
  2119. isLeave: 0,
  2120. submitingReport: false,
  2121. importResultMsg:null,
  2122. showImportResult:false,
  2123. importingData: false,
  2124. isDraft: 0,
  2125. timeStamp: 0,
  2126. projectColumns:[],
  2127. checkinLoading:false,
  2128. importWxParam:{date:null,},
  2129. active:0,
  2130. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2131. importWxDialog:false,
  2132. importDialog:false,
  2133. denyForm:null,
  2134. denyReasonDialog:false,
  2135. monthWorkTimeDialog: false,
  2136. isSubstitude:false,
  2137. isFill:false,
  2138. unFillList:[],
  2139. fillList:[],
  2140. fillMembList:[],
  2141. fillMembList_leave: [],
  2142. membListVisible: false,
  2143. isBatch:0,//是否是批量填报
  2144. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2145. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2146. 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')],
  2147. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2148. fillStatusList: [],
  2149. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2150. exportReportLogParam:{dateRange:[]},
  2151. exportDialog:false,
  2152. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2153. subProjectList:[],
  2154. canEdit: true,
  2155. originCanEdit: true,
  2156. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2157. selectTime:null,
  2158. reportTimeType:{},
  2159. curDate:'',
  2160. isAllSelect: false,
  2161. approveDialogVisible:false,
  2162. deptId:null,
  2163. targetUid: null,
  2164. membCount:0,
  2165. selectState:"-1",
  2166. user: JSON.parse(sessionStorage.getItem("user")),
  2167. allUsersList: [],
  2168. showAddMore:false,
  2169. allDate: [],
  2170. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2171. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2172. choseDay: 0,
  2173. tableHeight: 0,
  2174. listLoading: false,
  2175. projectList: [], //项目列表
  2176. fillProjectList: [],
  2177. reportList: [], //日报列表
  2178. reportNames:[], //批量审批列表
  2179. selCon:[], //筛选条件
  2180. selProjectList:[], //筛选后项目列表
  2181. selConShow: true,
  2182. usersList: [], // 全部人员列表
  2183. usersListId: '', // 选中的人员id
  2184. dialogVisible: false, //项目弹窗
  2185. report: '',
  2186. workForm: {
  2187. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2188. domains: [{
  2189. id: null,
  2190. projectId: "",
  2191. workingTime: "",
  2192. timeType:0,
  2193. content: "",
  2194. state: 2,
  2195. multiWorktime:0,
  2196. worktimeList:[],
  2197. degreeId: null,
  2198. auditUserList: [],
  2199. }],
  2200. showRefresh: false,
  2201. },
  2202. workRules: {
  2203. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2204. },
  2205. chooseParticipVisible: false,
  2206. logining: false,
  2207. isDisable: false,
  2208. timeType:[],
  2209. deptMembData: [
  2210. ],
  2211. //部门人员树状结构
  2212. data: [
  2213. {
  2214. id: -1,
  2215. label: this.$t('lable.allStaff'),
  2216. membCount:0
  2217. },
  2218. {
  2219. id: 0,
  2220. label: this.$t('lable.unassigned'),
  2221. }
  2222. ],
  2223. allData:{},
  2224. batchShowData:{},
  2225. option: [],
  2226. deptOptionList: [],
  2227. depData: {
  2228. id: -1,
  2229. label: this.$t('lable.allStaff'),
  2230. },
  2231. defaultProps: {
  2232. children: 'children',
  2233. label: 'label'
  2234. },
  2235. isNew: false,
  2236. selected: false,
  2237. valuet: new Date(),
  2238. domObj: null,
  2239. participator:[],
  2240. chosenMembCount:0,
  2241. jsDay: 0,
  2242. jsTime: 0,
  2243. falsss: false,
  2244. weidu: [],
  2245. weiduList: [],
  2246. yonghuUser: [],
  2247. dateAr: [],
  2248. batchSubFillDialog: false,
  2249. isSubstiS: false,
  2250. fillWeekDialogVisi: false,
  2251. fillWeekDialogVisiCustom: false,
  2252. zhoData: [],
  2253. weekDateRange: [],
  2254. btnZho: false,
  2255. weekDataLoading: false,
  2256. changdu: 6,
  2257. tianxieDialogVisible: false,
  2258. scopess: {},
  2259. zhoBao: {
  2260. time: '',
  2261. workingTime: '',
  2262. progress: '',
  2263. con: '',
  2264. subProjectId: '',
  2265. stage: '',
  2266. subProjectList: [],
  2267. stages: [],
  2268. },
  2269. zhoBaoIdx: '',
  2270. zhoBaoName: '',
  2271. zhis: {},
  2272. dealList: [],
  2273. toViewDialogVisible: false,
  2274. toViewList: [],
  2275. toViewloading: true,
  2276. toViewForm: {
  2277. pageIndex: '1',
  2278. pageSize: '20',
  2279. total: 0,
  2280. },
  2281. toViewloadings: false,
  2282. tabPositionss: 'top',
  2283. monthTotal: 0,
  2284. monthTotalPage: 0,
  2285. monthTotalLages: 20,
  2286. monthWorkData: [],
  2287. monthNotWorkDate: [],
  2288. monthWorkDataS1: [],
  2289. monthnotTotal: 0,
  2290. monthnotTotalPage: 0,
  2291. monthnotTotalLages: 20,
  2292. monthNotWorkDateS1: [],
  2293. deptMembDataText: '',
  2294. isFlag: false,
  2295. isMore: false,
  2296. stateKey: '0',
  2297. expandDate: [],
  2298. notifySelList:[],
  2299. departmentList: [],
  2300. approvalProcessDialog: false,
  2301. approvalProcessData: [],
  2302. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2303. 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')],
  2304. isWeekend: false,
  2305. canCancelInDialog: false,
  2306. approveinData: {},
  2307. approveinDialog: false,
  2308. reportCanDelete: false,
  2309. weeklyFilledTimeDialog: false,
  2310. weeklyFilledTimeList: [],
  2311. weeklyFilledTimeLoading: false,
  2312. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2313. weeklyFilledTimeCanDelete: false,
  2314. weeklyFilledTimeDate: null,
  2315. leaveAllNum: 0,
  2316. dataLoading: false,
  2317. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2318. vacationTime: {},
  2319. integrationProjectList: [],
  2320. totalReportHours: 0, // 合计的工时
  2321. workTimeForMinYi:0,
  2322. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2323. weekIndex: 1,
  2324. weekParentData: {},
  2325. deptIdForNoReport:[],
  2326. deptIdForReminder:[],
  2327. nameAearch: '', // 企业微信姓名搜索
  2328. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2329. deptMembDataLoading: false,
  2330. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2331. {
  2332. id: 4811,
  2333. // id: 10,
  2334. name: '陕西柘中建设工程有限公司'
  2335. }
  2336. ],
  2337. pushWorkTimeLogDig:false,
  2338. pushWorkTimeLogData:[],
  2339. userReportDeptList: [],
  2340. isReminder:true,
  2341. reportLogCheckDialog:false,
  2342. };
  2343. },
  2344. watch: {
  2345. deptMembDataText(val) {
  2346. this.$refs.chooseMembTree.filter(val);
  2347. }
  2348. },
  2349. filters: {
  2350. // 过滤
  2351. amounts(value) {
  2352. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2353. return 0
  2354. }
  2355. var zhi = +value + 0
  2356. return zhi.toFixed(1)
  2357. },
  2358. // zhoData
  2359. zhoData(value, arr) {
  2360. var dateArray = value.split("-");
  2361. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2362. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2363. // console.log(arr[date.getDay()])
  2364. // return "周" + "日一二三四五六".charAt(date.getDay());
  2365. return arr[date.getDay()]
  2366. },
  2367. // 过滤数字
  2368. numbers(value) {
  2369. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2370. return 0
  2371. }
  2372. return value
  2373. },
  2374. },
  2375. computed: {},
  2376. mounted() {
  2377. var now = new Date();
  2378. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2379. this.today = t;
  2380. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2381. this.exportParam.dateRange = [startStr,t];
  2382. this.exportReportLogParam.dateRange = [startStr,t];
  2383. this.getAllDate(1);
  2384. this.getReportList();
  2385. this.getProjectList();
  2386. this.getFillProjectList();
  2387. this.getTimeType();
  2388. this.getDepartment();
  2389. this.scrollFunction()
  2390. this.userssHu();
  2391. this.getFirstAndLastDay()
  2392. if(this.user.timeType.reportAuditType == 3){
  2393. this.getAllUsersList()
  2394. }
  2395. if (this.user.company.packageProject == 1) {
  2396. this.getBasecostItemList();
  2397. }
  2398. if(this.user.timeType.userWithMultiDept == 1) {
  2399. this.getDeptMembData();
  2400. }
  2401. if(this.user.timeType.lockWorktime){
  2402. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2403. }
  2404. //设置了下限
  2405. if (this.user.timeType.minReportTime) {
  2406. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2407. }
  2408. const that = this
  2409. if(this.user.userNameNeedTranslate == 1) {
  2410. that.dataLoading = that.$store.state.dataLoading
  2411. this.upDataLoading()
  2412. setTimeout(()=>{
  2413. that.dataLoading = that.$store.state.dataLoading
  2414. }, 1000)
  2415. }
  2416. if (this.user.companyId == this.yuzhongCompId) {
  2417. this.getJobResponList();
  2418. }
  2419. },
  2420. methods: {
  2421. ...mapMutations(['upDataLoading']),
  2422. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2423. isCustomization(userInfo, permissionArray) {
  2424. const { companyId } = userInfo
  2425. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2426. return isReportPictureRequired
  2427. },
  2428. // 获取如何信息选的可填写部门
  2429. getDeptMembData() {
  2430. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2431. if (res.code == "ok") {
  2432. let lists = res.data.userReportDeptList || []
  2433. const optimizedList = lists.map(item => ({
  2434. ...item,
  2435. label: item.departmentName,
  2436. value: item.departmentId,
  2437. }));
  2438. this.$set(this, 'userReportDeptList', optimizedList || []);
  2439. } else {
  2440. this.$message({
  2441. message: res.msg,
  2442. type: "error"
  2443. });
  2444. }
  2445. },error => { });
  2446. },
  2447. //任务被选中
  2448. onTaskSelected(domainItem) {
  2449. //取服务
  2450. if (domainItem.taskId) {
  2451. var that = this;
  2452. var param = {taskId:domainItem.taskId};
  2453. if (this.isSubstitude) {
  2454. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2455. param.userId = this.workForm.userId[0];
  2456. }
  2457. }
  2458. this.http.post('/task/getMyTaskService',param, res => {
  2459. if (res.code == "ok") {
  2460. // domainItem.workContentList = res.data;
  2461. that.$set(domainItem, 'sapServiceId', null);
  2462. that.$set(domainItem, 'serviceList', res.data);
  2463. } else {
  2464. this.$message({
  2465. message: res.msg,
  2466. type: "error"
  2467. });
  2468. }
  2469. },error => {
  2470. this.$message({
  2471. message: error,
  2472. type: "error"
  2473. });
  2474. }
  2475. );
  2476. } else {
  2477. //清空服务
  2478. }
  2479. },
  2480. onBatchTimeChange() {
  2481. //反向计算每日工作时长
  2482. if (this.workForm.createDate) {
  2483. let sdate = new Date(this.workForm.createDate[0]);
  2484. let edate = new Date(this.workForm.createDate[1]);
  2485. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2486. console.log('days===', days)
  2487. if (days < 0) {
  2488. return;
  2489. }
  2490. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2491. //总时长发生改变,自动按比例计算
  2492. this.workForm.domains.forEach(d=>{
  2493. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2494. });
  2495. }
  2496. },
  2497. //更新工作内容列表
  2498. updateJobContent(domainItem) {
  2499. var that = this;
  2500. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2501. if (res.code == "ok") {
  2502. // domainItem.workContentList = res.data;
  2503. that.$set(domainItem, 'extraField3', null);
  2504. that.$set(domainItem, 'workContentList', res.data);
  2505. } else {
  2506. this.$message({
  2507. message: res.msg,
  2508. type: "error"
  2509. });
  2510. }
  2511. },error => {
  2512. this.$message({
  2513. message: error,
  2514. type: "error"
  2515. });
  2516. }
  2517. );
  2518. },
  2519. updateResponse(domainItem) {
  2520. var that = this;
  2521. var selectPid = domainItem.projectId;
  2522. domainItem.extraField2 = null;
  2523. domainItem.extraField3 = null;
  2524. if (selectPid && domainItem.extraField1) {
  2525. //是否非项目
  2526. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2527. console.log('==========','isPublic=='+isPublic);
  2528. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2529. console.log(filteredRespList);
  2530. domainItem.filteredRespList = filteredRespList;
  2531. }
  2532. },
  2533. getJobResponList() {
  2534. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2535. if (res.code == "ok") {
  2536. this.jobResponseList = res.data;
  2537. } else {
  2538. this.$message({
  2539. message: res.msg,
  2540. type: "error"
  2541. });
  2542. }
  2543. },error => {
  2544. this.$message({
  2545. message: error,
  2546. type: "error"
  2547. });
  2548. }
  2549. );
  2550. },
  2551. openModImportTime(row) {
  2552. this.showModImportTimeDialog = true;
  2553. this.modItemDataId = row.id;
  2554. },
  2555. delImportTime(row) {
  2556. let rowId = row.id;
  2557. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2558. confirmButtonText: this.$t('btn.determine'),
  2559. cancelButtonText: this.$t('btn.cancel'),
  2560. type: "warning"
  2561. })
  2562. .then(() => {
  2563. this.http.post('/report-import-log/delete',{
  2564. id: rowId
  2565. },res => {
  2566. if (res.code == "ok") {
  2567. this.$message({
  2568. message: '删除成功',
  2569. type: "success"
  2570. });
  2571. this.getToView();
  2572. } else {
  2573. this.$message({
  2574. message: res.msg,
  2575. type: "error"
  2576. });
  2577. }
  2578. },error => {
  2579. this.$message({
  2580. message: error,
  2581. type: "error"
  2582. });
  2583. }
  2584. );
  2585. }).catch(() => {this.startDeleting = false});
  2586. },
  2587. confirmChangeModTime() {
  2588. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2589. this.$message({
  2590. message: '请选择时间',
  2591. type: "error"
  2592. });
  2593. return;
  2594. }
  2595. this.http.post('/report-import-log/changeTime',{
  2596. modLogDateTime: this.modImportTime,
  2597. modImportUserId: this.modImportUserId,
  2598. id: this.modItemDataId
  2599. },res => {
  2600. if (res.code == "ok") {
  2601. this.$message({
  2602. message: '修改成功',
  2603. type: "success"
  2604. });
  2605. this.getToView();
  2606. this.showModImportTimeDialog = false;
  2607. } else {
  2608. this.$message({
  2609. message: res.msg,
  2610. type: "error"
  2611. });
  2612. }
  2613. },error => {
  2614. this.$message({
  2615. message: error,
  2616. type: "error"
  2617. });
  2618. }
  2619. );
  2620. },
  2621. confirmBatchApproveReport() {
  2622. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2623. this.$message({
  2624. message: '请选择日期范围',
  2625. type: "error"
  2626. });
  2627. return;
  2628. }
  2629. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2630. confirmButtonText: this.$t('btn.determine'),
  2631. cancelButtonText: this.$t('btn.cancel'),
  2632. type: "warning"
  2633. })
  2634. .then(() => {
  2635. this.startDeleting = true;
  2636. let obj = {
  2637. startDate: this.deleteReportParam.date[0],
  2638. endDate: this.deleteReportParam.date[1]
  2639. }
  2640. if(this.deleteReportParam.departmentId) {
  2641. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2642. } else {
  2643. obj.departmentId = null
  2644. }
  2645. this.http.post('/report/batchApproveByDate',obj,res => {
  2646. if (res.code == "ok") {
  2647. this.$message({
  2648. message: '审核通过',
  2649. type: "success"
  2650. });
  2651. this.getReportList();
  2652. this.getDepartment();
  2653. this.startDeleting = false;
  2654. } else {
  2655. this.$message({
  2656. message: res.msg,
  2657. type: "error"
  2658. });
  2659. }
  2660. },error => {
  2661. this.$message({
  2662. message: error,
  2663. type: "error"
  2664. });
  2665. }
  2666. );
  2667. }).catch(() => {this.startDeleting = false});
  2668. },
  2669. confirmBatchDelReport() {
  2670. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2671. this.$message({
  2672. message: '请选择部门或人员',
  2673. type: "error"
  2674. });
  2675. return;
  2676. }
  2677. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2678. this.$message({
  2679. message: '请选择日期范围',
  2680. type: "error"
  2681. });
  2682. return;
  2683. }
  2684. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2685. confirmButtonText: this.$t('btn.determine'),
  2686. cancelButtonText: this.$t('btn.cancel'),
  2687. type: "warning"
  2688. })
  2689. .then(() => {
  2690. this.startDeleting = true;
  2691. this.http.post('/report/batchDelete',{
  2692. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2693. startDate: this.deleteReportParam.date[0],
  2694. endDate: this.deleteReportParam.date[1],
  2695. deptId: this.deleteReportParam.deptId[0]
  2696. },res => {
  2697. if (res.code == "ok") {
  2698. this.$message({
  2699. message: this.$t('message.successfullyDeleted'),
  2700. type: "success"
  2701. });
  2702. this.getReportList();
  2703. this.getDepartment();
  2704. this.startDeleting = false;
  2705. } else {
  2706. this.$message({
  2707. message: res.msg,
  2708. type: "error"
  2709. });
  2710. }
  2711. },error => {
  2712. this.$message({
  2713. message: error,
  2714. type: "error"
  2715. });
  2716. }
  2717. );
  2718. }).catch(() => {this.startDeleting = false});
  2719. },
  2720. getRecentlyProject() {
  2721. this.http.post('/project/nearProject',{},res => {
  2722. if(res.code == 'ok'){
  2723. let topObj = {
  2724. label: '最近选择项目',
  2725. peojectList: res.data
  2726. }
  2727. let botomObj = {
  2728. label: '全部项目',
  2729. peojectList: this.fillProjectList
  2730. }
  2731. //最近项目如果在fillProjectList中不存在,需要移除
  2732. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2733. this.integrationProjectList = [topObj, botomObj]
  2734. }else {
  2735. this.$message({
  2736. message: res.msg,
  2737. type: 'error'
  2738. })
  2739. }
  2740. },err => {
  2741. this.$message({
  2742. message: err,
  2743. type: 'error'
  2744. })
  2745. })
  2746. },
  2747. handlePictureCardPreview(file, index) {
  2748. console.log(file, index)
  2749. let arr = []
  2750. let imgArr = this.workForm.domains[index].imgListUrl
  2751. for(var i in imgArr) {
  2752. arr.push(imgArr[i].url)
  2753. }
  2754. console.log(arr, '图片数据')
  2755. const $viewer = this.$viewerApi({
  2756. images: arr
  2757. });
  2758. },
  2759. // 图片上传
  2760. addImg(e, index) {
  2761. console.log(e, '数据')
  2762. let formData = new FormData()
  2763. formData.append('multipartFile', e.file)
  2764. this.http.uploadFile('/common/uploadFile', formData,
  2765. res => {
  2766. if (res.code == "ok") {
  2767. this.$message({
  2768. message: this.$t('uploadedsuccessfully'),
  2769. type: "success"
  2770. });
  2771. if(!this.workForm.domains[index].imgList) {
  2772. this.workForm.domains[index].imgList = []
  2773. this.workForm.domains[index].imgListUrl = []
  2774. }
  2775. this.workForm.domains[index].imgList.push(res.data)
  2776. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2777. } else {
  2778. this.$message({message: res.msg,type: "error"});
  2779. }
  2780. console.log(this.workForm.domains[index])
  2781. },
  2782. error => {this.$message({message: error,type: "error"});
  2783. });
  2784. },
  2785. // 删除图片
  2786. delImg(file,fileList, index) {
  2787. console.log(file, fileList)
  2788. let idx = 0
  2789. for(let i in fileList) {
  2790. if(fileList[i].uid == file.uid) {
  2791. idx = i
  2792. }
  2793. }
  2794. this.workForm.domains[index].imgList.splice(idx, 1)
  2795. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2796. console.log(this.workForm.domains[index])
  2797. },
  2798. test(){
  2799. console.log('test',this.workForm.domains);
  2800. },
  2801. getHour(s1, s2) {
  2802. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2803. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2804. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2805. var ms = s2.getTime() - s1.getTime();
  2806. if (ms < 0) return 0;
  2807. let ma = ms / 1000 / 60 / 60
  2808. return ma; //小时
  2809. },
  2810. refreshWXCardTime(workdate) {
  2811. if (!workdate) return;
  2812. this.syncTimeLoading = true;
  2813. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2814. date: workdate,
  2815. },res => {
  2816. this.syncTimeLoading = false;
  2817. if(res.code == 'ok'){
  2818. this.workForm.time = res.data.time;
  2819. }else {
  2820. this.$message({
  2821. message: res.msg,
  2822. type: 'error'
  2823. })
  2824. }
  2825. },err => {
  2826. this.syncTimeLoading = false;
  2827. this.$message({
  2828. message: err,
  2829. type: 'error'
  2830. })
  2831. })
  2832. },
  2833. refreshAttendance(workdate) {
  2834. if (!workdate) return;
  2835. this.syncTimeLoading = true;
  2836. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2837. startDate: workdate[0],
  2838. endDate: workdate[1]
  2839. },res => {
  2840. this.syncTimeLoading = false;
  2841. if(res.code == 'ok'){
  2842. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2843. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2844. this.totalReportHours = this.workTimeForMinYi;
  2845. }else {
  2846. this.$message({
  2847. message: res.msg,
  2848. type: 'error'
  2849. })
  2850. }
  2851. },err => {
  2852. this.syncTimeLoading = false;
  2853. this.$message({
  2854. message: err,
  2855. type: 'error'
  2856. })
  2857. })
  2858. },
  2859. refreshBeiSengAttendance(workdate) {
  2860. if (!workdate) return;
  2861. this.syncTimeLoading = true;
  2862. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2863. createDate: workdate
  2864. },res => {
  2865. this.syncTimeLoading = false;
  2866. if(res.code == 'ok'){
  2867. this.workForm.time = res.data;
  2868. }else {
  2869. this.$message({
  2870. message: res.msg,
  2871. type: 'error'
  2872. })
  2873. }
  2874. },err => {
  2875. this.syncTimeLoading = false;
  2876. this.$message({
  2877. message: err,
  2878. type: 'error'
  2879. })
  2880. })
  2881. },
  2882. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2883. this.weeklyFilledTimeDialog = true
  2884. this.weeklyFilledTimeLoading = true
  2885. this.weeklyFilledTimeDate = parameterDate
  2886. this.http.post('/report/getReportList',{
  2887. date: parameterDate,
  2888. userId: this.user.id
  2889. },res => {
  2890. this.weeklyFilledTimeLoading = false
  2891. if(res.code == 'ok'){
  2892. this.weeklyFilledTimeList = res.data[0].data
  2893. let candelete = true
  2894. for(let i in this.weeklyFilledTimeList){
  2895. if(this.weeklyFilledTimeList[i].state < 2){
  2896. candelete = false
  2897. }
  2898. }
  2899. this.weeklyFilledTimeCanDelete = candelete
  2900. }else {
  2901. this.$message({
  2902. message: res.msg,
  2903. type: 'error'
  2904. })
  2905. }
  2906. },err => {
  2907. this.weeklyFilledTimeLoading = false
  2908. this.$message({
  2909. message: err,
  2910. type: 'error'
  2911. })
  2912. })
  2913. },
  2914. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2915. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2916. confirmButtonText: this.$t('btn.determine'),
  2917. cancelButtonText: this.$t('btn.cancel'),
  2918. type: "warning"
  2919. })
  2920. .then(() => {
  2921. this.http.post('/report/delete',{
  2922. userId: this.user.id,
  2923. date: this.weeklyFilledTimeDate
  2924. },res => {
  2925. if (res.code == "ok") {
  2926. this.$message({
  2927. message: this.$t('message.successfullyDeleted'),
  2928. type: "success"
  2929. });
  2930. this.getWeeklyWorkTime()
  2931. this.getReportList();
  2932. this.getDepartment();
  2933. this.weeklyFilledTimeDialog = false;
  2934. } else {
  2935. this.$message({
  2936. message: res.msg,
  2937. type: "error"
  2938. });
  2939. }
  2940. },error => {
  2941. this.$message({
  2942. message: error,
  2943. type: "error"
  2944. });
  2945. }
  2946. );
  2947. }).catch(() => {});
  2948. },
  2949. getApprovalProcess(item){
  2950. // console.log('this.date',this.choseDate);
  2951. this.http.post('/report-log/get',{
  2952. creatorId: item.id,
  2953. createDate: sessionStorage.msg
  2954. },res => {
  2955. if(res.code == 'ok'){
  2956. this.approvalProcessDialog = true
  2957. if(this.user.userNameNeedTranslate == 1) {
  2958. for(var i in res.data) {
  2959. let obj = {
  2960. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2961. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2962. }
  2963. res.data[i].msgCon = obj
  2964. }
  2965. }
  2966. this.approvalProcessData = res.data
  2967. console.log(this.approvalProcessData, '数据卡看')
  2968. }else{
  2969. this.$message({
  2970. message: res.msg,
  2971. type: 'error'
  2972. })
  2973. }
  2974. },err => {
  2975. this.$message({
  2976. message: err,
  2977. type: 'error'
  2978. })
  2979. })
  2980. },
  2981. filterNode(value, data) {
  2982. if (!value) return true;
  2983. return data.label.indexOf(value) !== -1;
  2984. },
  2985. triggerCalculateOT(index) {
  2986. var str = this.workForm.domains[index].overtimeHours + ''
  2987. if(str.indexOf('.') != '-1') {
  2988. var s = str.split('.')[0]
  2989. var st = str.split('.')[1]
  2990. var sts = st.split('')
  2991. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2992. }
  2993. },
  2994. searchScreen(e){
  2995. if(e){
  2996. this.monthNotWorkDateS1 = []
  2997. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2998. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2999. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3000. }
  3001. }
  3002. if (this.monthNotWorkDateS1.length > 50) {
  3003. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3004. }else{
  3005. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3006. }
  3007. // if (this.monthNotWorkDateS1.length > 0) {
  3008. // setTimeout(() => {
  3009. // this.tableListenernot()
  3010. // }, 1000);
  3011. // }
  3012. }else{
  3013. this.monthWorkDataS1 = []
  3014. for (let i = 0; i < this.monthWorkData.length; i++) {
  3015. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3016. this.monthWorkDataS1.push(this.monthWorkData[i])
  3017. }
  3018. }
  3019. if (this.monthWorkDataS1.length > 50) {
  3020. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3021. }else{
  3022. this.monthWorkDataS = this.monthWorkDataS1
  3023. }
  3024. // if (this.monthWorkDataS1.length > 0) {
  3025. // setTimeout(() => {
  3026. // this.tableListener()
  3027. // }, 1000);
  3028. // }
  3029. }
  3030. },
  3031. addUpload(data) {
  3032. // var zhi = data.fileName.split('.')[0]
  3033. // var sss = zhi + '.xlsx'
  3034. // return
  3035. var filePath = '/upload/' + data.serverName;
  3036. const a = document.createElement('a'); // 创建a标签
  3037. a.setAttribute('download', data.fileName);// download属性
  3038. a.setAttribute('href', filePath);// href链接
  3039. a.click(); //自执行点击事件
  3040. a.remove();
  3041. },
  3042. restrictNumber(targetId) {
  3043. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3044. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3045. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3046. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3047. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3048. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3049. inpu.value = parseFloat(inpu.value);
  3050. }
  3051. },
  3052. //获取项目下的任务分组
  3053. getTaskGroups(domain, index) {
  3054. domain.groupId=null;
  3055. this.http.post('/task-group/listMyJoinGroup',{
  3056. projectId: domain.projectId,
  3057. isSubstitude: this.isSubstitude ? 1 : 0
  3058. },
  3059. res => {
  3060. if (res.code == "ok") {
  3061. this.workForm.domains[index].taskGroups = res.data;
  3062. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3063. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3064. // this.getGroupStages(domain, index);
  3065. // }
  3066. this.$forceUpdate();
  3067. }
  3068. },
  3069. error => {
  3070. this.$message({
  3071. message: error,
  3072. type: "error"
  3073. });
  3074. }
  3075. );
  3076. },
  3077. //下载填报工时占比报表
  3078. downloadProjectRatio() {
  3079. this.exportUserRatio = true;
  3080. // let now = new Date();
  3081. // let month = now.getMonth();//默认看上个月的
  3082. // let monthStr = month<10? ('0'+month): month;
  3083. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3084. const today = new Date();
  3085. const year = today.getFullYear();
  3086. const month = today.getMonth() + 1;
  3087. let lastMonthYear, lastMonth;
  3088. if (month === 1) {
  3089. lastMonthYear = year - 1;
  3090. lastMonth = 12;
  3091. } else {
  3092. lastMonthYear = year;
  3093. lastMonth = month - 1;
  3094. }
  3095. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3096. console.log('赋值 ==>', this.ratioYmonth)
  3097. },
  3098. confirmDownloadRatio() {
  3099. this.startRatioExporting = true;
  3100. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3101. ymonth: this.ratioYmonth
  3102. },
  3103. res => {
  3104. if (res.code == "ok") {
  3105. this.startRatioExporting = false;
  3106. var filePath = res.data;
  3107. const a = document.createElement('a'); // 创建a标签
  3108. var data = filePath.split("/");
  3109. a.setAttribute('download', data[data.length-1]);// download属性
  3110. a.setAttribute('href', filePath);// href链接
  3111. a.click(); //自执行点击事件
  3112. a.remove();
  3113. } else {
  3114. this.startRatioExporting = false;
  3115. this.$message({
  3116. message: res.msg,
  3117. type: "error"
  3118. });
  3119. }
  3120. },
  3121. error => {
  3122. this.checkinLoading = false;
  3123. this.$message({
  3124. message: error,
  3125. type: "error"
  3126. });
  3127. }
  3128. );
  3129. },
  3130. //下载带企业微信考勤数据的工时统计模板
  3131. downloadCheckInExcel() {
  3132. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3133. startDate: this.importWxParam.date[0],
  3134. endDate: this.importWxParam.date[1],
  3135. },
  3136. res => {
  3137. if (res.code == "ok") {
  3138. var filePath = res.data;
  3139. const a = document.createElement('a'); // 创建a标签
  3140. var data = filePath.split("/");
  3141. a.setAttribute('download', data[data.length-1]);// download属性
  3142. a.setAttribute('href', filePath);// href链接
  3143. a.click(); //自执行点击事件
  3144. a.remove();
  3145. } else {
  3146. this.$message({
  3147. message: res.msg,
  3148. type: "error"
  3149. });
  3150. }
  3151. },
  3152. error => {
  3153. this.checkinLoading = false;
  3154. this.$message({
  3155. message: error,
  3156. type: "error"
  3157. });
  3158. }
  3159. );
  3160. },
  3161. pre() {
  3162. if (this.active == 0) return;
  3163. this.active--;
  3164. },
  3165. next() {
  3166. this.active++;
  3167. },
  3168. triggerTotalTime(index) {
  3169. var item = this.checkinList[index];
  3170. var total = 0.0;
  3171. for (var i=0;i<this.projectColumns.length; i++) {
  3172. var key = this.projectColumns[i];
  3173. if (item[key] != null && item[key] != '') {
  3174. total += parseFloat(item[key]);
  3175. }
  3176. }
  3177. item.totalFillTime = total;
  3178. },
  3179. //提交批量代填的数据
  3180. submitBatchSubFillData() {
  3181. var data = JSON.stringify(this.checkinList);
  3182. this.http.post('/user-corpwx-time/submitProjectTime',{
  3183. json: data,
  3184. projectColumns: JSON.stringify(this.projectColumns)
  3185. },
  3186. res => {
  3187. if (res.code == "ok") {
  3188. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3189. this.importWxDialog = false;
  3190. }
  3191. },
  3192. error => {
  3193. this.checkinLoading = false;
  3194. this.$message({
  3195. message: error,
  3196. type: "error"
  3197. });
  3198. }
  3199. );
  3200. },
  3201. loadCheckInData() {
  3202. if (this.importWxParam.date == null) {
  3203. this.checkinList = [];
  3204. return;
  3205. }
  3206. this.checkinLoading = true;
  3207. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3208. startDate: this.importWxParam.date[0],
  3209. endDate: this.importWxParam.date[1],
  3210. },
  3211. res => {
  3212. if (res.code == "ok") {
  3213. this.checkinLoading = false;
  3214. this.checkinList = res.data.list;
  3215. this.projectColumns = res.data.projects;
  3216. // 自定义表格会导致表格错乱,需重新计算表格
  3217. this.$nextTick(()=>{
  3218. this.$refs.tab.doLayout()
  3219. })
  3220. }
  3221. },
  3222. error => {
  3223. this.checkinLoading = false;
  3224. this.$message({
  3225. message: error,
  3226. type: "error"
  3227. });
  3228. }
  3229. );
  3230. },
  3231. importCardTime(item) {
  3232. //首先判断文件类型
  3233. let str = item.file.name.split(".");
  3234. let format = str[str.length - 1];
  3235. if (format != "xls" && format != "xlsx") {
  3236. this.$message({
  3237. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3238. type: "error"
  3239. });
  3240. } else {
  3241. this.importingData = true;
  3242. let formData = new FormData();
  3243. formData.append("multipartFile", item.file);
  3244. formData.append("companyId", this.user.companyId);
  3245. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3246. res => {
  3247. this.$refs.uploadCardTime.clearFiles();
  3248. this.importingData = false;
  3249. if (res.code == "ok") {
  3250. //换成弹出框,以免有人等了半天回来啥也没看到
  3251. this.$message({
  3252. message: '导入考勤时长成功',
  3253. type: "success"
  3254. });
  3255. } else {
  3256. this.$message({
  3257. message: res.msg,
  3258. type: "error"
  3259. });
  3260. }
  3261. },
  3262. error => {
  3263. this.$refs.upload.clearFiles();
  3264. this.listLoading = false;
  3265. this.$message({
  3266. message: error,
  3267. type: "error"
  3268. });
  3269. });
  3270. }
  3271. },
  3272. batchImportWxData(item) {
  3273. //首先判断文件类型
  3274. let str = item.file.name.split(".");
  3275. let format = str[str.length - 1];
  3276. if (format != "xls" && format != "xlsx") {
  3277. this.$message({
  3278. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3279. type: "error"
  3280. });
  3281. } else {
  3282. this.importingData = true;
  3283. let formData = new FormData();
  3284. formData.append("file", item.file);
  3285. formData.append("companyId", this.user.companyId);
  3286. formData.append("withCheckIn", 1);
  3287. this.http.uploadFile('/report/importData', formData,
  3288. res => {
  3289. this.$refs.upload.clearFiles();
  3290. this.showImportResult = true;
  3291. this.importingData = false;
  3292. if (res.code == "ok") {
  3293. //换成弹出框,以免有人等了半天回来啥也没看到
  3294. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3295. this.getReportList();
  3296. this.importWxDialog = false;
  3297. } else {
  3298. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3299. }
  3300. },
  3301. error => {
  3302. this.$refs.upload.clearFiles();
  3303. this.listLoading = false;
  3304. this.$message({
  3305. message: error,
  3306. type: "error"
  3307. });
  3308. });
  3309. }
  3310. },
  3311. batchImportData(item) {
  3312. //首先判断文件类型
  3313. let str = item.file.name.split(".");
  3314. let format = str[str.length - 1];
  3315. if (format != "xls" && format != "xlsx") {
  3316. this.$message({
  3317. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3318. type: "error"
  3319. });
  3320. } else {
  3321. this.importingData = true;
  3322. let formData = new FormData();
  3323. formData.append("file", item.file);
  3324. formData.append("companyId", this.user.companyId);
  3325. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3326. this.http.uploadFile(url, formData,
  3327. res => {
  3328. this.$refs.upload.clearFiles();
  3329. this.importingData = false;
  3330. this.showImportResult = true;
  3331. if (res.code == "ok") {
  3332. //换成弹出框,以免有人等了半天回来啥也没看到
  3333. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3334. this.getReportList();
  3335. this.importWXDialog = false;
  3336. } else {
  3337. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3338. }
  3339. },
  3340. error => {
  3341. this.$refs.upload.clearFiles();
  3342. this.importingData = false;
  3343. this.$message({
  3344. message: error,
  3345. type: "error"
  3346. });
  3347. });
  3348. }
  3349. },
  3350. userssHu() {
  3351. this.http.post('/time-type/getCompanyTimeSetting',{
  3352. companyId: this.user.companyId
  3353. },
  3354. res => {
  3355. if (res.code == "ok") {
  3356. this.yonghuUser = res.data
  3357. }
  3358. },
  3359. error => {
  3360. this.$message({
  3361. message: error,
  3362. type: "error"
  3363. });
  3364. }
  3365. );
  3366. },
  3367. iptBlur(i) {
  3368. if(this.isBatch == 0) {
  3369. return
  3370. }
  3371. var reqParam = {
  3372. startDate: this.workForm.createDate[0],
  3373. endDate: this.workForm.createDate[1]
  3374. };
  3375. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3376. reqParam.userId = this.workForm.userId[0];
  3377. }
  3378. this.http.post('/report/getWorkDays',reqParam,
  3379. res => {
  3380. if (res.code == "ok") {
  3381. this.jsDay = res.data
  3382. this.chuji(i)
  3383. } else {
  3384. this.$message({
  3385. message: res.msg,
  3386. type: "error"
  3387. });
  3388. }
  3389. },
  3390. error => {
  3391. this.$message({
  3392. message: error,
  3393. type: "error"
  3394. });
  3395. }
  3396. );
  3397. //明夷硬编码获取
  3398. if (this.user.company.companyName == this.mingyiName) {
  3399. this.getWorkTimeForMinYi();
  3400. }
  3401. },
  3402. getWorkTimeForMinYi(){
  3403. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3404. startDate: this.workForm.createDate[0],
  3405. endDate: this.workForm.createDate[1]
  3406. },
  3407. res => {
  3408. if (res.code == "ok") {
  3409. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3410. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3411. this.totalReportHours = this.workTimeForMinYi;
  3412. } else {
  3413. this.$message({
  3414. message: res.msg,
  3415. type: "error"
  3416. });
  3417. this.workForm.createDate = [];
  3418. }
  3419. },
  3420. error => {
  3421. this.$message({
  3422. message: error,
  3423. type: "error"
  3424. });
  3425. }
  3426. );
  3427. },
  3428. chuji(i) {
  3429. if(i == 0) {
  3430. this.seleChn(1)
  3431. } else if(i == 1) {
  3432. this.seleChn(0)
  3433. } else if(i == 2) {
  3434. if(this.workForm.domains[0].multiWorktime > 0) {
  3435. this.iptChangs()
  3436. } else {
  3437. this.iptChang()
  3438. }
  3439. } else if(i == 3) {
  3440. this.seleChn(0)
  3441. }
  3442. },
  3443. seleChn(e,domain) {
  3444. if(e == 1) {
  3445. for(var i in this.workForm.domains) {
  3446. if(this.workForm.domains[i].timeType == 0) {
  3447. this.workForm.domains[i].workingTime = 8
  3448. } else {
  3449. this.workForm.domains[i].workingTime = 4
  3450. }
  3451. }
  3452. }
  3453. var quanbu = 0
  3454. var spl = this.workForm.domains
  3455. var zhi = ''
  3456. for(var i in spl) {
  3457. var sp = +spl[i].workingTime + 0
  3458. zhi = this.jsDay * sp
  3459. quanbu = +quanbu + zhi
  3460. }
  3461. this.jsTime = quanbu
  3462. this.totalReportHours = quanbu
  3463. let worktime = this.jsTime
  3464. // 自动计算加班时长
  3465. if(this.isBatch != 0){
  3466. worktime = this.jsTime / this.jsDay
  3467. }
  3468. if(this.user.timeType.fillOvertime && domain){
  3469. let isover = false
  3470. let alltime = 0
  3471. let allover = 0 //此处alltime同上面的worktime
  3472. for(let d in spl){
  3473. if(spl[d].isOvertime){
  3474. isover = true
  3475. allover += spl[d].overtimeHours*1
  3476. }
  3477. alltime += spl[d].workingTime*1
  3478. }
  3479. if(domain.overtimeHours){
  3480. allover = allover - domain.overtimeHours
  3481. }
  3482. if(worktime*1 > this.user.timeType.allday){
  3483. if(isover){
  3484. if(alltime > (allover + this.user.timeType.allday)){
  3485. this.$set(domain,'isOvertime',true)
  3486. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3487. }else{
  3488. this.$set(domain,'isOvertime',false)
  3489. this.$set(domain,'overtimeHours',null)
  3490. if(alltime < (allover + this.user.timeType.allday)){
  3491. let overtime = allover + this.user.timeType.allday - alltime
  3492. for(let pi in spl){
  3493. if(spl[pi].overtimeHours){
  3494. if((overtime - spl[pi].overtimeHours*1) > 0){
  3495. overtime = overtime - spl[pi].overtimeHours*1
  3496. this.$set(spl[pi],'isOvertime',false)
  3497. this.$set(spl[pi],'overtimeHours',null)
  3498. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3499. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3500. break
  3501. }else{
  3502. this.$set(spl[pi],'isOvertime',false)
  3503. this.$set(spl[pi],'overtimeHours',null)
  3504. break
  3505. }
  3506. }
  3507. }
  3508. }
  3509. }
  3510. }else{
  3511. this.$set(domain,'isOvertime',true)
  3512. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3513. }
  3514. }else{
  3515. for(let di in spl){
  3516. this.$set(spl[di],'isOvertime',false)
  3517. this.$set(spl[di],'overtimeHours',null)
  3518. }
  3519. }
  3520. }
  3521. },
  3522. iptChang() {
  3523. var sl = this.workForm.domains
  3524. let timeArr = []
  3525. for(var i in sl) {
  3526. if(sl[i].startTime && sl[i].endTime) {
  3527. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3528. }
  3529. }
  3530. this.getTimeHours(timeArr)
  3531. // for(let j in arrNum) {
  3532. // this.timeJsonStr += arrNum[j]
  3533. // if(flg) {
  3534. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3535. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3536. // }
  3537. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3538. // flg = true
  3539. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3540. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3541. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3542. // }
  3543. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3544. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3545. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3546. // }
  3547. // }
  3548. },
  3549. iptChangs() {
  3550. var sl = this.workForm.domains
  3551. let timeArr = []
  3552. for(var i in sl) {
  3553. for(var j in sl[i].worktimeList){
  3554. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3555. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3556. }
  3557. }
  3558. }
  3559. this.getTimeHours(timeArr)
  3560. },
  3561. // 调用接口或去数据
  3562. getTimeHours(arr) {
  3563. this.http.post('/report/getHoursByTimeRange',{
  3564. timeJsonStr: JSON.stringify(arr)
  3565. },res => {
  3566. if(res.code === 'ok') {
  3567. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3568. } else {
  3569. this.$message({
  3570. message: res.msg,
  3571. type: 'error'
  3572. })
  3573. }
  3574. },err => {
  3575. this.$message({
  3576. message: err,
  3577. type: 'error'
  3578. })
  3579. })
  3580. },
  3581. // 按周填报调用接口计算时间
  3582. async getWeekHoursByTimeRange(timeRange) {
  3583. const url = '/report/getHoursByTimeRange';
  3584. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3585. var that = this;
  3586. return new Promise((resolve, reject) => {
  3587. this.http.post(url, data, function(res) {
  3588. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3589. }, function(err) {
  3590. reject(err);
  3591. });
  3592. });
  3593. },
  3594. removeTimeItem(item, index) {
  3595. item.worktimeList.splice(index, 1);
  3596. this.iptChangs()
  3597. },
  3598. //添加工时
  3599. addNewWorktime(index, item) {
  3600. if(item.worktimeList == null ) {
  3601. item.worktimeList = []
  3602. }
  3603. item.worktimeList.push({});
  3604. },
  3605. //复制项目
  3606. copyProject(index) {
  3607. var leftProgress = 10;
  3608. if (this.reportTimeType.type == 3) {
  3609. //计算已经待分配工时比例
  3610. let array = this.workForm.domains;
  3611. let totalProgress = 0;
  3612. for (var i=0;i<array.length; i++) {
  3613. totalProgress += array[i].progress;
  3614. }
  3615. if (totalProgress < 100) {
  3616. leftProgress = 100 - totalProgress;
  3617. }
  3618. }
  3619. var newIndex = index+1;
  3620. var itemDomain = {
  3621. projectId: this.workForm.domains[index].projectId,
  3622. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3623. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3624. ),
  3625. content: "",
  3626. progress:leftProgress,
  3627. state:2,//2-表示待提交
  3628. };
  3629. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3630. if (this.reportTimeType.type == 0) {
  3631. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3632. var length = this.workForm.domains.length;
  3633. if (length == 2) {
  3634. this.showAddMore = false;
  3635. }
  3636. }
  3637. this.selectProject(itemDomain, newIndex);
  3638. },
  3639. pushWorkTime(reportId){
  3640. let url=''
  3641. if(this.user.timeType.syncSap == 1){
  3642. url='/report/pushProjectReportToSap'
  3643. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3644. var pushDate = this.date + day;
  3645. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3646. confirmButtonText: '确定',
  3647. cancelButtonText: '取消',
  3648. type: 'info'
  3649. }).then(() => {
  3650. const loading = this.$loading({
  3651. lock: true,
  3652. text: '正在推送中,请耐心等待。',
  3653. spinner: 'el-icon-loading',
  3654. background: 'rgba(0, 0, 0, 0.7)'
  3655. });
  3656. this.http.post(url,{
  3657. pushDate: pushDate,
  3658. reportId: reportId
  3659. },res => {
  3660. loading.close();
  3661. if(res.code == 'ok'){
  3662. this.$message({
  3663. type: 'success',
  3664. message: res.data
  3665. });
  3666. }else{
  3667. this.$message({
  3668. type: 'error',
  3669. message: res.msg
  3670. })
  3671. }
  3672. },err => {
  3673. loading.close();
  3674. this.$message({
  3675. type: 'error',
  3676. message: err
  3677. })
  3678. })
  3679. }).catch(() => {
  3680. });
  3681. }else{
  3682. url='/report/pushReportDataToThird'
  3683. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3684. confirmButtonText: '确定',
  3685. cancelButtonText: '取消',
  3686. type: 'info'
  3687. }).then(() => {
  3688. const loading = this.$loading({
  3689. lock: true,
  3690. text: '正在推送中,请耐心等待。',
  3691. spinner: 'el-icon-loading',
  3692. background: 'rgba(0, 0, 0, 0.7)'
  3693. });
  3694. this.http.post(url,{
  3695. yearMonth: this.date
  3696. },res => {
  3697. loading.close();
  3698. if(res.code == 'ok'){
  3699. this.$message({
  3700. type: 'success',
  3701. message: '推送成功!'
  3702. });
  3703. }else{
  3704. this.$message({
  3705. type: 'error',
  3706. message: res.msg
  3707. })
  3708. }
  3709. },err => {
  3710. loading.close();
  3711. this.$message({
  3712. type: 'error',
  3713. message: err
  3714. })
  3715. })
  3716. }).catch(() => {
  3717. });
  3718. }
  3719. },
  3720. showWorkTime(){
  3721. this.monthWorkTimeDialog = true;
  3722. this.searchKeyword = ''
  3723. this.WorktimeDatepickValue = this.istoMonth()
  3724. if(this.WorktimeDatepickValue.length == 0){
  3725. let newdate = new Date();
  3726. let nowdate = newdate.toLocaleDateString();
  3727. let getauto = this.getAutoWeekDate(nowdate)
  3728. let nowwd = [getauto[0],getauto[6]]
  3729. this.WorktimeDatepickValue = nowwd
  3730. }
  3731. this.showMonthWorkTime()
  3732. },
  3733. handleClick(t,e){
  3734. if (t.name == "second") {
  3735. this.showMonthNotWorkTime()
  3736. }else if(t.name == "first"){
  3737. this.showMonthWorkTime()
  3738. }else if(t.name == "third"){
  3739. this.showMonthWorkTimeReminder()
  3740. }
  3741. },
  3742. //导出员工每日填报工时数
  3743. exportMembWorkHours() {
  3744. this.http.post(
  3745. "/report/exportUserDailyWorkTime",
  3746. {
  3747. // month: this.date,
  3748. startDate: this.WorktimeDatepickValue[0],
  3749. endDate: this.WorktimeDatepickValue[1],
  3750. },
  3751. (res) => {
  3752. if (res.code == "ok") {
  3753. let url = res.data;
  3754. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3755. }
  3756. },
  3757. (error) => {
  3758. this.$message({
  3759. message: error,
  3760. type: "error",
  3761. });
  3762. }
  3763. );
  3764. },
  3765. exportMembWorkHoursReminder() {
  3766. this.http.post(
  3767. "/report/exportUserDailyWorkTimeReminder",
  3768. {
  3769. // month: this.date,
  3770. startDate: this.WorktimeDatepickValue[0],
  3771. endDate: this.WorktimeDatepickValue[1],
  3772. },
  3773. (res) => {
  3774. if (res.code == "ok") {
  3775. let url = res.data;
  3776. this.downloadByA('工时异常表.xlsx', url);
  3777. }
  3778. },
  3779. (error) => {
  3780. this.$message({
  3781. message: error,
  3782. type: "error",
  3783. });
  3784. }
  3785. );
  3786. },
  3787. exportMembNotWorkHours() {
  3788. this.http.post(
  3789. "/report/exportNoReportUserList",
  3790. {
  3791. // month: this.date,
  3792. startDate: this.WorktimeDatepickValue[0],
  3793. endDate: this.WorktimeDatepickValue[1],
  3794. },
  3795. (res) => {
  3796. if (res.code == "ok") {
  3797. let url = res.data;
  3798. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3799. }
  3800. },
  3801. (error) => {
  3802. this.$message({
  3803. message: error,
  3804. type: "error",
  3805. });
  3806. }
  3807. );
  3808. },
  3809. downloadByA(name, url) {
  3810. const a = document.createElement("a"); // 创建a标签
  3811. a.setAttribute("download", name); // download属性
  3812. a.setAttribute("href", url); // href链接
  3813. a.click(); // 自执行点击事件
  3814. a.remove();
  3815. },
  3816. // 是否本月判断
  3817. istoMonth(){
  3818. let todate = new Date()
  3819. let tomonth = todate.getMonth() + 1
  3820. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3821. if(this.date == adate){
  3822. return []
  3823. }else{
  3824. let sedate = new Date(this.date)
  3825. let semonth = sedate.getMonth() + 1
  3826. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3827. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3828. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3829. return [sedates1, sedates2]
  3830. }
  3831. },
  3832. showMonthWorkTime() {
  3833. this.monthTotalPage = 0,
  3834. this.tbload = true
  3835. let parameter={
  3836. startDate: this.WorktimeDatepickValue[0],
  3837. endDate: this.WorktimeDatepickValue[1],
  3838. }
  3839. this.http.post(
  3840. "/report/getUserDailyWorkTime",
  3841. // "/report/getNoReportUserList",
  3842. parameter,
  3843. (res) => {
  3844. if (res.code == "ok") {
  3845. this.tbload = false;
  3846. this.pickDateArray = res.data.days;
  3847. // console.log('dataarray',res.data.days);
  3848. this.monthWorkData = res.data.list;
  3849. // this.monthWorkDataS = this.monthWorkData
  3850. // this.monthWorkDataS1 = res.data.list
  3851. this.monthTotal = res.data.list.length
  3852. if (this.monthWorkData.length > 50) {
  3853. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3854. }else{
  3855. this.monthWorkDataS = this.monthWorkData
  3856. }
  3857. this.searchScreen(0)
  3858. // this.monthWorkDataS = infoList
  3859. // 判断
  3860. // if (this.monthWorkDataS1.length > 0) {
  3861. // setTimeout(() => {
  3862. // this.tableListener()
  3863. // }, 1000);
  3864. // }
  3865. this.$nextTick(function(){
  3866. this.$refs.hasworkTbl.doLayout();
  3867. });
  3868. // this.$forceUpdate()
  3869. }
  3870. },
  3871. (error) => {
  3872. this.tbload = false
  3873. this.$message({
  3874. message: error,
  3875. type: "error",
  3876. });
  3877. }
  3878. );
  3879. },
  3880. showMonthWorkTimeReminder() {
  3881. this.monthTotalPage = 0,
  3882. this.tbload = true
  3883. let parameter={}
  3884. parameter={
  3885. startDate: this.WorktimeDatepickValue[0],
  3886. endDate: this.WorktimeDatepickValue[1],
  3887. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3888. viewValue:this.isReminder?1:0
  3889. }
  3890. this.http.post(
  3891. "/report/getUserDailyWorkTimeReminder",
  3892. parameter,
  3893. (res) => {
  3894. if (res.code == "ok") {
  3895. this.tbload = false;
  3896. this.monthWorkData = res.data.list;
  3897. this.monthTotal = res.data.list.length
  3898. if (this.monthWorkData.length > 50) {
  3899. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3900. }else{
  3901. this.monthWorkDataS = this.monthWorkData
  3902. }
  3903. this.searchScreen(0)
  3904. this.$nextTick(function(){
  3905. this.$refs.hasworkTbl.doLayout();
  3906. });
  3907. }
  3908. },
  3909. (error) => {
  3910. this.tbload = false
  3911. this.$message({
  3912. message: error,
  3913. type: "error",
  3914. });
  3915. }
  3916. );
  3917. },
  3918. // tableListener(){
  3919. // let that = this;
  3920. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3921. // // 添加scroll监听事件
  3922. // dom.addEventListener("scroll", function () {
  3923. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3924. // if (scrollDistance < 2) {
  3925. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3926. // that.monthTotalPage++; //当前页数自增
  3927. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3928. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3929. // var infoList = arrList.splice(
  3930. // that.monthTotalPage * that.monthTotalLages,
  3931. // that.monthTotalLages
  3932. // );
  3933. // // 数据添加
  3934. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3935. // }
  3936. // }
  3937. // })
  3938. // },
  3939. showMonthNotWorkTime() {
  3940. this.monthTotalPage = 0,
  3941. this.tbload = true,
  3942. this.http.post(
  3943. "/report/getNoReportUserList",
  3944. {
  3945. startDate: this.WorktimeDatepickValue[0],
  3946. endDate: this.WorktimeDatepickValue[1],
  3947. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3948. },
  3949. (res) => {
  3950. if (res.code == "ok") {
  3951. this.tbload = false
  3952. this.monthNotWorkDate = res.data;
  3953. // this.monthNotWorkDateS1 = res.data
  3954. this.monthnotTotal = res.data.length
  3955. // 2222111
  3956. if (this.monthNotWorkDate.length > 50) {
  3957. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3958. } else {
  3959. this.monthNotWorkDateS = this.monthNotWorkDate
  3960. }
  3961. this.searchScreen(1)
  3962. // 判断
  3963. // if (this.monthnotworkDateS1.length > 0) {
  3964. // setTimeout(() => {
  3965. // this.tableListenernot()
  3966. // }, 1000);
  3967. // }
  3968. this.$nextTick(function(){
  3969. this.$refs.hasworkTbl2.doLayout();
  3970. });
  3971. }
  3972. },
  3973. (error) => {
  3974. this.tbload = false
  3975. this.$message({
  3976. message: error,
  3977. type: "error",
  3978. });
  3979. }
  3980. );
  3981. },
  3982. // tableListenernot(){
  3983. // let that = this;
  3984. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3985. // dom.addEventListener("scroll", function () {
  3986. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3987. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3988. // if (scrollDistance2 < 2) {
  3989. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3990. // that.monthnotTotalPage++; //当前页数自增
  3991. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3992. // var infoList = arrList.splice(
  3993. // that.monthnotTotalPage * that.monthnotTotalLages,
  3994. // that.monthnotTotalLages
  3995. // );
  3996. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3997. // }
  3998. // }
  3999. // })
  4000. // },
  4001. listScroll(){
  4002. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4003. this.isMore = true
  4004. setTimeout(()=>{
  4005. this.isMore = false
  4006. },1000)
  4007. }else {
  4008. this.isFlag = true
  4009. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4010. this.monthWorkDataS = datalist
  4011. setTimeout(()=>{
  4012. this.isFlag = false
  4013. },300)
  4014. }
  4015. },
  4016. notListScroll(){
  4017. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4018. this.isMore = true
  4019. setTimeout(()=>{
  4020. this.isMore = false
  4021. },1000)
  4022. }else {
  4023. this.isFlag = true
  4024. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4025. this.monthNotWorkDateS = datalist
  4026. // console.log('length',this.monthNotWorkDateS.length)
  4027. setTimeout(()=>{
  4028. this.isFlag = false
  4029. },300)
  4030. }
  4031. },
  4032. getFirstAndLastDay() {
  4033. // 将选定的月份转换为Date对象
  4034. var monthDate = new Date();
  4035. var year = monthDate.getFullYear();
  4036. var month = monthDate.getMonth();
  4037. // 计算起始日和结束日
  4038. var startDay = new Date(year, month, 1);
  4039. var endDay = new Date(year, month + 1, 0);
  4040. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4041. this.WorktimeDatepickValueForMonth=lastmd
  4042. },
  4043. formatDate(date) {
  4044. var year = date.getFullYear();
  4045. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4046. var day = ("0" + date.getDate()).slice(-2);
  4047. return year + "-" + month + "-" + day;
  4048. },
  4049. // 获取默认这zhou日期参数 222
  4050. getLastWeek(e){
  4051. let newdate = new Date()
  4052. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4053. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4054. if(e==1){
  4055. this.WorktimeDatepickValue = lastwd
  4056. this.showMonthWorkTime()
  4057. }else if(e==2){
  4058. this.WorktimeDatepickValue = lastwd
  4059. this.showMonthWorkTimeReminder()
  4060. }else{
  4061. this.WorktimeDatepickValue = lastwd
  4062. this.showMonthNotWorkTime()
  4063. }
  4064. },
  4065. getThisWeek(e){
  4066. let newdate = new Date();
  4067. let nowdate = newdate.toLocaleDateString();
  4068. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4069. if(e==1){
  4070. this.WorktimeDatepickValue = nowwd
  4071. this.showMonthWorkTime()
  4072. }else if(e==2){
  4073. this.WorktimeDatepickValue = nowwd
  4074. this.showMonthWorkTimeReminder()
  4075. }else{
  4076. this.WorktimeDatepickValue = nowwd
  4077. this.showMonthNotWorkTime()
  4078. }
  4079. },
  4080. getDoubleLastWeek(e){
  4081. let newdate = new Date()
  4082. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4083. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4084. if(e==1){
  4085. this.WorktimeDatepickValue = nextwd
  4086. this.showMonthWorkTime()
  4087. }else if(e==2){
  4088. this.WorktimeDatepickValue = nextwd
  4089. this.showMonthWorkTimeReminder()
  4090. }else{
  4091. this.WorktimeDatepickValue = nextwd
  4092. this.showMonthNotWorkTime()
  4093. }
  4094. },
  4095. alreadyAllDate(stime,etime){
  4096. let diffdate = new Array();
  4097. let i=0;
  4098. while(stime<=etime){
  4099. let dateArray = stime.split("-");
  4100. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4101. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4102. let stimewk = this.weekDay[date.getDay()]
  4103. 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')
  4104. 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])
  4105. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4106. let stime_ts = new Date(stime).getTime();
  4107. let next_date = stime_ts + (24*60*60*1000);
  4108. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4109. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4110. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4111. stime = next_dates_y+next_dates_m+next_dates_d;
  4112. i++;
  4113. }
  4114. return diffdate
  4115. },
  4116. getAutoWeekDate(e) {
  4117. let dateString = e;
  4118. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4119. if (dateString.match(dateStringReg)) {
  4120. let presentDate = new Date(dateString),
  4121. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4122. return Array.from(new Array(7), function (val, index) {
  4123. let formatDate = new Date(
  4124. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4125. );
  4126. return (
  4127. formatDate.getFullYear() +
  4128. "-" +
  4129. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4130. "-" +
  4131. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4132. );
  4133. });
  4134. } else {
  4135. throw new Error(
  4136. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4137. );
  4138. }
  4139. },
  4140. onProgressChange() {
  4141. this.$forceUpdate();
  4142. },
  4143. showChooseMembTree() {
  4144. this.chosenMembCount = this.participator.length;
  4145. this.chooseParticipVisible = true;
  4146. },
  4147. onTreeItemChange() {
  4148. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4149. var list = chosenList.filter(item=>item.isUser == 1);
  4150. this.chosenMembCount = list.length;
  4151. },
  4152. findUserInTree() {
  4153. if (this.filterName == '') {
  4154. this.deptMembData = this.allMembData;
  4155. } else {
  4156. var list = this.findRecursively(this.filterName, this.allMembData);
  4157. this.deptMembData = list;
  4158. }
  4159. },
  4160. findRecursively(username, list) {
  4161. var filterList = [];
  4162. for (var i=0;i<list.length; i++) {
  4163. if (list[i].isUser == 1) {
  4164. if (list[i].label.indexOf(username) >= 0) {
  4165. //匹配上了
  4166. filterList.push(list[i]);
  4167. }
  4168. } else if (list[i].children != null && list[i].children.length > 0) {
  4169. var subList = this.findRecursively(username, list[i].children);
  4170. if (subList.length > 0) {
  4171. subList.forEach(s=>filterList.push(s));
  4172. }
  4173. }
  4174. }
  4175. return filterList;
  4176. },
  4177. //确定选择参与人
  4178. chooseParticip() {
  4179. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4180. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4181. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4182. if (this.user.company.packageProject == 1) {
  4183. if (this.chosenMembList.length > 1) {
  4184. this.$message({
  4185. message: '每次仅支持代填一个人',
  4186. type: "error",
  4187. });
  4188. return;
  4189. }
  4190. }
  4191. this.chooseParticipVisible = false;
  4192. this.workForm.userNames = '';
  4193. this.workForm.userId = [];
  4194. this.participator = [];
  4195. for (var i=0;i<this.chosenMembList.length; i++) {
  4196. this.workForm.userId.push(this.chosenMembList[i].id);
  4197. this.workForm.userNames += this.chosenMembList[i].label+',';
  4198. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4199. this.participator.push(item);
  4200. }
  4201. if (this.workForm.userNames.length > 0) {
  4202. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4203. }
  4204. if(this.user.userNameNeedTranslate == 1) {
  4205. if(this.workForm.userNames) {
  4206. this.workForm.userNames = this.workForm.userNames.split(',')
  4207. }
  4208. }
  4209. },
  4210. notifySel(sel){
  4211. // console.log(sel);
  4212. this.notifySelList = sel
  4213. },
  4214. //微信通知人员填写
  4215. Notify(code) {
  4216. if (this.notifySelList.length == 0) return;
  4217. var ids = '';
  4218. this.notifySelList.forEach(f=>{
  4219. ids += f.id+',';
  4220. })
  4221. this.http.post('/user/pushFillReport',{
  4222. ids: ids, date: this.curDate,
  4223. code: code
  4224. },
  4225. res => {
  4226. if (res.code == "ok") {
  4227. this.$message({
  4228. message: this.$t('message.sentSuccessfully'),
  4229. type: "success"
  4230. });
  4231. }
  4232. },
  4233. error => {
  4234. this.$message({
  4235. message: error,
  4236. type: "error"
  4237. });
  4238. }
  4239. );
  4240. },
  4241. //导出人员列表
  4242. exportMemb() {
  4243. if (this.fillMembList.length == 0) return;
  4244. var ids = '';
  4245. this.fillMembList.forEach(f=>{
  4246. ids += f.id+',';
  4247. })
  4248. this.http.post('/user/exportMembList',{
  4249. ids: ids,isFill: this.isFill, date: this.curDate
  4250. },
  4251. res => {
  4252. if (res.code == "ok") {
  4253. var aTag = document.createElement('a');
  4254. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4255. aTag.href = res.data;
  4256. aTag.click();
  4257. }
  4258. },
  4259. error => {
  4260. this.$message({
  4261. message: error,
  4262. type: "error"
  4263. });
  4264. }
  4265. );
  4266. },
  4267. showMembList(fill) {
  4268. this.membListVisible = true;
  4269. if (fill == 0) {
  4270. this.fillMembList = this.unFillList;
  4271. this.isFill = false;
  4272. let leaveList = []
  4273. let unleaveList = []
  4274. for(let i in this.fillMembList){
  4275. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4276. leaveList.push(this.fillMembList[i])
  4277. }else{
  4278. unleaveList.push(this.fillMembList[i])
  4279. }
  4280. }
  4281. this.fillMembList = unleaveList
  4282. this.fillMembList_leave = leaveList
  4283. } else if(fill == 1){
  4284. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4285. this.isFill = true;
  4286. }else{
  4287. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4288. this.isFill = true;
  4289. }
  4290. },
  4291. //获取自己填写的日报状态
  4292. getReportFillStatus() {
  4293. this.http.post('/report/getReportFillStatus',{
  4294. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4295. },
  4296. res => {
  4297. if (res.code == "ok") {
  4298. this.fillStatusList = res.data;
  4299. this.allDate.forEach(d=>{
  4300. var fillInfo = null;
  4301. d.state = null;
  4302. this.fillStatusList.forEach(s=>{
  4303. var d1 = s.createDate.split('-')[2];
  4304. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4305. if (d1.indexOf('0') == 0) {
  4306. d1 = d1.substring(1,d1.length);
  4307. }
  4308. if (d1 == d2) {
  4309. d.state = s.state;
  4310. d.exceedCardTime = s.exceedCardTime
  4311. }
  4312. })
  4313. })
  4314. this.$forceUpdate();
  4315. }
  4316. },
  4317. error => {
  4318. this.$message({
  4319. message: error,
  4320. type: "error"
  4321. });
  4322. }
  4323. );
  4324. },
  4325. scrollFunction () {
  4326. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4327. if (this.domObj.attachEvent) { // IE
  4328. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4329. } else if (this.domObj.addEventListener) {
  4330. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4331. }
  4332. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4333. },
  4334. mouseScroll(event) { // google 浏览器下
  4335. let detail = event.wheelDelta || event.detail
  4336. let moveForwardStep = -1
  4337. let moveBackStep = 1
  4338. let step = 0
  4339. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4340. event.preventDefault() // 阻止浏览器默认事件
  4341. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4342. },
  4343. // //左右滚动
  4344. // wheel(e){
  4345. // var a = document.getElementById("dateScroll");
  4346. // var scroll_width = 80; //滚动一下的距离
  4347. // var e = e || window.event, v;
  4348. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4349. // if(v>3||-v>3) v=-v;
  4350. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4351. // e.preventDefault(); //阻止浏览器的默认滚动
  4352. // },
  4353. showExportDialog() {
  4354. this.exportType = 0
  4355. this.exportDialog = true;
  4356. },
  4357. showExportTimeDialog() {
  4358. this.exportTimeDialog = true;
  4359. },
  4360. changeAllTime() {
  4361. //总时长发生改变,自动按比例计算
  4362. this.workForm.domains.forEach(d=>{
  4363. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4364. });
  4365. //计算jsTime
  4366. if (this.workForm.createDate) {
  4367. let sdate = new Date(this.workForm.createDate[0]);
  4368. let edate = new Date(this.workForm.createDate[1]);
  4369. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4370. console.log('days===', days)
  4371. if (days < 0) {
  4372. days = 0;
  4373. }
  4374. this.jsTime = this.reportTimeType.allday * days;
  4375. }
  4376. },
  4377. // 是否加班的单机事件
  4378. check() {
  4379. this.selected = !this.selected
  4380. this.isNew = this.selected
  4381. },
  4382. updateSubProject() {
  4383. this.$forceUpdate();
  4384. },
  4385. selectDegreeId(domain, index) {
  4386. this.http.post('/report/defaultDegree',{
  4387. projectId: domain.projectId
  4388. },
  4389. res => {
  4390. if (res.code == "ok") {
  4391. if(res.data) {
  4392. this.workForm.domains[index].degreeId = res.data.id + ''
  4393. this.$forceUpdate();
  4394. }
  4395. }
  4396. },
  4397. error => {
  4398. this.$message({
  4399. message: error,
  4400. type: "error"
  4401. });
  4402. }
  4403. );
  4404. },
  4405. //项目选中了, 加载子项目
  4406. selectProject(domain, index) {
  4407. if(!domain.projectId){
  4408. return;
  4409. }
  4410. // 默认选中上次填写的自定义维度
  4411. if(this.yonghuUser.customDegreeActive == 1) {
  4412. this.selectDegreeId(domain, index)
  4413. }
  4414. // console.log('projectId===',domain.projectId);
  4415. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4416. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4417. this.http.post('/sub-project/list',{
  4418. projectId: domain.projectId,
  4419. isReport: true
  4420. },
  4421. res => {
  4422. //清空之前选中的子项目
  4423. // this.workForm.domains[index].subProjectId = 0;
  4424. if (res.code == "ok") {
  4425. this.workForm.domains[index].subProjectList = res.data;
  4426. this.workForm.domains[index].subProjectId = null;
  4427. this.$forceUpdate();
  4428. }
  4429. },
  4430. error => {
  4431. this.$message({
  4432. message: error,
  4433. type: "error"
  4434. });
  4435. }
  4436. );
  4437. //项目相关的近期任务
  4438. if (this.user.company.packageProject == 1) {
  4439. this.getRecentTaskList(domain, index);
  4440. //获取项目相关专业
  4441. if (this.user.company.packageEngineering == 1) {
  4442. this.getProjectProfessions(domain, index);
  4443. }
  4444. //获取项目下的任务分组
  4445. this.getTaskGroups(domain, index);
  4446. }
  4447. // 获取项目相关的维度
  4448. // domain.degreeId = null
  4449. this.$set(domain,'degreeId',null)
  4450. this.$set(domain,'multiDegrIdArray',null)
  4451. this.dimension(domain, index);
  4452. //获取项目审核人
  4453. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4454. this.getProjectAuditorList(domain, index);
  4455. } else {
  4456. //按分组的负责人来审核
  4457. domain.projectAuditorId = null;
  4458. domain.projectAuditorName = null;
  4459. domain.auditUserList = null;
  4460. }
  4461. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4462. if (this.reportTimeType.type == 3) {
  4463. //新增项目时,自动计算
  4464. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4465. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4466. }
  4467. //加载昱众的工作职责
  4468. if (this.user.companyId == this.yuzhongCompId) {
  4469. this.updateResponse(domain);
  4470. }
  4471. },
  4472. getRecentTaskList(domain, index) {
  4473. //刷新任务时,清空服务
  4474. this.$set(domain, 'sapServiceId', null);
  4475. this.$set(domain, 'taskId', null);
  4476. var param = {
  4477. projectId: domain.projectId,
  4478. isSubstitude:this.isSubstitude?1:0,
  4479. };
  4480. if (domain.groupId) {
  4481. param.groupId = domain.groupId;
  4482. }
  4483. if (domain.stage) {
  4484. param.stage = domain.stage;
  4485. }
  4486. //专业版代填,获取代填员工的任务
  4487. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4488. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4489. this.$message({
  4490. message: '请选择代填的员工',
  4491. type: "error"
  4492. });
  4493. return;
  4494. } else {
  4495. param.userId = this.workForm.userId[0];
  4496. }
  4497. }
  4498. this.http.post('/task/getRecentTask',param,
  4499. res => {
  4500. if (res.code == "ok") {
  4501. this.workForm.domains[index].allTaskList = res.data;
  4502. this.workForm.domains[index].taskList = res.data;
  4503. this.$forceUpdate();
  4504. }
  4505. },
  4506. error => {
  4507. this.$message({
  4508. message: error,
  4509. type: "error"
  4510. });
  4511. }
  4512. );
  4513. },
  4514. //获取项目审核人
  4515. getProjectAuditorList(domainItem, index) {
  4516. if(domainItem.projectId == '') {
  4517. return
  4518. }
  4519. domainItem.projectAuditorId = null;
  4520. domainItem.projectAuditorName = null;
  4521. this.http.post('/project-auditor/getList',{
  4522. projectId: domainItem.projectId,
  4523. },
  4524. res => {
  4525. if (res.code == "ok") {
  4526. domainItem.auditUserList = res.data;
  4527. if (res.data.length==0) {
  4528. this.$message({
  4529. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4530. type: "error"
  4531. });
  4532. } else if (res.data.length==1) {
  4533. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4534. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4535. }
  4536. this.$forceUpdate();
  4537. }
  4538. },
  4539. error => {
  4540. this.$message({
  4541. message: error,
  4542. type: "error"
  4543. });
  4544. }
  4545. );
  4546. },
  4547. // 获取维度数据
  4548. dimension(domain, index) {
  4549. if(domain.projectId == '') {
  4550. return
  4551. }
  4552. this.http.post('/project/getDegreeList',{
  4553. projectId: domain.projectId,
  4554. },
  4555. res => {
  4556. if (res.code == "ok") {
  4557. // console.log("维度数据",res.data);
  4558. this.workForm.domains[index].wuduList = res.data
  4559. // this.workForm = this.workForm
  4560. this.$forceUpdate()
  4561. }
  4562. },
  4563. error => {
  4564. this.$message({
  4565. message: error,
  4566. type: "error"
  4567. });
  4568. }
  4569. );
  4570. },
  4571. //切换任务阶段
  4572. changeStages(domain, index) {
  4573. if (domain.stage == null || domain.stage == '') {
  4574. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4575. } else {
  4576. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4577. }
  4578. this.getRecentTaskList(domain, index);
  4579. this.$forceUpdate();
  4580. },
  4581. getGroupStages(domain, index, keepStage) {
  4582. // console.log(domain);
  4583. if(!domain.groupId){
  4584. domain.projectAuditorId = ''
  4585. domain.stages = []
  4586. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4587. domain.taskId = ''
  4588. domain.sapServiceId = ''
  4589. }
  4590. if(this.user.timeType.reportAuditType >= 1){
  4591. domain.auditUserList = []
  4592. }
  4593. this.$forceUpdate();
  4594. return
  4595. }
  4596. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4597. res => {
  4598. if (res.code == "ok") {
  4599. if (!keepStage) {
  4600. domain.stage = '';
  4601. }
  4602. domain.stages = res.data;
  4603. this.getRecentTaskList(domain, index);
  4604. this.$forceUpdate();
  4605. }
  4606. },
  4607. error => {
  4608. this.$message({
  4609. message: error,
  4610. type: "error"
  4611. });
  4612. });
  4613. //检查当前的项目是否需要获取分组的负责人
  4614. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4615. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4616. res => {
  4617. if (res.code == "ok") {
  4618. domain.getProjectAuditorList = res.data;
  4619. domain.auditUserList = res.data;
  4620. if (res.data.length==1) {
  4621. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4622. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4623. } else if (res.data.length==0) {
  4624. domain.projectAuditorId = null;
  4625. domain.projectAuditorName = null;
  4626. }
  4627. this.$forceUpdate();
  4628. }
  4629. },
  4630. error => {
  4631. this.$message({
  4632. message: error,
  4633. type: "error"
  4634. });
  4635. });
  4636. }
  4637. },
  4638. getProjectProfessions(domain, index) {
  4639. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4640. res => {
  4641. if (res.code == "ok") {
  4642. this.workForm.domains[index].professionProgress = res.data;
  4643. this.$forceUpdate();
  4644. }
  4645. },
  4646. error => {
  4647. this.$message({
  4648. message: error,
  4649. type: "error"
  4650. });
  4651. });
  4652. },
  4653. //删除自己的日报
  4654. deleteReport() {
  4655. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4656. confirmButtonText: this.$t('btn.determine'),
  4657. cancelButtonText: this.$t('btn.cancel'),
  4658. type: "warning"
  4659. })
  4660. .then(() => {
  4661. this.listLoading = true;
  4662. this.http.post('/report/delete',{
  4663. userId: this.user.id,
  4664. date: this.workForm.createDate
  4665. },
  4666. res => {
  4667. this.listLoading = false;
  4668. if (res.code == "ok") {
  4669. this.$message({
  4670. message: this.$t('message.successfullyDeleted'),
  4671. type: "success"
  4672. });
  4673. this.getReportList();
  4674. this.getDepartment();
  4675. this.dialogVisible = false;
  4676. } else {
  4677. this.$message({
  4678. message: res.msg,
  4679. type: "error"
  4680. });
  4681. }
  4682. },
  4683. error => {
  4684. this.listLoading = false;
  4685. this.$message({
  4686. message: error,
  4687. type: "error"
  4688. });
  4689. }
  4690. );
  4691. })
  4692. .catch(() => {});
  4693. },
  4694. // 管理员删除日报
  4695. guanli(item) {
  4696. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4697. let param = {date: this.date + day, userId: item.id};
  4698. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4699. confirmButtonText: this.$t('btn.determine'),
  4700. cancelButtonText: this.$t('btn.cancel'),
  4701. type: "warning"
  4702. })
  4703. .then(() => {
  4704. this.listLoading = true;
  4705. this.http.post('/report/delete',param,
  4706. res => {
  4707. this.listLoading = false;
  4708. if (res.code == "ok") {
  4709. this.$message({
  4710. message: this.$t('message.successfullyDeleted'),
  4711. type: "success"
  4712. });
  4713. this.getReportList();
  4714. this.getDepartment();
  4715. this.dialogVisible = false;
  4716. } else {
  4717. this.$message({
  4718. message: res.msg,
  4719. type: "error"
  4720. });
  4721. }
  4722. },
  4723. error => {
  4724. this.listLoading = false;
  4725. this.$message({
  4726. message: error,
  4727. type: "error"
  4728. });
  4729. }
  4730. );
  4731. })
  4732. .catch(() => {});
  4733. },
  4734. selectAll() {
  4735. if (this.isAllSelect) {
  4736. var keys = [];
  4737. this.reportNames.forEach(b=>{
  4738. keys.push(b.id);
  4739. })
  4740. this.$refs.approveTree.setCheckedKeys(keys);
  4741. } else {
  4742. this.$refs.approveTree.setCheckedKeys([]);
  4743. }
  4744. },
  4745. removeEmptyNode(list) {
  4746. for (var i=0;i<list.length;i++) {
  4747. var cnt = 0;
  4748. if (list[i].membCount == 0) {
  4749. list.splice(i, 1);
  4750. i--;
  4751. } else if (list[i].children != null) {
  4752. this.removeEmptyNode(list[i].children);
  4753. }
  4754. }
  4755. },
  4756. calculateMembCount(list) {
  4757. for (var i in list) {
  4758. var cnt = 0;
  4759. if (list[i].children != null) {
  4760. this.calculateMembCount(list[i].children);
  4761. for (var m in list[i].children) {
  4762. cnt += list[i].children[m].membCount;
  4763. }
  4764. }
  4765. if (list[i].isUser == 1) {
  4766. cnt++;
  4767. this.membCount++;
  4768. }
  4769. list[i].membCount = cnt;
  4770. }
  4771. },
  4772. stateChange() {
  4773. // console.log(this.allData,'alldate');
  4774. this.membCount = 0;
  4775. if (this.selectState == -1) {
  4776. //全部状态
  4777. this.data = this.allData;
  4778. } else {
  4779. //未填报
  4780. this.seluserText = ''
  4781. var newData = JSON.parse(JSON.stringify(this.allData));
  4782. this.filterState(this.selectState, newData);
  4783. this.data = newData;
  4784. }
  4785. this.calculateMembCount(this.data);
  4786. this.data[0].membCount = this.membCount;//总人数
  4787. },
  4788. //按状态过滤部门人员
  4789. filterState(state, list) {
  4790. for (var i =0;i<list.length; i++) {
  4791. var obj = list[i];
  4792. if (obj.isUser == 1) {
  4793. var match = false;
  4794. if (state == -2) {
  4795. if (obj.state == null) {
  4796. match = true;
  4797. }
  4798. } else {
  4799. if (obj.state == state) {
  4800. match = true;
  4801. }
  4802. }
  4803. if (!match) {
  4804. list.splice(i, 1);
  4805. i--;
  4806. } else {
  4807. }
  4808. } else {
  4809. if (obj.children != null) {
  4810. this.filterState(state, obj.children);
  4811. }
  4812. }
  4813. }
  4814. },
  4815. //a按名称过滤部门人员
  4816. async seluserforText(){
  4817. const { userNameNeedTranslate } = this.user
  4818. this.membCount = 0;
  4819. var newData = JSON.parse(JSON.stringify(this.allData));
  4820. let textList = [this.seluserText]
  4821. if(userNameNeedTranslate == 1) {
  4822. this.dataLoading = true
  4823. let res = await this.postData('/user/getEmployeeList', {
  4824. keyword: this.seluserText,
  4825. cursor: '',
  4826. departmentId: -1,
  4827. pageIndex: 1,
  4828. pageSize: 1000
  4829. })
  4830. textList = res.data.records.map(item => item.name)
  4831. this.dataLoading = false
  4832. }
  4833. // return
  4834. console.log(textList, '<=== textList')
  4835. this.seluserforTextin(this.seluserText, newData, textList)
  4836. console.log(newData, 'Data')
  4837. this.data = newData;
  4838. this.calculateMembCount(this.data);
  4839. this.data[0].membCount = this.membCount;//总人数
  4840. },
  4841. seluserforTextin(text, list, textList = []){
  4842. for (var i =0;i<list.length; i++) {
  4843. var obj = list[i];
  4844. if (obj.isUser == 1) {
  4845. var match = false;
  4846. // if (obj.label.indexOf(text) != -1) {
  4847. // match = true
  4848. // }
  4849. if(textList.some(item => item.includes(obj.label))) {
  4850. match = true
  4851. }
  4852. if (!match) {
  4853. list.splice(i, 1);
  4854. i--;
  4855. } else {
  4856. }
  4857. } else {
  4858. if (obj.children != null) {
  4859. this.seluserforTextin(text, obj.children, textList);
  4860. }
  4861. }
  4862. }
  4863. },
  4864. // 当节点发生变化时
  4865. nodeChangeExpand(data) {
  4866. // 保存当前展开的节点
  4867. let flag = false
  4868. this.nodeModelData.some(item => {
  4869. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4870. flag = true
  4871. return true
  4872. }
  4873. })
  4874. if (!flag) { // 不存在则存到数组里
  4875. this.nodeModelData.push(data.id)
  4876. }
  4877. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4878. },
  4879. nodeChangeCollapse(data) {
  4880. console.log(this.nodeModelData)
  4881. this.nodeModelData.some((item, i) => {
  4882. if (item === data.id) {
  4883. this.nodeModelData.length = i
  4884. }
  4885. })
  4886. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4887. },
  4888. // 部门列表点击
  4889. handleNodeClick(data) {
  4890. // this.dealList = data
  4891. this.theValues(data.id, this.allData)
  4892. // this.depData = data;
  4893. var list = [];
  4894. if (data.id == -1) {
  4895. this.deptId = null;
  4896. this.targetUid = null;
  4897. list = this.data;
  4898. } else if (data.isUser == 1) {
  4899. this.deptId = null;
  4900. this.targetUid = data.id;
  4901. } else {
  4902. this.deptId = data.id;
  4903. this.targetUid = null;
  4904. list.push(data);
  4905. }
  4906. this.getReportList();
  4907. if (list.length > 0) {
  4908. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4909. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4910. }
  4911. },
  4912. exportPushLog(){
  4913. this.http.post('/sap-sync-log/export',{},
  4914. res => {
  4915. if (res.code == "ok") {
  4916. var filePath = res.data;
  4917. var fName = '推送日志.xlsx'
  4918. const a = document.createElement('a'); // 创建a标签
  4919. a.setAttribute('download', fName);// download属性
  4920. a.setAttribute('href', filePath);// href链接
  4921. a.click(); //自执行点击事件
  4922. a.remove();
  4923. } else {
  4924. this.$message({
  4925. message: res.msg,
  4926. type: "error"
  4927. });
  4928. }
  4929. },
  4930. error => {
  4931. this.$message({
  4932. message: error,
  4933. type: "error"
  4934. });
  4935. });
  4936. },
  4937. theValues(id, item) {
  4938. for(var i in item) {
  4939. if(item[i].id == id) {
  4940. this.depData = item[i]
  4941. if(id == '-1') {
  4942. this.translation = '1'
  4943. } else {
  4944. if(item[i].children) {
  4945. this.translation = '2'
  4946. } else {
  4947. this.translation = '3'
  4948. }
  4949. }
  4950. return
  4951. } else {
  4952. if(item[i].children) {
  4953. this.theValues(id, item[i].children)
  4954. }
  4955. }
  4956. }
  4957. },
  4958. //获取可以选择的代填的人员列表
  4959. getSubstitudeUserDeptList() {
  4960. if (this.deptMembData.length == 0) {
  4961. this.http.post("/department/listMyMembs", {},
  4962. res => {
  4963. if (res.code == "ok") {
  4964. let noAllData = JSON.parse(JSON.stringify(res.data));
  4965. if (noAllData.length > 0) {
  4966. // if (noAllData[0].label == '全部人员') {
  4967. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4968. noAllData.splice(0,1);
  4969. }
  4970. }
  4971. this.setUserToDept(noAllData);
  4972. this.deptMembData = noAllData;
  4973. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4974. console.log(this.deptMembData, '代填人员数据')
  4975. } else {
  4976. this.$message({
  4977. message: res.msg,
  4978. type: "error"
  4979. });
  4980. }
  4981. },
  4982. error => {
  4983. this.$message({
  4984. message: error,
  4985. type: "error"
  4986. });
  4987. });
  4988. }
  4989. },
  4990. // 获取部门列表
  4991. getDepartmentForApprove() {
  4992. this.http.post( this.port.manage.depList, {},
  4993. res => {
  4994. if (res.code == "ok") {
  4995. var list1 = JSON.parse(JSON.stringify(res.data));
  4996. this.deptOptionList = this.changeArr(list1);
  4997. console.log(this.deptOptionList, '部门')
  4998. } else {
  4999. this.$message({
  5000. message: res.msg,
  5001. type: "error"
  5002. });
  5003. }
  5004. },
  5005. error => {
  5006. this.$message({
  5007. message: error,
  5008. type: "error"
  5009. });
  5010. });
  5011. },
  5012. // 获取部门列表
  5013. getDepartment() {
  5014. //如果没有权限,就不需要获取
  5015. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5016. return;
  5017. }
  5018. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5019. var param = {date:this.date + day};
  5020. this.http.post("/report/getMembList", param,
  5021. res => {
  5022. if (res.code == "ok") {
  5023. if(res.data.length == 0){
  5024. return
  5025. }
  5026. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5027. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5028. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5029. // if (this.user.role > 0) {
  5030. // }
  5031. list.splice(0,0,{
  5032. id: -1,
  5033. label: this.$t('lable.allStaff'),
  5034. })
  5035. this.membCount = 0;
  5036. //设置员工到部门下面
  5037. this.setUserToDept(list);
  5038. this.data = list;
  5039. // console.log('data',this.data);
  5040. this.expandDate = [this.data[1].id]
  5041. this.allData = list;
  5042. // if (noAllData.length > 0) {
  5043. // if (noAllData[0].label == '全部人员') {
  5044. // noAllData.splice(0,1);
  5045. // }
  5046. // }
  5047. // this.setUserToDept(noAllData);
  5048. // this.deptMembData = noAllData;
  5049. this.option = this.changeArr(list1);
  5050. list[0].membCount = this.membCount;
  5051. if (this.depData.id == -1) {
  5052. this.depData.membCount = this.membCount;
  5053. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5054. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5055. } else {
  5056. if (this.depData.isUser == null) {
  5057. var dep = this.findTargetDept(this.data, this.depData.id);
  5058. var membDeptList = [];
  5059. membDeptList.push(dep);
  5060. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5061. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5062. }
  5063. }
  5064. if (this.depData.isUser == null) {
  5065. if (this.isFill) {
  5066. this.fillMembList = this.fillList;
  5067. } else {
  5068. this.fillMembList = this.unFillList;
  5069. }
  5070. }
  5071. this.leaveAllNum = 0
  5072. for(let i in this.unFillList){
  5073. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5074. this.leaveAllNum += 1
  5075. }
  5076. }
  5077. this.stateChange()
  5078. } else {
  5079. this.$message({
  5080. message: res.msg,
  5081. type: "error"
  5082. });
  5083. }
  5084. },
  5085. error => {
  5086. this.$message({
  5087. message: error,
  5088. type: "error"
  5089. });
  5090. });
  5091. this.getReportFillStatus();
  5092. },
  5093. findTargetDept(list, deptId) {
  5094. var t = null;
  5095. for (var i=0;i<list.length; i++) {
  5096. if (list[i].isUser == null && list[i].id == deptId) {
  5097. t = list[i];
  5098. break;
  5099. }
  5100. }
  5101. if (t == null) {
  5102. for (var i=0;i<list.length; i++) {
  5103. if (list[i].children != null && list[i].children.length > 0) {
  5104. t = this.findTargetDept(list[i].children, deptId);
  5105. if (t != null) {
  5106. break;
  5107. }
  5108. }
  5109. }
  5110. }
  5111. return t;
  5112. },
  5113. getUserMembListFromDeptList(list, isFill) {
  5114. var membList = [];
  5115. for (var i in list) {
  5116. var deptName = list[i].label;
  5117. if (list[i].userList != null) {
  5118. list[i].userList.forEach(element => {
  5119. if (isFill == 0) {
  5120. //获取未填的
  5121. if (element.state == null) {
  5122. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5123. membList.push(obj);
  5124. }
  5125. } else {
  5126. if (element.state != null) {
  5127. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5128. membList.push(obj);
  5129. }
  5130. }
  5131. });
  5132. }
  5133. if (list[i].children != null) {
  5134. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5135. }
  5136. }
  5137. return membList;
  5138. },
  5139. setUserToDept(list) {
  5140. for (var i in list) {
  5141. var cnt = 0;
  5142. if (list[i].children != null) {
  5143. this.setUserToDept(list[i].children);
  5144. for (var m in list[i].children) {
  5145. cnt += list[i].children[m].membCount;
  5146. }
  5147. }
  5148. if (list[i].userList != null) {
  5149. if (list[i].children == null) {
  5150. list[i].children = [];
  5151. }
  5152. list[i].userList.forEach(element => {
  5153. var obj = {
  5154. id: element.id,
  5155. label:element.name,
  5156. state:element.state,
  5157. parentId:element.departmentId,
  5158. isUser:1,
  5159. workingTime: element.workingTime,
  5160. leaveDays: element.leaveDays,
  5161. leaveTimes: element.leaveTimes
  5162. };
  5163. list[i].children.push(obj);
  5164. this.membCount++;
  5165. cnt++;
  5166. });
  5167. }
  5168. list[i].membCount = cnt;
  5169. }
  5170. },
  5171. // 修改数组
  5172. changeArr(arr) {
  5173. for (var i = 0; i < arr.length; i++) {
  5174. if(arr[i].id != -1 && arr[i].id != 0) {
  5175. if (arr[i].children != null && arr[i].children.length>0) {
  5176. arr[i].children = this.changeArr(arr[i].children);
  5177. }
  5178. arr[i].id && (arr[i].value = arr[i].id);
  5179. delete arr[i].id;
  5180. }
  5181. }
  5182. for(var i in arr) {
  5183. if(arr[i].id == -1 || arr[i].id == 0) {
  5184. arr.splice(i,1)
  5185. }
  5186. }
  5187. return arr;
  5188. },
  5189. //时间段范围设置改动,监听
  5190. onTimeTypeChange(timeType) {
  5191. this.seleChn(1)
  5192. this.showAddMore = true;
  5193. for(var i in this.workForm.domains) {
  5194. if (this.workForm.domains[i].timeType == 0) {
  5195. this.showAddMore = false;
  5196. break;
  5197. }
  5198. }
  5199. if (this.showAddMore) {
  5200. //检测数量
  5201. if (this.workForm.domains.length == 2) {
  5202. this.showAddMore = false;
  5203. } else {
  5204. this.showAddMore = true;
  5205. }
  5206. }
  5207. },
  5208. getTimeType() {
  5209. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5210. res => {
  5211. if (res.code == "ok") {
  5212. var t = res.data;
  5213. this.reportTimeType = t;
  5214. if (this.reportTimeType.type > 0) {
  5215. this.showAddMore = true;
  5216. }
  5217. //转化时间格式
  5218. if (t.allday != null) {
  5219. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5220. }
  5221. if (t.am != null) {
  5222. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5223. }
  5224. if (t.pm != null) {
  5225. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5226. }
  5227. let arr = []
  5228. for(var i in res.data.excludeTimeList) {
  5229. let obj = {
  5230. s: res.data.excludeTimeList[i].startTime,
  5231. e: res.data.excludeTimeList[i].endTime,
  5232. }
  5233. arr.push(obj)
  5234. }
  5235. this.vacationTime = arr
  5236. } else {
  5237. this.$message({
  5238. message: res.msg,
  5239. type: "error"
  5240. });
  5241. }
  5242. },
  5243. error => {
  5244. this.listLoading = false;
  5245. this.$message({
  5246. message: error,
  5247. type: "error"
  5248. });
  5249. });
  5250. },
  5251. // 改变月份 -------
  5252. changeMonthOut() {
  5253. this.getAllDate();
  5254. this.getReportList();
  5255. this.getDepartment();
  5256. },
  5257. // 选择日期
  5258. choseDate(i, item) {
  5259. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5260. return
  5261. }
  5262. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5263. this.choseDay = i;
  5264. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5265. sessionStorage.msg = this.date + day,
  5266. this.getReportList();
  5267. this.getDepartment();
  5268. this.curDate = item.date;
  5269. },
  5270. canClick(i, item){
  5271. let nowDate = new Date()
  5272. let nowDateYear = nowDate.getFullYear()
  5273. let itemYear = parseInt(this.date.split('-')[0])
  5274. let nowDateMonth = nowDate.getMonth() + 1
  5275. let itemMonth = parseInt(this.date.split('-')[1])
  5276. let nowDateDay = nowDate.getDate()
  5277. let itemDay = parseInt(item.showDate.split('.')[1])
  5278. if(nowDateYear < itemYear){
  5279. return false
  5280. }else if(nowDateYear == itemYear){
  5281. if(nowDateMonth < itemMonth){
  5282. return false
  5283. }else if(nowDateMonth == itemMonth){
  5284. if(nowDateDay < itemDay){
  5285. return false
  5286. }
  5287. }
  5288. }
  5289. },
  5290. // 获取日期列表
  5291. getAllDate(e) {
  5292. var dayArry = [];
  5293. var day = this.getCountDays();
  5294. let curMonthDay = null;
  5295. for (var k = 1; k <= day; k++) {
  5296. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5297. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5298. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5299. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5300. if(sessionStorage.msg) {
  5301. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5302. this.choseDay = k - 1;
  5303. curMonthDay = str;
  5304. }
  5305. } else {
  5306. if (new Date().getDate() == k) {
  5307. this.choseDay = k - 1;
  5308. }
  5309. }
  5310. } else {
  5311. this.choseDay = 0;
  5312. }
  5313. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5314. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5315. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5316. }
  5317. this.allDate = dayArry;
  5318. //不能超过最大日期
  5319. if (this.choseDay > day-1) {
  5320. this.choseDay = day-1;
  5321. }
  5322. if(sessionStorage.from != 1){
  5323. let nowmonth = new Date().getMonth() + 1
  5324. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5325. let nowdate = new Date().getDate()
  5326. if(nowd == this.date){
  5327. if(e && sessionStorage.msg){
  5328. }else{
  5329. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5330. }
  5331. let nowday = new Date(sessionStorage.msg).getDate()
  5332. this.choseDay = nowday - 1
  5333. let monthdate = new Date(sessionStorage.msg)
  5334. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5335. }else{
  5336. if(e && sessionStorage.msg){
  5337. }else{
  5338. sessionStorage.msg = this.date + '-01'
  5339. }
  5340. let monthdate = new Date(sessionStorage.msg)
  5341. this.choseDay = monthdate.getDate() - 1
  5342. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5343. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5344. }
  5345. }else{
  5346. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5347. }
  5348. //从消息点击跳转过来的,直接加载指定日期
  5349. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5350. this.curDate = sessionStorage.msg;
  5351. sessionStorage.from = 0;
  5352. } else {
  5353. // if (curMonthDay != null) {
  5354. // // this.curDate = curMonthDay;
  5355. // let d = new Date(sessionStorage.msg)
  5356. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5357. // } else {
  5358. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5359. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5360. // }
  5361. }
  5362. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5363. // if(!sessionStorage.msg){
  5364. // let msgday = this.choseDay + 1
  5365. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5366. // }
  5367. this.getReportFillStatus();
  5368. },
  5369. getCountDays() {
  5370. var newstr = this.date.replace(/-/g, "/");
  5371. var curDate = new Date(newstr+'/01');
  5372. var curMonth = curDate.getMonth();
  5373. curDate.setMonth(curMonth + 1);
  5374. curDate.setDate(0);
  5375. return curDate.getDate();
  5376. },
  5377. reqMore() {
  5378. if (this.hasMore) {
  5379. this.pageIndex++;
  5380. this.requestHttpReports();
  5381. }
  5382. },
  5383. //加载日报数据
  5384. requestHttpReports() {
  5385. //请求数据
  5386. this.listLoading = true;
  5387. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5388. let param = {date: this.date + day};
  5389. if (this.deptId) {
  5390. param.deptId = this.deptId;
  5391. }
  5392. if (this.targetUid) {
  5393. param.userId = this.targetUid;
  5394. }
  5395. //传页码
  5396. if (this.hasMore) {
  5397. param.pageIndex = this.pageIndex;
  5398. }
  5399. this.http.post( this.port.report.list, param,
  5400. res => {
  5401. this.listLoading = false;
  5402. if (res.code == "ok") {
  5403. //扩增
  5404. this.reportList = this.reportList.concat(res.data.data);
  5405. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5406. if(document.querySelector("#day"+this.choseDay)){
  5407. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5408. }
  5409. } else {
  5410. this.$message({
  5411. message: res.msg,
  5412. type: "error"
  5413. });
  5414. }
  5415. },
  5416. error => {
  5417. this.listLoading = false;
  5418. this.$message({
  5419. message: error,
  5420. type: "error"
  5421. });
  5422. });
  5423. },
  5424. //获取日报列表
  5425. getReportList() {
  5426. //初始化,重置数据
  5427. this.pageIndex = 0;
  5428. this.hasMore = true;
  5429. this.reportList = [];
  5430. this.requestHttpReports();
  5431. },
  5432. //刷新日报状态,用于审核后更新
  5433. refreshReportData(reportId) {
  5434. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5435. res => {
  5436. if (res.code == "ok") {
  5437. for (var m=0;m<this.reportList.length; m++) {
  5438. var d = this.reportList[m].data;
  5439. var find = d.filter(r=>r.id == reportId);
  5440. if (find.length > 0) {
  5441. find[0].state = res.data.state;
  5442. if (find[0].state == 2) {//被驳回,要可以编辑
  5443. this.reportList[m].state = 2;
  5444. }
  5445. find[0].isDeptAudit = res.data.isDeptAudit;
  5446. find[0].departmentAuditState = res.data.departmentAuditState;
  5447. find[0].projectAuditorName = res.data.projectAuditorName;
  5448. find[0].projectAuditorId = res.data.projectAuditorId;
  5449. find[0].projectAuditState = res.data.projectAuditState;
  5450. find[0].rejectUserid = res.data.rejectUserid;
  5451. find[0].rejectUsername = res.data.rejectUsername;
  5452. find[0].rejectReason = res.data.rejectReason;
  5453. this.$forceUpdate();
  5454. break;
  5455. }
  5456. }
  5457. } else {
  5458. this.$message({
  5459. message: res.msg,
  5460. type: "error"
  5461. });
  5462. }
  5463. },
  5464. error => {
  5465. this.listLoading = false;
  5466. this.$message({
  5467. message: error,
  5468. type: "error"
  5469. });
  5470. });
  5471. },
  5472. //导出员工工时统计
  5473. exportUserTime() {
  5474. this.listLoading = true;
  5475. var param = {};
  5476. if (this.exportParam.dateRange != null) {
  5477. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5478. }
  5479. this.http.post('/department/exportDeptStatistic', param,
  5480. res => {
  5481. this.listLoading = false;
  5482. if (res.code == "ok") {
  5483. location.href = res.data;
  5484. this.exportTimeDialog = false;
  5485. } else {
  5486. this.$message({
  5487. message: res.msg,
  5488. type: "error"
  5489. });
  5490. }
  5491. },
  5492. error => {
  5493. this.listLoading = false;
  5494. this.$message({
  5495. message: error,
  5496. type: "error"
  5497. });
  5498. });
  5499. },
  5500. //导出日报
  5501. exportReport() {
  5502. this.exportingData = true;
  5503. var param = {};
  5504. if (this.exportParam.dateRange != null) {
  5505. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5506. }
  5507. if (this.exportParam.projectId != null) {
  5508. param.projectId = this.exportParam.projectId;
  5509. }
  5510. if (this.exportParam.departmentId != null) {
  5511. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5512. }
  5513. param.stateKey = this.stateKey
  5514. // param.departmentId = this.user.departmentId
  5515. console.log(param, '《=== 导出传的参数');
  5516. console.log('开始调用exportReport接口');
  5517. this.http.post(this.port.report.export, param,
  5518. res => {
  5519. this.exportingData = false;
  5520. if (res.code == "ok") {
  5521. var filePath = res.data;
  5522. const a = document.createElement('a'); // 创建a标签
  5523. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5524. a.setAttribute('href', filePath);// href链接
  5525. a.click(); //自执行点击事件
  5526. a.remove();
  5527. this.exportDialog = false;
  5528. } else {
  5529. this.$message({
  5530. message: res.msg,
  5531. type: "error"
  5532. });
  5533. }
  5534. },
  5535. error => {
  5536. this.exportingData = false;
  5537. this.$message({
  5538. message: error,
  5539. type: "error"
  5540. });
  5541. });
  5542. },
  5543. //导出日报审核记录
  5544. exportReportLog() {
  5545. this.exportingData = true;
  5546. var param = {};
  5547. if (this.exportReportLogParam.dateRange != null) {
  5548. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5549. }
  5550. this.http.post('/report-log/exportReportLog', param,
  5551. res => {
  5552. this.exportingData = false;
  5553. if (res.code == "ok") {
  5554. var filePath = res.data;
  5555. const a = document.createElement('a'); // 创建a标签
  5556. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5557. a.setAttribute('href', filePath);// href链接
  5558. a.click(); //自执行点击事件
  5559. a.remove();
  5560. this.exportDialog = false;
  5561. } else {
  5562. this.$message({
  5563. message: res.msg,
  5564. type: "error"
  5565. });
  5566. }
  5567. },
  5568. error => {
  5569. this.exportingData = false;
  5570. this.$message({
  5571. message: error,
  5572. type: "error"
  5573. });
  5574. });
  5575. },
  5576. importReportLog(item){
  5577. //首先判断文件类型
  5578. let str = item.file.name.split(".");
  5579. let format = str[str.length - 1];
  5580. if (format != "xls" && format != "xlsx") {
  5581. this.$message({
  5582. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5583. type: "error"
  5584. });
  5585. } else {
  5586. let formData = new FormData();
  5587. formData.append("multipartFile", item.file);
  5588. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5589. res => {
  5590. this.$refs.upload.clearFiles();
  5591. if (res.code == "ok") {
  5592. this.$message({
  5593. message: res.msg,
  5594. type: "success"
  5595. });
  5596. } else {
  5597. this.$message({
  5598. message: res.msg,
  5599. type: "error"
  5600. });
  5601. }
  5602. },
  5603. error => {
  5604. this.$refs.upload.clearFiles();
  5605. this.$message({
  5606. message: error,
  5607. type: "error"
  5608. });
  5609. });
  5610. }
  5611. },
  5612. //获取项目列表
  5613. getProjectList() {
  5614. this.listLoading = true;
  5615. this.http.post( this.port.project.list, {},
  5616. res => {
  5617. this.listLoading = false;
  5618. if (res.code == "ok") {
  5619. for(var i in res.data) {
  5620. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5621. res.data[i].projectCode = ''
  5622. }
  5623. }
  5624. this.projectList = res.data;
  5625. console.log("项目列表",this.projectList);
  5626. } else {
  5627. this.$message({
  5628. message: res.msg,
  5629. type: "error"
  5630. });
  5631. }
  5632. },
  5633. error => {
  5634. this.listLoading = false;
  5635. this.$message({
  5636. message: error,
  5637. type: "error"
  5638. });
  5639. });
  5640. },
  5641. // 获取填报日报的项目下拉列表
  5642. getFillProjectList() {
  5643. this.http.post( this.port.project.list, {
  5644. forReport: 1
  5645. },res => {
  5646. if (res.code == "ok") {
  5647. for(var i in res.data) {
  5648. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5649. res.data[i].projectCode = ''
  5650. }
  5651. }
  5652. this.fillProjectList = res.data;
  5653. this.getRecentlyProject()
  5654. } else {
  5655. this.$message({
  5656. message: res.msg,
  5657. type: "error"
  5658. });
  5659. }
  5660. },
  5661. error => {
  5662. this.$message({
  5663. message: error,
  5664. type: "error"
  5665. });
  5666. });
  5667. },
  5668. getBasecostItemList() {
  5669. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5670. companyId: this.user.companyId
  5671. },
  5672. res => {
  5673. if (res.code == "ok") {
  5674. this.timeBasecostList = res.data;
  5675. }
  5676. });
  5677. },
  5678. getAIReport(createDate) {
  5679. this.http.post('/report/getAIReport', {},
  5680. res => {
  5681. if (res.code == "ok") {
  5682. var quanbu = 0
  5683. this.jsDay = 1
  5684. var zhi = ''
  5685. var slp = res.data
  5686. for(var i in slp) {
  5687. var sp = +slp[i].workingTime + 0
  5688. zhi = this.jsDay * sp
  5689. quanbu = +quanbu + zhi
  5690. }
  5691. this.jsTime = quanbu
  5692. var aiReportData = res.data;
  5693. this.canCancelInDialog = false
  5694. if(aiReportData.length != 0) {
  5695. var arr = [];
  5696. for(var i in aiReportData) {
  5697. arr.push({
  5698. id: null,
  5699. projectId: aiReportData[i].projectId,
  5700. workingTime: aiReportData[i].workingTime,
  5701. content: '',
  5702. progress:100,
  5703. state: 2,
  5704. timeType: aiReportData[i].timeType,
  5705. subProjectList: aiReportData[i].subProjectList,
  5706. taskList: aiReportData[i].taskList,
  5707. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5708. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5709. taskId: aiReportData[i].taskId,
  5710. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5711. startTime: aiReportData[i].startTime,
  5712. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5713. endTime: aiReportData[i].endTime,
  5714. isOvertime: 0,
  5715. progress:aiReportData[i].progress,
  5716. professionProgress: aiReportData[i].professionProgressList,
  5717. stages:aiReportData[i].stages,
  5718. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5719. pics: null,
  5720. multiWorktime: aiReportData[i].multiWorktime,
  5721. worktimeList: [{}],
  5722. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5723. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5724. wuduList: aiReportData[i].degreeList,
  5725. taskGroups:aiReportData[i].taskGroups,
  5726. customData: aiReportData[i].customData,//自定义的数值
  5727. auditUserList: aiReportData[i].auditUserList,
  5728. projectAuditorId: aiReportData[i].projectAuditorId,
  5729. projectAuditorName: aiReportData[i].projectAuditorName,
  5730. overtimeHours: aiReportData[i].overtimeHours,
  5731. customText: aiReportData[i].customText,
  5732. basecostId: aiReportData[i].basecostId,
  5733. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5734. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5735. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5736. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5737. canEdit: true
  5738. })
  5739. }
  5740. this.workForm.domains = arr;
  5741. } else {
  5742. }
  5743. this.canEdit = true;
  5744. this.originCanEdit = true;
  5745. this.seleChn()
  5746. } else {
  5747. this.$message({
  5748. message: res.msg,
  5749. type: "error"
  5750. });
  5751. }
  5752. },
  5753. error => {
  5754. this.$message({
  5755. message: error,
  5756. type: "error"
  5757. });
  5758. });
  5759. },
  5760. // 获取个人某天的日报 111111
  5761. getReport() {
  5762. this.http.post( this.port.report.getPort, {
  5763. date: this.workForm.createDate
  5764. },
  5765. res => {
  5766. if (res.code == "ok") {
  5767. var quanbu = 0
  5768. this.jsDay = 1
  5769. var zhi = ''
  5770. var slp = res.data.report
  5771. for(var i in slp) {
  5772. var sp = +slp[i].workingTime + 0
  5773. zhi = this.jsDay * sp
  5774. quanbu = +quanbu + zhi
  5775. }
  5776. this.jsTime = quanbu
  5777. var list = res.data;
  5778. this.report = list;
  5779. this.reportTimeType = this.report.timeType;
  5780. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5781. this.isWeekend = !this.report.isWorkDay;
  5782. this.canCancelInDialog = false;
  5783. this.hasWrittenReport = list.report.length != 0;
  5784. if(list.report.length != 0) {
  5785. var arr = [];
  5786. this.canEdit = false;
  5787. let candelete = true
  5788. for(var i in list.report) {
  5789. var flg = null
  5790. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5791. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5792. var filteredRespList = null
  5793. if (targetP.length > 0) {
  5794. var isPublic = targetP[0].isPublic;
  5795. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5796. }
  5797. arr.push({
  5798. id: list.report[i].id,
  5799. projectId: list.report[i].projectId,
  5800. workingTime: list.report[i].workingTime,
  5801. content: list.report[i].content,
  5802. state: list.report[i].state,
  5803. timeType: list.report[i].timeType,
  5804. subProjectList: list.report[i].subProjectList,
  5805. taskList: list.report[i].taskList,
  5806. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5807. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5808. taskId: list.report[i].taskId,
  5809. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5810. startTime: list.report[i].startTime,
  5811. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5812. endTime: list.report[i].endTime,
  5813. isOvertime: flg,
  5814. progress:list.report[i].progress,
  5815. professionProgress: list.report[i].professionProgressList,
  5816. stages:list.report[i].stages,
  5817. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5818. pics: list.report[i].pics,
  5819. multiWorktime: list.report[i].multiWorktime,
  5820. worktimeList: list.report[i].worktimeList,
  5821. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5822. multiDegrIdArray: list.report[i].multiDegrIdList,
  5823. wuduList: list.report[i].degreeList,
  5824. taskGroups:list.report[i].taskGroups,
  5825. customData: list.report[i].customData,//自定义的数值
  5826. auditUserList: list.report[i].auditUserList,
  5827. projectAuditorId: list.report[i].projectAuditorId,
  5828. projectAuditorName: list.report[i].projectAuditorName,
  5829. overtimeHours: list.report[i].overtimeHours,
  5830. customText: list.report[i].customText,
  5831. basecostId: list.report[i].basecostId,
  5832. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5833. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5834. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5835. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5836. canEdit: list.report[i].state >= 2 ? true : false,
  5837. extraField1: list.report[i].extraField1,
  5838. extraField2: list.report[i].extraField2,
  5839. extraField3: list.report[i].extraField3,
  5840. workContentList: list.report[i].workContentList,
  5841. filteredRespList: filteredRespList,
  5842. serviceList: list.report[i].serviceList,
  5843. sapServiceId: list.report[i].sapServiceId,
  5844. reportTargetDeptId: list.report[i].deptId
  5845. })
  5846. if (list.report[i].state >= 2) {
  5847. this.canEdit = true;
  5848. }
  5849. if(list.report[i].state < 2){
  5850. candelete = false
  5851. }
  5852. if (list.report[i].state == 0){
  5853. this.canCancelInDialog = true
  5854. }
  5855. // 加判断
  5856. if(this.user.timeType.choseFromAlbum == 1) {
  5857. let arrList = []
  5858. for(var k in list.report[i].pics) {
  5859. let obj = {
  5860. name: k,
  5861. url: list.report[i].pics[k]
  5862. }
  5863. arrList.push(obj)
  5864. }
  5865. arr[i].imgListUrl = arrList
  5866. arr[i].imgList = list.report[i].pics
  5867. }
  5868. }
  5869. this.reportCanDelete = candelete
  5870. this.workForm = {
  5871. createDate: this.workForm.createDate,
  5872. domains: arr,
  5873. userNames:null,
  5874. userId:null,
  5875. time: list.time,
  5876. showRefresh: list.showRefresh
  5877. }
  5878. console.log('workForm', this.workForm)
  5879. } else {
  5880. this.workForm = {
  5881. createDate: this.workForm.createDate,
  5882. domains: [{
  5883. id: null,
  5884. projectId: "",
  5885. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5886. content: "",
  5887. progress:100,
  5888. state: 2,
  5889. timeType:0,
  5890. multiWorktime: this.reportTimeType.multiWorktime,
  5891. worktimeList:[{}],
  5892. canEdit: true,
  5893. auditorFirst: '',
  5894. auditorSec: '',
  5895. auditorThird: '',
  5896. ccUserid: ''
  5897. }],
  5898. userId:null,
  5899. userNames:null,
  5900. time: this.report.time,
  5901. showRefresh: list.showRefresh
  5902. }
  5903. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5904. this.$set(this.workForm.domains[0],'isOvertime',true)
  5905. if(this.reportTimeType.type != 2){
  5906. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5907. }
  5908. }
  5909. if(this.user.timeType.type == 1) {
  5910. var shuzhi = this.user.timeType.allday + ''
  5911. // console.log('执行一次', shuzhi.indexOf('.'))
  5912. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5913. }
  5914. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5915. //默认给第一个,必填字段
  5916. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5917. }
  5918. this.canEdit = true;
  5919. }
  5920. this.originCanEdit = this.canEdit;
  5921. this.seleChn()
  5922. } else {
  5923. this.$message({
  5924. message: res.msg,
  5925. type: "error"
  5926. });
  5927. }
  5928. },
  5929. error => {
  5930. this.$message({
  5931. message: error,
  5932. type: "error"
  5933. });
  5934. });
  5935. },
  5936. guanbi() {
  5937. this.falsss = false,
  5938. this.workTimeForMinYi=0
  5939. },
  5940. // 打开日报填写
  5941. fillInReport(i, isBatch) {
  5942. this.isWeekend = false
  5943. this.reportCanDelete = false
  5944. // console.log(this.user.timeType.type, '选择时长')
  5945. if(i != 1) {
  5946. this.falsss = false
  5947. } else {
  5948. this.falsss = true
  5949. }
  5950. if (this.isSubstitude) {
  5951. this.getSubstitudeUserDeptList();
  5952. }
  5953. if(i == -1 || this.isSubstitude) {
  5954. this.isDisable = false;
  5955. } else {
  5956. this.isDisable = true;
  5957. }
  5958. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5959. this.isBatch = isBatch;
  5960. if (this.isBatch == 0 && !this.isSubstitude) {
  5961. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5962. let weekday = new Date(this.workForm.createDate).getDay()
  5963. if(this.user.companyId == 817){
  5964. if(weekday == 0){
  5965. this.isWeekend = true
  5966. }
  5967. }else{
  5968. if(weekday == 0 || weekday == 6){
  5969. this.isWeekend = true
  5970. }
  5971. }
  5972. this.getReport(i);
  5973. } else {
  5974. // console.log('执行到了这里')
  5975. this.jsTime = 0
  5976. this.jsDay = 0
  5977. this.workForm = {
  5978. createDate: null,//批量填报没有日期
  5979. domains: [{
  5980. id: null,
  5981. projectId: "",
  5982. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5983. content: "",
  5984. progress:100,
  5985. state: 2,
  5986. timeType:0,
  5987. multiWorktime: this.reportTimeType.multiWorktime,
  5988. worktimeList:[{}],
  5989. canEdit: true,
  5990. }],
  5991. }
  5992. if(this.user.timeType.type == 1) {
  5993. var shuzhi = this.user.timeType.allday + ''
  5994. // console.log('执行二次')
  5995. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5996. }
  5997. // console.log(this.workForm)
  5998. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5999. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6000. }
  6001. this.canEdit = true;
  6002. }
  6003. this.dialogVisible = true;
  6004. },
  6005. //按周填报的弹窗口中编辑单项目相关数据
  6006. setWeekFormReportItem(reportId, i, names, row,sss) {
  6007. console.log(sss)
  6008. this.http.post('/report/getReportById', {
  6009. reportId: reportId
  6010. },
  6011. res => {
  6012. if (res.code == "ok") {
  6013. var data = res.data.report;
  6014. sss.subProjectId = data.subProjectId
  6015. sss.subProjectList = data.subProjectList;
  6016. sss.stage = data.stage
  6017. sss.subProjectList = data.subProjectList
  6018. sss.stages = data.stages
  6019. sss.taskGroups = data.taskGroups;
  6020. sss.auditUserList = data.auditUserList;
  6021. sss.degreeId = data.degreeId;
  6022. sss.customData = data.customData;
  6023. sss.wuduList = data.degreeList;
  6024. this.zhoBaoIdx = i
  6025. this.zhoBaoName = names
  6026. this.zhoBao = sss
  6027. this.zhis = row
  6028. if (sss.groupId) {
  6029. //最后一个参数表示是否保留stage的值,不要重置为空
  6030. this.getGroupStages(this.zhoBao, 0, true)
  6031. }
  6032. this.$forceUpdate();
  6033. }
  6034. });
  6035. },
  6036. // 按周填报里内容的填写
  6037. tianxies(item, i, names, row) {
  6038. if (item.state == 0) {
  6039. this.$message({
  6040. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  6041. type: "error"
  6042. });
  6043. return;
  6044. }
  6045. if (item.state == 1) {
  6046. this.$message({
  6047. message: '已通过状态不可修改',
  6048. type: "error"
  6049. });
  6050. return;
  6051. }
  6052. if(this.user.timeType.notAllowedNoAttendance == 1){
  6053. if(this.zhoData[i].corpTime){
  6054. if(this.zhoData[i].corpTime.workHours == 0){
  6055. this.$message({
  6056. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6057. type: 'error'
  6058. })
  6059. return
  6060. }
  6061. }else{
  6062. this.$message({
  6063. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6064. type: 'error'
  6065. })
  6066. return
  6067. }
  6068. }
  6069. var idd = ''
  6070. var obj = {}
  6071. for(var l in this.projectList) {
  6072. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  6073. }
  6074. obj.projectId = idd
  6075. this.tianxieDialogVisible = true
  6076. this.scopess = item
  6077. console.log(item, '《==== 当前的对象')
  6078. var sss = {}
  6079. if (item.id != null) {
  6080. sss.id = item.id;
  6081. sss.state = item.state;
  6082. } else {
  6083. sss.id = -1;
  6084. sss.state = 3;
  6085. }
  6086. sss.projectId = idd;
  6087. sss.progress = item.progress
  6088. sss.time = item.time
  6089. sss.content = item.content;
  6090. console.log('333', sss.content)
  6091. if (sss.time == '' && this.reportTimeType.type == 2) {
  6092. //取已填时间范围中最大的一个作为开始时间
  6093. var startTime = '09:00';
  6094. var fillStartTime = '00:00';
  6095. for (var t in this.selProjectList) {
  6096. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6097. if (fillItem.time) {
  6098. if (fillItem.time[1] > fillStartTime) {
  6099. fillStartTime = fillItem.time[1];
  6100. }
  6101. }
  6102. }
  6103. if (fillStartTime == '00:00') {
  6104. fillStartTime = '09:00';
  6105. }
  6106. var fillEndMax = '18:00';
  6107. if (fillStartTime >= '18:00') {
  6108. fillEndMax = '23:59';
  6109. }
  6110. sss.time = [fillStartTime, fillEndMax];
  6111. }
  6112. sss.groupId = item.groupId
  6113. sss.stage = item.stage;
  6114. sss.workingTime = item.workingTime
  6115. sss.projectAuditorId = item.projectAuditorId;
  6116. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6117. //默认选中第一个
  6118. sss.basecostId = this.timeBasecostList[0].id;
  6119. }
  6120. var hasEdited = this.zhoData[i][names].hasEdited;
  6121. if (hasEdited) {
  6122. sss = { ...item }
  6123. //编辑过了
  6124. sss.subProjectId = item.subProjectId
  6125. sss.stage = item.stage
  6126. sss.subProjectList = item.subProjectList
  6127. sss.stages = item.stages
  6128. sss.taskGroups = item.taskGroups;
  6129. console.log(sss.taskGroups, '33333');
  6130. sss.auditUserList = obj.auditUserList;
  6131. sss.degreeId = item.degreeId;
  6132. sss.customData = item.customData;
  6133. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6134. //只有一个审核人,自动设置上去
  6135. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6136. }
  6137. sss.wuduList = item.wuduList;
  6138. this.zhoBaoIdx = i
  6139. this.zhoBaoName = names
  6140. this.zhoBao = sss
  6141. this.zhis = row
  6142. if (sss.groupId) {
  6143. //最后一个参数表示是否保留stage的值,不要重置为空
  6144. this.getGroupStages(this.zhoBao, 0, true)
  6145. }
  6146. this.$forceUpdate();
  6147. this.getWeeklyTaskList(sss)
  6148. console.log('最后的周报 ===>', this.zhoBao)
  6149. } else {
  6150. //第一次打开,获取数据
  6151. if (sss.id == -1) {
  6152. //新填报的
  6153. this.selectProject(obj, 0);
  6154. var that = this
  6155. setTimeout(() =>{
  6156. sss.subProjectId = that.workForm.domains[0].subProjectId
  6157. sss.subProjectList = item.subProjectList;
  6158. sss.stage = that.workForm.domains[0].stage
  6159. sss.subProjectList = that.workForm.domains[0].subProjectList
  6160. sss.stages = that.workForm.domains[0].stages
  6161. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6162. sss.auditUserList = obj.auditUserList;
  6163. sss.degreeId = item.degreeId;
  6164. sss.customData = item.customData;
  6165. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6166. //只有一个审核人,自动设置上去
  6167. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6168. }
  6169. sss.wuduList = row[0].wuduList
  6170. that.zhoBaoIdx = i
  6171. that.zhoBaoName = names
  6172. that.zhoBao = sss
  6173. that.zhis = row
  6174. if (sss.groupId) {
  6175. //最后一个参数表示是否保留stage的值,不要重置为空
  6176. this.getGroupStages(that.zhoBao, 0, false)
  6177. }
  6178. that.$forceUpdate();
  6179. this.getWeeklyTaskList(sss)
  6180. },600);
  6181. } else {
  6182. //编辑填报过的;数据库已经存在的
  6183. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6184. }
  6185. }
  6186. },
  6187. // 按周填报里内容的填写点击确定
  6188. setWeekProItemData() {
  6189. //专业版模式下,任务分组和阶段必填
  6190. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6191. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6192. this.$message({
  6193. message: '任务分组和阶段必填,请检查',
  6194. type: "error"
  6195. });
  6196. return;
  6197. }
  6198. }
  6199. // 检查任务分组
  6200. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6201. this.$message({
  6202. message: '任务分组必填,请检查',
  6203. type: "error"
  6204. });
  6205. return
  6206. }
  6207. //检查子项目是否必填
  6208. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6209. this.$message({
  6210. message: '子项目必填,请检查',
  6211. type: "error"
  6212. });
  6213. return;
  6214. }
  6215. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6216. this.$message({
  6217. message: this.$t('message.Pleaseselectareviewer'),
  6218. type: "error"
  6219. });
  6220. return
  6221. }
  6222. if(this.user.timeType.reportAuditType == 3){
  6223. let auditTips = ''
  6224. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6225. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6226. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6227. if(auditTips){
  6228. auditTips = auditTips.substring(0,auditTips.length - 1)
  6229. this.$message({
  6230. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6231. type: 'error'
  6232. })
  6233. return
  6234. }
  6235. }
  6236. let errtips = ''
  6237. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6238. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6239. errtips += this.user.timeType.customDegreeName + '、'
  6240. }
  6241. }
  6242. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6243. errtips += this.user.timeType.customDataName + '、'
  6244. }
  6245. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6246. errtips += this.user.timeType.customTextName + '、'
  6247. }
  6248. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6249. errtips += this.$t('other.workMatters') +'、'
  6250. }
  6251. if(errtips){
  6252. errtips = errtips.substring(0,errtips.length - 1)
  6253. this.$message({
  6254. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6255. type: 'error'
  6256. })
  6257. return
  6258. }
  6259. this.tianxieDialogVisible = false
  6260. var zhong = this.zhoData
  6261. this.zhoBao.hasEdited = true;
  6262. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6263. this.zhoData = zhong
  6264. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6265. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6266. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6267. },
  6268. // 获取本周
  6269. getCurrentWeek() {
  6270. //今天
  6271. this.targetWeekDate = new Date();
  6272. this.initWeekFormData();
  6273. // this.jiazai()
  6274. },
  6275. // 获取上周
  6276. handleGetPrevWeek() {
  6277. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6278. this.initWeekFormData();
  6279. // this.jiazai()
  6280. },
  6281. // 获取下周
  6282. handleGetNextvWeek() {
  6283. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6284. this.initWeekFormData()
  6285. },
  6286. // 加载动画
  6287. jiazai() {
  6288. this.weekDataLoading = true
  6289. var that = this
  6290. setTimeout(() =>{
  6291. that.weekDataLoading = false
  6292. },1000);
  6293. },
  6294. // 转时间格式
  6295. dealdate(date) {
  6296. const dt = new Date(date)
  6297. const y = dt.getFullYear()
  6298. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6299. const d = (dt.getDate() + '').padStart(2, '0')
  6300. return `${y}-${m}-${d}`
  6301. },
  6302. // 按周填报
  6303. fillInReportss() {
  6304. window.addEventListener('scroll', this.handleScroll, true)
  6305. // this.jiazai()
  6306. this.fillWeekDialogVisi = true
  6307. this.getCurrentWeek();
  6308. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6309. //重新获取工时预警类型的预算项
  6310. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6311. companyId: this.user.companyId
  6312. },
  6313. res => {
  6314. if (res.code == "ok") {
  6315. this.timeBasecostList = res.data;
  6316. }
  6317. });
  6318. }
  6319. },
  6320. fillInReportCustom() {
  6321. this.weekIndex++
  6322. this.weekParentData = {
  6323. isSubstitude: this.isSubstitude
  6324. }
  6325. this.fillWeekDialogVisiCustom = true
  6326. },
  6327. // 按周填报的项目筛选
  6328. selListFun(){
  6329. this.selProjectList = []
  6330. if(this.selCon.length){
  6331. for (let i = 0; i < this.selCon.length; i++) {
  6332. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6333. }
  6334. this.selConShow = false ;
  6335. for (let i in this.zhoData) {
  6336. var obj = this.zhoData[i];
  6337. for(var j in this.selProjectList) {
  6338. var xinzhi = this.selProjectList[j].projectName
  6339. obj[xinzhi] = {}
  6340. obj[xinzhi].time = ''
  6341. obj[xinzhi].content = ''
  6342. obj[xinzhi].progress = 0
  6343. obj[xinzhi].workingTime = 0
  6344. }
  6345. }
  6346. this.initWeekFormData();
  6347. }else{
  6348. this.$message({
  6349. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6350. type:'error'
  6351. })
  6352. }
  6353. },
  6354. setWeekCardTimeData(list) {
  6355. for(let i in list){
  6356. let datei = '';
  6357. if (this.user.timeType.showDdCardtime == 1) {
  6358. datei = list[i].workDate;
  6359. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6360. datei = list[i].createDate;
  6361. } else if (this.user.timeType.syncFanwei == 1) {
  6362. datei = list[i].workDate;
  6363. }
  6364. for(let m in this.zhoData) {
  6365. if(datei == this.zhoData[m].zhoDataTime){
  6366. let item = {
  6367. startTime: list[i].startTime,
  6368. endTime: list[i].endTime,
  6369. workHours: list[i].workHours
  6370. }
  6371. this.$set(this.zhoData[m],'corpTime',item)
  6372. }
  6373. }
  6374. }
  6375. },
  6376. getWeeklyCardTime(){ //按周填报获取考勤信息
  6377. let dateStr = []
  6378. for(let i in this.zhoData){
  6379. dateStr.push(this.zhoData[i].zhoDataTime)
  6380. }
  6381. this.http.post('/report/getWeeklyCardTime',{
  6382. dateStr: JSON.stringify(dateStr)
  6383. },res => {
  6384. if(res.code == 'ok'){
  6385. for(let i in res.data){
  6386. let datei = '';
  6387. if (this.user.timeType.showDdCardtime == 1) {
  6388. datei = res.data[i].workDate.split('-');
  6389. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6390. datei = res.data[i].createDate.split('-');
  6391. }
  6392. for(let m in this.zhoData){
  6393. let datem = new Date(this.zhoData[m].zhoDataTime)
  6394. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6395. let item = {
  6396. startTime: res.data[i].startTime,
  6397. endTime: res.data[i].endTime,
  6398. workHours: res.data[i].workHours
  6399. }
  6400. this.$set(this.zhoData[m],'corpTime',item)
  6401. }
  6402. }
  6403. }
  6404. }else{
  6405. this.$message({
  6406. message: res.msg,
  6407. type: 'error'
  6408. })
  6409. }
  6410. },err => {
  6411. this.$message({
  6412. message: err,
  6413. type: 'error'
  6414. })
  6415. })
  6416. },
  6417. selListqx(){
  6418. this.fillWeekDialogVisi = false
  6419. this.selProjectList = []
  6420. this.selCon = []
  6421. },
  6422. handleScroll() {
  6423. this.changdu = this.projectList.length + 1
  6424. },
  6425. // 自动选择时间点的事件
  6426. // async zhoTimes(item, i) {
  6427. // var iss = i
  6428. // if(item.time == null) {
  6429. // return
  6430. // } else {
  6431. // const zhi = this.zhoData[iss];
  6432. // let he = 0;
  6433. // const timeArr = Object.values(zhi)
  6434. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6435. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6436. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6437. // console.log(data, 'data');
  6438. // zhi.he = `${he}h`;
  6439. // }
  6440. // },
  6441. async zhoTimes(item, index) {
  6442. const zho = this.zhoData[index];
  6443. if (!item.time) {
  6444. return;
  6445. }
  6446. const timeArr = Object.values(zho)
  6447. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6448. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6449. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6450. zho.he = `${totalHours[0]}h`;
  6451. },
  6452. // 判断两个时间段是否重叠
  6453. timeOverlap(idx, dateAr) {
  6454. let zhi = 0
  6455. for (let k in dateAr) {
  6456. if (idx !== k) {
  6457. 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))) {
  6458. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6459. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6460. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6461. }
  6462. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6463. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6464. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6465. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6466. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6467. } else {
  6468. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6469. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6470. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6471. }
  6472. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6473. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6474. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6475. }
  6476. }
  6477. }
  6478. }
  6479. }
  6480. return zhi
  6481. },
  6482. // 计算时间
  6483. getHourMinutes(str, end) {
  6484. var he = 0
  6485. var date2 = '2021/12/12 ' + end +':00'
  6486. var date1 = '2021/12/12 ' + str +':00'
  6487. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6488. var leave1=date3%(24*3600*1000)
  6489. var hours=Math.floor(leave1/(3600*1000))
  6490. var leave2=leave1%(3600*1000)
  6491. var minutes=Math.floor(leave2/(60*1000))
  6492. var shi = hours+'.'+ minutes
  6493. return he += +shi
  6494. },
  6495. // 自动选择事件长度的事件
  6496. zhoXuan(item, i) {
  6497. var iss = i
  6498. if(item.time == null) {
  6499. return
  6500. } else {
  6501. var zhi = this.zhoData[iss]
  6502. var he = 0
  6503. for(var i in zhi) {
  6504. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6505. he += +zhi[i].workingTime
  6506. }
  6507. }
  6508. zhi.he = he + 'h'
  6509. }
  6510. },
  6511. getPushWorkLogData(){
  6512. this.http.post('/sap-sync-log/list', {},
  6513. res => {
  6514. if (res.code == "ok") {
  6515. this.pushWorkTimeLogData = res.data;
  6516. } else {
  6517. this.$message({
  6518. message: res.msg,
  6519. type: "error"
  6520. });
  6521. }
  6522. },
  6523. error => {
  6524. this.$message({
  6525. message: error,
  6526. type: "error"
  6527. });
  6528. });
  6529. },
  6530. // 获取全部人员
  6531. getUsers() {
  6532. this.http.post('/user/getSimpleActiveUserList', {},
  6533. res => {
  6534. if (res.code == "ok") {
  6535. this.usersList = res.data;
  6536. } else {
  6537. this.$message({
  6538. message: res.msg,
  6539. type: "error"
  6540. });
  6541. }
  6542. },
  6543. error => {
  6544. this.$message({
  6545. message: error,
  6546. type: "error"
  6547. });
  6548. });
  6549. },
  6550. // 按时间比例
  6551. addBli(item, i) {
  6552. var iss = i
  6553. if(item.time == null) {
  6554. return
  6555. } else {
  6556. var zhi = this.zhoData[iss]
  6557. var he = 0
  6558. for(var i in zhi) {
  6559. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6560. he += +zhi[i].workingTime
  6561. }
  6562. }
  6563. zhi.he = he.toFixed(1) + 'h'
  6564. }
  6565. },
  6566. //按周填报选择的项目发生变化,需要设置列
  6567. onSelProjectChange() {
  6568. for (let i = 0; i < this.selCon.length; i++) {
  6569. var exists = false;
  6570. for (let j = 0; j < this.selProjectList.length; j++) {
  6571. if (this.selProjectList[j].id == this.selCon[i]) {
  6572. exists = true;
  6573. break;
  6574. }
  6575. }
  6576. if (!exists) {
  6577. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6578. this.selProjectList.push(newProject);
  6579. //添加新项目
  6580. for (var w in this.zhoData) {
  6581. var dayItem = this.zhoData[w];
  6582. var pName = newProject.projectName;
  6583. dayItem[pName] = {};
  6584. dayItem[pName].time = ''
  6585. dayItem[pName].content = ''
  6586. dayItem[pName].progress = 0
  6587. dayItem[pName].workingTime = 0
  6588. }
  6589. }
  6590. }
  6591. //去掉
  6592. for (let j = 0; j < this.selProjectList.length; j++) {
  6593. var exists = false;
  6594. for (let i = 0; i < this.selCon.length; i++) {
  6595. if (this.selProjectList[j].id == this.selCon[i]) {
  6596. exists = true;
  6597. break;
  6598. }
  6599. }
  6600. if (!exists) {
  6601. this.selProjectList.splice(j, 1);
  6602. j--;
  6603. }
  6604. }
  6605. this.loadFilledWeekReportItem();
  6606. //刷新表格
  6607. // this.$refs.weekTable.doLayout();
  6608. },
  6609. //根据选中的项目来刷新填写表格
  6610. loadFilledWeekReportItem() {
  6611. for (var w in this.zhoData) {
  6612. var dayItem = this.zhoData[w];
  6613. for (var i = 0; i < this.selProjectList.length; i++) {
  6614. var curColumnProject = this.selProjectList[i];
  6615. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6616. for (var t in dayItem.reportList) {
  6617. //有日报的项目,不能取消选择
  6618. for (var p in this.fillProjectList) {
  6619. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6620. }
  6621. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6622. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6623. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6624. if (this.reportTimeType.type == 2) {
  6625. //时间段模式
  6626. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6627. }
  6628. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6629. break;
  6630. }
  6631. }
  6632. // dayItem[curColumnProject.projectName] = matchReportItem;
  6633. }
  6634. }
  6635. this.$nextTick(()=>{
  6636. this.$refs.weekTable.doLayout();
  6637. });
  6638. },
  6639. initWeekFormData() {
  6640. this.weekDataLoading = true;
  6641. for (var p in this.fillProjectList) {
  6642. this.fillProjectList[p].canCancel = 1;
  6643. }
  6644. this.http.post('/report/getWeeklyReportData',{
  6645. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6646. },res => {
  6647. this.weekDataLoading = false;
  6648. if(res.code == 'ok'){
  6649. let projectList = res.data.projectList;
  6650. if (projectList.length > 0) {
  6651. //有选择过项目进行填报,直接选中
  6652. this.selProjectList = projectList;
  6653. this.selCon = [];
  6654. for (let i = 0; i < projectList.length; i++) {
  6655. this.selCon.push(projectList[i].id);
  6656. }
  6657. }
  6658. //设置日期
  6659. this.weekDateRange = res.data.dateList;
  6660. this.zhoData = [];
  6661. var arrst = []
  6662. for(var i in this.weekDateRange) {
  6663. var obj = {}
  6664. obj.zhoDataTime = this.weekDateRange[i].date
  6665. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6666. obj.he = this.weekDateRange[i].filledTime;
  6667. obj.canFill = this.weekDateRange[i].canFill;
  6668. // obj.filledTime = this.weekDateRange[i].filledTime;
  6669. obj.reportList = this.weekDateRange[i].reportList;
  6670. //初始化,防止渲染报错
  6671. for (var j = 0; j < this.selProjectList.length; j++) {
  6672. var pName = this.selProjectList[j].projectName
  6673. obj[pName] = {}
  6674. obj[pName].time = ''
  6675. obj[pName].content = ''
  6676. obj[pName].progress = 0
  6677. obj[pName].workingTime = 0
  6678. }
  6679. arrst.push(obj)
  6680. }
  6681. this.zhoData = arrst
  6682. this.setWeekCardTimeData(res.data.cardTimeList);
  6683. this.loadFilledWeekReportItem();
  6684. }else{
  6685. this.$message({
  6686. message: res.msg,
  6687. type: 'error'
  6688. })
  6689. }
  6690. },err => {
  6691. this.$message({
  6692. message: err,
  6693. type: 'error'
  6694. })
  6695. })
  6696. },
  6697. zhoZhi(res, i) {
  6698. var zhi = 0
  6699. for(var i in res) {
  6700. if(i != 'zhoDataTime' && i != 'he') {
  6701. zhi += +res[i]
  6702. }
  6703. }
  6704. res.he = zhi
  6705. },
  6706. zhoBtn(i) {
  6707. // this.zhoData.split(i, 1)
  6708. var arr = this.zhoData
  6709. arr.splice(i, 1)
  6710. },
  6711. zhoAddlast(){
  6712. this.selConShow = true
  6713. },
  6714. closeAddWeeklyReport(){
  6715. this.fillWeekDialogVisi = false
  6716. this.selConShow = true
  6717. this.selProjectList = []
  6718. this.selCon = []
  6719. },
  6720. checkDateWorkTime() {
  6721. //针对苏州景昱,单独的检查逻辑
  6722. if (this.user.companyId == 5978) {
  6723. //调接口,先检查工时是否存在异常
  6724. var zhi = this.zhoData;
  6725. var array = [];
  6726. for(let n in zhi){
  6727. if(zhi[n].he){
  6728. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6729. array.push(workData)
  6730. }
  6731. }
  6732. this.submitingReport = true;
  6733. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6734. res => {
  6735. this.submitingReport = false;
  6736. if (res.code == "ok") {
  6737. this.submitWeekReport(0)
  6738. } else {
  6739. this.$confirm(res.msg, '提示', {
  6740. confirmButtonText: '忽略并提交',
  6741. cancelButtonText: '取消',
  6742. type: 'error'
  6743. }).then(() => {
  6744. this.submitWeekReport(0)
  6745. }).catch(() => {
  6746. });
  6747. }
  6748. },
  6749. error => {
  6750. this.$message({
  6751. message: error,
  6752. type: "error"
  6753. });
  6754. });
  6755. }
  6756. },
  6757. // 提交按周填报
  6758. submitWeekReport(isDraft) {
  6759. var zhi = this.zhoData
  6760. var ll = 0
  6761. if(this.reportTimeType.type == 2) {
  6762. for(var i in zhi) {
  6763. this.dateAr = []
  6764. var alp = []
  6765. var zhis = zhi[i]
  6766. console.log(zhis)
  6767. for(var j in zhis) {
  6768. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6769. let objs = {}
  6770. objs.s = zhis[j].time[0]
  6771. objs.e = zhis[j].time[1]
  6772. objs.p = j
  6773. alp.push(objs)
  6774. }
  6775. }
  6776. console.log(alp)
  6777. this.dateAr = alp
  6778. if (this.reportTimeType.timeCanOverlap == 0) {
  6779. let str = this.$t('message.Filledtimeperiodsoverlap')
  6780. if(this.dateAr.length > 0) {
  6781. const trus = this.fns();
  6782. const overlapDataTime = this.getOverlapData(alp);
  6783. if (overlapDataTime.length > 0) {
  6784. const arrList = overlapDataTime.map((item) => item.p);
  6785. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6786. }
  6787. ll += 1
  6788. if(!trus) {
  6789. this.$message({
  6790. message: str,
  6791. type: 'error'
  6792. })
  6793. return false
  6794. }
  6795. }
  6796. } else {
  6797. if(this.dateAr.length > 0) {
  6798. ll +=1 ;
  6799. }
  6800. }
  6801. }
  6802. if(ll == 0) {
  6803. this.$message({
  6804. message: this.$t('message.Pleasefillinthetime'),
  6805. type: 'error'
  6806. })
  6807. return false
  6808. }
  6809. } else if(this.reportTimeType.type == 1){
  6810. for(var i in zhi) {
  6811. var zhis = zhi[i]
  6812. for(var j in zhis) {
  6813. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6814. ll += 1
  6815. }
  6816. }
  6817. }
  6818. if(ll == 0) {
  6819. this.$message({
  6820. message: this.$t('message.Pleaseselectatime'),
  6821. type: 'error'
  6822. })
  6823. return false
  6824. }
  6825. let overcorp = ''
  6826. for(let n in zhi){
  6827. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6828. overcorp += zhi[n].zhoDataTime + ','
  6829. }
  6830. }
  6831. if(this.user.companyId != 5978 && overcorp != ''){
  6832. overcorp = overcorp.substring(0,overcorp.length - 1)
  6833. this.$message({
  6834. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6835. type: 'error'
  6836. })
  6837. return
  6838. }
  6839. }
  6840. var submits = []
  6841. let formData = new FormData();
  6842. formData.append("draft", isDraft);
  6843. if(this.reportTimeType.multiWorktime == 1){
  6844. for (var i in this.zhoData) {
  6845. var zhoD = this.zhoData[i]
  6846. var flgs = false
  6847. for(var j in zhoD) {
  6848. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6849. flgs = true
  6850. // formData.append("degreeId", "-1");
  6851. formData.append("id", '-1');
  6852. for(var s in this.projectList) {
  6853. if(j == this.projectList[s].projectName) {
  6854. formData.append("projectId", this.projectList[s].id);
  6855. }
  6856. }
  6857. if(this.user.timeType.reportAuditType == 3){
  6858. let audItem = {}
  6859. if(this.user.timeType.auditLevel > 0){
  6860. audItem.auditorFirst = zhoD[j].auditorFirst
  6861. }
  6862. if(this.user.timeType.auditLevel > 1){
  6863. audItem.auditorSec = zhoD[j].auditorSec
  6864. }
  6865. if(this.user.timeType.auditLevel > 2){
  6866. audItem.auditorThird = zhoD[j].auditorThird
  6867. }
  6868. if(zhoD[j].ccUserid){
  6869. audItem.ccUserid = zhoD[j].ccUserid
  6870. }
  6871. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6872. }
  6873. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6874. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6875. formData.append("reportTimeType", this.reportTimeType.type);
  6876. formData.append("endTime", '');
  6877. formData.append("startTime", '');
  6878. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6879. var lix = []
  6880. var objjs = {}
  6881. objjs.startTime = zhoD[j].time[0]
  6882. objjs.endTime = zhoD[j].time[1]
  6883. if (zhoD[j].content == null || zhoD[j].content == '') {
  6884. zhoD[j].content == '-'
  6885. }
  6886. objjs.content = zhoD[j].content
  6887. lix.push(objjs)
  6888. var zhiZhi = JSON.stringify(lix)
  6889. zhiZhi = zhiZhi.replace(/,/g,"@");
  6890. formData.append("content", zhiZhi)
  6891. formData.append("isOvertime", 0)
  6892. formData.append("professionProgress", "[]")
  6893. if (zhoD[j].groupId) {
  6894. formData.append("groupId",zhoD[j].groupId)
  6895. } else {
  6896. //解决后台groupId数组越界的问题
  6897. formData.append("groupId",0)
  6898. }
  6899. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6900. formData.append("createDate",zhoD.zhoDataTime)
  6901. if (zhoD[j].projectAuditorId) {
  6902. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6903. }
  6904. if(zhoD[j].basecostId) {
  6905. formData.append("basecostId", zhoD[j].basecostId);
  6906. } else {
  6907. formData.append("basecostId", 0);
  6908. }
  6909. if(this.user.timeType.customDegreeActive){
  6910. if (this.user.timeType.customDegreeMultiple) {
  6911. if (zhoD[j].multiDegrIdArray) {
  6912. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6913. } else {
  6914. formData.append('multiDegrId','[]')
  6915. }
  6916. } else {
  6917. if (zhoD[j].degreeId) {
  6918. formData.append('degreeId',zhoD[j].degreeId)
  6919. } else {
  6920. formData.append('degreeId','-1')
  6921. }
  6922. }
  6923. }else{
  6924. formData.append("degreeId", "-1");
  6925. }
  6926. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6927. formData.append('customData',zhoD[j].customData)
  6928. }else if(this.user.timeType.customDataActive){
  6929. formData.append('customData',0)
  6930. }
  6931. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6932. formData.append('customText',zhoD[j].customText)
  6933. }else if(this.user.timeType.customTextActive){
  6934. formData.append('customText','-')
  6935. }
  6936. }
  6937. }
  6938. }
  6939. } else {
  6940. for (var i in this.zhoData) {
  6941. var zhoD = this.zhoData[i]
  6942. var flgs = false
  6943. if(this.reportTimeType.type == 2) {
  6944. for(var k in this.selProjectList) {
  6945. var pItem = this.selProjectList[k];
  6946. var pName = pItem.projectName;
  6947. var j = pName;
  6948. console.log('j==周报中的项目='+j);
  6949. if(zhoD[j].time && zhoD[j].time != 'null') {
  6950. flgs = true
  6951. // formData.append("degreeId", "-1");
  6952. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6953. for(var s in this.projectList) {
  6954. if(j == this.projectList[s].projectName) {
  6955. formData.append("projectId", this.projectList[s].id);
  6956. }
  6957. }
  6958. if(this.user.timeType.reportAuditType == 3){
  6959. let audItem = {}
  6960. if(this.user.timeType.auditLevel > 0){
  6961. audItem.auditorFirst = zhoD[j].auditorFirst
  6962. }
  6963. if(this.user.timeType.auditLevel > 1){
  6964. audItem.auditorSec = zhoD[j].auditorSec
  6965. }
  6966. if(this.user.timeType.auditLevel > 2){
  6967. audItem.auditorThird = zhoD[j].auditorThird
  6968. }
  6969. if(zhoD[j].ccUserid){
  6970. audItem.ccUserid = zhoD[j].ccUserid
  6971. }
  6972. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6973. }
  6974. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6975. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6976. formData.append("reportTimeType", this.reportTimeType.type);
  6977. formData.append("endTime", zhoD[j].time[1]);
  6978. formData.append("startTime", zhoD[j].time[0]);
  6979. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6980. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6981. formData.append("isOvertime", 0)
  6982. formData.append("professionProgress", "[]")
  6983. if (zhoD[j].groupId) {
  6984. formData.append("groupId",zhoD[j].groupId)
  6985. } else {
  6986. //解决后台groupId数组越界的问题
  6987. formData.append("groupId",0)
  6988. }
  6989. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6990. formData.append("createDate",zhoD.zhoDataTime)
  6991. if (zhoD[j].projectAuditorId) {
  6992. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6993. }
  6994. if(zhoD[j].basecostId) {
  6995. formData.append("basecostId", zhoD[j].basecostId);
  6996. } else {
  6997. formData.append("basecostId", 0);
  6998. }
  6999. if(this.user.timeType.customDegreeActive){
  7000. if (this.user.timeType.customDegreeMultiple) {
  7001. if (zhoD[j].multiDegrIdArray) {
  7002. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7003. } else {
  7004. formData.append("multiDegrId", "[]");
  7005. }
  7006. } else {
  7007. if (zhoD[j].degreeId) {
  7008. formData.append('degreeId',zhoD[j].degreeId)
  7009. } else {
  7010. formData.append("degreeId", "-1");
  7011. }
  7012. }
  7013. }else{
  7014. formData.append("degreeId", "-1");
  7015. }
  7016. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7017. formData.append('customData',zhoD[j].customData)
  7018. }else if(this.user.timeType.customDataActive){
  7019. formData.append('customData',0)
  7020. }
  7021. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7022. formData.append('customText',zhoD[j].customText)
  7023. }else if(this.user.timeType.customTextActive){
  7024. formData.append('customText','-')
  7025. }
  7026. }
  7027. }
  7028. } else {
  7029. for(var k in this.selProjectList) {
  7030. var pItem = this.selProjectList[k];
  7031. var pName = pItem.projectName;
  7032. var j = pName;
  7033. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7034. flgs = true
  7035. // formData.append("degreeId", "-1");
  7036. console.log('进入了workFpppp==='+j);
  7037. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7038. for(var s in this.projectList) {
  7039. if(j == this.projectList[s].projectName) {
  7040. formData.append("projectId", this.projectList[s].id);
  7041. }
  7042. }
  7043. if(this.user.timeType.reportAuditType == 3){
  7044. let audItem = {}
  7045. if(this.user.timeType.auditLevel > 0){
  7046. audItem.auditorFirst = zhoD[j].auditorFirst
  7047. }
  7048. if(this.user.timeType.auditLevel > 1){
  7049. audItem.auditorSec = zhoD[j].auditorSec
  7050. }
  7051. if(this.user.timeType.auditLevel > 2){
  7052. audItem.auditorThird = zhoD[j].auditorThird
  7053. }
  7054. if(zhoD[j].ccUserid){
  7055. audItem.ccUserid = zhoD[j].ccUserid
  7056. }
  7057. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7058. }
  7059. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7060. // formData.append("subProjectId", zhoD[j].subProjectId);
  7061. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7062. formData.append("reportTimeType", this.reportTimeType.type);
  7063. if(this.reportTimeType.type == 1) {
  7064. formData.append("workingTime", zhoD[j].workingTime);
  7065. } else if(this.reportTimeType.type == 2) {
  7066. formData.append("endTime", zhoD[j].time[1]);
  7067. formData.append("startTime", zhoD[j].time[0]);
  7068. } else if(this.reportTimeType.type == 3) {
  7069. formData.append("progress", zhoD[j].progress);
  7070. formData.append("workingTime", zhoD[j].workingTime);
  7071. }
  7072. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7073. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7074. formData.append("isOvertime", 0)
  7075. formData.append("professionProgress", "[]")
  7076. if (zhoD[j].groupId) {
  7077. formData.append("groupId",zhoD[j].groupId)
  7078. } else {
  7079. //解决后台groupId数组越界的问题
  7080. formData.append("groupId",0)
  7081. }
  7082. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7083. formData.append("createDate",zhoD.zhoDataTime)
  7084. if (zhoD[j].projectAuditorId) {
  7085. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7086. }
  7087. if(zhoD[j].basecostId) {
  7088. formData.append("basecostId", zhoD[j].basecostId);
  7089. } else {
  7090. formData.append("basecostId", 0);
  7091. }
  7092. if(this.user.timeType.customDegreeActive){
  7093. if (this.user.timeType.customDegreeMultiple) {
  7094. if (zhoD[j].multiDegrIdArray) {
  7095. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7096. } else {
  7097. formData.append("multiDegrId", "[]");
  7098. }
  7099. } else {
  7100. if (zhoD[j].degreeId) {
  7101. formData.append('degreeId',zhoD[j].degreeId)
  7102. } else {
  7103. formData.append("degreeId", "-1");
  7104. }
  7105. }
  7106. }else{
  7107. formData.append("degreeId", "-1");
  7108. }
  7109. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7110. formData.append('customData',zhoD[j].customData)
  7111. }else if(this.user.timeType.customDataActive){
  7112. formData.append('customData',0)
  7113. }
  7114. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7115. formData.append('customText',zhoD[j].customText)
  7116. }else if(this.user.timeType.customTextActive){
  7117. formData.append('customText','-')
  7118. }
  7119. }
  7120. }
  7121. }
  7122. }
  7123. }
  7124. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7125. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7126. if(!next) {
  7127. this.$message({
  7128. message: `【${error.join('、')}】请填写任务分组`,
  7129. type: 'error'
  7130. })
  7131. return
  7132. }
  7133. // 自定义维度
  7134. this.submitingReport = true;
  7135. this.http.uploadFile( this.port.report.editPort, formData,
  7136. res => {
  7137. // this.listLoading = false;
  7138. this.submitingReport = false;
  7139. if (res.code == "ok") {
  7140. this.$message({
  7141. message: this.$t('message.fillinsuccessfully'),
  7142. type: "success"
  7143. });
  7144. this.fillWeekDialogVisi = false
  7145. this.selConShow = true
  7146. this.zhoData = []
  7147. this.weekDateRange = ''
  7148. this.getReportList();
  7149. this.getDepartment();
  7150. // 关闭弹窗 并 清空
  7151. this.selProjectList = []
  7152. this.selCon = []
  7153. this.getRecentlyProject()
  7154. } else {
  7155. this.$message({
  7156. message: res.msg,
  7157. type: "error"
  7158. });
  7159. }
  7160. },
  7161. error => {
  7162. this.submitingReport = false;
  7163. this.$message({
  7164. message: error,
  7165. type: "error"
  7166. });
  7167. });
  7168. },
  7169. handleGroupAuditorData(data) {
  7170. const { reportAuditType } = this.user.timeType
  7171. if(reportAuditType != 1 && reportAuditType != 2) {
  7172. return {next: true}
  7173. }
  7174. let arrList = [];
  7175. Object.entries(data).forEach(([key, obj]) => {
  7176. Object.entries(obj).forEach(([projectName, projectData]) => {
  7177. if (projectData.workingTime && !projectData.groupId) {
  7178. arrList.push({
  7179. projectName,
  7180. date: obj.zhoDataTime,
  7181. dateText: obj.zhoDataTimeTxt
  7182. });
  7183. }
  7184. });
  7185. });
  7186. if(arrList.length > 0) {
  7187. return {
  7188. next: false,
  7189. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7190. }
  7191. } else {
  7192. return {
  7193. next: true,
  7194. error: [],
  7195. }
  7196. }
  7197. },
  7198. ChangeHourMinutestr (str) {
  7199. if (str !== "0" && str !== "" && str !== null) {
  7200. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7201. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7202. } else {
  7203. return "";
  7204. }
  7205. },
  7206. // 得到两个日期中间的日期
  7207. getdiffdate(stime,etime){
  7208. //初始化日期列表,数组
  7209. var diffdate = new Array();
  7210. var i=0;
  7211. //开始日期小于等于结束日期,并循环
  7212. while(stime<=etime){
  7213. diffdate[i] = stime;
  7214. //获取开始日期时间戳
  7215. var stime_ts = new Date(stime).getTime();
  7216. //增加一天时间戳后的日期
  7217. var next_date = stime_ts + (24*60*60*1000);
  7218. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7219. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7220. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7221. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7222. stime = next_dates_y+next_dates_m+next_dates_d;
  7223. //增加数组key
  7224. i++;
  7225. }
  7226. return diffdate;
  7227. },
  7228. // 添加模块
  7229. addDomain(i) {
  7230. var leftProgress = 10;
  7231. if (this.reportTimeType.type == 3) {
  7232. //计算已经待分配工时比例
  7233. let array = this.workForm.domains;
  7234. let totalProgress = 0;
  7235. for (var i=0;i<array.length; i++) {
  7236. totalProgress += array[i].progress;
  7237. }
  7238. if (totalProgress < 100) {
  7239. leftProgress = 100 - totalProgress;
  7240. }
  7241. }
  7242. var addItem = {
  7243. projectId: "",
  7244. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7245. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7246. ),
  7247. content: "",
  7248. progress:leftProgress,
  7249. state:2,//2-表示待提交
  7250. multiWorktime: this.reportTimeType.multiWorktime,
  7251. worktimeList:[{}],
  7252. canEdit: true,
  7253. auditorFirst: '',
  7254. auditorSec: '',
  7255. auditorThird: '',
  7256. ccUserid: ''
  7257. // degreeId: '',
  7258. };
  7259. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7260. this.$set(addItem,'isOvertime',true)
  7261. if(this.reportTimeType.type == 3){
  7262. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7263. }
  7264. }
  7265. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7266. //默认给第一个,必填字段
  7267. addItem.basecostId = this.timeBasecostList[0].id;
  7268. }
  7269. this.workForm.domains.push(addItem);
  7270. document.getElementById('workFormsItemBottom').scrollIntoView()
  7271. this.canEdit = true
  7272. if (this.reportTimeType.type == 0) {
  7273. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7274. var length = this.workForm.domains.length;
  7275. if (length == 2) {
  7276. this.showAddMore = false;
  7277. }
  7278. }
  7279. this.chuji()
  7280. this.seleChn()
  7281. },
  7282. // 移除模块
  7283. delDomain(i) {
  7284. this.workForm.domains.splice(i,1)
  7285. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7286. if (!this.originCanEdit) {
  7287. let iscan = false
  7288. for(let i in this.workForm.domains){
  7289. if(this.workForm.domains[i].canEdit){
  7290. iscan = true
  7291. }
  7292. }
  7293. this.canEdit = iscan
  7294. }
  7295. //检测当前剩下的一个,时间类型是否是全天
  7296. if (this.reportTimeType.type == 0) {
  7297. if (this.workForm.domains[0].timeType == 0) {
  7298. this.showAddMore = false;
  7299. } else {
  7300. this.showAddMore = true;
  7301. }
  7302. }
  7303. if(this.user.timeType.multiWorktime == 1) {
  7304. this.iptChangs()
  7305. } else {
  7306. this.seleChn(0)
  7307. }
  7308. },
  7309. // 改变月份
  7310. changeMonth() {
  7311. this.isWeekend = false
  7312. let date = new Date()
  7313. let nowmon = date.getMonth() + 1
  7314. let nowday = date.getDate()
  7315. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7316. if (this.isBatch == 0) {
  7317. if(this.user.timeType.fillAhead == 0){
  7318. let date_a = new Date(this.workForm.createDate)
  7319. if(date_a.getTime() > date.getTime()){
  7320. this.workForm.createDate = nowdate
  7321. }
  7322. }
  7323. //只有按天填报才能获取当天的日报
  7324. if(!this.isSubstitude){
  7325. let weekday = new Date(this.workForm.createDate).getDay()
  7326. if(this.user.companyId == 817){
  7327. if(weekday == 0){
  7328. this.isWeekend = true
  7329. }
  7330. }else{
  7331. if(weekday == 0 || weekday == 6){
  7332. this.isWeekend = true
  7333. }
  7334. }
  7335. this.getReport()
  7336. }
  7337. }else {
  7338. if(this.user.timeType.fillAhead == 0){
  7339. let date_a = new Date(this.workForm.createDate[1])
  7340. if(date_a.getTime() > date.getTime()){
  7341. this.workForm.createDate[1] = nowdate
  7342. let sdate = new Date(this.workForm.createDate[0])
  7343. let edate = new Date(this.workForm.createDate[1])
  7344. if(sdate > edate){
  7345. this.workForm.createDate[0] = this.workForm.createDate[1]
  7346. }
  7347. }
  7348. }
  7349. }
  7350. },
  7351. // 判断时间段
  7352. fns() {
  7353. for (let k in this.dateAr) {
  7354. if (!this.judege(k)) {
  7355. return false
  7356. }
  7357. }
  7358. return true
  7359. },
  7360. judege(idx){
  7361. for (let k in this.dateAr) {
  7362. if (idx !== k) {
  7363. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7364. return false
  7365. }
  7366. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7367. return false
  7368. }
  7369. }
  7370. }
  7371. return true
  7372. },
  7373. getOverlapData(data) {
  7374. let overlapData = [];
  7375. for (let i = 0; i < data.length; i++) {
  7376. for (let j = i + 1; j < data.length; j++) {
  7377. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7378. overlapData.push(data[i], data[j]);
  7379. }
  7380. }
  7381. }
  7382. return overlapData;
  7383. },
  7384. // 保存日报111111
  7385. submitReport(isDraft) {
  7386. this.isDraft = isDraft;
  7387. this.$refs.workForm.validate(valid => {
  7388. if (valid) {
  7389. if (!isDraft) {
  7390. //针对苏州景昱,单独的检查逻辑
  7391. if (this.user.companyId == 5978) {
  7392. //调接口,先检查工时是否存在异常
  7393. var totalTime = 0;
  7394. for (var t=0;t<this.workForm.domains.length; t++) {
  7395. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7396. }
  7397. var array = [];
  7398. if (this.isBatch) {
  7399. var startDate = new Date(this.workForm.createDate[0]);
  7400. var endDate = new Date(this.workForm.createDate[1]);
  7401. if (startDate > endDate) {
  7402. this.$message({
  7403. message: '开始日期不能大于结束日期',
  7404. type: "error"
  7405. });
  7406. return
  7407. } else {
  7408. while(true){
  7409. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7410. array.push(workData);
  7411. startDate.setDate(startDate.getDate() + 1);
  7412. if (startDate > endDate) {
  7413. break;
  7414. }
  7415. }
  7416. }
  7417. } else {
  7418. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7419. array.push(workData)
  7420. }
  7421. this.submitingReport = true;
  7422. var passUserId = this.user.id;
  7423. if (this.isSubstitude) {
  7424. passUserId = this.targetUids;
  7425. }
  7426. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7427. res => {
  7428. this.submitingReport = false;
  7429. if (res.code == "ok") {
  7430. this.submitReportSon()
  7431. } else {
  7432. this.$confirm(res.msg, '提示', {
  7433. confirmButtonText: '忽略并提交',
  7434. cancelButtonText: '取消',
  7435. type: 'error'
  7436. }).then(() => {
  7437. this.submitReportSon()
  7438. }).catch(() => {
  7439. });
  7440. }
  7441. },
  7442. error => {
  7443. this.$message({
  7444. message: error,
  7445. type: "error"
  7446. });
  7447. });
  7448. } else {
  7449. if(this.totalReportHours < this.user.timeType.allday){
  7450. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7451. confirmButtonText: '确定',
  7452. cancelButtonText: '取消',
  7453. type: 'warning'
  7454. }).then(() => {
  7455. this.submitReportSon()
  7456. }).catch(() => {
  7457. });
  7458. }else{
  7459. this.submitReportSon()
  7460. }
  7461. }
  7462. } else {
  7463. //暂存,不需要检查工时是否超过考勤
  7464. this.submitReportSon()
  7465. }
  7466. }
  7467. });
  7468. },
  7469. submitReportSon() {
  7470. this.dateAr = []
  7471. //检查重叠
  7472. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7473. let alp = []
  7474. if(this.user.timeType.multiWorktime != 1) {
  7475. for(var p in this.workForm.domains) {
  7476. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7477. let objs = {}
  7478. objs.s = this.workForm.domains[p].startTime
  7479. objs.e = this.workForm.domains[p].endTime
  7480. alp.push(objs)
  7481. }
  7482. }
  7483. this.dateAr = alp
  7484. if(this.dateAr.length > 0) {
  7485. let trus = this.fns()
  7486. if(!trus) {
  7487. this.$message({
  7488. message: this.$t('message.Filledtimeperiodsoverlap'),
  7489. type: "error"
  7490. });
  7491. return
  7492. }
  7493. }
  7494. } else {
  7495. for(var p in this.workForm.domains) {
  7496. var slll = this.workForm.domains[p]
  7497. for(var o in slll.worktimeList) {
  7498. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7499. let objs = {}
  7500. objs.s = slll.worktimeList[o].startTime
  7501. objs.e = slll.worktimeList[o].endTime
  7502. alp.push(objs)
  7503. }
  7504. }
  7505. }
  7506. this.dateAr = alp
  7507. if(this.dateAr.length > 0) {
  7508. let trus = this.fns()
  7509. if(!trus) {
  7510. this.$message({
  7511. message: this.$t('message.Filledtimeperiodsoverlap'),
  7512. type: "error"
  7513. });
  7514. return
  7515. }
  7516. }
  7517. }
  7518. }
  7519. //检查子项目
  7520. if (this.user.timeType.subProMustFill == 1) {
  7521. for(var p in this.workForm.domains) {
  7522. var oneProItem = this.workForm.domains[p]
  7523. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7524. //没有选择子项目
  7525. this.$message({
  7526. message: '子项目必填,请检查',
  7527. type: "error"
  7528. });
  7529. return
  7530. }
  7531. }
  7532. }
  7533. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7534. if (this.user.companyId == this.yuzhongCompId) {
  7535. for(var p in this.workForm.domains) {
  7536. var oneProItem = this.workForm.domains[p]
  7537. if (!oneProItem.extraField1) {
  7538. this.$message({
  7539. message: '角色必填,请检查',
  7540. type: "error"
  7541. });
  7542. return
  7543. }
  7544. if (!oneProItem.extraField2) {
  7545. this.$message({
  7546. message: '工作职责必填,请检查',
  7547. type: "error"
  7548. });
  7549. return
  7550. }
  7551. if (!oneProItem.extraField3) {
  7552. this.$message({
  7553. message: '工作内容必填,请检查',
  7554. type: "error"
  7555. });
  7556. return
  7557. }
  7558. }
  7559. }
  7560. // return
  7561. //代填的情况,检查人员是否已经选择
  7562. if (this.isSubstitude) {
  7563. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7564. this.$message({
  7565. message: this.$t('message.pleaseselectthepersontofillin'),
  7566. type: "error"
  7567. });
  7568. return;
  7569. }
  7570. }
  7571. //检查时间,全天和上下午不能同时存在
  7572. if (this.reportTimeType.type == 0) {
  7573. var alldayNum = 0;
  7574. var amNum = 0;
  7575. var pmNum = 0;
  7576. for(var i in this.workForm.domains) {
  7577. if (this.workForm.domains[i].timeType == 0) {
  7578. alldayNum ++;
  7579. } else if (this.workForm.domains[i].timeType == 1) {
  7580. amNum++;
  7581. } else if (this.workForm.domains[i].timeType == 2) {
  7582. pmNum++;
  7583. }
  7584. }
  7585. if (alldayNum > 1) {
  7586. this.$message({
  7587. // message: "工作时间-全天,只能选择一次",
  7588. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7589. type: "error"
  7590. });
  7591. return;
  7592. }
  7593. if (amNum > 1) {
  7594. this.$message({
  7595. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7596. type: "error"
  7597. });
  7598. return;
  7599. }
  7600. if (pmNum > 1) {
  7601. this.$message({
  7602. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7603. type: "error"
  7604. });
  7605. return;
  7606. }
  7607. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7608. this.$message({
  7609. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7610. type: "error"
  7611. });
  7612. return;
  7613. }
  7614. } else if (this.reportTimeType.type == 3) {
  7615. //总百分比不能超过100%
  7616. let total = 0;
  7617. this.workForm.domains.forEach(w=>{total += w.progress});
  7618. if (total > 100) {
  7619. this.$message({
  7620. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7621. type: "error"
  7622. });
  7623. return;
  7624. } else if (total < 100) {
  7625. this.$message({
  7626. message: this.$t('message.cannotbesubmitted'),
  7627. type: "error"
  7628. });
  7629. return;
  7630. }
  7631. }
  7632. this.listLoading = true;
  7633. let formData = new FormData();
  7634. formData.append("draft", this.isDraft);
  7635. var totalTime = 0;
  7636. for (var t=0;t<this.workForm.domains.length; t++) {
  7637. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7638. }
  7639. //批量填报不校验考勤时长,交给后台校验
  7640. if (!this.isBatch) {
  7641. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7642. if (this.workForm.time){
  7643. if (this.workForm.time.workHours == 0){
  7644. this.$message({
  7645. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7646. type: 'error'
  7647. })
  7648. return
  7649. }
  7650. }else{
  7651. this.$message({
  7652. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7653. type: 'error'
  7654. })
  7655. return
  7656. }
  7657. }
  7658. }
  7659. //针对凡己和景昱,此处不校验考勤时长
  7660. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7661. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7662. this.$message({
  7663. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7664. type: "error"
  7665. });
  7666. return;
  7667. }
  7668. }
  7669. for(var i in this.workForm.domains) {
  7670. // 检查任务/里程碑是否为必填
  7671. let taskRequired = this.user.timeType.taskRequired
  7672. if(taskRequired == 1) {
  7673. if(!this.workForm.domains[i].taskId) {
  7674. this.$message({
  7675. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7676. type: "error"
  7677. });
  7678. return
  7679. }
  7680. }
  7681. if(this.user.timeType.reportAuditType == 3){
  7682. let audItem = {}
  7683. let auditRule = ''
  7684. if(this.workForm.domains[i].id){
  7685. audItem.reportId = this.workForm.domains[i].id
  7686. }
  7687. if(this.user.timeType.auditLevel > 0){
  7688. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7689. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7690. }
  7691. if(this.user.timeType.auditLevel > 1){
  7692. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7693. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7694. }
  7695. if(this.user.timeType.auditLevel > 2){
  7696. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7697. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7698. }
  7699. if(this.workForm.domains[i].ccUserid){
  7700. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7701. }
  7702. if(auditRule){
  7703. auditRule = auditRule.substring(0,auditRule.length - 1)
  7704. this.$message({
  7705. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7706. type: 'error'
  7707. })
  7708. return
  7709. }
  7710. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7711. }
  7712. if (this.user.timeType.customDegreeActive) {
  7713. if (this.user.timeType.customDegreeMultiple) {
  7714. //多选
  7715. if (this.workForm.domains[i].multiDegrIdArray) {
  7716. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7717. degreeArray = degreeArray.replace(/,/g,"@");
  7718. formData.append("multiDegrId", degreeArray);
  7719. } else {
  7720. formData.append("multiDegrId", '[]');
  7721. }
  7722. } else {
  7723. //单选
  7724. if (this.workForm.domains[i].degreeId) {
  7725. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7726. } else {
  7727. formData.append("degreeId", -1);
  7728. }
  7729. }
  7730. } else {
  7731. formData.append("degreeId", -1);
  7732. }
  7733. if(this.workForm.domains[i].customData) {
  7734. // var sss = this.workForm.domains[i].degreeId.toString()
  7735. formData.append("customData", this.workForm.domains[i].customData);
  7736. } else {
  7737. formData.append("customData", 0);
  7738. }
  7739. if(this.workForm.domains[i].customText) {
  7740. formData.append("customText", this.workForm.domains[i].customText);
  7741. } else {
  7742. formData.append("customText", '-');
  7743. }
  7744. if (this.workForm.domains[i].id) {
  7745. formData.append("id", this.workForm.domains[i].id);
  7746. } else {
  7747. formData.append("id", -1);
  7748. }
  7749. formData.append("projectId", this.workForm.domains[i].projectId);
  7750. if (this.workForm.domains[i].subProjectId) {
  7751. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7752. } else {
  7753. formData.append("subProjectId", 0);
  7754. }
  7755. if (this.workForm.domains[i].groupId) {
  7756. formData.append("groupId", this.workForm.domains[i].groupId);
  7757. } else {
  7758. formData.append("groupId", 0);
  7759. }
  7760. if (this.workForm.domains[i].taskId) {
  7761. formData.append("taskId", this.workForm.domains[i].taskId);
  7762. } else {
  7763. formData.append("taskId", 0);
  7764. }
  7765. if (this.workForm.domains[i].taskFinish == true) {
  7766. formData.append("taskFinish", 1);
  7767. } else {
  7768. formData.append("taskFinish", 0);
  7769. }
  7770. formData.append("reportTimeType", this.reportTimeType.type);
  7771. if (this.reportTimeType.type == 0) {
  7772. formData.append("timeType", this.workForm.domains[i].timeType);
  7773. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7774. formData.append("workingTime", workingTime);
  7775. } else if (this.reportTimeType.type == 1){
  7776. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7777. } else if (this.reportTimeType.type == 2) {
  7778. formData.append("endTime", this.workForm.domains[i].endTime);
  7779. formData.append("startTime", this.workForm.domains[i].startTime);
  7780. } else if (this.reportTimeType.type == 3) {
  7781. //按比例分配
  7782. formData.append("progress", this.workForm.domains[i].progress);
  7783. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7784. }
  7785. if(this.user.timeType.choseFromAlbum == 1 ) {
  7786. console.log(this.workForm.domains[i].imgList)
  7787. if(this.workForm.domains[i].imgList) {
  7788. let imgListFor = this.workForm.domains[i].imgList
  7789. for(var b in imgListFor) {
  7790. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7791. }
  7792. console.log(imgListFor)
  7793. let m = JSON.stringify(imgListFor);
  7794. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7795. formData.append("picStr", m);
  7796. } else {
  7797. formData.append("picStr", '[]');
  7798. }
  7799. }
  7800. //处理多个时间事项
  7801. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7802. if (this.reportTimeType.multiWorktime == 1) {
  7803. //检查时间是否有重叠
  7804. var workList = this.workForm.domains[i].worktimeList;
  7805. for (var j=0;j<workList.length; j++) {
  7806. var curItem = workList[j];
  7807. //检查开始时间是否大于结束时间
  7808. if (curItem.startTime >= curItem.endTime) {
  7809. this.$message({
  7810. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7811. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7812. type: "error"
  7813. });
  7814. return;
  7815. }
  7816. //时间不可重叠
  7817. if (this.reportTimeType.timeCanOverlap == 0) {
  7818. for (var p = j+1;p<workList.length; p++) {
  7819. var jItem = workList[p];
  7820. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7821. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7822. this.$message({
  7823. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7824. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7825. type: "error"
  7826. });
  7827. return;
  7828. }
  7829. }
  7830. }
  7831. }
  7832. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7833. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7834. formData.append("content", m);
  7835. } else {
  7836. if (this.workForm.domains[i].content) {
  7837. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7838. m = m.replace(/,/g,",");
  7839. console.log(m, '需要传值的数据')
  7840. // formData.append("content", this.workForm.domains[i].content);
  7841. formData.append("content", m);
  7842. } else {
  7843. formData.append("content", '-');
  7844. }
  7845. }
  7846. if (this.isBatch == 0) {
  7847. formData.append("createDate", this.workForm.createDate);
  7848. } else {
  7849. //批量填报,时间范围
  7850. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7851. }
  7852. if(this.workForm.domains[i].isOvertime) {
  7853. formData.append("isOvertime", 1);
  7854. } else {
  7855. formData.append("isOvertime", 0);
  7856. }
  7857. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7858. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7859. } else {
  7860. formData.append("overtimeHours", 0);
  7861. }
  7862. if(this.workForm.domains[i].basecostId) {
  7863. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7864. } else {
  7865. formData.append("basecostId", 0);
  7866. }
  7867. if (this.workForm.userId != null) {
  7868. var targetUids = '';
  7869. this.workForm.userId.forEach(u=>{
  7870. targetUids += u + '@';
  7871. });
  7872. if (targetUids.length > 0) {
  7873. targetUids = targetUids.substring(0, targetUids.length -1);
  7874. formData.append("targetUids", targetUids);
  7875. }
  7876. }
  7877. //项目专业进度
  7878. if (this.workForm.domains[i].professionProgress) {
  7879. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7880. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7881. formData.append("professionProgress", m);
  7882. } else {
  7883. formData.append("professionProgress", "[]");
  7884. }
  7885. if (this.workForm.domains[i].stage) {
  7886. formData.append("stage", this.workForm.domains[i].stage);
  7887. } else {
  7888. formData.append("stage", "-");
  7889. }
  7890. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7891. if (this.workForm.domains[i].projectAuditorId) {
  7892. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7893. } else {
  7894. // console.log('执行到了这里')
  7895. // console.log(this.user.timeType.reportAuditType)
  7896. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7897. this.$message({
  7898. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7899. type: "error"
  7900. });
  7901. return;
  7902. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7903. //分组负责人先审核, 确定是选择了任务分组
  7904. if (this.workForm.domains[i].taskGroups.length == 0) {
  7905. this.$message({
  7906. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7907. type: "error"
  7908. });
  7909. } else if (!this.workForm.domains[i].groupId) {
  7910. // console.log(this.workForm.domains[i]);
  7911. this.$message({
  7912. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7913. type: "error"
  7914. });
  7915. } else {
  7916. this.$message({
  7917. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7918. type: "error"
  7919. });
  7920. }
  7921. return;
  7922. }
  7923. }
  7924. if (this.user.companyId == this.yuzhongCompId) {
  7925. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7926. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7927. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7928. }
  7929. //依斯贝的服务Id
  7930. if (this.user.companyId == this.yisibeiCompId) {
  7931. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7932. }
  7933. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7934. this.$message({
  7935. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7936. type: "error"
  7937. });
  7938. return
  7939. }
  7940. if(this.user.timeType.userWithMultiDept == 1) {
  7941. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  7942. }
  7943. }
  7944. this.submitingReport = true;
  7945. this.http.uploadFile( this.port.report.editPort, formData,
  7946. res => {
  7947. this.listLoading = false;
  7948. this.submitingReport = false;
  7949. if (res.code == "ok") {
  7950. if(res.msg!=null){
  7951. this.$message({
  7952. dangerouslyUseHTMLString: true,
  7953. message: res.msg,
  7954. type: "warning",
  7955. showClose: true,
  7956. duration: 0
  7957. });
  7958. }else{
  7959. this.$message({
  7960. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7961. type: "success"
  7962. });
  7963. }
  7964. this.dialogVisible = false;
  7965. this.jsDay = 0
  7966. this.jsTime = 0
  7967. this.getReportList();
  7968. this.getDepartment();
  7969. this.getRecentlyProject()
  7970. } else {
  7971. this.$message({
  7972. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7973. type: "error"
  7974. });
  7975. }
  7976. },
  7977. error => {
  7978. this.listLoading = false;
  7979. this.submitingReport = false;
  7980. this.$message({
  7981. message: error,
  7982. type: "error"
  7983. });
  7984. });
  7985. },
  7986. // 判断是展示那个工时导入
  7987. imports() {
  7988. if(this.user.timeType.syncCorpwxTime == 0) {
  7989. this.importDialog = true
  7990. } else {
  7991. this.importWxDialog = true
  7992. }
  7993. },
  7994. // 跳转
  7995. junpToDeskTop(id) {
  7996. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7997. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7998. },
  7999. // 通过日报
  8000. approve(id, item) {
  8001. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8002. this.approveinData = {
  8003. id: id,
  8004. date: this.date +day,
  8005. reportIds: item.id
  8006. }
  8007. if(this.user.timeType.needEvaluate == 1){
  8008. this.$set(this.approveinData,'evaluate','')
  8009. this.approveinDialog = true
  8010. }else{
  8011. this.logining = true;
  8012. this.approveinfun()
  8013. }
  8014. },
  8015. approveinfun(){
  8016. this.http.post( this.port.report.approve, this.approveinData,
  8017. res => {
  8018. this.logining = false;
  8019. if (res.code == "ok") {
  8020. this.approveinDialog = false
  8021. this.$message({
  8022. message: this.$t('message.Reviewsucceeded'),
  8023. type: "success"
  8024. });
  8025. this.refreshReportData(this.approveinData.reportIds);
  8026. this.getDepartment();
  8027. } else {
  8028. this.$message({
  8029. message: res.msg,
  8030. type: "error"
  8031. });
  8032. }
  8033. },
  8034. error => {
  8035. this.logining = false;
  8036. this.$message({
  8037. message: error,
  8038. type: "error"
  8039. });
  8040. });
  8041. },
  8042. //撤回日报
  8043. cancel(item,e) {
  8044. // console.log('can can need',item);
  8045. this.logining = true;
  8046. var ids = '';
  8047. var data = e ? item : item.data;
  8048. data.forEach(element => {
  8049. if(element.id){
  8050. ids +=(element.id+',');
  8051. }
  8052. });
  8053. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8054. res => {
  8055. this.logining = false;
  8056. if (res.code == "ok") {
  8057. this.$message({
  8058. message:this.$t('message.Withdrawalsucceeded'),
  8059. type: "success"
  8060. });
  8061. this.getReportList();
  8062. if(e){this.getReport()}
  8063. this.getDepartment();
  8064. } else {
  8065. this.$message({
  8066. message: res.msg,
  8067. type: "error"
  8068. });
  8069. }
  8070. },
  8071. error => {
  8072. this.logining = false;
  8073. this.$message({
  8074. message: error,
  8075. type: "error"
  8076. });
  8077. });
  8078. },
  8079. showDenyDialog(id,i, item) {
  8080. this.denyReasonDialog = true;
  8081. this.isDenying = false;
  8082. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8083. var ids = item.id;
  8084. // var data = item.data;
  8085. // data.forEach(element => {
  8086. // ids +=(element.id+',');
  8087. // });
  8088. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8089. },
  8090. // 未通过日报
  8091. deny() {
  8092. this.logining = true;
  8093. this.isDenying = true;
  8094. this.http.post( this.port.report.deny, this.denyForm,
  8095. res => {
  8096. this.logining = false;
  8097. this.isDenying = false;
  8098. if (res.code == "ok") {
  8099. this.$message({
  8100. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8101. type: "success"
  8102. });
  8103. this.refreshReportData(this.denyForm.reportIds);
  8104. this.getDepartment();
  8105. this.denyReasonDialog = false;
  8106. } else {
  8107. this.$message({
  8108. message: res.msg,
  8109. type: "error"
  8110. });
  8111. }
  8112. },
  8113. error => {
  8114. this.logining = false;
  8115. this.$message({
  8116. message: error,
  8117. type: "error"
  8118. });
  8119. });
  8120. },
  8121. // 查看工时记录弹窗
  8122. toView() {
  8123. this.toViewDialogVisible = true
  8124. this.toViewloading = true
  8125. this.getToView()
  8126. },
  8127. getToView() {
  8128. this.http.post( '/report-import-log/getList', this.toViewForm,
  8129. res => {
  8130. this.toViewloading = false;
  8131. if (res.code == "ok") {
  8132. // console.log(res.data, '数据数据')
  8133. this.toViewList = res.data.records
  8134. this.toViewForm.total = res.data.total
  8135. } else {
  8136. this.toViewloading = false;
  8137. this.$message({
  8138. message: res.msg,
  8139. type: "error"
  8140. });
  8141. }
  8142. })
  8143. },
  8144. // 触发 selectCat 组件更改他的值
  8145. selectCatCli(obj) {
  8146. // console.log(obj, '看看')
  8147. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8148. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8149. },
  8150. vueCasader(obj) {
  8151. console.log(obj, '看看值')
  8152. if(obj.distinction == 1 && obj.item) {
  8153. let arr = []
  8154. arr.push(obj.item.value)
  8155. this.exportParam.departmentId = arr
  8156. }
  8157. if(obj.distinction == '10' && obj) {
  8158. const { id, other } = obj
  8159. this.workForm.domains[other].reportTargetDeptId = id
  8160. }
  8161. },
  8162. //分页
  8163. handleCurrentChange(val) {
  8164. this.toViewForm.pageIndex = val;
  8165. this.getToView();
  8166. },
  8167. handleSizeChange(val) {
  8168. this.toViewForm.pageSize = val;
  8169. this.getToView();
  8170. },
  8171. getAllUsersList(){
  8172. this.http.post('/user/getSimpleActiveUserList',{
  8173. },res => {
  8174. if(res.code == 'ok'){
  8175. this.allUsersList = res.data
  8176. }else{
  8177. this.$message({
  8178. message: res.msg,
  8179. type: 'error'
  8180. })
  8181. }
  8182. },err => {
  8183. this.$message({
  8184. message: err,
  8185. type: 'error'
  8186. })
  8187. })
  8188. },
  8189. //景昱变更提醒
  8190. changeReminder(item){
  8191. console.log("============",item)
  8192. let parameter={
  8193. startDate: this.WorktimeDatepickValue[0],
  8194. endDate: this.WorktimeDatepickValue[1],
  8195. }
  8196. if(item){
  8197. parameter.createDate=item.createDate,
  8198. parameter.userId=item.userId
  8199. }
  8200. this.http.post('/report/changeReminder',parameter,res => {
  8201. if(res.code == 'ok'){
  8202. this.$message({
  8203. message: res.msg,
  8204. type: 'success'
  8205. })
  8206. }else{
  8207. this.$message({
  8208. message: res.msg,
  8209. type: 'error'
  8210. })
  8211. }
  8212. },err => {
  8213. this.$message({
  8214. message: err,
  8215. type: 'error'
  8216. })
  8217. })
  8218. },
  8219. //景昱取消异常
  8220. cancelReminder(item){
  8221. let parameter={}
  8222. if(item){
  8223. parameter.createDate=item.createDate,
  8224. parameter.userId=item.userId
  8225. }
  8226. this.http.post('/report/cancelReminder',parameter,res => {
  8227. if(res.code == 'ok'){
  8228. this.$message({
  8229. message: res.msg,
  8230. type: 'success'
  8231. })
  8232. }else{
  8233. this.$message({
  8234. message: res.msg,
  8235. type: 'error'
  8236. })
  8237. }
  8238. },err => {
  8239. this.$message({
  8240. message: err,
  8241. type: 'error'
  8242. })
  8243. })
  8244. this.showMonthWorkTimeReminder()
  8245. },
  8246. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8247. fillWeekCustomClne() {
  8248. this.fillWeekDialogVisiCustom = false
  8249. },
  8250. fillWeekCustomSubmit() {
  8251. this.getReportList();
  8252. this.getDepartment();
  8253. this.getRecentlyProject()
  8254. },
  8255. // 待填日报姓名搜索
  8256. nameAearchSeek(flg) {
  8257. if(!this.nameAearch) {
  8258. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8259. return
  8260. }
  8261. if(flg) {
  8262. this.enterpriseWechatgetUser()
  8263. }
  8264. },
  8265. handleThreeData(userList) {
  8266. console.log(userList, '人员数据')
  8267. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8268. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8269. },
  8270. // 过滤树节点
  8271. filterTreeNodes(treeData, filterKeywords) {
  8272. return treeData.filter((node) => {
  8273. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8274. if (node.children && node.children.length > 0) {
  8275. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8276. }
  8277. return true;
  8278. }
  8279. if (node.children && node.children.length > 0) {
  8280. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8281. return node.children.length > 0;
  8282. }
  8283. return false;
  8284. });
  8285. },
  8286. // 企业微信获取人员
  8287. enterpriseWechatgetUser() {
  8288. this.deptMembDataLoading = true
  8289. this.http.post('/user/getEmployeeList',{
  8290. departmentId: -1,
  8291. pageIndex: 1,
  8292. pageSize: 100,
  8293. keyword: this.nameAearch,
  8294. status: '',
  8295. roleId: '',
  8296. cursor: '',
  8297. onlyDirect: '',
  8298. matchingType: ''
  8299. },res => {
  8300. if(res.code == 'ok'){
  8301. this.deptMembDataLoading = false
  8302. const userListName = res.data.records.map(item => item.name)
  8303. this.handleThreeData(userListName)
  8304. }else{
  8305. this.deptMembDataLoading = false
  8306. this.$message({
  8307. message: res.msg,
  8308. type: 'error'
  8309. })
  8310. }
  8311. },err => {
  8312. this.deptMembDataLoading = false
  8313. this.$message({
  8314. message: err,
  8315. type: 'error'
  8316. })
  8317. })
  8318. },
  8319. // 按周填报获取相关任务
  8320. async getWeeklyTaskList(item) {
  8321. console.log(item, '<=== 数据')
  8322. const { projectId, groupId, stage, taskId } = item
  8323. console.log(projectId, groupId, stage)
  8324. let parms = { projectId, isSubstitude: 0 }
  8325. groupId ? parms.groupId = groupId : ''
  8326. stage ? parms.stage = stage : ''
  8327. const { data } = await this.postData('/task/getRecentTask', parms)
  8328. this.zhoBao.taskId = taskId
  8329. this.$set(this.zhoBao, 'taskList', data)
  8330. console.log(this.zhoBao)
  8331. },
  8332. // 封装 post 请求
  8333. postData(url, params) {
  8334. return new Promise((resolve, reject) => {
  8335. this.http.post(url, { ...params },
  8336. res => {
  8337. resolve(res)
  8338. },
  8339. error => {
  8340. this.$message({
  8341. message: error,
  8342. type: "error"
  8343. });
  8344. reject(error)
  8345. })
  8346. })
  8347. },
  8348. // 自定义事件
  8349. selectCal(obj) {
  8350. console.log(obj, '传数据来源')
  8351. if(obj.distinction == '1') {
  8352. this.zhoBao.projectAuditorId = obj.id
  8353. } else if(obj.distinction == '2') {
  8354. this.zhoBao.auditorFirst = obj.id
  8355. } else if(obj.distinction == '3') {
  8356. this.zhoBao.auditorSec = obj.id
  8357. } else if(obj.distinction == '4') {
  8358. this.zhoBao.auditorThird = obj.id
  8359. } else if(obj.distinction == '5') {
  8360. this.zhoBao.ccUserid = obj.id
  8361. } else if(obj.distinction == '12') {
  8362. this.usersListId = obj.id
  8363. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8364. this.searchKeyword = obj.name
  8365. } else {
  8366. this.searchKeyword = ''
  8367. }
  8368. this.searchScreen(0)
  8369. } else if(obj.distinction == '13') {
  8370. this.usersListId = obj.id
  8371. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8372. this.searchKeyword = obj.name
  8373. } else {
  8374. this.searchKeyword = ''
  8375. }
  8376. this.searchScreen(1)
  8377. }
  8378. }
  8379. },
  8380. created() {
  8381. this.getUsers()
  8382. let height = window.innerHeight;
  8383. this.tableHeight = height - 178;
  8384. const that = this;
  8385. window.onresize = function temp() {
  8386. that.tableHeight = window.innerHeight - 178;
  8387. };
  8388. this.toViewForm.companyId = this.user.companyId
  8389. this.initDrag([{
  8390. type: "LR",
  8391. domClass: {
  8392. // 中间分割线的名字
  8393. resize: "line-line",
  8394. // 左侧盒子的名字
  8395. left: "box-left",
  8396. // 右侧盒子的名字
  8397. right: "box-right",
  8398. // 父级的名字
  8399. box: "box-father",
  8400. },
  8401. otherInfo: {
  8402. // 限制左边栏最低宽度
  8403. leftWidth: 120,
  8404. },
  8405. },
  8406. {
  8407. type: "LR",
  8408. domClass: {
  8409. // 中间分割线的名字
  8410. resize: "line-second",
  8411. // 左侧盒子的名字
  8412. left: "left-laowang",
  8413. // 右侧盒子的名字
  8414. right: "box-second-father",
  8415. // 父级的名字
  8416. box: "grand",
  8417. },
  8418. otherInfo: {
  8419. // 限制左边栏最低宽度
  8420. leftWidth: 120,
  8421. },
  8422. },
  8423. ]);
  8424. }
  8425. };
  8426. </script>
  8427. <style lang="scss" scoped>
  8428. .fillWeekDialogVisiCustom {
  8429. width: 100%;
  8430. height: 70vh;
  8431. }
  8432. .fillWeekCustom {
  8433. .el-dialog__body {
  8434. padding: 20px 20px !important;
  8435. }
  8436. }
  8437. .photos {
  8438. position: relative;
  8439. display: flex;
  8440. flex-wrap: wrap;
  8441. }
  8442. .photos_img {
  8443. width: 120px;
  8444. height: 120px;
  8445. margin-right: 20px;
  8446. margin-bottom: 20px;
  8447. cursor: pointer;
  8448. img {
  8449. width: 100%;
  8450. height: 100%;
  8451. }
  8452. }
  8453. .paginatis {
  8454. padding: 10px 10px;
  8455. background: #f2f2f2;
  8456. }
  8457. .waiting {
  8458. color:orange;
  8459. }
  8460. .filledReportStyle {
  8461. color:#32CD32;
  8462. }
  8463. .RejectStyle {
  8464. color:red;
  8465. }
  8466. .waitSubmitStyle{
  8467. color: #409eff;
  8468. }
  8469. .chooseDate {
  8470. .waiting {
  8471. color: #20a0ff;
  8472. }
  8473. .filledReportStyle {
  8474. color:#20a0ff;
  8475. }
  8476. .RejectStyle {
  8477. color: #20a0ff;
  8478. }
  8479. .waitSubmitStyle{
  8480. color: #20a0ff;
  8481. }
  8482. }
  8483. .allDaily {
  8484. width:100%;
  8485. }
  8486. .report_title {
  8487. padding:10px 0;
  8488. color:#666;
  8489. }
  8490. .clearfix {
  8491. overflow-x: auto;
  8492. white-space: nowrap;
  8493. padding: 15px 0 10px 0;
  8494. // overflow-y: hidden;
  8495. .date_item {
  8496. padding: 0 3px;
  8497. cursor: pointer;
  8498. position: relative;
  8499. }
  8500. .chooseDate {
  8501. position: absolute;
  8502. bottom: -3px;
  8503. width: 37px;
  8504. height: 2px;
  8505. left: 14px;
  8506. background: #20a0ff;
  8507. }
  8508. }
  8509. .one_daily {
  8510. i {
  8511. color: #9ed0ff;
  8512. margin-right: 5px;
  8513. }
  8514. .one_daily_body {
  8515. padding: 10px 0px;
  8516. p {
  8517. margin: 0;
  8518. line-height: 30px;
  8519. }
  8520. }
  8521. ul {
  8522. padding: 0;
  8523. }
  8524. }
  8525. .checkbtn {
  8526. float: right;
  8527. margin-top: -10px;
  8528. }
  8529. .selConStyle{
  8530. margin-top:9rem;
  8531. margin-bottom:11rem;
  8532. .selConStyle_title{
  8533. height: 3rem;
  8534. text-align: center;
  8535. font-size: 17px;
  8536. }
  8537. .el-select{
  8538. margin: 0 15%;
  8539. width: 70%;
  8540. }
  8541. }
  8542. </style>
  8543. <style lang="scss">
  8544. /*去除upload组件过渡效果*/
  8545. .photos .el-upload-list__item {
  8546. transition: none !important;
  8547. }
  8548. .daily {
  8549. .el-card__body {
  8550. height: 80%;
  8551. overflow-y: auto;
  8552. }
  8553. .el-card__header {
  8554. padding: 0 20px;
  8555. }
  8556. }
  8557. .membListClass{
  8558. .el-dialog__body{
  8559. padding-top: 10px;
  8560. }
  8561. }
  8562. // .editReportDialog .el-dialog__footer{
  8563. // position: sticky;
  8564. // bottom: 0;
  8565. // background: #fff;
  8566. // height: 70px;
  8567. // z-index: 1010;
  8568. // }
  8569. .editReportDialog{
  8570. min-width: 800px;
  8571. }
  8572. .touruxiangmu{
  8573. max-width: 1000px;
  8574. }
  8575. </style>
  8576. <style scoped>
  8577. /* 项目标签的样式 */
  8578. .el-tag + .el-tag {
  8579. margin-left: 10px;
  8580. }
  8581. .button-new-tag {
  8582. margin-left: 10px;
  8583. height: 32px;
  8584. line-height: 30px;
  8585. padding-top: 0;
  8586. padding-bottom: 0;
  8587. }
  8588. .input-new-tag {
  8589. width: 90px;
  8590. margin-left: 10px;
  8591. vertical-align: bottom;
  8592. }
  8593. .selectworktime .el-table__fixed-body-wrapper{
  8594. top: 48px !important;
  8595. }
  8596. .selectworktime_export .selectworktime_export_l{
  8597. width: 650px;
  8598. float: left;
  8599. height: 42px;
  8600. }
  8601. .approvalProcessBox{
  8602. margin-left: 30px;
  8603. font-size: 14px;
  8604. line-height: 16px;
  8605. cursor: pointer;
  8606. }
  8607. .approvalProcessBox i {
  8608. margin-right: 0;
  8609. height: 16px;
  8610. width: 16px;
  8611. display: inline-block;
  8612. transform: scale(1.2);
  8613. position: relative;
  8614. top: 0.5px;
  8615. color: #409eff;
  8616. }
  8617. .approvalProcessBox .approvalProcessClick{
  8618. cursor: pointer;
  8619. color: #409eff;
  8620. font-size: 14px;
  8621. }
  8622. .approvalProcessBox:hover .approvalProcessClick{
  8623. color: #3485fb;
  8624. }
  8625. </style>
  8626. <style lang="scss" scoped>
  8627. // 加班样式
  8628. .overtime {
  8629. display: inline-block;
  8630. margin-left: 20px;
  8631. input {
  8632. display: inline-block;
  8633. margin-top: 5px;
  8634. }
  8635. }
  8636. .plus {
  8637. display: inline-block;
  8638. }
  8639. // .tages {
  8640. // float: right;
  8641. // }
  8642. .overtime {
  8643. display: inline-block;
  8644. margin-left: 30px;
  8645. }
  8646. .bloks {
  8647. display: inline-block;
  8648. width: 380px;
  8649. }
  8650. .zhiss {
  8651. display: flex;
  8652. justify-content: space-around;
  8653. align-items: center;
  8654. }
  8655. .zhoFel {
  8656. display: flex;
  8657. justify-content: space-between;
  8658. align-items: center;
  8659. }
  8660. // 左右滑动样式
  8661. .line {
  8662. width: 30px;
  8663. /* height: 500px; */
  8664. background: #f2f2f2;
  8665. cursor: w-resize;
  8666. }
  8667. .box-father {
  8668. border: 8px solid #000;
  8669. }
  8670. .line-second {
  8671. width: 10px;
  8672. /* background: red; */
  8673. }
  8674. .flex {
  8675. display: flex;
  8676. width: 100%;
  8677. }
  8678. .box-left {
  8679. flex: 0 0 400px;
  8680. /* height: 600px; */
  8681. /* background: blue; */
  8682. }
  8683. .box-right {
  8684. /* height: 600px; */
  8685. /* background: green; */
  8686. flex: 1;
  8687. }
  8688. .box-postion {
  8689. width: 200px;
  8690. /* height: 400px; */
  8691. background: #ccc;
  8692. }
  8693. .custom-tree-node {
  8694. flex: 1;
  8695. display: flex;
  8696. align-items: center;
  8697. justify-content: space-between;
  8698. font-size: 14px;
  8699. padding-right: 8px;
  8700. }
  8701. .daitianrbao {
  8702. width: 100%;
  8703. box-sizing: border-box;
  8704. height: 40px;
  8705. border-radius: 4px;
  8706. border: 1px solid #DCDFE6;
  8707. overflow: hidden;
  8708. text-overflow: ellipsis;
  8709. display: flex;
  8710. // align-items: center;
  8711. }
  8712. .daitianrbao .spnn {
  8713. display: inline-block;
  8714. box-sizing: border-box;
  8715. padding: 0 15px;
  8716. overflow: hidden;
  8717. text-overflow: ellipsis;
  8718. }
  8719. .daitianrbao .hover {
  8720. color: #DCDFE6 !important;
  8721. }
  8722. </style>