daily.vue 476 KB

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