daily.vue 484 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173
  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" @keyup.enter.native="seluserforText()" 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="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  132. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  133. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  134. <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>
  135. <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>
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  137. <!--部门负责人给个导出工时的功能 -->
  138. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  139. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  140. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  141. <el-link type="primary" v-if="user.roleName == '超级管理员' && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">日报审核修改</el-link>
  142. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  143. </span>
  144. </div>
  145. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  146. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  147. <i class="fa fa-circle"></i>
  148. <!-- {{item1.name}} -->
  149. <span v-if="user.userNameNeedTranslate == '1'">
  150. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  151. </span>
  152. <span v-if="user.userNameNeedTranslate != '1'">
  153. {{item1.name}}
  154. </span>
  155. <span style="margin-left:30px;">
  156. <span style="margin-right:20px;">
  157. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  158. <!-- 工作总时长: -->
  159. {{$t('other.totalWorkingHours')}}
  160. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  161. <span >{{item1.reportTime | amounts}}</span>h
  162. </span>
  163. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  164. <i class="iconfont firerock-iconliucheng1"></i>
  165. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  166. <!-- 审批流程 -->
  167. {{$t('other.approvalProcess')}}
  168. </span>
  169. </span>
  170. </span>
  171. <div class="checkbtn" style="padding-right:20px;">
  172. <!--编辑和删除日报-->
  173. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  176. </div>
  177. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  178. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  179. </div>
  180. <div class="one_daily_body">
  181. <el-timeline>
  182. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  183. <el-card shadow="never">
  184. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  185. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  186. <span v-if="user.company.packageEngineering == 0">
  187. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  188. <span v-if="user.timeType.reportAuditType == 7" >
  189. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  190. <span v-if="item2.deptAuditorName">、</span>
  191. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  192. </span>
  193. <span v-else>
  194. <span v-if="item2.isDeptAudit==0">
  195. <span v-if="item2.projectAuditState==0">
  196. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  197. <span v-if="item2.projectAuditorName != null">(
  198. <!-- {{item2.projectAuditorName}} -->
  199. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  200. )</span>
  201. <!-- 审核 --> {{$t('other.audit')}}
  202. </span>
  203. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  204. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  205. <span v-if="item2.projectAuditorName != null">(
  206. <!-- {{item2.projectAuditorName}} -->
  207. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  208. )</span>
  209. <!-- 审核通过 --> {{$t('state.approved')}}
  210. </span>
  211. </span>
  212. <span v-else-if="item2.isDeptAudit==1">
  213. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  214. ({{$t('other.await')}}
  215. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  216. {{$t('other.audit')}})
  217. </span>
  218. </span>
  219. ]</span>
  220. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  221. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  222. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  223. </span>
  224. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  225. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  226. </span>
  227. <!-- <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> -->
  228. <span v-if="user.company.packageEngineering == 1">
  229. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  230. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  231. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  233. (
  234. <!-- <span v-if="user.userNameNeedTranslate != 1">
  235. {{item2.projectAuditorName}}
  236. </span>
  237. <span v-if="user.userNameNeedTranslate == 1">
  238. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  239. </span> -->
  240. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  241. )
  242. </span>{{$t('other.audit')}} ]</span>
  243. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  244. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  245. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  246. </span>
  247. <!--每个项目上单独审核 -->
  248. <span style="float:right;">
  249. <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>
  250. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  251. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  252. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  253. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  254. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  255. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  256. <!--自己可以撤回待审核状态的报告 -->
  257. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  258. </span>
  259. </p>
  260. <p v-if="user.companyId == yuzhongCompId">
  261. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  262. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  263. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  264. <!--任务分组和阶段 -->
  265. <p v-if="item2.groupId != 0">
  266. {{$t('other.taskGroup')}}:{{item2.groupName}}
  267. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  268. </p>
  269. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  270. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  271. <!-- 自定义日报文本 -->
  272. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  273. <p v-if="user.company.packageEngineering == 1">
  274. {{$t('other.professionalProgress')}}:
  275. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  276. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  277. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  278. </el-tooltip>
  279. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  280. <i class="iconfont firerock-iconshenhetongguo"></i>
  281. </el-tooltip>
  282. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  283. <i class="iconfont firerock-iconshenhebohui"></i>
  284. </el-tooltip>
  285. </span>
  286. </p>
  287. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  288. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  289. </p>
  290. <div v-if="item2.multiWorktime==0">
  291. <p style="display: inline-block;">{{$t('time.duration')}}:
  292. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  293. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  294. {{item2.time.toFixed(1)}}h
  295. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  296. </p>
  297. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  298. </div>
  299. <div v-if="item2.multiWorktime==1" >
  300. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  301. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  302. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  303. <p style="display: inline-block;">{{$t('time.duration')}}:
  304. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  305. {{timeItem.time.toFixed(1)}}h
  306. </p>
  307. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  308. </div>
  309. </div>
  310. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  311. <!--照片的显示 -->
  312. <p v-if="item2.pics != null && item2.pics.length > 0">
  313. <el-image v-for="(pic, index) in item2.pics" :key="index"
  314. style="width: 100px; height: 100px; margin-right:10px;"
  315. :src="pic"
  316. :preview-src-list="item2.pics">
  317. </el-image>
  318. </p>
  319. </el-card>
  320. </el-timeline-item>
  321. </el-timeline>
  322. </div>
  323. </div>
  324. <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>
  325. <!-- 简陋的无报告提示 -->
  326. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </el-card>
  333. </div>
  334. <!-- 工时推送日志弹窗 -->
  335. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  336. <template>
  337. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  338. </template>
  339. <template>
  340. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  341. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  342. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  343. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  344. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  345. <el-table-column prop="result" label="推送结果" width="250">
  346. <template slot-scope="scope">
  347. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  348. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  352. </el-table>
  353. </template>
  354. <span slot="footer" class="dialog-footer">
  355. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  356. </span>
  357. </el-dialog>
  358. <!-- 填写日报的dialog -->
  359. <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">
  360. <div style="height: 65vh;overflow: auto;">
  361. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  362. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  363. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  364. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  365. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  366. <span class="spnn" v-if="workForm.userNames">
  367. <span v-for="(item, index) in workForm.userNames" :key="index">
  368. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  369. <span v-if="index < workForm.userNames.length - 1">,</span>
  370. </span>
  371. </span>
  372. <span class="spnn hover" v-else>
  373. {{$t('defaultText.pleaseSelectAsubstitute')}}
  374. </span>
  375. </div>
  376. </el-form-item>
  377. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  378. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  379. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  380. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  381. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  382. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  383. <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>
  384. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  385. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  386. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  387. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  388. <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>
  389. <!-- AI智能填报 -->
  390. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  391. </el-form-item>
  392. <!--考勤时长显示-->
  393. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  394. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  395. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  396. </span>
  397. <!--批量填报和批量代填不显示考勤记录-->
  398. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  399. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  400. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  401. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  402. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  403. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  404. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  405. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  406. @click="refreshAttendance(workForm.createDate)"></el-button>
  407. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  408. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  409. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  410. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  411. </el-form-item>
  412. <!-- 000000 -->
  413. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  414. <div v-if="reportTimeType.multiWorktime==0">
  415. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  416. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  417. <el-select v-model="domain.timeType" style="width:200px;"
  418. v-if="reportTimeType.type == 0"
  419. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  420. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  421. @change="onTimeTypeChange(domain.timeType)">
  422. <el-option
  423. v-for="item in timeType"
  424. :key="item.value"
  425. :label="item.label"
  426. :value="item.value">
  427. </el-option>
  428. </el-select>
  429. <!-- 数字时长选择 -->
  430. <el-select v-model="domain.workingTime" style="width:200px;"
  431. v-if="reportTimeType.type == 1"
  432. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  433. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  434. @change="seleChn(0,domain)">
  435. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  436. </el-select>
  437. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  438. <span v-if="reportTimeType.type == 2">
  439. <!--时间范围选择 -->
  440. <el-time-picker
  441. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  442. v-model="domain.startTime"
  443. :placeholder="$t('time.startTime')"
  444. style="width:120px;"
  445. format="HH:mm"
  446. value-format="HH:mm"
  447. :picker-options="{
  448. start: '08:00',
  449. end: '23:30'
  450. }"
  451. @change="iptChang()">
  452. </el-time-picker> - <el-time-picker
  453. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  454. v-model="domain.endTime"
  455. :placeholder="$t('time.endTime')"
  456. style="width:120px;"
  457. format="HH:mm"
  458. value-format="HH:mm"
  459. :picker-options="{
  460. start: '08:00',
  461. end: '23:30',
  462. minTime: domain.startTime
  463. }"
  464. @change="iptChang()">
  465. </el-time-picker>
  466. </span>
  467. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  468. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  469. <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>
  470. </div>
  471. </el-form-item>
  472. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  473. :prop="'domains.' + index + '.reportTargetDeptId'"
  474. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  475. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  476. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  477. <span style="float: left">
  478. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  479. </span>
  480. </el-option>
  481. </el-select>
  482. <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>
  483. </el-form-item>
  484. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  485. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  486. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  487. @change="selectProject(domain, index)"
  488. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  489. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  490. <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">
  491. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  492. <span style="float: right;">{{ item.projectName }}</span>
  493. </el-option>
  494. </el-option-group>
  495. </el-select>
  496. <!--昱众不显示子项目-->
  497. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  498. <span style="margin-left:45px;">
  499. {{$t('lable.subproject')}}</span>
  500. <!--子项目 -->
  501. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  502. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  503. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  504. </el-select>
  505. </template>
  506. <template v-if="user.companyId == yuzhongCompId">
  507. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  508. <!--角色选择 -->
  509. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  510. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  511. <el-option
  512. v-for="item in roleList"
  513. :key="item.value"
  514. :label="item.label"
  515. :value="item.value">
  516. </el-option>
  517. </el-select>
  518. </template>
  519. <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%;"
  520. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  521. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  522. </el-link>
  523. <!-- <el-link type="primary" v-if="canEdit"
  524. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  525. </el-form-item>
  526. <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">
  527. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  528. </el-form-item>
  529. <!--如果设置了工时成本预警的预算成本项-->
  530. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  531. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  532. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  533. </el-select>
  534. </el-form-item>
  535. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  536. <template slot="label">
  537. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  538. <span >{{$t('lable.taskGrouping')}}</span>
  539. </template>
  540. <!-- 任务分组 -->
  541. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  542. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  543. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  544. </el-select>
  545. <template v-if="user.companyId == yuzhongCompId">
  546. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  547. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  548. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  549. <el-option
  550. v-for="item in domain.filteredRespList"
  551. :key="item.id"
  552. :label="item.jobRespon"
  553. :value="item.id">
  554. </el-option>
  555. </el-select>
  556. </template>
  557. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  558. <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>
  559. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  560. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  561. @change="changeStages(domain, index)"
  562. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  563. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  564. </el-select>
  565. </template>
  566. </el-form-item>
  567. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  568. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  569. <template slot="label">
  570. <span style="color:#FF0000;">*</span>
  571. <span >{{$t('other.projectAuditor')}}</span>
  572. </template>
  573. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  574. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  575. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  576. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  577. </el-option>
  578. </el-select>
  579. <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>
  580. </el-form-item>
  581. </div>
  582. <el-form-item v-if="user.companyId == yuzhongCompId">
  583. <template slot="label">
  584. <span style="color:#FF0000;">*</span>
  585. <span >工作内容</span>
  586. </template>
  587. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  588. :disabled="(workForm.domains[index].state>=2?false:true)" >
  589. <el-option
  590. v-for="item in domain.workContentList"
  591. :key="item.id"
  592. :label="item.workContext"
  593. :value="item.id">
  594. </el-option>
  595. </el-select>
  596. </el-form-item>
  597. <!-- 111111 -->
  598. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  599. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  600. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  601. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  602. <span v-else>{{item.name}}</span>
  603. </el-option>
  604. </el-select>
  605. <template v-if="user.timeType.auditLevel > 1">
  606. <i class="el-icon-right"></i>
  607. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-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. <template v-if="user.timeType.auditLevel > 2">
  615. <i class="el-icon-right"></i>
  616. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :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. </template>
  623. </el-form-item>
  624. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  625. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  626. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  627. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  628. <span v-else>{{item.name}}</span>
  629. </el-option>
  630. </el-select>
  631. </el-form-item>
  632. <!-- 相关维度/自定义维度 -->
  633. <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'">
  634. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  635. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  636. </el-option>
  637. </el-select>
  638. </el-form-item>
  639. <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'">
  640. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  641. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  642. </el-option>
  643. </el-select>
  644. </el-form-item>
  645. <!-- 相关数值 -->
  646. <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">
  647. <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>
  648. </el-form-item>
  649. <!-- 自定义文本 -->
  650. <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">
  651. <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>
  652. </el-form-item>
  653. <!--按比例填报-->
  654. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  655. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  656. <div style="width:400px;">
  657. <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>
  658. <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>
  659. </div>
  660. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  661. <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>
  662. </div>
  663. </el-form-item>
  664. <!--工程专业版本模式下, 各个专业的进度填报 -->
  665. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  666. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  667. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  668. <el-input size="mini" style="width:60px;" v-model="item.progress"
  669. @keyup.native="onProgressChange"
  670. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  671. </span>
  672. </el-form-item>
  673. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  674. <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))" >
  675. <template slot="label" v-if="user.timeType.taskRequired == 1">
  676. <span style="color:#FF0000;">*</span>
  677. <span >任务</span>
  678. </template>
  679. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  681. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  682. </el-select>
  683. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  684. </el-form-item>
  685. <!--针对依斯贝的SAP服务-->
  686. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  687. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  688. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  689. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  690. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  691. </el-select>
  692. </el-form-item>
  693. <!--工作事项-->
  694. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  695. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  696. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  697. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  698. </el-form-item>
  699. <!-- 拍照上传 -->
  700. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  701. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  702. <div class="photos">
  703. <div>
  704. <el-upload
  705. list-type="picture-card"
  706. :http-request="(file) => {return addImg(file, index)}"
  707. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  708. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  709. :file-list="domain.imgListUrl" :limit="9"
  710. :disabled="workForm.domains[index].state>=2?false:true">
  711. <i class="el-icon-plus"></i>
  712. </el-upload>
  713. </div>
  714. </div>
  715. </el-form-item>
  716. </div>
  717. <!--多个工作事项填报的情况 -->
  718. <div v-if="reportTimeType.multiWorktime==1">
  719. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  720. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  721. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  722. @change="selectProject(domain, index)"
  723. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  724. <!-- <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">
  725. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  726. <span style="float: right;">{{ item.projectName }}</span>
  727. </el-option> -->
  728. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  729. <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">
  730. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  731. <span style="float: right;">{{ item.projectName }}</span>
  732. </el-option>
  733. </el-option-group>
  734. </el-select>
  735. <template v-if="user.timeType.mainProjectState != 1">
  736. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  737. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  738. <!--子项目 -->
  739. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  740. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  741. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  742. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  743. </el-select>
  744. </template>
  745. <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;"
  746. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  747. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  748. </el-link>
  749. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  750. <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>
  751. </div>
  752. <!-- <el-link type="primary" v-if="canEdit"
  753. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  754. </el-form-item>
  755. <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">
  756. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  757. </el-form-item>
  758. <!--如果设置了工时成本预警的预算成本项-->
  759. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  760. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  761. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  762. </el-select>
  763. </el-form-item>
  764. <el-form-item v-if="user.company.packageProject == 1">
  765. <template slot="label">
  766. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  767. <span >{{$t('lable.taskGrouping')}}</span>
  768. </template>
  769. <!-- 任务分组 -->
  770. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  771. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  772. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  773. </el-select>
  774. <!-- 项目的阶段 -->
  775. <span v-if="domain.stages != null && domain.stages.length> 0"
  776. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  777. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  778. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  779. @change="changeStages(domain, index)"
  780. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  781. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  782. </el-select>
  783. </el-form-item>
  784. <el-form-item :label="$t('other.projectAuditor')" >
  785. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  786. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  787. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  788. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  789. </el-option>
  790. </el-select>
  791. <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>
  792. </el-form-item>
  793. <!--工程专业版本模式下, 各个专业的进度填报 -->
  794. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  795. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  796. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  797. <el-input size="mini" style="width:60px;" v-model="item.progress"
  798. @keyup.native="onProgressChange"
  799. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  800. </span>
  801. </el-form-item>
  802. <!-- 相关维度 -->
  803. <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'">
  804. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  805. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  806. </el-option>
  807. </el-select>
  808. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  809. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  810. </el-option>
  811. </el-select>
  812. </el-form-item>
  813. <!-- 相关数值 -->
  814. <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">
  815. <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>
  816. </el-form-item>
  817. <!-- 自定义文本 -->
  818. <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">
  819. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  820. </el-form-item>
  821. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  822. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  823. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  824. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  825. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  826. </el-select>
  827. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  828. </el-form-item>
  829. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  830. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  831. <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>
  832. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  833. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  834. <span v-if="reportTimeType.type == 2">
  835. <!-- <span> -->
  836. <!--时间范围选择 -->
  837. <el-time-picker
  838. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  839. v-model="timeItem.startTime"
  840. :placeholder="$t('time.startTime')"
  841. style="width:120px;"
  842. format="HH:mm"
  843. value-format="HH:mm"
  844. :picker-options="{
  845. start: '00:00',
  846. end: '23:59',
  847. }"
  848. @change="iptChangs()">
  849. </el-time-picker> - <el-time-picker
  850. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  851. v-model="timeItem.endTime"
  852. :placeholder="$t('time.endTime')"
  853. style="width:120px;"
  854. format="HH:mm"
  855. value-format="HH:mm"
  856. :picker-options="{
  857. start: '00:00',
  858. end: '23:59',
  859. minTime: timeItem.startTime
  860. }"
  861. @change="iptChangs()">
  862. </el-time-picker>
  863. </span>
  864. </el-form-item>
  865. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  866. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  867. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  868. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  869. ></el-input>
  870. </el-form-item>
  871. </div>
  872. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  873. </div>
  874. <!--照片的显示 -->
  875. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  876. <el-image v-for="(pic, index) in domain.pics" :key="index"
  877. style="width: 100px; height: 100px; margin-right:10px;"
  878. :src="pic"
  879. :preview-src-list="domain.pics">
  880. </el-image>
  881. </p>
  882. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  883. </div>
  884. <span id="workFormsItemBottom"></span>
  885. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  886. </el-form>
  887. </div>
  888. <span slot="footer" class="dialog-footer">
  889. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  890. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  891. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  892. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  893. <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>
  894. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  895. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  896. </span>
  897. </el-dialog>
  898. <!-- 按周填报 -->
  899. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  900. <!-- 按周填报-已填工时-点击 -->
  901. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  902. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  903. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  904. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  905. <el-table-column prop="state" :label="$t('state.states')">
  906. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  907. </el-table-column>
  908. </el-table>
  909. <span slot="footer" class="dialog-footer">
  910. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  911. </span>
  912. </el-dialog>
  913. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  914. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  915. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  916. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  917. <span class="spnn" v-if="workForm.userNames">
  918. <span v-for="(item, index) in workForm.userNames" :key="index">
  919. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  920. <span v-if="index < workForm.userNames.length - 1">,</span>
  921. </span>
  922. </span>
  923. <span class="spnn hover" v-else>
  924. {{$t('defaultText.pleaseSelectAsubstitute')}}
  925. </span>
  926. </div>
  927. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">下一步</el-button>
  928. </div>
  929. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  930. <el-form-item style="height:30px;margin-top:-72px;">
  931. <!-- <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> -->
  932. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  933. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  934. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  935. <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>
  936. <el-option
  937. v-for="item in fillProjectList"
  938. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  939. :key="item.id"
  940. :label="item.projectName + '\u3000' + item.projectCode"
  941. :value="item.id">
  942. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  943. <span style="float: right">{{ item.projectName }}</span>
  944. </el-option>
  945. </el-select>
  946. <span style="float:right;margin-right:10px;">选择项目</span>
  947. </el-form-item>
  948. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  949. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  950. <template slot-scope="scope">
  951. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  952. </template>
  953. </el-table-column>
  954. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  955. <template slot-scope="scope">
  956. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  957. <p v-else></p>
  958. </template>
  959. </el-table-column> -->
  960. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  961. <template slot-scope="scope">
  962. <div v-if="scope.row.canFill == 1">
  963. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  964. <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>
  965. <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>
  966. <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>
  967. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  968. </div>
  969. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  970. <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>
  971. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  972. </div>
  973. </div>
  974. <div v-else >
  975. <span style="color:#999999;">不可超前填报</span>
  976. </div>
  977. </template>
  978. </el-table-column>
  979. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  980. <template slot-scope="scope">
  981. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  982. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  983. </template>
  984. </el-table-column>
  985. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  986. <template slot-scope="scope">
  987. <div class="zhiss">
  988. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  989. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  990. </div>
  991. </template>
  992. </el-table-column>
  993. </el-table>
  994. </el-form>
  995. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  996. <span v-if="isSubstitude" style="float:left;color:orange;">*正在为【{{workForm.userNames}}】代填</span>
  997. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  998. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  999. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1000. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1001. <!--针对景昱,先检查工时是否存在异常-->
  1002. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1003. </span>
  1004. </el-dialog>
  1005. <!-- 重庆物奇私人定制的按周填报 -->
  1006. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1007. <div class="fillWeekDialogVisiCustom">
  1008. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1009. </div>
  1010. </el-dialog>
  1011. <!-- 选择时间 -->
  1012. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1013. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1014. <span slot="footer" class="dialog-footer">
  1015. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1016. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1017. </span>
  1018. </el-dialog>
  1019. <!-- 按周填报弹窗 -->
  1020. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1021. <div>
  1022. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1023. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1024. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1025. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1026. </el-select>
  1027. </div>
  1028. <!--如果设置了工时成本预警的预算成本项-->
  1029. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1030. <p>{{$t('lable.budgetSource')}}</p>
  1031. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1032. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1033. </el-select>
  1034. </div>
  1035. <!-- 任务分组 -->
  1036. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1037. <p>{{$t('lable.taskGrouping')}}</p>
  1038. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1039. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1040. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. </div>
  1043. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1044. <p>{{$t('other.inputStage')}}</p>
  1045. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1046. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1047. </el-select>
  1048. </div>
  1049. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1050. <p>{{$t('other.reviewer')}}</p>
  1051. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1052. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1053. </el-select>
  1054. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1055. </div>
  1056. <template v-if="user.timeType.reportAuditType == 3">
  1057. <div class="zhoFel">
  1058. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1059. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1060. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1061. </el-select>
  1062. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1063. </div>
  1064. <div class="zhoFel">
  1065. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1066. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1067. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1068. </el-select>
  1069. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1070. </div>
  1071. <div class="zhoFel">
  1072. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1073. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1074. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1075. </el-select>
  1076. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1077. </div>
  1078. <div class="zhoFel">
  1079. <p>{{ $t('chao-song-ren') }}</p>
  1080. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1081. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1082. </el-select>
  1083. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1084. </div>
  1085. </template>
  1086. <!-- 自定义维度 -->
  1087. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1088. <p>{{user.timeType.customDegreeName}}</p>
  1089. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1090. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1091. </el-select>
  1092. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1093. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1094. </el-select>
  1095. </div>
  1096. <!-- 自定义数值 -->
  1097. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1098. <p>{{user.timeType.customDataName}}</p>
  1099. <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>
  1100. </div>
  1101. <!-- 自定义文本 -->
  1102. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1103. <p>{{user.timeType.customTextName}}</p>
  1104. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1105. </div>
  1106. <!-- 选择任务 -->
  1107. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1108. <p>任务 / 里程碑</p>
  1109. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1110. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1111. </el-select>
  1112. </div>
  1113. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1114. <p>{{$t('other.timeSelection')}}</p>
  1115. <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>
  1116. </div>
  1117. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1118. <p>{{$t('other.chooseDuration')}}</p>
  1119. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1120. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1121. </el-select>
  1122. </div>
  1123. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1124. <p>{{$t('lable.percentageOfTime')}}</p>
  1125. <div style="width:400px;display: flex;align-items: center;">
  1126. <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>
  1127. <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>
  1128. </div>
  1129. </div>
  1130. <div class="zhoFel">
  1131. <p>{{$t('other.workMatters')}}</p>
  1132. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1133. </div>
  1134. </div>
  1135. <span slot="footer" class="dialog-footer">
  1136. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1137. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1138. </span>
  1139. </el-dialog>
  1140. <!--导出报表条件选择 -->
  1141. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1142. <el-form ref="form3" :model="exportParam" >
  1143. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1144. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1145. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1146. </el-select>
  1147. </el-form-item>
  1148. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1149. <!-- <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>
  1150. <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> -->
  1151. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1152. </el-form-item>
  1153. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1154. <el-date-picker
  1155. v-model="exportParam.dateRange" :editable="false"
  1156. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1157. :range-separator="$t('other.to')"
  1158. type="daterange"
  1159. :start-placeholder="$t('time.startDate')"
  1160. :end-placeholder="$t('time.endDate')"
  1161. ></el-date-picker>
  1162. </el-form-item>
  1163. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1164. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1165. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1166. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1167. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1168. </el-select>
  1169. </el-form-item>
  1170. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1171. <div class="exportReportRadio">
  1172. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1173. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1174. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1175. <i class="el-icon-question"></i>
  1176. </el-tooltip>
  1177. </div>
  1178. </el-form-item>
  1179. </el-form>
  1180. <div slot="footer" class="dialog-footer">
  1181. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1182. </div>
  1183. </el-dialog>
  1184. <!--导出报表条件选择 -->
  1185. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1186. <el-form ref="form3" :model="exportParam" >
  1187. <el-form-item prop="range" :label="$t('time.dateRange')">
  1188. <el-date-picker
  1189. v-model="exportParam.dateRange" :editable="false"
  1190. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1191. :clearable="true"
  1192. :range-separator="$t('other.to')"
  1193. type="daterange"
  1194. :start-placeholder="$t('time.startDate')"
  1195. :end-placeholder="$t('time.endDate')"
  1196. ></el-date-picker>
  1197. </el-form-item>
  1198. </el-form>
  1199. <div slot="footer" class="dialog-footer">
  1200. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1201. </div>
  1202. </el-dialog>
  1203. <!--人员列表 -->
  1204. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1205. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1206. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1207. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1208. <el-table-column type="selection"></el-table-column>
  1209. <el-table-column prop="label" :label="$t('lable.name')" >
  1210. <template slot-scope="scope">
  1211. <span>
  1212. <!-- {{(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}} -->
  1213. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1214. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1215. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1216. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1217. </span>
  1218. <span v-else>
  1219. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1221. </span>
  1222. </span>
  1223. </template>
  1224. </el-table-column>
  1225. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1226. <template slot-scope="scope">
  1227. <div>
  1228. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1229. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1230. </div>
  1231. </template>
  1232. </el-table-column>
  1233. </el-table>
  1234. </el-tab-pane>
  1235. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1236. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1237. <el-table-column prop="label" :label="$t('lable.name')" >
  1238. <template slot-scope="scope">
  1239. <!-- <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> -->
  1240. <!-- <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> -->
  1241. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1242. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1243. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1244. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1245. </span>
  1246. <span v-else>
  1247. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1248. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1249. </span>
  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. </el-tab-pane>
  1262. </el-tabs>
  1263. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1264. <el-table-column type="selection"></el-table-column>
  1265. <el-table-column prop="label" :label="$t('lable.name')" >
  1266. <template slot-scope="scope">
  1267. <div>
  1268. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1269. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1270. </div>
  1271. </template>
  1272. </el-table-column>
  1273. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1274. <template slot-scope="scope">
  1275. <div>
  1276. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1277. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1278. </div>
  1279. </template>
  1280. </el-table-column>
  1281. </el-table>
  1282. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1283. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1284. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1285. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1286. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1287. </div>
  1288. </el-dialog>
  1289. <!-- 日报审核修改 -->
  1290. <el-dialog
  1291. title="日报审核修改"
  1292. :visible.sync="reportLogCheckDialog"
  1293. width="30%"
  1294. :before-close="handleClose">
  1295. <el-form ref="form3" :model="exportReportLogParam" >
  1296. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1297. <el-date-picker
  1298. v-model="exportReportLogParam.dateRange" :editable="false"
  1299. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1300. :range-separator="$t('other.to')"
  1301. type="daterange"
  1302. :start-placeholder="$t('time.startDate')"
  1303. :end-placeholder="$t('time.endDate')"
  1304. ></el-date-picker>
  1305. </el-form-item>
  1306. </el-form>
  1307. <el-link type="primary" @click="exportReportLog">导出日报审核记录数据</el-link>
  1308. <br>
  1309. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1310. <el-link type="primary" @click="importReportLog">导入日报审核记录修改数据</el-link></el-upload>
  1311. <span slot="footer" class="dialog-footer">
  1312. <el-button type="primary" @click="reportLogCheckDialog = false">关闭</el-button>
  1313. </span>
  1314. </el-dialog>
  1315. <!-- 按部门选择人员 -->
  1316. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1317. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1318. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1319. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1320. </el-input>
  1321. <div class="tree" style="height:400px">
  1322. <el-scrollbar style="height:100%">
  1323. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1324. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1325. highlight-current :filter-node-method="filterNode">
  1326. <span class="custom-tree-node" slot-scope="{ node }">
  1327. <span v-if="user.userNameNeedTranslate == '1'">
  1328. <span v-if="node.data.children">
  1329. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1330. </span>
  1331. <span v-else>
  1332. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1333. </span>
  1334. </span>
  1335. <span v-if="user.userNameNeedTranslate != '1'">
  1336. {{ node.label }}
  1337. </span>
  1338. <!-- {{ node.label }} -->
  1339. </span>
  1340. </el-tree>
  1341. </el-scrollbar>
  1342. </div>
  1343. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1344. <div slot="footer" class="dialog-footer">
  1345. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1346. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1347. </div>
  1348. </el-dialog>
  1349. <el-dialog
  1350. v-if="monthWorkTimeDialog"
  1351. :visible.sync="monthWorkTimeDialog"
  1352. :close-on-click-modal="false"
  1353. customClass="customWidth selectworktime"
  1354. width="92%"
  1355. top="60px"
  1356. >
  1357. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1358. <el-tabs v-model="activeName" @tab-click="handleClick">
  1359. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1360. <div class="selectworktime_export" style="margin-top:10px;">
  1361. <div class="selectworktime_export_l">
  1362. <el-date-picker
  1363. class="selecteworktime_datapick"
  1364. v-model="WorktimeDatepickValue"
  1365. value-format="yyyy-MM-dd"
  1366. type="daterange"
  1367. align="right"
  1368. unlink-panels
  1369. :range-separator="$t('other.to')"
  1370. :start-placeholder="$t('time.startDate')"
  1371. :end-placeholder="$t('time.endDate')"
  1372. :default-time="['12:00:00', '12:00:00']"
  1373. size="small"
  1374. popper-class="selecteorktime_datapick_popper"
  1375. @change="showMonthWorkTime()"
  1376. >
  1377. </el-date-picker>
  1378. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1379. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1380. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1381. <!-- 222 -->
  1382. </div>
  1383. <div>
  1384. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1385. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1386. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1387. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1388. </el-input>
  1389. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1390. </div>
  1391. <div style="float: left; height:32px; padding-top:10px;">
  1392. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">待审核</span>
  1393. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">已通过</span>
  1394. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">已驳回</span>
  1395. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">未提交</span>
  1396. </div>
  1397. <div style="float: right; vertical-align: middle;height:32px">
  1398. <el-link
  1399. type="primary"
  1400. @click="exportMembWorkHours()"
  1401. >{{$t('export.exportData')}}</el-link
  1402. >
  1403. </div>
  1404. </div>
  1405. <el-table ref="hasworkTbl"
  1406. :data="monthWorkDataS"
  1407. v-el-table-infinite-scroll="listScroll"
  1408. border
  1409. :height="'70vh'"
  1410. highlight-current-row
  1411. style="width: 100%"
  1412. v-loading="tbload"
  1413. :lazy="true"
  1414. :cell-style="hasworkTblCellStyle"
  1415. >
  1416. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1417. <template slot-scope="scope">
  1418. {{ scope.$index + 1 }}
  1419. </template>
  1420. </el-table-column>
  1421. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1422. <template slot-scope="scope">
  1423. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1424. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1425. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1426. <!-- {{scope.row.name}} -->
  1427. </span>
  1428. </template>
  1429. </el-table-column>
  1430. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1431. <template slot-scope="scope">
  1432. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1433. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1434. </template>
  1435. </el-table-column>
  1436. <el-table-column
  1437. min-width="60"
  1438. v-for="(item, index) in pickDateArray"
  1439. :key="index"
  1440. :label="item"
  1441. align="center"
  1442. >
  1443. <template slot="header" slot-scope="scope">
  1444. <div>{{ scope.column.label.dateStr }}</div>
  1445. <div>{{ scope.column.label.weekStr }}</div>
  1446. </template>
  1447. <template slot-scope="scope">
  1448. <div
  1449. v-if="
  1450. scope.row.worktimeList.filter(
  1451. (w) =>
  1452. w.createDate==item.date
  1453. ).length > 0 &&
  1454. scope.row.worktimeList.filter(
  1455. (w) =>w.createDate==item.date
  1456. )[0].workingTime < reportTimeType.allday
  1457. "
  1458. >
  1459. {{
  1460. scope.row.worktimeList.filter(
  1461. (w) =>w.createDate==item.date
  1462. )[0].workingTime.toFixed(1)
  1463. }}
  1464. </div>
  1465. <div
  1466. v-if="
  1467. scope.row.worktimeList.filter(
  1468. (w) =>w.createDate==item.date
  1469. ).length > 0 &&
  1470. scope.row.worktimeList.filter(
  1471. (w) =>w.createDate==item.date
  1472. )[0].workingTime > reportTimeType.allday
  1473. "
  1474. >
  1475. {{
  1476. scope.row.worktimeList.filter(
  1477. (w) =>w.createDate==item.date
  1478. )[0].workingTime.toFixed(1)
  1479. }}
  1480. </div>
  1481. <div
  1482. v-if="
  1483. scope.row.worktimeList.filter(
  1484. (w) =>w.createDate==item.date
  1485. ).length > 0 &&
  1486. scope.row.worktimeList.filter(
  1487. (w) =>w.createDate==item.date
  1488. )[0].workingTime == reportTimeType.allday
  1489. "
  1490. >
  1491. {{
  1492. scope.row.worktimeList.filter(
  1493. (w) =>w.createDate==item.date
  1494. )[0].workingTime
  1495. }}
  1496. </div>
  1497. <div
  1498. v-if="
  1499. scope.row.worktimeList.filter(
  1500. (w) =>w.createDate==item.date
  1501. ).length == 0
  1502. "
  1503. >
  1504. 0
  1505. </div>
  1506. <div
  1507. v-if="
  1508. scope.row.worktimeList.filter(
  1509. (w) =>w.createDate==item.date
  1510. ).length > 0 &&
  1511. typeof scope.row.worktimeList.filter(
  1512. (w) =>w.createDate==item.date
  1513. )[0].workingTime == 'string'
  1514. "
  1515. >
  1516. {{
  1517. scope.row.worktimeList.filter(
  1518. (w) =>w.createDate==item.date
  1519. )[0].workingTime
  1520. }}
  1521. </div>
  1522. </template>
  1523. </el-table-column>
  1524. </el-table>
  1525. <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>
  1526. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1527. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1528. <label style="font-size: 16px">员工每日已填报工时数</label>
  1529. <el-link
  1530. type="primary"
  1531. style="float: right; margin-right: 60px"
  1532. @click="exportMembWorkHours()"
  1533. >导出已填报数据</el-link
  1534. > -->
  1535. <!-- <el-button >导出</el-button> -->
  1536. <!-- </div> -->
  1537. </el-tab-pane>
  1538. <el-tab-pane label="未提交人员列表" name="second" >
  1539. <div class="selectworktime_export" style="margin-top:10px">
  1540. <div class="selectworktime_export_l">
  1541. <el-date-picker
  1542. class="selecteworktime_datapick"
  1543. v-model="WorktimeDatepickValue"
  1544. value-format="yyyy-MM-dd"
  1545. type="daterange"
  1546. align="right"
  1547. unlink-panels
  1548. :range-separator="$t('other.to')"
  1549. :start-placeholder="$t('time.startDate')"
  1550. :end-placeholder="$t('time.endDate')"
  1551. :default-time="['12:00:00', '12:00:00']"
  1552. size="small"
  1553. popper-class="selecteorktime_datapick_popper"
  1554. @change="showMonthNotWorkTime()"
  1555. >
  1556. </el-date-picker>
  1557. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1558. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1559. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1560. </div>
  1561. <div>
  1562. <div style="margin-top:10px;">
  1563. <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>
  1564. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1565. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1566. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1567. </el-input>
  1568. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1569. <el-link
  1570. type="primary"
  1571. style="float: right; vertical-align: middle;height:32px"
  1572. @click="exportMembNotWorkHours()"
  1573. >{{$t('export.exportData')}}</el-link
  1574. >
  1575. </div>
  1576. </div>
  1577. </div>
  1578. <el-table
  1579. ref="hasworkTbl2"
  1580. :data="monthNotWorkDateS"
  1581. v-el-table-infinite-scroll="notListScroll"
  1582. border
  1583. :height="'70vh'"
  1584. highlight-current-row
  1585. style="width: 100%"
  1586. v-loading="tbload"
  1587. lazy
  1588. >
  1589. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1590. <template slot-scope="scope">
  1591. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1592. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1593. </template>
  1594. </el-table-column>
  1595. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1596. <template slot-scope="scope">
  1597. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1598. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1599. </template>
  1600. </el-table-column>
  1601. <el-table-column
  1602. min-width="200"
  1603. :label="$t('weekDay.date')"
  1604. align="center"
  1605. prop="createDate"
  1606. >
  1607. </el-table-column>
  1608. <el-table-column
  1609. min-width="200"
  1610. :label="$t('state.states')"
  1611. align="center"
  1612. prop="status"
  1613. />
  1614. <el-table-column
  1615. min-width="200"
  1616. :label="$t('other.attendanceData')"
  1617. prop="cardTime"
  1618. align="center"
  1619. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1620. </el-table>
  1621. <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>
  1622. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1623. </el-tab-pane>
  1624. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1625. <div class="selectworktime_export" style="margin-top:10px;">
  1626. <div class="selectworktime_export_l">
  1627. <el-date-picker
  1628. class="selecteworktime_datapick"
  1629. v-model="WorktimeDatepickValue"
  1630. value-format="yyyy-MM-dd"
  1631. type="daterange"
  1632. align="right"
  1633. unlink-panels
  1634. :range-separator="$t('other.to')"
  1635. :start-placeholder="$t('time.startDate')"
  1636. :end-placeholder="$t('time.endDate')"
  1637. :default-time="['12:00:00', '12:00:00']"
  1638. size="small"
  1639. popper-class="selecteorktime_datapick_popper"
  1640. @change="showMonthWorkTimeReminder()"
  1641. >
  1642. </el-date-picker>
  1643. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1644. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1645. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1646. </div>
  1647. <div>
  1648. <div style="margin-top:10px;">
  1649. <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>
  1650. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1651. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1652. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1653. </el-input>
  1654. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1655. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1656. </div>
  1657. </div>
  1658. <div style="float: right; vertical-align: middle;height:32px">
  1659. <el-link
  1660. type="primary"
  1661. @click="changeReminder()"
  1662. >{{'变更提醒'}}</el-link
  1663. >
  1664. <el-link
  1665. type="primary"
  1666. @click="exportMembWorkHoursReminder()"
  1667. >{{$t('export.exportData')}}</el-link
  1668. >
  1669. </div>
  1670. </div>
  1671. <el-table ref="hasworkTbl"
  1672. :data="monthWorkDataS"
  1673. v-el-table-infinite-scroll="listScroll"
  1674. border
  1675. :height="'70vh'"
  1676. highlight-current-row
  1677. style="width: 100%"
  1678. v-loading="tbload"
  1679. :lazy="true"
  1680. >
  1681. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1682. <template slot-scope="scope">
  1683. {{ scope.row.createDate}}
  1684. </template>
  1685. </el-table-column>
  1686. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1687. <template slot-scope="scope">
  1688. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1689. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1690. <!-- {{scope.row.name}} -->
  1691. </template>
  1692. </el-table-column>
  1693. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1694. <template slot-scope="scope">
  1695. {{scope.row.invokeValue}}
  1696. </template>
  1697. </el-table-column>
  1698. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1699. <template slot-scope="scope">
  1700. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1701. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1702. </template>
  1703. </el-table-column>
  1704. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1705. <template slot-scope="scope">
  1706. {{ scope.row.workingTime}}
  1707. </template>
  1708. </el-table-column>
  1709. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1710. <template slot-scope="scope">
  1711. {{ scope.row.cardTime}}
  1712. </template>
  1713. </el-table-column>
  1714. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1715. <template slot-scope="scope">
  1716. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1717. </template>
  1718. </el-table-column>
  1719. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1720. <template slot-scope="scope">
  1721. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1722. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1723. </template>
  1724. </el-table-column>
  1725. </el-table>
  1726. <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>
  1727. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1728. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1729. <label style="font-size: 16px">员工每日已填报工时数</label>
  1730. <el-link
  1731. type="primary"
  1732. style="float: right; margin-right: 60px"
  1733. @click="exportMembWorkHours()"
  1734. >导出已填报数据</el-link
  1735. > -->
  1736. <!-- <el-button >导出</el-button> -->
  1737. <!-- </div> -->
  1738. </el-tab-pane>
  1739. </el-tabs>
  1740. </el-dialog>
  1741. <!--驳回弹出框 -->
  1742. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1743. <div>
  1744. <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')" />
  1745. </div>
  1746. <div slot="footer" class="dialog-footer">
  1747. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1748. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1749. </div>
  1750. </el-dialog>
  1751. <!-- 通过弹出框 -->
  1752. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1753. <div>
  1754. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1755. </div>
  1756. <div slot="footer" class="dialog-footer">
  1757. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1758. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1759. </div>
  1760. </el-dialog>
  1761. <!--批量导入日报 -->
  1762. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1763. <p>1. {{$t('other.download')}}
  1764. <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>
  1765. </p>
  1766. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1767. <p style="display: flex;justify-content: center;">
  1768. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1769. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1770. </el-upload>
  1771. </p>
  1772. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1773. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1774. </div>
  1775. </el-dialog>
  1776. <!-- 工时导入记录弹窗 -->
  1777. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1778. <div style="height: 452px">
  1779. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1780. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1781. <el-table-column prop="userName" :label="$t('other.operator')">
  1782. <template slot-scope="scope">
  1783. <div>
  1784. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1785. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1786. </div>
  1787. </template>
  1788. </el-table-column>
  1789. <el-table-column prop="datel" :label="$t('other.document')">
  1790. <template slot-scope="scope">
  1791. <div>
  1792. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1793. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1794. </div>
  1795. </template>
  1796. </el-table-column>
  1797. <el-table-column label="操作" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1798. <template slot-scope="scope">
  1799. <div>
  1800. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1801. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1802. </div>
  1803. </template>
  1804. </el-table-column>
  1805. </el-table>
  1806. <el-col :span="24" class="paginatis">
  1807. <el-pagination
  1808. @size-change="handleSizeChange"
  1809. @current-change="handleCurrentChange"
  1810. :page-sizes="[20 , 50 , 80 , 100]"
  1811. :page-size="20"
  1812. layout="total, sizes, prev, pager, next"
  1813. :total="toViewForm.total"
  1814. style="float:right;"
  1815. ></el-pagination>
  1816. </el-col>
  1817. </div>
  1818. </el-dialog>
  1819. <!--基于企业微信考勤数据的工时导入 -->
  1820. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1821. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1822. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1823. </el-step>
  1824. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1825. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1826. </el-steps>
  1827. <div v-if="active==0" style="padding:30px;height:360px;">
  1828. <div style="margin-top:50px;margin-left:280px;">
  1829. <el-date-picker
  1830. v-model="importWxParam.date" :editable="false"
  1831. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1832. :clearable="true"
  1833. :range-separator="$t('other.to')"
  1834. type="daterange"
  1835. :start-placeholder="$t('time.startDate')"
  1836. :end-placeholder="$t('time.endDate')"
  1837. @change="loadCheckInData"
  1838. ></el-date-picker>
  1839. </div>
  1840. </div>
  1841. <div v-if="active==1" style="padding:10px;">
  1842. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1843. style="width: 100%;margin-top:5px;" >
  1844. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1845. <template slot-scope="scope">
  1846. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1847. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1848. </template>
  1849. </el-table-column>
  1850. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1851. </el-table-column>
  1852. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1853. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1854. <template slot-scope="scope">
  1855. <div>
  1856. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1857. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1858. </div>
  1859. </template>
  1860. </el-table-column>
  1861. <el-table-column prop="departmentName" label="部门" >
  1862. <template slot-scope="scope">
  1863. <div>
  1864. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1865. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1866. </div>
  1867. </template>
  1868. </el-table-column>
  1869. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1870. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1871. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1872. <template slot-scope="scope">
  1873. {{scope.row.workHours.toFixed(1)}}h
  1874. </template>
  1875. </el-table-column>
  1876. </el-table>
  1877. </div>
  1878. <div v-if="active==2" >
  1879. <p style="display: flex;justify-content: center;height:390px;">
  1880. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1881. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1882. </el-upload>
  1883. </p>
  1884. </div>
  1885. <div slot="title">
  1886. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1887. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1888. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1889. <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>
  1890. <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>
  1891. <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>
  1892. </div>
  1893. <span slot="footer">
  1894. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1895. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1896. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1897. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1898. </span>
  1899. </el-dialog>
  1900. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1901. <p style="display: flex;justify-content: center;height:100px;">
  1902. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1903. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1904. </el-upload>
  1905. </p>
  1906. </el-dialog>
  1907. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1908. <div>
  1909. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1910. v-model="deleteReportParam.date" :editable="false"
  1911. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1912. :clearable="true"
  1913. :range-separator="$t('other.to')"
  1914. type="daterange"
  1915. :start-placeholder="$t('time.startDate')"
  1916. :end-placeholder="$t('time.endDate')"
  1917. ></el-date-picker>
  1918. </div>
  1919. <div style="margin-top:10px;">
  1920. <span>请选择部门:</span>
  1921. <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>
  1922. <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>
  1923. </div>
  1924. <div style="margin-top:10px;">
  1925. <span>请选择员工:</span>
  1926. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1927. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1928. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1929. <span v-else>{{item.name}}</span>
  1930. </el-option>
  1931. </el-select>
  1932. </div>
  1933. <span slot="footer">
  1934. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1935. </span>
  1936. </el-dialog>
  1937. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1938. <div>
  1939. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1940. v-model="deleteReportParam.date" :editable="false"
  1941. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1942. :clearable="true"
  1943. :range-separator="$t('other.to')"
  1944. type="daterange"
  1945. :start-placeholder="$t('time.startDate')"
  1946. :end-placeholder="$t('time.endDate')"
  1947. ></el-date-picker>
  1948. </div>
  1949. <div style="margin-top:15px;">
  1950. <span>选择部门:</span>
  1951. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1952. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1953. size="small" v-if="user.userNameNeedTranslate != 1"
  1954. ></el-cascader>
  1955. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1956. </div>
  1957. <span slot="footer">
  1958. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1959. </span>
  1960. </el-dialog>
  1961. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1962. <div>
  1963. <span>选择时间:</span><el-date-picker
  1964. v-model="modImportTime"
  1965. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1966. :clearable="true"
  1967. type="datetime"
  1968. ></el-date-picker>
  1969. <span>选择导入人员:</span><el-select
  1970. v-model="modImportUserId"
  1971. >
  1972. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1973. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1974. <span v-else>{{item.name}}</span>
  1975. </el-option>
  1976. </el-select>
  1977. </div>
  1978. <span slot="footer">
  1979. <el-button @click="confirmChangeModTime" >确认</el-button>
  1980. </span>
  1981. </el-dialog>
  1982. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1983. <div>
  1984. <span>请选择年月:</span>
  1985. <el-date-picker
  1986. v-model="ratioYmonth" :editable="false"
  1987. format="yyyyMM" value-format="yyyyMM"
  1988. type="month"
  1989. ></el-date-picker>
  1990. </div>
  1991. <span slot="footer">
  1992. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1993. </span>
  1994. </el-dialog>
  1995. <!--工时批量代填 -->
  1996. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1997. <div>
  1998. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1999. v-model="importWxParam.date" :editable="false"
  2000. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2001. :clearable="true"
  2002. :range-separator="$t('other.to')"
  2003. type="daterange"
  2004. :start-placeholder="$t('time.startDate')"
  2005. :end-placeholder="$t('time.endDate')"
  2006. @change="loadCheckInData"
  2007. ></el-date-picker>
  2008. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2009. </div>
  2010. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2011. :key="timeStamp"
  2012. style="width: 100%;margin-top:5px;" ref="tab">
  2013. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2014. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2015. <template slot-scope="scope">
  2016. <div>
  2017. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2018. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2019. </div>
  2020. </template>
  2021. </el-table-column>
  2022. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2023. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2024. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2025. <template slot-scope="scope">
  2026. {{scope.row.workHours.toFixed(1)}}h
  2027. </template>
  2028. </el-table-column>
  2029. <!--项目名称列表 -->
  2030. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2031. <template slot-scope="scope">
  2032. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2033. </template>
  2034. </el-table-column>
  2035. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2036. <template slot-scope="scope">
  2037. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2038. </template>
  2039. </el-table-column>
  2040. </el-table>
  2041. </el-dialog>
  2042. <!--基于企业微信考勤数据的工时导入 -->
  2043. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2044. <div style="padding-bottom:10px;">
  2045. <p>{{importResultMsg}}</p>
  2046. </div>
  2047. <!-- <span slot="footer" class="dialog-footer">
  2048. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2049. </span> -->
  2050. </el-dialog>
  2051. <!-- 审核流程展示 -->
  2052. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2053. <div style="padding:20px 40px 20px 0">
  2054. <el-timeline :reverse="false">
  2055. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2056. <!-- {{item.msg}} -->
  2057. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2058. <span v-if="user.userNameNeedTranslate == 1">
  2059. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2060. <span>{{item.msgCon.two}}</span>
  2061. </span>
  2062. </el-timeline-item>
  2063. </el-timeline>
  2064. </div>
  2065. </el-dialog>
  2066. </section>
  2067. </template>
  2068. <script>
  2069. // 左右滑动
  2070. import dragMixin from "@/common/js/tensile.js";
  2071. import util from "../../common/js/util";
  2072. // 自定义select组件
  2073. import selectCat from "@/components/select.vue"
  2074. // 引入自定义级联组件
  2075. import vueCascader from "@/components/cascader.vue"
  2076. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2077. // 重庆物奇定制组件
  2078. import WeeklyCustomization from "./weeklyCustomization.vue"
  2079. import { mapMutations } from 'vuex'
  2080. let _that = this
  2081. export default {
  2082. mixins: [dragMixin],
  2083. components: {
  2084. selectCat,
  2085. vueCascader,
  2086. WeeklyCustomization,
  2087. vueMultipleDept
  2088. },
  2089. data() {
  2090. return {
  2091. substitudeStep: 1,
  2092. showHidden: false,
  2093. pageIndex: 0,
  2094. hasMore: true,
  2095. exportType: 0,
  2096. exportingData: false,
  2097. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2098. jobResponseList:[],
  2099. yisibeiCompId: 3092,
  2100. yuzhongCompId: 3385,
  2101. mingyiName : '成都明夷电子科技有限公司',
  2102. // mingyiName : '明夷',
  2103. modItemDataId: null,
  2104. modImportTime: null,
  2105. modImportUserId: null,
  2106. showModImportTimeDialog: false,
  2107. showBatchSimpleApproveReport: false,
  2108. startDeleting: false,
  2109. showBatchDeleteReport: false,
  2110. deleteReportParam: {date:null, userIds:[]},
  2111. isDenying: false,
  2112. targetWeekDate: null,//填写周报中的周日期
  2113. importCardTimeVisi: false,
  2114. startRatioExporting: false,
  2115. exportUserRatio: false,
  2116. ratioYmonth:null,
  2117. hasWrittenReport: false,
  2118. today:null,
  2119. syncTimeLoading: false,
  2120. seluserText: '',
  2121. translation: '1', // 1、文字, 2、部门, 3、人员
  2122. exportLoad: false,
  2123. getPickerOptions: {
  2124. disabledDate: (time) => {
  2125. var date = new Date();
  2126. var year = date.getFullYear();
  2127. var month = date.getMonth() + 1;
  2128. if (month >= 1 && month <= 9) {
  2129. month = "0" + month;
  2130. }
  2131. var currentdate = year.toString() + month.toString();
  2132. var timeyear = time.getFullYear();
  2133. var timemonth = time.getMonth() + 1;
  2134. if (timemonth >= 1 && timemonth <= 9) {
  2135. timemonth = "0" + timemonth;
  2136. }
  2137. var timedate = timeyear.toString() + timemonth.toString();
  2138. if(this.user.timeType.fillAhead == 0){
  2139. return currentdate < timedate;
  2140. }else{
  2141. return false
  2142. }
  2143. }
  2144. },
  2145. alalal: '8.0',
  2146. timeBasecostList:null,
  2147. tbload: false,
  2148. exportTimeDialog: false,
  2149. searchKeyword: '',
  2150. monthWorkDataS: [],
  2151. monthNotWorkDateS: [],
  2152. pickDateArray:[],
  2153. WorktimeDatepickValue: [],
  2154. activeName:"first",
  2155. isLeave: 0,
  2156. submitingReport: false,
  2157. importResultMsg:null,
  2158. showImportResult:false,
  2159. importingData: false,
  2160. isDraft: 0,
  2161. timeStamp: 0,
  2162. projectColumns:[],
  2163. checkinLoading:false,
  2164. importWxParam:{date:null,},
  2165. active:0,
  2166. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2167. importWxDialog:false,
  2168. importDialog:false,
  2169. denyForm:null,
  2170. denyReasonDialog:false,
  2171. monthWorkTimeDialog: false,
  2172. isSubstitude:false,
  2173. isFill:false,
  2174. unFillList:[],
  2175. fillList:[],
  2176. fillMembList:[],
  2177. fillMembList_leave: [],
  2178. membListVisible: false,
  2179. isBatch:0,//是否是批量填报
  2180. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2181. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2182. 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')],
  2183. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2184. fillStatusList: [],
  2185. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2186. exportReportLogParam:{dateRange:[]},
  2187. exportDialog:false,
  2188. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2189. subProjectList:[],
  2190. canEdit: true,
  2191. originCanEdit: true,
  2192. 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],
  2193. selectTime:null,
  2194. reportTimeType:{},
  2195. curDate:'',
  2196. isAllSelect: false,
  2197. approveDialogVisible:false,
  2198. deptId:null,
  2199. targetUid: null,
  2200. membCount:0,
  2201. selectState:"-1",
  2202. user: JSON.parse(sessionStorage.getItem("user")),
  2203. allUsersList: [],
  2204. showAddMore:false,
  2205. allDate: [],
  2206. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2207. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2208. choseDay: 0,
  2209. tableHeight: 0,
  2210. listLoading: false,
  2211. projectList: [], //项目列表
  2212. fillProjectList: [],
  2213. reportList: [], //日报列表
  2214. reportNames:[], //批量审批列表
  2215. selCon:[], //筛选条件
  2216. selProjectList:[], //筛选后项目列表
  2217. selConShow: true,
  2218. usersList: [], // 全部人员列表
  2219. usersListId: '', // 选中的人员id
  2220. dialogVisible: false, //项目弹窗
  2221. report: '',
  2222. workForm: {
  2223. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2224. domains: [{
  2225. id: null,
  2226. projectId: "",
  2227. workingTime: "",
  2228. timeType:0,
  2229. content: "",
  2230. state: 2,
  2231. multiWorktime:0,
  2232. worktimeList:[],
  2233. degreeId: null,
  2234. auditUserList: [],
  2235. }],
  2236. showRefresh: false,
  2237. },
  2238. workRules: {
  2239. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2240. },
  2241. chooseParticipVisible: false,
  2242. logining: false,
  2243. isDisable: false,
  2244. timeType:[],
  2245. deptMembData: [
  2246. ],
  2247. //部门人员树状结构
  2248. data: [
  2249. {
  2250. id: -1,
  2251. label: this.$t('lable.allStaff'),
  2252. membCount:0
  2253. },
  2254. {
  2255. id: 0,
  2256. label: this.$t('lable.unassigned'),
  2257. }
  2258. ],
  2259. allData:{},
  2260. batchShowData:{},
  2261. option: [],
  2262. deptOptionList: [],
  2263. depData: {
  2264. id: -1,
  2265. label: this.$t('lable.allStaff'),
  2266. },
  2267. defaultProps: {
  2268. children: 'children',
  2269. label: 'label'
  2270. },
  2271. isNew: false,
  2272. selected: false,
  2273. valuet: new Date(),
  2274. domObj: null,
  2275. participator:[],
  2276. chosenMembCount:0,
  2277. jsDay: 0,
  2278. jsTime: 0,
  2279. falsss: false,
  2280. weidu: [],
  2281. weiduList: [],
  2282. yonghuUser: [],
  2283. dateAr: [],
  2284. batchSubFillDialog: false,
  2285. isSubstiS: false,
  2286. fillWeekDialogVisi: false,
  2287. fillWeekDialogVisiCustom: false,
  2288. zhoData: [],
  2289. weekDateRange: [],
  2290. btnZho: false,
  2291. weekDataLoading: false,
  2292. changdu: 6,
  2293. tianxieDialogVisible: false,
  2294. scopess: {},
  2295. zhoBao: {
  2296. time: '',
  2297. workingTime: '',
  2298. progress: '',
  2299. con: '',
  2300. subProjectId: '',
  2301. stage: '',
  2302. subProjectList: [],
  2303. stages: [],
  2304. },
  2305. zhoBaoIdx: '',
  2306. zhoBaoName: '',
  2307. zhis: {},
  2308. dealList: [],
  2309. toViewDialogVisible: false,
  2310. toViewList: [],
  2311. toViewloading: true,
  2312. toViewForm: {
  2313. pageIndex: '1',
  2314. pageSize: '20',
  2315. total: 0,
  2316. },
  2317. toViewloadings: false,
  2318. tabPositionss: 'top',
  2319. monthTotal: 0,
  2320. monthTotalPage: 0,
  2321. monthTotalLages: 20,
  2322. monthWorkData: [],
  2323. monthNotWorkDate: [],
  2324. monthWorkDataS1: [],
  2325. monthnotTotal: 0,
  2326. monthnotTotalPage: 0,
  2327. monthnotTotalLages: 20,
  2328. monthNotWorkDateS1: [],
  2329. deptMembDataText: '',
  2330. isFlag: false,
  2331. isMore: false,
  2332. stateKey: '0',
  2333. expandDate: [],
  2334. notifySelList:[],
  2335. departmentList: [],
  2336. trandepartmentList:[],
  2337. approvalProcessDialog: false,
  2338. approvalProcessData: [],
  2339. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2340. 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')],
  2341. isWeekend: false,
  2342. canCancelInDialog: false,
  2343. approveinData: {},
  2344. approveinDialog: false,
  2345. reportCanDelete: false,
  2346. weeklyFilledTimeDialog: false,
  2347. weeklyFilledTimeList: [],
  2348. weeklyFilledTimeLoading: false,
  2349. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2350. weeklyFilledTimeCanDelete: false,
  2351. weeklyFilledTimeDate: null,
  2352. leaveAllNum: 0,
  2353. dataLoading: false,
  2354. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2355. vacationTime: {},
  2356. integrationProjectList: [],
  2357. totalReportHours: 0, // 合计的工时
  2358. workTimeForMinYi:0,
  2359. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2360. weekIndex: 1,
  2361. weekParentData: {},
  2362. deptIdForNoReport:[],
  2363. deptIdForReminder:[],
  2364. nameAearch: '', // 企业微信姓名搜索
  2365. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2366. deptMembDataLoading: false,
  2367. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2368. {
  2369. id: 4811,
  2370. // id: 10,
  2371. name: '陕西柘中建设工程有限公司'
  2372. }
  2373. ],
  2374. pushWorkTimeLogDig:false,
  2375. pushWorkTimeLogData:[],
  2376. userReportDeptList: [],
  2377. isReminder:true,
  2378. reportLogCheckDialog:false,
  2379. deptIdForHasReport:[],
  2380. };
  2381. },
  2382. watch: {
  2383. deptMembDataText(val) {
  2384. this.$refs.chooseMembTree.filter(val);
  2385. }
  2386. },
  2387. filters: {
  2388. // 过滤
  2389. amounts(value) {
  2390. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2391. return 0
  2392. }
  2393. var zhi = +value + 0
  2394. return zhi.toFixed(1)
  2395. },
  2396. // zhoData
  2397. zhoData(value, arr) {
  2398. var dateArray = value.split("-");
  2399. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2400. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2401. // console.log(arr[date.getDay()])
  2402. // return "周" + "日一二三四五六".charAt(date.getDay());
  2403. return arr[date.getDay()]
  2404. },
  2405. // 过滤数字
  2406. numbers(value) {
  2407. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2408. return 0
  2409. }
  2410. return value
  2411. },
  2412. },
  2413. computed: {},
  2414. mounted() {
  2415. var now = new Date();
  2416. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2417. this.today = t;
  2418. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2419. this.exportParam.dateRange = [startStr,t];
  2420. this.exportReportLogParam.dateRange = [startStr,t];
  2421. this.getAllDate(1);
  2422. this.getReportList();
  2423. this.getProjectList();
  2424. this.getFillProjectList();
  2425. this.getTimeType();
  2426. this.getDepartment();
  2427. this.scrollFunction()
  2428. this.userssHu();
  2429. this.getFirstAndLastDay()
  2430. if(this.user.timeType.reportAuditType == 3){
  2431. this.getAllUsersList()
  2432. }
  2433. if (this.user.company.packageProject == 1) {
  2434. this.getBasecostItemList();
  2435. }
  2436. if(this.user.timeType.userWithMultiDept == 1) {
  2437. this.getDeptMembData();
  2438. }
  2439. if(this.user.timeType.lockWorktime){
  2440. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2441. }
  2442. //设置了下限
  2443. if (this.user.timeType.minReportTime) {
  2444. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2445. }
  2446. const that = this
  2447. if(this.user.userNameNeedTranslate == 1) {
  2448. that.dataLoading = that.$store.state.dataLoading
  2449. this.upDataLoading()
  2450. setTimeout(()=>{
  2451. that.dataLoading = that.$store.state.dataLoading
  2452. }, 1000)
  2453. }
  2454. if (this.user.companyId == this.yuzhongCompId) {
  2455. this.getJobResponList();
  2456. }
  2457. },
  2458. methods: {
  2459. ...mapMutations(['upDataLoading']),
  2460. // 已填工时情况表设置背景色
  2461. hasworkTblCellStyle({ columnIndex, row, column }) {
  2462. if(columnIndex > 2) {
  2463. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2464. const worktimeList = row.worktimeList || []
  2465. const times = this.reportTimeType.allday
  2466. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2467. const isWorkDate = filterData[0] && filterData[0].workingTime
  2468. const state = filterData[0] && filterData[0].state
  2469. if (state == 0 || state == -1) {
  2470. return "backgroundColor: orange"
  2471. } else if (state == 1) {
  2472. //审核通过
  2473. return "backgroundColor: #32CD32"
  2474. } else if (state == 2) {
  2475. return "backgroundColor: red"
  2476. } else {
  2477. return "backgroundColor: #E0E0E0"
  2478. // if(isWorkDate < times) {
  2479. // return "backgroundColor: #FC3D49"
  2480. // }
  2481. // if(isWorkDate > times) {
  2482. // return "backgroundColor: #20a0ff"
  2483. // }
  2484. }
  2485. }
  2486. },
  2487. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2488. isCustomization(userInfo, permissionArray) {
  2489. const { companyId } = userInfo
  2490. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2491. return isReportPictureRequired
  2492. },
  2493. showHiddenFunction() {
  2494. this.showHidden = true;
  2495. },
  2496. // 获取如何信息选的可填写部门
  2497. getDeptMembData() {
  2498. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2499. if (res.code == "ok") {
  2500. let lists = res.data.userReportDeptList || []
  2501. const optimizedList = lists.map(item => ({
  2502. ...item,
  2503. label: item.departmentName,
  2504. value: item.departmentId,
  2505. }));
  2506. this.$set(this, 'userReportDeptList', optimizedList || []);
  2507. } else {
  2508. this.$message({
  2509. message: res.msg,
  2510. type: "error"
  2511. });
  2512. }
  2513. },error => { });
  2514. },
  2515. //任务被选中
  2516. onTaskSelected(domainItem) {
  2517. //取服务
  2518. if (domainItem.taskId) {
  2519. var that = this;
  2520. var param = {taskId:domainItem.taskId};
  2521. if (this.isSubstitude) {
  2522. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2523. param.userId = this.workForm.userId[0];
  2524. }
  2525. }
  2526. this.http.post('/task/getMyTaskService',param, res => {
  2527. if (res.code == "ok") {
  2528. // domainItem.workContentList = res.data;
  2529. that.$set(domainItem, 'sapServiceId', null);
  2530. that.$set(domainItem, 'serviceList', res.data);
  2531. } else {
  2532. this.$message({
  2533. message: res.msg,
  2534. type: "error"
  2535. });
  2536. }
  2537. },error => {
  2538. this.$message({
  2539. message: error,
  2540. type: "error"
  2541. });
  2542. }
  2543. );
  2544. } else {
  2545. //清空服务
  2546. }
  2547. },
  2548. onBatchTimeChange() {
  2549. //反向计算每日工作时长
  2550. if (this.workForm.createDate) {
  2551. let sdate = new Date(this.workForm.createDate[0]);
  2552. let edate = new Date(this.workForm.createDate[1]);
  2553. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2554. console.log('days===', days)
  2555. if (days < 0) {
  2556. return;
  2557. }
  2558. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2559. //总时长发生改变,自动按比例计算
  2560. this.workForm.domains.forEach(d=>{
  2561. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2562. });
  2563. }
  2564. },
  2565. //更新工作内容列表
  2566. updateJobContent(domainItem) {
  2567. var that = this;
  2568. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2569. if (res.code == "ok") {
  2570. // domainItem.workContentList = res.data;
  2571. that.$set(domainItem, 'extraField3', null);
  2572. that.$set(domainItem, 'workContentList', res.data);
  2573. } else {
  2574. this.$message({
  2575. message: res.msg,
  2576. type: "error"
  2577. });
  2578. }
  2579. },error => {
  2580. this.$message({
  2581. message: error,
  2582. type: "error"
  2583. });
  2584. }
  2585. );
  2586. },
  2587. updateResponse(domainItem) {
  2588. var that = this;
  2589. var selectPid = domainItem.projectId;
  2590. domainItem.extraField2 = null;
  2591. domainItem.extraField3 = null;
  2592. if (selectPid && domainItem.extraField1) {
  2593. //是否非项目
  2594. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2595. console.log('==========','isPublic=='+isPublic);
  2596. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2597. console.log(filteredRespList);
  2598. domainItem.filteredRespList = filteredRespList;
  2599. }
  2600. },
  2601. getJobResponList() {
  2602. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2603. if (res.code == "ok") {
  2604. this.jobResponseList = res.data;
  2605. } else {
  2606. this.$message({
  2607. message: res.msg,
  2608. type: "error"
  2609. });
  2610. }
  2611. },error => {
  2612. this.$message({
  2613. message: error,
  2614. type: "error"
  2615. });
  2616. }
  2617. );
  2618. },
  2619. openModImportTime(row) {
  2620. this.showModImportTimeDialog = true;
  2621. this.modItemDataId = row.id;
  2622. },
  2623. delImportTime(row) {
  2624. let rowId = row.id;
  2625. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2626. confirmButtonText: this.$t('btn.determine'),
  2627. cancelButtonText: this.$t('btn.cancel'),
  2628. type: "warning"
  2629. })
  2630. .then(() => {
  2631. this.http.post('/report-import-log/delete',{
  2632. id: rowId
  2633. },res => {
  2634. if (res.code == "ok") {
  2635. this.$message({
  2636. message: '删除成功',
  2637. type: "success"
  2638. });
  2639. this.getToView();
  2640. } else {
  2641. this.$message({
  2642. message: res.msg,
  2643. type: "error"
  2644. });
  2645. }
  2646. },error => {
  2647. this.$message({
  2648. message: error,
  2649. type: "error"
  2650. });
  2651. }
  2652. );
  2653. }).catch(() => {this.startDeleting = false});
  2654. },
  2655. confirmChangeModTime() {
  2656. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2657. this.$message({
  2658. message: '请选择时间',
  2659. type: "error"
  2660. });
  2661. return;
  2662. }
  2663. this.http.post('/report-import-log/changeTime',{
  2664. modLogDateTime: this.modImportTime,
  2665. modImportUserId: this.modImportUserId,
  2666. id: this.modItemDataId
  2667. },res => {
  2668. if (res.code == "ok") {
  2669. this.$message({
  2670. message: '修改成功',
  2671. type: "success"
  2672. });
  2673. this.getToView();
  2674. this.showModImportTimeDialog = false;
  2675. } else {
  2676. this.$message({
  2677. message: res.msg,
  2678. type: "error"
  2679. });
  2680. }
  2681. },error => {
  2682. this.$message({
  2683. message: error,
  2684. type: "error"
  2685. });
  2686. }
  2687. );
  2688. },
  2689. confirmBatchApproveReport() {
  2690. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2691. this.$message({
  2692. message: '请选择日期范围',
  2693. type: "error"
  2694. });
  2695. return;
  2696. }
  2697. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2698. confirmButtonText: this.$t('btn.determine'),
  2699. cancelButtonText: this.$t('btn.cancel'),
  2700. type: "warning"
  2701. })
  2702. .then(() => {
  2703. this.startDeleting = true;
  2704. let obj = {
  2705. startDate: this.deleteReportParam.date[0],
  2706. endDate: this.deleteReportParam.date[1]
  2707. }
  2708. if(this.deleteReportParam.departmentId) {
  2709. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2710. } else {
  2711. obj.departmentId = null
  2712. }
  2713. this.http.post('/report/batchApproveByDate',obj,res => {
  2714. if (res.code == "ok") {
  2715. this.$message({
  2716. message: '审核通过',
  2717. type: "success"
  2718. });
  2719. this.getReportList();
  2720. this.getDepartment();
  2721. this.startDeleting = false;
  2722. } else {
  2723. this.$message({
  2724. message: res.msg,
  2725. type: "error"
  2726. });
  2727. }
  2728. },error => {
  2729. this.$message({
  2730. message: error,
  2731. type: "error"
  2732. });
  2733. }
  2734. );
  2735. }).catch(() => {this.startDeleting = false});
  2736. },
  2737. confirmBatchDelReport() {
  2738. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2739. this.$message({
  2740. message: '请选择部门或人员',
  2741. type: "error"
  2742. });
  2743. return;
  2744. }
  2745. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2746. this.$message({
  2747. message: '请选择日期范围',
  2748. type: "error"
  2749. });
  2750. return;
  2751. }
  2752. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2753. confirmButtonText: this.$t('btn.determine'),
  2754. cancelButtonText: this.$t('btn.cancel'),
  2755. type: "warning"
  2756. })
  2757. .then(() => {
  2758. this.startDeleting = true;
  2759. this.http.post('/report/batchDelete',{
  2760. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2761. startDate: this.deleteReportParam.date[0],
  2762. endDate: this.deleteReportParam.date[1],
  2763. deptId: this.deleteReportParam.deptId[0]
  2764. },res => {
  2765. if (res.code == "ok") {
  2766. this.$message({
  2767. message: this.$t('message.successfullyDeleted'),
  2768. type: "success"
  2769. });
  2770. this.getReportList();
  2771. this.getDepartment();
  2772. this.startDeleting = false;
  2773. } else {
  2774. this.$message({
  2775. message: res.msg,
  2776. type: "error"
  2777. });
  2778. }
  2779. },error => {
  2780. this.$message({
  2781. message: error,
  2782. type: "error"
  2783. });
  2784. }
  2785. );
  2786. }).catch(() => {this.startDeleting = false});
  2787. },
  2788. getRecentlyProject() {
  2789. this.http.post('/project/nearProject',{},res => {
  2790. if(res.code == 'ok'){
  2791. let topObj = {
  2792. label: '最近选择项目',
  2793. peojectList: res.data
  2794. }
  2795. let botomObj = {
  2796. label: '全部项目',
  2797. peojectList: this.fillProjectList
  2798. }
  2799. //最近项目如果在fillProjectList中不存在,需要移除
  2800. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2801. this.integrationProjectList = [topObj, botomObj]
  2802. }else {
  2803. this.$message({
  2804. message: res.msg,
  2805. type: 'error'
  2806. })
  2807. }
  2808. },err => {
  2809. this.$message({
  2810. message: err,
  2811. type: 'error'
  2812. })
  2813. })
  2814. },
  2815. handlePictureCardPreview(file, index) {
  2816. console.log(file, index)
  2817. let arr = []
  2818. let imgArr = this.workForm.domains[index].imgListUrl
  2819. for(var i in imgArr) {
  2820. arr.push(imgArr[i].url)
  2821. }
  2822. console.log(arr, '图片数据')
  2823. const $viewer = this.$viewerApi({
  2824. images: arr
  2825. });
  2826. },
  2827. // 图片上传
  2828. addImg(e, index) {
  2829. console.log(e, '数据')
  2830. let formData = new FormData()
  2831. formData.append('multipartFile', e.file)
  2832. this.http.uploadFile('/common/uploadFile', formData,
  2833. res => {
  2834. if (res.code == "ok") {
  2835. this.$message({
  2836. message: this.$t('uploadedsuccessfully'),
  2837. type: "success"
  2838. });
  2839. if(!this.workForm.domains[index].imgList) {
  2840. this.workForm.domains[index].imgList = []
  2841. this.workForm.domains[index].imgListUrl = []
  2842. }
  2843. this.workForm.domains[index].imgList.push(res.data)
  2844. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2845. } else {
  2846. this.$message({message: res.msg,type: "error"});
  2847. }
  2848. console.log(this.workForm.domains[index])
  2849. },
  2850. error => {this.$message({message: error,type: "error"});
  2851. });
  2852. },
  2853. // 删除图片
  2854. delImg(file,fileList, index) {
  2855. console.log(file, fileList)
  2856. let idx = 0
  2857. for(let i in fileList) {
  2858. if(fileList[i].uid == file.uid) {
  2859. idx = i
  2860. }
  2861. }
  2862. this.workForm.domains[index].imgList.splice(idx, 1)
  2863. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2864. console.log(this.workForm.domains[index])
  2865. },
  2866. test(){
  2867. console.log('test',this.workForm.domains);
  2868. },
  2869. getHour(s1, s2) {
  2870. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2871. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2872. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2873. var ms = s2.getTime() - s1.getTime();
  2874. if (ms < 0) return 0;
  2875. let ma = ms / 1000 / 60 / 60
  2876. return ma; //小时
  2877. },
  2878. refreshWXCardTime(workdate) {
  2879. if (!workdate) return;
  2880. this.syncTimeLoading = true;
  2881. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2882. date: workdate,
  2883. },res => {
  2884. this.syncTimeLoading = false;
  2885. if(res.code == 'ok'){
  2886. this.workForm.time = res.data.time;
  2887. }else {
  2888. this.$message({
  2889. message: res.msg,
  2890. type: 'error'
  2891. })
  2892. }
  2893. },err => {
  2894. this.syncTimeLoading = false;
  2895. this.$message({
  2896. message: err,
  2897. type: 'error'
  2898. })
  2899. })
  2900. },
  2901. refreshAttendance(workdate) {
  2902. if (!workdate) return;
  2903. this.syncTimeLoading = true;
  2904. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2905. startDate: workdate[0],
  2906. endDate: workdate[1]
  2907. },res => {
  2908. this.syncTimeLoading = false;
  2909. if(res.code == 'ok'){
  2910. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2911. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2912. this.totalReportHours = this.workTimeForMinYi;
  2913. }else {
  2914. this.$message({
  2915. message: res.msg,
  2916. type: 'error'
  2917. })
  2918. }
  2919. },err => {
  2920. this.syncTimeLoading = false;
  2921. this.$message({
  2922. message: err,
  2923. type: 'error'
  2924. })
  2925. })
  2926. },
  2927. refreshBeiSengAttendance(workdate) {
  2928. if (!workdate) return;
  2929. this.syncTimeLoading = true;
  2930. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2931. createDate: workdate
  2932. },res => {
  2933. this.syncTimeLoading = false;
  2934. if(res.code == 'ok'){
  2935. this.workForm.time = res.data;
  2936. }else {
  2937. this.$message({
  2938. message: res.msg,
  2939. type: 'error'
  2940. })
  2941. }
  2942. },err => {
  2943. this.syncTimeLoading = false;
  2944. this.$message({
  2945. message: err,
  2946. type: 'error'
  2947. })
  2948. })
  2949. },
  2950. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2951. this.weeklyFilledTimeDialog = true
  2952. this.weeklyFilledTimeLoading = true
  2953. this.weeklyFilledTimeDate = parameterDate
  2954. this.http.post('/report/getReportList',{
  2955. date: parameterDate,
  2956. userId: this.user.id
  2957. },res => {
  2958. this.weeklyFilledTimeLoading = false
  2959. if(res.code == 'ok'){
  2960. this.weeklyFilledTimeList = res.data[0].data
  2961. let candelete = true
  2962. for(let i in this.weeklyFilledTimeList){
  2963. if(this.weeklyFilledTimeList[i].state < 2){
  2964. candelete = false
  2965. }
  2966. }
  2967. this.weeklyFilledTimeCanDelete = candelete
  2968. }else {
  2969. this.$message({
  2970. message: res.msg,
  2971. type: 'error'
  2972. })
  2973. }
  2974. },err => {
  2975. this.weeklyFilledTimeLoading = false
  2976. this.$message({
  2977. message: err,
  2978. type: 'error'
  2979. })
  2980. })
  2981. },
  2982. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2983. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2984. confirmButtonText: this.$t('btn.determine'),
  2985. cancelButtonText: this.$t('btn.cancel'),
  2986. type: "warning"
  2987. })
  2988. .then(() => {
  2989. this.http.post('/report/delete',{
  2990. userId: this.user.id,
  2991. date: this.weeklyFilledTimeDate
  2992. },res => {
  2993. if (res.code == "ok") {
  2994. this.$message({
  2995. message: this.$t('message.successfullyDeleted'),
  2996. type: "success"
  2997. });
  2998. this.getWeeklyWorkTime()
  2999. this.getReportList();
  3000. this.getDepartment();
  3001. this.weeklyFilledTimeDialog = false;
  3002. } else {
  3003. this.$message({
  3004. message: res.msg,
  3005. type: "error"
  3006. });
  3007. }
  3008. },error => {
  3009. this.$message({
  3010. message: error,
  3011. type: "error"
  3012. });
  3013. }
  3014. );
  3015. }).catch(() => {});
  3016. },
  3017. getApprovalProcess(item){
  3018. // console.log('this.date',this.choseDate);
  3019. this.http.post('/report-log/get',{
  3020. creatorId: item.id,
  3021. createDate: sessionStorage.msg
  3022. },res => {
  3023. if(res.code == 'ok'){
  3024. this.approvalProcessDialog = true
  3025. if(this.user.userNameNeedTranslate == 1) {
  3026. for(var i in res.data) {
  3027. let obj = {
  3028. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3029. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3030. }
  3031. res.data[i].msgCon = obj
  3032. }
  3033. }
  3034. this.approvalProcessData = res.data
  3035. console.log(this.approvalProcessData, '数据卡看')
  3036. }else{
  3037. this.$message({
  3038. message: res.msg,
  3039. type: 'error'
  3040. })
  3041. }
  3042. },err => {
  3043. this.$message({
  3044. message: err,
  3045. type: 'error'
  3046. })
  3047. })
  3048. },
  3049. filterNode(value, data) {
  3050. if (!value) return true;
  3051. return data.label.indexOf(value) !== -1;
  3052. },
  3053. triggerCalculateOT(index) {
  3054. var str = this.workForm.domains[index].overtimeHours + ''
  3055. if(str.indexOf('.') != '-1') {
  3056. var s = str.split('.')[0]
  3057. var st = str.split('.')[1]
  3058. var sts = st.split('')
  3059. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3060. }
  3061. },
  3062. searchScreen(e){
  3063. if(e){
  3064. this.monthNotWorkDateS1 = []
  3065. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3066. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3067. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3068. }
  3069. }
  3070. if (this.monthNotWorkDateS1.length > 50) {
  3071. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3072. }else{
  3073. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3074. }
  3075. // if (this.monthNotWorkDateS1.length > 0) {
  3076. // setTimeout(() => {
  3077. // this.tableListenernot()
  3078. // }, 1000);
  3079. // }
  3080. }else{
  3081. this.monthWorkDataS1 = []
  3082. for (let i = 0; i < this.monthWorkData.length; i++) {
  3083. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3084. this.monthWorkDataS1.push(this.monthWorkData[i])
  3085. }
  3086. }
  3087. if (this.monthWorkDataS1.length > 50) {
  3088. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3089. }else{
  3090. this.monthWorkDataS = this.monthWorkDataS1
  3091. }
  3092. // if (this.monthWorkDataS1.length > 0) {
  3093. // setTimeout(() => {
  3094. // this.tableListener()
  3095. // }, 1000);
  3096. // }
  3097. }
  3098. },
  3099. addUpload(data) {
  3100. // var zhi = data.fileName.split('.')[0]
  3101. // var sss = zhi + '.xlsx'
  3102. // return
  3103. var filePath = '/upload/' + data.serverName;
  3104. const a = document.createElement('a'); // 创建a标签
  3105. a.setAttribute('download', data.fileName);// download属性
  3106. a.setAttribute('href', filePath);// href链接
  3107. a.click(); //自执行点击事件
  3108. a.remove();
  3109. },
  3110. restrictNumber(targetId) {
  3111. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3112. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3113. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3114. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3115. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3116. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3117. inpu.value = parseFloat(inpu.value);
  3118. }
  3119. },
  3120. //获取项目下的任务分组
  3121. getTaskGroups(domain, index) {
  3122. domain.groupId=null;
  3123. this.http.post('/task-group/listMyJoinGroup',{
  3124. projectId: domain.projectId,
  3125. isSubstitude: this.isSubstitude ? 1 : 0
  3126. },
  3127. res => {
  3128. if (res.code == "ok") {
  3129. this.workForm.domains[index].taskGroups = res.data;
  3130. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3131. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3132. // this.getGroupStages(domain, index);
  3133. // }
  3134. this.$forceUpdate();
  3135. }
  3136. },
  3137. error => {
  3138. this.$message({
  3139. message: error,
  3140. type: "error"
  3141. });
  3142. }
  3143. );
  3144. },
  3145. //下载填报工时占比报表
  3146. downloadProjectRatio() {
  3147. this.exportUserRatio = true;
  3148. // let now = new Date();
  3149. // let month = now.getMonth();//默认看上个月的
  3150. // let monthStr = month<10? ('0'+month): month;
  3151. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3152. const today = new Date();
  3153. const year = today.getFullYear();
  3154. const month = today.getMonth() + 1;
  3155. let lastMonthYear, lastMonth;
  3156. if (month === 1) {
  3157. lastMonthYear = year - 1;
  3158. lastMonth = 12;
  3159. } else {
  3160. lastMonthYear = year;
  3161. lastMonth = month - 1;
  3162. }
  3163. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3164. console.log('赋值 ==>', this.ratioYmonth)
  3165. },
  3166. confirmDownloadRatio() {
  3167. this.startRatioExporting = true;
  3168. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3169. ymonth: this.ratioYmonth
  3170. },
  3171. res => {
  3172. if (res.code == "ok") {
  3173. this.startRatioExporting = false;
  3174. var filePath = res.data;
  3175. const a = document.createElement('a'); // 创建a标签
  3176. var data = filePath.split("/");
  3177. a.setAttribute('download', data[data.length-1]);// download属性
  3178. a.setAttribute('href', filePath);// href链接
  3179. a.click(); //自执行点击事件
  3180. a.remove();
  3181. } else {
  3182. this.startRatioExporting = false;
  3183. this.$message({
  3184. message: res.msg,
  3185. type: "error"
  3186. });
  3187. }
  3188. },
  3189. error => {
  3190. this.checkinLoading = false;
  3191. this.$message({
  3192. message: error,
  3193. type: "error"
  3194. });
  3195. }
  3196. );
  3197. },
  3198. //下载带企业微信考勤数据的工时统计模板
  3199. downloadCheckInExcel() {
  3200. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3201. startDate: this.importWxParam.date[0],
  3202. endDate: this.importWxParam.date[1],
  3203. },
  3204. res => {
  3205. if (res.code == "ok") {
  3206. var filePath = res.data;
  3207. const a = document.createElement('a'); // 创建a标签
  3208. var data = filePath.split("/");
  3209. a.setAttribute('download', data[data.length-1]);// download属性
  3210. a.setAttribute('href', filePath);// href链接
  3211. a.click(); //自执行点击事件
  3212. a.remove();
  3213. } else {
  3214. this.$message({
  3215. message: res.msg,
  3216. type: "error"
  3217. });
  3218. }
  3219. },
  3220. error => {
  3221. this.checkinLoading = false;
  3222. this.$message({
  3223. message: error,
  3224. type: "error"
  3225. });
  3226. }
  3227. );
  3228. },
  3229. pre() {
  3230. if (this.active == 0) return;
  3231. this.active--;
  3232. },
  3233. next() {
  3234. this.active++;
  3235. },
  3236. triggerTotalTime(index) {
  3237. var item = this.checkinList[index];
  3238. var total = 0.0;
  3239. for (var i=0;i<this.projectColumns.length; i++) {
  3240. var key = this.projectColumns[i];
  3241. if (item[key] != null && item[key] != '') {
  3242. total += parseFloat(item[key]);
  3243. }
  3244. }
  3245. item.totalFillTime = total;
  3246. },
  3247. //提交批量代填的数据
  3248. submitBatchSubFillData() {
  3249. var data = JSON.stringify(this.checkinList);
  3250. this.http.post('/user-corpwx-time/submitProjectTime',{
  3251. json: data,
  3252. projectColumns: JSON.stringify(this.projectColumns)
  3253. },
  3254. res => {
  3255. if (res.code == "ok") {
  3256. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3257. this.importWxDialog = false;
  3258. }
  3259. },
  3260. error => {
  3261. this.checkinLoading = false;
  3262. this.$message({
  3263. message: error,
  3264. type: "error"
  3265. });
  3266. }
  3267. );
  3268. },
  3269. loadCheckInData() {
  3270. if (this.importWxParam.date == null) {
  3271. this.checkinList = [];
  3272. return;
  3273. }
  3274. this.checkinLoading = true;
  3275. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3276. startDate: this.importWxParam.date[0],
  3277. endDate: this.importWxParam.date[1],
  3278. },
  3279. res => {
  3280. if (res.code == "ok") {
  3281. this.checkinLoading = false;
  3282. this.checkinList = res.data.list;
  3283. this.projectColumns = res.data.projects;
  3284. // 自定义表格会导致表格错乱,需重新计算表格
  3285. this.$nextTick(()=>{
  3286. this.$refs.tab.doLayout()
  3287. })
  3288. }
  3289. },
  3290. error => {
  3291. this.checkinLoading = false;
  3292. this.$message({
  3293. message: error,
  3294. type: "error"
  3295. });
  3296. }
  3297. );
  3298. },
  3299. importCardTime(item) {
  3300. //首先判断文件类型
  3301. let str = item.file.name.split(".");
  3302. let format = str[str.length - 1];
  3303. if (format != "xls" && format != "xlsx") {
  3304. this.$message({
  3305. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3306. type: "error"
  3307. });
  3308. } else {
  3309. this.importingData = true;
  3310. let formData = new FormData();
  3311. formData.append("multipartFile", item.file);
  3312. formData.append("companyId", this.user.companyId);
  3313. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3314. res => {
  3315. this.$refs.uploadCardTime.clearFiles();
  3316. this.importingData = false;
  3317. if (res.code == "ok") {
  3318. //换成弹出框,以免有人等了半天回来啥也没看到
  3319. this.$message({
  3320. message: '导入考勤时长成功',
  3321. type: "success"
  3322. });
  3323. } else {
  3324. this.$message({
  3325. message: res.msg,
  3326. type: "error"
  3327. });
  3328. }
  3329. },
  3330. error => {
  3331. this.$refs.upload.clearFiles();
  3332. this.listLoading = false;
  3333. this.$message({
  3334. message: error,
  3335. type: "error"
  3336. });
  3337. });
  3338. }
  3339. },
  3340. batchImportWxData(item) {
  3341. //首先判断文件类型
  3342. let str = item.file.name.split(".");
  3343. let format = str[str.length - 1];
  3344. if (format != "xls" && format != "xlsx") {
  3345. this.$message({
  3346. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3347. type: "error"
  3348. });
  3349. } else {
  3350. this.importingData = true;
  3351. let formData = new FormData();
  3352. formData.append("file", item.file);
  3353. formData.append("companyId", this.user.companyId);
  3354. formData.append("withCheckIn", 1);
  3355. this.http.uploadFile('/report/importData', formData,
  3356. res => {
  3357. this.$refs.upload.clearFiles();
  3358. this.showImportResult = true;
  3359. this.importingData = false;
  3360. if (res.code == "ok") {
  3361. //换成弹出框,以免有人等了半天回来啥也没看到
  3362. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3363. this.getReportList();
  3364. this.importWxDialog = false;
  3365. } else {
  3366. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3367. }
  3368. },
  3369. error => {
  3370. this.$refs.upload.clearFiles();
  3371. this.listLoading = false;
  3372. this.$message({
  3373. message: error,
  3374. type: "error"
  3375. });
  3376. });
  3377. }
  3378. },
  3379. batchImportData(item) {
  3380. //首先判断文件类型
  3381. let str = item.file.name.split(".");
  3382. let format = str[str.length - 1];
  3383. if (format != "xls" && format != "xlsx") {
  3384. this.$message({
  3385. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3386. type: "error"
  3387. });
  3388. } else {
  3389. this.importingData = true;
  3390. let formData = new FormData();
  3391. formData.append("file", item.file);
  3392. formData.append("companyId", this.user.companyId);
  3393. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3394. this.http.uploadFile(url, formData,
  3395. res => {
  3396. this.$refs.upload.clearFiles();
  3397. this.importingData = false;
  3398. this.showImportResult = true;
  3399. if (res.code == "ok") {
  3400. //换成弹出框,以免有人等了半天回来啥也没看到
  3401. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3402. this.getReportList();
  3403. this.importWXDialog = false;
  3404. } else {
  3405. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3406. }
  3407. },
  3408. error => {
  3409. this.$refs.upload.clearFiles();
  3410. this.importingData = false;
  3411. this.$message({
  3412. message: error,
  3413. type: "error"
  3414. });
  3415. });
  3416. }
  3417. },
  3418. userssHu() {
  3419. this.http.post('/time-type/getCompanyTimeSetting',{
  3420. companyId: this.user.companyId
  3421. },
  3422. res => {
  3423. if (res.code == "ok") {
  3424. this.yonghuUser = res.data
  3425. }
  3426. },
  3427. error => {
  3428. this.$message({
  3429. message: error,
  3430. type: "error"
  3431. });
  3432. }
  3433. );
  3434. },
  3435. iptBlur(i) {
  3436. if(this.isBatch == 0) {
  3437. return
  3438. }
  3439. var reqParam = {
  3440. startDate: this.workForm.createDate[0],
  3441. endDate: this.workForm.createDate[1]
  3442. };
  3443. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3444. reqParam.userId = this.workForm.userId[0];
  3445. }
  3446. this.http.post('/report/getWorkDays',reqParam,
  3447. res => {
  3448. if (res.code == "ok") {
  3449. this.jsDay = res.data
  3450. this.chuji(i)
  3451. } else {
  3452. this.$message({
  3453. message: res.msg,
  3454. type: "error"
  3455. });
  3456. }
  3457. },
  3458. error => {
  3459. this.$message({
  3460. message: error,
  3461. type: "error"
  3462. });
  3463. }
  3464. );
  3465. //明夷硬编码获取
  3466. if (this.user.company.companyName == this.mingyiName) {
  3467. this.getWorkTimeForMinYi();
  3468. }
  3469. },
  3470. getWorkTimeForMinYi(){
  3471. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3472. startDate: this.workForm.createDate[0],
  3473. endDate: this.workForm.createDate[1]
  3474. },
  3475. res => {
  3476. if (res.code == "ok") {
  3477. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3478. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3479. this.totalReportHours = this.workTimeForMinYi;
  3480. } else {
  3481. this.$message({
  3482. message: res.msg,
  3483. type: "error"
  3484. });
  3485. this.workForm.createDate = [];
  3486. }
  3487. },
  3488. error => {
  3489. this.$message({
  3490. message: error,
  3491. type: "error"
  3492. });
  3493. }
  3494. );
  3495. },
  3496. chuji(i) {
  3497. if(i == 0) {
  3498. this.seleChn(1)
  3499. } else if(i == 1) {
  3500. this.seleChn(0)
  3501. } else if(i == 2) {
  3502. if(this.workForm.domains[0].multiWorktime > 0) {
  3503. this.iptChangs()
  3504. } else {
  3505. this.iptChang()
  3506. }
  3507. } else if(i == 3) {
  3508. this.seleChn(0)
  3509. }
  3510. },
  3511. seleChn(e,domain) {
  3512. if(e == 1) {
  3513. for(var i in this.workForm.domains) {
  3514. if(this.workForm.domains[i].timeType == 0) {
  3515. this.workForm.domains[i].workingTime = 8
  3516. } else {
  3517. this.workForm.domains[i].workingTime = 4
  3518. }
  3519. }
  3520. }
  3521. var quanbu = 0
  3522. var spl = this.workForm.domains
  3523. var zhi = ''
  3524. for(var i in spl) {
  3525. var sp = +spl[i].workingTime + 0
  3526. zhi = this.jsDay * sp
  3527. quanbu = +quanbu + zhi
  3528. }
  3529. this.jsTime = quanbu
  3530. this.totalReportHours = quanbu
  3531. let worktime = this.jsTime
  3532. // 自动计算加班时长
  3533. if(this.isBatch != 0){
  3534. worktime = this.jsTime / this.jsDay
  3535. }
  3536. if(this.user.timeType.fillOvertime && domain){
  3537. let isover = false
  3538. let alltime = 0
  3539. let allover = 0 //此处alltime同上面的worktime
  3540. for(let d in spl){
  3541. if(spl[d].isOvertime){
  3542. isover = true
  3543. allover += spl[d].overtimeHours*1
  3544. }
  3545. alltime += spl[d].workingTime*1
  3546. }
  3547. if(domain.overtimeHours){
  3548. allover = allover - domain.overtimeHours
  3549. }
  3550. if(worktime*1 > this.user.timeType.allday){
  3551. if(isover){
  3552. if(alltime > (allover + this.user.timeType.allday)){
  3553. this.$set(domain,'isOvertime',true)
  3554. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3555. }else{
  3556. this.$set(domain,'isOvertime',false)
  3557. this.$set(domain,'overtimeHours',null)
  3558. if(alltime < (allover + this.user.timeType.allday)){
  3559. let overtime = allover + this.user.timeType.allday - alltime
  3560. for(let pi in spl){
  3561. if(spl[pi].overtimeHours){
  3562. if((overtime - spl[pi].overtimeHours*1) > 0){
  3563. overtime = overtime - spl[pi].overtimeHours*1
  3564. this.$set(spl[pi],'isOvertime',false)
  3565. this.$set(spl[pi],'overtimeHours',null)
  3566. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3567. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3568. break
  3569. }else{
  3570. this.$set(spl[pi],'isOvertime',false)
  3571. this.$set(spl[pi],'overtimeHours',null)
  3572. break
  3573. }
  3574. }
  3575. }
  3576. }
  3577. }
  3578. }else{
  3579. this.$set(domain,'isOvertime',true)
  3580. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3581. }
  3582. }else{
  3583. for(let di in spl){
  3584. this.$set(spl[di],'isOvertime',false)
  3585. this.$set(spl[di],'overtimeHours',null)
  3586. }
  3587. }
  3588. }
  3589. },
  3590. iptChang() {
  3591. var sl = this.workForm.domains
  3592. let timeArr = []
  3593. for(var i in sl) {
  3594. if(sl[i].startTime && sl[i].endTime) {
  3595. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3596. }
  3597. }
  3598. this.getTimeHours(timeArr)
  3599. // for(let j in arrNum) {
  3600. // this.timeJsonStr += arrNum[j]
  3601. // if(flg) {
  3602. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3603. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3604. // }
  3605. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3606. // flg = true
  3607. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3608. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3609. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3610. // }
  3611. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3612. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3613. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3614. // }
  3615. // }
  3616. },
  3617. iptChangs() {
  3618. var sl = this.workForm.domains
  3619. let timeArr = []
  3620. for(var i in sl) {
  3621. for(var j in sl[i].worktimeList){
  3622. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3623. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3624. }
  3625. }
  3626. }
  3627. this.getTimeHours(timeArr)
  3628. },
  3629. // 调用接口或去数据
  3630. getTimeHours(arr) {
  3631. this.http.post('/report/getHoursByTimeRange',{
  3632. timeJsonStr: JSON.stringify(arr)
  3633. },res => {
  3634. if(res.code === 'ok') {
  3635. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3636. } else {
  3637. this.$message({
  3638. message: res.msg,
  3639. type: 'error'
  3640. })
  3641. }
  3642. },err => {
  3643. this.$message({
  3644. message: err,
  3645. type: 'error'
  3646. })
  3647. })
  3648. },
  3649. // 按周填报调用接口计算时间
  3650. async getWeekHoursByTimeRange(timeRange) {
  3651. const url = '/report/getHoursByTimeRange';
  3652. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3653. var that = this;
  3654. return new Promise((resolve, reject) => {
  3655. this.http.post(url, data, function(res) {
  3656. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3657. }, function(err) {
  3658. reject(err);
  3659. });
  3660. });
  3661. },
  3662. removeTimeItem(item, index) {
  3663. item.worktimeList.splice(index, 1);
  3664. this.iptChangs()
  3665. },
  3666. //添加工时
  3667. addNewWorktime(index, item) {
  3668. if(item.worktimeList == null ) {
  3669. item.worktimeList = []
  3670. }
  3671. item.worktimeList.push({});
  3672. },
  3673. //复制项目
  3674. copyProject(index) {
  3675. var leftProgress = 10;
  3676. if (this.reportTimeType.type == 3) {
  3677. //计算已经待分配工时比例
  3678. let array = this.workForm.domains;
  3679. let totalProgress = 0;
  3680. for (var i=0;i<array.length; i++) {
  3681. totalProgress += array[i].progress;
  3682. }
  3683. if (totalProgress < 100) {
  3684. leftProgress = 100 - totalProgress;
  3685. }
  3686. }
  3687. var newIndex = index+1;
  3688. var itemDomain = {
  3689. projectId: this.workForm.domains[index].projectId,
  3690. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3691. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3692. ),
  3693. content: "",
  3694. progress:leftProgress,
  3695. state:2,//2-表示待提交
  3696. };
  3697. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3698. if (this.reportTimeType.type == 0) {
  3699. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3700. var length = this.workForm.domains.length;
  3701. if (length == 2) {
  3702. this.showAddMore = false;
  3703. }
  3704. }
  3705. this.selectProject(itemDomain, newIndex);
  3706. },
  3707. pushWorkTime(reportId){
  3708. let url=''
  3709. if(this.user.timeType.syncSap == 1){
  3710. url='/report/pushProjectReportToSap'
  3711. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3712. var pushDate = this.date + day;
  3713. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3714. confirmButtonText: '确定',
  3715. cancelButtonText: '取消',
  3716. type: 'info'
  3717. }).then(() => {
  3718. const loading = this.$loading({
  3719. lock: true,
  3720. text: '正在推送中,请耐心等待。',
  3721. spinner: 'el-icon-loading',
  3722. background: 'rgba(0, 0, 0, 0.7)'
  3723. });
  3724. this.http.post(url,{
  3725. pushDate: pushDate,
  3726. reportId: reportId
  3727. },res => {
  3728. loading.close();
  3729. if(res.code == 'ok'){
  3730. this.$message({
  3731. type: 'success',
  3732. message: res.data
  3733. });
  3734. }else{
  3735. this.$message({
  3736. type: 'error',
  3737. message: res.msg
  3738. })
  3739. }
  3740. },err => {
  3741. loading.close();
  3742. this.$message({
  3743. type: 'error',
  3744. message: err
  3745. })
  3746. })
  3747. }).catch(() => {
  3748. });
  3749. }else{
  3750. url='/report/pushReportDataToThird'
  3751. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3752. confirmButtonText: '确定',
  3753. cancelButtonText: '取消',
  3754. type: 'info'
  3755. }).then(() => {
  3756. const loading = this.$loading({
  3757. lock: true,
  3758. text: '正在推送中,请耐心等待。',
  3759. spinner: 'el-icon-loading',
  3760. background: 'rgba(0, 0, 0, 0.7)'
  3761. });
  3762. this.http.post(url,{
  3763. yearMonth: this.date
  3764. },res => {
  3765. loading.close();
  3766. if(res.code == 'ok'){
  3767. this.$message({
  3768. type: 'success',
  3769. message: '推送成功!'
  3770. });
  3771. }else{
  3772. this.$message({
  3773. type: 'error',
  3774. message: res.msg
  3775. })
  3776. }
  3777. },err => {
  3778. loading.close();
  3779. this.$message({
  3780. type: 'error',
  3781. message: err
  3782. })
  3783. })
  3784. }).catch(() => {
  3785. });
  3786. }
  3787. },
  3788. showWorkTime(){
  3789. this.monthWorkTimeDialog = true;
  3790. this.searchKeyword = ''
  3791. this.WorktimeDatepickValue = this.istoMonth()
  3792. if(this.WorktimeDatepickValue.length == 0){
  3793. let newdate = new Date();
  3794. let nowdate = newdate.toLocaleDateString();
  3795. let getauto = this.getAutoWeekDate(nowdate)
  3796. let nowwd = [getauto[0],getauto[6]]
  3797. this.WorktimeDatepickValue = nowwd
  3798. }
  3799. this.showMonthWorkTime()
  3800. },
  3801. handleClick(t,e){
  3802. if (t.name == "second") {
  3803. this.showMonthNotWorkTime()
  3804. }else if(t.name == "first"){
  3805. this.showMonthWorkTime()
  3806. }else if(t.name == "third"){
  3807. this.showMonthWorkTimeReminder()
  3808. }
  3809. },
  3810. //导出员工每日填报工时数
  3811. exportMembWorkHours() {
  3812. this.http.post(
  3813. "/report/exportUserDailyWorkTime",
  3814. {
  3815. // month: this.date,
  3816. startDate: this.WorktimeDatepickValue[0],
  3817. endDate: this.WorktimeDatepickValue[1],
  3818. },
  3819. (res) => {
  3820. if (res.code == "ok") {
  3821. let url = res.data;
  3822. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3823. }
  3824. },
  3825. (error) => {
  3826. this.$message({
  3827. message: error,
  3828. type: "error",
  3829. });
  3830. }
  3831. );
  3832. },
  3833. exportMembWorkHoursReminder() {
  3834. this.http.post(
  3835. "/report/exportUserDailyWorkTimeReminder",
  3836. {
  3837. // month: this.date,
  3838. startDate: this.WorktimeDatepickValue[0],
  3839. endDate: this.WorktimeDatepickValue[1],
  3840. },
  3841. (res) => {
  3842. if (res.code == "ok") {
  3843. let url = res.data;
  3844. this.downloadByA('工时异常表.xlsx', url);
  3845. }
  3846. },
  3847. (error) => {
  3848. this.$message({
  3849. message: error,
  3850. type: "error",
  3851. });
  3852. }
  3853. );
  3854. },
  3855. exportMembNotWorkHours() {
  3856. this.http.post(
  3857. "/report/exportNoReportUserList",
  3858. {
  3859. // month: this.date,
  3860. startDate: this.WorktimeDatepickValue[0],
  3861. endDate: this.WorktimeDatepickValue[1],
  3862. },
  3863. (res) => {
  3864. if (res.code == "ok") {
  3865. let url = res.data;
  3866. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3867. }
  3868. },
  3869. (error) => {
  3870. this.$message({
  3871. message: error,
  3872. type: "error",
  3873. });
  3874. }
  3875. );
  3876. },
  3877. downloadByA(name, url) {
  3878. const a = document.createElement("a"); // 创建a标签
  3879. a.setAttribute("download", name); // download属性
  3880. a.setAttribute("href", url); // href链接
  3881. a.click(); // 自执行点击事件
  3882. a.remove();
  3883. },
  3884. // 是否本月判断
  3885. istoMonth(){
  3886. let todate = new Date()
  3887. let tomonth = todate.getMonth() + 1
  3888. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3889. if(this.date == adate){
  3890. return []
  3891. }else{
  3892. let sedate = new Date(this.date)
  3893. let semonth = sedate.getMonth() + 1
  3894. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3895. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3896. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3897. return [sedates1, sedates2]
  3898. }
  3899. },
  3900. showMonthWorkTime() {
  3901. this.monthTotalPage = 0,
  3902. this.tbload = true
  3903. let parameter={
  3904. startDate: this.WorktimeDatepickValue[0],
  3905. endDate: this.WorktimeDatepickValue[1],
  3906. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3907. }
  3908. this.http.post(
  3909. "/report/getUserDailyWorkTime",
  3910. // "/report/getNoReportUserList",
  3911. parameter,
  3912. (res) => {
  3913. if (res.code == "ok") {
  3914. this.tbload = false;
  3915. this.pickDateArray = res.data.days.map(item => {
  3916. return {
  3917. ...item,
  3918. dateStr: item.label.split('/')[0],
  3919. weekStr: item.label.split('/')[1]
  3920. }
  3921. });
  3922. // console.log('dataarray',res.data.days);
  3923. this.monthWorkData = res.data.list;
  3924. // this.monthWorkDataS = this.monthWorkData
  3925. // this.monthWorkDataS1 = 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.monthWorkDataS = infoList
  3934. // 判断
  3935. // if (this.monthWorkDataS1.length > 0) {
  3936. // setTimeout(() => {
  3937. // this.tableListener()
  3938. // }, 1000);
  3939. // }
  3940. this.$nextTick(function(){
  3941. this.$refs.hasworkTbl.doLayout();
  3942. });
  3943. // this.$forceUpdate()
  3944. }
  3945. },
  3946. (error) => {
  3947. this.tbload = false
  3948. this.$message({
  3949. message: error,
  3950. type: "error",
  3951. });
  3952. }
  3953. );
  3954. },
  3955. showMonthWorkTimeReminder() {
  3956. this.monthTotalPage = 0,
  3957. this.tbload = true
  3958. let parameter={}
  3959. parameter={
  3960. startDate: this.WorktimeDatepickValue[0],
  3961. endDate: this.WorktimeDatepickValue[1],
  3962. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3963. viewValue:this.isReminder?1:0
  3964. }
  3965. this.http.post(
  3966. "/report/getUserDailyWorkTimeReminder",
  3967. parameter,
  3968. (res) => {
  3969. if (res.code == "ok") {
  3970. this.tbload = false;
  3971. this.monthWorkData = res.data.list;
  3972. this.monthTotal = res.data.list.length
  3973. if (this.monthWorkData.length > 50) {
  3974. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3975. }else{
  3976. this.monthWorkDataS = this.monthWorkData
  3977. }
  3978. this.searchScreen(0)
  3979. this.$nextTick(function(){
  3980. this.$refs.hasworkTbl.doLayout();
  3981. });
  3982. }
  3983. },
  3984. (error) => {
  3985. this.tbload = false
  3986. this.$message({
  3987. message: error,
  3988. type: "error",
  3989. });
  3990. }
  3991. );
  3992. },
  3993. // tableListener(){
  3994. // let that = this;
  3995. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3996. // // 添加scroll监听事件
  3997. // dom.addEventListener("scroll", function () {
  3998. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3999. // if (scrollDistance < 2) {
  4000. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4001. // that.monthTotalPage++; //当前页数自增
  4002. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4003. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4004. // var infoList = arrList.splice(
  4005. // that.monthTotalPage * that.monthTotalLages,
  4006. // that.monthTotalLages
  4007. // );
  4008. // // 数据添加
  4009. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4010. // }
  4011. // }
  4012. // })
  4013. // },
  4014. showMonthNotWorkTime() {
  4015. this.monthTotalPage = 0,
  4016. this.tbload = true,
  4017. this.http.post(
  4018. "/report/getNoReportUserList",
  4019. {
  4020. startDate: this.WorktimeDatepickValue[0],
  4021. endDate: this.WorktimeDatepickValue[1],
  4022. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4023. },
  4024. (res) => {
  4025. if (res.code == "ok") {
  4026. this.tbload = false
  4027. this.monthNotWorkDate = res.data;
  4028. // this.monthNotWorkDateS1 = res.data
  4029. this.monthnotTotal = res.data.length
  4030. // 2222111
  4031. if (this.monthNotWorkDate.length > 50) {
  4032. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4033. } else {
  4034. this.monthNotWorkDateS = this.monthNotWorkDate
  4035. }
  4036. this.searchScreen(1)
  4037. // 判断
  4038. // if (this.monthnotworkDateS1.length > 0) {
  4039. // setTimeout(() => {
  4040. // this.tableListenernot()
  4041. // }, 1000);
  4042. // }
  4043. this.$nextTick(function(){
  4044. this.$refs.hasworkTbl2.doLayout();
  4045. });
  4046. }
  4047. },
  4048. (error) => {
  4049. this.tbload = false
  4050. this.$message({
  4051. message: error,
  4052. type: "error",
  4053. });
  4054. }
  4055. );
  4056. },
  4057. // tableListenernot(){
  4058. // let that = this;
  4059. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4060. // dom.addEventListener("scroll", function () {
  4061. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4062. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4063. // if (scrollDistance2 < 2) {
  4064. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4065. // that.monthnotTotalPage++; //当前页数自增
  4066. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4067. // var infoList = arrList.splice(
  4068. // that.monthnotTotalPage * that.monthnotTotalLages,
  4069. // that.monthnotTotalLages
  4070. // );
  4071. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4072. // }
  4073. // }
  4074. // })
  4075. // },
  4076. listScroll(){
  4077. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4078. this.isMore = true
  4079. setTimeout(()=>{
  4080. this.isMore = false
  4081. },1000)
  4082. }else {
  4083. this.isFlag = true
  4084. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4085. this.monthWorkDataS = datalist
  4086. setTimeout(()=>{
  4087. this.isFlag = false
  4088. },300)
  4089. }
  4090. },
  4091. notListScroll(){
  4092. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4093. this.isMore = true
  4094. setTimeout(()=>{
  4095. this.isMore = false
  4096. },1000)
  4097. }else {
  4098. this.isFlag = true
  4099. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4100. this.monthNotWorkDateS = datalist
  4101. // console.log('length',this.monthNotWorkDateS.length)
  4102. setTimeout(()=>{
  4103. this.isFlag = false
  4104. },300)
  4105. }
  4106. },
  4107. getFirstAndLastDay() {
  4108. // 将选定的月份转换为Date对象
  4109. var monthDate = new Date();
  4110. var year = monthDate.getFullYear();
  4111. var month = monthDate.getMonth();
  4112. // 计算起始日和结束日
  4113. var startDay = new Date(year, month, 1);
  4114. var endDay = new Date(year, month + 1, 0);
  4115. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4116. this.WorktimeDatepickValueForMonth=lastmd
  4117. },
  4118. formatDate(date) {
  4119. var year = date.getFullYear();
  4120. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4121. var day = ("0" + date.getDate()).slice(-2);
  4122. return year + "-" + month + "-" + day;
  4123. },
  4124. // 获取默认这zhou日期参数 222
  4125. getLastWeek(e){
  4126. let newdate = new Date()
  4127. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4128. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4129. if(e==1){
  4130. this.WorktimeDatepickValue = lastwd
  4131. this.showMonthWorkTime()
  4132. }else if(e==2){
  4133. this.WorktimeDatepickValue = lastwd
  4134. this.showMonthWorkTimeReminder()
  4135. }else{
  4136. this.WorktimeDatepickValue = lastwd
  4137. this.showMonthNotWorkTime()
  4138. }
  4139. },
  4140. getThisWeek(e){
  4141. let newdate = new Date();
  4142. let nowdate = newdate.toLocaleDateString();
  4143. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4144. if(e==1){
  4145. this.WorktimeDatepickValue = nowwd
  4146. this.showMonthWorkTime()
  4147. }else if(e==2){
  4148. this.WorktimeDatepickValue = nowwd
  4149. this.showMonthWorkTimeReminder()
  4150. }else{
  4151. this.WorktimeDatepickValue = nowwd
  4152. this.showMonthNotWorkTime()
  4153. }
  4154. },
  4155. getDoubleLastWeek(e){
  4156. let newdate = new Date()
  4157. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4158. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4159. if(e==1){
  4160. this.WorktimeDatepickValue = nextwd
  4161. this.showMonthWorkTime()
  4162. }else if(e==2){
  4163. this.WorktimeDatepickValue = nextwd
  4164. this.showMonthWorkTimeReminder()
  4165. }else{
  4166. this.WorktimeDatepickValue = nextwd
  4167. this.showMonthNotWorkTime()
  4168. }
  4169. },
  4170. alreadyAllDate(stime,etime){
  4171. let diffdate = new Array();
  4172. let i=0;
  4173. while(stime<=etime){
  4174. let dateArray = stime.split("-");
  4175. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4176. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4177. let stimewk = this.weekDay[date.getDay()]
  4178. 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')
  4179. 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])
  4180. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4181. let stime_ts = new Date(stime).getTime();
  4182. let next_date = stime_ts + (24*60*60*1000);
  4183. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4184. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4185. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4186. stime = next_dates_y+next_dates_m+next_dates_d;
  4187. i++;
  4188. }
  4189. return diffdate
  4190. },
  4191. getAutoWeekDate(e) {
  4192. let dateString = e;
  4193. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4194. if (dateString.match(dateStringReg)) {
  4195. let presentDate = new Date(dateString),
  4196. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4197. return Array.from(new Array(7), function (val, index) {
  4198. let formatDate = new Date(
  4199. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4200. );
  4201. return (
  4202. formatDate.getFullYear() +
  4203. "-" +
  4204. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4205. "-" +
  4206. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4207. );
  4208. });
  4209. } else {
  4210. throw new Error(
  4211. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4212. );
  4213. }
  4214. },
  4215. onProgressChange() {
  4216. this.$forceUpdate();
  4217. },
  4218. showChooseMembTree() {
  4219. this.chosenMembCount = this.participator.length;
  4220. this.chooseParticipVisible = true;
  4221. },
  4222. onTreeItemChange() {
  4223. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4224. var list = chosenList.filter(item=>item.isUser == 1);
  4225. this.chosenMembCount = list.length;
  4226. },
  4227. findUserInTree() {
  4228. if (this.filterName == '') {
  4229. this.deptMembData = this.allMembData;
  4230. } else {
  4231. var list = this.findRecursively(this.filterName, this.allMembData);
  4232. this.deptMembData = list;
  4233. }
  4234. },
  4235. findRecursively(username, list) {
  4236. var filterList = [];
  4237. for (var i=0;i<list.length; i++) {
  4238. if (list[i].isUser == 1) {
  4239. if (list[i].label.indexOf(username) >= 0) {
  4240. //匹配上了
  4241. filterList.push(list[i]);
  4242. }
  4243. } else if (list[i].children != null && list[i].children.length > 0) {
  4244. var subList = this.findRecursively(username, list[i].children);
  4245. if (subList.length > 0) {
  4246. subList.forEach(s=>filterList.push(s));
  4247. }
  4248. }
  4249. }
  4250. return filterList;
  4251. },
  4252. //确定选择参与人
  4253. chooseParticip() {
  4254. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4255. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4256. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4257. if (this.user.company.packageProject == 1) {
  4258. if (this.chosenMembList.length > 1) {
  4259. this.$message({
  4260. message: '每次仅支持代填一个人',
  4261. type: "error",
  4262. });
  4263. return;
  4264. }
  4265. }
  4266. this.chooseParticipVisible = false;
  4267. this.workForm.userNames = '';
  4268. this.workForm.userId = [];
  4269. this.participator = [];
  4270. for (var i=0;i<this.chosenMembList.length; i++) {
  4271. this.workForm.userId.push(this.chosenMembList[i].id);
  4272. this.workForm.userNames += this.chosenMembList[i].label+',';
  4273. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4274. this.participator.push(item);
  4275. }
  4276. if (this.workForm.userNames.length > 0) {
  4277. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4278. }
  4279. if(this.user.userNameNeedTranslate == 1) {
  4280. if(this.workForm.userNames) {
  4281. this.workForm.userNames = this.workForm.userNames.split(',')
  4282. }
  4283. }
  4284. },
  4285. notifySel(sel){
  4286. // console.log(sel);
  4287. this.notifySelList = sel
  4288. },
  4289. //微信通知人员填写
  4290. Notify(code) {
  4291. if (this.notifySelList.length == 0) return;
  4292. var ids = '';
  4293. this.notifySelList.forEach(f=>{
  4294. ids += f.id+',';
  4295. })
  4296. this.http.post('/user/pushFillReport',{
  4297. ids: ids, date: this.curDate,
  4298. code: code
  4299. },
  4300. res => {
  4301. if (res.code == "ok") {
  4302. this.$message({
  4303. message: this.$t('message.sentSuccessfully'),
  4304. type: "success"
  4305. });
  4306. }
  4307. },
  4308. error => {
  4309. this.$message({
  4310. message: error,
  4311. type: "error"
  4312. });
  4313. }
  4314. );
  4315. },
  4316. //导出人员列表
  4317. exportMemb() {
  4318. if (this.fillMembList.length == 0) return;
  4319. var ids = '';
  4320. this.fillMembList.forEach(f=>{
  4321. ids += f.id+',';
  4322. })
  4323. this.http.post('/user/exportMembList',{
  4324. ids: ids,isFill: this.isFill, date: this.curDate
  4325. },
  4326. res => {
  4327. if (res.code == "ok") {
  4328. var aTag = document.createElement('a');
  4329. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4330. aTag.href = res.data;
  4331. aTag.click();
  4332. }
  4333. },
  4334. error => {
  4335. this.$message({
  4336. message: error,
  4337. type: "error"
  4338. });
  4339. }
  4340. );
  4341. },
  4342. showMembList(fill) {
  4343. this.membListVisible = true;
  4344. if (fill == 0) {
  4345. this.fillMembList = this.unFillList;
  4346. this.isFill = false;
  4347. let leaveList = []
  4348. let unleaveList = []
  4349. for(let i in this.fillMembList){
  4350. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4351. leaveList.push(this.fillMembList[i])
  4352. }else{
  4353. unleaveList.push(this.fillMembList[i])
  4354. }
  4355. }
  4356. this.fillMembList = unleaveList
  4357. this.fillMembList_leave = leaveList
  4358. } else if(fill == 1){
  4359. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4360. this.isFill = true;
  4361. }else{
  4362. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4363. this.isFill = true;
  4364. }
  4365. },
  4366. //获取自己填写的日报状态
  4367. getReportFillStatus() {
  4368. this.http.post('/report/getReportFillStatus',{
  4369. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4370. },
  4371. res => {
  4372. if (res.code == "ok") {
  4373. this.fillStatusList = res.data;
  4374. this.allDate.forEach(d=>{
  4375. var fillInfo = null;
  4376. d.state = null;
  4377. this.fillStatusList.forEach(s=>{
  4378. var d1 = s.createDate.split('-')[2];
  4379. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4380. if (d1.indexOf('0') == 0) {
  4381. d1 = d1.substring(1,d1.length);
  4382. }
  4383. if (d1 == d2) {
  4384. d.state = s.state;
  4385. d.exceedCardTime = s.exceedCardTime
  4386. }
  4387. })
  4388. })
  4389. this.$forceUpdate();
  4390. }
  4391. },
  4392. error => {
  4393. this.$message({
  4394. message: error,
  4395. type: "error"
  4396. });
  4397. }
  4398. );
  4399. },
  4400. scrollFunction () {
  4401. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4402. if (this.domObj.attachEvent) { // IE
  4403. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4404. } else if (this.domObj.addEventListener) {
  4405. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4406. }
  4407. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4408. },
  4409. mouseScroll(event) { // google 浏览器下
  4410. let detail = event.wheelDelta || event.detail
  4411. let moveForwardStep = -1
  4412. let moveBackStep = 1
  4413. let step = 0
  4414. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4415. event.preventDefault() // 阻止浏览器默认事件
  4416. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4417. },
  4418. // //左右滚动
  4419. // wheel(e){
  4420. // var a = document.getElementById("dateScroll");
  4421. // var scroll_width = 80; //滚动一下的距离
  4422. // var e = e || window.event, v;
  4423. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4424. // if(v>3||-v>3) v=-v;
  4425. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4426. // e.preventDefault(); //阻止浏览器的默认滚动
  4427. // },
  4428. showExportDialog() {
  4429. this.exportType = 0
  4430. this.exportDialog = true;
  4431. },
  4432. showExportTimeDialog() {
  4433. this.exportTimeDialog = true;
  4434. },
  4435. changeAllTime() {
  4436. //总时长发生改变,自动按比例计算
  4437. this.workForm.domains.forEach(d=>{
  4438. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4439. });
  4440. //计算jsTime
  4441. if (this.workForm.createDate) {
  4442. let sdate = new Date(this.workForm.createDate[0]);
  4443. let edate = new Date(this.workForm.createDate[1]);
  4444. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4445. console.log('days===', days)
  4446. if (days < 0) {
  4447. days = 0;
  4448. }
  4449. this.jsTime = this.reportTimeType.allday * days;
  4450. }
  4451. },
  4452. // 是否加班的单机事件
  4453. check() {
  4454. this.selected = !this.selected
  4455. this.isNew = this.selected
  4456. },
  4457. updateSubProject() {
  4458. this.$forceUpdate();
  4459. },
  4460. selectDegreeId(domain, index) {
  4461. this.http.post('/report/defaultDegree',{
  4462. projectId: domain.projectId
  4463. },
  4464. res => {
  4465. if (res.code == "ok") {
  4466. if(res.data) {
  4467. this.workForm.domains[index].degreeId = res.data.id + ''
  4468. this.$forceUpdate();
  4469. }
  4470. }
  4471. },
  4472. error => {
  4473. this.$message({
  4474. message: error,
  4475. type: "error"
  4476. });
  4477. }
  4478. );
  4479. },
  4480. //项目选中了, 加载子项目
  4481. selectProject(domain, index) {
  4482. if(!domain.projectId){
  4483. return;
  4484. }
  4485. // 默认选中上次填写的自定义维度
  4486. if(this.yonghuUser.customDegreeActive == 1) {
  4487. this.selectDegreeId(domain, index)
  4488. }
  4489. // console.log('projectId===',domain.projectId);
  4490. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4491. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4492. this.http.post('/sub-project/list',{
  4493. projectId: domain.projectId,
  4494. isReport: true
  4495. },
  4496. res => {
  4497. //清空之前选中的子项目
  4498. // this.workForm.domains[index].subProjectId = 0;
  4499. if (res.code == "ok") {
  4500. this.workForm.domains[index].subProjectList = res.data;
  4501. this.workForm.domains[index].subProjectId = null;
  4502. this.$forceUpdate();
  4503. }
  4504. },
  4505. error => {
  4506. this.$message({
  4507. message: error,
  4508. type: "error"
  4509. });
  4510. }
  4511. );
  4512. //项目相关的近期任务
  4513. if (this.user.company.packageProject == 1) {
  4514. this.getRecentTaskList(domain, index);
  4515. //获取项目相关专业
  4516. if (this.user.company.packageEngineering == 1) {
  4517. this.getProjectProfessions(domain, index);
  4518. }
  4519. //获取项目下的任务分组
  4520. this.getTaskGroups(domain, index);
  4521. }
  4522. // 获取项目相关的维度
  4523. // domain.degreeId = null
  4524. this.$set(domain,'degreeId',null)
  4525. this.$set(domain,'multiDegrIdArray',null)
  4526. this.dimension(domain, index);
  4527. //获取项目审核人
  4528. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4529. this.getProjectAuditorList(domain, index);
  4530. } else {
  4531. //按分组的负责人来审核
  4532. domain.projectAuditorId = null;
  4533. domain.projectAuditorName = null;
  4534. domain.auditUserList = null;
  4535. }
  4536. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4537. if (this.reportTimeType.type == 3) {
  4538. //新增项目时,自动计算
  4539. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4540. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4541. }
  4542. //加载昱众的工作职责
  4543. if (this.user.companyId == this.yuzhongCompId) {
  4544. this.updateResponse(domain);
  4545. }
  4546. },
  4547. getRecentTaskList(domain, index) {
  4548. //刷新任务时,清空服务
  4549. this.$set(domain, 'sapServiceId', null);
  4550. this.$set(domain, 'taskId', null);
  4551. var param = {
  4552. projectId: domain.projectId,
  4553. isSubstitude:this.isSubstitude?1:0,
  4554. };
  4555. if (domain.groupId) {
  4556. param.groupId = domain.groupId;
  4557. }
  4558. if (domain.stage) {
  4559. param.stage = domain.stage;
  4560. }
  4561. //专业版代填,获取代填员工的任务
  4562. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4563. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4564. this.$message({
  4565. message: '请选择代填的员工',
  4566. type: "error"
  4567. });
  4568. return;
  4569. } else {
  4570. param.userId = this.workForm.userId[0];
  4571. }
  4572. }
  4573. this.http.post('/task/getRecentTask',param,
  4574. res => {
  4575. if (res.code == "ok") {
  4576. this.workForm.domains[index].allTaskList = res.data;
  4577. this.workForm.domains[index].taskList = res.data;
  4578. this.$forceUpdate();
  4579. }
  4580. },
  4581. error => {
  4582. this.$message({
  4583. message: error,
  4584. type: "error"
  4585. });
  4586. }
  4587. );
  4588. },
  4589. //获取项目审核人
  4590. getProjectAuditorList(domainItem, index) {
  4591. if(domainItem.projectId == '') {
  4592. return
  4593. }
  4594. domainItem.projectAuditorId = null;
  4595. domainItem.projectAuditorName = null;
  4596. this.http.post('/project-auditor/getList',{
  4597. projectId: domainItem.projectId,
  4598. },
  4599. res => {
  4600. if (res.code == "ok") {
  4601. domainItem.auditUserList = res.data;
  4602. if (res.data.length==0) {
  4603. this.$message({
  4604. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4605. type: "error"
  4606. });
  4607. } else if (res.data.length==1) {
  4608. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4609. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4610. }
  4611. this.$forceUpdate();
  4612. }
  4613. },
  4614. error => {
  4615. this.$message({
  4616. message: error,
  4617. type: "error"
  4618. });
  4619. }
  4620. );
  4621. },
  4622. // 获取维度数据
  4623. dimension(domain, index) {
  4624. if(domain.projectId == '') {
  4625. return
  4626. }
  4627. this.http.post('/project/getDegreeList',{
  4628. projectId: domain.projectId,
  4629. },
  4630. res => {
  4631. if (res.code == "ok") {
  4632. // console.log("维度数据",res.data);
  4633. this.workForm.domains[index].wuduList = res.data
  4634. // this.workForm = this.workForm
  4635. this.$forceUpdate()
  4636. }
  4637. },
  4638. error => {
  4639. this.$message({
  4640. message: error,
  4641. type: "error"
  4642. });
  4643. }
  4644. );
  4645. },
  4646. //切换任务阶段
  4647. changeStages(domain, index) {
  4648. if (domain.stage == null || domain.stage == '') {
  4649. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4650. } else {
  4651. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4652. }
  4653. this.getRecentTaskList(domain, index);
  4654. this.$forceUpdate();
  4655. },
  4656. getGroupStages(domain, index, keepStage) {
  4657. // console.log(domain);
  4658. if(!domain.groupId){
  4659. domain.projectAuditorId = ''
  4660. domain.stages = []
  4661. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4662. domain.taskId = ''
  4663. domain.sapServiceId = ''
  4664. }
  4665. if(this.user.timeType.reportAuditType >= 1){
  4666. domain.auditUserList = []
  4667. }
  4668. this.$forceUpdate();
  4669. return
  4670. }
  4671. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4672. res => {
  4673. if (res.code == "ok") {
  4674. if (!keepStage) {
  4675. domain.stage = '';
  4676. }
  4677. domain.stages = res.data;
  4678. this.getRecentTaskList(domain, index);
  4679. this.$forceUpdate();
  4680. }
  4681. },
  4682. error => {
  4683. this.$message({
  4684. message: error,
  4685. type: "error"
  4686. });
  4687. });
  4688. //检查当前的项目是否需要获取分组的负责人
  4689. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4690. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4691. res => {
  4692. if (res.code == "ok") {
  4693. domain.getProjectAuditorList = res.data;
  4694. domain.auditUserList = res.data;
  4695. if (res.data.length==1) {
  4696. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4697. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4698. } else if (res.data.length==0) {
  4699. domain.projectAuditorId = null;
  4700. domain.projectAuditorName = null;
  4701. }
  4702. this.$forceUpdate();
  4703. }
  4704. },
  4705. error => {
  4706. this.$message({
  4707. message: error,
  4708. type: "error"
  4709. });
  4710. });
  4711. }
  4712. },
  4713. getProjectProfessions(domain, index) {
  4714. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4715. res => {
  4716. if (res.code == "ok") {
  4717. this.workForm.domains[index].professionProgress = res.data;
  4718. this.$forceUpdate();
  4719. }
  4720. },
  4721. error => {
  4722. this.$message({
  4723. message: error,
  4724. type: "error"
  4725. });
  4726. });
  4727. },
  4728. //删除自己的日报
  4729. deleteReport() {
  4730. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4731. confirmButtonText: this.$t('btn.determine'),
  4732. cancelButtonText: this.$t('btn.cancel'),
  4733. type: "warning"
  4734. })
  4735. .then(() => {
  4736. this.listLoading = true;
  4737. this.http.post('/report/delete',{
  4738. userId: this.user.id,
  4739. date: this.workForm.createDate
  4740. },
  4741. res => {
  4742. this.listLoading = false;
  4743. if (res.code == "ok") {
  4744. this.$message({
  4745. message: this.$t('message.successfullyDeleted'),
  4746. type: "success"
  4747. });
  4748. this.getReportList();
  4749. this.getDepartment();
  4750. this.dialogVisible = false;
  4751. } else {
  4752. this.$message({
  4753. message: res.msg,
  4754. type: "error"
  4755. });
  4756. }
  4757. },
  4758. error => {
  4759. this.listLoading = false;
  4760. this.$message({
  4761. message: error,
  4762. type: "error"
  4763. });
  4764. }
  4765. );
  4766. })
  4767. .catch(() => {});
  4768. },
  4769. // 管理员删除日报
  4770. guanli(item) {
  4771. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4772. let param = {date: this.date + day, userId: item.id};
  4773. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4774. confirmButtonText: this.$t('btn.determine'),
  4775. cancelButtonText: this.$t('btn.cancel'),
  4776. type: "warning"
  4777. })
  4778. .then(() => {
  4779. this.listLoading = true;
  4780. this.http.post('/report/delete',param,
  4781. res => {
  4782. this.listLoading = false;
  4783. if (res.code == "ok") {
  4784. this.$message({
  4785. message: this.$t('message.successfullyDeleted'),
  4786. type: "success"
  4787. });
  4788. this.getReportList();
  4789. this.getDepartment();
  4790. this.dialogVisible = false;
  4791. } else {
  4792. this.$message({
  4793. message: res.msg,
  4794. type: "error"
  4795. });
  4796. }
  4797. },
  4798. error => {
  4799. this.listLoading = false;
  4800. this.$message({
  4801. message: error,
  4802. type: "error"
  4803. });
  4804. }
  4805. );
  4806. })
  4807. .catch(() => {});
  4808. },
  4809. selectAll() {
  4810. if (this.isAllSelect) {
  4811. var keys = [];
  4812. this.reportNames.forEach(b=>{
  4813. keys.push(b.id);
  4814. })
  4815. this.$refs.approveTree.setCheckedKeys(keys);
  4816. } else {
  4817. this.$refs.approveTree.setCheckedKeys([]);
  4818. }
  4819. },
  4820. removeEmptyNode(list) {
  4821. for (var i=0;i<list.length;i++) {
  4822. var cnt = 0;
  4823. if (list[i].membCount == 0) {
  4824. list.splice(i, 1);
  4825. i--;
  4826. } else if (list[i].children != null) {
  4827. this.removeEmptyNode(list[i].children);
  4828. }
  4829. }
  4830. },
  4831. calculateMembCount(list) {
  4832. for (var i in list) {
  4833. var cnt = 0;
  4834. if (list[i].children != null) {
  4835. this.calculateMembCount(list[i].children);
  4836. for (var m in list[i].children) {
  4837. cnt += list[i].children[m].membCount;
  4838. }
  4839. }
  4840. if (list[i].isUser == 1) {
  4841. cnt++;
  4842. this.membCount++;
  4843. }
  4844. list[i].membCount = cnt;
  4845. }
  4846. },
  4847. stateChange() {
  4848. // console.log(this.allData,'alldate');
  4849. this.membCount = 0;
  4850. if (this.selectState == -1) {
  4851. //全部状态
  4852. this.data = this.allData;
  4853. } else {
  4854. //未填报
  4855. this.seluserText = ''
  4856. var newData = JSON.parse(JSON.stringify(this.allData));
  4857. this.filterState(this.selectState, newData);
  4858. this.data = newData;
  4859. }
  4860. this.calculateMembCount(this.data);
  4861. this.data[0].membCount = this.membCount;//总人数
  4862. },
  4863. //按状态过滤部门人员
  4864. filterState(state, list) {
  4865. for (var i =0;i<list.length; i++) {
  4866. var obj = list[i];
  4867. if (obj.isUser == 1) {
  4868. var match = false;
  4869. if (state == -2) {
  4870. if (obj.state == null) {
  4871. match = true;
  4872. }
  4873. } else {
  4874. if (obj.state == state) {
  4875. match = true;
  4876. }
  4877. }
  4878. if (!match) {
  4879. list.splice(i, 1);
  4880. i--;
  4881. } else {
  4882. }
  4883. } else {
  4884. if (obj.children != null) {
  4885. this.filterState(state, obj.children);
  4886. }
  4887. }
  4888. }
  4889. },
  4890. //a按名称过滤部门人员
  4891. async seluserforText(){
  4892. const { userNameNeedTranslate } = this.user
  4893. this.membCount = 0;
  4894. var newData = JSON.parse(JSON.stringify(this.allData));
  4895. let textList = [this.seluserText]
  4896. if(userNameNeedTranslate == 1) {
  4897. this.dataLoading = true
  4898. let res = await this.postData('/user/getEmployeeList', {
  4899. keyword: this.seluserText,
  4900. cursor: '',
  4901. departmentId: -1,
  4902. pageIndex: 1,
  4903. pageSize: 1000
  4904. })
  4905. textList = res.data.records.map(item => item.name)
  4906. this.dataLoading = false
  4907. }
  4908. // return
  4909. console.log(textList, '<=== textList')
  4910. this.seluserforTextin(this.seluserText, newData, textList)
  4911. console.log(newData, 'Data')
  4912. this.data = newData;
  4913. this.calculateMembCount(this.data);
  4914. this.data[0].membCount = this.membCount;//总人数
  4915. },
  4916. seluserforTextin(text, list, textList = []){
  4917. for (var i =0;i<list.length; i++) {
  4918. var obj = list[i];
  4919. if (obj.isUser == 1) {
  4920. var match = false;
  4921. // if (obj.label.indexOf(text) != -1) {
  4922. // match = true
  4923. // }
  4924. if(textList.some(item => item.includes(obj.label))) {
  4925. match = true
  4926. }
  4927. if (!match) {
  4928. list.splice(i, 1);
  4929. i--;
  4930. } else {
  4931. }
  4932. } else {
  4933. if (obj.children != null) {
  4934. this.seluserforTextin(text, obj.children, textList);
  4935. }
  4936. }
  4937. }
  4938. },
  4939. // 当节点发生变化时
  4940. nodeChangeExpand(data) {
  4941. // 保存当前展开的节点
  4942. let flag = false
  4943. this.nodeModelData.some(item => {
  4944. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4945. flag = true
  4946. return true
  4947. }
  4948. })
  4949. if (!flag) { // 不存在则存到数组里
  4950. this.nodeModelData.push(data.id)
  4951. }
  4952. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4953. },
  4954. nodeChangeCollapse(data) {
  4955. console.log(this.nodeModelData)
  4956. this.nodeModelData.some((item, i) => {
  4957. if (item === data.id) {
  4958. this.nodeModelData.length = i
  4959. }
  4960. })
  4961. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4962. },
  4963. // 部门列表点击
  4964. handleNodeClick(data) {
  4965. // this.dealList = data
  4966. this.theValues(data.id, this.allData)
  4967. // this.depData = data;
  4968. var list = [];
  4969. if (data.id == -1) {
  4970. this.deptId = null;
  4971. this.targetUid = null;
  4972. list = this.data;
  4973. } else if (data.isUser == 1) {
  4974. this.deptId = null;
  4975. this.targetUid = data.id;
  4976. } else {
  4977. this.deptId = data.id;
  4978. this.targetUid = null;
  4979. list.push(data);
  4980. }
  4981. this.getReportList();
  4982. if (list.length > 0) {
  4983. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4984. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4985. }
  4986. },
  4987. exportPushLog(){
  4988. this.http.post('/sap-sync-log/export',{},
  4989. res => {
  4990. if (res.code == "ok") {
  4991. var filePath = res.data;
  4992. var fName = '推送日志.xlsx'
  4993. const a = document.createElement('a'); // 创建a标签
  4994. a.setAttribute('download', fName);// download属性
  4995. a.setAttribute('href', filePath);// href链接
  4996. a.click(); //自执行点击事件
  4997. a.remove();
  4998. } else {
  4999. this.$message({
  5000. message: res.msg,
  5001. type: "error"
  5002. });
  5003. }
  5004. },
  5005. error => {
  5006. this.$message({
  5007. message: error,
  5008. type: "error"
  5009. });
  5010. });
  5011. },
  5012. theValues(id, item) {
  5013. for(var i in item) {
  5014. if(item[i].id == id) {
  5015. this.depData = item[i]
  5016. if(id == '-1') {
  5017. this.translation = '1'
  5018. } else {
  5019. if(item[i].children) {
  5020. this.translation = '2'
  5021. } else {
  5022. this.translation = '3'
  5023. }
  5024. }
  5025. return
  5026. } else {
  5027. if(item[i].children) {
  5028. this.theValues(id, item[i].children)
  5029. }
  5030. }
  5031. }
  5032. },
  5033. //获取可以选择的代填的人员列表
  5034. getSubstitudeUserDeptList() {
  5035. if (this.deptMembData.length == 0) {
  5036. this.http.post("/department/listMyMembs", {},
  5037. res => {
  5038. if (res.code == "ok") {
  5039. let noAllData = JSON.parse(JSON.stringify(res.data));
  5040. if (noAllData.length > 0) {
  5041. // if (noAllData[0].label == '全部人员') {
  5042. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5043. noAllData.splice(0,1);
  5044. }
  5045. }
  5046. this.setUserToDept(noAllData);
  5047. this.deptMembData = noAllData;
  5048. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5049. console.log(this.deptMembData, '代填人员数据')
  5050. } else {
  5051. this.$message({
  5052. message: res.msg,
  5053. type: "error"
  5054. });
  5055. }
  5056. },
  5057. error => {
  5058. this.$message({
  5059. message: error,
  5060. type: "error"
  5061. });
  5062. });
  5063. }
  5064. },
  5065. // 获取部门列表
  5066. getDepartmentForApprove() {
  5067. this.http.post( this.port.manage.depList, {},
  5068. res => {
  5069. if (res.code == "ok") {
  5070. var list1 = JSON.parse(JSON.stringify(res.data));
  5071. this.deptOptionList = this.changeArr(list1);
  5072. console.log(this.deptOptionList, '部门')
  5073. } else {
  5074. this.$message({
  5075. message: res.msg,
  5076. type: "error"
  5077. });
  5078. }
  5079. },
  5080. error => {
  5081. this.$message({
  5082. message: error,
  5083. type: "error"
  5084. });
  5085. });
  5086. },
  5087. // 获取部门列表
  5088. getDepartment() {
  5089. //如果没有权限,就不需要获取
  5090. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5091. return;
  5092. }
  5093. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5094. var param = {date:this.date + day};
  5095. this.http.post("/report/getMembList", param,
  5096. res => {
  5097. if (res.code == "ok") {
  5098. if(res.data.length == 0){
  5099. return
  5100. }
  5101. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5102. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5103. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5104. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5105. // if (this.user.role > 0) {
  5106. // }
  5107. list.splice(0,0,{
  5108. id: -1,
  5109. label: this.$t('lable.allStaff'),
  5110. })
  5111. this.membCount = 0;
  5112. //设置员工到部门下面
  5113. this.setUserToDept(list);
  5114. this.data = list;
  5115. // console.log('data',this.data);
  5116. this.expandDate = [this.data[1].id]
  5117. this.allData = list;
  5118. // if (noAllData.length > 0) {
  5119. // if (noAllData[0].label == '全部人员') {
  5120. // noAllData.splice(0,1);
  5121. // }
  5122. // }
  5123. // this.setUserToDept(noAllData);
  5124. // this.deptMembData = noAllData;
  5125. this.option = this.changeArr(list1);
  5126. list[0].membCount = this.membCount;
  5127. if (this.depData.id == -1) {
  5128. this.depData.membCount = this.membCount;
  5129. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5130. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5131. } else {
  5132. if (this.depData.isUser == null) {
  5133. var dep = this.findTargetDept(this.data, this.depData.id);
  5134. var membDeptList = [];
  5135. membDeptList.push(dep);
  5136. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5137. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5138. }
  5139. }
  5140. if (this.depData.isUser == null) {
  5141. if (this.isFill) {
  5142. this.fillMembList = this.fillList;
  5143. } else {
  5144. this.fillMembList = this.unFillList;
  5145. }
  5146. }
  5147. this.leaveAllNum = 0
  5148. for(let i in this.unFillList){
  5149. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5150. this.leaveAllNum += 1
  5151. }
  5152. }
  5153. this.stateChange()
  5154. } else {
  5155. this.$message({
  5156. message: res.msg,
  5157. type: "error"
  5158. });
  5159. }
  5160. },
  5161. error => {
  5162. this.$message({
  5163. message: error,
  5164. type: "error"
  5165. });
  5166. });
  5167. this.getReportFillStatus();
  5168. },
  5169. findTargetDept(list, deptId) {
  5170. var t = null;
  5171. for (var i=0;i<list.length; i++) {
  5172. if (list[i].isUser == null && list[i].id == deptId) {
  5173. t = list[i];
  5174. break;
  5175. }
  5176. }
  5177. if (t == null) {
  5178. for (var i=0;i<list.length; i++) {
  5179. if (list[i].children != null && list[i].children.length > 0) {
  5180. t = this.findTargetDept(list[i].children, deptId);
  5181. if (t != null) {
  5182. break;
  5183. }
  5184. }
  5185. }
  5186. }
  5187. return t;
  5188. },
  5189. getUserMembListFromDeptList(list, isFill) {
  5190. var membList = [];
  5191. for (var i in list) {
  5192. var deptName = list[i].label;
  5193. if (list[i].userList != null) {
  5194. list[i].userList.forEach(element => {
  5195. if (isFill == 0) {
  5196. //获取未填的
  5197. if (element.state == null) {
  5198. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5199. membList.push(obj);
  5200. }
  5201. } else {
  5202. if (element.state != null) {
  5203. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5204. membList.push(obj);
  5205. }
  5206. }
  5207. });
  5208. }
  5209. if (list[i].children != null) {
  5210. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5211. }
  5212. }
  5213. return membList;
  5214. },
  5215. setUserToDept(list) {
  5216. for (var i in list) {
  5217. var cnt = 0;
  5218. if (list[i].children != null) {
  5219. this.setUserToDept(list[i].children);
  5220. for (var m in list[i].children) {
  5221. cnt += list[i].children[m].membCount;
  5222. }
  5223. }
  5224. if (list[i].userList != null) {
  5225. if (list[i].children == null) {
  5226. list[i].children = [];
  5227. }
  5228. list[i].userList.forEach(element => {
  5229. var obj = {
  5230. id: element.id,
  5231. label:element.name,
  5232. state:element.state,
  5233. parentId:element.departmentId,
  5234. isUser:1,
  5235. workingTime: element.workingTime,
  5236. leaveDays: element.leaveDays,
  5237. leaveTimes: element.leaveTimes
  5238. };
  5239. list[i].children.push(obj);
  5240. this.membCount++;
  5241. cnt++;
  5242. });
  5243. }
  5244. list[i].membCount = cnt;
  5245. }
  5246. },
  5247. // 修改数组
  5248. changeArr(arr) {
  5249. for (var i = 0; i < arr.length; i++) {
  5250. if(arr[i].id != -1 && arr[i].id != 0) {
  5251. if (arr[i].children != null && arr[i].children.length>0) {
  5252. arr[i].children = this.changeArr(arr[i].children);
  5253. }
  5254. arr[i].id && (arr[i].value = arr[i].id);
  5255. delete arr[i].id;
  5256. }
  5257. }
  5258. for(var i in arr) {
  5259. if(arr[i].id == -1 || arr[i].id == 0) {
  5260. arr.splice(i,1)
  5261. }
  5262. }
  5263. return arr;
  5264. },
  5265. //时间段范围设置改动,监听
  5266. onTimeTypeChange(timeType) {
  5267. this.seleChn(1)
  5268. this.showAddMore = true;
  5269. for(var i in this.workForm.domains) {
  5270. if (this.workForm.domains[i].timeType == 0) {
  5271. this.showAddMore = false;
  5272. break;
  5273. }
  5274. }
  5275. if (this.showAddMore) {
  5276. //检测数量
  5277. if (this.workForm.domains.length == 2) {
  5278. this.showAddMore = false;
  5279. } else {
  5280. this.showAddMore = true;
  5281. }
  5282. }
  5283. },
  5284. getTimeType() {
  5285. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5286. res => {
  5287. if (res.code == "ok") {
  5288. var t = res.data;
  5289. this.reportTimeType = t;
  5290. if (this.reportTimeType.type > 0) {
  5291. this.showAddMore = true;
  5292. }
  5293. //转化时间格式
  5294. if (t.allday != null) {
  5295. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5296. }
  5297. if (t.am != null) {
  5298. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5299. }
  5300. if (t.pm != null) {
  5301. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5302. }
  5303. let arr = []
  5304. for(var i in res.data.excludeTimeList) {
  5305. let obj = {
  5306. s: res.data.excludeTimeList[i].startTime,
  5307. e: res.data.excludeTimeList[i].endTime,
  5308. }
  5309. arr.push(obj)
  5310. }
  5311. this.vacationTime = arr
  5312. } else {
  5313. this.$message({
  5314. message: res.msg,
  5315. type: "error"
  5316. });
  5317. }
  5318. },
  5319. error => {
  5320. this.listLoading = false;
  5321. this.$message({
  5322. message: error,
  5323. type: "error"
  5324. });
  5325. });
  5326. },
  5327. // 改变月份 -------
  5328. changeMonthOut() {
  5329. this.getAllDate();
  5330. this.getReportList();
  5331. this.getDepartment();
  5332. },
  5333. // 选择日期
  5334. choseDate(i, item) {
  5335. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5336. return
  5337. }
  5338. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5339. this.choseDay = i;
  5340. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5341. sessionStorage.msg = this.date + day,
  5342. this.getReportList();
  5343. this.getDepartment();
  5344. this.curDate = item.date;
  5345. },
  5346. canClick(i, item){
  5347. let nowDate = new Date()
  5348. let nowDateYear = nowDate.getFullYear()
  5349. let itemYear = parseInt(this.date.split('-')[0])
  5350. let nowDateMonth = nowDate.getMonth() + 1
  5351. let itemMonth = parseInt(this.date.split('-')[1])
  5352. let nowDateDay = nowDate.getDate()
  5353. let itemDay = parseInt(item.showDate.split('.')[1])
  5354. if(nowDateYear < itemYear){
  5355. return false
  5356. }else if(nowDateYear == itemYear){
  5357. if(nowDateMonth < itemMonth){
  5358. return false
  5359. }else if(nowDateMonth == itemMonth){
  5360. if(nowDateDay < itemDay){
  5361. return false
  5362. }
  5363. }
  5364. }
  5365. },
  5366. // 获取日期列表
  5367. getAllDate(e) {
  5368. var dayArry = [];
  5369. var day = this.getCountDays();
  5370. let curMonthDay = null;
  5371. for (var k = 1; k <= day; k++) {
  5372. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5373. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5374. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5375. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5376. if(sessionStorage.msg) {
  5377. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5378. this.choseDay = k - 1;
  5379. curMonthDay = str;
  5380. }
  5381. } else {
  5382. if (new Date().getDate() == k) {
  5383. this.choseDay = k - 1;
  5384. }
  5385. }
  5386. } else {
  5387. this.choseDay = 0;
  5388. }
  5389. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5390. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5391. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5392. }
  5393. this.allDate = dayArry;
  5394. //不能超过最大日期
  5395. if (this.choseDay > day-1) {
  5396. this.choseDay = day-1;
  5397. }
  5398. if(sessionStorage.from != 1){
  5399. let nowmonth = new Date().getMonth() + 1
  5400. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5401. let nowdate = new Date().getDate()
  5402. if(nowd == this.date){
  5403. if(e && sessionStorage.msg){
  5404. }else{
  5405. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5406. }
  5407. let nowday = new Date(sessionStorage.msg).getDate()
  5408. this.choseDay = nowday - 1
  5409. let monthdate = new Date(sessionStorage.msg)
  5410. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5411. }else{
  5412. if(e && sessionStorage.msg){
  5413. }else{
  5414. sessionStorage.msg = this.date + '-01'
  5415. }
  5416. let monthdate = new Date(sessionStorage.msg)
  5417. this.choseDay = monthdate.getDate() - 1
  5418. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5419. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5420. }
  5421. }else{
  5422. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5423. }
  5424. //从消息点击跳转过来的,直接加载指定日期
  5425. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5426. this.curDate = sessionStorage.msg;
  5427. sessionStorage.from = 0;
  5428. } else {
  5429. // if (curMonthDay != null) {
  5430. // // this.curDate = curMonthDay;
  5431. // let d = new Date(sessionStorage.msg)
  5432. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5433. // } else {
  5434. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5435. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5436. // }
  5437. }
  5438. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5439. // if(!sessionStorage.msg){
  5440. // let msgday = this.choseDay + 1
  5441. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5442. // }
  5443. this.getReportFillStatus();
  5444. },
  5445. getCountDays() {
  5446. var newstr = this.date.replace(/-/g, "/");
  5447. var curDate = new Date(newstr+'/01');
  5448. var curMonth = curDate.getMonth();
  5449. curDate.setMonth(curMonth + 1);
  5450. curDate.setDate(0);
  5451. return curDate.getDate();
  5452. },
  5453. reqMore() {
  5454. if (this.hasMore) {
  5455. this.pageIndex++;
  5456. this.requestHttpReports();
  5457. }
  5458. },
  5459. //加载日报数据
  5460. requestHttpReports() {
  5461. //请求数据
  5462. this.listLoading = true;
  5463. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5464. let param = {date: this.date + day};
  5465. if (this.deptId) {
  5466. param.deptId = this.deptId;
  5467. }
  5468. if (this.targetUid) {
  5469. param.userId = this.targetUid;
  5470. }
  5471. //传页码
  5472. if (this.hasMore) {
  5473. param.pageIndex = this.pageIndex;
  5474. }
  5475. this.http.post( this.port.report.list, param,
  5476. res => {
  5477. this.listLoading = false;
  5478. if (res.code == "ok") {
  5479. //扩增
  5480. if (res.data.data.length > 0) {
  5481. this.reportList = this.reportList.concat(res.data.data);
  5482. } else if (this.pageIndex > 1){
  5483. this.$message({
  5484. message: '没有更多数据了',
  5485. type: "info"
  5486. });
  5487. }
  5488. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5489. if(document.querySelector("#day"+this.choseDay)){
  5490. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5491. }
  5492. } else {
  5493. this.$message({
  5494. message: res.msg,
  5495. type: "error"
  5496. });
  5497. }
  5498. },
  5499. error => {
  5500. this.listLoading = false;
  5501. this.$message({
  5502. message: error,
  5503. type: "error"
  5504. });
  5505. });
  5506. },
  5507. //获取日报列表
  5508. getReportList() {
  5509. //初始化,重置数据
  5510. this.pageIndex = 0;
  5511. this.hasMore = true;
  5512. this.reportList = [];
  5513. this.requestHttpReports();
  5514. },
  5515. //刷新日报状态,用于审核后更新
  5516. refreshReportData(reportId) {
  5517. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5518. res => {
  5519. if (res.code == "ok") {
  5520. for (var m=0;m<this.reportList.length; m++) {
  5521. var d = this.reportList[m].data;
  5522. var find = d.filter(r=>r.id == reportId);
  5523. if (find.length > 0) {
  5524. find[0].state = res.data.state;
  5525. if (find[0].state == 2) {//被驳回,要可以编辑
  5526. this.reportList[m].state = 2;
  5527. }
  5528. find[0].isDeptAudit = res.data.isDeptAudit;
  5529. find[0].departmentAuditState = res.data.departmentAuditState;
  5530. find[0].projectAuditorName = res.data.projectAuditorName;
  5531. find[0].projectAuditorId = res.data.projectAuditorId;
  5532. find[0].projectAuditState = res.data.projectAuditState;
  5533. find[0].rejectUserid = res.data.rejectUserid;
  5534. find[0].rejectUsername = res.data.rejectUsername;
  5535. find[0].rejectReason = res.data.rejectReason;
  5536. this.$forceUpdate();
  5537. break;
  5538. }
  5539. }
  5540. } else {
  5541. this.$message({
  5542. message: res.msg,
  5543. type: "error"
  5544. });
  5545. }
  5546. },
  5547. error => {
  5548. this.listLoading = false;
  5549. this.$message({
  5550. message: error,
  5551. type: "error"
  5552. });
  5553. });
  5554. },
  5555. //导出员工工时统计
  5556. exportUserTime() {
  5557. this.listLoading = true;
  5558. var param = {};
  5559. if (this.exportParam.dateRange != null) {
  5560. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5561. }
  5562. this.http.post('/department/exportDeptStatistic', param,
  5563. res => {
  5564. this.listLoading = false;
  5565. if (res.code == "ok") {
  5566. location.href = res.data;
  5567. this.exportTimeDialog = false;
  5568. } else {
  5569. this.$message({
  5570. message: res.msg,
  5571. type: "error"
  5572. });
  5573. }
  5574. },
  5575. error => {
  5576. this.listLoading = false;
  5577. this.$message({
  5578. message: error,
  5579. type: "error"
  5580. });
  5581. });
  5582. },
  5583. //导出日报
  5584. exportReport() {
  5585. this.exportingData = true;
  5586. var param = {};
  5587. if (this.exportParam.dateRange != null) {
  5588. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5589. }
  5590. if (this.exportParam.projectId != null) {
  5591. param.projectId = this.exportParam.projectId;
  5592. }
  5593. if (this.exportParam.departmentId != null) {
  5594. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5595. param.departmentIds = this.exportParam.departmentId.join(',')
  5596. }
  5597. param.stateKey = this.stateKey
  5598. // param.departmentId = this.user.departmentId
  5599. console.log(param, '《=== 导出传的参数');
  5600. console.log('开始调用exportReport接口');
  5601. this.http.post(this.port.report.export, param,
  5602. res => {
  5603. this.exportingData = false;
  5604. if (res.code == "ok") {
  5605. var filePath = res.data;
  5606. const a = document.createElement('a'); // 创建a标签
  5607. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5608. a.setAttribute('href', filePath);// href链接
  5609. a.click(); //自执行点击事件
  5610. a.remove();
  5611. this.exportDialog = false;
  5612. } else {
  5613. this.$message({
  5614. message: res.msg,
  5615. type: "error"
  5616. });
  5617. }
  5618. },
  5619. error => {
  5620. this.exportingData = false;
  5621. this.$message({
  5622. message: error,
  5623. type: "error"
  5624. });
  5625. });
  5626. },
  5627. //导出日报审核记录
  5628. exportReportLog() {
  5629. this.exportingData = true;
  5630. var param = {};
  5631. if (this.exportReportLogParam.dateRange != null) {
  5632. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5633. }
  5634. this.http.post('/report-log/exportReportLog', param,
  5635. res => {
  5636. this.exportingData = false;
  5637. if (res.code == "ok") {
  5638. var filePath = res.data;
  5639. const a = document.createElement('a'); // 创建a标签
  5640. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5641. a.setAttribute('href', filePath);// href链接
  5642. a.click(); //自执行点击事件
  5643. a.remove();
  5644. this.exportDialog = false;
  5645. } else {
  5646. this.$message({
  5647. message: res.msg,
  5648. type: "error"
  5649. });
  5650. }
  5651. },
  5652. error => {
  5653. this.exportingData = false;
  5654. this.$message({
  5655. message: error,
  5656. type: "error"
  5657. });
  5658. });
  5659. },
  5660. importReportLog(item){
  5661. //首先判断文件类型
  5662. let str = item.file.name.split(".");
  5663. let format = str[str.length - 1];
  5664. if (format != "xls" && format != "xlsx") {
  5665. this.$message({
  5666. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5667. type: "error"
  5668. });
  5669. } else {
  5670. let formData = new FormData();
  5671. formData.append("multipartFile", item.file);
  5672. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5673. res => {
  5674. this.$refs.upload.clearFiles();
  5675. if (res.code == "ok") {
  5676. this.$message({
  5677. message: res.msg,
  5678. type: "success"
  5679. });
  5680. } else {
  5681. this.$message({
  5682. message: res.msg,
  5683. type: "error"
  5684. });
  5685. }
  5686. },
  5687. error => {
  5688. this.$refs.upload.clearFiles();
  5689. this.$message({
  5690. message: error,
  5691. type: "error"
  5692. });
  5693. });
  5694. }
  5695. },
  5696. //获取项目列表
  5697. getProjectList() {
  5698. this.listLoading = true;
  5699. this.http.post( this.port.project.list, {},
  5700. res => {
  5701. this.listLoading = false;
  5702. if (res.code == "ok") {
  5703. for(var i in res.data) {
  5704. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5705. res.data[i].projectCode = ''
  5706. }
  5707. }
  5708. this.projectList = res.data;
  5709. console.log("项目列表",this.projectList);
  5710. } else {
  5711. this.$message({
  5712. message: res.msg,
  5713. type: "error"
  5714. });
  5715. }
  5716. },
  5717. error => {
  5718. this.listLoading = false;
  5719. this.$message({
  5720. message: error,
  5721. type: "error"
  5722. });
  5723. });
  5724. },
  5725. // 获取填报日报的项目下拉列表
  5726. getFillProjectList() {
  5727. this.http.post( this.port.project.list, {
  5728. forReport: 1
  5729. },res => {
  5730. if (res.code == "ok") {
  5731. for(var i in res.data) {
  5732. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5733. res.data[i].projectCode = ''
  5734. }
  5735. }
  5736. this.fillProjectList = res.data;
  5737. this.getRecentlyProject()
  5738. } else {
  5739. this.$message({
  5740. message: res.msg,
  5741. type: "error"
  5742. });
  5743. }
  5744. },
  5745. error => {
  5746. this.$message({
  5747. message: error,
  5748. type: "error"
  5749. });
  5750. });
  5751. },
  5752. getBasecostItemList() {
  5753. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5754. companyId: this.user.companyId
  5755. },
  5756. res => {
  5757. if (res.code == "ok") {
  5758. this.timeBasecostList = res.data;
  5759. }
  5760. });
  5761. },
  5762. getAIReport(createDate) {
  5763. this.http.post('/report/getAIReport', {},
  5764. res => {
  5765. if (res.code == "ok") {
  5766. var quanbu = 0
  5767. this.jsDay = 1
  5768. var zhi = ''
  5769. var slp = res.data
  5770. for(var i in slp) {
  5771. var sp = +slp[i].workingTime + 0
  5772. zhi = this.jsDay * sp
  5773. quanbu = +quanbu + zhi
  5774. }
  5775. this.jsTime = quanbu
  5776. var aiReportData = res.data;
  5777. this.canCancelInDialog = false
  5778. if(aiReportData.length != 0) {
  5779. var arr = [];
  5780. for(var i in aiReportData) {
  5781. arr.push({
  5782. id: null,
  5783. projectId: aiReportData[i].projectId,
  5784. workingTime: aiReportData[i].workingTime,
  5785. content: '',
  5786. progress:100,
  5787. state: 2,
  5788. timeType: aiReportData[i].timeType,
  5789. subProjectList: aiReportData[i].subProjectList,
  5790. taskList: aiReportData[i].taskList,
  5791. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5792. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5793. taskId: aiReportData[i].taskId,
  5794. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5795. startTime: aiReportData[i].startTime,
  5796. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5797. endTime: aiReportData[i].endTime,
  5798. isOvertime: 0,
  5799. progress:aiReportData[i].progress,
  5800. professionProgress: aiReportData[i].professionProgressList,
  5801. stages:aiReportData[i].stages,
  5802. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5803. pics: null,
  5804. multiWorktime: aiReportData[i].multiWorktime,
  5805. worktimeList: [{}],
  5806. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5807. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5808. wuduList: aiReportData[i].degreeList,
  5809. taskGroups:aiReportData[i].taskGroups,
  5810. customData: aiReportData[i].customData,//自定义的数值
  5811. auditUserList: aiReportData[i].auditUserList,
  5812. projectAuditorId: aiReportData[i].projectAuditorId,
  5813. projectAuditorName: aiReportData[i].projectAuditorName,
  5814. overtimeHours: aiReportData[i].overtimeHours,
  5815. customText: aiReportData[i].customText,
  5816. basecostId: aiReportData[i].basecostId,
  5817. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5818. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5819. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5820. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5821. canEdit: true
  5822. })
  5823. }
  5824. this.workForm.domains = arr;
  5825. } else {
  5826. }
  5827. this.canEdit = true;
  5828. this.originCanEdit = true;
  5829. this.seleChn()
  5830. } else {
  5831. this.$message({
  5832. message: res.msg,
  5833. type: "error"
  5834. });
  5835. }
  5836. },
  5837. error => {
  5838. this.$message({
  5839. message: error,
  5840. type: "error"
  5841. });
  5842. });
  5843. },
  5844. // 获取个人某天的日报 111111
  5845. getReport() {
  5846. this.http.post( this.port.report.getPort, {
  5847. date: this.workForm.createDate
  5848. },
  5849. res => {
  5850. if (res.code == "ok") {
  5851. var quanbu = 0
  5852. this.jsDay = 1
  5853. var zhi = ''
  5854. var slp = res.data.report
  5855. for(var i in slp) {
  5856. var sp = +slp[i].workingTime + 0
  5857. zhi = this.jsDay * sp
  5858. quanbu = +quanbu + zhi
  5859. }
  5860. this.jsTime = quanbu
  5861. var list = res.data;
  5862. this.report = list;
  5863. this.reportTimeType = this.report.timeType;
  5864. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5865. this.isWeekend = !this.report.isWorkDay;
  5866. this.canCancelInDialog = false;
  5867. this.hasWrittenReport = list.report.length != 0;
  5868. if(list.report.length != 0) {
  5869. var arr = [];
  5870. this.canEdit = false;
  5871. let candelete = true
  5872. for(var i in list.report) {
  5873. var flg = null
  5874. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5875. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5876. var filteredRespList = null
  5877. if (targetP.length > 0) {
  5878. var isPublic = targetP[0].isPublic;
  5879. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5880. }
  5881. arr.push({
  5882. id: list.report[i].id,
  5883. projectId: list.report[i].projectId,
  5884. workingTime: list.report[i].workingTime,
  5885. content: list.report[i].content,
  5886. state: list.report[i].state,
  5887. timeType: list.report[i].timeType,
  5888. subProjectList: list.report[i].subProjectList,
  5889. taskList: list.report[i].taskList,
  5890. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5891. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5892. taskId: list.report[i].taskId,
  5893. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5894. startTime: list.report[i].startTime,
  5895. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5896. endTime: list.report[i].endTime,
  5897. isOvertime: flg,
  5898. progress:list.report[i].progress,
  5899. professionProgress: list.report[i].professionProgressList,
  5900. stages:list.report[i].stages,
  5901. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5902. pics: list.report[i].pics,
  5903. multiWorktime: list.report[i].multiWorktime,
  5904. worktimeList: list.report[i].worktimeList,
  5905. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5906. multiDegrIdArray: list.report[i].multiDegrIdList,
  5907. wuduList: list.report[i].degreeList,
  5908. taskGroups:list.report[i].taskGroups,
  5909. customData: list.report[i].customData,//自定义的数值
  5910. auditUserList: list.report[i].auditUserList,
  5911. projectAuditorId: list.report[i].projectAuditorId,
  5912. projectAuditorName: list.report[i].projectAuditorName,
  5913. overtimeHours: list.report[i].overtimeHours,
  5914. customText: list.report[i].customText,
  5915. basecostId: list.report[i].basecostId,
  5916. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5917. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5918. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5919. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5920. canEdit: list.report[i].state >= 2 ? true : false,
  5921. extraField1: list.report[i].extraField1,
  5922. extraField2: list.report[i].extraField2,
  5923. extraField3: list.report[i].extraField3,
  5924. workContentList: list.report[i].workContentList,
  5925. filteredRespList: filteredRespList,
  5926. serviceList: list.report[i].serviceList,
  5927. sapServiceId: list.report[i].sapServiceId,
  5928. reportTargetDeptId: list.report[i].deptId
  5929. })
  5930. if (list.report[i].state >= 2) {
  5931. this.canEdit = true;
  5932. }
  5933. if(list.report[i].state < 2){
  5934. candelete = false
  5935. }
  5936. if (list.report[i].state == 0){
  5937. this.canCancelInDialog = true
  5938. }
  5939. // 加判断
  5940. if(this.user.timeType.choseFromAlbum == 1) {
  5941. let arrList = []
  5942. for(var k in list.report[i].pics) {
  5943. let obj = {
  5944. name: k,
  5945. url: list.report[i].pics[k]
  5946. }
  5947. arrList.push(obj)
  5948. }
  5949. arr[i].imgListUrl = arrList
  5950. arr[i].imgList = list.report[i].pics
  5951. }
  5952. }
  5953. this.reportCanDelete = candelete
  5954. this.workForm = {
  5955. createDate: this.workForm.createDate,
  5956. domains: arr,
  5957. userNames:null,
  5958. userId:null,
  5959. time: list.time,
  5960. showRefresh: list.showRefresh
  5961. }
  5962. console.log('workForm', this.workForm)
  5963. } else {
  5964. this.workForm = {
  5965. createDate: this.workForm.createDate,
  5966. domains: [{
  5967. id: null,
  5968. projectId: "",
  5969. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5970. content: "",
  5971. progress:100,
  5972. state: 2,
  5973. timeType:0,
  5974. multiWorktime: this.reportTimeType.multiWorktime,
  5975. worktimeList:[{}],
  5976. canEdit: true,
  5977. auditorFirst: '',
  5978. auditorSec: '',
  5979. auditorThird: '',
  5980. ccUserid: ''
  5981. }],
  5982. userId:null,
  5983. userNames:null,
  5984. time: this.report.time,
  5985. showRefresh: list.showRefresh
  5986. }
  5987. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5988. this.$set(this.workForm.domains[0],'isOvertime',true)
  5989. if(this.reportTimeType.type != 2){
  5990. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5991. }
  5992. }
  5993. if(this.user.timeType.type == 1) {
  5994. var shuzhi = this.user.timeType.allday + ''
  5995. // console.log('执行一次', shuzhi.indexOf('.'))
  5996. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5997. }
  5998. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5999. //默认给第一个,必填字段
  6000. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6001. }
  6002. this.canEdit = true;
  6003. }
  6004. this.originCanEdit = this.canEdit;
  6005. this.seleChn()
  6006. } else {
  6007. this.$message({
  6008. message: res.msg,
  6009. type: "error"
  6010. });
  6011. }
  6012. },
  6013. error => {
  6014. this.$message({
  6015. message: error,
  6016. type: "error"
  6017. });
  6018. });
  6019. },
  6020. guanbi() {
  6021. this.falsss = false,
  6022. this.workTimeForMinYi=0
  6023. },
  6024. // 打开日报填写
  6025. fillInReport(i, isBatch) {
  6026. this.isWeekend = false
  6027. this.reportCanDelete = false
  6028. // console.log(this.user.timeType.type, '选择时长')
  6029. if(i != 1) {
  6030. this.falsss = false
  6031. } else {
  6032. this.falsss = true
  6033. }
  6034. if (this.isSubstitude) {
  6035. this.getSubstitudeUserDeptList();
  6036. }
  6037. if(i == -1 || this.isSubstitude) {
  6038. this.isDisable = false;
  6039. } else {
  6040. this.isDisable = true;
  6041. }
  6042. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6043. this.isBatch = isBatch;
  6044. if (this.isBatch == 0 && !this.isSubstitude) {
  6045. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6046. let weekday = new Date(this.workForm.createDate).getDay()
  6047. if(this.user.companyId == 817){
  6048. if(weekday == 0){
  6049. this.isWeekend = true
  6050. }
  6051. }else{
  6052. if(weekday == 0 || weekday == 6){
  6053. this.isWeekend = true
  6054. }
  6055. }
  6056. this.getReport(i);
  6057. } else {
  6058. // console.log('执行到了这里')
  6059. this.jsTime = 0
  6060. this.jsDay = 0
  6061. this.workForm = {
  6062. createDate: null,//批量填报没有日期
  6063. domains: [{
  6064. id: null,
  6065. projectId: "",
  6066. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6067. content: "",
  6068. progress:100,
  6069. state: 2,
  6070. timeType:0,
  6071. multiWorktime: this.reportTimeType.multiWorktime,
  6072. worktimeList:[{}],
  6073. canEdit: true,
  6074. }],
  6075. }
  6076. if(this.user.timeType.type == 1) {
  6077. var shuzhi = this.user.timeType.allday + ''
  6078. // console.log('执行二次')
  6079. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6080. }
  6081. // console.log(this.workForm)
  6082. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6083. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6084. }
  6085. this.canEdit = true;
  6086. }
  6087. this.dialogVisible = true;
  6088. },
  6089. //按周填报的弹窗口中编辑单项目相关数据
  6090. setWeekFormReportItem(reportId, i, names, row,sss) {
  6091. console.log(sss)
  6092. this.http.post('/report/getReportById', {
  6093. reportId: reportId
  6094. },
  6095. res => {
  6096. if (res.code == "ok") {
  6097. var data = res.data.report;
  6098. sss.subProjectId = data.subProjectId
  6099. sss.subProjectList = data.subProjectList;
  6100. sss.stage = data.stage
  6101. sss.subProjectList = data.subProjectList
  6102. sss.stages = data.stages
  6103. sss.taskGroups = data.taskGroups;
  6104. sss.auditUserList = data.auditUserList;
  6105. sss.degreeId = data.degreeId;
  6106. sss.customData = data.customData;
  6107. sss.wuduList = data.degreeList;
  6108. this.zhoBaoIdx = i
  6109. this.zhoBaoName = names
  6110. this.zhoBao = sss
  6111. this.zhis = row
  6112. if (sss.groupId) {
  6113. //最后一个参数表示是否保留stage的值,不要重置为空
  6114. this.getGroupStages(this.zhoBao, 0, true)
  6115. }
  6116. this.$forceUpdate();
  6117. }
  6118. });
  6119. },
  6120. // 按周填报里内容的填写
  6121. showWeekItemEdit(item, i, projectId,names, row) {
  6122. if (item.state == 0) {
  6123. this.$message({
  6124. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  6125. type: "error"
  6126. });
  6127. return;
  6128. }
  6129. if (item.state == 1) {
  6130. this.$message({
  6131. message: '已通过状态不可修改',
  6132. type: "error"
  6133. });
  6134. return;
  6135. }
  6136. if(this.user.timeType.notAllowedNoAttendance == 1){
  6137. if(this.zhoData[i].corpTime){
  6138. if(this.zhoData[i].corpTime.workHours == 0){
  6139. this.$message({
  6140. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6141. type: 'error'
  6142. })
  6143. return
  6144. }
  6145. }else{
  6146. this.$message({
  6147. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6148. type: 'error'
  6149. })
  6150. return
  6151. }
  6152. }
  6153. var obj = {}
  6154. obj.projectId = projectId
  6155. this.tianxieDialogVisible = true
  6156. this.scopess = item
  6157. var sss = {}
  6158. if (item.id != null) {
  6159. sss.id = item.id;
  6160. sss.state = item.state;
  6161. } else {
  6162. sss.id = -1;
  6163. sss.state = 3;
  6164. }
  6165. sss.projectId = projectId;
  6166. sss.progress = item.progress
  6167. sss.time = item.time
  6168. sss.content = item.content;
  6169. console.log('333', sss.content)
  6170. if (sss.time == '' && this.reportTimeType.type == 2) {
  6171. //取已填时间范围中最大的一个作为开始时间
  6172. var startTime = '09:00';
  6173. var fillStartTime = '00:00';
  6174. for (var t in this.selProjectList) {
  6175. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6176. if (fillItem.time) {
  6177. if (fillItem.time[1] > fillStartTime) {
  6178. fillStartTime = fillItem.time[1];
  6179. }
  6180. }
  6181. }
  6182. if (fillStartTime == '00:00') {
  6183. fillStartTime = '09:00';
  6184. }
  6185. var fillEndMax = '18:00';
  6186. if (fillStartTime >= '18:00') {
  6187. fillEndMax = '23:59';
  6188. }
  6189. sss.time = [fillStartTime, fillEndMax];
  6190. }
  6191. sss.groupId = item.groupId
  6192. sss.stage = item.stage;
  6193. sss.workingTime = item.workingTime
  6194. sss.projectAuditorId = item.projectAuditorId;
  6195. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6196. //默认选中第一个
  6197. sss.basecostId = this.timeBasecostList[0].id;
  6198. }
  6199. var hasEdited = this.zhoData[i][names].hasEdited;
  6200. if (hasEdited) {
  6201. sss = { ...item }
  6202. //编辑过了
  6203. sss.subProjectId = item.subProjectId
  6204. sss.stage = item.stage
  6205. sss.subProjectList = item.subProjectList
  6206. sss.stages = item.stages
  6207. sss.taskGroups = item.taskGroups;
  6208. console.log(sss.taskGroups, '33333');
  6209. sss.auditUserList = obj.auditUserList;
  6210. sss.degreeId = item.degreeId;
  6211. sss.customData = item.customData;
  6212. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6213. //只有一个审核人,自动设置上去
  6214. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6215. }
  6216. sss.wuduList = item.wuduList;
  6217. this.zhoBaoIdx = i
  6218. this.zhoBaoName = names
  6219. this.zhoBao = sss
  6220. this.zhis = row
  6221. if (sss.groupId) {
  6222. //最后一个参数表示是否保留stage的值,不要重置为空
  6223. this.getGroupStages(this.zhoBao, 0, true)
  6224. }
  6225. this.$forceUpdate();
  6226. this.getWeeklyTaskList(sss)
  6227. console.log('最后的周报 ===>', this.zhoBao)
  6228. } else {
  6229. //第一次打开,获取数据
  6230. if (sss.id == -1) {
  6231. //新填报的
  6232. this.selectProject(obj, 0);
  6233. var that = this
  6234. setTimeout(() =>{
  6235. sss.subProjectId = that.workForm.domains[0].subProjectId
  6236. sss.subProjectList = item.subProjectList;
  6237. sss.stage = that.workForm.domains[0].stage
  6238. sss.subProjectList = that.workForm.domains[0].subProjectList
  6239. sss.stages = that.workForm.domains[0].stages
  6240. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6241. sss.auditUserList = obj.auditUserList;
  6242. sss.degreeId = item.degreeId;
  6243. sss.customData = item.customData;
  6244. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6245. //只有一个审核人,自动设置上去
  6246. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6247. }
  6248. sss.wuduList = row[0].wuduList
  6249. that.zhoBaoIdx = i
  6250. that.zhoBaoName = names
  6251. that.zhoBao = sss
  6252. that.zhis = row
  6253. if (sss.groupId) {
  6254. //最后一个参数表示是否保留stage的值,不要重置为空
  6255. this.getGroupStages(that.zhoBao, 0, false)
  6256. }
  6257. that.$forceUpdate();
  6258. this.getWeeklyTaskList(sss)
  6259. },600);
  6260. } else {
  6261. //编辑填报过的;数据库已经存在的
  6262. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6263. }
  6264. }
  6265. },
  6266. // 按周填报里内容的填写点击确定
  6267. setWeekProItemData() {
  6268. //专业版模式下,任务分组和阶段必填
  6269. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6270. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6271. this.$message({
  6272. message: '任务分组和阶段必填,请检查',
  6273. type: "error"
  6274. });
  6275. return;
  6276. }
  6277. }
  6278. // 检查任务分组
  6279. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6280. this.$message({
  6281. message: '任务分组必填,请检查',
  6282. type: "error"
  6283. });
  6284. return
  6285. }
  6286. //检查子项目是否必填
  6287. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6288. this.$message({
  6289. message: '子项目必填,请检查',
  6290. type: "error"
  6291. });
  6292. return;
  6293. }
  6294. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6295. this.$message({
  6296. message: this.$t('message.Pleaseselectareviewer'),
  6297. type: "error"
  6298. });
  6299. return
  6300. }
  6301. if(this.user.timeType.reportAuditType == 3){
  6302. let auditTips = ''
  6303. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6304. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6305. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6306. if(auditTips){
  6307. auditTips = auditTips.substring(0,auditTips.length - 1)
  6308. this.$message({
  6309. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6310. type: 'error'
  6311. })
  6312. return
  6313. }
  6314. }
  6315. let errtips = ''
  6316. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6317. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6318. errtips += this.user.timeType.customDegreeName + '、'
  6319. }
  6320. }
  6321. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6322. errtips += this.user.timeType.customDataName + '、'
  6323. }
  6324. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6325. errtips += this.user.timeType.customTextName + '、'
  6326. }
  6327. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6328. errtips += this.$t('other.workMatters') +'、'
  6329. }
  6330. if(errtips){
  6331. errtips = errtips.substring(0,errtips.length - 1)
  6332. this.$message({
  6333. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6334. type: 'error'
  6335. })
  6336. return
  6337. }
  6338. this.tianxieDialogVisible = false
  6339. var zhong = this.zhoData
  6340. this.zhoBao.hasEdited = true;
  6341. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6342. this.zhoData = zhong
  6343. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6344. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6345. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6346. },
  6347. // 获取本周
  6348. getCurrentWeek() {
  6349. //今天
  6350. this.targetWeekDate = new Date();
  6351. this.initWeekFormData();
  6352. // this.jiazai()
  6353. },
  6354. // 获取上周
  6355. handleGetPrevWeek() {
  6356. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6357. this.initWeekFormData();
  6358. // this.jiazai()
  6359. },
  6360. // 获取下周
  6361. handleGetNextvWeek() {
  6362. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6363. this.initWeekFormData()
  6364. },
  6365. // 加载动画
  6366. jiazai() {
  6367. this.weekDataLoading = true
  6368. var that = this
  6369. setTimeout(() =>{
  6370. that.weekDataLoading = false
  6371. },1000);
  6372. },
  6373. // 转时间格式
  6374. dealdate(date) {
  6375. const dt = new Date(date)
  6376. const y = dt.getFullYear()
  6377. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6378. const d = (dt.getDate() + '').padStart(2, '0')
  6379. return `${y}-${m}-${d}`
  6380. },
  6381. // 按周填报
  6382. fillInReportss() {
  6383. window.addEventListener('scroll', this.handleScroll, true)
  6384. // this.jiazai()
  6385. this.fillWeekDialogVisi = true;
  6386. if (this.isSubstitude) {
  6387. this.substitudeStep = 1;
  6388. this.getSubstitudeUserDeptList();
  6389. } else {
  6390. this.getCurrentWeek();
  6391. }
  6392. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6393. //重新获取工时预警类型的预算项
  6394. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6395. companyId: this.user.companyId
  6396. },
  6397. res => {
  6398. if (res.code == "ok") {
  6399. this.timeBasecostList = res.data;
  6400. }
  6401. });
  6402. }
  6403. },
  6404. fillInReportCustom() {
  6405. this.weekIndex++
  6406. this.weekParentData = {
  6407. isSubstitude: this.isSubstitude
  6408. }
  6409. this.fillWeekDialogVisiCustom = true
  6410. },
  6411. // 按周填报的项目筛选
  6412. selListFun(){
  6413. this.selProjectList = []
  6414. if(this.selCon.length){
  6415. for (let i = 0; i < this.selCon.length; i++) {
  6416. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6417. }
  6418. this.selConShow = false ;
  6419. for (let i in this.zhoData) {
  6420. var obj = this.zhoData[i];
  6421. for(var j in this.selProjectList) {
  6422. var xinzhi = this.selProjectList[j].projectName
  6423. obj[xinzhi] = {}
  6424. obj[xinzhi].time = ''
  6425. obj[xinzhi].content = ''
  6426. obj[xinzhi].progress = 0
  6427. obj[xinzhi].workingTime = 0
  6428. }
  6429. }
  6430. this.initWeekFormData();
  6431. }else{
  6432. this.$message({
  6433. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6434. type:'error'
  6435. })
  6436. }
  6437. },
  6438. setWeekCardTimeData(list) {
  6439. for(let i in list){
  6440. let datei = '';
  6441. if (this.user.timeType.showDdCardtime == 1) {
  6442. datei = list[i].workDate;
  6443. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6444. datei = list[i].createDate;
  6445. } else if (this.user.timeType.syncFanwei == 1) {
  6446. datei = list[i].workDate;
  6447. }
  6448. for(let m in this.zhoData) {
  6449. if(datei == this.zhoData[m].zhoDataTime){
  6450. let item = {
  6451. startTime: list[i].startTime,
  6452. endTime: list[i].endTime,
  6453. workHours: list[i].workHours
  6454. }
  6455. this.$set(this.zhoData[m],'corpTime',item)
  6456. }
  6457. }
  6458. }
  6459. },
  6460. getWeeklyCardTime(){ //按周填报获取考勤信息
  6461. let dateStr = []
  6462. for(let i in this.zhoData){
  6463. dateStr.push(this.zhoData[i].zhoDataTime)
  6464. }
  6465. this.http.post('/report/getWeeklyCardTime',{
  6466. dateStr: JSON.stringify(dateStr)
  6467. },res => {
  6468. if(res.code == 'ok'){
  6469. for(let i in res.data){
  6470. let datei = '';
  6471. if (this.user.timeType.showDdCardtime == 1) {
  6472. datei = res.data[i].workDate.split('-');
  6473. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6474. datei = res.data[i].createDate.split('-');
  6475. }
  6476. for(let m in this.zhoData){
  6477. let datem = new Date(this.zhoData[m].zhoDataTime)
  6478. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6479. let item = {
  6480. startTime: res.data[i].startTime,
  6481. endTime: res.data[i].endTime,
  6482. workHours: res.data[i].workHours
  6483. }
  6484. this.$set(this.zhoData[m],'corpTime',item)
  6485. }
  6486. }
  6487. }
  6488. }else{
  6489. this.$message({
  6490. message: res.msg,
  6491. type: 'error'
  6492. })
  6493. }
  6494. },err => {
  6495. this.$message({
  6496. message: err,
  6497. type: 'error'
  6498. })
  6499. })
  6500. },
  6501. selListqx(){
  6502. this.fillWeekDialogVisi = false
  6503. this.selProjectList = []
  6504. this.selCon = []
  6505. },
  6506. handleScroll() {
  6507. this.changdu = this.projectList.length + 1
  6508. },
  6509. // 自动选择时间点的事件
  6510. // async zhoTimes(item, i) {
  6511. // var iss = i
  6512. // if(item.time == null) {
  6513. // return
  6514. // } else {
  6515. // const zhi = this.zhoData[iss];
  6516. // let he = 0;
  6517. // const timeArr = Object.values(zhi)
  6518. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6519. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6520. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6521. // console.log(data, 'data');
  6522. // zhi.he = `${he}h`;
  6523. // }
  6524. // },
  6525. async zhoTimes(item, index) {
  6526. const zho = this.zhoData[index];
  6527. if (!item.time) {
  6528. return;
  6529. }
  6530. const timeArr = Object.values(zho)
  6531. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6532. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6533. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6534. zho.he = `${totalHours[0]}h`;
  6535. },
  6536. // 判断两个时间段是否重叠
  6537. timeOverlap(idx, dateAr) {
  6538. let zhi = 0
  6539. for (let k in dateAr) {
  6540. if (idx !== k) {
  6541. 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))) {
  6542. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6543. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6544. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6545. }
  6546. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6547. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6548. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6549. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6550. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6551. } else {
  6552. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6553. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6554. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6555. }
  6556. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6557. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6558. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6559. }
  6560. }
  6561. }
  6562. }
  6563. }
  6564. return zhi
  6565. },
  6566. // 计算时间
  6567. getHourMinutes(str, end) {
  6568. var he = 0
  6569. var date2 = '2021/12/12 ' + end +':00'
  6570. var date1 = '2021/12/12 ' + str +':00'
  6571. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6572. var leave1=date3%(24*3600*1000)
  6573. var hours=Math.floor(leave1/(3600*1000))
  6574. var leave2=leave1%(3600*1000)
  6575. var minutes=Math.floor(leave2/(60*1000))
  6576. var shi = hours+'.'+ minutes
  6577. return he += +shi
  6578. },
  6579. // 自动选择事件长度的事件
  6580. zhoXuan(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 + 'h'
  6593. }
  6594. },
  6595. getPushWorkLogData(){
  6596. this.http.post('/sap-sync-log/list', {},
  6597. res => {
  6598. if (res.code == "ok") {
  6599. this.pushWorkTimeLogData = res.data;
  6600. } else {
  6601. this.$message({
  6602. message: res.msg,
  6603. type: "error"
  6604. });
  6605. }
  6606. },
  6607. error => {
  6608. this.$message({
  6609. message: error,
  6610. type: "error"
  6611. });
  6612. });
  6613. },
  6614. // 获取全部人员
  6615. getUsers() {
  6616. this.http.post('/user/getSimpleActiveUserList', {},
  6617. res => {
  6618. if (res.code == "ok") {
  6619. this.usersList = res.data;
  6620. } else {
  6621. this.$message({
  6622. message: res.msg,
  6623. type: "error"
  6624. });
  6625. }
  6626. },
  6627. error => {
  6628. this.$message({
  6629. message: error,
  6630. type: "error"
  6631. });
  6632. });
  6633. },
  6634. // 按时间比例
  6635. addBli(item, i) {
  6636. var iss = i
  6637. if(item.time == null) {
  6638. return
  6639. } else {
  6640. var zhi = this.zhoData[iss]
  6641. var he = 0
  6642. for(var i in zhi) {
  6643. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6644. he += +zhi[i].workingTime
  6645. }
  6646. }
  6647. zhi.he = he.toFixed(1) + 'h'
  6648. }
  6649. },
  6650. //按周填报选择的项目发生变化,需要设置列
  6651. onSelProjectChange() {
  6652. for (let i = 0; i < this.selCon.length; i++) {
  6653. var exists = false;
  6654. for (let j = 0; j < this.selProjectList.length; j++) {
  6655. if (this.selProjectList[j].id == this.selCon[i]) {
  6656. exists = true;
  6657. break;
  6658. }
  6659. }
  6660. if (!exists) {
  6661. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6662. this.selProjectList.push(newProject);
  6663. //添加新项目
  6664. for (var w in this.zhoData) {
  6665. var dayItem = this.zhoData[w];
  6666. var pName = newProject.projectName;
  6667. dayItem[pName] = {};
  6668. dayItem[pName].time = ''
  6669. dayItem[pName].content = ''
  6670. dayItem[pName].progress = 0
  6671. dayItem[pName].workingTime = 0
  6672. }
  6673. }
  6674. }
  6675. //去掉
  6676. for (let j = 0; j < this.selProjectList.length; j++) {
  6677. var exists = false;
  6678. for (let i = 0; i < this.selCon.length; i++) {
  6679. if (this.selProjectList[j].id == this.selCon[i]) {
  6680. exists = true;
  6681. break;
  6682. }
  6683. }
  6684. if (!exists) {
  6685. this.selProjectList.splice(j, 1);
  6686. j--;
  6687. }
  6688. }
  6689. this.loadFilledWeekReportItem();
  6690. //刷新表格
  6691. // this.$refs.weekTable.doLayout();
  6692. },
  6693. //根据选中的项目来刷新填写表格
  6694. loadFilledWeekReportItem() {
  6695. for (var w in this.zhoData) {
  6696. var dayItem = this.zhoData[w];
  6697. for (var i = 0; i < this.selProjectList.length; i++) {
  6698. var curColumnProject = this.selProjectList[i];
  6699. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6700. for (var t in dayItem.reportList) {
  6701. //有日报的项目,不能取消选择
  6702. for (var p in this.fillProjectList) {
  6703. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6704. }
  6705. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6706. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6707. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6708. if (this.reportTimeType.type == 2) {
  6709. //时间段模式
  6710. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6711. }
  6712. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6713. break;
  6714. }
  6715. }
  6716. // dayItem[curColumnProject.projectName] = matchReportItem;
  6717. }
  6718. }
  6719. this.$nextTick(()=>{
  6720. this.$refs.weekTable.doLayout();
  6721. });
  6722. },
  6723. initWeekFormData() {
  6724. this.weekDataLoading = true;
  6725. for (var p in this.fillProjectList) {
  6726. this.fillProjectList[p].canCancel = 1;
  6727. }
  6728. var param = {
  6729. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6730. };
  6731. if (this.isSubstitude) {
  6732. //传代填人的userId
  6733. param.targetUserId = this.workForm.userId[0];
  6734. }
  6735. this.http.post('/report/getWeeklyReportData',param,res => {
  6736. this.weekDataLoading = false;
  6737. if(res.code == 'ok'){
  6738. let projectList = res.data.projectList;
  6739. if (projectList.length > 0) {
  6740. //有选择过项目进行填报,直接选中
  6741. this.selProjectList = projectList;
  6742. this.selCon = [];
  6743. for (let i = 0; i < projectList.length; i++) {
  6744. this.selCon.push(projectList[i].id);
  6745. }
  6746. }
  6747. //设置日期
  6748. this.weekDateRange = res.data.dateList;
  6749. this.zhoData = [];
  6750. var arrst = []
  6751. for(var i in this.weekDateRange) {
  6752. var obj = {}
  6753. obj.zhoDataTime = this.weekDateRange[i].date
  6754. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6755. obj.he = this.weekDateRange[i].filledTime;
  6756. obj.canFill = this.weekDateRange[i].canFill;
  6757. // obj.filledTime = this.weekDateRange[i].filledTime;
  6758. obj.reportList = this.weekDateRange[i].reportList;
  6759. //初始化,防止渲染报错
  6760. for (var j = 0; j < this.selProjectList.length; j++) {
  6761. var pName = this.selProjectList[j].projectName
  6762. obj[pName] = {}
  6763. obj[pName].time = ''
  6764. obj[pName].content = ''
  6765. obj[pName].progress = 0
  6766. obj[pName].workingTime = 0
  6767. }
  6768. arrst.push(obj)
  6769. }
  6770. this.zhoData = arrst
  6771. this.setWeekCardTimeData(res.data.cardTimeList);
  6772. this.loadFilledWeekReportItem();
  6773. }else{
  6774. this.$message({
  6775. message: res.msg,
  6776. type: 'error'
  6777. })
  6778. }
  6779. },err => {
  6780. this.$message({
  6781. message: err,
  6782. type: 'error'
  6783. })
  6784. })
  6785. },
  6786. zhoZhi(res, i) {
  6787. var zhi = 0
  6788. for(var i in res) {
  6789. if(i != 'zhoDataTime' && i != 'he') {
  6790. zhi += +res[i]
  6791. }
  6792. }
  6793. res.he = zhi
  6794. },
  6795. zhoBtn(i) {
  6796. // this.zhoData.split(i, 1)
  6797. var arr = this.zhoData
  6798. arr.splice(i, 1)
  6799. },
  6800. zhoAddlast(){
  6801. this.selConShow = true
  6802. },
  6803. closeAddWeeklyReport(){
  6804. this.fillWeekDialogVisi = false
  6805. this.selConShow = true
  6806. this.selProjectList = []
  6807. this.selCon = []
  6808. },
  6809. checkDateWorkTime() {
  6810. //针对苏州景昱,单独的检查逻辑
  6811. if (this.user.companyId == 5978) {
  6812. //调接口,先检查工时是否存在异常
  6813. var zhi = this.zhoData;
  6814. var array = [];
  6815. for(let n in zhi){
  6816. if(zhi[n].he){
  6817. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6818. array.push(workData)
  6819. }
  6820. }
  6821. this.submitingReport = true;
  6822. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6823. res => {
  6824. this.submitingReport = false;
  6825. if (res.code == "ok") {
  6826. this.submitWeekReport(0)
  6827. } else {
  6828. this.$confirm(res.msg, '提示', {
  6829. confirmButtonText: '忽略并提交',
  6830. cancelButtonText: '取消',
  6831. type: 'error'
  6832. }).then(() => {
  6833. this.submitWeekReport(0)
  6834. }).catch(() => {
  6835. });
  6836. }
  6837. },
  6838. error => {
  6839. this.$message({
  6840. message: error,
  6841. type: "error"
  6842. });
  6843. });
  6844. }
  6845. },
  6846. // 提交按周填报
  6847. submitWeekReport(isDraft) {
  6848. var zhi = this.zhoData
  6849. var ll = 0
  6850. if(this.reportTimeType.type == 2) {
  6851. for(var i in zhi) {
  6852. this.dateAr = []
  6853. var alp = []
  6854. var zhis = zhi[i]
  6855. console.log(zhis)
  6856. for(var j in zhis) {
  6857. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6858. let objs = {}
  6859. objs.s = zhis[j].time[0]
  6860. objs.e = zhis[j].time[1]
  6861. objs.p = j
  6862. alp.push(objs)
  6863. }
  6864. }
  6865. console.log(alp)
  6866. this.dateAr = alp
  6867. if (this.reportTimeType.timeCanOverlap == 0) {
  6868. let str = this.$t('message.Filledtimeperiodsoverlap')
  6869. if(this.dateAr.length > 0) {
  6870. const trus = this.fns();
  6871. const overlapDataTime = this.getOverlapData(alp);
  6872. if (overlapDataTime.length > 0) {
  6873. const arrList = overlapDataTime.map((item) => item.p);
  6874. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6875. }
  6876. ll += 1
  6877. if(!trus) {
  6878. this.$message({
  6879. message: str,
  6880. type: 'error'
  6881. })
  6882. return false
  6883. }
  6884. }
  6885. } else {
  6886. if(this.dateAr.length > 0) {
  6887. ll +=1 ;
  6888. }
  6889. }
  6890. }
  6891. if(ll == 0) {
  6892. this.$message({
  6893. message: this.$t('message.Pleasefillinthetime'),
  6894. type: 'error'
  6895. })
  6896. return false
  6897. }
  6898. } else if(this.reportTimeType.type == 1){
  6899. for(var i in zhi) {
  6900. var zhis = zhi[i]
  6901. for(var j in zhis) {
  6902. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6903. ll += 1
  6904. }
  6905. }
  6906. }
  6907. if(ll == 0) {
  6908. this.$message({
  6909. message: this.$t('message.Pleaseselectatime'),
  6910. type: 'error'
  6911. })
  6912. return false
  6913. }
  6914. let overcorp = ''
  6915. for(let n in zhi){
  6916. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6917. overcorp += zhi[n].zhoDataTime + ','
  6918. }
  6919. }
  6920. if(this.user.companyId != 5978 && overcorp != ''){
  6921. overcorp = overcorp.substring(0,overcorp.length - 1)
  6922. this.$message({
  6923. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6924. type: 'error'
  6925. })
  6926. return
  6927. }
  6928. }
  6929. var submits = []
  6930. let formData = new FormData();
  6931. formData.append("draft", isDraft);
  6932. if(this.reportTimeType.multiWorktime == 1){
  6933. for (var i in this.zhoData) {
  6934. var zhoD = this.zhoData[i]
  6935. var flgs = false
  6936. for(var j in zhoD) {
  6937. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6938. flgs = true
  6939. // formData.append("degreeId", "-1");
  6940. formData.append("id", '-1');
  6941. if (this.isSubstitude) {
  6942. formData.append('targetUids',this.workForm.userId[0]);
  6943. }
  6944. for(var s in this.projectList) {
  6945. if(j == this.projectList[s].projectName) {
  6946. formData.append("projectId", this.projectList[s].id);
  6947. }
  6948. }
  6949. if(this.user.timeType.reportAuditType == 3){
  6950. let audItem = {}
  6951. if(this.user.timeType.auditLevel > 0){
  6952. audItem.auditorFirst = zhoD[j].auditorFirst
  6953. }
  6954. if(this.user.timeType.auditLevel > 1){
  6955. audItem.auditorSec = zhoD[j].auditorSec
  6956. }
  6957. if(this.user.timeType.auditLevel > 2){
  6958. audItem.auditorThird = zhoD[j].auditorThird
  6959. }
  6960. if(zhoD[j].ccUserid){
  6961. audItem.ccUserid = zhoD[j].ccUserid
  6962. }
  6963. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6964. }
  6965. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6966. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6967. formData.append("reportTimeType", this.reportTimeType.type);
  6968. formData.append("endTime", '');
  6969. formData.append("startTime", '');
  6970. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6971. var lix = []
  6972. var objjs = {}
  6973. objjs.startTime = zhoD[j].time[0]
  6974. objjs.endTime = zhoD[j].time[1]
  6975. if (zhoD[j].content == null || zhoD[j].content == '') {
  6976. zhoD[j].content == '-'
  6977. }
  6978. objjs.content = zhoD[j].content
  6979. lix.push(objjs)
  6980. var zhiZhi = JSON.stringify(lix)
  6981. zhiZhi = zhiZhi.replace(/,/g,"@");
  6982. formData.append("content", zhiZhi)
  6983. formData.append("isOvertime", 0)
  6984. formData.append("professionProgress", "[]")
  6985. if (zhoD[j].groupId) {
  6986. formData.append("groupId",zhoD[j].groupId)
  6987. } else {
  6988. //解决后台groupId数组越界的问题
  6989. formData.append("groupId",0)
  6990. }
  6991. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6992. formData.append("createDate",zhoD.zhoDataTime)
  6993. if (zhoD[j].projectAuditorId) {
  6994. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6995. }
  6996. if(zhoD[j].basecostId) {
  6997. formData.append("basecostId", zhoD[j].basecostId);
  6998. } else {
  6999. formData.append("basecostId", 0);
  7000. }
  7001. if(this.user.timeType.customDegreeActive){
  7002. if (this.user.timeType.customDegreeMultiple) {
  7003. if (zhoD[j].multiDegrIdArray) {
  7004. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7005. } else {
  7006. formData.append('multiDegrId','[]')
  7007. }
  7008. } else {
  7009. if (zhoD[j].degreeId) {
  7010. formData.append('degreeId',zhoD[j].degreeId)
  7011. } else {
  7012. formData.append('degreeId','-1')
  7013. }
  7014. }
  7015. }else{
  7016. formData.append("degreeId", "-1");
  7017. }
  7018. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7019. formData.append('customData',zhoD[j].customData)
  7020. }else if(this.user.timeType.customDataActive){
  7021. formData.append('customData',0)
  7022. }
  7023. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7024. formData.append('customText',zhoD[j].customText)
  7025. }else if(this.user.timeType.customTextActive){
  7026. formData.append('customText','-')
  7027. }
  7028. }
  7029. }
  7030. }
  7031. } else {
  7032. for (var i in this.zhoData) {
  7033. var zhoD = this.zhoData[i]
  7034. var flgs = false
  7035. if(this.reportTimeType.type == 2) {
  7036. for(var k in this.selProjectList) {
  7037. var pItem = this.selProjectList[k];
  7038. var pName = pItem.projectName;
  7039. var j = pName;
  7040. console.log('j==周报中的项目='+j);
  7041. if(zhoD[j].time && zhoD[j].time != 'null') {
  7042. flgs = true
  7043. // formData.append("degreeId", "-1");
  7044. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7045. if (this.isSubstitude) {
  7046. formData.append('targetUids',this.workForm.userId[0]);
  7047. }
  7048. for(var s in this.projectList) {
  7049. if(j == this.projectList[s].projectName) {
  7050. formData.append("projectId", this.projectList[s].id);
  7051. }
  7052. }
  7053. if(this.user.timeType.reportAuditType == 3){
  7054. let audItem = {}
  7055. if(this.user.timeType.auditLevel > 0){
  7056. audItem.auditorFirst = zhoD[j].auditorFirst
  7057. }
  7058. if(this.user.timeType.auditLevel > 1){
  7059. audItem.auditorSec = zhoD[j].auditorSec
  7060. }
  7061. if(this.user.timeType.auditLevel > 2){
  7062. audItem.auditorThird = zhoD[j].auditorThird
  7063. }
  7064. if(zhoD[j].ccUserid){
  7065. audItem.ccUserid = zhoD[j].ccUserid
  7066. }
  7067. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7068. }
  7069. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7070. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7071. formData.append("reportTimeType", this.reportTimeType.type);
  7072. formData.append("endTime", zhoD[j].time[1]);
  7073. formData.append("startTime", zhoD[j].time[0]);
  7074. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7075. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7076. formData.append("isOvertime", 0)
  7077. formData.append("professionProgress", "[]")
  7078. if (zhoD[j].groupId) {
  7079. formData.append("groupId",zhoD[j].groupId)
  7080. } else {
  7081. //解决后台groupId数组越界的问题
  7082. formData.append("groupId",0)
  7083. }
  7084. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7085. formData.append("createDate",zhoD.zhoDataTime)
  7086. if (zhoD[j].projectAuditorId) {
  7087. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7088. }
  7089. if(zhoD[j].basecostId) {
  7090. formData.append("basecostId", zhoD[j].basecostId);
  7091. } else {
  7092. formData.append("basecostId", 0);
  7093. }
  7094. if(this.user.timeType.customDegreeActive){
  7095. if (this.user.timeType.customDegreeMultiple) {
  7096. if (zhoD[j].multiDegrIdArray) {
  7097. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7098. } else {
  7099. formData.append("multiDegrId", "[]");
  7100. }
  7101. } else {
  7102. if (zhoD[j].degreeId) {
  7103. formData.append('degreeId',zhoD[j].degreeId)
  7104. } else {
  7105. formData.append("degreeId", "-1");
  7106. }
  7107. }
  7108. }else{
  7109. formData.append("degreeId", "-1");
  7110. }
  7111. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7112. formData.append('customData',zhoD[j].customData)
  7113. }else if(this.user.timeType.customDataActive){
  7114. formData.append('customData',0)
  7115. }
  7116. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7117. formData.append('customText',zhoD[j].customText)
  7118. }else if(this.user.timeType.customTextActive){
  7119. formData.append('customText','-')
  7120. }
  7121. }
  7122. }
  7123. } else {
  7124. for(var k in this.selProjectList) {
  7125. var pItem = this.selProjectList[k];
  7126. var pName = pItem.projectName;
  7127. var j = pName;
  7128. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7129. flgs = true
  7130. // formData.append("degreeId", "-1");
  7131. console.log('进入了workFpppp==='+j);
  7132. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7133. if (this.isSubstitude) {
  7134. formData.append('targetUids',this.workForm.userId[0]);
  7135. }
  7136. for(var s in this.projectList) {
  7137. if(j == this.projectList[s].projectName) {
  7138. formData.append("projectId", this.projectList[s].id);
  7139. }
  7140. }
  7141. if(this.user.timeType.reportAuditType == 3){
  7142. let audItem = {}
  7143. if(this.user.timeType.auditLevel > 0){
  7144. audItem.auditorFirst = zhoD[j].auditorFirst
  7145. }
  7146. if(this.user.timeType.auditLevel > 1){
  7147. audItem.auditorSec = zhoD[j].auditorSec
  7148. }
  7149. if(this.user.timeType.auditLevel > 2){
  7150. audItem.auditorThird = zhoD[j].auditorThird
  7151. }
  7152. if(zhoD[j].ccUserid){
  7153. audItem.ccUserid = zhoD[j].ccUserid
  7154. }
  7155. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7156. }
  7157. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7158. // formData.append("subProjectId", zhoD[j].subProjectId);
  7159. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7160. formData.append("reportTimeType", this.reportTimeType.type);
  7161. if(this.reportTimeType.type == 1) {
  7162. formData.append("workingTime", zhoD[j].workingTime);
  7163. } else if(this.reportTimeType.type == 2) {
  7164. formData.append("endTime", zhoD[j].time[1]);
  7165. formData.append("startTime", zhoD[j].time[0]);
  7166. } else if(this.reportTimeType.type == 3) {
  7167. formData.append("progress", zhoD[j].progress);
  7168. formData.append("workingTime", zhoD[j].workingTime);
  7169. }
  7170. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7171. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7172. formData.append("isOvertime", 0)
  7173. formData.append("professionProgress", "[]")
  7174. if (zhoD[j].groupId) {
  7175. formData.append("groupId",zhoD[j].groupId)
  7176. } else {
  7177. //解决后台groupId数组越界的问题
  7178. formData.append("groupId",0)
  7179. }
  7180. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7181. formData.append("createDate",zhoD.zhoDataTime)
  7182. if (zhoD[j].projectAuditorId) {
  7183. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7184. }
  7185. if(zhoD[j].basecostId) {
  7186. formData.append("basecostId", zhoD[j].basecostId);
  7187. } else {
  7188. formData.append("basecostId", 0);
  7189. }
  7190. if(this.user.timeType.customDegreeActive){
  7191. if (this.user.timeType.customDegreeMultiple) {
  7192. if (zhoD[j].multiDegrIdArray) {
  7193. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7194. } else {
  7195. formData.append("multiDegrId", "[]");
  7196. }
  7197. } else {
  7198. if (zhoD[j].degreeId) {
  7199. formData.append('degreeId',zhoD[j].degreeId)
  7200. } else {
  7201. formData.append("degreeId", "-1");
  7202. }
  7203. }
  7204. }else{
  7205. formData.append("degreeId", "-1");
  7206. }
  7207. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7208. formData.append('customData',zhoD[j].customData)
  7209. }else if(this.user.timeType.customDataActive){
  7210. formData.append('customData',0)
  7211. }
  7212. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7213. formData.append('customText',zhoD[j].customText)
  7214. }else if(this.user.timeType.customTextActive){
  7215. formData.append('customText','-')
  7216. }
  7217. }
  7218. }
  7219. }
  7220. }
  7221. }
  7222. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7223. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7224. if(!next) {
  7225. this.$message({
  7226. message: `【${error.join('、')}】请填写任务分组`,
  7227. type: 'error'
  7228. })
  7229. return
  7230. }
  7231. // 自定义维度
  7232. this.submitingReport = true;
  7233. this.http.uploadFile( this.port.report.editPort, formData,
  7234. res => {
  7235. // this.listLoading = false;
  7236. this.submitingReport = false;
  7237. if (res.code == "ok") {
  7238. this.$message({
  7239. message: this.$t('message.fillinsuccessfully'),
  7240. type: "success"
  7241. });
  7242. this.fillWeekDialogVisi = false
  7243. this.selConShow = true
  7244. this.zhoData = []
  7245. this.weekDateRange = ''
  7246. this.getReportList();
  7247. this.getDepartment();
  7248. // 关闭弹窗 并 清空
  7249. this.selProjectList = []
  7250. this.selCon = []
  7251. this.getRecentlyProject()
  7252. } else {
  7253. this.$message({
  7254. message: res.msg,
  7255. type: "error"
  7256. });
  7257. }
  7258. },
  7259. error => {
  7260. this.submitingReport = false;
  7261. this.$message({
  7262. message: error,
  7263. type: "error"
  7264. });
  7265. });
  7266. },
  7267. handleGroupAuditorData(data) {
  7268. const { reportAuditType } = this.user.timeType
  7269. if(reportAuditType != 1 && reportAuditType != 2) {
  7270. return {next: true}
  7271. }
  7272. let arrList = [];
  7273. Object.entries(data).forEach(([key, obj]) => {
  7274. Object.entries(obj).forEach(([projectName, projectData]) => {
  7275. if (projectData.workingTime && !projectData.groupId) {
  7276. arrList.push({
  7277. projectName,
  7278. date: obj.zhoDataTime,
  7279. dateText: obj.zhoDataTimeTxt
  7280. });
  7281. }
  7282. });
  7283. });
  7284. if(arrList.length > 0) {
  7285. return {
  7286. next: false,
  7287. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7288. }
  7289. } else {
  7290. return {
  7291. next: true,
  7292. error: [],
  7293. }
  7294. }
  7295. },
  7296. ChangeHourMinutestr (str) {
  7297. if (str !== "0" && str !== "" && str !== null) {
  7298. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7299. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7300. } else {
  7301. return "";
  7302. }
  7303. },
  7304. // 得到两个日期中间的日期
  7305. getdiffdate(stime,etime){
  7306. //初始化日期列表,数组
  7307. var diffdate = new Array();
  7308. var i=0;
  7309. //开始日期小于等于结束日期,并循环
  7310. while(stime<=etime){
  7311. diffdate[i] = stime;
  7312. //获取开始日期时间戳
  7313. var stime_ts = new Date(stime).getTime();
  7314. //增加一天时间戳后的日期
  7315. var next_date = stime_ts + (24*60*60*1000);
  7316. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7317. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7318. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7319. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7320. stime = next_dates_y+next_dates_m+next_dates_d;
  7321. //增加数组key
  7322. i++;
  7323. }
  7324. return diffdate;
  7325. },
  7326. // 添加模块
  7327. addDomain(i) {
  7328. var leftProgress = 10;
  7329. if (this.reportTimeType.type == 3) {
  7330. //计算已经待分配工时比例
  7331. let array = this.workForm.domains;
  7332. let totalProgress = 0;
  7333. for (var i=0;i<array.length; i++) {
  7334. totalProgress += array[i].progress;
  7335. }
  7336. if (totalProgress < 100) {
  7337. leftProgress = 100 - totalProgress;
  7338. }
  7339. }
  7340. var addItem = {
  7341. projectId: "",
  7342. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7343. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7344. ),
  7345. content: "",
  7346. progress:leftProgress,
  7347. state:2,//2-表示待提交
  7348. multiWorktime: this.reportTimeType.multiWorktime,
  7349. worktimeList:[{}],
  7350. canEdit: true,
  7351. auditorFirst: '',
  7352. auditorSec: '',
  7353. auditorThird: '',
  7354. ccUserid: ''
  7355. // degreeId: '',
  7356. };
  7357. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7358. this.$set(addItem,'isOvertime',true)
  7359. if(this.reportTimeType.type == 3){
  7360. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7361. }
  7362. }
  7363. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7364. //默认给第一个,必填字段
  7365. addItem.basecostId = this.timeBasecostList[0].id;
  7366. }
  7367. this.workForm.domains.push(addItem);
  7368. document.getElementById('workFormsItemBottom').scrollIntoView()
  7369. this.canEdit = true
  7370. if (this.reportTimeType.type == 0) {
  7371. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7372. var length = this.workForm.domains.length;
  7373. if (length == 2) {
  7374. this.showAddMore = false;
  7375. }
  7376. }
  7377. this.chuji()
  7378. this.seleChn()
  7379. },
  7380. // 移除模块
  7381. delDomain(i) {
  7382. this.workForm.domains.splice(i,1)
  7383. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7384. if (!this.originCanEdit) {
  7385. let iscan = false
  7386. for(let i in this.workForm.domains){
  7387. if(this.workForm.domains[i].canEdit){
  7388. iscan = true
  7389. }
  7390. }
  7391. this.canEdit = iscan
  7392. }
  7393. //检测当前剩下的一个,时间类型是否是全天
  7394. if (this.reportTimeType.type == 0) {
  7395. if (this.workForm.domains[0].timeType == 0) {
  7396. this.showAddMore = false;
  7397. } else {
  7398. this.showAddMore = true;
  7399. }
  7400. }
  7401. if(this.user.timeType.multiWorktime == 1) {
  7402. this.iptChangs()
  7403. } else {
  7404. this.seleChn(0)
  7405. }
  7406. },
  7407. // 改变月份
  7408. changeMonth() {
  7409. this.isWeekend = false
  7410. let date = new Date()
  7411. let nowmon = date.getMonth() + 1
  7412. let nowday = date.getDate()
  7413. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7414. if (this.isBatch == 0) {
  7415. if(this.user.timeType.fillAhead == 0){
  7416. let date_a = new Date(this.workForm.createDate)
  7417. if(date_a.getTime() > date.getTime()){
  7418. this.workForm.createDate = nowdate
  7419. }
  7420. }
  7421. //只有按天填报才能获取当天的日报
  7422. if(!this.isSubstitude){
  7423. let weekday = new Date(this.workForm.createDate).getDay()
  7424. if(this.user.companyId == 817){
  7425. if(weekday == 0){
  7426. this.isWeekend = true
  7427. }
  7428. }else{
  7429. if(weekday == 0 || weekday == 6){
  7430. this.isWeekend = true
  7431. }
  7432. }
  7433. this.getReport()
  7434. }
  7435. }else {
  7436. if(this.user.timeType.fillAhead == 0){
  7437. let date_a = new Date(this.workForm.createDate[1])
  7438. if(date_a.getTime() > date.getTime()){
  7439. this.workForm.createDate[1] = nowdate
  7440. let sdate = new Date(this.workForm.createDate[0])
  7441. let edate = new Date(this.workForm.createDate[1])
  7442. if(sdate > edate){
  7443. this.workForm.createDate[0] = this.workForm.createDate[1]
  7444. }
  7445. }
  7446. }
  7447. }
  7448. },
  7449. // 判断时间段
  7450. fns() {
  7451. for (let k in this.dateAr) {
  7452. if (!this.judege(k)) {
  7453. return false
  7454. }
  7455. }
  7456. return true
  7457. },
  7458. judege(idx){
  7459. for (let k in this.dateAr) {
  7460. if (idx !== k) {
  7461. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7462. return false
  7463. }
  7464. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7465. return false
  7466. }
  7467. }
  7468. }
  7469. return true
  7470. },
  7471. getOverlapData(data) {
  7472. let overlapData = [];
  7473. for (let i = 0; i < data.length; i++) {
  7474. for (let j = i + 1; j < data.length; j++) {
  7475. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7476. overlapData.push(data[i], data[j]);
  7477. }
  7478. }
  7479. }
  7480. return overlapData;
  7481. },
  7482. // 保存日报111111
  7483. submitReport(isDraft) {
  7484. this.isDraft = isDraft;
  7485. this.$refs.workForm.validate(valid => {
  7486. if (valid) {
  7487. if (!isDraft) {
  7488. //针对苏州景昱,单独的检查逻辑
  7489. if (this.user.companyId == 5978) {
  7490. //调接口,先检查工时是否存在异常
  7491. var totalTime = 0;
  7492. for (var t=0;t<this.workForm.domains.length; t++) {
  7493. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7494. }
  7495. var array = [];
  7496. if (this.isBatch) {
  7497. var startDate = new Date(this.workForm.createDate[0]);
  7498. var endDate = new Date(this.workForm.createDate[1]);
  7499. if (startDate > endDate) {
  7500. this.$message({
  7501. message: '开始日期不能大于结束日期',
  7502. type: "error"
  7503. });
  7504. return
  7505. } else {
  7506. while(true){
  7507. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7508. array.push(workData);
  7509. startDate.setDate(startDate.getDate() + 1);
  7510. if (startDate > endDate) {
  7511. break;
  7512. }
  7513. }
  7514. }
  7515. } else {
  7516. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7517. array.push(workData)
  7518. }
  7519. this.submitingReport = true;
  7520. var passUserId = this.user.id;
  7521. if (this.isSubstitude) {
  7522. passUserId = this.targetUids;
  7523. }
  7524. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7525. res => {
  7526. this.submitingReport = false;
  7527. if (res.code == "ok") {
  7528. this.submitReportSon()
  7529. } else {
  7530. this.$confirm(res.msg, '提示', {
  7531. confirmButtonText: '忽略并提交',
  7532. cancelButtonText: '取消',
  7533. type: 'error'
  7534. }).then(() => {
  7535. this.submitReportSon()
  7536. }).catch(() => {
  7537. });
  7538. }
  7539. },
  7540. error => {
  7541. this.$message({
  7542. message: error,
  7543. type: "error"
  7544. });
  7545. });
  7546. } else {
  7547. if(this.totalReportHours < this.user.timeType.allday){
  7548. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7549. confirmButtonText: '确定',
  7550. cancelButtonText: '取消',
  7551. type: 'warning'
  7552. }).then(() => {
  7553. this.submitReportSon()
  7554. }).catch(() => {
  7555. });
  7556. }else{
  7557. this.submitReportSon()
  7558. }
  7559. }
  7560. } else {
  7561. //暂存,不需要检查工时是否超过考勤
  7562. this.submitReportSon()
  7563. }
  7564. }
  7565. });
  7566. },
  7567. submitReportSon() {
  7568. this.dateAr = []
  7569. //检查重叠
  7570. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7571. let alp = []
  7572. if(this.user.timeType.multiWorktime != 1) {
  7573. for(var p in this.workForm.domains) {
  7574. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7575. let objs = {}
  7576. objs.s = this.workForm.domains[p].startTime
  7577. objs.e = this.workForm.domains[p].endTime
  7578. alp.push(objs)
  7579. }
  7580. }
  7581. this.dateAr = alp
  7582. if(this.dateAr.length > 0) {
  7583. let trus = this.fns()
  7584. if(!trus) {
  7585. this.$message({
  7586. message: this.$t('message.Filledtimeperiodsoverlap'),
  7587. type: "error"
  7588. });
  7589. return
  7590. }
  7591. }
  7592. } else {
  7593. for(var p in this.workForm.domains) {
  7594. var slll = this.workForm.domains[p]
  7595. for(var o in slll.worktimeList) {
  7596. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7597. let objs = {}
  7598. objs.s = slll.worktimeList[o].startTime
  7599. objs.e = slll.worktimeList[o].endTime
  7600. alp.push(objs)
  7601. }
  7602. }
  7603. }
  7604. this.dateAr = alp
  7605. if(this.dateAr.length > 0) {
  7606. let trus = this.fns()
  7607. if(!trus) {
  7608. this.$message({
  7609. message: this.$t('message.Filledtimeperiodsoverlap'),
  7610. type: "error"
  7611. });
  7612. return
  7613. }
  7614. }
  7615. }
  7616. }
  7617. //检查子项目
  7618. if (this.user.timeType.subProMustFill == 1) {
  7619. for(var p in this.workForm.domains) {
  7620. var oneProItem = this.workForm.domains[p]
  7621. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7622. //没有选择子项目
  7623. this.$message({
  7624. message: '子项目必填,请检查',
  7625. type: "error"
  7626. });
  7627. return
  7628. }
  7629. }
  7630. }
  7631. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7632. if (this.user.companyId == this.yuzhongCompId) {
  7633. for(var p in this.workForm.domains) {
  7634. var oneProItem = this.workForm.domains[p]
  7635. if (!oneProItem.extraField1) {
  7636. this.$message({
  7637. message: '角色必填,请检查',
  7638. type: "error"
  7639. });
  7640. return
  7641. }
  7642. if (!oneProItem.extraField2) {
  7643. this.$message({
  7644. message: '工作职责必填,请检查',
  7645. type: "error"
  7646. });
  7647. return
  7648. }
  7649. if (!oneProItem.extraField3) {
  7650. this.$message({
  7651. message: '工作内容必填,请检查',
  7652. type: "error"
  7653. });
  7654. return
  7655. }
  7656. }
  7657. }
  7658. // return
  7659. //代填的情况,检查人员是否已经选择
  7660. if (this.isSubstitude) {
  7661. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7662. this.$message({
  7663. message: this.$t('message.pleaseselectthepersontofillin'),
  7664. type: "error"
  7665. });
  7666. return;
  7667. }
  7668. }
  7669. //检查时间,全天和上下午不能同时存在
  7670. if (this.reportTimeType.type == 0) {
  7671. var alldayNum = 0;
  7672. var amNum = 0;
  7673. var pmNum = 0;
  7674. for(var i in this.workForm.domains) {
  7675. if (this.workForm.domains[i].timeType == 0) {
  7676. alldayNum ++;
  7677. } else if (this.workForm.domains[i].timeType == 1) {
  7678. amNum++;
  7679. } else if (this.workForm.domains[i].timeType == 2) {
  7680. pmNum++;
  7681. }
  7682. }
  7683. if (alldayNum > 1) {
  7684. this.$message({
  7685. // message: "工作时间-全天,只能选择一次",
  7686. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7687. type: "error"
  7688. });
  7689. return;
  7690. }
  7691. if (amNum > 1) {
  7692. this.$message({
  7693. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7694. type: "error"
  7695. });
  7696. return;
  7697. }
  7698. if (pmNum > 1) {
  7699. this.$message({
  7700. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7701. type: "error"
  7702. });
  7703. return;
  7704. }
  7705. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7706. this.$message({
  7707. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7708. type: "error"
  7709. });
  7710. return;
  7711. }
  7712. } else if (this.reportTimeType.type == 3) {
  7713. //总百分比不能超过100%
  7714. let total = 0;
  7715. this.workForm.domains.forEach(w=>{total += w.progress});
  7716. if (total > 100) {
  7717. this.$message({
  7718. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7719. type: "error"
  7720. });
  7721. return;
  7722. } else if (total < 100) {
  7723. this.$message({
  7724. message: this.$t('message.cannotbesubmitted'),
  7725. type: "error"
  7726. });
  7727. return;
  7728. }
  7729. }
  7730. this.listLoading = true;
  7731. let formData = new FormData();
  7732. formData.append("draft", this.isDraft);
  7733. var totalTime = 0;
  7734. for (var t=0;t<this.workForm.domains.length; t++) {
  7735. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7736. }
  7737. //批量填报不校验考勤时长,交给后台校验
  7738. if (!this.isBatch) {
  7739. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7740. if (this.workForm.time){
  7741. if (this.workForm.time.workHours == 0){
  7742. this.$message({
  7743. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7744. type: 'error'
  7745. })
  7746. return
  7747. }
  7748. }else{
  7749. this.$message({
  7750. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7751. type: 'error'
  7752. })
  7753. return
  7754. }
  7755. }
  7756. }
  7757. //针对凡己和景昱,此处不校验考勤时长
  7758. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7759. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7760. this.$message({
  7761. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7762. type: "error"
  7763. });
  7764. return;
  7765. }
  7766. }
  7767. for(var i in this.workForm.domains) {
  7768. // 检查任务/里程碑是否为必填
  7769. let taskRequired = this.user.timeType.taskRequired
  7770. if(taskRequired == 1) {
  7771. if(!this.workForm.domains[i].taskId) {
  7772. this.$message({
  7773. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7774. type: "error"
  7775. });
  7776. return
  7777. }
  7778. }
  7779. if(this.user.timeType.reportAuditType == 3){
  7780. let audItem = {}
  7781. let auditRule = ''
  7782. if(this.workForm.domains[i].id){
  7783. audItem.reportId = this.workForm.domains[i].id
  7784. }
  7785. if(this.user.timeType.auditLevel > 0){
  7786. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7787. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7788. }
  7789. if(this.user.timeType.auditLevel > 1){
  7790. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7791. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7792. }
  7793. if(this.user.timeType.auditLevel > 2){
  7794. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7795. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7796. }
  7797. if(this.workForm.domains[i].ccUserid){
  7798. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7799. }
  7800. if(auditRule){
  7801. auditRule = auditRule.substring(0,auditRule.length - 1)
  7802. this.$message({
  7803. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7804. type: 'error'
  7805. })
  7806. return
  7807. }
  7808. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7809. }
  7810. if (this.user.timeType.customDegreeActive) {
  7811. if (this.user.timeType.customDegreeMultiple) {
  7812. //多选
  7813. if (this.workForm.domains[i].multiDegrIdArray) {
  7814. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7815. degreeArray = degreeArray.replace(/,/g,"@");
  7816. formData.append("multiDegrId", degreeArray);
  7817. } else {
  7818. formData.append("multiDegrId", '[]');
  7819. }
  7820. } else {
  7821. //单选
  7822. if (this.workForm.domains[i].degreeId) {
  7823. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7824. } else {
  7825. formData.append("degreeId", -1);
  7826. }
  7827. }
  7828. } else {
  7829. formData.append("degreeId", -1);
  7830. }
  7831. if(this.workForm.domains[i].customData) {
  7832. // var sss = this.workForm.domains[i].degreeId.toString()
  7833. formData.append("customData", this.workForm.domains[i].customData);
  7834. } else {
  7835. formData.append("customData", 0);
  7836. }
  7837. if(this.workForm.domains[i].customText) {
  7838. formData.append("customText", this.workForm.domains[i].customText);
  7839. } else {
  7840. formData.append("customText", '-');
  7841. }
  7842. if (this.workForm.domains[i].id) {
  7843. formData.append("id", this.workForm.domains[i].id);
  7844. } else {
  7845. formData.append("id", -1);
  7846. }
  7847. formData.append("projectId", this.workForm.domains[i].projectId);
  7848. if (this.workForm.domains[i].subProjectId) {
  7849. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7850. } else {
  7851. formData.append("subProjectId", 0);
  7852. }
  7853. if (this.workForm.domains[i].groupId) {
  7854. formData.append("groupId", this.workForm.domains[i].groupId);
  7855. } else {
  7856. formData.append("groupId", 0);
  7857. }
  7858. if (this.workForm.domains[i].taskId) {
  7859. formData.append("taskId", this.workForm.domains[i].taskId);
  7860. } else {
  7861. formData.append("taskId", 0);
  7862. }
  7863. if (this.workForm.domains[i].taskFinish == true) {
  7864. formData.append("taskFinish", 1);
  7865. } else {
  7866. formData.append("taskFinish", 0);
  7867. }
  7868. formData.append("reportTimeType", this.reportTimeType.type);
  7869. if (this.reportTimeType.type == 0) {
  7870. formData.append("timeType", this.workForm.domains[i].timeType);
  7871. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7872. formData.append("workingTime", workingTime);
  7873. } else if (this.reportTimeType.type == 1){
  7874. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7875. } else if (this.reportTimeType.type == 2) {
  7876. formData.append("endTime", this.workForm.domains[i].endTime);
  7877. formData.append("startTime", this.workForm.domains[i].startTime);
  7878. } else if (this.reportTimeType.type == 3) {
  7879. //按比例分配
  7880. formData.append("progress", this.workForm.domains[i].progress);
  7881. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7882. }
  7883. if(this.user.timeType.choseFromAlbum == 1 ) {
  7884. console.log(this.workForm.domains[i].imgList)
  7885. if(this.workForm.domains[i].imgList) {
  7886. let imgListFor = this.workForm.domains[i].imgList
  7887. for(var b in imgListFor) {
  7888. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7889. }
  7890. console.log(imgListFor)
  7891. let m = JSON.stringify(imgListFor);
  7892. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7893. formData.append("picStr", m);
  7894. } else {
  7895. formData.append("picStr", '[]');
  7896. }
  7897. }
  7898. //处理多个时间事项
  7899. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7900. if (this.reportTimeType.multiWorktime == 1) {
  7901. //检查时间是否有重叠
  7902. var workList = this.workForm.domains[i].worktimeList;
  7903. for (var j=0;j<workList.length; j++) {
  7904. var curItem = workList[j];
  7905. //检查开始时间是否大于结束时间
  7906. if (curItem.startTime >= curItem.endTime) {
  7907. this.$message({
  7908. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7909. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7910. type: "error"
  7911. });
  7912. return;
  7913. }
  7914. //时间不可重叠
  7915. if (this.reportTimeType.timeCanOverlap == 0) {
  7916. for (var p = j+1;p<workList.length; p++) {
  7917. var jItem = workList[p];
  7918. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7919. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7920. this.$message({
  7921. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7922. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7923. type: "error"
  7924. });
  7925. return;
  7926. }
  7927. }
  7928. }
  7929. }
  7930. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7931. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7932. formData.append("content", m);
  7933. } else {
  7934. if (this.workForm.domains[i].content) {
  7935. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7936. m = m.replace(/,/g,",");
  7937. console.log(m, '需要传值的数据')
  7938. // formData.append("content", this.workForm.domains[i].content);
  7939. formData.append("content", m);
  7940. } else {
  7941. formData.append("content", '-');
  7942. }
  7943. }
  7944. if (this.isBatch == 0) {
  7945. formData.append("createDate", this.workForm.createDate);
  7946. } else {
  7947. //批量填报,时间范围
  7948. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7949. }
  7950. if(this.workForm.domains[i].isOvertime) {
  7951. formData.append("isOvertime", 1);
  7952. } else {
  7953. formData.append("isOvertime", 0);
  7954. }
  7955. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7956. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7957. } else {
  7958. formData.append("overtimeHours", 0);
  7959. }
  7960. if(this.workForm.domains[i].basecostId) {
  7961. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7962. } else {
  7963. formData.append("basecostId", 0);
  7964. }
  7965. if (this.workForm.userId != null) {
  7966. var targetUids = '';
  7967. this.workForm.userId.forEach(u=>{
  7968. targetUids += u + '@';
  7969. });
  7970. if (targetUids.length > 0) {
  7971. targetUids = targetUids.substring(0, targetUids.length -1);
  7972. formData.append("targetUids", targetUids);
  7973. }
  7974. }
  7975. //项目专业进度
  7976. if (this.workForm.domains[i].professionProgress) {
  7977. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7978. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7979. formData.append("professionProgress", m);
  7980. } else {
  7981. formData.append("professionProgress", "[]");
  7982. }
  7983. if (this.workForm.domains[i].stage) {
  7984. formData.append("stage", this.workForm.domains[i].stage);
  7985. } else {
  7986. formData.append("stage", "-");
  7987. }
  7988. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7989. if (this.workForm.domains[i].projectAuditorId) {
  7990. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7991. } else {
  7992. // console.log('执行到了这里')
  7993. // console.log(this.user.timeType.reportAuditType)
  7994. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7995. this.$message({
  7996. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7997. type: "error"
  7998. });
  7999. return;
  8000. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  8001. //分组负责人先审核, 确定是选择了任务分组
  8002. if (this.workForm.domains[i].taskGroups.length == 0) {
  8003. this.$message({
  8004. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8005. type: "error"
  8006. });
  8007. } else if (!this.workForm.domains[i].groupId) {
  8008. // console.log(this.workForm.domains[i]);
  8009. this.$message({
  8010. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8011. type: "error"
  8012. });
  8013. } else {
  8014. this.$message({
  8015. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  8016. type: "error"
  8017. });
  8018. }
  8019. return;
  8020. }
  8021. }
  8022. if (this.user.companyId == this.yuzhongCompId) {
  8023. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8024. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8025. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8026. }
  8027. //依斯贝的服务Id
  8028. if (this.user.companyId == this.yisibeiCompId) {
  8029. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8030. }
  8031. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8032. this.$message({
  8033. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  8034. type: "error"
  8035. });
  8036. return
  8037. }
  8038. if(this.user.timeType.userWithMultiDept == 1) {
  8039. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8040. }
  8041. }
  8042. this.submitingReport = true;
  8043. this.http.uploadFile( this.port.report.editPort, formData,
  8044. res => {
  8045. this.listLoading = false;
  8046. this.submitingReport = false;
  8047. if (res.code == "ok") {
  8048. if(res.msg!=null){
  8049. this.$message({
  8050. dangerouslyUseHTMLString: true,
  8051. message: res.msg,
  8052. type: "warning",
  8053. showClose: true,
  8054. duration: 0
  8055. });
  8056. }else{
  8057. this.$message({
  8058. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8059. type: "success"
  8060. });
  8061. }
  8062. this.dialogVisible = false;
  8063. this.jsDay = 0
  8064. this.jsTime = 0
  8065. this.getReportList();
  8066. this.getDepartment();
  8067. this.getRecentlyProject()
  8068. } else {
  8069. this.$message({
  8070. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8071. type: "error"
  8072. });
  8073. }
  8074. },
  8075. error => {
  8076. this.listLoading = false;
  8077. this.submitingReport = false;
  8078. this.$message({
  8079. message: error,
  8080. type: "error"
  8081. });
  8082. });
  8083. },
  8084. // 判断是展示那个工时导入
  8085. imports() {
  8086. if(this.user.timeType.syncCorpwxTime == 0) {
  8087. this.importDialog = true
  8088. } else {
  8089. this.importWxDialog = true
  8090. }
  8091. },
  8092. // 跳转
  8093. junpToDeskTop(id) {
  8094. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8095. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8096. },
  8097. // 通过日报
  8098. approve(id, item) {
  8099. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8100. this.approveinData = {
  8101. id: id,
  8102. date: this.date +day,
  8103. reportIds: item.id
  8104. }
  8105. if(this.user.timeType.needEvaluate == 1){
  8106. this.$set(this.approveinData,'evaluate','')
  8107. this.approveinDialog = true
  8108. }else{
  8109. this.logining = true;
  8110. this.approveinfun()
  8111. }
  8112. },
  8113. approveinfun(){
  8114. this.http.post( this.port.report.approve, this.approveinData,
  8115. res => {
  8116. this.logining = false;
  8117. if (res.code == "ok") {
  8118. this.approveinDialog = false
  8119. this.$message({
  8120. message: this.$t('message.Reviewsucceeded'),
  8121. type: "success"
  8122. });
  8123. this.refreshReportData(this.approveinData.reportIds);
  8124. this.getDepartment();
  8125. } else {
  8126. this.$message({
  8127. message: res.msg,
  8128. type: "error"
  8129. });
  8130. }
  8131. },
  8132. error => {
  8133. this.logining = false;
  8134. this.$message({
  8135. message: error,
  8136. type: "error"
  8137. });
  8138. });
  8139. },
  8140. //撤回日报
  8141. cancel(item,e) {
  8142. // console.log('can can need',item);
  8143. this.logining = true;
  8144. var ids = '';
  8145. var data = e ? item : item.data;
  8146. data.forEach(element => {
  8147. if(element.id){
  8148. ids +=(element.id+',');
  8149. }
  8150. });
  8151. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8152. res => {
  8153. this.logining = false;
  8154. if (res.code == "ok") {
  8155. this.$message({
  8156. message:this.$t('message.Withdrawalsucceeded'),
  8157. type: "success"
  8158. });
  8159. this.getReportList();
  8160. if(e){this.getReport()}
  8161. this.getDepartment();
  8162. } else {
  8163. this.$message({
  8164. message: res.msg,
  8165. type: "error"
  8166. });
  8167. }
  8168. },
  8169. error => {
  8170. this.logining = false;
  8171. this.$message({
  8172. message: error,
  8173. type: "error"
  8174. });
  8175. });
  8176. },
  8177. showDenyDialog(id,i, item) {
  8178. this.denyReasonDialog = true;
  8179. this.isDenying = false;
  8180. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8181. var ids = item.id;
  8182. // var data = item.data;
  8183. // data.forEach(element => {
  8184. // ids +=(element.id+',');
  8185. // });
  8186. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8187. },
  8188. // 未通过日报
  8189. deny() {
  8190. this.logining = true;
  8191. this.isDenying = true;
  8192. this.http.post( this.port.report.deny, this.denyForm,
  8193. res => {
  8194. this.logining = false;
  8195. this.isDenying = false;
  8196. if (res.code == "ok") {
  8197. this.$message({
  8198. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8199. type: "success"
  8200. });
  8201. this.refreshReportData(this.denyForm.reportIds);
  8202. this.getDepartment();
  8203. this.denyReasonDialog = false;
  8204. } else {
  8205. this.$message({
  8206. message: res.msg,
  8207. type: "error"
  8208. });
  8209. }
  8210. },
  8211. error => {
  8212. this.logining = false;
  8213. this.$message({
  8214. message: error,
  8215. type: "error"
  8216. });
  8217. });
  8218. },
  8219. // 查看工时记录弹窗
  8220. toView() {
  8221. this.toViewDialogVisible = true
  8222. this.toViewloading = true
  8223. this.getToView()
  8224. },
  8225. getToView() {
  8226. this.http.post( '/report-import-log/getList', this.toViewForm,
  8227. res => {
  8228. this.toViewloading = false;
  8229. if (res.code == "ok") {
  8230. // console.log(res.data, '数据数据')
  8231. this.toViewList = res.data.records
  8232. this.toViewForm.total = res.data.total
  8233. } else {
  8234. this.toViewloading = false;
  8235. this.$message({
  8236. message: res.msg,
  8237. type: "error"
  8238. });
  8239. }
  8240. })
  8241. },
  8242. // 触发 selectCat 组件更改他的值
  8243. selectCatCli(obj) {
  8244. // console.log(obj, '看看')
  8245. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8246. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8247. },
  8248. vueCasader(obj) {
  8249. console.log(obj, '看看值', this.departmentList)
  8250. if(obj.distinction == 1 && obj.item) {
  8251. let arr = []
  8252. arr.push(obj.item.value)
  8253. this.exportParam.departmentId = arr
  8254. }
  8255. if(obj.distinction == '10' && obj) {
  8256. const { id, other } = obj
  8257. this.workForm.domains[other].reportTargetDeptId = id
  8258. }
  8259. if(obj.distinction == '14' && obj) {
  8260. let arr = []
  8261. arr.push(obj.id)
  8262. this.deptIdForHasReport = arr
  8263. this.showMonthWorkTime()
  8264. }
  8265. if(obj.distinction == '15' && obj) {
  8266. let arr = []
  8267. arr.push(obj.id)
  8268. this.deptIdForNoReport = arr
  8269. this.showMonthNotWorkTime()
  8270. }
  8271. if(obj.distinction == '16' && obj) {
  8272. let arr = []
  8273. arr.push(obj.id)
  8274. this.deptIdForReminder = arr
  8275. this.showMonthWorkTimeReminder()
  8276. }
  8277. },
  8278. //分页
  8279. handleCurrentChange(val) {
  8280. this.toViewForm.pageIndex = val;
  8281. this.getToView();
  8282. },
  8283. handleSizeChange(val) {
  8284. this.toViewForm.pageSize = val;
  8285. this.getToView();
  8286. },
  8287. getAllUsersList(){
  8288. this.http.post('/user/getSimpleActiveUserList',{
  8289. },res => {
  8290. if(res.code == 'ok'){
  8291. this.allUsersList = res.data
  8292. }else{
  8293. this.$message({
  8294. message: res.msg,
  8295. type: 'error'
  8296. })
  8297. }
  8298. },err => {
  8299. this.$message({
  8300. message: err,
  8301. type: 'error'
  8302. })
  8303. })
  8304. },
  8305. //景昱变更提醒
  8306. changeReminder(item){
  8307. console.log("============",item)
  8308. let parameter={
  8309. startDate: this.WorktimeDatepickValue[0],
  8310. endDate: this.WorktimeDatepickValue[1],
  8311. }
  8312. if(item){
  8313. parameter.createDate=item.createDate,
  8314. parameter.userId=item.userId
  8315. }
  8316. this.http.post('/report/changeReminder',parameter,res => {
  8317. if(res.code == 'ok'){
  8318. this.$message({
  8319. message: res.msg,
  8320. type: 'success'
  8321. })
  8322. }else{
  8323. this.$message({
  8324. message: res.msg,
  8325. type: 'error'
  8326. })
  8327. }
  8328. },err => {
  8329. this.$message({
  8330. message: err,
  8331. type: 'error'
  8332. })
  8333. })
  8334. },
  8335. //景昱取消异常
  8336. cancelReminder(item){
  8337. let parameter={}
  8338. if(item){
  8339. parameter.createDate=item.createDate,
  8340. parameter.userId=item.userId
  8341. }
  8342. this.http.post('/report/cancelReminder',parameter,res => {
  8343. if(res.code == 'ok'){
  8344. this.$message({
  8345. message: res.msg,
  8346. type: 'success'
  8347. })
  8348. }else{
  8349. this.$message({
  8350. message: res.msg,
  8351. type: 'error'
  8352. })
  8353. }
  8354. },err => {
  8355. this.$message({
  8356. message: err,
  8357. type: 'error'
  8358. })
  8359. })
  8360. this.showMonthWorkTimeReminder()
  8361. },
  8362. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8363. fillWeekCustomClne() {
  8364. this.fillWeekDialogVisiCustom = false
  8365. },
  8366. fillWeekCustomSubmit() {
  8367. this.getReportList();
  8368. this.getDepartment();
  8369. this.getRecentlyProject()
  8370. },
  8371. // 待填日报姓名搜索
  8372. nameAearchSeek(flg) {
  8373. if(!this.nameAearch) {
  8374. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8375. return
  8376. }
  8377. if(flg) {
  8378. this.enterpriseWechatgetUser()
  8379. }
  8380. },
  8381. handleThreeData(userList) {
  8382. console.log(userList, '人员数据')
  8383. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8384. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8385. },
  8386. // 过滤树节点
  8387. filterTreeNodes(treeData, filterKeywords) {
  8388. return treeData.filter((node) => {
  8389. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8390. if (node.children && node.children.length > 0) {
  8391. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8392. }
  8393. return true;
  8394. }
  8395. if (node.children && node.children.length > 0) {
  8396. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8397. return node.children.length > 0;
  8398. }
  8399. return false;
  8400. });
  8401. },
  8402. // 企业微信获取人员
  8403. enterpriseWechatgetUser() {
  8404. this.deptMembDataLoading = true
  8405. this.http.post('/user/getEmployeeList',{
  8406. departmentId: -1,
  8407. pageIndex: 1,
  8408. pageSize: 100,
  8409. keyword: this.nameAearch,
  8410. status: '',
  8411. roleId: '',
  8412. cursor: '',
  8413. onlyDirect: '',
  8414. matchingType: ''
  8415. },res => {
  8416. if(res.code == 'ok'){
  8417. this.deptMembDataLoading = false
  8418. const userListName = res.data.records.map(item => item.name)
  8419. this.handleThreeData(userListName)
  8420. }else{
  8421. this.deptMembDataLoading = false
  8422. this.$message({
  8423. message: res.msg,
  8424. type: 'error'
  8425. })
  8426. }
  8427. },err => {
  8428. this.deptMembDataLoading = false
  8429. this.$message({
  8430. message: err,
  8431. type: 'error'
  8432. })
  8433. })
  8434. },
  8435. // 按周填报获取相关任务
  8436. async getWeeklyTaskList(item) {
  8437. console.log(item, '<=== 数据')
  8438. const { projectId, groupId, stage, taskId } = item
  8439. console.log(projectId, groupId, stage)
  8440. let parms = { projectId, isSubstitude: 0 }
  8441. groupId ? parms.groupId = groupId : ''
  8442. stage ? parms.stage = stage : ''
  8443. const { data } = await this.postData('/task/getRecentTask', parms)
  8444. this.zhoBao.taskId = taskId
  8445. this.$set(this.zhoBao, 'taskList', data)
  8446. console.log(this.zhoBao)
  8447. },
  8448. // 封装 post 请求
  8449. postData(url, params) {
  8450. return new Promise((resolve, reject) => {
  8451. this.http.post(url, { ...params },
  8452. res => {
  8453. resolve(res)
  8454. },
  8455. error => {
  8456. this.$message({
  8457. message: error,
  8458. type: "error"
  8459. });
  8460. reject(error)
  8461. })
  8462. })
  8463. },
  8464. // 自定义事件
  8465. selectCal(obj) {
  8466. console.log(obj, '传数据来源')
  8467. if(obj.distinction == '1') {
  8468. this.zhoBao.projectAuditorId = obj.id
  8469. } else if(obj.distinction == '2') {
  8470. this.zhoBao.auditorFirst = obj.id
  8471. } else if(obj.distinction == '3') {
  8472. this.zhoBao.auditorSec = obj.id
  8473. } else if(obj.distinction == '4') {
  8474. this.zhoBao.auditorThird = obj.id
  8475. } else if(obj.distinction == '5') {
  8476. this.zhoBao.ccUserid = obj.id
  8477. } else if(obj.distinction == '12') {
  8478. this.usersListId = obj.id
  8479. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8480. this.searchKeyword = obj.name
  8481. } else {
  8482. this.searchKeyword = ''
  8483. }
  8484. this.searchScreen(0)
  8485. } else if(obj.distinction == '13') {
  8486. this.usersListId = obj.id
  8487. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8488. this.searchKeyword = obj.name
  8489. } else {
  8490. this.searchKeyword = ''
  8491. }
  8492. this.searchScreen(1)
  8493. }
  8494. }
  8495. },
  8496. created() {
  8497. this.getUsers()
  8498. let height = window.innerHeight;
  8499. this.tableHeight = height - 178;
  8500. const that = this;
  8501. window.onresize = function temp() {
  8502. that.tableHeight = window.innerHeight - 178;
  8503. };
  8504. this.toViewForm.companyId = this.user.companyId
  8505. this.initDrag([{
  8506. type: "LR",
  8507. domClass: {
  8508. // 中间分割线的名字
  8509. resize: "line-line",
  8510. // 左侧盒子的名字
  8511. left: "box-left",
  8512. // 右侧盒子的名字
  8513. right: "box-right",
  8514. // 父级的名字
  8515. box: "box-father",
  8516. },
  8517. otherInfo: {
  8518. // 限制左边栏最低宽度
  8519. leftWidth: 120,
  8520. },
  8521. },
  8522. {
  8523. type: "LR",
  8524. domClass: {
  8525. // 中间分割线的名字
  8526. resize: "line-second",
  8527. // 左侧盒子的名字
  8528. left: "left-laowang",
  8529. // 右侧盒子的名字
  8530. right: "box-second-father",
  8531. // 父级的名字
  8532. box: "grand",
  8533. },
  8534. otherInfo: {
  8535. // 限制左边栏最低宽度
  8536. leftWidth: 120,
  8537. },
  8538. },
  8539. ]);
  8540. }
  8541. };
  8542. </script>
  8543. <style lang="scss" scoped>
  8544. .fillWeekDialogVisiCustom {
  8545. width: 100%;
  8546. height: 70vh;
  8547. }
  8548. .fillWeekCustom {
  8549. .el-dialog__body {
  8550. padding: 20px 20px !important;
  8551. }
  8552. }
  8553. .photos {
  8554. position: relative;
  8555. display: flex;
  8556. flex-wrap: wrap;
  8557. }
  8558. .photos_img {
  8559. width: 120px;
  8560. height: 120px;
  8561. margin-right: 20px;
  8562. margin-bottom: 20px;
  8563. cursor: pointer;
  8564. img {
  8565. width: 100%;
  8566. height: 100%;
  8567. }
  8568. }
  8569. .paginatis {
  8570. padding: 10px 10px;
  8571. background: #f2f2f2;
  8572. }
  8573. .waiting {
  8574. color:orange;
  8575. }
  8576. .filledReportStyle {
  8577. color:#32CD32;
  8578. }
  8579. .RejectStyle {
  8580. color:red;
  8581. }
  8582. .waitSubmitStyle{
  8583. color: #409eff;
  8584. }
  8585. .chooseDate {
  8586. .waiting {
  8587. color: #20a0ff;
  8588. }
  8589. .filledReportStyle {
  8590. color:#20a0ff;
  8591. }
  8592. .RejectStyle {
  8593. color: #20a0ff;
  8594. }
  8595. .waitSubmitStyle{
  8596. color: #20a0ff;
  8597. }
  8598. }
  8599. .allDaily {
  8600. width:100%;
  8601. }
  8602. .report_title {
  8603. padding:10px 0;
  8604. color:#666;
  8605. }
  8606. .clearfix {
  8607. overflow-x: auto;
  8608. white-space: nowrap;
  8609. padding: 15px 0 10px 0;
  8610. // overflow-y: hidden;
  8611. .date_item {
  8612. padding: 0 3px;
  8613. cursor: pointer;
  8614. position: relative;
  8615. }
  8616. .chooseDate {
  8617. position: absolute;
  8618. bottom: -3px;
  8619. width: 37px;
  8620. height: 2px;
  8621. left: 14px;
  8622. background: #20a0ff;
  8623. }
  8624. }
  8625. .one_daily {
  8626. i {
  8627. color: #9ed0ff;
  8628. margin-right: 5px;
  8629. }
  8630. .one_daily_body {
  8631. padding: 10px 0px;
  8632. p {
  8633. margin: 0;
  8634. line-height: 30px;
  8635. }
  8636. }
  8637. ul {
  8638. padding: 0;
  8639. }
  8640. }
  8641. .checkbtn {
  8642. float: right;
  8643. margin-top: -10px;
  8644. }
  8645. .selConStyle{
  8646. margin-top:9rem;
  8647. margin-bottom:11rem;
  8648. .selConStyle_title{
  8649. height: 3rem;
  8650. text-align: center;
  8651. font-size: 17px;
  8652. }
  8653. .el-select{
  8654. margin: 0 15%;
  8655. width: 70%;
  8656. }
  8657. }
  8658. </style>
  8659. <style lang="scss">
  8660. /*去除upload组件过渡效果*/
  8661. .photos .el-upload-list__item {
  8662. transition: none !important;
  8663. }
  8664. .daily {
  8665. .el-card__body {
  8666. height: 80%;
  8667. overflow-y: auto;
  8668. }
  8669. .el-card__header {
  8670. padding: 0 20px;
  8671. }
  8672. }
  8673. .membListClass{
  8674. .el-dialog__body{
  8675. padding-top: 10px;
  8676. }
  8677. }
  8678. // .editReportDialog .el-dialog__footer{
  8679. // position: sticky;
  8680. // bottom: 0;
  8681. // background: #fff;
  8682. // height: 70px;
  8683. // z-index: 1010;
  8684. // }
  8685. .editReportDialog{
  8686. min-width: 800px;
  8687. }
  8688. .touruxiangmu{
  8689. max-width: 1000px;
  8690. }
  8691. </style>
  8692. <style scoped>
  8693. /* 项目标签的样式 */
  8694. .el-tag + .el-tag {
  8695. margin-left: 10px;
  8696. }
  8697. .button-new-tag {
  8698. margin-left: 10px;
  8699. height: 32px;
  8700. line-height: 30px;
  8701. padding-top: 0;
  8702. padding-bottom: 0;
  8703. }
  8704. .input-new-tag {
  8705. width: 90px;
  8706. margin-left: 10px;
  8707. vertical-align: bottom;
  8708. }
  8709. .selectworktime .el-table__fixed-body-wrapper{
  8710. top: 48px !important;
  8711. }
  8712. .selectworktime_export .selectworktime_export_l{
  8713. width: 650px;
  8714. float: left;
  8715. height: 42px;
  8716. }
  8717. .approvalProcessBox{
  8718. margin-left: 30px;
  8719. font-size: 14px;
  8720. line-height: 16px;
  8721. cursor: pointer;
  8722. }
  8723. .approvalProcessBox i {
  8724. margin-right: 0;
  8725. height: 16px;
  8726. width: 16px;
  8727. display: inline-block;
  8728. transform: scale(1.2);
  8729. position: relative;
  8730. top: 0.5px;
  8731. color: #409eff;
  8732. }
  8733. .approvalProcessBox .approvalProcessClick{
  8734. cursor: pointer;
  8735. color: #409eff;
  8736. font-size: 14px;
  8737. }
  8738. .approvalProcessBox:hover .approvalProcessClick{
  8739. color: #3485fb;
  8740. }
  8741. </style>
  8742. <style lang="scss" scoped>
  8743. .bionicClass {
  8744. -webkit-appearance: none;
  8745. background-color: #FFF;
  8746. background-image: none;
  8747. border-radius: 4px;
  8748. border: 1px solid #DCDFE6;
  8749. box-sizing: border-box;
  8750. color: #606266;
  8751. display: inline-block;
  8752. height: 40px;
  8753. line-height: 40px;
  8754. outline: 0;
  8755. padding: 0 15px;
  8756. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8757. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8758. width: 350px;
  8759. cursor: pointer;
  8760. .bionicClassText {
  8761. color: #C0C4CC;
  8762. }
  8763. }
  8764. // 加班样式
  8765. .overtime {
  8766. display: inline-block;
  8767. margin-left: 20px;
  8768. input {
  8769. display: inline-block;
  8770. margin-top: 5px;
  8771. }
  8772. }
  8773. .plus {
  8774. display: inline-block;
  8775. }
  8776. // .tages {
  8777. // float: right;
  8778. // }
  8779. .overtime {
  8780. display: inline-block;
  8781. margin-left: 30px;
  8782. }
  8783. .bloks {
  8784. display: inline-block;
  8785. width: 380px;
  8786. }
  8787. .zhiss {
  8788. display: flex;
  8789. justify-content: space-around;
  8790. align-items: center;
  8791. }
  8792. .zhoFel {
  8793. display: flex;
  8794. justify-content: space-between;
  8795. align-items: center;
  8796. }
  8797. // 左右滑动样式
  8798. .line {
  8799. width: 30px;
  8800. /* height: 500px; */
  8801. background: #f2f2f2;
  8802. cursor: w-resize;
  8803. }
  8804. .box-father {
  8805. border: 8px solid #000;
  8806. }
  8807. .line-second {
  8808. width: 10px;
  8809. /* background: red; */
  8810. }
  8811. .flex {
  8812. display: flex;
  8813. width: 100%;
  8814. }
  8815. .box-left {
  8816. flex: 0 0 400px;
  8817. /* height: 600px; */
  8818. /* background: blue; */
  8819. }
  8820. .box-right {
  8821. /* height: 600px; */
  8822. /* background: green; */
  8823. flex: 1;
  8824. }
  8825. .box-postion {
  8826. width: 200px;
  8827. /* height: 400px; */
  8828. background: #ccc;
  8829. }
  8830. .custom-tree-node {
  8831. flex: 1;
  8832. display: flex;
  8833. align-items: center;
  8834. justify-content: space-between;
  8835. font-size: 14px;
  8836. padding-right: 8px;
  8837. }
  8838. .daitianrbao {
  8839. width: 100%;
  8840. box-sizing: border-box;
  8841. height: 40px;
  8842. border-radius: 4px;
  8843. border: 1px solid #DCDFE6;
  8844. overflow: hidden;
  8845. text-overflow: ellipsis;
  8846. display: flex;
  8847. // align-items: center;
  8848. }
  8849. .daitianrbao .spnn {
  8850. display: inline-block;
  8851. box-sizing: border-box;
  8852. padding: 0 15px;
  8853. overflow: hidden;
  8854. text-overflow: ellipsis;
  8855. }
  8856. .daitianrbao .hover {
  8857. color: #DCDFE6 !important;
  8858. }
  8859. </style>