daily.vue 436 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <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>
  175. <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>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <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> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <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"
  252. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  253. <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"
  254. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  255. <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"
  256. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  257. <!--自己可以撤回待审核状态的报告 -->
  258. <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>
  259. </span>
  260. </p>
  261. <p v-if="user.companyId == yuzhongCompId">
  262. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  263. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  264. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  265. <!--任务分组和阶段 -->
  266. <p v-if="item2.groupId != 0">
  267. {{$t('other.taskGroup')}}:{{item2.groupName}}
  268. <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>
  269. </p>
  270. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  271. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  272. <!-- 自定义日报文本 -->
  273. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  274. <p v-if="user.company.packageEngineering == 1">
  275. {{$t('other.professionalProgress')}}:
  276. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  277. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  278. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  279. </el-tooltip>
  280. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  281. <i class="iconfont firerock-iconshenhetongguo"></i>
  282. </el-tooltip>
  283. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  284. <i class="iconfont firerock-iconshenhebohui"></i>
  285. </el-tooltip>
  286. </span>
  287. </p>
  288. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  289. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  290. </p>
  291. <div v-if="item2.multiWorktime==0">
  292. <p style="display: inline-block;">{{$t('time.duration')}}:
  293. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  295. {{item2.time.toFixed(1)}}h
  296. <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>
  297. </p>
  298. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  299. </div>
  300. <div v-if="item2.multiWorktime==1" >
  301. <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>
  302. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  303. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  304. <p style="display: inline-block;">{{$t('time.duration')}}:
  305. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  306. {{timeItem.time.toFixed(1)}}h
  307. </p>
  308. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  309. </div>
  310. </div>
  311. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  312. <!--照片的显示 -->
  313. <p v-if="item2.pics != null && item2.pics.length > 0">
  314. <el-image v-for="(pic, index) in item2.pics" :key="index"
  315. style="width: 100px; height: 100px; margin-right:10px;"
  316. :src="pic"
  317. :preview-src-list="item2.pics">
  318. </el-image>
  319. </p>
  320. </el-card>
  321. </el-timeline-item>
  322. </el-timeline>
  323. </div>
  324. </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><ww-open-data type='userName' :openid='item'></ww-open-data></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. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  390. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  391. </span>
  392. <!--批量填报和批量代填不显示考勤记录-->
  393. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  394. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  395. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  396. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  397. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  398. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  399. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  400. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  401. @click="refreshAttendance(workForm.createDate)"></el-button>
  402. <!-- AI智能填报 -->
  403. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  404. </el-form-item>
  405. <!-- 000000 -->
  406. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  407. <div v-if="reportTimeType.multiWorktime==0">
  408. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  409. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  410. <el-select v-model="domain.timeType" style="width:200px;"
  411. v-if="reportTimeType.type == 0"
  412. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  413. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  414. @change="onTimeTypeChange(domain.timeType)">
  415. <el-option
  416. v-for="item in timeType"
  417. :key="item.value"
  418. :label="item.label"
  419. :value="item.value">
  420. </el-option>
  421. </el-select>
  422. <!-- 数字时长选择 -->
  423. <el-select v-model="domain.workingTime" style="width:200px;"
  424. v-if="reportTimeType.type == 1"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  427. @change="seleChn(0,domain)">
  428. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  429. </el-select>
  430. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  431. <span v-if="reportTimeType.type == 2">
  432. <!--时间范围选择 -->
  433. <el-time-picker
  434. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  435. v-model="domain.startTime"
  436. :placeholder="$t('time.startTime')"
  437. style="width:120px;"
  438. format="HH:mm"
  439. value-format="HH:mm"
  440. :picker-options="{
  441. start: '08:00',
  442. end: '23:30'
  443. }"
  444. @change="iptChang()">
  445. </el-time-picker> - <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.endTime"
  448. :placeholder="$t('time.endTime')"
  449. style="width:120px;"
  450. format="HH:mm"
  451. value-format="HH:mm"
  452. :picker-options="{
  453. start: '08:00',
  454. end: '23:30',
  455. minTime: domain.startTime
  456. }"
  457. @change="iptChang()">
  458. </el-time-picker>
  459. </span>
  460. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  461. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  462. <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>
  463. </div>
  464. </el-form-item>
  465. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  466. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  467. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  468. @change="selectProject(domain, index)"
  469. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  470. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  471. <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">
  472. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  473. <span style="float: right;">{{ item.projectName }}</span>
  474. </el-option>
  475. </el-option-group>
  476. </el-select>
  477. <!--昱众不显示子项目-->
  478. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  479. <span style="margin-left:45px;">
  480. {{$t('lable.subproject')}}</span>
  481. <!--子项目 -->
  482. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  483. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  484. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  485. </el-select>
  486. </template>
  487. <template v-if="user.companyId == yuzhongCompId">
  488. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  489. <!--角色选择 -->
  490. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  491. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  492. <el-option
  493. v-for="item in roleList"
  494. :key="item.value"
  495. :label="item.label"
  496. :value="item.value">
  497. </el-option>
  498. </el-select>
  499. </template>
  500. <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%;"
  501. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  502. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  503. </el-link>
  504. <!-- <el-link type="primary" v-if="canEdit"
  505. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  506. </el-form-item>
  507. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  508. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  509. </el-form-item>
  510. <!--如果设置了工时成本预警的预算成本项-->
  511. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  512. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  513. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  514. </el-select>
  515. </el-form-item>
  516. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  517. <template slot="label">
  518. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  519. <span >{{$t('lable.taskGrouping')}}</span>
  520. </template>
  521. <!-- 任务分组 -->
  522. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  523. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  524. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  525. </el-select>
  526. <template v-if="user.companyId == yuzhongCompId">
  527. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  528. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  529. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  530. <el-option
  531. v-for="item in domain.filteredRespList"
  532. :key="item.id"
  533. :label="item.jobRespon"
  534. :value="item.id">
  535. </el-option>
  536. </el-select>
  537. </template>
  538. <template v-else><!-- 项目的阶段 -->
  539. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  540. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  541. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  542. @change="changeStages(domain, index)"
  543. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  544. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  545. </el-select>
  546. </template>
  547. </el-form-item>
  548. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  549. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  550. <template slot="label">
  551. <span style="color:#FF0000;">*</span>
  552. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  553. </template>
  554. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  555. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  556. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  557. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  558. </el-option>
  559. </el-select>
  560. <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>
  561. </el-form-item>
  562. </div>
  563. <el-form-item v-if="user.companyId == yuzhongCompId">
  564. <template slot="label">
  565. <span style="color:#FF0000;">*</span>
  566. <span >工作内容</span>
  567. </template>
  568. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  569. :disabled="(workForm.domains[index].state>=2?false:true)" >
  570. <el-option
  571. v-for="item in domain.workContentList"
  572. :key="item.id"
  573. :label="item.workContext"
  574. :value="item.id">
  575. </el-option>
  576. </el-select>
  577. </el-form-item>
  578. <!-- 111111 -->
  579. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  580. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  581. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  582. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  583. <span v-else>{{item.name}}</span>
  584. </el-option>
  585. </el-select>
  586. <template v-if="user.timeType.auditLevel > 1">
  587. <i class="el-icon-right"></i>
  588. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  589. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  590. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  591. <span v-else>{{item.name}}</span>
  592. </el-option>
  593. </el-select>
  594. </template>
  595. <template v-if="user.timeType.auditLevel > 2">
  596. <i class="el-icon-right"></i>
  597. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  598. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  599. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  600. <span v-else>{{item.name}}</span>
  601. </el-option>
  602. </el-select>
  603. </template>
  604. </el-form-item>
  605. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  606. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  607. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  608. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  609. <span v-else>{{item.name}}</span>
  610. </el-option>
  611. </el-select>
  612. </el-form-item>
  613. <!-- 相关维度/自定义维度 -->
  614. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  615. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  616. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  617. </el-option>
  618. </el-select>
  619. </el-form-item>
  620. <!-- 相关数值 -->
  621. <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">
  622. <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>
  623. </el-form-item>
  624. <!-- 自定义文本 -->
  625. <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">
  626. <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>
  627. </el-form-item>
  628. <!--按比例填报-->
  629. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  630. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  631. <div style="width:400px;">
  632. <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>
  633. <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>
  634. </div>
  635. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  636. <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>
  637. </div>
  638. </el-form-item>
  639. <!--工程专业版本模式下, 各个专业的进度填报 -->
  640. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  641. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  642. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  643. <el-input size="mini" style="width:60px;" v-model="item.progress"
  644. @keyup.native="onProgressChange"
  645. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  646. </span>
  647. </el-form-item>
  648. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  649. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  650. <template slot="label" v-if="user.companyId == 3092">
  651. <span style="color:#FF0000;">*</span>
  652. <span >任务</span>
  653. </template>
  654. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  655. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  656. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  657. </el-select>
  658. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  659. </el-form-item>
  660. <!--针对依斯贝的SAP服务-->
  661. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  662. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  663. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  664. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  665. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  666. </el-select>
  667. </el-form-item>
  668. <!--工作事项-->
  669. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  670. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  671. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  673. </el-form-item>
  674. <!-- 拍照上传 -->
  675. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  676. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  677. <div class="photos">
  678. <div>
  679. <el-upload
  680. list-type="picture-card"
  681. :http-request="(file) => {return addImg(file, index)}"
  682. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  683. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  684. :file-list="domain.imgListUrl" :limit="9"
  685. :disabled="workForm.domains[index].state>=2?false:true">
  686. <i class="el-icon-plus"></i>
  687. </el-upload>
  688. </div>
  689. </div>
  690. </el-form-item>
  691. </div>
  692. <!--多个工作事项填报的情况 -->
  693. <div v-if="reportTimeType.multiWorktime==1">
  694. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  695. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  696. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  697. @change="selectProject(domain, index)"
  698. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  699. <!-- <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">
  700. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  701. <span style="float: right;">{{ item.projectName }}</span>
  702. </el-option> -->
  703. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  704. <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">
  705. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  706. <span style="float: right;">{{ item.projectName }}</span>
  707. </el-option>
  708. </el-option-group>
  709. </el-select>
  710. <template v-if="user.timeType.mainProjectState != 1">
  711. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  712. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  713. <!--子项目 -->
  714. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  715. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  716. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  717. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  718. </el-select>
  719. </template>
  720. <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;"
  721. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  722. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  723. </el-link>
  724. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  725. <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>
  726. </div>
  727. <!-- <el-link type="primary" v-if="canEdit"
  728. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  729. </el-form-item>
  730. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  731. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  732. </el-form-item>
  733. <!--如果设置了工时成本预警的预算成本项-->
  734. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  735. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  736. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  737. </el-select>
  738. </el-form-item>
  739. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  740. <!-- 任务分组 -->
  741. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  742. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  743. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  744. </el-select>
  745. <!-- 项目的阶段 -->
  746. <span v-if="domain.stages != null && domain.stages.length> 0"
  747. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  748. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  749. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  750. @change="changeStages(domain, index)"
  751. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  752. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  753. </el-select>
  754. </el-form-item>
  755. <el-form-item :label="$t('other.projectAuditor')" >
  756. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  757. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  758. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  759. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  760. </el-option>
  761. </el-select>
  762. <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>
  763. </el-form-item>
  764. <!--工程专业版本模式下, 各个专业的进度填报 -->
  765. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  766. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  767. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  768. <el-input size="mini" style="width:60px;" v-model="item.progress"
  769. @keyup.native="onProgressChange"
  770. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  771. </span>
  772. </el-form-item>
  773. <!-- 相关维度 -->
  774. <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'">
  775. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  776. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  777. </el-option>
  778. </el-select>
  779. </el-form-item>
  780. <!-- 相关数值 -->
  781. <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">
  782. <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>
  783. </el-form-item>
  784. <!-- 自定义文本 -->
  785. <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">
  786. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  787. </el-form-item>
  788. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  789. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  790. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  791. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  792. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  793. </el-select>
  794. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  795. </el-form-item>
  796. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  797. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  798. <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>
  799. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  800. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  801. <span v-if="reportTimeType.type == 2">
  802. <!-- <span> -->
  803. <!--时间范围选择 -->
  804. <el-time-picker
  805. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  806. v-model="timeItem.startTime"
  807. :placeholder="$t('time.startTime')"
  808. style="width:120px;"
  809. format="HH:mm"
  810. value-format="HH:mm"
  811. :picker-options="{
  812. start: '00:00',
  813. end: '23:59',
  814. }"
  815. @change="iptChangs()">
  816. </el-time-picker> - <el-time-picker
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  818. v-model="timeItem.endTime"
  819. :placeholder="$t('time.endTime')"
  820. style="width:120px;"
  821. format="HH:mm"
  822. value-format="HH:mm"
  823. :picker-options="{
  824. start: '00:00',
  825. end: '23:59',
  826. minTime: timeItem.startTime
  827. }"
  828. @change="iptChangs()">
  829. </el-time-picker>
  830. </span>
  831. </el-form-item>
  832. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  833. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  834. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  835. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  836. ></el-input>
  837. </el-form-item>
  838. </div>
  839. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  840. </div>
  841. <!--照片的显示 -->
  842. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  843. <el-image v-for="(pic, index) in domain.pics" :key="index"
  844. style="width: 100px; height: 100px; margin-right:10px;"
  845. :src="pic"
  846. :preview-src-list="domain.pics">
  847. </el-image>
  848. </p>
  849. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  850. </div>
  851. <span id="workFormsItemBottom"></span>
  852. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  853. </el-form>
  854. </div>
  855. <span slot="footer" class="dialog-footer">
  856. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  857. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  858. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  859. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  860. <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>
  861. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  862. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  863. </span>
  864. </el-dialog>
  865. <!-- 按周填报 -->
  866. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  867. <!-- 按周填报-已填工时-点击 -->
  868. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  869. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  870. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  871. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  872. <el-table-column prop="state" :label="$t('state.states')">
  873. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  874. </el-table-column>
  875. <!-- <el-table-column label="操作">
  876. <template slot-scope="scope">
  877. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  878. </template>
  879. </el-table-column> -->
  880. </el-table>
  881. <span slot="footer" class="dialog-footer">
  882. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  883. </span>
  884. </el-dialog>
  885. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  886. <el-form-item style="height:30px;margin-top:-72px;">
  887. <!-- <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> -->
  888. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  889. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  890. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  891. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  892. <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>
  893. <el-option
  894. v-for="item in fillProjectList"
  895. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  896. :key="item.id"
  897. :label="item.projectName + '\u3000' + item.projectCode"
  898. :value="item.id">
  899. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  900. <span style="float: right">{{ item.projectName }}</span>
  901. </el-option>
  902. </el-select>
  903. <span style="float:right;margin-right:10px;">选择项目</span>
  904. </el-form-item>
  905. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  906. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  907. <template slot-scope="scope">
  908. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  909. </template>
  910. </el-table-column>
  911. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  912. <template slot-scope="scope">
  913. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  914. <p v-else></p>
  915. </template>
  916. </el-table-column> -->
  917. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  918. <template slot-scope="scope">
  919. <div v-if="scope.row.canFill == 1">
  920. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  921. <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>
  922. <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>
  923. <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>
  924. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  925. </div>
  926. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  927. <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>
  928. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  929. </div>
  930. </div>
  931. <div v-else >
  932. <span style="color:#999999;">不可超前填报</span>
  933. </div>
  934. </template>
  935. </el-table-column>
  936. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  937. <template slot-scope="scope">
  938. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  939. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  940. </template>
  941. </el-table-column>
  942. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  943. <template slot-scope="scope">
  944. <div class="zhiss">
  945. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  946. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  947. </div>
  948. </template>
  949. </el-table-column>
  950. </el-table>
  951. </el-form>
  952. <span slot="footer" class="dialog-footer" >
  953. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  954. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  955. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  956. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  957. </span>
  958. </el-dialog>
  959. <!-- 重庆物奇私人定制的按周填报 -->
  960. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  961. <div class="fillWeekDialogVisiCustom">
  962. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  963. </div>
  964. </el-dialog>
  965. <!-- 选择时间 -->
  966. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  967. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  968. <span slot="footer" class="dialog-footer">
  969. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  970. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  971. </span>
  972. </el-dialog>
  973. <!-- 按周填报弹窗 -->
  974. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  975. <div>
  976. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  977. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  978. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  979. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  980. </el-select>
  981. </div>
  982. <!--如果设置了工时成本预警的预算成本项-->
  983. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  984. <p>{{$t('lable.budgetSource')}}</p>
  985. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  986. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  987. </el-select>
  988. </div>
  989. <!-- 任务分组 -->
  990. <div class="zhoFel" v-if="user.company.packageProject == 1">
  991. <p>{{$t('lable.taskGrouping')}}</p>
  992. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  993. @change="getGroupStages(zhoBao, 0)">
  994. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  995. </el-select>
  996. </div>
  997. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  998. <p>{{$t('other.inputStage')}}</p>
  999. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  1000. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1001. </el-select>
  1002. </div>
  1003. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1004. <p>{{$t('other.reviewer')}}</p>
  1005. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1006. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1007. </el-select>
  1008. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1009. </div>
  1010. <template v-if="user.timeType.reportAuditType == 3">
  1011. <div class="zhoFel">
  1012. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1013. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1014. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1015. </el-select>
  1016. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1017. </div>
  1018. <div class="zhoFel">
  1019. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1020. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1021. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1022. </el-select>
  1023. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1024. </div>
  1025. <div class="zhoFel">
  1026. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1027. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1028. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1029. </el-select>
  1030. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1031. </div>
  1032. <div class="zhoFel">
  1033. <p>{{ $t('chao-song-ren') }}</p>
  1034. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1035. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1036. </el-select>
  1037. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1038. </div>
  1039. </template>
  1040. <!-- 自定义维度 -->
  1041. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1042. <p>{{user.timeType.customDegreeName}}</p>
  1043. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1044. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1045. </el-select>
  1046. </div>
  1047. <!-- 自定义数值 -->
  1048. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1049. <p>{{user.timeType.customDataName}}</p>
  1050. <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>
  1051. </div>
  1052. <!-- 自定义文本 -->
  1053. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1054. <p>{{user.timeType.customTextName}}</p>
  1055. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1056. </div>
  1057. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1058. <p>{{$t('other.timeSelection')}}</p>
  1059. <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>
  1060. </div>
  1061. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1062. <p>{{$t('other.chooseDuration')}}</p>
  1063. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1064. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1065. </el-select>
  1066. </div>
  1067. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1068. <p>{{$t('lable.percentageOfTime')}}</p>
  1069. <div style="width:400px;display: flex;align-items: center;">
  1070. <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>
  1071. <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>
  1072. </div>
  1073. </div>
  1074. <div class="zhoFel">
  1075. <p>{{$t('other.workMatters')}}</p>
  1076. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1077. </div>
  1078. </div>
  1079. <span slot="footer" class="dialog-footer">
  1080. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1081. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1082. </span>
  1083. </el-dialog>
  1084. <!--导出报表条件选择 -->
  1085. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1086. <el-form ref="form3" :model="exportParam" >
  1087. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1088. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1089. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1090. </el-select>
  1091. </el-form-item>
  1092. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1093. <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>
  1094. <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>
  1095. </el-form-item>
  1096. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1097. <el-date-picker
  1098. v-model="exportParam.dateRange" :editable="false"
  1099. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1100. :range-separator="$t('other.to')"
  1101. type="daterange"
  1102. :start-placeholder="$t('time.startDate')"
  1103. :end-placeholder="$t('time.endDate')"
  1104. ></el-date-picker>
  1105. </el-form-item>
  1106. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1107. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1108. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1109. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1110. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1111. </el-select>
  1112. </el-form-item>
  1113. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1114. <div class="exportReportRadio">
  1115. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1116. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1117. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1118. <i class="el-icon-question"></i>
  1119. </el-tooltip>
  1120. </div>
  1121. </el-form-item>
  1122. </el-form>
  1123. <div slot="footer" class="dialog-footer">
  1124. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1125. </div>
  1126. </el-dialog>
  1127. <!--导出报表条件选择 -->
  1128. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1129. <el-form ref="form3" :model="exportParam" >
  1130. <el-form-item prop="range" :label="$t('time.dateRange')">
  1131. <el-date-picker
  1132. v-model="exportParam.dateRange" :editable="false"
  1133. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1134. :clearable="true"
  1135. :range-separator="$t('other.to')"
  1136. type="daterange"
  1137. :start-placeholder="$t('time.startDate')"
  1138. :end-placeholder="$t('time.endDate')"
  1139. ></el-date-picker>
  1140. </el-form-item>
  1141. </el-form>
  1142. <div slot="footer" class="dialog-footer">
  1143. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1144. </div>
  1145. </el-dialog>
  1146. <!--人员列表 -->
  1147. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1148. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1149. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1150. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1151. <el-table-column type="selection"></el-table-column>
  1152. <el-table-column prop="label" :label="$t('lable.name')" >
  1153. <template slot-scope="scope">
  1154. <span>
  1155. <!-- {{(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}} -->
  1156. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1157. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1158. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1159. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1160. </span>
  1161. <span v-else>
  1162. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1163. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1164. </span>
  1165. </span>
  1166. </template>
  1167. </el-table-column>
  1168. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1169. <template slot-scope="scope">
  1170. <div>
  1171. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1172. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1173. </div>
  1174. </template>
  1175. </el-table-column>
  1176. </el-table>
  1177. </el-tab-pane>
  1178. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1179. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1180. <el-table-column prop="label" :label="$t('lable.name')" >
  1181. <template slot-scope="scope">
  1182. <!-- <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> -->
  1183. <!-- <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> -->
  1184. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1185. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1186. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1187. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1188. </span>
  1189. <span v-else>
  1190. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1191. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1192. </span>
  1193. </template>
  1194. </el-table-column>
  1195. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1196. <template slot-scope="scope">
  1197. <div>
  1198. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1199. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1200. </div>
  1201. </template>
  1202. </el-table-column>
  1203. </el-table>
  1204. </el-tab-pane>
  1205. </el-tabs>
  1206. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1207. <el-table-column type="selection"></el-table-column>
  1208. <el-table-column prop="label" :label="$t('lable.name')" >
  1209. <template slot-scope="scope">
  1210. <div>
  1211. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1212. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1213. </div>
  1214. </template>
  1215. </el-table-column>
  1216. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1217. <template slot-scope="scope">
  1218. <div>
  1219. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1220. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1221. </div>
  1222. </template>
  1223. </el-table-column>
  1224. </el-table>
  1225. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1226. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1227. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1228. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1229. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1230. </div>
  1231. </el-dialog>
  1232. <!-- 按部门选择人员 -->
  1233. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1234. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1235. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1236. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1237. </el-input>
  1238. <div class="tree" style="height:400px">
  1239. <el-scrollbar style="height:100%">
  1240. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1241. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1242. highlight-current :filter-node-method="filterNode">
  1243. <span class="custom-tree-node" slot-scope="{ node }">
  1244. <span v-if="user.userNameNeedTranslate == '1'">
  1245. <span v-if="node.data.children">
  1246. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1247. </span>
  1248. <span v-else>
  1249. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1250. </span>
  1251. </span>
  1252. <span v-if="user.userNameNeedTranslate != '1'">
  1253. {{ node.label }}
  1254. </span>
  1255. <!-- {{ node.label }} -->
  1256. </span>
  1257. </el-tree>
  1258. </el-scrollbar>
  1259. </div>
  1260. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1261. <div slot="footer" class="dialog-footer">
  1262. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1263. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1264. </div>
  1265. </el-dialog>
  1266. <el-dialog
  1267. v-if="monthWorkTimeDialog"
  1268. :visible.sync="monthWorkTimeDialog"
  1269. :close-on-click-modal="false"
  1270. customClass="customWidth selectworktime"
  1271. width="1200px"
  1272. title=""
  1273. >
  1274. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1275. <el-tabs v-model="activeName" @tab-click="handleClick">
  1276. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1277. <div class="selectworktime_export" style="margin-top:10px;">
  1278. <div class="selectworktime_export_l">
  1279. <el-date-picker
  1280. class="selecteworktime_datapick"
  1281. v-model="WorktimeDatepickValue"
  1282. value-format="yyyy-MM-dd"
  1283. type="daterange"
  1284. align="right"
  1285. unlink-panels
  1286. :range-separator="$t('other.to')"
  1287. :start-placeholder="$t('time.startDate')"
  1288. :end-placeholder="$t('time.endDate')"
  1289. :default-time="['12:00:00', '12:00:00']"
  1290. size="small"
  1291. popper-class="selecteorktime_datapick_popper"
  1292. @change="showMonthWorkTime()"
  1293. >
  1294. </el-date-picker>
  1295. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1296. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1297. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1298. <!-- 222 -->
  1299. </div>
  1300. <div>
  1301. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1302. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1303. </el-input>
  1304. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1305. </div>
  1306. <el-link
  1307. type="primary"
  1308. style="float: right; vertical-align: middle;height:32px"
  1309. @click="exportMembWorkHours()"
  1310. >{{$t('export.exportData')}}</el-link
  1311. >
  1312. </div>
  1313. <el-table ref="hasworkTbl"
  1314. :data="monthWorkDataS"
  1315. v-el-table-infinite-scroll="listScroll"
  1316. border
  1317. :height="500"
  1318. highlight-current-row
  1319. style="width: 100%"
  1320. v-loading="tbload"
  1321. :lazy="true"
  1322. >
  1323. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1324. <template slot-scope="scope">
  1325. {{ scope.$index + 1 }}
  1326. </template>
  1327. </el-table-column>
  1328. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1329. <template slot-scope="scope">
  1330. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1331. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1332. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1333. <!-- {{scope.row.name}} -->
  1334. </span>
  1335. </template>
  1336. </el-table-column>
  1337. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1338. <template slot-scope="scope">
  1339. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1340. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1341. </template>
  1342. </el-table-column>
  1343. <el-table-column
  1344. min-width="105"
  1345. v-for="(item, index) in pickDateArray"
  1346. :key="index"
  1347. :label="item.label"
  1348. align="center"
  1349. >
  1350. <template slot-scope="scope">
  1351. <div
  1352. style="color: red"
  1353. v-if="
  1354. scope.row.worktimeList.filter(
  1355. (w) =>
  1356. w.createDate==item.date
  1357. ).length > 0 &&
  1358. scope.row.worktimeList.filter(
  1359. (w) =>w.createDate==item.date
  1360. )[0].workingTime < reportTimeType.allday
  1361. "
  1362. >
  1363. {{
  1364. scope.row.worktimeList.filter(
  1365. (w) =>w.createDate==item.date
  1366. )[0].workingTime.toFixed(1)
  1367. }}
  1368. </div>
  1369. <div
  1370. style="color: #20a0ff"
  1371. v-if="
  1372. scope.row.worktimeList.filter(
  1373. (w) =>w.createDate==item.date
  1374. ).length > 0 &&
  1375. scope.row.worktimeList.filter(
  1376. (w) =>w.createDate==item.date
  1377. )[0].workingTime > reportTimeType.allday
  1378. "
  1379. >
  1380. {{
  1381. scope.row.worktimeList.filter(
  1382. (w) =>w.createDate==item.date
  1383. )[0].workingTime.toFixed(1)
  1384. }}
  1385. </div>
  1386. <div
  1387. v-if="
  1388. scope.row.worktimeList.filter(
  1389. (w) =>w.createDate==item.date
  1390. ).length > 0 &&
  1391. scope.row.worktimeList.filter(
  1392. (w) =>w.createDate==item.date
  1393. )[0].workingTime == reportTimeType.allday
  1394. "
  1395. >
  1396. {{
  1397. scope.row.worktimeList.filter(
  1398. (w) =>w.createDate==item.date
  1399. )[0].workingTime
  1400. }}
  1401. </div>
  1402. <div
  1403. v-if="
  1404. scope.row.worktimeList.filter(
  1405. (w) =>w.createDate==item.date
  1406. ).length == 0
  1407. "
  1408. >
  1409. 0
  1410. </div>
  1411. <div
  1412. v-if="
  1413. scope.row.worktimeList.filter(
  1414. (w) =>w.createDate==item.date
  1415. ).length > 0 &&
  1416. typeof scope.row.worktimeList.filter(
  1417. (w) =>w.createDate==item.date
  1418. )[0].workingTime == 'string'
  1419. "
  1420. >
  1421. {{
  1422. scope.row.worktimeList.filter(
  1423. (w) =>w.createDate==item.date
  1424. )[0].workingTime
  1425. }}
  1426. </div>
  1427. </template>
  1428. </el-table-column>
  1429. </el-table>
  1430. <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>
  1431. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1432. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1433. <label style="font-size: 16px">员工每日已填报工时数</label>
  1434. <el-link
  1435. type="primary"
  1436. style="float: right; margin-right: 60px"
  1437. @click="exportMembWorkHours()"
  1438. >导出已填报数据</el-link
  1439. > -->
  1440. <!-- <el-button >导出</el-button> -->
  1441. <!-- </div> -->
  1442. </el-tab-pane>
  1443. <el-tab-pane label="未提交人员列表" name="second" >
  1444. <div class="selectworktime_export" style="margin-top:10px">
  1445. <div class="selectworktime_export_l">
  1446. <el-date-picker
  1447. class="selecteworktime_datapick"
  1448. v-model="WorktimeDatepickValue"
  1449. value-format="yyyy-MM-dd"
  1450. type="daterange"
  1451. align="right"
  1452. unlink-panels
  1453. :range-separator="$t('other.to')"
  1454. :start-placeholder="$t('time.startDate')"
  1455. :end-placeholder="$t('time.endDate')"
  1456. :default-time="['12:00:00', '12:00:00']"
  1457. size="small"
  1458. popper-class="selecteorktime_datapick_popper"
  1459. @change="showMonthNotWorkTime()"
  1460. >
  1461. </el-date-picker>
  1462. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1463. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1464. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1465. </div>
  1466. <div>
  1467. <div style="margin-top:10px;">
  1468. <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>
  1469. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1470. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1471. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1472. </el-input>
  1473. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1474. <el-link
  1475. type="primary"
  1476. style="float: right; vertical-align: middle;height:32px"
  1477. @click="exportMembNotWorkHours()"
  1478. >{{$t('export.exportData')}}</el-link
  1479. >
  1480. </div>
  1481. </div>
  1482. </div>
  1483. <el-table
  1484. ref="hasworkTbl2"
  1485. :data="monthNotWorkDateS"
  1486. v-el-table-infinite-scroll="notListScroll"
  1487. border
  1488. :height="500"
  1489. highlight-current-row
  1490. style="width: 100%"
  1491. v-loading="tbload"
  1492. lazy
  1493. >
  1494. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1495. <template slot-scope="scope">
  1496. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1497. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1498. </template>
  1499. </el-table-column>
  1500. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1501. <template slot-scope="scope">
  1502. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1503. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1504. </template>
  1505. </el-table-column>
  1506. <el-table-column
  1507. min-width="200"
  1508. :label="$t('weekDay.date')"
  1509. align="center"
  1510. prop="createDate"
  1511. >
  1512. </el-table-column>
  1513. <el-table-column
  1514. min-width="200"
  1515. :label="$t('state.states')"
  1516. align="center"
  1517. prop="status"
  1518. />
  1519. <el-table-column
  1520. min-width="200"
  1521. :label="$t('other.attendanceData')"
  1522. prop="cardTime"
  1523. align="center"
  1524. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1525. </el-table>
  1526. <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>
  1527. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1528. </el-tab-pane>
  1529. </el-tabs>
  1530. </el-dialog>
  1531. <!--驳回弹出框 -->
  1532. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1533. <div>
  1534. <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')" />
  1535. </div>
  1536. <div slot="footer" class="dialog-footer">
  1537. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1538. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1539. </div>
  1540. </el-dialog>
  1541. <!-- 通过弹出框 -->
  1542. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1543. <div>
  1544. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1545. </div>
  1546. <div slot="footer" class="dialog-footer">
  1547. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1548. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1549. </div>
  1550. </el-dialog>
  1551. <!--批量导入日报 -->
  1552. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1553. <p>1. {{$t('other.download')}}
  1554. <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>
  1555. </p>
  1556. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1557. <p style="display: flex;justify-content: center;">
  1558. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1559. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1560. </el-upload>
  1561. </p>
  1562. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1563. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1564. </div>
  1565. </el-dialog>
  1566. <!-- 工时导入记录弹窗 -->
  1567. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1568. <div style="height: 452px">
  1569. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1570. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1571. <el-table-column prop="userName" :label="$t('other.operator')">
  1572. <template slot-scope="scope">
  1573. <div>
  1574. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1575. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1576. </div>
  1577. </template>
  1578. </el-table-column>
  1579. <el-table-column prop="datel" :label="$t('other.document')">
  1580. <template slot-scope="scope">
  1581. <div>
  1582. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1583. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1584. </div>
  1585. </template>
  1586. </el-table-column>
  1587. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1588. <template slot-scope="scope">
  1589. <div>
  1590. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1591. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1592. </div>
  1593. </template>
  1594. </el-table-column>
  1595. </el-table>
  1596. <el-col :span="24" class="paginatis">
  1597. <el-pagination
  1598. @size-change="handleSizeChange"
  1599. @current-change="handleCurrentChange"
  1600. :page-sizes="[20 , 50 , 80 , 100]"
  1601. :page-size="20"
  1602. layout="total, sizes, prev, pager, next"
  1603. :total="toViewForm.total"
  1604. style="float:right;"
  1605. ></el-pagination>
  1606. </el-col>
  1607. </div>
  1608. </el-dialog>
  1609. <!--基于企业微信考勤数据的工时导入 -->
  1610. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1611. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1612. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1613. </el-step>
  1614. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1615. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1616. </el-steps>
  1617. <div v-if="active==0" style="padding:30px;height:360px;">
  1618. <div style="margin-top:50px;margin-left:280px;">
  1619. <el-date-picker
  1620. v-model="importWxParam.date" :editable="false"
  1621. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1622. :clearable="true"
  1623. :range-separator="$t('other.to')"
  1624. type="daterange"
  1625. :start-placeholder="$t('time.startDate')"
  1626. :end-placeholder="$t('time.endDate')"
  1627. @change="loadCheckInData"
  1628. ></el-date-picker>
  1629. </div>
  1630. </div>
  1631. <div v-if="active==1" style="padding:10px;">
  1632. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1633. style="width: 100%;margin-top:5px;" >
  1634. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1635. <template slot-scope="scope">
  1636. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1637. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1638. </template>
  1639. </el-table-column>
  1640. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1641. </el-table-column>
  1642. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1643. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1644. <template slot-scope="scope">
  1645. <div>
  1646. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1647. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1648. </div>
  1649. </template>
  1650. </el-table-column>
  1651. <el-table-column prop="departmentName" label="部门" >
  1652. <template slot-scope="scope">
  1653. <div>
  1654. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1655. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1656. </div>
  1657. </template>
  1658. </el-table-column>
  1659. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1660. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1661. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1662. <template slot-scope="scope">
  1663. {{scope.row.workHours.toFixed(1)}}h
  1664. </template>
  1665. </el-table-column>
  1666. </el-table>
  1667. </div>
  1668. <div v-if="active==2" >
  1669. <p style="display: flex;justify-content: center;height:390px;">
  1670. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1671. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1672. </el-upload>
  1673. </p>
  1674. </div>
  1675. <div slot="title">
  1676. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1677. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1678. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1679. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1680. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1681. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1682. </div>
  1683. <span slot="footer">
  1684. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1685. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1686. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1687. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1688. </span>
  1689. </el-dialog>
  1690. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1691. <p style="display: flex;justify-content: center;height:100px;">
  1692. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1693. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1694. </el-upload>
  1695. </p>
  1696. </el-dialog>
  1697. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1698. <div>
  1699. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1700. v-model="deleteReportParam.date" :editable="false"
  1701. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1702. :clearable="true"
  1703. :range-separator="$t('other.to')"
  1704. type="daterange"
  1705. :start-placeholder="$t('time.startDate')"
  1706. :end-placeholder="$t('time.endDate')"
  1707. ></el-date-picker>
  1708. </div>
  1709. <div style="margin-top:10px;">
  1710. <span>请选择部门:</span>
  1711. <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>
  1712. <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>
  1713. </div>
  1714. <div style="margin-top:10px;">
  1715. <span>请选择员工:</span>
  1716. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1717. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1718. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1719. <span v-else>{{item.name}}</span>
  1720. </el-option>
  1721. </el-select>
  1722. </div>
  1723. <span slot="footer">
  1724. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1725. </span>
  1726. </el-dialog>
  1727. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1728. <div>
  1729. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1730. v-model="deleteReportParam.date" :editable="false"
  1731. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1732. :clearable="true"
  1733. :range-separator="$t('other.to')"
  1734. type="daterange"
  1735. :start-placeholder="$t('time.startDate')"
  1736. :end-placeholder="$t('time.endDate')"
  1737. ></el-date-picker>
  1738. </div>
  1739. <div style="margin-top:15px;">
  1740. <span>选择部门:</span>
  1741. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1742. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1743. size="small" v-if="user.userNameNeedTranslate != 1"
  1744. ></el-cascader>
  1745. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1746. </div>
  1747. <span slot="footer">
  1748. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1749. </span>
  1750. </el-dialog>
  1751. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1752. <div>
  1753. <span>选择时间:</span><el-date-picker
  1754. v-model="modImportTime"
  1755. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1756. :clearable="true"
  1757. type="datetime"
  1758. ></el-date-picker>
  1759. <span>选择导入人员:</span><el-select
  1760. v-model="modImportUserId"
  1761. >
  1762. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1763. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1764. <span v-else>{{item.name}}</span>
  1765. </el-option>
  1766. </el-select>
  1767. </div>
  1768. <span slot="footer">
  1769. <el-button @click="confirmChangeModTime" >确认</el-button>
  1770. </span>
  1771. </el-dialog>
  1772. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1773. <div>
  1774. <span>请选择年月:</span>
  1775. <el-date-picker
  1776. v-model="ratioYmonth" :editable="false"
  1777. format="yyyyMM" value-format="yyyyMM"
  1778. type="month"
  1779. ></el-date-picker>
  1780. </div>
  1781. <span slot="footer">
  1782. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1783. </span>
  1784. </el-dialog>
  1785. <!--工时批量代填 -->
  1786. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1787. <div>
  1788. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1789. v-model="importWxParam.date" :editable="false"
  1790. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1791. :clearable="true"
  1792. :range-separator="$t('other.to')"
  1793. type="daterange"
  1794. :start-placeholder="$t('time.startDate')"
  1795. :end-placeholder="$t('time.endDate')"
  1796. @change="loadCheckInData"
  1797. ></el-date-picker>
  1798. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1799. </div>
  1800. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1801. :key="timeStamp"
  1802. style="width: 100%;margin-top:5px;" ref="tab">
  1803. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1804. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1805. <template slot-scope="scope">
  1806. <div>
  1807. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1808. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1809. </div>
  1810. </template>
  1811. </el-table-column>
  1812. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1813. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1814. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1815. <template slot-scope="scope">
  1816. {{scope.row.workHours.toFixed(1)}}h
  1817. </template>
  1818. </el-table-column>
  1819. <!--项目名称列表 -->
  1820. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1821. <template slot-scope="scope">
  1822. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1823. </template>
  1824. </el-table-column>
  1825. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1826. <template slot-scope="scope">
  1827. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1828. </template>
  1829. </el-table-column>
  1830. </el-table>
  1831. </el-dialog>
  1832. <!--基于企业微信考勤数据的工时导入 -->
  1833. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1834. <div style="padding-bottom:10px;">
  1835. <p>{{importResultMsg}}</p>
  1836. </div>
  1837. <!-- <span slot="footer" class="dialog-footer">
  1838. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1839. </span> -->
  1840. </el-dialog>
  1841. <!-- 审核流程展示 -->
  1842. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1843. <div style="padding:20px 40px 20px 0">
  1844. <el-timeline :reverse="false">
  1845. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1846. <!-- {{item.msg}} -->
  1847. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1848. <span v-if="user.userNameNeedTranslate == 1">
  1849. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1850. <span>{{item.msgCon.two}}</span>
  1851. </span>
  1852. </el-timeline-item>
  1853. </el-timeline>
  1854. </div>
  1855. </el-dialog>
  1856. </section>
  1857. </template>
  1858. <script>
  1859. // 左右滑动
  1860. import dragMixin from "@/common/js/tensile.js";
  1861. import util from "../../common/js/util";
  1862. // 自定义select组件
  1863. import selectCat from "@/components/select.vue"
  1864. // 引入自定义级联组件
  1865. import vueCascader from "@/components/cascader.vue"
  1866. // 重庆物奇定制组件
  1867. import WeeklyCustomization from "./weeklyCustomization.vue"
  1868. import { mapMutations } from 'vuex'
  1869. let _that = this
  1870. export default {
  1871. mixins: [dragMixin],
  1872. components: {
  1873. selectCat,
  1874. vueCascader,
  1875. WeeklyCustomization
  1876. },
  1877. data() {
  1878. return {
  1879. exportType: 0,
  1880. exportingData: false,
  1881. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1882. jobResponseList:[],
  1883. yisibeiCompId: 3092,
  1884. yuzhongCompId: 3385,
  1885. mingyiName : '成都明夷电子科技有限公司',
  1886. // mingyiName : '明夷',
  1887. modItemDataId: null,
  1888. modImportTime: null,
  1889. modImportUserId: null,
  1890. showModImportTimeDialog: false,
  1891. showBatchSimpleApproveReport: false,
  1892. startDeleting: false,
  1893. showBatchDeleteReport: false,
  1894. deleteReportParam: {date:null, userIds:[]},
  1895. isDenying: false,
  1896. targetWeekDate: null,//填写周报中的周日期
  1897. importCardTimeVisi: false,
  1898. startRatioExporting: false,
  1899. exportUserRatio: false,
  1900. ratioYmonth:null,
  1901. hasWrittenReport: false,
  1902. today:null,
  1903. syncTimeLoading: false,
  1904. seluserText: '',
  1905. translation: '1', // 1、文字, 2、部门, 3、人员
  1906. exportLoad: false,
  1907. getPickerOptions: {
  1908. disabledDate: (time) => {
  1909. var date = new Date();
  1910. var year = date.getFullYear();
  1911. var month = date.getMonth() + 1;
  1912. if (month >= 1 && month <= 9) {
  1913. month = "0" + month;
  1914. }
  1915. var currentdate = year.toString() + month.toString();
  1916. var timeyear = time.getFullYear();
  1917. var timemonth = time.getMonth() + 1;
  1918. if (timemonth >= 1 && timemonth <= 9) {
  1919. timemonth = "0" + timemonth;
  1920. }
  1921. var timedate = timeyear.toString() + timemonth.toString();
  1922. if(this.user.timeType.fillAhead == 0){
  1923. return currentdate < timedate;
  1924. }else{
  1925. return false
  1926. }
  1927. }
  1928. },
  1929. alalal: '8.0',
  1930. timeBasecostList:null,
  1931. tbload: false,
  1932. exportTimeDialog: false,
  1933. searchKeyword: '',
  1934. monthWorkDataS: [],
  1935. monthNotWorkDateS: [],
  1936. pickDateArray:[],
  1937. WorktimeDatepickValue: [],
  1938. activeName:"first",
  1939. isLeave: 0,
  1940. submitingReport: false,
  1941. importResultMsg:null,
  1942. showImportResult:false,
  1943. importingData: false,
  1944. isDraft: 0,
  1945. timeStamp: 0,
  1946. projectColumns:[],
  1947. checkinLoading:false,
  1948. importWxParam:{date:null,},
  1949. active:0,
  1950. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1951. importWxDialog:false,
  1952. importDialog:false,
  1953. denyForm:null,
  1954. denyReasonDialog:false,
  1955. monthWorkTimeDialog: false,
  1956. isSubstitude:false,
  1957. isFill:false,
  1958. unFillList:[],
  1959. fillList:[],
  1960. fillMembList:[],
  1961. fillMembList_leave: [],
  1962. membListVisible: false,
  1963. isBatch:0,//是否是批量填报
  1964. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1965. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1966. 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')],
  1967. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1968. fillStatusList: [],
  1969. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1970. exportDialog:false,
  1971. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1972. subProjectList:[],
  1973. canEdit: true,
  1974. originCanEdit: true,
  1975. 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],
  1976. selectTime:null,
  1977. reportTimeType:{},
  1978. curDate:'',
  1979. isAllSelect: false,
  1980. approveDialogVisible:false,
  1981. deptId:null,
  1982. targetUid: null,
  1983. membCount:0,
  1984. selectState:"-1",
  1985. user: JSON.parse(sessionStorage.getItem("user")),
  1986. allUsersList: [],
  1987. showAddMore:false,
  1988. allDate: [],
  1989. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1990. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1991. choseDay: 0,
  1992. tableHeight: 0,
  1993. listLoading: false,
  1994. projectList: [], //项目列表
  1995. fillProjectList: [],
  1996. reportList: [], //日报列表
  1997. reportNames:[], //批量审批列表
  1998. selCon:[], //筛选条件
  1999. selProjectList:[], //筛选后项目列表
  2000. selConShow: true,
  2001. usersList: [], // 全部人员列表
  2002. usersListId: '', // 选中的人员id
  2003. dialogVisible: false, //项目弹窗
  2004. report: '',
  2005. workForm: {
  2006. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2007. domains: [{
  2008. id: null,
  2009. projectId: "",
  2010. workingTime: "",
  2011. timeType:0,
  2012. content: "",
  2013. state: 2,
  2014. multiWorktime:0,
  2015. worktimeList:[],
  2016. degreeId: null,
  2017. auditUserList: [],
  2018. }],
  2019. },
  2020. workRules: {
  2021. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2022. },
  2023. chooseParticipVisible: false,
  2024. logining: false,
  2025. isDisable: false,
  2026. timeType:[],
  2027. deptMembData: [
  2028. ],
  2029. //部门人员树状结构
  2030. data: [
  2031. {
  2032. id: -1,
  2033. label: this.$t('lable.allStaff'),
  2034. membCount:0
  2035. },
  2036. {
  2037. id: 0,
  2038. label: this.$t('lable.unassigned'),
  2039. }
  2040. ],
  2041. allData:{},
  2042. batchShowData:{},
  2043. option: [],
  2044. deptOptionList: [],
  2045. depData: {
  2046. id: -1,
  2047. label: this.$t('lable.allStaff'),
  2048. },
  2049. defaultProps: {
  2050. children: 'children',
  2051. label: 'label'
  2052. },
  2053. isNew: false,
  2054. selected: false,
  2055. valuet: new Date(),
  2056. domObj: null,
  2057. participator:[],
  2058. chosenMembCount:0,
  2059. jsDay: 0,
  2060. jsTime: 0,
  2061. falsss: false,
  2062. weidu: [],
  2063. weiduList: [],
  2064. yonghuUser: [],
  2065. dateAr: [],
  2066. batchSubFillDialog: false,
  2067. isSubstiS: false,
  2068. fillWeekDialogVisi: false,
  2069. fillWeekDialogVisiCustom: false,
  2070. zhoData: [],
  2071. weekDateRange: [],
  2072. btnZho: false,
  2073. weekDataLoading: false,
  2074. changdu: 6,
  2075. tianxieDialogVisible: false,
  2076. scopess: {},
  2077. zhoBao: {
  2078. time: '',
  2079. workingTime: '',
  2080. progress: '',
  2081. con: '',
  2082. subProjectId: '',
  2083. stage: '',
  2084. subProjectList: [],
  2085. stages: [],
  2086. },
  2087. zhoBaoIdx: '',
  2088. zhoBaoName: '',
  2089. zhis: {},
  2090. dealList: [],
  2091. toViewDialogVisible: false,
  2092. toViewList: [],
  2093. toViewloading: true,
  2094. toViewForm: {
  2095. pageIndex: '1',
  2096. pageSize: '20',
  2097. total: 0,
  2098. },
  2099. toViewloadings: false,
  2100. tabPositionss: 'top',
  2101. monthTotal: 0,
  2102. monthTotalPage: 0,
  2103. monthTotalLages: 20,
  2104. monthWorkData: [],
  2105. monthNotWorkDate: [],
  2106. monthWorkDataS1: [],
  2107. monthnotTotal: 0,
  2108. monthnotTotalPage: 0,
  2109. monthnotTotalLages: 20,
  2110. monthNotWorkDateS1: [],
  2111. deptMembDataText: '',
  2112. isFlag: false,
  2113. isMore: false,
  2114. stateKey: '0',
  2115. expandDate: [],
  2116. notifySelList:[],
  2117. departmentList: [],
  2118. approvalProcessDialog: false,
  2119. approvalProcessData: [],
  2120. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2121. 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')],
  2122. isWeekend: false,
  2123. canCancelInDialog: false,
  2124. approveinData: {},
  2125. approveinDialog: false,
  2126. reportCanDelete: false,
  2127. weeklyFilledTimeDialog: false,
  2128. weeklyFilledTimeList: [],
  2129. weeklyFilledTimeLoading: false,
  2130. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2131. weeklyFilledTimeCanDelete: false,
  2132. weeklyFilledTimeDate: null,
  2133. leaveAllNum: 0,
  2134. dataLoading: false,
  2135. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2136. vacationTime: {},
  2137. integrationProjectList: [],
  2138. totalReportHours: 0, // 合计的工时
  2139. workTimeForMinYi:0,
  2140. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2141. weekIndex: 1,
  2142. weekParentData: {},
  2143. deptIdForNoReport:[],
  2144. nameAearch: '', // 企业微信姓名搜索
  2145. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2146. deptMembDataLoading: false,
  2147. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2148. {
  2149. id: 4811,
  2150. // id: 10,
  2151. name: '陕西柘中建设工程有限公司'
  2152. }
  2153. ],
  2154. pushWorkTimeLogDig:false,
  2155. pushWorkTimeLogData:[],
  2156. };
  2157. },
  2158. watch: {
  2159. deptMembDataText(val) {
  2160. this.$refs.chooseMembTree.filter(val);
  2161. }
  2162. },
  2163. filters: {
  2164. // 过滤
  2165. amounts(value) {
  2166. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2167. return 0
  2168. }
  2169. var zhi = +value + 0
  2170. return zhi.toFixed(1)
  2171. },
  2172. // zhoData
  2173. zhoData(value, arr) {
  2174. var dateArray = value.split("-");
  2175. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2176. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2177. // console.log(arr[date.getDay()])
  2178. // return "周" + "日一二三四五六".charAt(date.getDay());
  2179. return arr[date.getDay()]
  2180. },
  2181. // 过滤数字
  2182. numbers(value) {
  2183. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2184. return 0
  2185. }
  2186. return value
  2187. },
  2188. },
  2189. computed: {},
  2190. mounted() {
  2191. var now = new Date();
  2192. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2193. this.today = t;
  2194. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2195. this.exportParam.dateRange = [startStr,t];
  2196. this.getAllDate(1);
  2197. this.getReportList();
  2198. this.getProjectList();
  2199. this.getFillProjectList();
  2200. this.getTimeType();
  2201. this.getDepartment();
  2202. this.scrollFunction()
  2203. this.userssHu();
  2204. if(this.user.timeType.reportAuditType == 3){
  2205. this.getAllUsersList()
  2206. }
  2207. if (this.user.company.packageProject == 1) {
  2208. this.getBasecostItemList();
  2209. }
  2210. if(this.user.timeType.lockWorktime){
  2211. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2212. }
  2213. //设置了下限
  2214. if (this.user.timeType.minReportTime) {
  2215. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2216. }
  2217. const that = this
  2218. if(this.user.userNameNeedTranslate == 1) {
  2219. that.dataLoading = that.$store.state.dataLoading
  2220. this.upDataLoading()
  2221. setTimeout(()=>{
  2222. that.dataLoading = that.$store.state.dataLoading
  2223. }, 1000)
  2224. }
  2225. if (this.user.companyId == this.yuzhongCompId) {
  2226. this.getJobResponList();
  2227. }
  2228. },
  2229. methods: {
  2230. ...mapMutations(['upDataLoading']),
  2231. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2232. isCustomization(userInfo, permissionArray) {
  2233. const { companyId } = userInfo
  2234. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2235. return isReportPictureRequired
  2236. },
  2237. //任务被选中
  2238. onTaskSelected(domainItem) {
  2239. //取服务
  2240. if (domainItem.taskId) {
  2241. var that = this;
  2242. var param = {taskId:domainItem.taskId};
  2243. if (this.isSubstitude) {
  2244. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2245. param.userId = this.workForm.userId[0];
  2246. }
  2247. }
  2248. this.http.post('/task/getMyTaskService',param, res => {
  2249. if (res.code == "ok") {
  2250. // domainItem.workContentList = res.data;
  2251. that.$set(domainItem, 'sapServiceId', null);
  2252. that.$set(domainItem, 'serviceList', res.data);
  2253. } else {
  2254. this.$message({
  2255. message: res.msg,
  2256. type: "error"
  2257. });
  2258. }
  2259. },error => {
  2260. this.$message({
  2261. message: error,
  2262. type: "error"
  2263. });
  2264. }
  2265. );
  2266. } else {
  2267. //清空服务
  2268. }
  2269. },
  2270. onBatchTimeChange() {
  2271. //反向计算每日工作时长
  2272. if (this.workForm.createDate) {
  2273. let sdate = new Date(this.workForm.createDate[0]);
  2274. let edate = new Date(this.workForm.createDate[1]);
  2275. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2276. console.log('days===', days)
  2277. if (days < 0) {
  2278. return;
  2279. }
  2280. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2281. //总时长发生改变,自动按比例计算
  2282. this.workForm.domains.forEach(d=>{
  2283. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2284. });
  2285. }
  2286. },
  2287. //更新工作内容列表
  2288. updateJobContent(domainItem) {
  2289. var that = this;
  2290. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2291. if (res.code == "ok") {
  2292. // domainItem.workContentList = res.data;
  2293. that.$set(domainItem, 'extraField3', null);
  2294. that.$set(domainItem, 'workContentList', res.data);
  2295. } else {
  2296. this.$message({
  2297. message: res.msg,
  2298. type: "error"
  2299. });
  2300. }
  2301. },error => {
  2302. this.$message({
  2303. message: error,
  2304. type: "error"
  2305. });
  2306. }
  2307. );
  2308. },
  2309. updateResponse(domainItem) {
  2310. var that = this;
  2311. var selectPid = domainItem.projectId;
  2312. domainItem.extraField2 = null;
  2313. domainItem.extraField3 = null;
  2314. if (selectPid && domainItem.extraField1) {
  2315. //是否非项目
  2316. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2317. console.log('==========','isPublic=='+isPublic);
  2318. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2319. console.log(filteredRespList);
  2320. domainItem.filteredRespList = filteredRespList;
  2321. }
  2322. },
  2323. getJobResponList() {
  2324. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2325. if (res.code == "ok") {
  2326. this.jobResponseList = res.data;
  2327. } else {
  2328. this.$message({
  2329. message: res.msg,
  2330. type: "error"
  2331. });
  2332. }
  2333. },error => {
  2334. this.$message({
  2335. message: error,
  2336. type: "error"
  2337. });
  2338. }
  2339. );
  2340. },
  2341. openModImportTime(row) {
  2342. this.showModImportTimeDialog = true;
  2343. this.modItemDataId = row.id;
  2344. },
  2345. delImportTime(row) {
  2346. let rowId = row.id;
  2347. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2348. confirmButtonText: this.$t('btn.determine'),
  2349. cancelButtonText: this.$t('btn.cancel'),
  2350. type: "warning"
  2351. })
  2352. .then(() => {
  2353. this.http.post('/report-import-log/delete',{
  2354. id: rowId
  2355. },res => {
  2356. if (res.code == "ok") {
  2357. this.$message({
  2358. message: '删除成功',
  2359. type: "success"
  2360. });
  2361. this.getToView();
  2362. } else {
  2363. this.$message({
  2364. message: res.msg,
  2365. type: "error"
  2366. });
  2367. }
  2368. },error => {
  2369. this.$message({
  2370. message: error,
  2371. type: "error"
  2372. });
  2373. }
  2374. );
  2375. }).catch(() => {this.startDeleting = false});
  2376. },
  2377. confirmChangeModTime() {
  2378. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2379. this.$message({
  2380. message: '请选择时间',
  2381. type: "error"
  2382. });
  2383. return;
  2384. }
  2385. this.http.post('/report-import-log/changeTime',{
  2386. modLogDateTime: this.modImportTime,
  2387. modImportUserId: this.modImportUserId,
  2388. id: this.modItemDataId
  2389. },res => {
  2390. if (res.code == "ok") {
  2391. this.$message({
  2392. message: '修改成功',
  2393. type: "success"
  2394. });
  2395. this.getToView();
  2396. this.showModImportTimeDialog = false;
  2397. } else {
  2398. this.$message({
  2399. message: res.msg,
  2400. type: "error"
  2401. });
  2402. }
  2403. },error => {
  2404. this.$message({
  2405. message: error,
  2406. type: "error"
  2407. });
  2408. }
  2409. );
  2410. },
  2411. confirmBatchApproveReport() {
  2412. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2413. this.$message({
  2414. message: '请选择日期范围',
  2415. type: "error"
  2416. });
  2417. return;
  2418. }
  2419. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2420. confirmButtonText: this.$t('btn.determine'),
  2421. cancelButtonText: this.$t('btn.cancel'),
  2422. type: "warning"
  2423. })
  2424. .then(() => {
  2425. this.startDeleting = true;
  2426. let obj = {
  2427. startDate: this.deleteReportParam.date[0],
  2428. endDate: this.deleteReportParam.date[1]
  2429. }
  2430. if(this.deleteReportParam.departmentId) {
  2431. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2432. } else {
  2433. obj.departmentId = null
  2434. }
  2435. this.http.post('/report/batchApproveByDate',obj,res => {
  2436. if (res.code == "ok") {
  2437. this.$message({
  2438. message: '审核通过',
  2439. type: "success"
  2440. });
  2441. this.getReportList();
  2442. this.getDepartment();
  2443. this.startDeleting = false;
  2444. } else {
  2445. this.$message({
  2446. message: res.msg,
  2447. type: "error"
  2448. });
  2449. }
  2450. },error => {
  2451. this.$message({
  2452. message: error,
  2453. type: "error"
  2454. });
  2455. }
  2456. );
  2457. }).catch(() => {this.startDeleting = false});
  2458. },
  2459. confirmBatchDelReport() {
  2460. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2461. this.$message({
  2462. message: '请选择部门或人员',
  2463. type: "error"
  2464. });
  2465. return;
  2466. }
  2467. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2468. this.$message({
  2469. message: '请选择日期范围',
  2470. type: "error"
  2471. });
  2472. return;
  2473. }
  2474. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2475. confirmButtonText: this.$t('btn.determine'),
  2476. cancelButtonText: this.$t('btn.cancel'),
  2477. type: "warning"
  2478. })
  2479. .then(() => {
  2480. this.startDeleting = true;
  2481. this.http.post('/report/batchDelete',{
  2482. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2483. startDate: this.deleteReportParam.date[0],
  2484. endDate: this.deleteReportParam.date[1],
  2485. deptId: this.deleteReportParam.deptId[0]
  2486. },res => {
  2487. if (res.code == "ok") {
  2488. this.$message({
  2489. message: this.$t('message.successfullyDeleted'),
  2490. type: "success"
  2491. });
  2492. this.getReportList();
  2493. this.getDepartment();
  2494. this.startDeleting = false;
  2495. } else {
  2496. this.$message({
  2497. message: res.msg,
  2498. type: "error"
  2499. });
  2500. }
  2501. },error => {
  2502. this.$message({
  2503. message: error,
  2504. type: "error"
  2505. });
  2506. }
  2507. );
  2508. }).catch(() => {this.startDeleting = false});
  2509. },
  2510. getRecentlyProject() {
  2511. this.http.post('/project/nearProject',{},res => {
  2512. if(res.code == 'ok'){
  2513. let topObj = {
  2514. label: '最近选择项目',
  2515. peojectList: res.data
  2516. }
  2517. let botomObj = {
  2518. label: '全部项目',
  2519. peojectList: this.fillProjectList
  2520. }
  2521. //最近项目如果在fillProjectList中不存在,需要移除
  2522. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2523. this.integrationProjectList = [topObj, botomObj]
  2524. }else {
  2525. this.$message({
  2526. message: res.msg,
  2527. type: 'error'
  2528. })
  2529. }
  2530. },err => {
  2531. this.$message({
  2532. message: err,
  2533. type: 'error'
  2534. })
  2535. })
  2536. },
  2537. handlePictureCardPreview(file, index) {
  2538. console.log(file, index)
  2539. let arr = []
  2540. let imgArr = this.workForm.domains[index].imgListUrl
  2541. for(var i in imgArr) {
  2542. arr.push(imgArr[i].url)
  2543. }
  2544. console.log(arr, '图片数据')
  2545. const $viewer = this.$viewerApi({
  2546. images: arr
  2547. });
  2548. },
  2549. // 图片上传
  2550. addImg(e, index) {
  2551. console.log(e, '数据')
  2552. let formData = new FormData()
  2553. formData.append('multipartFile', e.file)
  2554. this.http.uploadFile('/common/uploadFile', formData,
  2555. res => {
  2556. if (res.code == "ok") {
  2557. this.$message({
  2558. message: this.$t('uploadedsuccessfully'),
  2559. type: "success"
  2560. });
  2561. if(!this.workForm.domains[index].imgList) {
  2562. this.workForm.domains[index].imgList = []
  2563. this.workForm.domains[index].imgListUrl = []
  2564. }
  2565. this.workForm.domains[index].imgList.push(res.data)
  2566. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2567. } else {
  2568. this.$message({message: res.msg,type: "error"});
  2569. }
  2570. console.log(this.workForm.domains[index])
  2571. },
  2572. error => {this.$message({message: error,type: "error"});
  2573. });
  2574. },
  2575. // 删除图片
  2576. delImg(file,fileList, index) {
  2577. console.log(file, fileList)
  2578. let idx = 0
  2579. for(let i in fileList) {
  2580. if(fileList[i].uid == file.uid) {
  2581. idx = i
  2582. }
  2583. }
  2584. this.workForm.domains[index].imgList.splice(idx, 1)
  2585. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2586. console.log(this.workForm.domains[index])
  2587. },
  2588. test(){
  2589. console.log('test',this.workForm.domains);
  2590. },
  2591. getHour(s1, s2) {
  2592. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2593. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2594. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2595. var ms = s2.getTime() - s1.getTime();
  2596. if (ms < 0) return 0;
  2597. let ma = ms / 1000 / 60 / 60
  2598. return ma; //小时
  2599. },
  2600. refreshWXCardTime(workdate) {
  2601. if (!workdate) return;
  2602. this.syncTimeLoading = true;
  2603. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2604. date: workdate,
  2605. },res => {
  2606. this.syncTimeLoading = false;
  2607. if(res.code == 'ok'){
  2608. this.workForm.time = res.data.time;
  2609. }else {
  2610. this.$message({
  2611. message: res.msg,
  2612. type: 'error'
  2613. })
  2614. }
  2615. },err => {
  2616. this.syncTimeLoading = false;
  2617. this.$message({
  2618. message: err,
  2619. type: 'error'
  2620. })
  2621. })
  2622. },
  2623. refreshAttendance(workdate) {
  2624. if (!workdate) return;
  2625. this.syncTimeLoading = true;
  2626. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2627. startDate: workdate[0],
  2628. endDate: workdate[1]
  2629. },res => {
  2630. this.syncTimeLoading = false;
  2631. if(res.code == 'ok'){
  2632. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2633. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2634. this.totalReportHours = this.workTimeForMinYi;
  2635. }else {
  2636. this.$message({
  2637. message: res.msg,
  2638. type: 'error'
  2639. })
  2640. }
  2641. },err => {
  2642. this.syncTimeLoading = false;
  2643. this.$message({
  2644. message: err,
  2645. type: 'error'
  2646. })
  2647. })
  2648. },
  2649. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2650. this.weeklyFilledTimeDialog = true
  2651. this.weeklyFilledTimeLoading = true
  2652. this.weeklyFilledTimeDate = parameterDate
  2653. this.http.post('/report/getReportList',{
  2654. date: parameterDate,
  2655. userId: this.user.id
  2656. },res => {
  2657. this.weeklyFilledTimeLoading = false
  2658. if(res.code == 'ok'){
  2659. this.weeklyFilledTimeList = res.data[0].data
  2660. let candelete = true
  2661. for(let i in this.weeklyFilledTimeList){
  2662. if(this.weeklyFilledTimeList[i].state < 2){
  2663. candelete = false
  2664. }
  2665. }
  2666. this.weeklyFilledTimeCanDelete = candelete
  2667. }else {
  2668. this.$message({
  2669. message: res.msg,
  2670. type: 'error'
  2671. })
  2672. }
  2673. },err => {
  2674. this.weeklyFilledTimeLoading = false
  2675. this.$message({
  2676. message: err,
  2677. type: 'error'
  2678. })
  2679. })
  2680. },
  2681. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2682. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2683. confirmButtonText: this.$t('btn.determine'),
  2684. cancelButtonText: this.$t('btn.cancel'),
  2685. type: "warning"
  2686. })
  2687. .then(() => {
  2688. this.http.post('/report/delete',{
  2689. userId: this.user.id,
  2690. date: this.weeklyFilledTimeDate
  2691. },res => {
  2692. if (res.code == "ok") {
  2693. this.$message({
  2694. message: this.$t('message.successfullyDeleted'),
  2695. type: "success"
  2696. });
  2697. this.getWeeklyWorkTime()
  2698. this.getReportList();
  2699. this.getDepartment();
  2700. this.weeklyFilledTimeDialog = false;
  2701. } else {
  2702. this.$message({
  2703. message: res.msg,
  2704. type: "error"
  2705. });
  2706. }
  2707. },error => {
  2708. this.$message({
  2709. message: error,
  2710. type: "error"
  2711. });
  2712. }
  2713. );
  2714. }).catch(() => {});
  2715. },
  2716. getApprovalProcess(item){
  2717. // console.log('this.date',this.choseDate);
  2718. this.http.post('/report-log/get',{
  2719. creatorId: item.id,
  2720. createDate: sessionStorage.msg
  2721. },res => {
  2722. if(res.code == 'ok'){
  2723. this.approvalProcessDialog = true
  2724. if(this.user.userNameNeedTranslate == 1) {
  2725. for(var i in res.data) {
  2726. let obj = {
  2727. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2728. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2729. }
  2730. res.data[i].msgCon = obj
  2731. }
  2732. }
  2733. this.approvalProcessData = res.data
  2734. console.log(this.approvalProcessData, '数据卡看')
  2735. }else{
  2736. this.$message({
  2737. message: res.msg,
  2738. type: 'error'
  2739. })
  2740. }
  2741. },err => {
  2742. this.$message({
  2743. message: err,
  2744. type: 'error'
  2745. })
  2746. })
  2747. },
  2748. filterNode(value, data) {
  2749. if (!value) return true;
  2750. return data.label.indexOf(value) !== -1;
  2751. },
  2752. triggerCalculateOT(index) {
  2753. var str = this.workForm.domains[index].overtimeHours + ''
  2754. if(str.indexOf('.') != '-1') {
  2755. var s = str.split('.')[0]
  2756. var st = str.split('.')[1]
  2757. var sts = st.split('')
  2758. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2759. }
  2760. },
  2761. searchScreen(e){
  2762. if(e){
  2763. this.monthNotWorkDateS1 = []
  2764. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2765. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2766. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2767. }
  2768. }
  2769. if (this.monthNotWorkDateS1.length > 50) {
  2770. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2771. }else{
  2772. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2773. }
  2774. // if (this.monthNotWorkDateS1.length > 0) {
  2775. // setTimeout(() => {
  2776. // this.tableListenernot()
  2777. // }, 1000);
  2778. // }
  2779. }else{
  2780. this.monthWorkDataS1 = []
  2781. for (let i = 0; i < this.monthWorkData.length; i++) {
  2782. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2783. this.monthWorkDataS1.push(this.monthWorkData[i])
  2784. }
  2785. }
  2786. if (this.monthWorkDataS1.length > 50) {
  2787. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2788. }else{
  2789. this.monthWorkDataS = this.monthWorkDataS1
  2790. }
  2791. // if (this.monthWorkDataS1.length > 0) {
  2792. // setTimeout(() => {
  2793. // this.tableListener()
  2794. // }, 1000);
  2795. // }
  2796. }
  2797. },
  2798. addUpload(data) {
  2799. // var zhi = data.fileName.split('.')[0]
  2800. // var sss = zhi + '.xlsx'
  2801. // return
  2802. var filePath = '/upload/' + data.serverName;
  2803. const a = document.createElement('a'); // 创建a标签
  2804. a.setAttribute('download', data.fileName);// download属性
  2805. a.setAttribute('href', filePath);// href链接
  2806. a.click(); //自执行点击事件
  2807. a.remove();
  2808. },
  2809. restrictNumber(targetId) {
  2810. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2811. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2812. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2813. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2814. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2815. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2816. inpu.value = parseFloat(inpu.value);
  2817. }
  2818. },
  2819. //获取项目下的任务分组
  2820. getTaskGroups(domain, index) {
  2821. domain.groupId=null;
  2822. this.http.post('/task-group/listMyJoinGroup',{
  2823. projectId: domain.projectId,
  2824. isSubstitude: this.isSubstitude ? 1 : 0
  2825. },
  2826. res => {
  2827. if (res.code == "ok") {
  2828. this.workForm.domains[index].taskGroups = res.data;
  2829. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2830. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2831. // this.getGroupStages(domain, index);
  2832. // }
  2833. this.$forceUpdate();
  2834. }
  2835. },
  2836. error => {
  2837. this.$message({
  2838. message: error,
  2839. type: "error"
  2840. });
  2841. }
  2842. );
  2843. },
  2844. //下载填报工时占比报表
  2845. downloadProjectRatio() {
  2846. this.exportUserRatio = true;
  2847. // let now = new Date();
  2848. // let month = now.getMonth();//默认看上个月的
  2849. // let monthStr = month<10? ('0'+month): month;
  2850. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2851. const today = new Date();
  2852. const year = today.getFullYear();
  2853. const month = today.getMonth() + 1;
  2854. let lastMonthYear, lastMonth;
  2855. if (month === 1) {
  2856. lastMonthYear = year - 1;
  2857. lastMonth = 12;
  2858. } else {
  2859. lastMonthYear = year;
  2860. lastMonth = month - 1;
  2861. }
  2862. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2863. console.log('赋值 ==>', this.ratioYmonth)
  2864. },
  2865. confirmDownloadRatio() {
  2866. this.startRatioExporting = true;
  2867. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2868. ymonth: this.ratioYmonth
  2869. },
  2870. res => {
  2871. if (res.code == "ok") {
  2872. this.startRatioExporting = false;
  2873. var filePath = res.data;
  2874. const a = document.createElement('a'); // 创建a标签
  2875. var data = filePath.split("/");
  2876. a.setAttribute('download', data[data.length-1]);// download属性
  2877. a.setAttribute('href', filePath);// href链接
  2878. a.click(); //自执行点击事件
  2879. a.remove();
  2880. } else {
  2881. this.startRatioExporting = false;
  2882. this.$message({
  2883. message: res.msg,
  2884. type: "error"
  2885. });
  2886. }
  2887. },
  2888. error => {
  2889. this.checkinLoading = false;
  2890. this.$message({
  2891. message: error,
  2892. type: "error"
  2893. });
  2894. }
  2895. );
  2896. },
  2897. //下载带企业微信考勤数据的工时统计模板
  2898. downloadCheckInExcel() {
  2899. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2900. startDate: this.importWxParam.date[0],
  2901. endDate: this.importWxParam.date[1],
  2902. },
  2903. res => {
  2904. if (res.code == "ok") {
  2905. var filePath = res.data;
  2906. const a = document.createElement('a'); // 创建a标签
  2907. var data = filePath.split("/");
  2908. a.setAttribute('download', data[data.length-1]);// download属性
  2909. a.setAttribute('href', filePath);// href链接
  2910. a.click(); //自执行点击事件
  2911. a.remove();
  2912. } else {
  2913. this.$message({
  2914. message: res.msg,
  2915. type: "error"
  2916. });
  2917. }
  2918. },
  2919. error => {
  2920. this.checkinLoading = false;
  2921. this.$message({
  2922. message: error,
  2923. type: "error"
  2924. });
  2925. }
  2926. );
  2927. },
  2928. pre() {
  2929. if (this.active == 0) return;
  2930. this.active--;
  2931. },
  2932. next() {
  2933. this.active++;
  2934. },
  2935. triggerTotalTime(index) {
  2936. var item = this.checkinList[index];
  2937. var total = 0.0;
  2938. for (var i=0;i<this.projectColumns.length; i++) {
  2939. var key = this.projectColumns[i];
  2940. if (item[key] != null && item[key] != '') {
  2941. total += parseFloat(item[key]);
  2942. }
  2943. }
  2944. item.totalFillTime = total;
  2945. },
  2946. //提交批量代填的数据
  2947. submitBatchSubFillData() {
  2948. var data = JSON.stringify(this.checkinList);
  2949. this.http.post('/user-corpwx-time/submitProjectTime',{
  2950. json: data,
  2951. projectColumns: JSON.stringify(this.projectColumns)
  2952. },
  2953. res => {
  2954. if (res.code == "ok") {
  2955. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2956. this.importWxDialog = false;
  2957. }
  2958. },
  2959. error => {
  2960. this.checkinLoading = false;
  2961. this.$message({
  2962. message: error,
  2963. type: "error"
  2964. });
  2965. }
  2966. );
  2967. },
  2968. loadCheckInData() {
  2969. if (this.importWxParam.date == null) {
  2970. this.checkinList = [];
  2971. return;
  2972. }
  2973. this.checkinLoading = true;
  2974. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2975. startDate: this.importWxParam.date[0],
  2976. endDate: this.importWxParam.date[1],
  2977. },
  2978. res => {
  2979. if (res.code == "ok") {
  2980. this.checkinLoading = false;
  2981. this.checkinList = res.data.list;
  2982. this.projectColumns = res.data.projects;
  2983. // 自定义表格会导致表格错乱,需重新计算表格
  2984. this.$nextTick(()=>{
  2985. this.$refs.tab.doLayout()
  2986. })
  2987. }
  2988. },
  2989. error => {
  2990. this.checkinLoading = false;
  2991. this.$message({
  2992. message: error,
  2993. type: "error"
  2994. });
  2995. }
  2996. );
  2997. },
  2998. importCardTime(item) {
  2999. //首先判断文件类型
  3000. let str = item.file.name.split(".");
  3001. let format = str[str.length - 1];
  3002. if (format != "xls" && format != "xlsx") {
  3003. this.$message({
  3004. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3005. type: "error"
  3006. });
  3007. } else {
  3008. this.importingData = true;
  3009. let formData = new FormData();
  3010. formData.append("multipartFile", item.file);
  3011. formData.append("companyId", this.user.companyId);
  3012. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3013. res => {
  3014. this.$refs.uploadCardTime.clearFiles();
  3015. this.importingData = false;
  3016. if (res.code == "ok") {
  3017. //换成弹出框,以免有人等了半天回来啥也没看到
  3018. this.$message({
  3019. message: '导入考勤时长成功',
  3020. type: "success"
  3021. });
  3022. } else {
  3023. this.$message({
  3024. message: res.msg,
  3025. type: "error"
  3026. });
  3027. }
  3028. },
  3029. error => {
  3030. this.$refs.upload.clearFiles();
  3031. this.listLoading = false;
  3032. this.$message({
  3033. message: error,
  3034. type: "error"
  3035. });
  3036. });
  3037. }
  3038. },
  3039. batchImportWxData(item) {
  3040. //首先判断文件类型
  3041. let str = item.file.name.split(".");
  3042. let format = str[str.length - 1];
  3043. if (format != "xls" && format != "xlsx") {
  3044. this.$message({
  3045. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3046. type: "error"
  3047. });
  3048. } else {
  3049. this.importingData = true;
  3050. let formData = new FormData();
  3051. formData.append("file", item.file);
  3052. formData.append("companyId", this.user.companyId);
  3053. formData.append("withCheckIn", 1);
  3054. this.http.uploadFile('/report/importData', formData,
  3055. res => {
  3056. this.$refs.upload.clearFiles();
  3057. this.showImportResult = true;
  3058. this.importingData = false;
  3059. if (res.code == "ok") {
  3060. //换成弹出框,以免有人等了半天回来啥也没看到
  3061. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3062. this.getReportList();
  3063. this.importWxDialog = false;
  3064. } else {
  3065. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3066. }
  3067. },
  3068. error => {
  3069. this.$refs.upload.clearFiles();
  3070. this.listLoading = false;
  3071. this.$message({
  3072. message: error,
  3073. type: "error"
  3074. });
  3075. });
  3076. }
  3077. },
  3078. batchImportData(item) {
  3079. //首先判断文件类型
  3080. let str = item.file.name.split(".");
  3081. let format = str[str.length - 1];
  3082. if (format != "xls" && format != "xlsx") {
  3083. this.$message({
  3084. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3085. type: "error"
  3086. });
  3087. } else {
  3088. this.importingData = true;
  3089. let formData = new FormData();
  3090. formData.append("file", item.file);
  3091. formData.append("companyId", this.user.companyId);
  3092. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3093. this.http.uploadFile(url, formData,
  3094. res => {
  3095. this.$refs.upload.clearFiles();
  3096. this.importingData = false;
  3097. this.showImportResult = true;
  3098. if (res.code == "ok") {
  3099. //换成弹出框,以免有人等了半天回来啥也没看到
  3100. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3101. this.getReportList();
  3102. this.importWXDialog = false;
  3103. } else {
  3104. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3105. }
  3106. },
  3107. error => {
  3108. this.$refs.upload.clearFiles();
  3109. this.importingData = false;
  3110. this.$message({
  3111. message: error,
  3112. type: "error"
  3113. });
  3114. });
  3115. }
  3116. },
  3117. userssHu() {
  3118. this.http.post('/time-type/getCompanyTimeSetting',{
  3119. companyId: this.user.companyId
  3120. },
  3121. res => {
  3122. if (res.code == "ok") {
  3123. this.yonghuUser = res.data
  3124. }
  3125. },
  3126. error => {
  3127. this.$message({
  3128. message: error,
  3129. type: "error"
  3130. });
  3131. }
  3132. );
  3133. },
  3134. iptBlur(i) {
  3135. if(this.isBatch == 0) {
  3136. return
  3137. }
  3138. this.http.post('/report/getWorkDays',{
  3139. startDate: this.workForm.createDate[0],
  3140. endDate: this.workForm.createDate[1]
  3141. },
  3142. res => {
  3143. if (res.code == "ok") {
  3144. this.jsDay = res.data
  3145. this.chuji(i)
  3146. } else {
  3147. this.$message({
  3148. message: res.msg,
  3149. type: "error"
  3150. });
  3151. }
  3152. },
  3153. error => {
  3154. this.$message({
  3155. message: error,
  3156. type: "error"
  3157. });
  3158. }
  3159. );
  3160. //明夷硬编码获取
  3161. if (this.user.company.companyName == this.mingyiName) {
  3162. this.getWorkTimeForMinYi();
  3163. }
  3164. },
  3165. getWorkTimeForMinYi(){
  3166. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3167. startDate: this.workForm.createDate[0],
  3168. endDate: this.workForm.createDate[1]
  3169. },
  3170. res => {
  3171. if (res.code == "ok") {
  3172. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3173. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3174. this.totalReportHours = this.workTimeForMinYi;
  3175. } else {
  3176. this.$message({
  3177. message: res.msg,
  3178. type: "error"
  3179. });
  3180. this.workForm.createDate = [];
  3181. }
  3182. },
  3183. error => {
  3184. this.$message({
  3185. message: error,
  3186. type: "error"
  3187. });
  3188. }
  3189. );
  3190. },
  3191. chuji(i) {
  3192. if(i == 0) {
  3193. this.seleChn(1)
  3194. } else if(i == 1) {
  3195. this.seleChn(0)
  3196. } else if(i == 2) {
  3197. if(this.workForm.domains[0].multiWorktime > 0) {
  3198. this.iptChangs()
  3199. } else {
  3200. this.iptChang()
  3201. }
  3202. } else if(i == 3) {
  3203. this.seleChn(0)
  3204. }
  3205. },
  3206. seleChn(e,domain) {
  3207. if(e == 1) {
  3208. for(var i in this.workForm.domains) {
  3209. if(this.workForm.domains[i].timeType == 0) {
  3210. this.workForm.domains[i].workingTime = 8
  3211. } else {
  3212. this.workForm.domains[i].workingTime = 4
  3213. }
  3214. }
  3215. }
  3216. var quanbu = 0
  3217. var spl = this.workForm.domains
  3218. var zhi = ''
  3219. for(var i in spl) {
  3220. var sp = +spl[i].workingTime + 0
  3221. zhi = this.jsDay * sp
  3222. quanbu = +quanbu + zhi
  3223. }
  3224. this.jsTime = quanbu
  3225. this.totalReportHours = quanbu
  3226. let worktime = this.jsTime
  3227. // 自动计算加班时长
  3228. if(this.isBatch != 0){
  3229. worktime = this.jsTime / this.jsDay
  3230. }
  3231. if(this.user.timeType.fillOvertime && domain){
  3232. let isover = false
  3233. let alltime = 0
  3234. let allover = 0 //此处alltime同上面的worktime
  3235. for(let d in spl){
  3236. if(spl[d].isOvertime){
  3237. isover = true
  3238. allover += spl[d].overtimeHours*1
  3239. }
  3240. alltime += spl[d].workingTime*1
  3241. }
  3242. if(domain.overtimeHours){
  3243. allover = allover - domain.overtimeHours
  3244. }
  3245. if(worktime*1 > this.user.timeType.allday){
  3246. if(isover){
  3247. if(alltime > (allover + this.user.timeType.allday)){
  3248. this.$set(domain,'isOvertime',true)
  3249. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3250. }else{
  3251. this.$set(domain,'isOvertime',false)
  3252. this.$set(domain,'overtimeHours',null)
  3253. if(alltime < (allover + this.user.timeType.allday)){
  3254. let overtime = allover + this.user.timeType.allday - alltime
  3255. for(let pi in spl){
  3256. if(spl[pi].overtimeHours){
  3257. if((overtime - spl[pi].overtimeHours*1) > 0){
  3258. overtime = overtime - spl[pi].overtimeHours*1
  3259. this.$set(spl[pi],'isOvertime',false)
  3260. this.$set(spl[pi],'overtimeHours',null)
  3261. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3262. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3263. break
  3264. }else{
  3265. this.$set(spl[pi],'isOvertime',false)
  3266. this.$set(spl[pi],'overtimeHours',null)
  3267. break
  3268. }
  3269. }
  3270. }
  3271. }
  3272. }
  3273. }else{
  3274. this.$set(domain,'isOvertime',true)
  3275. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3276. }
  3277. }else{
  3278. for(let di in spl){
  3279. this.$set(spl[di],'isOvertime',false)
  3280. this.$set(spl[di],'overtimeHours',null)
  3281. }
  3282. }
  3283. }
  3284. },
  3285. iptChang() {
  3286. var sl = this.workForm.domains
  3287. let timeArr = []
  3288. for(var i in sl) {
  3289. if(sl[i].startTime && sl[i].endTime) {
  3290. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3291. }
  3292. }
  3293. this.getTimeHours(timeArr)
  3294. // for(let j in arrNum) {
  3295. // this.timeJsonStr += arrNum[j]
  3296. // if(flg) {
  3297. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3298. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3299. // }
  3300. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3301. // flg = true
  3302. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3303. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3304. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3305. // }
  3306. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3307. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3308. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3309. // }
  3310. // }
  3311. },
  3312. iptChangs() {
  3313. var sl = this.workForm.domains
  3314. let timeArr = []
  3315. for(var i in sl) {
  3316. for(var j in sl[i].worktimeList){
  3317. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3318. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3319. }
  3320. }
  3321. }
  3322. this.getTimeHours(timeArr)
  3323. },
  3324. // 调用接口或去数据
  3325. getTimeHours(arr) {
  3326. this.http.post('/report/getHoursByTimeRange',{
  3327. timeJsonStr: JSON.stringify(arr)
  3328. },res => {
  3329. if(res.code === 'ok') {
  3330. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3331. } else {
  3332. this.$message({
  3333. message: res.msg,
  3334. type: 'error'
  3335. })
  3336. }
  3337. },err => {
  3338. this.$message({
  3339. message: err,
  3340. type: 'error'
  3341. })
  3342. })
  3343. },
  3344. // 按周填报调用接口计算时间
  3345. async getWeekHoursByTimeRange(timeRange) {
  3346. const url = '/report/getHoursByTimeRange';
  3347. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3348. var that = this;
  3349. return new Promise((resolve, reject) => {
  3350. this.http.post(url, data, function(res) {
  3351. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3352. }, function(err) {
  3353. reject(err);
  3354. });
  3355. });
  3356. },
  3357. removeTimeItem(item, index) {
  3358. item.worktimeList.splice(index, 1);
  3359. this.iptChangs()
  3360. },
  3361. //添加工时
  3362. addNewWorktime(index, item) {
  3363. if(item.worktimeList == null ) {
  3364. item.worktimeList = []
  3365. }
  3366. item.worktimeList.push({});
  3367. },
  3368. //复制项目
  3369. copyProject(index) {
  3370. var leftProgress = 10;
  3371. if (this.reportTimeType.type == 3) {
  3372. //计算已经待分配工时比例
  3373. let array = this.workForm.domains;
  3374. let totalProgress = 0;
  3375. for (var i=0;i<array.length; i++) {
  3376. totalProgress += array[i].progress;
  3377. }
  3378. if (totalProgress < 100) {
  3379. leftProgress = 100 - totalProgress;
  3380. }
  3381. }
  3382. var newIndex = index+1;
  3383. var itemDomain = {
  3384. projectId: this.workForm.domains[index].projectId,
  3385. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3386. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3387. ),
  3388. content: "",
  3389. progress:leftProgress,
  3390. state:2,//2-表示待提交
  3391. };
  3392. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3393. if (this.reportTimeType.type == 0) {
  3394. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3395. var length = this.workForm.domains.length;
  3396. if (length == 2) {
  3397. this.showAddMore = false;
  3398. }
  3399. }
  3400. this.selectProject(itemDomain, newIndex);
  3401. },
  3402. pushWorkTime(){
  3403. let url=''
  3404. if(this.user.timeType.syncSap == 1){
  3405. url='/report/pushProjectReportToSap'
  3406. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3407. var pushDate = this.date + day;
  3408. this.$confirm('确认推送'+pushDate+'的工时?', '提示', {
  3409. confirmButtonText: '确定',
  3410. cancelButtonText: '取消',
  3411. type: 'info'
  3412. }).then(() => {
  3413. const loading = this.$loading({
  3414. lock: true,
  3415. text: '正在推送中,请耐心等待。',
  3416. spinner: 'el-icon-loading',
  3417. background: 'rgba(0, 0, 0, 0.7)'
  3418. });
  3419. this.http.post(url,{
  3420. pushDate: pushDate
  3421. },res => {
  3422. loading.close();
  3423. if(res.code == 'ok'){
  3424. this.$message({
  3425. type: 'success',
  3426. message: res.data
  3427. });
  3428. }else{
  3429. this.$message({
  3430. type: 'error',
  3431. message: res.msg
  3432. })
  3433. }
  3434. },err => {
  3435. loading.close();
  3436. this.$message({
  3437. type: 'error',
  3438. message: err
  3439. })
  3440. })
  3441. }).catch(() => {
  3442. });
  3443. }else{
  3444. url='/report/pushReportDataToThird'
  3445. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3446. confirmButtonText: '确定',
  3447. cancelButtonText: '取消',
  3448. type: 'info'
  3449. }).then(() => {
  3450. const loading = this.$loading({
  3451. lock: true,
  3452. text: '正在推送中,请耐心等待。',
  3453. spinner: 'el-icon-loading',
  3454. background: 'rgba(0, 0, 0, 0.7)'
  3455. });
  3456. this.http.post(url,{
  3457. yearMonth: this.date
  3458. },res => {
  3459. loading.close();
  3460. if(res.code == 'ok'){
  3461. this.$message({
  3462. type: 'success',
  3463. message: '推送成功!'
  3464. });
  3465. }else{
  3466. this.$message({
  3467. type: 'error',
  3468. message: res.msg
  3469. })
  3470. }
  3471. },err => {
  3472. loading.close();
  3473. this.$message({
  3474. type: 'error',
  3475. message: err
  3476. })
  3477. })
  3478. }).catch(() => {
  3479. });
  3480. }
  3481. },
  3482. showWorkTime(){
  3483. this.monthWorkTimeDialog = true;
  3484. this.searchKeyword = ''
  3485. this.WorktimeDatepickValue = this.istoMonth()
  3486. if(this.WorktimeDatepickValue.length == 0){
  3487. let newdate = new Date();
  3488. let nowdate = newdate.toLocaleDateString();
  3489. let getauto = this.getAutoWeekDate(nowdate)
  3490. let nowwd = [getauto[0],getauto[6]]
  3491. this.WorktimeDatepickValue = nowwd
  3492. }
  3493. this.showMonthWorkTime()
  3494. },
  3495. handleClick(t,e){
  3496. if (t.name == "first") {
  3497. this.showMonthWorkTime()
  3498. }else{
  3499. this.showMonthNotWorkTime()
  3500. }
  3501. },
  3502. //导出员工每日填报工时数
  3503. exportMembWorkHours() {
  3504. this.http.post(
  3505. "/report/exportUserDailyWorkTime",
  3506. {
  3507. // month: this.date,
  3508. startDate: this.WorktimeDatepickValue[0],
  3509. endDate: this.WorktimeDatepickValue[1],
  3510. },
  3511. (res) => {
  3512. if (res.code == "ok") {
  3513. let url = res.data;
  3514. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3515. }
  3516. },
  3517. (error) => {
  3518. this.$message({
  3519. message: error,
  3520. type: "error",
  3521. });
  3522. }
  3523. );
  3524. },
  3525. exportMembNotWorkHours() {
  3526. this.http.post(
  3527. "/report/exportNoReportUserList",
  3528. {
  3529. // month: this.date,
  3530. startDate: this.WorktimeDatepickValue[0],
  3531. endDate: this.WorktimeDatepickValue[1],
  3532. },
  3533. (res) => {
  3534. if (res.code == "ok") {
  3535. let url = res.data;
  3536. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3537. }
  3538. },
  3539. (error) => {
  3540. this.$message({
  3541. message: error,
  3542. type: "error",
  3543. });
  3544. }
  3545. );
  3546. },
  3547. downloadByA(name, url) {
  3548. const a = document.createElement("a"); // 创建a标签
  3549. a.setAttribute("download", name); // download属性
  3550. a.setAttribute("href", url); // href链接
  3551. a.click(); // 自执行点击事件
  3552. a.remove();
  3553. },
  3554. // 是否本月判断
  3555. istoMonth(){
  3556. let todate = new Date()
  3557. let tomonth = todate.getMonth() + 1
  3558. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3559. if(this.date == adate){
  3560. return []
  3561. }else{
  3562. let sedate = new Date(this.date)
  3563. let semonth = sedate.getMonth() + 1
  3564. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3565. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3566. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3567. return [sedates1, sedates2]
  3568. }
  3569. },
  3570. showMonthWorkTime() {
  3571. this.monthTotalPage = 0,
  3572. this.tbload = true
  3573. this.http.post(
  3574. "/report/getUserDailyWorkTime",
  3575. // "/report/getNoReportUserList",
  3576. {
  3577. // month: this.date,
  3578. startDate: this.WorktimeDatepickValue[0],
  3579. endDate: this.WorktimeDatepickValue[1],
  3580. },
  3581. (res) => {
  3582. if (res.code == "ok") {
  3583. this.tbload = false;
  3584. this.pickDateArray = res.data.days;
  3585. // console.log('dataarray',res.data.days);
  3586. this.monthWorkData = res.data.list;
  3587. // this.monthWorkDataS = this.monthWorkData
  3588. // this.monthWorkDataS1 = res.data.list
  3589. this.monthTotal = res.data.list.length
  3590. if (this.monthWorkData.length > 50) {
  3591. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3592. }else{
  3593. this.monthWorkDataS = this.monthWorkData
  3594. }
  3595. this.searchScreen(0)
  3596. // this.monthWorkDataS = infoList
  3597. // 判断
  3598. // if (this.monthWorkDataS1.length > 0) {
  3599. // setTimeout(() => {
  3600. // this.tableListener()
  3601. // }, 1000);
  3602. // }
  3603. this.$nextTick(function(){
  3604. this.$refs.hasworkTbl.doLayout();
  3605. });
  3606. // this.$forceUpdate()
  3607. }
  3608. },
  3609. (error) => {
  3610. this.tbload = false
  3611. this.$message({
  3612. message: error,
  3613. type: "error",
  3614. });
  3615. }
  3616. );
  3617. },
  3618. // tableListener(){
  3619. // let that = this;
  3620. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3621. // // 添加scroll监听事件
  3622. // dom.addEventListener("scroll", function () {
  3623. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3624. // if (scrollDistance < 2) {
  3625. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3626. // that.monthTotalPage++; //当前页数自增
  3627. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3628. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3629. // var infoList = arrList.splice(
  3630. // that.monthTotalPage * that.monthTotalLages,
  3631. // that.monthTotalLages
  3632. // );
  3633. // // 数据添加
  3634. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3635. // }
  3636. // }
  3637. // })
  3638. // },
  3639. showMonthNotWorkTime() {
  3640. this.monthTotalPage = 0,
  3641. this.tbload = true,
  3642. this.http.post(
  3643. "/report/getNoReportUserList",
  3644. {
  3645. startDate: this.WorktimeDatepickValue[0],
  3646. endDate: this.WorktimeDatepickValue[1],
  3647. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3648. },
  3649. (res) => {
  3650. if (res.code == "ok") {
  3651. this.tbload = false
  3652. this.monthNotWorkDate = res.data;
  3653. // this.monthNotWorkDateS1 = res.data
  3654. this.monthnotTotal = res.data.length
  3655. // 2222111
  3656. if (this.monthNotWorkDate.length > 50) {
  3657. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3658. } else {
  3659. this.monthNotWorkDateS = this.monthNotWorkDate
  3660. }
  3661. this.searchScreen(1)
  3662. // 判断
  3663. // if (this.monthnotworkDateS1.length > 0) {
  3664. // setTimeout(() => {
  3665. // this.tableListenernot()
  3666. // }, 1000);
  3667. // }
  3668. this.$nextTick(function(){
  3669. this.$refs.hasworkTbl2.doLayout();
  3670. });
  3671. }
  3672. },
  3673. (error) => {
  3674. this.tbload = false
  3675. this.$message({
  3676. message: error,
  3677. type: "error",
  3678. });
  3679. }
  3680. );
  3681. },
  3682. // tableListenernot(){
  3683. // let that = this;
  3684. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3685. // dom.addEventListener("scroll", function () {
  3686. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3687. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3688. // if (scrollDistance2 < 2) {
  3689. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3690. // that.monthnotTotalPage++; //当前页数自增
  3691. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3692. // var infoList = arrList.splice(
  3693. // that.monthnotTotalPage * that.monthnotTotalLages,
  3694. // that.monthnotTotalLages
  3695. // );
  3696. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3697. // }
  3698. // }
  3699. // })
  3700. // },
  3701. listScroll(){
  3702. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3703. this.isMore = true
  3704. setTimeout(()=>{
  3705. this.isMore = false
  3706. },1000)
  3707. }else {
  3708. this.isFlag = true
  3709. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3710. this.monthWorkDataS = datalist
  3711. setTimeout(()=>{
  3712. this.isFlag = false
  3713. },300)
  3714. }
  3715. },
  3716. notListScroll(){
  3717. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3718. this.isMore = true
  3719. setTimeout(()=>{
  3720. this.isMore = false
  3721. },1000)
  3722. }else {
  3723. this.isFlag = true
  3724. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3725. this.monthNotWorkDateS = datalist
  3726. // console.log('length',this.monthNotWorkDateS.length)
  3727. setTimeout(()=>{
  3728. this.isFlag = false
  3729. },300)
  3730. }
  3731. },
  3732. // 获取默认这zhou日期参数 222
  3733. getLastWeek(e){
  3734. let newdate = new Date()
  3735. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3736. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3737. if(e){
  3738. this.WorktimeDatepickValue = lastwd
  3739. this.showMonthWorkTime()
  3740. }else{
  3741. this.WorktimeDatepickValue = lastwd
  3742. this.showMonthNotWorkTime()
  3743. }
  3744. },
  3745. getThisWeek(e){
  3746. let newdate = new Date();
  3747. let nowdate = newdate.toLocaleDateString();
  3748. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3749. if(e){
  3750. this.WorktimeDatepickValue = nowwd
  3751. this.showMonthWorkTime()
  3752. }else{
  3753. this.WorktimeDatepickValue = nowwd
  3754. this.showMonthNotWorkTime()
  3755. }
  3756. },
  3757. getDoubleLastWeek(e){
  3758. let newdate = new Date()
  3759. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3760. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3761. if(e){
  3762. this.WorktimeDatepickValue = nextwd
  3763. this.showMonthWorkTime()
  3764. }else{
  3765. this.WorktimeDatepickValue = nextwd
  3766. this.showMonthNotWorkTime()
  3767. }
  3768. },
  3769. alreadyAllDate(stime,etime){
  3770. let diffdate = new Array();
  3771. let i=0;
  3772. while(stime<=etime){
  3773. let dateArray = stime.split("-");
  3774. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3775. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3776. let stimewk = this.weekDay[date.getDay()]
  3777. 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')
  3778. 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])
  3779. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3780. let stime_ts = new Date(stime).getTime();
  3781. let next_date = stime_ts + (24*60*60*1000);
  3782. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3783. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3784. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3785. stime = next_dates_y+next_dates_m+next_dates_d;
  3786. i++;
  3787. }
  3788. return diffdate
  3789. },
  3790. getAutoWeekDate(e) {
  3791. let dateString = e;
  3792. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3793. if (dateString.match(dateStringReg)) {
  3794. let presentDate = new Date(dateString),
  3795. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3796. return Array.from(new Array(7), function (val, index) {
  3797. let formatDate = new Date(
  3798. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3799. );
  3800. return (
  3801. formatDate.getFullYear() +
  3802. "-" +
  3803. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3804. "-" +
  3805. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3806. );
  3807. });
  3808. } else {
  3809. throw new Error(
  3810. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3811. );
  3812. }
  3813. },
  3814. onProgressChange() {
  3815. this.$forceUpdate();
  3816. },
  3817. showChooseMembTree() {
  3818. this.chosenMembCount = this.participator.length;
  3819. this.chooseParticipVisible = true;
  3820. },
  3821. onTreeItemChange() {
  3822. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3823. var list = chosenList.filter(item=>item.isUser == 1);
  3824. this.chosenMembCount = list.length;
  3825. },
  3826. findUserInTree() {
  3827. if (this.filterName == '') {
  3828. this.deptMembData = this.allMembData;
  3829. } else {
  3830. var list = this.findRecursively(this.filterName, this.allMembData);
  3831. this.deptMembData = list;
  3832. }
  3833. },
  3834. findRecursively(username, list) {
  3835. var filterList = [];
  3836. for (var i=0;i<list.length; i++) {
  3837. if (list[i].isUser == 1) {
  3838. if (list[i].label.indexOf(username) >= 0) {
  3839. //匹配上了
  3840. filterList.push(list[i]);
  3841. }
  3842. } else if (list[i].children != null && list[i].children.length > 0) {
  3843. var subList = this.findRecursively(username, list[i].children);
  3844. if (subList.length > 0) {
  3845. subList.forEach(s=>filterList.push(s));
  3846. }
  3847. }
  3848. }
  3849. return filterList;
  3850. },
  3851. //确定选择参与人
  3852. chooseParticip() {
  3853. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3854. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3855. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3856. if (this.user.company.packageProject == 1) {
  3857. if (this.chosenMembList.length > 1) {
  3858. this.$message({
  3859. message: '每次仅支持代填一个人',
  3860. type: "error",
  3861. });
  3862. return;
  3863. }
  3864. }
  3865. this.chooseParticipVisible = false;
  3866. this.workForm.userNames = '';
  3867. this.workForm.userId = [];
  3868. this.participator = [];
  3869. for (var i=0;i<this.chosenMembList.length; i++) {
  3870. this.workForm.userId.push(this.chosenMembList[i].id);
  3871. this.workForm.userNames += this.chosenMembList[i].label+',';
  3872. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3873. this.participator.push(item);
  3874. }
  3875. if (this.workForm.userNames.length > 0) {
  3876. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3877. }
  3878. if(this.user.userNameNeedTranslate == 1) {
  3879. if(this.workForm.userNames) {
  3880. this.workForm.userNames = this.workForm.userNames.split(',')
  3881. }
  3882. }
  3883. },
  3884. notifySel(sel){
  3885. // console.log(sel);
  3886. this.notifySelList = sel
  3887. },
  3888. //微信通知人员填写
  3889. Notify(code) {
  3890. if (this.notifySelList.length == 0) return;
  3891. var ids = '';
  3892. this.notifySelList.forEach(f=>{
  3893. ids += f.id+',';
  3894. })
  3895. this.http.post('/user/pushFillReport',{
  3896. ids: ids, date: this.curDate,
  3897. code: code
  3898. },
  3899. res => {
  3900. if (res.code == "ok") {
  3901. this.$message({
  3902. message: this.$t('message.sentSuccessfully'),
  3903. type: "success"
  3904. });
  3905. }
  3906. },
  3907. error => {
  3908. this.$message({
  3909. message: error,
  3910. type: "error"
  3911. });
  3912. }
  3913. );
  3914. },
  3915. //导出人员列表
  3916. exportMemb() {
  3917. if (this.fillMembList.length == 0) return;
  3918. var ids = '';
  3919. this.fillMembList.forEach(f=>{
  3920. ids += f.id+',';
  3921. })
  3922. this.http.post('/user/exportMembList',{
  3923. ids: ids,isFill: this.isFill, date: this.curDate
  3924. },
  3925. res => {
  3926. if (res.code == "ok") {
  3927. var aTag = document.createElement('a');
  3928. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3929. aTag.href = res.data;
  3930. aTag.click();
  3931. }
  3932. },
  3933. error => {
  3934. this.$message({
  3935. message: error,
  3936. type: "error"
  3937. });
  3938. }
  3939. );
  3940. },
  3941. showMembList(fill) {
  3942. this.membListVisible = true;
  3943. if (fill == 0) {
  3944. this.fillMembList = this.unFillList;
  3945. this.isFill = false;
  3946. let leaveList = []
  3947. let unleaveList = []
  3948. for(let i in this.fillMembList){
  3949. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3950. leaveList.push(this.fillMembList[i])
  3951. }else{
  3952. unleaveList.push(this.fillMembList[i])
  3953. }
  3954. }
  3955. this.fillMembList = unleaveList
  3956. this.fillMembList_leave = leaveList
  3957. } else if(fill == 1){
  3958. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3959. this.isFill = true;
  3960. }else{
  3961. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3962. this.isFill = true;
  3963. }
  3964. },
  3965. //获取自己填写的日报状态
  3966. getReportFillStatus() {
  3967. this.http.post('/report/getReportFillStatus',{
  3968. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3969. },
  3970. res => {
  3971. if (res.code == "ok") {
  3972. this.fillStatusList = res.data;
  3973. this.allDate.forEach(d=>{
  3974. var fillInfo = null;
  3975. d.state = null;
  3976. this.fillStatusList.forEach(s=>{
  3977. // console.log(d)
  3978. var d1 = s.createDate.split('-')[2];
  3979. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  3980. // console.log(d2, '我被执行了')
  3981. if (d1.indexOf('0') == 0) {
  3982. d1 = d1.substring(1,d1.length);
  3983. }
  3984. if (d1 == d2) {
  3985. d.state = s.state;
  3986. }
  3987. })
  3988. })
  3989. this.$forceUpdate();
  3990. }
  3991. },
  3992. error => {
  3993. this.$message({
  3994. message: error,
  3995. type: "error"
  3996. });
  3997. }
  3998. );
  3999. },
  4000. scrollFunction () {
  4001. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4002. if (this.domObj.attachEvent) { // IE
  4003. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4004. } else if (this.domObj.addEventListener) {
  4005. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4006. }
  4007. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4008. },
  4009. mouseScroll(event) { // google 浏览器下
  4010. let detail = event.wheelDelta || event.detail
  4011. let moveForwardStep = -1
  4012. let moveBackStep = 1
  4013. let step = 0
  4014. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4015. event.preventDefault() // 阻止浏览器默认事件
  4016. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4017. },
  4018. // //左右滚动
  4019. // wheel(e){
  4020. // var a = document.getElementById("dateScroll");
  4021. // var scroll_width = 80; //滚动一下的距离
  4022. // var e = e || window.event, v;
  4023. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4024. // if(v>3||-v>3) v=-v;
  4025. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4026. // e.preventDefault(); //阻止浏览器的默认滚动
  4027. // },
  4028. showExportDialog() {
  4029. this.exportType = 0
  4030. this.exportDialog = true;
  4031. },
  4032. showExportTimeDialog() {
  4033. this.exportTimeDialog = true;
  4034. },
  4035. changeAllTime() {
  4036. //总时长发生改变,自动按比例计算
  4037. this.workForm.domains.forEach(d=>{
  4038. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4039. });
  4040. //计算jsTime
  4041. if (this.workForm.createDate) {
  4042. let sdate = new Date(this.workForm.createDate[0]);
  4043. let edate = new Date(this.workForm.createDate[1]);
  4044. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4045. console.log('days===', days)
  4046. if (days < 0) {
  4047. days = 0;
  4048. }
  4049. this.jsTime = this.reportTimeType.allday * days;
  4050. }
  4051. },
  4052. // 是否加班的单机事件
  4053. check() {
  4054. this.selected = !this.selected
  4055. this.isNew = this.selected
  4056. },
  4057. updateSubProject() {
  4058. this.$forceUpdate();
  4059. },
  4060. selectDegreeId(domain, index) {
  4061. this.http.post('/report/defaultDegree',{
  4062. projectId: domain.projectId
  4063. },
  4064. res => {
  4065. if (res.code == "ok") {
  4066. if(res.data) {
  4067. this.workForm.domains[index].degreeId = res.data.id + ''
  4068. this.$forceUpdate();
  4069. }
  4070. }
  4071. },
  4072. error => {
  4073. this.$message({
  4074. message: error,
  4075. type: "error"
  4076. });
  4077. }
  4078. );
  4079. },
  4080. //项目选中了, 加载子项目
  4081. selectProject(domain, index) {
  4082. if(!domain.projectId){
  4083. return;
  4084. }
  4085. // 默认选中上次填写的自定义维度
  4086. if(this.yonghuUser.customDegreeActive == 1) {
  4087. this.selectDegreeId(domain, index)
  4088. }
  4089. // console.log('projectId===',domain.projectId);
  4090. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4091. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4092. this.http.post('/sub-project/list',{
  4093. projectId: domain.projectId,
  4094. isReport: true
  4095. },
  4096. res => {
  4097. //清空之前选中的子项目
  4098. // this.workForm.domains[index].subProjectId = 0;
  4099. if (res.code == "ok") {
  4100. this.workForm.domains[index].subProjectList = res.data;
  4101. this.workForm.domains[index].subProjectId = null;
  4102. this.$forceUpdate();
  4103. }
  4104. },
  4105. error => {
  4106. this.$message({
  4107. message: error,
  4108. type: "error"
  4109. });
  4110. }
  4111. );
  4112. //项目相关的近期任务
  4113. if (this.user.company.packageProject == 1) {
  4114. this.getRecentTaskList(domain, index);
  4115. //获取项目相关专业
  4116. if (this.user.company.packageEngineering == 1) {
  4117. this.getProjectProfessions(domain, index);
  4118. }
  4119. //获取项目下的任务分组
  4120. this.getTaskGroups(domain, index);
  4121. }
  4122. // 获取项目相关的维度
  4123. // domain.degreeId = null
  4124. this.$set(domain,'degreeId',null)
  4125. this.dimension(domain, index);
  4126. //获取项目审核人
  4127. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4128. this.getProjectAuditorList(domain, index);
  4129. } else {
  4130. //按分组的负责人来审核
  4131. domain.projectAuditorId = null;
  4132. domain.projectAuditorName = null;
  4133. domain.auditUserList = null;
  4134. }
  4135. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4136. if (this.reportTimeType.type == 3) {
  4137. //新增项目时,自动计算
  4138. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4139. domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
  4140. }
  4141. //加载昱众的工作职责
  4142. if (this.user.companyId == this.yuzhongCompId) {
  4143. this.updateResponse(domain);
  4144. }
  4145. },
  4146. getRecentTaskList(domain, index) {
  4147. //刷新任务时,清空服务
  4148. this.$set(domain, 'sapServiceId', null);
  4149. this.$set(domain, 'taskId', null);
  4150. var param = {
  4151. projectId: domain.projectId,
  4152. isSubstitude:this.isSubstitude?1:0,
  4153. };
  4154. if (domain.groupId) {
  4155. param.groupId = domain.groupId;
  4156. }
  4157. if (domain.stage) {
  4158. param.stage = domain.stage;
  4159. }
  4160. //专业版代填,获取代填员工的任务
  4161. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4162. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4163. this.$message({
  4164. message: '请选择代填的员工',
  4165. type: "error"
  4166. });
  4167. return;
  4168. } else {
  4169. param.userId = this.workForm.userId[0];
  4170. }
  4171. }
  4172. this.http.post('/task/getRecentTask',param,
  4173. res => {
  4174. if (res.code == "ok") {
  4175. this.workForm.domains[index].allTaskList = res.data;
  4176. this.workForm.domains[index].taskList = res.data;
  4177. this.$forceUpdate();
  4178. }
  4179. },
  4180. error => {
  4181. this.$message({
  4182. message: error,
  4183. type: "error"
  4184. });
  4185. }
  4186. );
  4187. },
  4188. //获取项目审核人
  4189. getProjectAuditorList(domainItem, index) {
  4190. if(domainItem.projectId == '') {
  4191. return
  4192. }
  4193. domainItem.projectAuditorId = null;
  4194. domainItem.projectAuditorName = null;
  4195. this.http.post('/project-auditor/getList',{
  4196. projectId: domainItem.projectId,
  4197. },
  4198. res => {
  4199. if (res.code == "ok") {
  4200. domainItem.auditUserList = res.data;
  4201. if (res.data.length==0) {
  4202. this.$message({
  4203. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4204. type: "error"
  4205. });
  4206. } else if (res.data.length==1) {
  4207. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4208. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4209. }
  4210. this.$forceUpdate();
  4211. }
  4212. },
  4213. error => {
  4214. this.$message({
  4215. message: error,
  4216. type: "error"
  4217. });
  4218. }
  4219. );
  4220. },
  4221. // 获取维度数据
  4222. dimension(domain, index) {
  4223. if(domain.projectId == '') {
  4224. return
  4225. }
  4226. this.http.post('/project/getDegreeList',{
  4227. projectId: domain.projectId,
  4228. },
  4229. res => {
  4230. if (res.code == "ok") {
  4231. // console.log("维度数据",res.data);
  4232. this.workForm.domains[index].wuduList = res.data
  4233. // this.workForm = this.workForm
  4234. this.$forceUpdate()
  4235. }
  4236. },
  4237. error => {
  4238. this.$message({
  4239. message: error,
  4240. type: "error"
  4241. });
  4242. }
  4243. );
  4244. },
  4245. //切换任务阶段
  4246. changeStages(domain, index) {
  4247. if (domain.stage == null || domain.stage == '') {
  4248. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4249. } else {
  4250. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4251. }
  4252. this.getRecentTaskList(domain, index);
  4253. this.$forceUpdate();
  4254. },
  4255. getGroupStages(domain, index, keepStage) {
  4256. // console.log(domain);
  4257. if(!domain.groupId){
  4258. domain.projectAuditorId = ''
  4259. domain.stages = []
  4260. if(this.user.timeType.reportAuditType >= 1){
  4261. domain.auditUserList = []
  4262. }
  4263. this.$forceUpdate();
  4264. return
  4265. }
  4266. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4267. res => {
  4268. if (res.code == "ok") {
  4269. if (!keepStage) {
  4270. domain.stage = '';
  4271. }
  4272. domain.stages = res.data;
  4273. domain.taskId = null;
  4274. this.getRecentTaskList(domain, index);
  4275. this.$forceUpdate();
  4276. }
  4277. },
  4278. error => {
  4279. this.$message({
  4280. message: error,
  4281. type: "error"
  4282. });
  4283. });
  4284. //检查当前的项目是否需要获取分组的负责人
  4285. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4286. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4287. res => {
  4288. if (res.code == "ok") {
  4289. domain.getProjectAuditorList = res.data;
  4290. domain.auditUserList = res.data;
  4291. if (res.data.length==1) {
  4292. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4293. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4294. } else if (res.data.length==0) {
  4295. domain.projectAuditorId = null;
  4296. domain.projectAuditorName = null;
  4297. }
  4298. this.$forceUpdate();
  4299. }
  4300. },
  4301. error => {
  4302. this.$message({
  4303. message: error,
  4304. type: "error"
  4305. });
  4306. });
  4307. }
  4308. },
  4309. getProjectProfessions(domain, index) {
  4310. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4311. res => {
  4312. if (res.code == "ok") {
  4313. this.workForm.domains[index].professionProgress = res.data;
  4314. this.$forceUpdate();
  4315. }
  4316. },
  4317. error => {
  4318. this.$message({
  4319. message: error,
  4320. type: "error"
  4321. });
  4322. });
  4323. },
  4324. //删除自己的日报
  4325. deleteReport() {
  4326. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4327. confirmButtonText: this.$t('btn.determine'),
  4328. cancelButtonText: this.$t('btn.cancel'),
  4329. type: "warning"
  4330. })
  4331. .then(() => {
  4332. this.listLoading = true;
  4333. this.http.post('/report/delete',{
  4334. userId: this.user.id,
  4335. date: this.workForm.createDate
  4336. },
  4337. res => {
  4338. this.listLoading = false;
  4339. if (res.code == "ok") {
  4340. this.$message({
  4341. message: this.$t('message.successfullyDeleted'),
  4342. type: "success"
  4343. });
  4344. this.getReportList();
  4345. this.getDepartment();
  4346. this.dialogVisible = false;
  4347. } else {
  4348. this.$message({
  4349. message: res.msg,
  4350. type: "error"
  4351. });
  4352. }
  4353. },
  4354. error => {
  4355. this.listLoading = false;
  4356. this.$message({
  4357. message: error,
  4358. type: "error"
  4359. });
  4360. }
  4361. );
  4362. })
  4363. .catch(() => {});
  4364. },
  4365. // 管理员删除日报
  4366. guanli(item) {
  4367. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4368. let param = {date: this.date + day, userId: item.id};
  4369. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4370. confirmButtonText: this.$t('btn.determine'),
  4371. cancelButtonText: this.$t('btn.cancel'),
  4372. type: "warning"
  4373. })
  4374. .then(() => {
  4375. this.listLoading = true;
  4376. this.http.post('/report/delete',param,
  4377. res => {
  4378. this.listLoading = false;
  4379. if (res.code == "ok") {
  4380. this.$message({
  4381. message: this.$t('message.successfullyDeleted'),
  4382. type: "success"
  4383. });
  4384. this.getReportList();
  4385. this.getDepartment();
  4386. this.dialogVisible = false;
  4387. } else {
  4388. this.$message({
  4389. message: res.msg,
  4390. type: "error"
  4391. });
  4392. }
  4393. },
  4394. error => {
  4395. this.listLoading = false;
  4396. this.$message({
  4397. message: error,
  4398. type: "error"
  4399. });
  4400. }
  4401. );
  4402. })
  4403. .catch(() => {});
  4404. },
  4405. selectAll() {
  4406. if (this.isAllSelect) {
  4407. var keys = [];
  4408. this.reportNames.forEach(b=>{
  4409. keys.push(b.id);
  4410. })
  4411. this.$refs.approveTree.setCheckedKeys(keys);
  4412. } else {
  4413. this.$refs.approveTree.setCheckedKeys([]);
  4414. }
  4415. },
  4416. removeEmptyNode(list) {
  4417. for (var i=0;i<list.length;i++) {
  4418. var cnt = 0;
  4419. if (list[i].membCount == 0) {
  4420. list.splice(i, 1);
  4421. i--;
  4422. } else if (list[i].children != null) {
  4423. this.removeEmptyNode(list[i].children);
  4424. }
  4425. }
  4426. },
  4427. calculateMembCount(list) {
  4428. for (var i in list) {
  4429. var cnt = 0;
  4430. if (list[i].children != null) {
  4431. this.calculateMembCount(list[i].children);
  4432. for (var m in list[i].children) {
  4433. cnt += list[i].children[m].membCount;
  4434. }
  4435. }
  4436. if (list[i].isUser == 1) {
  4437. cnt++;
  4438. this.membCount++;
  4439. }
  4440. list[i].membCount = cnt;
  4441. }
  4442. },
  4443. stateChange() {
  4444. // console.log(this.allData,'alldate');
  4445. this.membCount = 0;
  4446. if (this.selectState == -1) {
  4447. //全部状态
  4448. this.data = this.allData;
  4449. } else {
  4450. //未填报
  4451. this.seluserText = ''
  4452. var newData = JSON.parse(JSON.stringify(this.allData));
  4453. this.filterState(this.selectState, newData);
  4454. this.data = newData;
  4455. }
  4456. this.calculateMembCount(this.data);
  4457. this.data[0].membCount = this.membCount;//总人数
  4458. },
  4459. //按状态过滤部门人员
  4460. filterState(state, list) {
  4461. for (var i =0;i<list.length; i++) {
  4462. var obj = list[i];
  4463. if (obj.isUser == 1) {
  4464. var match = false;
  4465. if (state == -2) {
  4466. if (obj.state == null) {
  4467. match = true;
  4468. }
  4469. } else {
  4470. if (obj.state == state) {
  4471. match = true;
  4472. }
  4473. }
  4474. if (!match) {
  4475. list.splice(i, 1);
  4476. i--;
  4477. } else {
  4478. }
  4479. } else {
  4480. if (obj.children != null) {
  4481. this.filterState(state, obj.children);
  4482. }
  4483. }
  4484. }
  4485. },
  4486. //a按名称过滤部门人员
  4487. async seluserforText(){
  4488. const { userNameNeedTranslate } = this.user
  4489. this.membCount = 0;
  4490. var newData = JSON.parse(JSON.stringify(this.allData));
  4491. let textList = [this.seluserText]
  4492. if(userNameNeedTranslate == 1) {
  4493. this.dataLoading = true
  4494. let res = await this.postData('/user/getEmployeeList', {
  4495. keyword: this.seluserText,
  4496. cursor: '',
  4497. departmentId: -1,
  4498. pageIndex: 1,
  4499. pageSize: 1000
  4500. })
  4501. textList = res.data.records.map(item => item.name)
  4502. this.dataLoading = false
  4503. }
  4504. // return
  4505. console.log(textList, '<=== textList')
  4506. this.seluserforTextin(this.seluserText, newData, textList)
  4507. console.log(newData, 'Data')
  4508. this.data = newData;
  4509. this.calculateMembCount(this.data);
  4510. this.data[0].membCount = this.membCount;//总人数
  4511. },
  4512. seluserforTextin(text, list, textList = []){
  4513. for (var i =0;i<list.length; i++) {
  4514. var obj = list[i];
  4515. if (obj.isUser == 1) {
  4516. var match = false;
  4517. // if (obj.label.indexOf(text) != -1) {
  4518. // match = true
  4519. // }
  4520. if(textList.some(item => item.includes(obj.label))) {
  4521. match = true
  4522. }
  4523. if (!match) {
  4524. list.splice(i, 1);
  4525. i--;
  4526. } else {
  4527. }
  4528. } else {
  4529. if (obj.children != null) {
  4530. this.seluserforTextin(text, obj.children, textList);
  4531. }
  4532. }
  4533. }
  4534. },
  4535. // 当节点发生变化时
  4536. nodeChangeExpand(data) {
  4537. // 保存当前展开的节点
  4538. let flag = false
  4539. this.nodeModelData.some(item => {
  4540. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4541. flag = true
  4542. return true
  4543. }
  4544. })
  4545. if (!flag) { // 不存在则存到数组里
  4546. this.nodeModelData.push(data.id)
  4547. }
  4548. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4549. },
  4550. nodeChangeCollapse(data) {
  4551. console.log(this.nodeModelData)
  4552. this.nodeModelData.some((item, i) => {
  4553. if (item === data.id) {
  4554. this.nodeModelData.length = i
  4555. }
  4556. })
  4557. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4558. },
  4559. // 部门列表点击
  4560. handleNodeClick(data) {
  4561. // this.dealList = data
  4562. this.theValues(data.id, this.allData)
  4563. // this.depData = data;
  4564. var list = [];
  4565. if (data.id == -1) {
  4566. this.deptId = null;
  4567. this.targetUid = null;
  4568. list = this.data;
  4569. } else if (data.isUser == 1) {
  4570. this.deptId = null;
  4571. this.targetUid = data.id;
  4572. } else {
  4573. this.deptId = data.id;
  4574. this.targetUid = null;
  4575. list.push(data);
  4576. }
  4577. this.getReportList();
  4578. if (list.length > 0) {
  4579. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4580. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4581. }
  4582. },
  4583. exportPushLog(){
  4584. this.http.post('/sap-sync-log/export',{},
  4585. res => {
  4586. if (res.code == "ok") {
  4587. var filePath = res.data;
  4588. var fName = '推送日志.xlsx'
  4589. const a = document.createElement('a'); // 创建a标签
  4590. a.setAttribute('download', fName);// download属性
  4591. a.setAttribute('href', filePath);// href链接
  4592. a.click(); //自执行点击事件
  4593. a.remove();
  4594. } else {
  4595. this.$message({
  4596. message: res.msg,
  4597. type: "error"
  4598. });
  4599. }
  4600. },
  4601. error => {
  4602. this.$message({
  4603. message: error,
  4604. type: "error"
  4605. });
  4606. });
  4607. },
  4608. theValues(id, item) {
  4609. for(var i in item) {
  4610. if(item[i].id == id) {
  4611. this.depData = item[i]
  4612. if(id == '-1') {
  4613. this.translation = '1'
  4614. } else {
  4615. if(item[i].children) {
  4616. this.translation = '2'
  4617. } else {
  4618. this.translation = '3'
  4619. }
  4620. }
  4621. return
  4622. } else {
  4623. if(item[i].children) {
  4624. this.theValues(id, item[i].children)
  4625. }
  4626. }
  4627. }
  4628. },
  4629. //获取可以选择的代填的人员列表
  4630. getSubstitudeUserDeptList() {
  4631. if (this.deptMembData.length == 0) {
  4632. this.http.post("/department/listMyMembs", {},
  4633. res => {
  4634. if (res.code == "ok") {
  4635. let noAllData = JSON.parse(JSON.stringify(res.data));
  4636. if (noAllData.length > 0) {
  4637. // if (noAllData[0].label == '全部人员') {
  4638. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4639. noAllData.splice(0,1);
  4640. }
  4641. }
  4642. this.setUserToDept(noAllData);
  4643. this.deptMembData = noAllData;
  4644. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4645. console.log(this.deptMembData, '代填人员数据')
  4646. } else {
  4647. this.$message({
  4648. message: res.msg,
  4649. type: "error"
  4650. });
  4651. }
  4652. },
  4653. error => {
  4654. this.$message({
  4655. message: error,
  4656. type: "error"
  4657. });
  4658. });
  4659. }
  4660. },
  4661. // 获取部门列表
  4662. getDepartmentForApprove() {
  4663. this.http.post( this.port.manage.depList, {},
  4664. res => {
  4665. if (res.code == "ok") {
  4666. var list1 = JSON.parse(JSON.stringify(res.data));
  4667. this.deptOptionList = this.changeArr(list1);
  4668. console.log(this.deptOptionList, '部门')
  4669. } else {
  4670. this.$message({
  4671. message: res.msg,
  4672. type: "error"
  4673. });
  4674. }
  4675. },
  4676. error => {
  4677. this.$message({
  4678. message: error,
  4679. type: "error"
  4680. });
  4681. });
  4682. },
  4683. // 获取部门列表
  4684. getDepartment() {
  4685. //如果没有权限,就不需要获取
  4686. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4687. return;
  4688. }
  4689. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4690. var param = {date:this.date + day};
  4691. this.http.post("/report/getMembList", param,
  4692. res => {
  4693. if (res.code == "ok") {
  4694. if(res.data.length == 0){
  4695. return
  4696. }
  4697. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4698. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4699. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4700. // if (this.user.role > 0) {
  4701. // }
  4702. list.splice(0,0,{
  4703. id: -1,
  4704. label: this.$t('lable.allStaff'),
  4705. })
  4706. this.membCount = 0;
  4707. //设置员工到部门下面
  4708. this.setUserToDept(list);
  4709. this.data = list;
  4710. // console.log('data',this.data);
  4711. this.expandDate = [this.data[1].id]
  4712. this.allData = list;
  4713. // if (noAllData.length > 0) {
  4714. // if (noAllData[0].label == '全部人员') {
  4715. // noAllData.splice(0,1);
  4716. // }
  4717. // }
  4718. // this.setUserToDept(noAllData);
  4719. // this.deptMembData = noAllData;
  4720. this.option = this.changeArr(list1);
  4721. list[0].membCount = this.membCount;
  4722. if (this.depData.id == -1) {
  4723. this.depData.membCount = this.membCount;
  4724. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4725. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4726. } else {
  4727. if (this.depData.isUser == null) {
  4728. var dep = this.findTargetDept(this.data, this.depData.id);
  4729. var membDeptList = [];
  4730. membDeptList.push(dep);
  4731. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4732. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4733. }
  4734. }
  4735. if (this.depData.isUser == null) {
  4736. if (this.isFill) {
  4737. this.fillMembList = this.fillList;
  4738. } else {
  4739. this.fillMembList = this.unFillList;
  4740. }
  4741. }
  4742. this.leaveAllNum = 0
  4743. for(let i in this.unFillList){
  4744. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4745. this.leaveAllNum += 1
  4746. }
  4747. }
  4748. this.stateChange()
  4749. } else {
  4750. this.$message({
  4751. message: res.msg,
  4752. type: "error"
  4753. });
  4754. }
  4755. },
  4756. error => {
  4757. this.$message({
  4758. message: error,
  4759. type: "error"
  4760. });
  4761. });
  4762. this.getReportFillStatus();
  4763. },
  4764. findTargetDept(list, deptId) {
  4765. var t = null;
  4766. for (var i=0;i<list.length; i++) {
  4767. if (list[i].isUser == null && list[i].id == deptId) {
  4768. t = list[i];
  4769. break;
  4770. }
  4771. }
  4772. if (t == null) {
  4773. for (var i=0;i<list.length; i++) {
  4774. if (list[i].children != null && list[i].children.length > 0) {
  4775. t = this.findTargetDept(list[i].children, deptId);
  4776. if (t != null) {
  4777. break;
  4778. }
  4779. }
  4780. }
  4781. }
  4782. return t;
  4783. },
  4784. getUserMembListFromDeptList(list, isFill) {
  4785. var membList = [];
  4786. for (var i in list) {
  4787. var deptName = list[i].label;
  4788. if (list[i].userList != null) {
  4789. list[i].userList.forEach(element => {
  4790. if (isFill == 0) {
  4791. //获取未填的
  4792. if (element.state == null) {
  4793. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4794. membList.push(obj);
  4795. }
  4796. } else {
  4797. if (element.state != null) {
  4798. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4799. membList.push(obj);
  4800. }
  4801. }
  4802. });
  4803. }
  4804. if (list[i].children != null) {
  4805. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4806. }
  4807. }
  4808. return membList;
  4809. },
  4810. setUserToDept(list) {
  4811. for (var i in list) {
  4812. var cnt = 0;
  4813. if (list[i].children != null) {
  4814. this.setUserToDept(list[i].children);
  4815. for (var m in list[i].children) {
  4816. cnt += list[i].children[m].membCount;
  4817. }
  4818. }
  4819. if (list[i].userList != null) {
  4820. if (list[i].children == null) {
  4821. list[i].children = [];
  4822. }
  4823. list[i].userList.forEach(element => {
  4824. var obj = {
  4825. id: element.id,
  4826. label:element.name,
  4827. state:element.state,
  4828. parentId:element.departmentId,
  4829. isUser:1,
  4830. workingTime: element.workingTime,
  4831. leaveDays: element.leaveDays,
  4832. leaveTimes: element.leaveTimes
  4833. };
  4834. list[i].children.push(obj);
  4835. this.membCount++;
  4836. cnt++;
  4837. });
  4838. }
  4839. list[i].membCount = cnt;
  4840. }
  4841. },
  4842. // 修改数组
  4843. changeArr(arr) {
  4844. for (var i = 0; i < arr.length; i++) {
  4845. if(arr[i].id != -1 && arr[i].id != 0) {
  4846. if (arr[i].children != null && arr[i].children.length>0) {
  4847. arr[i].children = this.changeArr(arr[i].children);
  4848. }
  4849. arr[i].id && (arr[i].value = arr[i].id);
  4850. delete arr[i].id;
  4851. }
  4852. }
  4853. for(var i in arr) {
  4854. if(arr[i].id == -1 || arr[i].id == 0) {
  4855. arr.splice(i,1)
  4856. }
  4857. }
  4858. return arr;
  4859. },
  4860. //时间段范围设置改动,监听
  4861. onTimeTypeChange(timeType) {
  4862. this.seleChn(1)
  4863. this.showAddMore = true;
  4864. for(var i in this.workForm.domains) {
  4865. if (this.workForm.domains[i].timeType == 0) {
  4866. this.showAddMore = false;
  4867. break;
  4868. }
  4869. }
  4870. if (this.showAddMore) {
  4871. //检测数量
  4872. if (this.workForm.domains.length == 2) {
  4873. this.showAddMore = false;
  4874. } else {
  4875. this.showAddMore = true;
  4876. }
  4877. }
  4878. },
  4879. getTimeType() {
  4880. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4881. res => {
  4882. if (res.code == "ok") {
  4883. var t = res.data;
  4884. this.reportTimeType = t;
  4885. if (this.reportTimeType.type > 0) {
  4886. this.showAddMore = true;
  4887. }
  4888. //转化时间格式
  4889. if (t.allday != null) {
  4890. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4891. }
  4892. if (t.am != null) {
  4893. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4894. }
  4895. if (t.pm != null) {
  4896. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4897. }
  4898. let arr = []
  4899. for(var i in res.data.excludeTimeList) {
  4900. let obj = {
  4901. s: res.data.excludeTimeList[i].startTime,
  4902. e: res.data.excludeTimeList[i].endTime,
  4903. }
  4904. arr.push(obj)
  4905. }
  4906. this.vacationTime = arr
  4907. } else {
  4908. this.$message({
  4909. message: res.msg,
  4910. type: "error"
  4911. });
  4912. }
  4913. },
  4914. error => {
  4915. this.listLoading = false;
  4916. this.$message({
  4917. message: error,
  4918. type: "error"
  4919. });
  4920. });
  4921. },
  4922. // 改变月份 -------
  4923. changeMonthOut() {
  4924. this.getAllDate();
  4925. this.getReportList();
  4926. this.getDepartment();
  4927. },
  4928. // 选择日期
  4929. choseDate(i, item) {
  4930. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4931. return
  4932. }
  4933. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4934. this.choseDay = i;
  4935. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4936. sessionStorage.msg = this.date + day,
  4937. this.getReportList();
  4938. this.getDepartment();
  4939. this.curDate = item.date;
  4940. },
  4941. canClick(i, item){
  4942. let nowDate = new Date()
  4943. let nowDateYear = nowDate.getFullYear()
  4944. let itemYear = parseInt(this.date.split('-')[0])
  4945. let nowDateMonth = nowDate.getMonth() + 1
  4946. let itemMonth = parseInt(this.date.split('-')[1])
  4947. let nowDateDay = nowDate.getDate()
  4948. let itemDay = parseInt(item.showDate.split('.')[1])
  4949. if(nowDateYear < itemYear){
  4950. return false
  4951. }else if(nowDateYear == itemYear){
  4952. if(nowDateMonth < itemMonth){
  4953. return false
  4954. }else if(nowDateMonth == itemMonth){
  4955. if(nowDateDay < itemDay){
  4956. return false
  4957. }
  4958. }
  4959. }
  4960. },
  4961. // 获取日期列表
  4962. getAllDate(e) {
  4963. var dayArry = [];
  4964. var day = this.getCountDays();
  4965. let curMonthDay = null;
  4966. for (var k = 1; k <= day; k++) {
  4967. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4968. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4969. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4970. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4971. if(sessionStorage.msg) {
  4972. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4973. this.choseDay = k - 1;
  4974. curMonthDay = str;
  4975. }
  4976. } else {
  4977. if (new Date().getDate() == k) {
  4978. this.choseDay = k - 1;
  4979. }
  4980. }
  4981. } else {
  4982. this.choseDay = 0;
  4983. }
  4984. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  4985. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  4986. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  4987. }
  4988. this.allDate = dayArry;
  4989. //不能超过最大日期
  4990. if (this.choseDay > day-1) {
  4991. this.choseDay = day-1;
  4992. }
  4993. if(sessionStorage.from != 1){
  4994. let nowmonth = new Date().getMonth() + 1
  4995. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  4996. let nowdate = new Date().getDate()
  4997. if(nowd == this.date){
  4998. if(e && sessionStorage.msg){
  4999. }else{
  5000. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5001. }
  5002. let nowday = new Date(sessionStorage.msg).getDate()
  5003. this.choseDay = nowday - 1
  5004. let monthdate = new Date(sessionStorage.msg)
  5005. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5006. }else{
  5007. if(e && sessionStorage.msg){
  5008. }else{
  5009. sessionStorage.msg = this.date + '-01'
  5010. }
  5011. let monthdate = new Date(sessionStorage.msg)
  5012. this.choseDay = monthdate.getDate() - 1
  5013. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5014. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5015. }
  5016. }else{
  5017. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5018. }
  5019. //从消息点击跳转过来的,直接加载指定日期
  5020. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5021. this.curDate = sessionStorage.msg;
  5022. sessionStorage.from = 0;
  5023. } else {
  5024. // if (curMonthDay != null) {
  5025. // // this.curDate = curMonthDay;
  5026. // let d = new Date(sessionStorage.msg)
  5027. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5028. // } else {
  5029. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5030. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5031. // }
  5032. }
  5033. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5034. // if(!sessionStorage.msg){
  5035. // let msgday = this.choseDay + 1
  5036. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5037. // }
  5038. this.getReportFillStatus();
  5039. },
  5040. getCountDays() {
  5041. var newstr = this.date.replace(/-/g, "/");
  5042. var curDate = new Date(newstr+'/01');
  5043. var curMonth = curDate.getMonth();
  5044. curDate.setMonth(curMonth + 1);
  5045. curDate.setDate(0);
  5046. return curDate.getDate();
  5047. },
  5048. //获取日报列表
  5049. getReportList() {
  5050. this.listLoading = true;
  5051. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5052. let param = {date: this.date + day};
  5053. if (this.deptId) {
  5054. param.deptId = this.deptId;
  5055. }
  5056. if (this.targetUid) {
  5057. param.userId = this.targetUid;
  5058. }
  5059. this.http.post( this.port.report.list, param,
  5060. res => {
  5061. this.listLoading = false;
  5062. if (res.code == "ok") {
  5063. this.reportList = res.data;
  5064. if(document.querySelector("#day"+this.choseDay)){
  5065. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5066. }
  5067. } else {
  5068. this.$message({
  5069. message: res.msg,
  5070. type: "error"
  5071. });
  5072. }
  5073. },
  5074. error => {
  5075. this.listLoading = false;
  5076. this.$message({
  5077. message: error,
  5078. type: "error"
  5079. });
  5080. });
  5081. },
  5082. // 处理数据
  5083. // dealWith() {
  5084. // var tianxie = 0
  5085. // var weixtianxie = 0
  5086. // if(this.selectState == -1) {
  5087. // } else {
  5088. // var arr = []
  5089. // for (var i in this.reportList) {
  5090. // arr.push(this.reportList[i].id)
  5091. // }
  5092. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  5093. // }
  5094. // },
  5095. // getDealWith(item, tx, wtx, arr) {
  5096. // for(var i in item) {
  5097. // if(item[i].children) {
  5098. // this.getDealWith(item[i].children, tx, wtx, arr)
  5099. // } else {
  5100. // if(arr.indexOf(item[i].id) != '-1') {
  5101. // tx = +tx + 1
  5102. // }
  5103. // }
  5104. // }
  5105. // },
  5106. //导出员工工时统计
  5107. exportUserTime() {
  5108. this.listLoading = true;
  5109. var param = {};
  5110. if (this.exportParam.dateRange != null) {
  5111. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5112. }
  5113. this.http.post('/department/exportDeptStatistic', param,
  5114. res => {
  5115. this.listLoading = false;
  5116. if (res.code == "ok") {
  5117. location.href = res.data;
  5118. this.exportTimeDialog = false;
  5119. } else {
  5120. this.$message({
  5121. message: res.msg,
  5122. type: "error"
  5123. });
  5124. }
  5125. },
  5126. error => {
  5127. this.listLoading = false;
  5128. this.$message({
  5129. message: error,
  5130. type: "error"
  5131. });
  5132. });
  5133. },
  5134. //导出日报
  5135. exportReport() {
  5136. this.exportingData = true;
  5137. var param = {};
  5138. if (this.exportParam.dateRange != null) {
  5139. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5140. }
  5141. if (this.exportParam.projectId != null) {
  5142. param.projectId = this.exportParam.projectId;
  5143. }
  5144. if (this.exportParam.departmentId != null) {
  5145. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5146. }
  5147. param.stateKey = this.stateKey
  5148. // param.departmentId = this.user.departmentId
  5149. console.log(param, '《=== 导出传的参数')
  5150. this.http.post( this.port.report.export, param,
  5151. res => {
  5152. this.exportingData = false;
  5153. if (res.code == "ok") {
  5154. location.href = res.data;
  5155. this.exportDialog = false;
  5156. } else {
  5157. this.$message({
  5158. message: res.msg,
  5159. type: "error"
  5160. });
  5161. }
  5162. },
  5163. error => {
  5164. this.exportingData = false;
  5165. this.$message({
  5166. message: error,
  5167. type: "error"
  5168. });
  5169. });
  5170. },
  5171. //获取项目列表
  5172. getProjectList() {
  5173. this.listLoading = true;
  5174. this.http.post( this.port.project.list, {},
  5175. res => {
  5176. this.listLoading = false;
  5177. if (res.code == "ok") {
  5178. for(var i in res.data) {
  5179. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5180. res.data[i].projectCode = ''
  5181. }
  5182. }
  5183. this.projectList = res.data;
  5184. console.log("项目列表",this.projectList);
  5185. } else {
  5186. this.$message({
  5187. message: res.msg,
  5188. type: "error"
  5189. });
  5190. }
  5191. },
  5192. error => {
  5193. this.listLoading = false;
  5194. this.$message({
  5195. message: error,
  5196. type: "error"
  5197. });
  5198. });
  5199. },
  5200. // 获取填报日报的项目下拉列表
  5201. getFillProjectList() {
  5202. this.http.post( this.port.project.list, {
  5203. forReport: 1
  5204. },res => {
  5205. if (res.code == "ok") {
  5206. for(var i in res.data) {
  5207. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5208. res.data[i].projectCode = ''
  5209. }
  5210. }
  5211. this.fillProjectList = res.data;
  5212. this.getRecentlyProject()
  5213. } else {
  5214. this.$message({
  5215. message: res.msg,
  5216. type: "error"
  5217. });
  5218. }
  5219. },
  5220. error => {
  5221. this.$message({
  5222. message: error,
  5223. type: "error"
  5224. });
  5225. });
  5226. },
  5227. getBasecostItemList() {
  5228. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5229. companyId: this.user.companyId
  5230. },
  5231. res => {
  5232. if (res.code == "ok") {
  5233. this.timeBasecostList = res.data;
  5234. }
  5235. });
  5236. },
  5237. getAIReport(createDate) {
  5238. this.http.post('/report/getAIReport', {},
  5239. res => {
  5240. if (res.code == "ok") {
  5241. var quanbu = 0
  5242. this.jsDay = 1
  5243. var zhi = ''
  5244. var slp = res.data
  5245. for(var i in slp) {
  5246. var sp = +slp[i].workingTime + 0
  5247. zhi = this.jsDay * sp
  5248. quanbu = +quanbu + zhi
  5249. }
  5250. this.jsTime = quanbu
  5251. var aiReportData = res.data;
  5252. this.canCancelInDialog = false
  5253. if(aiReportData.length != 0) {
  5254. var arr = [];
  5255. for(var i in aiReportData) {
  5256. arr.push({
  5257. id: null,
  5258. projectId: aiReportData[i].projectId,
  5259. workingTime: aiReportData[i].workingTime,
  5260. content: '',
  5261. progress:100,
  5262. state: 2,
  5263. timeType: aiReportData[i].timeType,
  5264. subProjectList: aiReportData[i].subProjectList,
  5265. taskList: aiReportData[i].taskList,
  5266. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5267. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5268. taskId: aiReportData[i].taskId,
  5269. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5270. startTime: aiReportData[i].startTime,
  5271. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5272. endTime: aiReportData[i].endTime,
  5273. isOvertime: 0,
  5274. progress:aiReportData[i].progress,
  5275. professionProgress: aiReportData[i].professionProgressList,
  5276. stages:aiReportData[i].stages,
  5277. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5278. pics: null,
  5279. multiWorktime: aiReportData[i].multiWorktime,
  5280. worktimeList: [{}],
  5281. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5282. wuduList: aiReportData[i].degreeList,
  5283. taskGroups:aiReportData[i].taskGroups,
  5284. customData: aiReportData[i].customData,//自定义的数值
  5285. auditUserList: aiReportData[i].auditUserList,
  5286. projectAuditorId: aiReportData[i].projectAuditorId,
  5287. projectAuditorName: aiReportData[i].projectAuditorName,
  5288. overtimeHours: aiReportData[i].overtimeHours,
  5289. customText: aiReportData[i].customText,
  5290. basecostId: aiReportData[i].basecostId,
  5291. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5292. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5293. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5294. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5295. canEdit: true
  5296. })
  5297. }
  5298. this.workForm.domains = arr;
  5299. } else {
  5300. }
  5301. this.canEdit = true;
  5302. this.originCanEdit = true;
  5303. this.seleChn()
  5304. } else {
  5305. this.$message({
  5306. message: res.msg,
  5307. type: "error"
  5308. });
  5309. }
  5310. },
  5311. error => {
  5312. this.$message({
  5313. message: error,
  5314. type: "error"
  5315. });
  5316. });
  5317. },
  5318. // 获取个人某天的日报 111111
  5319. getReport() {
  5320. this.http.post( this.port.report.getPort, {
  5321. date: this.workForm.createDate
  5322. },
  5323. res => {
  5324. if (res.code == "ok") {
  5325. var quanbu = 0
  5326. this.jsDay = 1
  5327. var zhi = ''
  5328. var slp = res.data.report
  5329. for(var i in slp) {
  5330. var sp = +slp[i].workingTime + 0
  5331. zhi = this.jsDay * sp
  5332. quanbu = +quanbu + zhi
  5333. }
  5334. this.jsTime = quanbu
  5335. var list = res.data;
  5336. this.report = list;
  5337. this.reportTimeType = this.report.timeType;
  5338. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5339. this.isWeekend = !this.report.isWorkDay;
  5340. this.canCancelInDialog = false;
  5341. this.hasWrittenReport = list.report.length != 0;
  5342. if(list.report.length != 0) {
  5343. var arr = [];
  5344. this.canEdit = false;
  5345. let candelete = true
  5346. for(var i in list.report) {
  5347. var flg = null
  5348. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5349. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5350. var filteredRespList = null
  5351. if (targetP.length > 0) {
  5352. var isPublic = targetP[0].isPublic;
  5353. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5354. }
  5355. arr.push({
  5356. id: list.report[i].id,
  5357. projectId: list.report[i].projectId,
  5358. workingTime: list.report[i].workingTime,
  5359. content: list.report[i].content,
  5360. state: list.report[i].state,
  5361. timeType: list.report[i].timeType,
  5362. subProjectList: list.report[i].subProjectList,
  5363. taskList: list.report[i].taskList,
  5364. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5365. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5366. taskId: list.report[i].taskId,
  5367. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5368. startTime: list.report[i].startTime,
  5369. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5370. endTime: list.report[i].endTime,
  5371. isOvertime: flg,
  5372. progress:list.report[i].progress,
  5373. professionProgress: list.report[i].professionProgressList,
  5374. stages:list.report[i].stages,
  5375. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5376. pics: list.report[i].pics,
  5377. multiWorktime: list.report[i].multiWorktime,
  5378. worktimeList: list.report[i].worktimeList,
  5379. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5380. wuduList: list.report[i].degreeList,
  5381. taskGroups:list.report[i].taskGroups,
  5382. customData: list.report[i].customData,//自定义的数值
  5383. auditUserList: list.report[i].auditUserList,
  5384. projectAuditorId: list.report[i].projectAuditorId,
  5385. projectAuditorName: list.report[i].projectAuditorName,
  5386. overtimeHours: list.report[i].overtimeHours,
  5387. customText: list.report[i].customText,
  5388. basecostId: list.report[i].basecostId,
  5389. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5390. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5391. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5392. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5393. canEdit: list.report[i].state >= 2 ? true : false,
  5394. extraField1: list.report[i].extraField1,
  5395. extraField2: list.report[i].extraField2,
  5396. extraField3: list.report[i].extraField3,
  5397. workContentList: list.report[i].workContentList,
  5398. filteredRespList: filteredRespList,
  5399. serviceList: list.report[i].serviceList,
  5400. sapServiceId: list.report[i].sapServiceId,
  5401. })
  5402. if (list.report[i].state >= 2) {
  5403. this.canEdit = true;
  5404. }
  5405. if(list.report[i].state < 2){
  5406. candelete = false
  5407. }
  5408. if (list.report[i].state == 0){
  5409. this.canCancelInDialog = true
  5410. }
  5411. // 加判断
  5412. if(this.user.timeType.choseFromAlbum == 1) {
  5413. let arrList = []
  5414. for(var k in list.report[i].pics) {
  5415. let obj = {
  5416. name: k,
  5417. url: list.report[i].pics[k]
  5418. }
  5419. arrList.push(obj)
  5420. }
  5421. arr[i].imgListUrl = arrList
  5422. arr[i].imgList = list.report[i].pics
  5423. }
  5424. }
  5425. this.reportCanDelete = candelete
  5426. this.workForm = {
  5427. createDate: this.workForm.createDate,
  5428. domains: arr,
  5429. userNames:null,
  5430. userId:null,
  5431. time: list.time
  5432. }
  5433. console.log('workForm', this.workForm)
  5434. } else {
  5435. this.workForm = {
  5436. createDate: this.workForm.createDate,
  5437. domains: [{
  5438. id: null,
  5439. projectId: "",
  5440. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5441. content: "",
  5442. progress:100,
  5443. state: 2,
  5444. timeType:0,
  5445. multiWorktime: this.reportTimeType.multiWorktime,
  5446. worktimeList:[{}],
  5447. canEdit: true,
  5448. auditorFirst: '',
  5449. auditorSec: '',
  5450. auditorThird: '',
  5451. ccUserid: ''
  5452. }],
  5453. userId:null,
  5454. userNames:null,
  5455. time: this.report.time
  5456. }
  5457. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5458. this.$set(this.workForm.domains[0],'isOvertime',true)
  5459. if(this.reportTimeType.type != 2){
  5460. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5461. }
  5462. }
  5463. if(this.user.timeType.type == 1) {
  5464. var shuzhi = this.user.timeType.allday + ''
  5465. // console.log('执行一次', shuzhi.indexOf('.'))
  5466. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5467. }
  5468. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5469. //默认给第一个,必填字段
  5470. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5471. }
  5472. this.canEdit = true;
  5473. }
  5474. this.originCanEdit = this.canEdit;
  5475. this.seleChn()
  5476. } else {
  5477. this.$message({
  5478. message: res.msg,
  5479. type: "error"
  5480. });
  5481. }
  5482. },
  5483. error => {
  5484. this.$message({
  5485. message: error,
  5486. type: "error"
  5487. });
  5488. });
  5489. },
  5490. guanbi() {
  5491. this.falsss = false,
  5492. this.workTimeForMinYi=0
  5493. },
  5494. // 打开日报填写
  5495. fillInReport(i, isBatch) {
  5496. this.isWeekend = false
  5497. this.reportCanDelete = false
  5498. // console.log(this.user.timeType.type, '选择时长')
  5499. if(i != 1) {
  5500. this.falsss = false
  5501. } else {
  5502. this.falsss = true
  5503. }
  5504. if (this.isSubstitude) {
  5505. this.getSubstitudeUserDeptList();
  5506. }
  5507. if(i == -1 || this.isSubstitude) {
  5508. this.isDisable = false;
  5509. } else {
  5510. this.isDisable = true;
  5511. }
  5512. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5513. this.isBatch = isBatch;
  5514. if (this.isBatch == 0 && !this.isSubstitude) {
  5515. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5516. let weekday = new Date(this.workForm.createDate).getDay()
  5517. if(this.user.companyId == 817){
  5518. if(weekday == 0){
  5519. this.isWeekend = true
  5520. }
  5521. }else{
  5522. if(weekday == 0 || weekday == 6){
  5523. this.isWeekend = true
  5524. }
  5525. }
  5526. this.getReport(i);
  5527. } else {
  5528. // console.log('执行到了这里')
  5529. this.jsTime = 0
  5530. this.jsDay = 0
  5531. this.workForm = {
  5532. createDate: null,//批量填报没有日期
  5533. domains: [{
  5534. id: null,
  5535. projectId: "",
  5536. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5537. content: "",
  5538. progress:100,
  5539. state: 2,
  5540. timeType:0,
  5541. multiWorktime: this.reportTimeType.multiWorktime,
  5542. worktimeList:[{}],
  5543. canEdit: true,
  5544. }],
  5545. }
  5546. if(this.user.timeType.type == 1) {
  5547. var shuzhi = this.user.timeType.allday + ''
  5548. // console.log('执行二次')
  5549. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5550. }
  5551. // console.log(this.workForm)
  5552. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5553. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5554. }
  5555. this.canEdit = true;
  5556. }
  5557. this.dialogVisible = true;
  5558. },
  5559. //按周填报的弹窗口中编辑单项目相关数据
  5560. setWeekFormReportItem(reportId, i, names, row,sss) {
  5561. console.log(sss)
  5562. this.http.post('/report/getReportById', {
  5563. reportId: reportId
  5564. },
  5565. res => {
  5566. if (res.code == "ok") {
  5567. var data = res.data.report;
  5568. sss.subProjectId = data.subProjectId
  5569. sss.subProjectList = data.subProjectList;
  5570. sss.stage = data.stage
  5571. sss.subProjectList = data.subProjectList
  5572. sss.stages = data.stages
  5573. sss.taskGroups = data.taskGroups;
  5574. sss.auditUserList = data.auditUserList;
  5575. sss.degreeId = data.degreeId;
  5576. sss.customData = data.customData;
  5577. sss.wuduList = data.degreeList;
  5578. this.zhoBaoIdx = i
  5579. this.zhoBaoName = names
  5580. this.zhoBao = sss
  5581. this.zhis = row
  5582. if (sss.groupId) {
  5583. //最后一个参数表示是否保留stage的值,不要重置为空
  5584. this.getGroupStages(this.zhoBao, 0, true)
  5585. }
  5586. this.$forceUpdate();
  5587. }
  5588. });
  5589. },
  5590. // 按周填报里内容的填写
  5591. tianxies(item, i, names, row) {
  5592. if (item.state == 0) {
  5593. this.$message({
  5594. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5595. type: "error"
  5596. });
  5597. return;
  5598. }
  5599. if (item.state == 1) {
  5600. this.$message({
  5601. message: '已通过状态不可修改',
  5602. type: "error"
  5603. });
  5604. return;
  5605. }
  5606. if(this.user.timeType.notAllowedNoAttendance == 1){
  5607. if(this.zhoData[i].corpTime){
  5608. if(this.zhoData[i].corpTime.workHours == 0){
  5609. this.$message({
  5610. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5611. type: 'error'
  5612. })
  5613. return
  5614. }
  5615. }else{
  5616. this.$message({
  5617. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5618. type: 'error'
  5619. })
  5620. return
  5621. }
  5622. }
  5623. var idd = ''
  5624. var obj = {}
  5625. for(var l in this.projectList) {
  5626. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5627. }
  5628. obj.projectId = idd
  5629. this.tianxieDialogVisible = true
  5630. this.scopess = item
  5631. var sss = {}
  5632. if (item.id != null) {
  5633. sss.id = item.id;
  5634. sss.state = item.state;
  5635. } else {
  5636. sss.id = -1;
  5637. sss.state = 3;
  5638. }
  5639. sss.projectId = idd;
  5640. sss.progress = item.progress
  5641. sss.time = item.time
  5642. sss.content = item.content;
  5643. console.log('333', sss.content)
  5644. if (sss.time == '' && this.reportTimeType.type == 2) {
  5645. //取已填时间范围中最大的一个作为开始时间
  5646. var startTime = '09:00';
  5647. var fillStartTime = '00:00';
  5648. for (var t in this.selProjectList) {
  5649. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5650. if (fillItem.time) {
  5651. if (fillItem.time[1] > fillStartTime) {
  5652. fillStartTime = fillItem.time[1];
  5653. }
  5654. }
  5655. }
  5656. if (fillStartTime == '00:00') {
  5657. fillStartTime = '09:00';
  5658. }
  5659. var fillEndMax = '18:00';
  5660. if (fillStartTime >= '18:00') {
  5661. fillEndMax = '23:59';
  5662. }
  5663. sss.time = [fillStartTime, fillEndMax];
  5664. }
  5665. sss.groupId = item.groupId
  5666. sss.stage = item.stage;
  5667. sss.workingTime = item.workingTime
  5668. sss.projectAuditorId = item.projectAuditorId;
  5669. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5670. //默认选中第一个
  5671. sss.basecostId = this.timeBasecostList[0].id;
  5672. }
  5673. var hasEdited = this.zhoData[i][names].hasEdited;
  5674. if (hasEdited) {
  5675. //编辑过了
  5676. sss.subProjectId = item.subProjectId
  5677. sss.stage = item.stage
  5678. sss.subProjectList = item.subProjectList
  5679. sss.stages = item.stages
  5680. sss.taskGroups = item.taskGroups;
  5681. console.log(sss.taskGroups, '33333');
  5682. sss.auditUserList = obj.auditUserList;
  5683. sss.degreeId = item.degreeId;
  5684. sss.customData = item.customData;
  5685. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5686. //只有一个审核人,自动设置上去
  5687. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5688. }
  5689. sss.wuduList = item.wuduList;
  5690. this.zhoBaoIdx = i
  5691. this.zhoBaoName = names
  5692. this.zhoBao = sss
  5693. this.zhis = row
  5694. if (sss.groupId) {
  5695. //最后一个参数表示是否保留stage的值,不要重置为空
  5696. this.getGroupStages(this.zhoBao, 0, true)
  5697. }
  5698. this.$forceUpdate();
  5699. } else {
  5700. //第一次打开,获取数据
  5701. if (sss.id == -1) {
  5702. //新填报的
  5703. this.selectProject(obj, 0);
  5704. var that = this
  5705. setTimeout(() =>{
  5706. sss.subProjectId = that.workForm.domains[0].subProjectId
  5707. sss.subProjectList = item.subProjectList;
  5708. sss.stage = that.workForm.domains[0].stage
  5709. sss.subProjectList = that.workForm.domains[0].subProjectList
  5710. sss.stages = that.workForm.domains[0].stages
  5711. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5712. sss.auditUserList = obj.auditUserList;
  5713. sss.degreeId = item.degreeId;
  5714. sss.customData = item.customData;
  5715. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5716. //只有一个审核人,自动设置上去
  5717. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5718. }
  5719. sss.wuduList = row[0].wuduList
  5720. that.zhoBaoIdx = i
  5721. that.zhoBaoName = names
  5722. that.zhoBao = sss
  5723. that.zhis = row
  5724. if (sss.groupId) {
  5725. //最后一个参数表示是否保留stage的值,不要重置为空
  5726. this.getGroupStages(that.zhoBao, 0, false)
  5727. }
  5728. that.$forceUpdate();
  5729. },600);
  5730. } else {
  5731. //编辑填报过的;数据库已经存在的
  5732. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5733. }
  5734. }
  5735. },
  5736. // 按周填报里内容的填写点击确定
  5737. setWeekProItemData() {
  5738. //专业版模式下,任务分组和阶段必填
  5739. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5740. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5741. this.$message({
  5742. message: '任务分组和阶段必填,请检查',
  5743. type: "error"
  5744. });
  5745. return;
  5746. }
  5747. }
  5748. //检查子项目是否必填
  5749. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5750. this.$message({
  5751. message: '子项目必填,请检查',
  5752. type: "error"
  5753. });
  5754. return;
  5755. }
  5756. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5757. this.$message({
  5758. message: this.$t('message.Pleaseselectareviewer'),
  5759. type: "error"
  5760. });
  5761. return
  5762. }
  5763. if(this.user.timeType.reportAuditType == 3){
  5764. let auditTips = ''
  5765. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5766. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5767. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5768. if(auditTips){
  5769. auditTips = auditTips.substring(0,auditTips.length - 1)
  5770. this.$message({
  5771. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5772. type: 'error'
  5773. })
  5774. return
  5775. }
  5776. }
  5777. let errtips = ''
  5778. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  5779. errtips += this.user.timeType.customDegreeName + '、'
  5780. }
  5781. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5782. errtips += this.user.timeType.customDataName + '、'
  5783. }
  5784. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5785. errtips += this.user.timeType.customTextName + '、'
  5786. }
  5787. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5788. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5789. }
  5790. if(errtips){
  5791. errtips = errtips.substring(0,errtips.length - 1)
  5792. this.$message({
  5793. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5794. type: 'error'
  5795. })
  5796. return
  5797. }
  5798. this.tianxieDialogVisible = false
  5799. var zhong = this.zhoData
  5800. this.zhoBao.hasEdited = true;
  5801. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5802. this.zhoData = zhong
  5803. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5804. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5805. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5806. },
  5807. // 获取本周
  5808. getCurrentWeek() {
  5809. //今天
  5810. this.targetWeekDate = new Date();
  5811. this.initWeekFormData();
  5812. // this.jiazai()
  5813. },
  5814. // 获取上周
  5815. handleGetPrevWeek() {
  5816. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5817. this.initWeekFormData();
  5818. // this.jiazai()
  5819. },
  5820. // 获取下周
  5821. handleGetNextvWeek() {
  5822. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5823. this.initWeekFormData()
  5824. },
  5825. // 加载动画
  5826. jiazai() {
  5827. this.weekDataLoading = true
  5828. var that = this
  5829. setTimeout(() =>{
  5830. that.weekDataLoading = false
  5831. },1000);
  5832. },
  5833. // 转时间格式
  5834. dealdate(date) {
  5835. const dt = new Date(date)
  5836. const y = dt.getFullYear()
  5837. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5838. const d = (dt.getDate() + '').padStart(2, '0')
  5839. return `${y}-${m}-${d}`
  5840. },
  5841. // 按周填报
  5842. fillInReportss() {
  5843. window.addEventListener('scroll', this.handleScroll, true)
  5844. // this.jiazai()
  5845. this.fillWeekDialogVisi = true
  5846. this.getCurrentWeek();
  5847. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5848. //重新获取工时预警类型的预算项
  5849. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5850. companyId: this.user.companyId
  5851. },
  5852. res => {
  5853. if (res.code == "ok") {
  5854. this.timeBasecostList = res.data;
  5855. }
  5856. });
  5857. }
  5858. },
  5859. fillInReportCustom() {
  5860. this.weekIndex++
  5861. this.weekParentData = {
  5862. isSubstitude: this.isSubstitude
  5863. }
  5864. this.fillWeekDialogVisiCustom = true
  5865. },
  5866. // 按周填报的项目筛选
  5867. selListFun(){
  5868. this.selProjectList = []
  5869. if(this.selCon.length){
  5870. for (let i = 0; i < this.selCon.length; i++) {
  5871. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5872. }
  5873. this.selConShow = false ;
  5874. for (let i in this.zhoData) {
  5875. var obj = this.zhoData[i];
  5876. for(var j in this.selProjectList) {
  5877. var xinzhi = this.selProjectList[j].projectName
  5878. obj[xinzhi] = {}
  5879. obj[xinzhi].time = ''
  5880. obj[xinzhi].content = ''
  5881. obj[xinzhi].progress = 0
  5882. obj[xinzhi].workingTime = 0
  5883. }
  5884. }
  5885. this.initWeekFormData();
  5886. }else{
  5887. this.$message({
  5888. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5889. type:'error'
  5890. })
  5891. }
  5892. },
  5893. setWeekCardTimeData(list) {
  5894. for(let i in list){
  5895. let datei = '';
  5896. if (this.user.timeType.showDdCardtime == 1) {
  5897. datei = list[i].workDate;
  5898. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5899. datei = list[i].createDate;
  5900. } else if (this.user.timeType.syncFanwei == 1) {
  5901. datei = list[i].workDate;
  5902. }
  5903. for(let m in this.zhoData) {
  5904. if(datei == this.zhoData[m].zhoDataTime){
  5905. let item = {
  5906. startTime: list[i].startTime,
  5907. endTime: list[i].endTime,
  5908. workHours: list[i].workHours
  5909. }
  5910. this.$set(this.zhoData[m],'corpTime',item)
  5911. }
  5912. }
  5913. }
  5914. },
  5915. getWeeklyCardTime(){ //按周填报获取考勤信息
  5916. let dateStr = []
  5917. for(let i in this.zhoData){
  5918. dateStr.push(this.zhoData[i].zhoDataTime)
  5919. }
  5920. this.http.post('/report/getWeeklyCardTime',{
  5921. dateStr: JSON.stringify(dateStr)
  5922. },res => {
  5923. if(res.code == 'ok'){
  5924. for(let i in res.data){
  5925. let datei = '';
  5926. if (this.user.timeType.showDdCardtime == 1) {
  5927. datei = res.data[i].workDate.split('-');
  5928. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5929. datei = res.data[i].createDate.split('-');
  5930. }
  5931. for(let m in this.zhoData){
  5932. let datem = new Date(this.zhoData[m].zhoDataTime)
  5933. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5934. let item = {
  5935. startTime: res.data[i].startTime,
  5936. endTime: res.data[i].endTime,
  5937. workHours: res.data[i].workHours
  5938. }
  5939. this.$set(this.zhoData[m],'corpTime',item)
  5940. }
  5941. }
  5942. }
  5943. }else{
  5944. this.$message({
  5945. message: res.msg,
  5946. type: 'error'
  5947. })
  5948. }
  5949. },err => {
  5950. this.$message({
  5951. message: err,
  5952. type: 'error'
  5953. })
  5954. })
  5955. },
  5956. selListqx(){
  5957. this.fillWeekDialogVisi = false
  5958. this.selProjectList = []
  5959. this.selCon = []
  5960. },
  5961. handleScroll() {
  5962. this.changdu = this.projectList.length + 1
  5963. },
  5964. // 自动选择时间点的事件
  5965. // async zhoTimes(item, i) {
  5966. // var iss = i
  5967. // if(item.time == null) {
  5968. // return
  5969. // } else {
  5970. // const zhi = this.zhoData[iss];
  5971. // let he = 0;
  5972. // const timeArr = Object.values(zhi)
  5973. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  5974. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  5975. // const data = await this.getWeekHoursByTimeRange(timeArr);
  5976. // console.log(data, 'data');
  5977. // zhi.he = `${he}h`;
  5978. // }
  5979. // },
  5980. async zhoTimes(item, index) {
  5981. const zho = this.zhoData[index];
  5982. if (!item.time) {
  5983. return;
  5984. }
  5985. const timeArr = Object.values(zho)
  5986. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  5987. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  5988. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  5989. zho.he = `${totalHours[0]}h`;
  5990. },
  5991. // 判断两个时间段是否重叠
  5992. timeOverlap(idx, dateAr) {
  5993. let zhi = 0
  5994. for (let k in dateAr) {
  5995. if (idx !== k) {
  5996. 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))) {
  5997. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  5998. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  5999. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6000. }
  6001. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6002. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6003. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6004. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6005. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6006. } else {
  6007. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6008. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6009. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6010. }
  6011. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6012. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6013. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6014. }
  6015. }
  6016. }
  6017. }
  6018. }
  6019. return zhi
  6020. },
  6021. // 计算时间
  6022. getHourMinutes(str, end) {
  6023. var he = 0
  6024. var date2 = '2021/12/12 ' + end +':00'
  6025. var date1 = '2021/12/12 ' + str +':00'
  6026. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6027. var leave1=date3%(24*3600*1000)
  6028. var hours=Math.floor(leave1/(3600*1000))
  6029. var leave2=leave1%(3600*1000)
  6030. var minutes=Math.floor(leave2/(60*1000))
  6031. var shi = hours+'.'+ minutes
  6032. return he += +shi
  6033. },
  6034. // 自动选择事件长度的事件
  6035. zhoXuan(item, i) {
  6036. var iss = i
  6037. if(item.time == null) {
  6038. return
  6039. } else {
  6040. var zhi = this.zhoData[iss]
  6041. var he = 0
  6042. for(var i in zhi) {
  6043. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6044. he += +zhi[i].workingTime
  6045. }
  6046. }
  6047. zhi.he = he + 'h'
  6048. }
  6049. },
  6050. getPushWorkLogData(){
  6051. this.http.post('/sap-sync-log/list', {},
  6052. res => {
  6053. if (res.code == "ok") {
  6054. this.pushWorkTimeLogData = res.data;
  6055. } else {
  6056. this.$message({
  6057. message: res.msg,
  6058. type: "error"
  6059. });
  6060. }
  6061. },
  6062. error => {
  6063. this.$message({
  6064. message: error,
  6065. type: "error"
  6066. });
  6067. });
  6068. },
  6069. // 获取全部人员
  6070. getUsers() {
  6071. this.http.post('/user/getSimpleActiveUserList', {},
  6072. res => {
  6073. if (res.code == "ok") {
  6074. this.usersList = res.data;
  6075. } else {
  6076. this.$message({
  6077. message: res.msg,
  6078. type: "error"
  6079. });
  6080. }
  6081. },
  6082. error => {
  6083. this.$message({
  6084. message: error,
  6085. type: "error"
  6086. });
  6087. });
  6088. },
  6089. // 按时间比例
  6090. addBli(item, i) {
  6091. var iss = i
  6092. if(item.time == null) {
  6093. return
  6094. } else {
  6095. var zhi = this.zhoData[iss]
  6096. var he = 0
  6097. for(var i in zhi) {
  6098. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6099. he += +zhi[i].workingTime
  6100. }
  6101. }
  6102. zhi.he = he.toFixed(1) + 'h'
  6103. }
  6104. },
  6105. //按周填报选择的项目发生变化,需要设置列
  6106. onSelProjectChange() {
  6107. for (let i = 0; i < this.selCon.length; i++) {
  6108. var exists = false;
  6109. for (let j = 0; j < this.selProjectList.length; j++) {
  6110. if (this.selProjectList[j].id == this.selCon[i]) {
  6111. exists = true;
  6112. break;
  6113. }
  6114. }
  6115. if (!exists) {
  6116. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6117. this.selProjectList.push(newProject);
  6118. //添加新项目
  6119. for (var w in this.zhoData) {
  6120. var dayItem = this.zhoData[w];
  6121. var pName = newProject.projectName;
  6122. dayItem[pName] = {};
  6123. dayItem[pName].time = ''
  6124. dayItem[pName].content = ''
  6125. dayItem[pName].progress = 0
  6126. dayItem[pName].workingTime = 0
  6127. }
  6128. }
  6129. }
  6130. //去掉
  6131. for (let j = 0; j < this.selProjectList.length; j++) {
  6132. var exists = false;
  6133. for (let i = 0; i < this.selCon.length; i++) {
  6134. if (this.selProjectList[j].id == this.selCon[i]) {
  6135. exists = true;
  6136. break;
  6137. }
  6138. }
  6139. if (!exists) {
  6140. this.selProjectList.splice(j, 1);
  6141. j--;
  6142. }
  6143. }
  6144. this.loadFilledWeekReportItem();
  6145. //刷新表格
  6146. // this.$refs.weekTable.doLayout();
  6147. },
  6148. //根据选中的项目来刷新填写表格
  6149. loadFilledWeekReportItem() {
  6150. for (var w in this.zhoData) {
  6151. var dayItem = this.zhoData[w];
  6152. for (var i = 0; i < this.selProjectList.length; i++) {
  6153. var curColumnProject = this.selProjectList[i];
  6154. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6155. for (var t in dayItem.reportList) {
  6156. //有日报的项目,不能取消选择
  6157. for (var p in this.fillProjectList) {
  6158. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6159. }
  6160. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6161. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6162. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6163. if (this.reportTimeType.type == 2) {
  6164. //时间段模式
  6165. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6166. }
  6167. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6168. break;
  6169. }
  6170. }
  6171. // dayItem[curColumnProject.projectName] = matchReportItem;
  6172. }
  6173. }
  6174. this.$nextTick(()=>{
  6175. this.$refs.weekTable.doLayout();
  6176. });
  6177. },
  6178. initWeekFormData() {
  6179. this.weekDataLoading = true;
  6180. for (var p in this.fillProjectList) {
  6181. this.fillProjectList[p].canCancel = 1;
  6182. }
  6183. this.http.post('/report/getWeeklyReportData',{
  6184. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6185. },res => {
  6186. this.weekDataLoading = false;
  6187. if(res.code == 'ok'){
  6188. let projectList = res.data.projectList;
  6189. if (projectList.length > 0) {
  6190. //有选择过项目进行填报,直接选中
  6191. this.selProjectList = projectList;
  6192. this.selCon = [];
  6193. for (let i = 0; i < projectList.length; i++) {
  6194. this.selCon.push(projectList[i].id);
  6195. }
  6196. }
  6197. //设置日期
  6198. this.weekDateRange = res.data.dateList;
  6199. this.zhoData = [];
  6200. var arrst = []
  6201. for(var i in this.weekDateRange) {
  6202. var obj = {}
  6203. obj.zhoDataTime = this.weekDateRange[i].date
  6204. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6205. obj.he = this.weekDateRange[i].filledTime;
  6206. obj.canFill = this.weekDateRange[i].canFill;
  6207. // obj.filledTime = this.weekDateRange[i].filledTime;
  6208. obj.reportList = this.weekDateRange[i].reportList;
  6209. //初始化,防止渲染报错
  6210. for (var j = 0; j < this.selProjectList.length; j++) {
  6211. var pName = this.selProjectList[j].projectName
  6212. obj[pName] = {}
  6213. obj[pName].time = ''
  6214. obj[pName].content = ''
  6215. obj[pName].progress = 0
  6216. obj[pName].workingTime = 0
  6217. }
  6218. arrst.push(obj)
  6219. }
  6220. this.zhoData = arrst
  6221. this.setWeekCardTimeData(res.data.cardTimeList);
  6222. this.loadFilledWeekReportItem();
  6223. }else{
  6224. this.$message({
  6225. message: res.msg,
  6226. type: 'error'
  6227. })
  6228. }
  6229. },err => {
  6230. this.$message({
  6231. message: err,
  6232. type: 'error'
  6233. })
  6234. })
  6235. },
  6236. zhoZhi(res, i) {
  6237. var zhi = 0
  6238. for(var i in res) {
  6239. if(i != 'zhoDataTime' && i != 'he') {
  6240. zhi += +res[i]
  6241. }
  6242. }
  6243. res.he = zhi
  6244. },
  6245. zhoBtn(i) {
  6246. // this.zhoData.split(i, 1)
  6247. var arr = this.zhoData
  6248. arr.splice(i, 1)
  6249. },
  6250. zhoAddlast(){
  6251. this.selConShow = true
  6252. },
  6253. closeAddWeeklyReport(){
  6254. this.fillWeekDialogVisi = false
  6255. this.selConShow = true
  6256. this.selProjectList = []
  6257. this.selCon = []
  6258. },
  6259. // 提交按周填报
  6260. submitWeekReport(isDraft) {
  6261. var zhi = this.zhoData
  6262. var ll = 0
  6263. if(this.reportTimeType.type == 2) {
  6264. for(var i in zhi) {
  6265. this.dateAr = []
  6266. var alp = []
  6267. var zhis = zhi[i]
  6268. console.log(zhis)
  6269. for(var j in zhis) {
  6270. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6271. let objs = {}
  6272. objs.s = zhis[j].time[0]
  6273. objs.e = zhis[j].time[1]
  6274. objs.p = j
  6275. alp.push(objs)
  6276. }
  6277. }
  6278. console.log(alp)
  6279. this.dateAr = alp
  6280. if (this.reportTimeType.timeCanOverlap == 0) {
  6281. let str = this.$t('message.Filledtimeperiodsoverlap')
  6282. if(this.dateAr.length > 0) {
  6283. const trus = this.fns();
  6284. const overlapDataTime = this.getOverlapData(alp);
  6285. if (overlapDataTime.length > 0) {
  6286. const arrList = overlapDataTime.map((item) => item.p);
  6287. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6288. }
  6289. ll += 1
  6290. if(!trus) {
  6291. this.$message({
  6292. message: str,
  6293. type: 'error'
  6294. })
  6295. return false
  6296. }
  6297. }
  6298. } else {
  6299. if(this.dateAr.length > 0) {
  6300. ll +=1 ;
  6301. }
  6302. }
  6303. }
  6304. if(ll == 0) {
  6305. this.$message({
  6306. message: this.$t('message.Pleasefillinthetime'),
  6307. type: 'error'
  6308. })
  6309. return false
  6310. }
  6311. } else if(this.reportTimeType.type == 1){
  6312. for(var i in zhi) {
  6313. var zhis = zhi[i]
  6314. for(var j in zhis) {
  6315. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6316. ll += 1
  6317. }
  6318. }
  6319. }
  6320. if(ll == 0) {
  6321. this.$message({
  6322. message: this.$t('message.Pleaseselectatime'),
  6323. type: 'error'
  6324. })
  6325. return false
  6326. }
  6327. let overcorp = ''
  6328. for(let n in zhi){
  6329. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6330. overcorp += zhi[n].zhoDataTime + ','
  6331. }
  6332. }
  6333. if(overcorp != ''){
  6334. overcorp = overcorp.substring(0,overcorp.length - 1)
  6335. this.$message({
  6336. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6337. type: 'error'
  6338. })
  6339. return
  6340. }
  6341. }
  6342. var submits = []
  6343. let formData = new FormData();
  6344. formData.append("draft", isDraft);
  6345. if(this.reportTimeType.multiWorktime == 1){
  6346. for (var i in this.zhoData) {
  6347. var zhoD = this.zhoData[i]
  6348. var flgs = false
  6349. for(var j in zhoD) {
  6350. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6351. flgs = true
  6352. // formData.append("degreeId", "-1");
  6353. formData.append("id", '-1');
  6354. for(var s in this.projectList) {
  6355. if(j == this.projectList[s].projectName) {
  6356. formData.append("projectId", this.projectList[s].id);
  6357. }
  6358. }
  6359. if(this.user.timeType.reportAuditType == 3){
  6360. let audItem = {}
  6361. if(this.user.timeType.auditLevel > 0){
  6362. audItem.auditorFirst = zhoD[j].auditorFirst
  6363. }
  6364. if(this.user.timeType.auditLevel > 1){
  6365. audItem.auditorSec = zhoD[j].auditorSec
  6366. }
  6367. if(this.user.timeType.auditLevel > 2){
  6368. audItem.auditorThird = zhoD[j].auditorThird
  6369. }
  6370. if(zhoD[j].ccUserid){
  6371. audItem.ccUserid = zhoD[j].ccUserid
  6372. }
  6373. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6374. }
  6375. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6376. formData.append("taskId", 0);
  6377. formData.append("reportTimeType", this.reportTimeType.type);
  6378. formData.append("endTime", '');
  6379. formData.append("startTime", '');
  6380. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6381. var lix = []
  6382. var objjs = {}
  6383. objjs.startTime = zhoD[j].time[0]
  6384. objjs.endTime = zhoD[j].time[1]
  6385. if (zhoD[j].content == null || zhoD[j].content == '') {
  6386. zhoD[j].content == '-'
  6387. }
  6388. objjs.content = zhoD[j].content
  6389. lix.push(objjs)
  6390. var zhiZhi = JSON.stringify(lix)
  6391. zhiZhi = zhiZhi.replace(/,/g,"@");
  6392. formData.append("content", zhiZhi)
  6393. formData.append("isOvertime", 0)
  6394. formData.append("professionProgress", "[]")
  6395. if (zhoD[j].groupId) {
  6396. formData.append("groupId",zhoD[j].groupId)
  6397. } else {
  6398. //解决后台groupId数组越界的问题
  6399. formData.append("groupId",0)
  6400. }
  6401. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6402. formData.append("createDate",zhoD.zhoDataTime)
  6403. if (zhoD[j].projectAuditorId) {
  6404. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6405. }
  6406. if(zhoD[j].basecostId) {
  6407. formData.append("basecostId", zhoD[j].basecostId);
  6408. } else {
  6409. formData.append("basecostId", 0);
  6410. }
  6411. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6412. formData.append('degreeId',zhoD[j].degreeId)
  6413. }else{
  6414. formData.append("degreeId", "-1");
  6415. }
  6416. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6417. formData.append('customData',zhoD[j].customData)
  6418. }else if(this.user.timeType.customDataActive){
  6419. formData.append('customData',0)
  6420. }
  6421. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6422. formData.append('customText',zhoD[j].customText)
  6423. }else if(this.user.timeType.customTextActive){
  6424. formData.append('customText','-')
  6425. }
  6426. }
  6427. }
  6428. }
  6429. } else {
  6430. for (var i in this.zhoData) {
  6431. var zhoD = this.zhoData[i]
  6432. var flgs = false
  6433. if(this.reportTimeType.type == 2) {
  6434. for(var k in this.selProjectList) {
  6435. var pItem = this.selProjectList[k];
  6436. var pName = pItem.projectName;
  6437. var j = pName;
  6438. console.log('j==周报中的项目='+j);
  6439. if(zhoD[j].time && zhoD[j].time != 'null') {
  6440. flgs = true
  6441. // formData.append("degreeId", "-1");
  6442. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6443. for(var s in this.projectList) {
  6444. if(j == this.projectList[s].projectName) {
  6445. formData.append("projectId", this.projectList[s].id);
  6446. }
  6447. }
  6448. if(this.user.timeType.reportAuditType == 3){
  6449. let audItem = {}
  6450. if(this.user.timeType.auditLevel > 0){
  6451. audItem.auditorFirst = zhoD[j].auditorFirst
  6452. }
  6453. if(this.user.timeType.auditLevel > 1){
  6454. audItem.auditorSec = zhoD[j].auditorSec
  6455. }
  6456. if(this.user.timeType.auditLevel > 2){
  6457. audItem.auditorThird = zhoD[j].auditorThird
  6458. }
  6459. if(zhoD[j].ccUserid){
  6460. audItem.ccUserid = zhoD[j].ccUserid
  6461. }
  6462. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6463. }
  6464. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6465. formData.append("taskId", 0);
  6466. formData.append("reportTimeType", this.reportTimeType.type);
  6467. formData.append("endTime", zhoD[j].time[1]);
  6468. formData.append("startTime", zhoD[j].time[0]);
  6469. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6470. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6471. formData.append("isOvertime", 0)
  6472. formData.append("professionProgress", "[]")
  6473. if (zhoD[j].groupId) {
  6474. formData.append("groupId",zhoD[j].groupId)
  6475. } else {
  6476. //解决后台groupId数组越界的问题
  6477. formData.append("groupId",0)
  6478. }
  6479. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6480. formData.append("createDate",zhoD.zhoDataTime)
  6481. if (zhoD[j].projectAuditorId) {
  6482. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6483. }
  6484. if(zhoD[j].basecostId) {
  6485. formData.append("basecostId", zhoD[j].basecostId);
  6486. } else {
  6487. formData.append("basecostId", 0);
  6488. }
  6489. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6490. formData.append('degreeId',zhoD[j].degreeId)
  6491. }else{
  6492. formData.append("degreeId", "-1");
  6493. }
  6494. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6495. formData.append('customData',zhoD[j].customData)
  6496. }else if(this.user.timeType.customDataActive){
  6497. formData.append('customData',0)
  6498. }
  6499. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6500. formData.append('customText',zhoD[j].customText)
  6501. }else if(this.user.timeType.customTextActive){
  6502. formData.append('customText','-')
  6503. }
  6504. }
  6505. }
  6506. } else {
  6507. for(var k in this.selProjectList) {
  6508. var pItem = this.selProjectList[k];
  6509. var pName = pItem.projectName;
  6510. var j = pName;
  6511. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6512. flgs = true
  6513. // formData.append("degreeId", "-1");
  6514. console.log('进入了workFpppp==='+j);
  6515. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6516. for(var s in this.projectList) {
  6517. if(j == this.projectList[s].projectName) {
  6518. formData.append("projectId", this.projectList[s].id);
  6519. }
  6520. }
  6521. if(this.user.timeType.reportAuditType == 3){
  6522. let audItem = {}
  6523. if(this.user.timeType.auditLevel > 0){
  6524. audItem.auditorFirst = zhoD[j].auditorFirst
  6525. }
  6526. if(this.user.timeType.auditLevel > 1){
  6527. audItem.auditorSec = zhoD[j].auditorSec
  6528. }
  6529. if(this.user.timeType.auditLevel > 2){
  6530. audItem.auditorThird = zhoD[j].auditorThird
  6531. }
  6532. if(zhoD[j].ccUserid){
  6533. audItem.ccUserid = zhoD[j].ccUserid
  6534. }
  6535. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6536. }
  6537. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6538. // formData.append("subProjectId", zhoD[j].subProjectId);
  6539. formData.append("taskId", 0);
  6540. formData.append("reportTimeType", this.reportTimeType.type);
  6541. if(this.reportTimeType.type == 1) {
  6542. formData.append("workingTime", zhoD[j].workingTime);
  6543. } else if(this.reportTimeType.type == 2) {
  6544. formData.append("endTime", zhoD[j].time[1]);
  6545. formData.append("startTime", zhoD[j].time[0]);
  6546. } else if(this.reportTimeType.type == 3) {
  6547. formData.append("progress", zhoD[j].progress);
  6548. formData.append("workingTime", zhoD[j].workingTime);
  6549. }
  6550. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6551. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6552. formData.append("isOvertime", 0)
  6553. formData.append("professionProgress", "[]")
  6554. if (zhoD[j].groupId) {
  6555. formData.append("groupId",zhoD[j].groupId)
  6556. } else {
  6557. //解决后台groupId数组越界的问题
  6558. formData.append("groupId",0)
  6559. }
  6560. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6561. formData.append("createDate",zhoD.zhoDataTime)
  6562. if (zhoD[j].projectAuditorId) {
  6563. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6564. }
  6565. if(zhoD[j].basecostId) {
  6566. formData.append("basecostId", zhoD[j].basecostId);
  6567. } else {
  6568. formData.append("basecostId", 0);
  6569. }
  6570. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6571. formData.append('degreeId',zhoD[j].degreeId)
  6572. }else{
  6573. formData.append("degreeId", "-1");
  6574. }
  6575. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6576. formData.append('customData',zhoD[j].customData)
  6577. }else if(this.user.timeType.customDataActive){
  6578. formData.append('customData',0)
  6579. }
  6580. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6581. formData.append('customText',zhoD[j].customText)
  6582. }else if(this.user.timeType.customTextActive){
  6583. formData.append('customText','-')
  6584. }
  6585. }
  6586. }
  6587. }
  6588. }
  6589. }
  6590. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6591. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6592. if(!next) {
  6593. this.$message({
  6594. message: `【${error.join('、')}】请填写任务分组`,
  6595. type: 'error'
  6596. })
  6597. return
  6598. }
  6599. // 自定义维度
  6600. this.submitingReport = true;
  6601. this.http.uploadFile( this.port.report.editPort, formData,
  6602. res => {
  6603. // this.listLoading = false;
  6604. this.submitingReport = false;
  6605. if (res.code == "ok") {
  6606. this.$message({
  6607. message: this.$t('message.fillinsuccessfully'),
  6608. type: "success"
  6609. });
  6610. this.fillWeekDialogVisi = false
  6611. this.selConShow = true
  6612. this.zhoData = []
  6613. this.weekDateRange = ''
  6614. this.getReportList();
  6615. this.getDepartment();
  6616. // 关闭弹窗 并 清空
  6617. this.selProjectList = []
  6618. this.selCon = []
  6619. this.getRecentlyProject()
  6620. } else {
  6621. this.$message({
  6622. message: res.msg,
  6623. type: "error"
  6624. });
  6625. }
  6626. },
  6627. error => {
  6628. this.submitingReport = false;
  6629. this.$message({
  6630. message: error,
  6631. type: "error"
  6632. });
  6633. });
  6634. },
  6635. handleGroupAuditorData(data) {
  6636. const { reportAuditType } = this.user.timeType
  6637. if(reportAuditType != 1 && reportAuditType != 2) {
  6638. return {next: true}
  6639. }
  6640. let arrList = [];
  6641. Object.entries(data).forEach(([key, obj]) => {
  6642. Object.entries(obj).forEach(([projectName, projectData]) => {
  6643. if (projectData.workingTime && !projectData.groupId) {
  6644. arrList.push({
  6645. projectName,
  6646. date: obj.zhoDataTime,
  6647. dateText: obj.zhoDataTimeTxt
  6648. });
  6649. }
  6650. });
  6651. });
  6652. if(arrList.length > 0) {
  6653. return {
  6654. next: false,
  6655. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6656. }
  6657. } else {
  6658. return {
  6659. next: true,
  6660. error: [],
  6661. }
  6662. }
  6663. },
  6664. ChangeHourMinutestr (str) {
  6665. if (str !== "0" && str !== "" && str !== null) {
  6666. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6667. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6668. } else {
  6669. return "";
  6670. }
  6671. },
  6672. // 得到两个日期中间的日期
  6673. getdiffdate(stime,etime){
  6674. //初始化日期列表,数组
  6675. var diffdate = new Array();
  6676. var i=0;
  6677. //开始日期小于等于结束日期,并循环
  6678. while(stime<=etime){
  6679. diffdate[i] = stime;
  6680. //获取开始日期时间戳
  6681. var stime_ts = new Date(stime).getTime();
  6682. //增加一天时间戳后的日期
  6683. var next_date = stime_ts + (24*60*60*1000);
  6684. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6685. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6686. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6687. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6688. stime = next_dates_y+next_dates_m+next_dates_d;
  6689. //增加数组key
  6690. i++;
  6691. }
  6692. return diffdate;
  6693. },
  6694. // 添加模块
  6695. addDomain(i) {
  6696. var leftProgress = 10;
  6697. if (this.reportTimeType.type == 3) {
  6698. //计算已经待分配工时比例
  6699. let array = this.workForm.domains;
  6700. let totalProgress = 0;
  6701. for (var i=0;i<array.length; i++) {
  6702. totalProgress += array[i].progress;
  6703. }
  6704. if (totalProgress < 100) {
  6705. leftProgress = 100 - totalProgress;
  6706. }
  6707. }
  6708. var addItem = {
  6709. projectId: "",
  6710. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6711. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6712. ),
  6713. content: "",
  6714. progress:leftProgress,
  6715. state:2,//2-表示待提交
  6716. multiWorktime: this.reportTimeType.multiWorktime,
  6717. worktimeList:[{}],
  6718. canEdit: true,
  6719. auditorFirst: '',
  6720. auditorSec: '',
  6721. auditorThird: '',
  6722. ccUserid: ''
  6723. // degreeId: '',
  6724. };
  6725. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6726. this.$set(addItem,'isOvertime',true)
  6727. if(this.reportTimeType.type == 3){
  6728. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6729. }
  6730. }
  6731. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6732. //默认给第一个,必填字段
  6733. addItem.basecostId = this.timeBasecostList[0].id;
  6734. }
  6735. this.workForm.domains.push(addItem);
  6736. document.getElementById('workFormsItemBottom').scrollIntoView()
  6737. this.canEdit = true
  6738. if (this.reportTimeType.type == 0) {
  6739. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6740. var length = this.workForm.domains.length;
  6741. if (length == 2) {
  6742. this.showAddMore = false;
  6743. }
  6744. }
  6745. this.chuji()
  6746. this.seleChn()
  6747. },
  6748. // 移除模块
  6749. delDomain(i) {
  6750. this.workForm.domains.splice(i,1)
  6751. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6752. if (!this.originCanEdit) {
  6753. let iscan = false
  6754. for(let i in this.workForm.domains){
  6755. if(this.workForm.domains[i].canEdit){
  6756. iscan = true
  6757. }
  6758. }
  6759. this.canEdit = iscan
  6760. }
  6761. //检测当前剩下的一个,时间类型是否是全天
  6762. if (this.reportTimeType.type == 0) {
  6763. if (this.workForm.domains[0].timeType == 0) {
  6764. this.showAddMore = false;
  6765. } else {
  6766. this.showAddMore = true;
  6767. }
  6768. }
  6769. if(this.user.timeType.multiWorktime == 1) {
  6770. this.iptChangs()
  6771. } else {
  6772. this.seleChn(0)
  6773. }
  6774. },
  6775. // 改变月份
  6776. changeMonth() {
  6777. this.isWeekend = false
  6778. let date = new Date()
  6779. let nowmon = date.getMonth() + 1
  6780. let nowday = date.getDate()
  6781. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6782. if (this.isBatch == 0) {
  6783. if(this.user.timeType.fillAhead == 0){
  6784. let date_a = new Date(this.workForm.createDate)
  6785. if(date_a.getTime() > date.getTime()){
  6786. this.workForm.createDate = nowdate
  6787. }
  6788. }
  6789. //只有按天填报才能获取当天的日报
  6790. if(!this.isSubstitude){
  6791. let weekday = new Date(this.workForm.createDate).getDay()
  6792. if(this.user.companyId == 817){
  6793. if(weekday == 0){
  6794. this.isWeekend = true
  6795. }
  6796. }else{
  6797. if(weekday == 0 || weekday == 6){
  6798. this.isWeekend = true
  6799. }
  6800. }
  6801. this.getReport()
  6802. }
  6803. }else {
  6804. if(this.user.timeType.fillAhead == 0){
  6805. let date_a = new Date(this.workForm.createDate[1])
  6806. if(date_a.getTime() > date.getTime()){
  6807. this.workForm.createDate[1] = nowdate
  6808. let sdate = new Date(this.workForm.createDate[0])
  6809. let edate = new Date(this.workForm.createDate[1])
  6810. if(sdate > edate){
  6811. this.workForm.createDate[0] = this.workForm.createDate[1]
  6812. }
  6813. }
  6814. }
  6815. }
  6816. },
  6817. // 判断时间段
  6818. fns() {
  6819. for (let k in this.dateAr) {
  6820. if (!this.judege(k)) {
  6821. return false
  6822. }
  6823. }
  6824. return true
  6825. },
  6826. judege(idx){
  6827. for (let k in this.dateAr) {
  6828. if (idx !== k) {
  6829. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6830. return false
  6831. }
  6832. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6833. return false
  6834. }
  6835. }
  6836. }
  6837. return true
  6838. },
  6839. getOverlapData(data) {
  6840. let overlapData = [];
  6841. for (let i = 0; i < data.length; i++) {
  6842. for (let j = i + 1; j < data.length; j++) {
  6843. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6844. overlapData.push(data[i], data[j]);
  6845. }
  6846. }
  6847. }
  6848. return overlapData;
  6849. },
  6850. // 保存日报111111
  6851. submitReport(isDraft) {
  6852. this.isDraft = isDraft;
  6853. this.$refs.workForm.validate(valid => {
  6854. if (valid) {
  6855. if(this.totalReportHours < this.user.timeType.allday){
  6856. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6857. confirmButtonText: '确定',
  6858. cancelButtonText: '取消',
  6859. type: 'warning'
  6860. }).then(() => {
  6861. this.submitReportSon()
  6862. }).catch(() => {
  6863. });
  6864. }else{
  6865. this.submitReportSon()
  6866. }
  6867. }
  6868. });
  6869. },
  6870. submitReportSon() {
  6871. this.dateAr = []
  6872. //检查重叠
  6873. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6874. let alp = []
  6875. if(this.user.timeType.multiWorktime != 1) {
  6876. for(var p in this.workForm.domains) {
  6877. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6878. let objs = {}
  6879. objs.s = this.workForm.domains[p].startTime
  6880. objs.e = this.workForm.domains[p].endTime
  6881. alp.push(objs)
  6882. }
  6883. }
  6884. this.dateAr = alp
  6885. if(this.dateAr.length > 0) {
  6886. let trus = this.fns()
  6887. if(!trus) {
  6888. this.$message({
  6889. message: this.$t('message.Filledtimeperiodsoverlap'),
  6890. type: "error"
  6891. });
  6892. return
  6893. }
  6894. }
  6895. } else {
  6896. for(var p in this.workForm.domains) {
  6897. var slll = this.workForm.domains[p]
  6898. for(var o in slll.worktimeList) {
  6899. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6900. let objs = {}
  6901. objs.s = slll.worktimeList[o].startTime
  6902. objs.e = slll.worktimeList[o].endTime
  6903. alp.push(objs)
  6904. }
  6905. }
  6906. }
  6907. this.dateAr = alp
  6908. if(this.dateAr.length > 0) {
  6909. let trus = this.fns()
  6910. if(!trus) {
  6911. this.$message({
  6912. message: this.$t('message.Filledtimeperiodsoverlap'),
  6913. type: "error"
  6914. });
  6915. return
  6916. }
  6917. }
  6918. }
  6919. }
  6920. //检查子项目
  6921. if (this.user.timeType.subProMustFill == 1) {
  6922. for(var p in this.workForm.domains) {
  6923. var oneProItem = this.workForm.domains[p]
  6924. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6925. //没有选择子项目
  6926. this.$message({
  6927. message: '子项目必填,请检查',
  6928. type: "error"
  6929. });
  6930. return
  6931. }
  6932. }
  6933. }
  6934. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  6935. if (this.user.companyId == this.yuzhongCompId) {
  6936. for(var p in this.workForm.domains) {
  6937. var oneProItem = this.workForm.domains[p]
  6938. if (!oneProItem.extraField1) {
  6939. this.$message({
  6940. message: '角色必填,请检查',
  6941. type: "error"
  6942. });
  6943. return
  6944. }
  6945. if (!oneProItem.extraField2) {
  6946. this.$message({
  6947. message: '工作职责必填,请检查',
  6948. type: "error"
  6949. });
  6950. return
  6951. }
  6952. if (!oneProItem.extraField3) {
  6953. this.$message({
  6954. message: '工作内容必填,请检查',
  6955. type: "error"
  6956. });
  6957. return
  6958. }
  6959. }
  6960. }
  6961. // return
  6962. //代填的情况,检查人员是否已经选择
  6963. if (this.isSubstitude) {
  6964. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  6965. this.$message({
  6966. message: this.$t('message.pleaseselectthepersontofillin'),
  6967. type: "error"
  6968. });
  6969. return;
  6970. }
  6971. }
  6972. //检查时间,全天和上下午不能同时存在
  6973. if (this.reportTimeType.type == 0) {
  6974. var alldayNum = 0;
  6975. var amNum = 0;
  6976. var pmNum = 0;
  6977. for(var i in this.workForm.domains) {
  6978. if (this.workForm.domains[i].timeType == 0) {
  6979. alldayNum ++;
  6980. } else if (this.workForm.domains[i].timeType == 1) {
  6981. amNum++;
  6982. } else if (this.workForm.domains[i].timeType == 2) {
  6983. pmNum++;
  6984. }
  6985. }
  6986. if (alldayNum > 1) {
  6987. this.$message({
  6988. // message: "工作时间-全天,只能选择一次",
  6989. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  6990. type: "error"
  6991. });
  6992. return;
  6993. }
  6994. if (amNum > 1) {
  6995. this.$message({
  6996. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  6997. type: "error"
  6998. });
  6999. return;
  7000. }
  7001. if (pmNum > 1) {
  7002. this.$message({
  7003. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7004. type: "error"
  7005. });
  7006. return;
  7007. }
  7008. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7009. this.$message({
  7010. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7011. type: "error"
  7012. });
  7013. return;
  7014. }
  7015. } else if (this.reportTimeType.type == 3) {
  7016. //总百分比不能超过100%
  7017. let total = 0;
  7018. this.workForm.domains.forEach(w=>{total += w.progress});
  7019. if (total > 100) {
  7020. this.$message({
  7021. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7022. type: "error"
  7023. });
  7024. return;
  7025. } else if (total < 100) {
  7026. this.$message({
  7027. message: this.$t('message.cannotbesubmitted'),
  7028. type: "error"
  7029. });
  7030. return;
  7031. }
  7032. }
  7033. this.listLoading = true;
  7034. let formData = new FormData();
  7035. formData.append("draft", this.isDraft);
  7036. var totalTime = 0;
  7037. for (var t=0;t<this.workForm.domains.length; t++) {
  7038. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7039. }
  7040. //批量填报不校验考勤时长,交给后台校验
  7041. if (!this.isBatch) {
  7042. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7043. if (this.workForm.time){
  7044. if (this.workForm.time.workHours == 0){
  7045. this.$message({
  7046. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7047. type: 'error'
  7048. })
  7049. return
  7050. }
  7051. }else{
  7052. this.$message({
  7053. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7054. type: 'error'
  7055. })
  7056. return
  7057. }
  7058. }
  7059. }
  7060. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7061. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7062. this.$message({
  7063. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7064. type: "error"
  7065. });
  7066. return;
  7067. }
  7068. }
  7069. for(var i in this.workForm.domains) {
  7070. if(this.user.timeType.reportAuditType == 3){
  7071. let audItem = {}
  7072. let auditRule = ''
  7073. if(this.workForm.domains[i].id){
  7074. audItem.reportId = this.workForm.domains[i].id
  7075. }
  7076. if(this.user.timeType.auditLevel > 0){
  7077. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7078. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7079. }
  7080. if(this.user.timeType.auditLevel > 1){
  7081. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7082. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7083. }
  7084. if(this.user.timeType.auditLevel > 2){
  7085. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7086. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7087. }
  7088. if(this.workForm.domains[i].ccUserid){
  7089. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7090. }
  7091. if(auditRule){
  7092. auditRule = auditRule.substring(0,auditRule.length - 1)
  7093. this.$message({
  7094. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7095. type: 'error'
  7096. })
  7097. return
  7098. }
  7099. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7100. }
  7101. if(this.workForm.domains[i].degreeId) {
  7102. // var sss = this.workForm.domains[i].degreeId.toString()
  7103. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7104. } else {
  7105. formData.append("degreeId", -1);
  7106. }
  7107. if(this.workForm.domains[i].customData) {
  7108. // var sss = this.workForm.domains[i].degreeId.toString()
  7109. formData.append("customData", this.workForm.domains[i].customData);
  7110. } else {
  7111. formData.append("customData", 0);
  7112. }
  7113. if(this.workForm.domains[i].customText) {
  7114. formData.append("customText", this.workForm.domains[i].customText);
  7115. } else {
  7116. formData.append("customText", '-');
  7117. }
  7118. if (this.workForm.domains[i].id) {
  7119. formData.append("id", this.workForm.domains[i].id);
  7120. } else {
  7121. formData.append("id", -1);
  7122. }
  7123. formData.append("projectId", this.workForm.domains[i].projectId);
  7124. if (this.workForm.domains[i].subProjectId) {
  7125. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7126. } else {
  7127. formData.append("subProjectId", 0);
  7128. }
  7129. if (this.workForm.domains[i].groupId) {
  7130. formData.append("groupId", this.workForm.domains[i].groupId);
  7131. } else {
  7132. formData.append("groupId", 0);
  7133. }
  7134. if (this.workForm.domains[i].taskId) {
  7135. formData.append("taskId", this.workForm.domains[i].taskId);
  7136. } else {
  7137. formData.append("taskId", 0);
  7138. }
  7139. if (this.workForm.domains[i].taskFinish == true) {
  7140. formData.append("taskFinish", 1);
  7141. } else {
  7142. formData.append("taskFinish", 0);
  7143. }
  7144. formData.append("reportTimeType", this.reportTimeType.type);
  7145. if (this.reportTimeType.type == 0) {
  7146. formData.append("timeType", this.workForm.domains[i].timeType);
  7147. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7148. formData.append("workingTime", workingTime);
  7149. } else if (this.reportTimeType.type == 1){
  7150. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7151. } else if (this.reportTimeType.type == 2) {
  7152. formData.append("endTime", this.workForm.domains[i].endTime);
  7153. formData.append("startTime", this.workForm.domains[i].startTime);
  7154. } else if (this.reportTimeType.type == 3) {
  7155. //按比例分配
  7156. formData.append("progress", this.workForm.domains[i].progress);
  7157. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7158. }
  7159. if(this.user.timeType.choseFromAlbum == 1 ) {
  7160. console.log(this.workForm.domains[i].imgList)
  7161. if(this.workForm.domains[i].imgList) {
  7162. let imgListFor = this.workForm.domains[i].imgList
  7163. for(var b in imgListFor) {
  7164. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7165. }
  7166. console.log(imgListFor)
  7167. let m = JSON.stringify(imgListFor);
  7168. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7169. formData.append("picStr", m);
  7170. } else {
  7171. formData.append("picStr", '[]');
  7172. }
  7173. }
  7174. //处理多个时间事项
  7175. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7176. if (this.reportTimeType.multiWorktime == 1) {
  7177. //检查时间是否有重叠
  7178. var workList = this.workForm.domains[i].worktimeList;
  7179. for (var j=0;j<workList.length; j++) {
  7180. var curItem = workList[j];
  7181. //检查开始时间是否大于结束时间
  7182. if (curItem.startTime >= curItem.endTime) {
  7183. this.$message({
  7184. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7185. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7186. type: "error"
  7187. });
  7188. return;
  7189. }
  7190. //时间不可重叠
  7191. if (this.reportTimeType.timeCanOverlap == 0) {
  7192. for (var p = j+1;p<workList.length; p++) {
  7193. var jItem = workList[p];
  7194. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7195. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7196. this.$message({
  7197. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7198. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7199. type: "error"
  7200. });
  7201. return;
  7202. }
  7203. }
  7204. }
  7205. }
  7206. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7207. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7208. formData.append("content", m);
  7209. } else {
  7210. if (this.workForm.domains[i].content) {
  7211. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7212. m = m.replace(/,/g,",");
  7213. console.log(m, '需要传值的数据')
  7214. // formData.append("content", this.workForm.domains[i].content);
  7215. formData.append("content", m);
  7216. } else {
  7217. formData.append("content", '-');
  7218. }
  7219. }
  7220. if (this.isBatch == 0) {
  7221. formData.append("createDate", this.workForm.createDate);
  7222. } else {
  7223. //批量填报,时间范围
  7224. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7225. }
  7226. if(this.workForm.domains[i].isOvertime) {
  7227. formData.append("isOvertime", 1);
  7228. } else {
  7229. formData.append("isOvertime", 0);
  7230. }
  7231. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7232. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7233. } else {
  7234. formData.append("overtimeHours", 0);
  7235. }
  7236. if(this.workForm.domains[i].basecostId) {
  7237. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7238. } else {
  7239. formData.append("basecostId", 0);
  7240. }
  7241. if (this.workForm.userId != null) {
  7242. var targetUids = '';
  7243. this.workForm.userId.forEach(u=>{
  7244. targetUids += u + '@';
  7245. });
  7246. if (targetUids.length > 0) {
  7247. targetUids = targetUids.substring(0, targetUids.length -1);
  7248. formData.append("targetUids", targetUids);
  7249. }
  7250. }
  7251. //项目专业进度
  7252. if (this.workForm.domains[i].professionProgress) {
  7253. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7254. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7255. formData.append("professionProgress", m);
  7256. } else {
  7257. formData.append("professionProgress", "[]");
  7258. }
  7259. if (this.workForm.domains[i].stage) {
  7260. formData.append("stage", this.workForm.domains[i].stage);
  7261. } else {
  7262. formData.append("stage", "-");
  7263. }
  7264. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7265. if (this.workForm.domains[i].projectAuditorId) {
  7266. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7267. } else {
  7268. // console.log('执行到了这里')
  7269. // console.log(this.user.timeType.reportAuditType)
  7270. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7271. this.$message({
  7272. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7273. type: "error"
  7274. });
  7275. return;
  7276. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7277. //分组负责人先审核, 确定是选择了任务分组
  7278. if (this.workForm.domains[i].taskGroups.length == 0) {
  7279. this.$message({
  7280. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7281. type: "error"
  7282. });
  7283. } else if (!this.workForm.domains[i].groupId) {
  7284. // console.log(this.workForm.domains[i]);
  7285. this.$message({
  7286. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7287. type: "error"
  7288. });
  7289. } else {
  7290. this.$message({
  7291. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7292. type: "error"
  7293. });
  7294. }
  7295. return;
  7296. }
  7297. }
  7298. if (this.user.companyId == this.yuzhongCompId) {
  7299. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7300. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7301. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7302. }
  7303. //依斯贝的服务Id
  7304. if (this.user.companyId == this.yisibeiCompId) {
  7305. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7306. }
  7307. }
  7308. this.submitingReport = true;
  7309. this.http.uploadFile( this.port.report.editPort, formData,
  7310. res => {
  7311. this.listLoading = false;
  7312. this.submitingReport = false;
  7313. if (res.code == "ok") {
  7314. if(res.msg!=null){
  7315. this.$message({
  7316. dangerouslyUseHTMLString: true,
  7317. message: res.msg,
  7318. type: "warning",
  7319. showClose: true,
  7320. duration: 0
  7321. });
  7322. }else{
  7323. this.$message({
  7324. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7325. type: "success"
  7326. });
  7327. }
  7328. this.dialogVisible = false;
  7329. this.jsDay = 0
  7330. this.jsTime = 0
  7331. this.getReportList();
  7332. this.getDepartment();
  7333. this.getRecentlyProject()
  7334. } else {
  7335. this.$message({
  7336. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7337. type: "error"
  7338. });
  7339. }
  7340. },
  7341. error => {
  7342. this.listLoading = false;
  7343. this.submitingReport = false;
  7344. this.$message({
  7345. message: error,
  7346. type: "error"
  7347. });
  7348. });
  7349. },
  7350. // 判断是展示那个工时导入
  7351. imports() {
  7352. if(this.user.timeType.syncCorpwxTime == 0) {
  7353. this.importDialog = true
  7354. } else {
  7355. this.importWxDialog = true
  7356. }
  7357. },
  7358. // 跳转
  7359. junpToDeskTop(id) {
  7360. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7361. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7362. },
  7363. // 通过日报
  7364. approve(id, item) {
  7365. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7366. this.approveinData = {
  7367. id: id,
  7368. date: this.date +day,
  7369. reportIds: item.id
  7370. }
  7371. if(this.user.timeType.needEvaluate == 1){
  7372. this.$set(this.approveinData,'evaluate','')
  7373. this.approveinDialog = true
  7374. }else{
  7375. this.logining = true;
  7376. this.approveinfun()
  7377. }
  7378. },
  7379. approveinfun(){
  7380. this.http.post( this.port.report.approve, this.approveinData,
  7381. res => {
  7382. this.logining = false;
  7383. if (res.code == "ok") {
  7384. this.approveinDialog = false
  7385. this.$message({
  7386. message: this.$t('message.Reviewsucceeded'),
  7387. type: "success"
  7388. });
  7389. this.getReportList();
  7390. this.getDepartment();
  7391. } else {
  7392. this.$message({
  7393. message: res.msg,
  7394. type: "error"
  7395. });
  7396. }
  7397. },
  7398. error => {
  7399. this.logining = false;
  7400. this.$message({
  7401. message: error,
  7402. type: "error"
  7403. });
  7404. });
  7405. },
  7406. //撤回日报
  7407. cancel(item,e) {
  7408. // console.log('can can need',item);
  7409. this.logining = true;
  7410. var ids = '';
  7411. var data = e ? item : item.data;
  7412. data.forEach(element => {
  7413. if(element.id){
  7414. ids +=(element.id+',');
  7415. }
  7416. });
  7417. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7418. res => {
  7419. this.logining = false;
  7420. if (res.code == "ok") {
  7421. this.$message({
  7422. message:this.$t('message.Withdrawalsucceeded'),
  7423. type: "success"
  7424. });
  7425. this.getReportList();
  7426. if(e){this.getReport()}
  7427. this.getDepartment();
  7428. } else {
  7429. this.$message({
  7430. message: res.msg,
  7431. type: "error"
  7432. });
  7433. }
  7434. },
  7435. error => {
  7436. this.logining = false;
  7437. this.$message({
  7438. message: error,
  7439. type: "error"
  7440. });
  7441. });
  7442. },
  7443. showDenyDialog(id,i, item) {
  7444. this.denyReasonDialog = true;
  7445. this.isDenying = false;
  7446. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7447. var ids = item.id;
  7448. // var data = item.data;
  7449. // data.forEach(element => {
  7450. // ids +=(element.id+',');
  7451. // });
  7452. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7453. },
  7454. // 未通过日报
  7455. deny() {
  7456. this.logining = true;
  7457. this.isDenying = true;
  7458. this.http.post( this.port.report.deny, this.denyForm,
  7459. res => {
  7460. this.logining = false;
  7461. this.isDenying = false;
  7462. if (res.code == "ok") {
  7463. this.$message({
  7464. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7465. type: "success"
  7466. });
  7467. this.getReportList();
  7468. this.getDepartment();
  7469. this.denyReasonDialog = false;
  7470. } else {
  7471. this.$message({
  7472. message: res.msg,
  7473. type: "error"
  7474. });
  7475. }
  7476. },
  7477. error => {
  7478. this.logining = false;
  7479. this.$message({
  7480. message: error,
  7481. type: "error"
  7482. });
  7483. });
  7484. },
  7485. // 查看工时记录弹窗
  7486. toView() {
  7487. this.toViewDialogVisible = true
  7488. this.toViewloading = true
  7489. this.getToView()
  7490. },
  7491. getToView() {
  7492. this.http.post( '/report-import-log/getList', this.toViewForm,
  7493. res => {
  7494. this.toViewloading = false;
  7495. if (res.code == "ok") {
  7496. // console.log(res.data, '数据数据')
  7497. this.toViewList = res.data.records
  7498. this.toViewForm.total = res.data.total
  7499. } else {
  7500. this.toViewloading = false;
  7501. this.$message({
  7502. message: res.msg,
  7503. type: "error"
  7504. });
  7505. }
  7506. })
  7507. },
  7508. // 触发 selectCat 组件更改他的值
  7509. selectCatCli(obj) {
  7510. // console.log(obj, '看看')
  7511. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7512. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7513. },
  7514. vueCasader(obj) {
  7515. // console.log(obj, '看看值')
  7516. if(obj.distinction == 1 && obj.item) {
  7517. let arr = []
  7518. arr.push(obj.item.id)
  7519. this.exportParam.departmentId = arr
  7520. }
  7521. },
  7522. //分页
  7523. handleCurrentChange(val) {
  7524. this.toViewForm.pageIndex = val;
  7525. this.getToView();
  7526. },
  7527. handleSizeChange(val) {
  7528. this.toViewForm.pageSize = val;
  7529. this.getToView();
  7530. },
  7531. getAllUsersList(){
  7532. this.http.post('/user/getSimpleActiveUserList',{
  7533. },res => {
  7534. if(res.code == 'ok'){
  7535. this.allUsersList = res.data
  7536. }else{
  7537. this.$message({
  7538. message: res.msg,
  7539. type: 'error'
  7540. })
  7541. }
  7542. },err => {
  7543. this.$message({
  7544. message: err,
  7545. type: 'error'
  7546. })
  7547. })
  7548. },
  7549. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7550. fillWeekCustomClne() {
  7551. this.fillWeekDialogVisiCustom = false
  7552. },
  7553. fillWeekCustomSubmit() {
  7554. this.getReportList();
  7555. this.getDepartment();
  7556. this.getRecentlyProject()
  7557. },
  7558. // 待填日报姓名搜索
  7559. nameAearchSeek(flg) {
  7560. if(!this.nameAearch) {
  7561. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7562. return
  7563. }
  7564. if(flg) {
  7565. this.enterpriseWechatgetUser()
  7566. }
  7567. },
  7568. handleThreeData(userList) {
  7569. console.log(userList, '人员数据')
  7570. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7571. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7572. },
  7573. // 过滤树节点
  7574. filterTreeNodes(treeData, filterKeywords) {
  7575. return treeData.filter((node) => {
  7576. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7577. if (node.children && node.children.length > 0) {
  7578. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7579. }
  7580. return true;
  7581. }
  7582. if (node.children && node.children.length > 0) {
  7583. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7584. return node.children.length > 0;
  7585. }
  7586. return false;
  7587. });
  7588. },
  7589. // 企业微信获取人员
  7590. enterpriseWechatgetUser() {
  7591. this.deptMembDataLoading = true
  7592. this.http.post('/user/getEmployeeList',{
  7593. departmentId: -1,
  7594. pageIndex: 1,
  7595. pageSize: 100,
  7596. keyword: this.nameAearch,
  7597. status: '',
  7598. roleId: '',
  7599. cursor: '',
  7600. onlyDirect: '',
  7601. matchingType: ''
  7602. },res => {
  7603. if(res.code == 'ok'){
  7604. this.deptMembDataLoading = false
  7605. const userListName = res.data.records.map(item => item.name)
  7606. this.handleThreeData(userListName)
  7607. }else{
  7608. this.deptMembDataLoading = false
  7609. this.$message({
  7610. message: res.msg,
  7611. type: 'error'
  7612. })
  7613. }
  7614. },err => {
  7615. this.deptMembDataLoading = false
  7616. this.$message({
  7617. message: err,
  7618. type: 'error'
  7619. })
  7620. })
  7621. },
  7622. // 封装 post 请求
  7623. postData(url, params) {
  7624. return new Promise((resolve, reject) => {
  7625. this.http.post(url, { ...params },
  7626. res => {
  7627. resolve(res)
  7628. },
  7629. error => {
  7630. this.$message({
  7631. message: error,
  7632. type: "error"
  7633. });
  7634. reject(error)
  7635. })
  7636. })
  7637. },
  7638. // 自定义事件
  7639. selectCal(obj) {
  7640. console.log(obj, '传数据来源')
  7641. if(obj.distinction == '1') {
  7642. this.zhoBao.projectAuditorId = obj.id
  7643. } else if(obj.distinction == '2') {
  7644. this.zhoBao.auditorFirst = obj.id
  7645. } else if(obj.distinction == '3') {
  7646. this.zhoBao.auditorSec = obj.id
  7647. } else if(obj.distinction == '4') {
  7648. this.zhoBao.auditorThird = obj.id
  7649. } else if(obj.distinction == '5') {
  7650. this.zhoBao.ccUserid = obj.id
  7651. } else if(obj.distinction == '12') {
  7652. this.usersListId = obj.id
  7653. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7654. this.searchKeyword = obj.name
  7655. } else {
  7656. this.searchKeyword = ''
  7657. }
  7658. this.searchScreen(0)
  7659. } else if(obj.distinction == '13') {
  7660. this.usersListId = obj.id
  7661. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7662. this.searchKeyword = obj.name
  7663. } else {
  7664. this.searchKeyword = ''
  7665. }
  7666. this.searchScreen(1)
  7667. }
  7668. }
  7669. },
  7670. created() {
  7671. this.getUsers()
  7672. let height = window.innerHeight;
  7673. this.tableHeight = height - 178;
  7674. const that = this;
  7675. window.onresize = function temp() {
  7676. that.tableHeight = window.innerHeight - 178;
  7677. };
  7678. this.toViewForm.companyId = this.user.companyId
  7679. this.initDrag([{
  7680. type: "LR",
  7681. domClass: {
  7682. // 中间分割线的名字
  7683. resize: "line-line",
  7684. // 左侧盒子的名字
  7685. left: "box-left",
  7686. // 右侧盒子的名字
  7687. right: "box-right",
  7688. // 父级的名字
  7689. box: "box-father",
  7690. },
  7691. otherInfo: {
  7692. // 限制左边栏最低宽度
  7693. leftWidth: 120,
  7694. },
  7695. },
  7696. {
  7697. type: "LR",
  7698. domClass: {
  7699. // 中间分割线的名字
  7700. resize: "line-second",
  7701. // 左侧盒子的名字
  7702. left: "left-laowang",
  7703. // 右侧盒子的名字
  7704. right: "box-second-father",
  7705. // 父级的名字
  7706. box: "grand",
  7707. },
  7708. otherInfo: {
  7709. // 限制左边栏最低宽度
  7710. leftWidth: 120,
  7711. },
  7712. },
  7713. ]);
  7714. }
  7715. };
  7716. </script>
  7717. <style lang="scss" scoped>
  7718. .fillWeekDialogVisiCustom {
  7719. width: 100%;
  7720. height: 70vh;
  7721. }
  7722. .fillWeekCustom {
  7723. .el-dialog__body {
  7724. padding: 20px 20px !important;
  7725. }
  7726. }
  7727. .photos {
  7728. position: relative;
  7729. display: flex;
  7730. flex-wrap: wrap;
  7731. }
  7732. .photos_img {
  7733. width: 120px;
  7734. height: 120px;
  7735. margin-right: 20px;
  7736. margin-bottom: 20px;
  7737. cursor: pointer;
  7738. img {
  7739. width: 100%;
  7740. height: 100%;
  7741. }
  7742. }
  7743. .paginatis {
  7744. padding: 10px 10px;
  7745. background: #f2f2f2;
  7746. }
  7747. .waiting {
  7748. color:orange;
  7749. }
  7750. .filledReportStyle {
  7751. color:#32CD32;
  7752. }
  7753. .RejectStyle {
  7754. color:red;
  7755. }
  7756. .waitSubmitStyle{
  7757. color: #409eff;
  7758. }
  7759. .chooseDate {
  7760. .waiting {
  7761. color: #20a0ff;
  7762. }
  7763. .filledReportStyle {
  7764. color:#20a0ff;
  7765. }
  7766. .RejectStyle {
  7767. color: #20a0ff;
  7768. }
  7769. .waitSubmitStyle{
  7770. color: #20a0ff;
  7771. }
  7772. }
  7773. .allDaily {
  7774. width:100%;
  7775. }
  7776. .report_title {
  7777. padding:10px 0;
  7778. color:#666;
  7779. }
  7780. .clearfix {
  7781. overflow-x: auto;
  7782. white-space: nowrap;
  7783. padding: 15px 0 10px 0;
  7784. // overflow-y: hidden;
  7785. .date_item {
  7786. padding: 0 3px;
  7787. cursor: pointer;
  7788. position: relative;
  7789. }
  7790. .chooseDate {
  7791. position: absolute;
  7792. bottom: -3px;
  7793. width: 37px;
  7794. height: 2px;
  7795. left: 14px;
  7796. background: #20a0ff;
  7797. }
  7798. }
  7799. .one_daily {
  7800. i {
  7801. color: #9ed0ff;
  7802. margin-right: 5px;
  7803. }
  7804. .one_daily_body {
  7805. padding: 10px 0px;
  7806. p {
  7807. margin: 0;
  7808. line-height: 30px;
  7809. }
  7810. }
  7811. ul {
  7812. padding: 0;
  7813. }
  7814. }
  7815. .checkbtn {
  7816. float: right;
  7817. margin-top: -10px;
  7818. }
  7819. .selConStyle{
  7820. margin-top:9rem;
  7821. margin-bottom:11rem;
  7822. .selConStyle_title{
  7823. height: 3rem;
  7824. text-align: center;
  7825. font-size: 17px;
  7826. }
  7827. .el-select{
  7828. margin: 0 15%;
  7829. width: 70%;
  7830. }
  7831. }
  7832. </style>
  7833. <style lang="scss">
  7834. /*去除upload组件过渡效果*/
  7835. .photos .el-upload-list__item {
  7836. transition: none !important;
  7837. }
  7838. .daily {
  7839. .el-card__body {
  7840. height: 80%;
  7841. overflow-y: auto;
  7842. }
  7843. .el-card__header {
  7844. padding: 0 20px;
  7845. }
  7846. }
  7847. .membListClass{
  7848. .el-dialog__body{
  7849. padding-top: 10px;
  7850. }
  7851. }
  7852. // .editReportDialog .el-dialog__footer{
  7853. // position: sticky;
  7854. // bottom: 0;
  7855. // background: #fff;
  7856. // height: 70px;
  7857. // z-index: 1010;
  7858. // }
  7859. .editReportDialog{
  7860. min-width: 800px;
  7861. }
  7862. .touruxiangmu{
  7863. max-width: 1000px;
  7864. }
  7865. </style>
  7866. <style scoped>
  7867. /* 项目标签的样式 */
  7868. .el-tag + .el-tag {
  7869. margin-left: 10px;
  7870. }
  7871. .button-new-tag {
  7872. margin-left: 10px;
  7873. height: 32px;
  7874. line-height: 30px;
  7875. padding-top: 0;
  7876. padding-bottom: 0;
  7877. }
  7878. .input-new-tag {
  7879. width: 90px;
  7880. margin-left: 10px;
  7881. vertical-align: bottom;
  7882. }
  7883. .selectworktime .el-table__fixed-body-wrapper{
  7884. top: 48px !important;
  7885. }
  7886. .selectworktime_export .selectworktime_export_l{
  7887. width: 650px;
  7888. float: left;
  7889. height: 42px;
  7890. }
  7891. .approvalProcessBox{
  7892. margin-left: 30px;
  7893. font-size: 14px;
  7894. line-height: 16px;
  7895. cursor: pointer;
  7896. }
  7897. .approvalProcessBox i {
  7898. margin-right: 0;
  7899. height: 16px;
  7900. width: 16px;
  7901. display: inline-block;
  7902. transform: scale(1.2);
  7903. position: relative;
  7904. top: 0.5px;
  7905. color: #409eff;
  7906. }
  7907. .approvalProcessBox .approvalProcessClick{
  7908. cursor: pointer;
  7909. color: #409eff;
  7910. font-size: 14px;
  7911. }
  7912. .approvalProcessBox:hover .approvalProcessClick{
  7913. color: #3485fb;
  7914. }
  7915. </style>
  7916. <style lang="scss" scoped>
  7917. // 加班样式
  7918. .overtime {
  7919. display: inline-block;
  7920. margin-left: 20px;
  7921. input {
  7922. display: inline-block;
  7923. margin-top: 5px;
  7924. }
  7925. }
  7926. .plus {
  7927. display: inline-block;
  7928. }
  7929. // .tages {
  7930. // float: right;
  7931. // }
  7932. .overtime {
  7933. display: inline-block;
  7934. margin-left: 30px;
  7935. }
  7936. .bloks {
  7937. display: inline-block;
  7938. width: 380px;
  7939. }
  7940. .zhiss {
  7941. display: flex;
  7942. justify-content: space-around;
  7943. align-items: center;
  7944. }
  7945. .zhoFel {
  7946. display: flex;
  7947. justify-content: space-between;
  7948. align-items: center;
  7949. }
  7950. // 左右滑动样式
  7951. .line {
  7952. width: 30px;
  7953. /* height: 500px; */
  7954. background: #f2f2f2;
  7955. cursor: w-resize;
  7956. }
  7957. .box-father {
  7958. border: 8px solid #000;
  7959. }
  7960. .line-second {
  7961. width: 10px;
  7962. /* background: red; */
  7963. }
  7964. .flex {
  7965. display: flex;
  7966. width: 100%;
  7967. }
  7968. .box-left {
  7969. flex: 0 0 400px;
  7970. /* height: 600px; */
  7971. /* background: blue; */
  7972. }
  7973. .box-right {
  7974. /* height: 600px; */
  7975. /* background: green; */
  7976. flex: 1;
  7977. }
  7978. .box-postion {
  7979. width: 200px;
  7980. /* height: 400px; */
  7981. background: #ccc;
  7982. }
  7983. .custom-tree-node {
  7984. flex: 1;
  7985. display: flex;
  7986. align-items: center;
  7987. justify-content: space-between;
  7988. font-size: 14px;
  7989. padding-right: 8px;
  7990. }
  7991. .daitianrbao {
  7992. width: 100%;
  7993. box-sizing: border-box;
  7994. height: 40px;
  7995. border-radius: 4px;
  7996. border: 1px solid #DCDFE6;
  7997. overflow: hidden;
  7998. text-overflow: ellipsis;
  7999. display: flex;
  8000. // align-items: center;
  8001. }
  8002. .daitianrbao .spnn {
  8003. display: inline-block;
  8004. box-sizing: border-box;
  8005. padding: 0 15px;
  8006. overflow: hidden;
  8007. text-overflow: ellipsis;
  8008. }
  8009. .daitianrbao .hover {
  8010. color: #DCDFE6 !important;
  8011. }
  8012. </style>