daily.vue 459 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741
  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. <el-tooltip v-if="item.exceedCardTime" effect="dark" content="填报时长超过北森考勤时长" placement="top-start">
  22. <i class="el-icon-warning" style="color:red;"></i>
  23. </el-tooltip>
  24. </div>
  25. </div>
  26. </span>
  27. </div>
  28. </div>
  29. <div style="display:flex;">
  30. <div class="grand flex">
  31. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  32. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  33. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  34. </div> -->
  35. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  36. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  37. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  38. </el-input>
  39. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  40. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  41. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  42. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  43. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  44. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  45. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  46. </el-select>
  47. </div>
  48. <div>
  49. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  50. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <!-- <span>{{ node.label }}</span> -->
  53. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  54. <span v-if="user.userNameNeedTranslate == '1'">
  55. <span v-if="node.data.children">
  56. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  57. </span>
  58. <span v-else>
  59. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  60. </span>
  61. </span>
  62. <span v-if="user.userNameNeedTranslate != '1'">
  63. {{ node.label }}
  64. </span>
  65. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  66. </span>
  67. <div style="position: absolute;right: 15px;">
  68. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  69. <!-- 未填报 -->
  70. {{$t('state.DidNotFillIn')}}
  71. </span>
  72. <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'">
  73. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  74. {{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)')}}
  75. </span>
  76. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  77. <!-- 待审核 -->
  78. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  79. </span>
  80. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  81. <!-- 已通过 -->
  82. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  83. </span>
  84. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  85. <!-- 未通过 -->
  86. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  87. </span>
  88. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  89. <!-- 待提交 -->
  90. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  91. </span>
  92. </div>
  93. </span>
  94. </el-tree>
  95. </div>
  96. </div>
  97. </div>
  98. <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">
  99. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  100. -
  101. -
  102. -
  103. </div>
  104. </div>
  105. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  106. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  107. <div class="allDaily" style="float:left;flex-grow:1">
  108. <!--系统管理员和部门负责人 -->
  109. <div class="report_title" style="display:flex;justify-content: space-between;">
  110. <span>
  111. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  112. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  113. <!-- {{depData != null ?depData.label:""}} -->
  114. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  116. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  117. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  118. <span v-if="targetUid == null">
  119. <!-- - 已提交 -->
  120. -{{$t('state.hasBeenSubmitted')}}
  121. <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')}},
  122. <!-- 待提交 -->
  123. {{$t('state.waitingsubmit')}}
  124. <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')}},
  125. <!-- 漏填 -->
  126. <!-- {{$t('state.missFillReport')}} -->
  127. 未填
  128. <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')}}
  129. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  130. </span>
  131. </span>
  132. </span>
  133. <span style="float:right;">
  134. <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>
  135. <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>
  136. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  137. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  138. <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>
  139. <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>
  140. <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>
  141. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  142. <!--部门负责人给个导出工时的功能 -->
  143. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  144. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  146. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  147. </span>
  148. </div>
  149. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  150. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  151. <i class="fa fa-circle"></i>
  152. <!-- {{item1.name}} -->
  153. <span v-if="user.userNameNeedTranslate == '1'">
  154. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  155. </span>
  156. <span v-if="user.userNameNeedTranslate != '1'">
  157. {{item1.name}}
  158. </span>
  159. <span style="margin-left:30px;">
  160. <span style="margin-right:20px;">
  161. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  162. <!-- 工作总时长: -->
  163. {{$t('other.totalWorkingHours')}}
  164. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  165. <span >{{item1.reportTime | amounts}}</span>h
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <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>
  178. <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>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  182. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. </div>
  184. <div class="one_daily_body">
  185. <el-timeline>
  186. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  187. <el-card shadow="never">
  188. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  189. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  190. <span v-if="user.company.packageEngineering == 0">
  191. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  192. <span v-if="item2.isDeptAudit==0">
  193. <span v-if="item2.projectAuditState==0">
  194. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  195. <span v-if="item2.projectAuditorName != null">(
  196. <!-- {{item2.projectAuditorName}} -->
  197. <span v-if="user.userNameNeedTranslate == '1'">
  198. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  199. </span>
  200. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  201. )</span>
  202. <!-- 审核 --> {{$t('other.audit')}}
  203. </span>
  204. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  205. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  206. <span v-if="item2.projectAuditorName != null">(
  207. <!-- {{item2.projectAuditorName}} -->
  208. <span v-if="user.userNameNeedTranslate == '1'">
  209. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  210. </span>
  211. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  212. )</span>
  213. <!-- 审核通过 --> {{$t('state.approved')}}
  214. </span>
  215. </span>
  216. <span v-else-if="item2.isDeptAudit==1">
  217. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  218. ({{$t('other.await')}}
  219. <span v-if="user.userNameNeedTranslate == '1'">
  220. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  221. </span>
  222. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  223. {{$t('other.audit')}})
  224. </span>
  225. ]</span>
  226. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  227. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  228. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  229. </span>
  230. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  232. </span>
  233. <!-- <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> -->
  234. <span v-if="user.company.packageEngineering == 1">
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  238. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  239. (
  240. <span v-if="user.userNameNeedTranslate != 1">
  241. {{item2.projectAuditorName}}
  242. </span>
  243. <span v-if="user.userNameNeedTranslate == 1">
  244. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  245. </span>
  246. )
  247. </span>{{$t('other.audit')}} ]</span>
  248. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  249. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  251. </span>
  252. <!--每个项目上单独审核 -->
  253. <span style="float:right;">
  254. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  255. <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"
  256. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  257. <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"
  258. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  259. <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"
  260. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  261. <!--自己可以撤回待审核状态的报告 -->
  262. <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>
  263. </span>
  264. </p>
  265. <p v-if="user.companyId == yuzhongCompId">
  266. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  267. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  268. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  269. <!--任务分组和阶段 -->
  270. <p v-if="item2.groupId != 0">
  271. {{$t('other.taskGroup')}}:{{item2.groupName}}
  272. <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>
  273. </p>
  274. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  275. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  276. <!-- 自定义日报文本 -->
  277. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  278. <p v-if="user.company.packageEngineering == 1">
  279. {{$t('other.professionalProgress')}}:
  280. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  281. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  282. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhetongguo"></i>
  286. </el-tooltip>
  287. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  288. <i class="iconfont firerock-iconshenhebohui"></i>
  289. </el-tooltip>
  290. </span>
  291. </p>
  292. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  293. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  294. </p>
  295. <div v-if="item2.multiWorktime==0">
  296. <p style="display: inline-block;">{{$t('time.duration')}}:
  297. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  298. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  299. {{item2.time.toFixed(1)}}h
  300. <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>
  301. </p>
  302. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  303. </div>
  304. <div v-if="item2.multiWorktime==1" >
  305. <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>
  306. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  307. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  308. <p style="display: inline-block;">{{$t('time.duration')}}:
  309. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  310. {{timeItem.time.toFixed(1)}}h
  311. </p>
  312. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  313. </div>
  314. </div>
  315. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  316. <!--照片的显示 -->
  317. <p v-if="item2.pics != null && item2.pics.length > 0">
  318. <el-image v-for="(pic, index) in item2.pics" :key="index"
  319. style="width: 100px; height: 100px; margin-right:10px;"
  320. :src="pic"
  321. :preview-src-list="item2.pics">
  322. </el-image>
  323. </p>
  324. </el-card>
  325. </el-timeline-item>
  326. </el-timeline>
  327. </div>
  328. </div>
  329. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  330. <!-- 简陋的无报告提示 -->
  331. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </el-card>
  338. </div>
  339. <!-- 工时推送日志弹窗 -->
  340. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  341. <template>
  342. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  343. </template>
  344. <template>
  345. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  346. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  347. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  348. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  349. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  350. <el-table-column prop="result" label="推送结果" width="250">
  351. <template slot-scope="scope">
  352. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  353. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  357. </el-table>
  358. </template>
  359. <span slot="footer" class="dialog-footer">
  360. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  361. </span>
  362. </el-dialog>
  363. <!-- 填写日报的dialog -->
  364. <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">
  365. <div style="height: 65vh;overflow: auto;">
  366. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  367. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  368. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  369. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  370. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  371. <span class="spnn" v-if="workForm.userNames">
  372. <span v-for="(item, index) in workForm.userNames" :key="index">
  373. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  374. <span v-if="index < workForm.userNames.length - 1">,</span>
  375. </span>
  376. </span>
  377. <span class="spnn hover" v-else>
  378. {{$t('defaultText.pleaseSelectAsubstitute')}}
  379. </span>
  380. </div>
  381. </el-form-item>
  382. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  383. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  384. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  385. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  386. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  387. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  388. <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>
  389. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  390. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  391. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  392. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  393. <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>
  394. <!-- AI智能填报 -->
  395. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  396. </el-form-item>
  397. <!--考勤时长显示-->
  398. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.time || user.companyId == 5978">
  399. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  400. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  401. </span>
  402. <!--批量填报和批量代填不显示考勤记录-->
  403. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  404. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  405. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  406. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  407. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  408. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  409. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  410. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  411. @click="refreshAttendance(workForm.createDate)"></el-button>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  414. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  415. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  416. </el-form-item>
  417. <!-- 000000 -->
  418. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  419. <div v-if="reportTimeType.multiWorktime==0">
  420. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  421. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  422. <el-select v-model="domain.timeType" style="width:200px;"
  423. v-if="reportTimeType.type == 0"
  424. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. @change="onTimeTypeChange(domain.timeType)">
  427. <el-option
  428. v-for="item in timeType"
  429. :key="item.value"
  430. :label="item.label"
  431. :value="item.value">
  432. </el-option>
  433. </el-select>
  434. <!-- 数字时长选择 -->
  435. <el-select v-model="domain.workingTime" style="width:200px;"
  436. v-if="reportTimeType.type == 1"
  437. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  438. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  439. @change="seleChn(0,domain)">
  440. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  441. </el-select>
  442. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  443. <span v-if="reportTimeType.type == 2">
  444. <!--时间范围选择 -->
  445. <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.startTime"
  448. :placeholder="$t('time.startTime')"
  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. }"
  456. @change="iptChang()">
  457. </el-time-picker> - <el-time-picker
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  459. v-model="domain.endTime"
  460. :placeholder="$t('time.endTime')"
  461. style="width:120px;"
  462. format="HH:mm"
  463. value-format="HH:mm"
  464. :picker-options="{
  465. start: '08:00',
  466. end: '23:30',
  467. minTime: domain.startTime
  468. }"
  469. @change="iptChang()">
  470. </el-time-picker>
  471. </span>
  472. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  473. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  474. <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>
  475. </div>
  476. </el-form-item>
  477. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  478. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  479. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  480. @change="selectProject(domain, index)"
  481. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  482. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  483. <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">
  484. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  485. <span style="float: right;">{{ item.projectName }}</span>
  486. </el-option>
  487. </el-option-group>
  488. </el-select>
  489. <!--昱众不显示子项目-->
  490. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  491. <span style="margin-left:45px;">
  492. {{$t('lable.subproject')}}</span>
  493. <!--子项目 -->
  494. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  495. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  496. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  497. </el-select>
  498. </template>
  499. <template v-if="user.companyId == yuzhongCompId">
  500. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  501. <!--角色选择 -->
  502. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  503. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  504. <el-option
  505. v-for="item in roleList"
  506. :key="item.value"
  507. :label="item.label"
  508. :value="item.value">
  509. </el-option>
  510. </el-select>
  511. </template>
  512. <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%;"
  513. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  514. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  515. </el-link>
  516. <!-- <el-link type="primary" v-if="canEdit"
  517. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  518. </el-form-item>
  519. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  520. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  521. </el-form-item>
  522. <!--如果设置了工时成本预警的预算成本项-->
  523. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  524. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  525. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  526. </el-select>
  527. </el-form-item>
  528. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  529. <template slot="label">
  530. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  531. <span >{{$t('lable.taskGrouping')}}</span>
  532. </template>
  533. <!-- 任务分组 -->
  534. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  535. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  536. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  537. </el-select>
  538. <template v-if="user.companyId == yuzhongCompId">
  539. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  540. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  541. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  542. <el-option
  543. v-for="item in domain.filteredRespList"
  544. :key="item.id"
  545. :label="item.jobRespon"
  546. :value="item.id">
  547. </el-option>
  548. </el-select>
  549. </template>
  550. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  551. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  552. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  553. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  554. @change="changeStages(domain, index)"
  555. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  556. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  557. </el-select>
  558. </template>
  559. </el-form-item>
  560. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  561. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  562. <template slot="label">
  563. <span style="color:#FF0000;">*</span>
  564. <span >{{$t('other.projectAuditor')}}</span>
  565. </template>
  566. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  567. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  568. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  569. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  570. </el-option>
  571. </el-select>
  572. <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>
  573. </el-form-item>
  574. </div>
  575. <el-form-item v-if="user.companyId == yuzhongCompId">
  576. <template slot="label">
  577. <span style="color:#FF0000;">*</span>
  578. <span >工作内容</span>
  579. </template>
  580. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  581. :disabled="(workForm.domains[index].state>=2?false:true)" >
  582. <el-option
  583. v-for="item in domain.workContentList"
  584. :key="item.id"
  585. :label="item.workContext"
  586. :value="item.id">
  587. </el-option>
  588. </el-select>
  589. </el-form-item>
  590. <!-- 111111 -->
  591. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  592. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  593. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  594. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  595. <span v-else>{{item.name}}</span>
  596. </el-option>
  597. </el-select>
  598. <template v-if="user.timeType.auditLevel > 1">
  599. <i class="el-icon-right"></i>
  600. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  601. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  602. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  603. <span v-else>{{item.name}}</span>
  604. </el-option>
  605. </el-select>
  606. </template>
  607. <template v-if="user.timeType.auditLevel > 2">
  608. <i class="el-icon-right"></i>
  609. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  610. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  611. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  612. <span v-else>{{item.name}}</span>
  613. </el-option>
  614. </el-select>
  615. </template>
  616. </el-form-item>
  617. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  618. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  619. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  620. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  621. <span v-else>{{item.name}}</span>
  622. </el-option>
  623. </el-select>
  624. </el-form-item>
  625. <!-- 相关维度/自定义维度 -->
  626. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  627. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  628. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  629. </el-option>
  630. </el-select>
  631. </el-form-item>
  632. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  633. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  634. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  635. </el-option>
  636. </el-select>
  637. </el-form-item>
  638. <!-- 相关数值 -->
  639. <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">
  640. <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>
  641. </el-form-item>
  642. <!-- 自定义文本 -->
  643. <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">
  644. <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>
  645. </el-form-item>
  646. <!--按比例填报-->
  647. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  648. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  649. <div style="width:400px;">
  650. <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>
  651. <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>
  652. </div>
  653. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  654. <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>
  655. </div>
  656. </el-form-item>
  657. <!--工程专业版本模式下, 各个专业的进度填报 -->
  658. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  659. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  660. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  661. <el-input size="mini" style="width:60px;" v-model="item.progress"
  662. @keyup.native="onProgressChange"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  664. </span>
  665. </el-form-item>
  666. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  667. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  668. <template slot="label" v-if="user.timeType.taskRequired == 1">
  669. <span style="color:#FF0000;">*</span>
  670. <span >任务</span>
  671. </template>
  672. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  673. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  674. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  675. </el-select>
  676. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  677. </el-form-item>
  678. <!--针对依斯贝的SAP服务-->
  679. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  680. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  681. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  682. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  683. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  684. </el-select>
  685. </el-form-item>
  686. <!--工作事项-->
  687. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  688. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  689. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  690. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  691. </el-form-item>
  692. <!-- 拍照上传 -->
  693. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  694. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  695. <div class="photos">
  696. <div>
  697. <el-upload
  698. list-type="picture-card"
  699. :http-request="(file) => {return addImg(file, index)}"
  700. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  701. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  702. :file-list="domain.imgListUrl" :limit="9"
  703. :disabled="workForm.domains[index].state>=2?false:true">
  704. <i class="el-icon-plus"></i>
  705. </el-upload>
  706. </div>
  707. </div>
  708. </el-form-item>
  709. </div>
  710. <!--多个工作事项填报的情况 -->
  711. <div v-if="reportTimeType.multiWorktime==1">
  712. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  713. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  714. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  715. @change="selectProject(domain, index)"
  716. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  717. <!-- <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">
  718. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  719. <span style="float: right;">{{ item.projectName }}</span>
  720. </el-option> -->
  721. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  722. <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">
  723. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  724. <span style="float: right;">{{ item.projectName }}</span>
  725. </el-option>
  726. </el-option-group>
  727. </el-select>
  728. <template v-if="user.timeType.mainProjectState != 1">
  729. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  730. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  731. <!--子项目 -->
  732. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  733. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  734. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  735. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  736. </el-select>
  737. </template>
  738. <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;"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  740. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  741. </el-link>
  742. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  743. <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>
  744. </div>
  745. <!-- <el-link type="primary" v-if="canEdit"
  746. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  747. </el-form-item>
  748. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  749. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  750. </el-form-item>
  751. <!--如果设置了工时成本预警的预算成本项-->
  752. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  753. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  754. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  755. </el-select>
  756. </el-form-item>
  757. <el-form-item v-if="user.company.packageProject == 1">
  758. <template slot="label">
  759. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  760. <span >{{$t('lable.taskGrouping')}}</span>
  761. </template>
  762. <!-- 任务分组 -->
  763. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  764. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  765. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  766. </el-select>
  767. <!-- 项目的阶段 -->
  768. <span v-if="domain.stages != null && domain.stages.length> 0"
  769. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  770. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  771. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  772. @change="changeStages(domain, index)"
  773. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  774. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  775. </el-select>
  776. </el-form-item>
  777. <el-form-item :label="$t('other.projectAuditor')" >
  778. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  779. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  780. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  781. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  782. </el-option>
  783. </el-select>
  784. <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>
  785. </el-form-item>
  786. <!--工程专业版本模式下, 各个专业的进度填报 -->
  787. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  788. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  789. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  790. <el-input size="mini" style="width:60px;" v-model="item.progress"
  791. @keyup.native="onProgressChange"
  792. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  793. </span>
  794. </el-form-item>
  795. <!-- 相关维度 -->
  796. <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'">
  797. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  798. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  799. </el-option>
  800. </el-select>
  801. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  802. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  803. </el-option>
  804. </el-select>
  805. </el-form-item>
  806. <!-- 相关数值 -->
  807. <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">
  808. <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>
  809. </el-form-item>
  810. <!-- 自定义文本 -->
  811. <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">
  812. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  813. </el-form-item>
  814. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  815. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  816. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  818. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  819. </el-select>
  820. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  821. </el-form-item>
  822. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  823. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  824. <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>
  825. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  826. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  827. <span v-if="reportTimeType.type == 2">
  828. <!-- <span> -->
  829. <!--时间范围选择 -->
  830. <el-time-picker
  831. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  832. v-model="timeItem.startTime"
  833. :placeholder="$t('time.startTime')"
  834. style="width:120px;"
  835. format="HH:mm"
  836. value-format="HH:mm"
  837. :picker-options="{
  838. start: '00:00',
  839. end: '23:59',
  840. }"
  841. @change="iptChangs()">
  842. </el-time-picker> - <el-time-picker
  843. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  844. v-model="timeItem.endTime"
  845. :placeholder="$t('time.endTime')"
  846. style="width:120px;"
  847. format="HH:mm"
  848. value-format="HH:mm"
  849. :picker-options="{
  850. start: '00:00',
  851. end: '23:59',
  852. minTime: timeItem.startTime
  853. }"
  854. @change="iptChangs()">
  855. </el-time-picker>
  856. </span>
  857. </el-form-item>
  858. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  859. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  860. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  861. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  862. ></el-input>
  863. </el-form-item>
  864. </div>
  865. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  866. </div>
  867. <!--照片的显示 -->
  868. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  869. <el-image v-for="(pic, index) in domain.pics" :key="index"
  870. style="width: 100px; height: 100px; margin-right:10px;"
  871. :src="pic"
  872. :preview-src-list="domain.pics">
  873. </el-image>
  874. </p>
  875. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  876. </div>
  877. <span id="workFormsItemBottom"></span>
  878. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  879. </el-form>
  880. </div>
  881. <span slot="footer" class="dialog-footer">
  882. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  883. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  884. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  885. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  886. <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>
  887. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  888. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  889. </span>
  890. </el-dialog>
  891. <!-- 按周填报 -->
  892. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  893. <!-- 按周填报-已填工时-点击 -->
  894. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  895. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  896. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  897. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  898. <el-table-column prop="state" :label="$t('state.states')">
  899. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  900. </el-table-column>
  901. <!-- <el-table-column label="操作">
  902. <template slot-scope="scope">
  903. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  904. </template>
  905. </el-table-column> -->
  906. </el-table>
  907. <span slot="footer" class="dialog-footer">
  908. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  909. </span>
  910. </el-dialog>
  911. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  912. <el-form-item style="height:30px;margin-top:-72px;">
  913. <!-- <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> -->
  914. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  915. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  916. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  917. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  918. <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>
  919. <el-option
  920. v-for="item in fillProjectList"
  921. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  922. :key="item.id"
  923. :label="item.projectName + '\u3000' + item.projectCode"
  924. :value="item.id">
  925. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  926. <span style="float: right">{{ item.projectName }}</span>
  927. </el-option>
  928. </el-select>
  929. <span style="float:right;margin-right:10px;">选择项目</span>
  930. </el-form-item>
  931. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  932. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  933. <template slot-scope="scope">
  934. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  935. </template>
  936. </el-table-column>
  937. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  938. <template slot-scope="scope">
  939. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  940. <p v-else></p>
  941. </template>
  942. </el-table-column> -->
  943. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  944. <template slot-scope="scope">
  945. <div v-if="scope.row.canFill == 1">
  946. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  947. <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>
  948. <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>
  949. <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>
  950. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  951. </div>
  952. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  953. <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>
  954. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  955. </div>
  956. </div>
  957. <div v-else >
  958. <span style="color:#999999;">不可超前填报</span>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  963. <template slot-scope="scope">
  964. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  965. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  966. </template>
  967. </el-table-column>
  968. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  969. <template slot-scope="scope">
  970. <div class="zhiss">
  971. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  972. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  973. </div>
  974. </template>
  975. </el-table-column>
  976. </el-table>
  977. </el-form>
  978. <span slot="footer" class="dialog-footer" >
  979. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  980. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  981. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  982. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 重庆物奇私人定制的按周填报 -->
  986. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  987. <div class="fillWeekDialogVisiCustom">
  988. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  989. </div>
  990. </el-dialog>
  991. <!-- 选择时间 -->
  992. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  993. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  994. <span slot="footer" class="dialog-footer">
  995. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  996. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  997. </span>
  998. </el-dialog>
  999. <!-- 按周填报弹窗 -->
  1000. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1001. <div>
  1002. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1003. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1004. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1005. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1006. </el-select>
  1007. </div>
  1008. <!--如果设置了工时成本预警的预算成本项-->
  1009. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1010. <p>{{$t('lable.budgetSource')}}</p>
  1011. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1012. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <!-- 任务分组 -->
  1016. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1017. <p>{{$t('lable.taskGrouping')}}</p>
  1018. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1019. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1020. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1021. </el-select>
  1022. </div>
  1023. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1024. <p>{{$t('other.inputStage')}}</p>
  1025. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1026. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1027. </el-select>
  1028. </div>
  1029. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1030. <p>{{$t('other.reviewer')}}</p>
  1031. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1032. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. <template v-if="user.timeType.reportAuditType == 3">
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1046. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. <div class="zhoFel">
  1052. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1053. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1054. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1055. </el-select>
  1056. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1057. </div>
  1058. <div class="zhoFel">
  1059. <p>{{ $t('chao-song-ren') }}</p>
  1060. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1061. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. </template>
  1066. <!-- 自定义维度 -->
  1067. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1068. <p>{{user.timeType.customDegreeName}}</p>
  1069. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1070. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1071. </el-select>
  1072. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1073. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1074. </el-select>
  1075. </div>
  1076. <!-- 自定义数值 -->
  1077. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1078. <p>{{user.timeType.customDataName}}</p>
  1079. <el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  1080. </div>
  1081. <!-- 自定义文本 -->
  1082. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1083. <p>{{user.timeType.customTextName}}</p>
  1084. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1085. </div>
  1086. <!-- 选择任务 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1088. <p>任务 / 里程碑</p>
  1089. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1090. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1091. </el-select>
  1092. </div>
  1093. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1094. <p>{{$t('other.timeSelection')}}</p>
  1095. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" @change="$forceUpdate()" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  1096. </div>
  1097. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1098. <p>{{$t('other.chooseDuration')}}</p>
  1099. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1100. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1101. </el-select>
  1102. </div>
  1103. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1104. <p>{{$t('lable.percentageOfTime')}}</p>
  1105. <div style="width:400px;display: flex;align-items: center;">
  1106. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1107. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}{{$t('time.hour')}}</span></el-col>
  1108. </div>
  1109. </div>
  1110. <div class="zhoFel">
  1111. <p>{{$t('other.workMatters')}}</p>
  1112. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1113. </div>
  1114. </div>
  1115. <span slot="footer" class="dialog-footer">
  1116. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1117. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1118. </span>
  1119. </el-dialog>
  1120. <!--导出报表条件选择 -->
  1121. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1122. <el-form ref="form3" :model="exportParam" >
  1123. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1124. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1125. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1126. </el-select>
  1127. </el-form-item>
  1128. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1129. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1130. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1131. </el-form-item>
  1132. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1133. <el-date-picker
  1134. v-model="exportParam.dateRange" :editable="false"
  1135. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1136. :range-separator="$t('other.to')"
  1137. type="daterange"
  1138. :start-placeholder="$t('time.startDate')"
  1139. :end-placeholder="$t('time.endDate')"
  1140. ></el-date-picker>
  1141. </el-form-item>
  1142. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1143. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1144. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1145. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1146. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1147. </el-select>
  1148. </el-form-item>
  1149. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1150. <div class="exportReportRadio">
  1151. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1152. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1153. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1154. <i class="el-icon-question"></i>
  1155. </el-tooltip>
  1156. </div>
  1157. </el-form-item>
  1158. </el-form>
  1159. <div slot="footer" class="dialog-footer">
  1160. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1161. </div>
  1162. </el-dialog>
  1163. <!--导出报表条件选择 -->
  1164. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1165. <el-form ref="form3" :model="exportParam" >
  1166. <el-form-item prop="range" :label="$t('time.dateRange')">
  1167. <el-date-picker
  1168. v-model="exportParam.dateRange" :editable="false"
  1169. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1170. :clearable="true"
  1171. :range-separator="$t('other.to')"
  1172. type="daterange"
  1173. :start-placeholder="$t('time.startDate')"
  1174. :end-placeholder="$t('time.endDate')"
  1175. ></el-date-picker>
  1176. </el-form-item>
  1177. </el-form>
  1178. <div slot="footer" class="dialog-footer">
  1179. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1180. </div>
  1181. </el-dialog>
  1182. <!--人员列表 -->
  1183. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1184. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1185. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1186. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1187. <el-table-column type="selection"></el-table-column>
  1188. <el-table-column prop="label" :label="$t('lable.name')" >
  1189. <template slot-scope="scope">
  1190. <span>
  1191. <!-- {{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}} -->
  1192. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1193. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1194. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1195. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1196. </span>
  1197. <span v-else>
  1198. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1199. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1200. </span>
  1201. </span>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1205. <template slot-scope="scope">
  1206. <div>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1209. </div>
  1210. </template>
  1211. </el-table-column>
  1212. </el-table>
  1213. </el-tab-pane>
  1214. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1215. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1216. <el-table-column prop="label" :label="$t('lable.name')" >
  1217. <template slot-scope="scope">
  1218. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天 - ' + leaveTypeName[scope.row.leaveType] + ')' : '(请假' + scope.row.leaveTimes + 'h - ' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1219. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1220. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1222. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1223. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1224. </span>
  1225. <span v-else>
  1226. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1227. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1228. </span>
  1229. </template>
  1230. </el-table-column>
  1231. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1232. <template slot-scope="scope">
  1233. <div>
  1234. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1236. </div>
  1237. </template>
  1238. </el-table-column>
  1239. </el-table>
  1240. </el-tab-pane>
  1241. </el-tabs>
  1242. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1243. <el-table-column type="selection"></el-table-column>
  1244. <el-table-column prop="label" :label="$t('lable.name')" >
  1245. <template slot-scope="scope">
  1246. <div>
  1247. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1248. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1249. </div>
  1250. </template>
  1251. </el-table-column>
  1252. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1253. <template slot-scope="scope">
  1254. <div>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1257. </div>
  1258. </template>
  1259. </el-table-column>
  1260. </el-table>
  1261. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1262. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1263. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1264. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1265. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1266. </div>
  1267. </el-dialog>
  1268. <!-- 按部门选择人员 -->
  1269. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1270. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1271. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1272. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1273. </el-input>
  1274. <div class="tree" style="height:400px">
  1275. <el-scrollbar style="height:100%">
  1276. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1277. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1278. highlight-current :filter-node-method="filterNode">
  1279. <span class="custom-tree-node" slot-scope="{ node }">
  1280. <span v-if="user.userNameNeedTranslate == '1'">
  1281. <span v-if="node.data.children">
  1282. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1283. </span>
  1284. <span v-else>
  1285. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1286. </span>
  1287. </span>
  1288. <span v-if="user.userNameNeedTranslate != '1'">
  1289. {{ node.label }}
  1290. </span>
  1291. <!-- {{ node.label }} -->
  1292. </span>
  1293. </el-tree>
  1294. </el-scrollbar>
  1295. </div>
  1296. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1297. <div slot="footer" class="dialog-footer">
  1298. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1299. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1300. </div>
  1301. </el-dialog>
  1302. <el-dialog
  1303. v-if="monthWorkTimeDialog"
  1304. :visible.sync="monthWorkTimeDialog"
  1305. :close-on-click-modal="false"
  1306. customClass="customWidth selectworktime"
  1307. width="1200px"
  1308. title=""
  1309. >
  1310. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1311. <el-tabs v-model="activeName" @tab-click="handleClick">
  1312. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1313. <div class="selectworktime_export" style="margin-top:10px;">
  1314. <div class="selectworktime_export_l">
  1315. <el-date-picker
  1316. class="selecteworktime_datapick"
  1317. v-model="WorktimeDatepickValue"
  1318. value-format="yyyy-MM-dd"
  1319. type="daterange"
  1320. align="right"
  1321. unlink-panels
  1322. :range-separator="$t('other.to')"
  1323. :start-placeholder="$t('time.startDate')"
  1324. :end-placeholder="$t('time.endDate')"
  1325. :default-time="['12:00:00', '12:00:00']"
  1326. size="small"
  1327. popper-class="selecteorktime_datapick_popper"
  1328. @change="showMonthWorkTime('first')"
  1329. >
  1330. </el-date-picker>
  1331. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1332. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1333. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1334. <!-- 222 -->
  1335. </div>
  1336. <div>
  1337. <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">
  1338. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1339. </el-input>
  1340. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1341. </div>
  1342. <div style="float: right; vertical-align: middle;height:32px">
  1343. <el-link
  1344. type="primary"
  1345. @click="exportMembWorkHours()"
  1346. >{{$t('export.exportData')}}</el-link
  1347. >
  1348. </div>
  1349. </div>
  1350. <el-table ref="hasworkTbl"
  1351. :data="monthWorkDataS"
  1352. v-el-table-infinite-scroll="listScroll"
  1353. border
  1354. :height="500"
  1355. highlight-current-row
  1356. style="width: 100%"
  1357. v-loading="tbload"
  1358. :lazy="true"
  1359. >
  1360. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1361. <template slot-scope="scope">
  1362. {{ scope.$index + 1 }}
  1363. </template>
  1364. </el-table-column>
  1365. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1366. <template slot-scope="scope">
  1367. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1368. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1369. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1370. <!-- {{scope.row.name}} -->
  1371. </span>
  1372. </template>
  1373. </el-table-column>
  1374. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1375. <template slot-scope="scope">
  1376. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1377. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1378. </template>
  1379. </el-table-column>
  1380. <el-table-column
  1381. min-width="105"
  1382. v-for="(item, index) in pickDateArray"
  1383. :key="index"
  1384. :label="item.label"
  1385. align="center"
  1386. >
  1387. <template slot-scope="scope">
  1388. <div
  1389. style="color: red"
  1390. v-if="
  1391. scope.row.worktimeList.filter(
  1392. (w) =>
  1393. w.createDate==item.date
  1394. ).length > 0 &&
  1395. scope.row.worktimeList.filter(
  1396. (w) =>w.createDate==item.date
  1397. )[0].workingTime < reportTimeType.allday
  1398. "
  1399. >
  1400. {{
  1401. scope.row.worktimeList.filter(
  1402. (w) =>w.createDate==item.date
  1403. )[0].workingTime.toFixed(1)
  1404. }}
  1405. </div>
  1406. <div
  1407. style="color: #20a0ff"
  1408. v-if="
  1409. scope.row.worktimeList.filter(
  1410. (w) =>w.createDate==item.date
  1411. ).length > 0 &&
  1412. scope.row.worktimeList.filter(
  1413. (w) =>w.createDate==item.date
  1414. )[0].workingTime > reportTimeType.allday
  1415. "
  1416. >
  1417. {{
  1418. scope.row.worktimeList.filter(
  1419. (w) =>w.createDate==item.date
  1420. )[0].workingTime.toFixed(1)
  1421. }}
  1422. </div>
  1423. <div
  1424. v-if="
  1425. scope.row.worktimeList.filter(
  1426. (w) =>w.createDate==item.date
  1427. ).length > 0 &&
  1428. scope.row.worktimeList.filter(
  1429. (w) =>w.createDate==item.date
  1430. )[0].workingTime == reportTimeType.allday
  1431. "
  1432. >
  1433. {{
  1434. scope.row.worktimeList.filter(
  1435. (w) =>w.createDate==item.date
  1436. )[0].workingTime
  1437. }}
  1438. </div>
  1439. <div
  1440. v-if="
  1441. scope.row.worktimeList.filter(
  1442. (w) =>w.createDate==item.date
  1443. ).length == 0
  1444. "
  1445. >
  1446. 0
  1447. </div>
  1448. <div
  1449. v-if="
  1450. scope.row.worktimeList.filter(
  1451. (w) =>w.createDate==item.date
  1452. ).length > 0 &&
  1453. typeof scope.row.worktimeList.filter(
  1454. (w) =>w.createDate==item.date
  1455. )[0].workingTime == 'string'
  1456. "
  1457. >
  1458. {{
  1459. scope.row.worktimeList.filter(
  1460. (w) =>w.createDate==item.date
  1461. )[0].workingTime
  1462. }}
  1463. </div>
  1464. </template>
  1465. </el-table-column>
  1466. </el-table>
  1467. <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>
  1468. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1469. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1470. <label style="font-size: 16px">员工每日已填报工时数</label>
  1471. <el-link
  1472. type="primary"
  1473. style="float: right; margin-right: 60px"
  1474. @click="exportMembWorkHours()"
  1475. >导出已填报数据</el-link
  1476. > -->
  1477. <!-- <el-button >导出</el-button> -->
  1478. <!-- </div> -->
  1479. </el-tab-pane>
  1480. <el-tab-pane label="未提交人员列表" name="second" >
  1481. <div class="selectworktime_export" style="margin-top:10px">
  1482. <div class="selectworktime_export_l">
  1483. <el-date-picker
  1484. class="selecteworktime_datapick"
  1485. v-model="WorktimeDatepickValue"
  1486. value-format="yyyy-MM-dd"
  1487. type="daterange"
  1488. align="right"
  1489. unlink-panels
  1490. :range-separator="$t('other.to')"
  1491. :start-placeholder="$t('time.startDate')"
  1492. :end-placeholder="$t('time.endDate')"
  1493. :default-time="['12:00:00', '12:00:00']"
  1494. size="small"
  1495. popper-class="selecteorktime_datapick_popper"
  1496. @change="showMonthNotWorkTime()"
  1497. >
  1498. </el-date-picker>
  1499. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1500. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1501. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1502. </div>
  1503. <div>
  1504. <div style="margin-top:10px;">
  1505. <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>
  1506. <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>
  1507. <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">
  1508. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1509. </el-input>
  1510. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1511. <el-link
  1512. type="primary"
  1513. style="float: right; vertical-align: middle;height:32px"
  1514. @click="exportMembNotWorkHours()"
  1515. >{{$t('export.exportData')}}</el-link
  1516. >
  1517. </div>
  1518. </div>
  1519. </div>
  1520. <el-table
  1521. ref="hasworkTbl2"
  1522. :data="monthNotWorkDateS"
  1523. v-el-table-infinite-scroll="notListScroll"
  1524. border
  1525. :height="500"
  1526. highlight-current-row
  1527. style="width: 100%"
  1528. v-loading="tbload"
  1529. lazy
  1530. >
  1531. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1532. <template slot-scope="scope">
  1533. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1534. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1535. </template>
  1536. </el-table-column>
  1537. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1538. <template slot-scope="scope">
  1539. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1540. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1541. </template>
  1542. </el-table-column>
  1543. <el-table-column
  1544. min-width="200"
  1545. :label="$t('weekDay.date')"
  1546. align="center"
  1547. prop="createDate"
  1548. >
  1549. </el-table-column>
  1550. <el-table-column
  1551. min-width="200"
  1552. :label="$t('state.states')"
  1553. align="center"
  1554. prop="status"
  1555. />
  1556. <el-table-column
  1557. min-width="200"
  1558. :label="$t('other.attendanceData')"
  1559. prop="cardTime"
  1560. align="center"
  1561. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1562. </el-table>
  1563. <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>
  1564. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1565. </el-tab-pane>
  1566. <el-tab-pane v-if="user.companyId==5978" :label="'工时填报明细'" name="third">
  1567. <div class="selectworktime_export" style="margin-top:10px;">
  1568. <!-- <div class="selectworktime_export_l">
  1569. <el-date-picker
  1570. class="selecteworktime_datapick"
  1571. v-model="WorktimeDatepickValue"
  1572. value-format="yyyy-MM-dd"
  1573. type="daterange"
  1574. align="right"
  1575. unlink-panels
  1576. :range-separator="$t('other.to')"
  1577. :start-placeholder="$t('time.startDate')"
  1578. :end-placeholder="$t('time.endDate')"
  1579. :default-time="['12:00:00', '12:00:00']"
  1580. size="small"
  1581. popper-class="selecteorktime_datapick_popper"
  1582. @change="showMonthWorkTime()"
  1583. >
  1584. </el-date-picker>
  1585. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1586. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1587. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1588. </div> -->
  1589. <div>
  1590. <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">
  1591. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1592. </el-input>
  1593. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1594. </div>
  1595. <div style="float: right; vertical-align: middle;height:32px">
  1596. <el-link
  1597. v-if="user.companyId==5978"
  1598. type="primary"
  1599. @click="changeReminder()"
  1600. >{{'变更提醒'}}</el-link
  1601. >
  1602. <el-link
  1603. type="primary"
  1604. @click="exportMembWorkHours()"
  1605. >{{$t('export.exportData')}}</el-link
  1606. >
  1607. </div>
  1608. </div>
  1609. <el-table ref="hasworkTbl"
  1610. :data="monthWorkDataS"
  1611. v-el-table-infinite-scroll="listScroll"
  1612. border
  1613. :height="500"
  1614. highlight-current-row
  1615. style="width: 100%"
  1616. v-loading="tbload"
  1617. :lazy="true"
  1618. >
  1619. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1620. <template slot-scope="scope">
  1621. {{ scope.$index + 1 }}
  1622. </template>
  1623. </el-table-column>
  1624. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1625. <template slot-scope="scope">
  1626. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1627. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1628. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1629. <!-- {{scope.row.name}} -->
  1630. </span>
  1631. </template>
  1632. </el-table-column>
  1633. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1634. <template slot-scope="scope">
  1635. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1636. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1637. </template>
  1638. </el-table-column>
  1639. <el-table-column
  1640. min-width="105"
  1641. v-for="(item, index) in pickDateArray"
  1642. :key="index"
  1643. :label="item.label"
  1644. align="center"
  1645. >
  1646. <template slot-scope="scope">
  1647. <div
  1648. style="color: red"
  1649. v-if="
  1650. scope.row.worktimeList.filter(
  1651. (w) =>
  1652. w.createDate==item.date
  1653. ).length > 0 &&
  1654. scope.row.worktimeList.filter(
  1655. (w) =>w.createDate==item.date
  1656. )[0].workingTime < reportTimeType.allday
  1657. "
  1658. >
  1659. {{
  1660. scope.row.worktimeList.filter(
  1661. (w) =>w.createDate==item.date
  1662. )[0].workingTime.toFixed(1)
  1663. }}
  1664. </div>
  1665. <div
  1666. style="color: #20a0ff"
  1667. v-if="
  1668. scope.row.worktimeList.filter(
  1669. (w) =>w.createDate==item.date
  1670. ).length > 0 &&
  1671. scope.row.worktimeList.filter(
  1672. (w) =>w.createDate==item.date
  1673. )[0].workingTime > reportTimeType.allday
  1674. "
  1675. >
  1676. {{
  1677. scope.row.worktimeList.filter(
  1678. (w) =>w.createDate==item.date
  1679. )[0].workingTime.toFixed(1)
  1680. }}
  1681. </div>
  1682. <div
  1683. v-if="
  1684. scope.row.worktimeList.filter(
  1685. (w) =>w.createDate==item.date
  1686. ).length > 0 &&
  1687. scope.row.worktimeList.filter(
  1688. (w) =>w.createDate==item.date
  1689. )[0].workingTime == reportTimeType.allday
  1690. "
  1691. >
  1692. {{
  1693. scope.row.worktimeList.filter(
  1694. (w) =>w.createDate==item.date
  1695. )[0].workingTime
  1696. }}
  1697. </div>
  1698. <div
  1699. v-if="
  1700. scope.row.worktimeList.filter(
  1701. (w) =>w.createDate==item.date
  1702. ).length == 0
  1703. "
  1704. >
  1705. 0
  1706. </div>
  1707. <div
  1708. v-if="
  1709. scope.row.worktimeList.filter(
  1710. (w) =>w.createDate==item.date
  1711. ).length > 0 &&
  1712. typeof scope.row.worktimeList.filter(
  1713. (w) =>w.createDate==item.date
  1714. )[0].workingTime == 'string'
  1715. "
  1716. >
  1717. {{
  1718. scope.row.worktimeList.filter(
  1719. (w) =>w.createDate==item.date
  1720. )[0].workingTime
  1721. }}
  1722. </div>
  1723. </template>
  1724. </el-table-column>
  1725. </el-table>
  1726. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1727. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1728. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1729. <label style="font-size: 16px">员工每日已填报工时数</label>
  1730. <el-link
  1731. type="primary"
  1732. style="float: right; margin-right: 60px"
  1733. @click="exportMembWorkHours()"
  1734. >导出已填报数据</el-link
  1735. > -->
  1736. <!-- <el-button >导出</el-button> -->
  1737. <!-- </div> -->
  1738. </el-tab-pane>
  1739. </el-tabs>
  1740. </el-dialog>
  1741. <!--驳回弹出框 -->
  1742. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1743. <div>
  1744. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
  1745. </div>
  1746. <div slot="footer" class="dialog-footer">
  1747. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1748. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1749. </div>
  1750. </el-dialog>
  1751. <!-- 通过弹出框 -->
  1752. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1753. <div>
  1754. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1755. </div>
  1756. <div slot="footer" class="dialog-footer">
  1757. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1758. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1759. </div>
  1760. </el-dialog>
  1761. <!--批量导入日报 -->
  1762. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1763. <p>1. {{$t('other.download')}}
  1764. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1765. </p>
  1766. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1767. <p style="display: flex;justify-content: center;">
  1768. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1769. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1770. </el-upload>
  1771. </p>
  1772. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1773. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1774. </div>
  1775. </el-dialog>
  1776. <!-- 工时导入记录弹窗 -->
  1777. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1778. <div style="height: 452px">
  1779. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1780. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1781. <el-table-column prop="userName" :label="$t('other.operator')">
  1782. <template slot-scope="scope">
  1783. <div>
  1784. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1785. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1786. </div>
  1787. </template>
  1788. </el-table-column>
  1789. <el-table-column prop="datel" :label="$t('other.document')">
  1790. <template slot-scope="scope">
  1791. <div>
  1792. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1793. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1794. </div>
  1795. </template>
  1796. </el-table-column>
  1797. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1798. <template slot-scope="scope">
  1799. <div>
  1800. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1801. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1802. </div>
  1803. </template>
  1804. </el-table-column>
  1805. </el-table>
  1806. <el-col :span="24" class="paginatis">
  1807. <el-pagination
  1808. @size-change="handleSizeChange"
  1809. @current-change="handleCurrentChange"
  1810. :page-sizes="[20 , 50 , 80 , 100]"
  1811. :page-size="20"
  1812. layout="total, sizes, prev, pager, next"
  1813. :total="toViewForm.total"
  1814. style="float:right;"
  1815. ></el-pagination>
  1816. </el-col>
  1817. </div>
  1818. </el-dialog>
  1819. <!--基于企业微信考勤数据的工时导入 -->
  1820. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1821. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1822. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1823. </el-step>
  1824. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1825. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1826. </el-steps>
  1827. <div v-if="active==0" style="padding:30px;height:360px;">
  1828. <div style="margin-top:50px;margin-left:280px;">
  1829. <el-date-picker
  1830. v-model="importWxParam.date" :editable="false"
  1831. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1832. :clearable="true"
  1833. :range-separator="$t('other.to')"
  1834. type="daterange"
  1835. :start-placeholder="$t('time.startDate')"
  1836. :end-placeholder="$t('time.endDate')"
  1837. @change="loadCheckInData"
  1838. ></el-date-picker>
  1839. </div>
  1840. </div>
  1841. <div v-if="active==1" style="padding:10px;">
  1842. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1843. style="width: 100%;margin-top:5px;" >
  1844. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1845. <template slot-scope="scope">
  1846. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1847. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1848. </template>
  1849. </el-table-column>
  1850. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1851. </el-table-column>
  1852. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1853. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1854. <template slot-scope="scope">
  1855. <div>
  1856. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1857. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1858. </div>
  1859. </template>
  1860. </el-table-column>
  1861. <el-table-column prop="departmentName" label="部门" >
  1862. <template slot-scope="scope">
  1863. <div>
  1864. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1865. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1866. </div>
  1867. </template>
  1868. </el-table-column>
  1869. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1870. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1871. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1872. <template slot-scope="scope">
  1873. {{scope.row.workHours.toFixed(1)}}h
  1874. </template>
  1875. </el-table-column>
  1876. </el-table>
  1877. </div>
  1878. <div v-if="active==2" >
  1879. <p style="display: flex;justify-content: center;height:390px;">
  1880. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1881. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1882. </el-upload>
  1883. </p>
  1884. </div>
  1885. <div slot="title">
  1886. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1887. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1888. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1889. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1890. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1891. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1892. </div>
  1893. <span slot="footer">
  1894. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1895. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1896. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1897. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1898. </span>
  1899. </el-dialog>
  1900. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1901. <p style="display: flex;justify-content: center;height:100px;">
  1902. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1903. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1904. </el-upload>
  1905. </p>
  1906. </el-dialog>
  1907. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1908. <div>
  1909. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1910. v-model="deleteReportParam.date" :editable="false"
  1911. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1912. :clearable="true"
  1913. :range-separator="$t('other.to')"
  1914. type="daterange"
  1915. :start-placeholder="$t('time.startDate')"
  1916. :end-placeholder="$t('time.endDate')"
  1917. ></el-date-picker>
  1918. </div>
  1919. <div style="margin-top:10px;">
  1920. <span>请选择部门:</span>
  1921. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1922. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1923. </div>
  1924. <div style="margin-top:10px;">
  1925. <span>请选择员工:</span>
  1926. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1927. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1928. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1929. <span v-else>{{item.name}}</span>
  1930. </el-option>
  1931. </el-select>
  1932. </div>
  1933. <span slot="footer">
  1934. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1935. </span>
  1936. </el-dialog>
  1937. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1938. <div>
  1939. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1940. v-model="deleteReportParam.date" :editable="false"
  1941. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1942. :clearable="true"
  1943. :range-separator="$t('other.to')"
  1944. type="daterange"
  1945. :start-placeholder="$t('time.startDate')"
  1946. :end-placeholder="$t('time.endDate')"
  1947. ></el-date-picker>
  1948. </div>
  1949. <div style="margin-top:15px;">
  1950. <span>选择部门:</span>
  1951. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1952. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1953. size="small" v-if="user.userNameNeedTranslate != 1"
  1954. ></el-cascader>
  1955. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1956. </div>
  1957. <span slot="footer">
  1958. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1959. </span>
  1960. </el-dialog>
  1961. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1962. <div>
  1963. <span>选择时间:</span><el-date-picker
  1964. v-model="modImportTime"
  1965. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1966. :clearable="true"
  1967. type="datetime"
  1968. ></el-date-picker>
  1969. <span>选择导入人员:</span><el-select
  1970. v-model="modImportUserId"
  1971. >
  1972. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1973. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1974. <span v-else>{{item.name}}</span>
  1975. </el-option>
  1976. </el-select>
  1977. </div>
  1978. <span slot="footer">
  1979. <el-button @click="confirmChangeModTime" >确认</el-button>
  1980. </span>
  1981. </el-dialog>
  1982. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1983. <div>
  1984. <span>请选择年月:</span>
  1985. <el-date-picker
  1986. v-model="ratioYmonth" :editable="false"
  1987. format="yyyyMM" value-format="yyyyMM"
  1988. type="month"
  1989. ></el-date-picker>
  1990. </div>
  1991. <span slot="footer">
  1992. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1993. </span>
  1994. </el-dialog>
  1995. <!--工时批量代填 -->
  1996. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1997. <div>
  1998. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1999. v-model="importWxParam.date" :editable="false"
  2000. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2001. :clearable="true"
  2002. :range-separator="$t('other.to')"
  2003. type="daterange"
  2004. :start-placeholder="$t('time.startDate')"
  2005. :end-placeholder="$t('time.endDate')"
  2006. @change="loadCheckInData"
  2007. ></el-date-picker>
  2008. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2009. </div>
  2010. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2011. :key="timeStamp"
  2012. style="width: 100%;margin-top:5px;" ref="tab">
  2013. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2014. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2015. <template slot-scope="scope">
  2016. <div>
  2017. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  2018. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2019. </div>
  2020. </template>
  2021. </el-table-column>
  2022. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2023. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2024. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2025. <template slot-scope="scope">
  2026. {{scope.row.workHours.toFixed(1)}}h
  2027. </template>
  2028. </el-table-column>
  2029. <!--项目名称列表 -->
  2030. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2031. <template slot-scope="scope">
  2032. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2033. </template>
  2034. </el-table-column>
  2035. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2036. <template slot-scope="scope">
  2037. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2038. </template>
  2039. </el-table-column>
  2040. </el-table>
  2041. </el-dialog>
  2042. <!--基于企业微信考勤数据的工时导入 -->
  2043. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2044. <div style="padding-bottom:10px;">
  2045. <p>{{importResultMsg}}</p>
  2046. </div>
  2047. <!-- <span slot="footer" class="dialog-footer">
  2048. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2049. </span> -->
  2050. </el-dialog>
  2051. <!-- 审核流程展示 -->
  2052. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2053. <div style="padding:20px 40px 20px 0">
  2054. <el-timeline :reverse="false">
  2055. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2056. <!-- {{item.msg}} -->
  2057. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2058. <span v-if="user.userNameNeedTranslate == 1">
  2059. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  2060. <span>{{item.msgCon.two}}</span>
  2061. </span>
  2062. </el-timeline-item>
  2063. </el-timeline>
  2064. </div>
  2065. </el-dialog>
  2066. </section>
  2067. </template>
  2068. <script>
  2069. // 左右滑动
  2070. import dragMixin from "@/common/js/tensile.js";
  2071. import util from "../../common/js/util";
  2072. // 自定义select组件
  2073. import selectCat from "@/components/select.vue"
  2074. // 引入自定义级联组件
  2075. import vueCascader from "@/components/cascader.vue"
  2076. // 重庆物奇定制组件
  2077. import WeeklyCustomization from "./weeklyCustomization.vue"
  2078. import { mapMutations } from 'vuex'
  2079. let _that = this
  2080. export default {
  2081. mixins: [dragMixin],
  2082. components: {
  2083. selectCat,
  2084. vueCascader,
  2085. WeeklyCustomization
  2086. },
  2087. data() {
  2088. return {
  2089. pageIndex: 0,
  2090. hasMore: true,
  2091. exportType: 0,
  2092. exportingData: false,
  2093. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2094. jobResponseList:[],
  2095. yisibeiCompId: 3092,
  2096. yuzhongCompId: 3385,
  2097. mingyiName : '成都明夷电子科技有限公司',
  2098. // mingyiName : '明夷',
  2099. modItemDataId: null,
  2100. modImportTime: null,
  2101. modImportUserId: null,
  2102. showModImportTimeDialog: false,
  2103. showBatchSimpleApproveReport: false,
  2104. startDeleting: false,
  2105. showBatchDeleteReport: false,
  2106. deleteReportParam: {date:null, userIds:[]},
  2107. isDenying: false,
  2108. targetWeekDate: null,//填写周报中的周日期
  2109. importCardTimeVisi: false,
  2110. startRatioExporting: false,
  2111. exportUserRatio: false,
  2112. ratioYmonth:null,
  2113. hasWrittenReport: false,
  2114. today:null,
  2115. syncTimeLoading: false,
  2116. seluserText: '',
  2117. translation: '1', // 1、文字, 2、部门, 3、人员
  2118. exportLoad: false,
  2119. getPickerOptions: {
  2120. disabledDate: (time) => {
  2121. var date = new Date();
  2122. var year = date.getFullYear();
  2123. var month = date.getMonth() + 1;
  2124. if (month >= 1 && month <= 9) {
  2125. month = "0" + month;
  2126. }
  2127. var currentdate = year.toString() + month.toString();
  2128. var timeyear = time.getFullYear();
  2129. var timemonth = time.getMonth() + 1;
  2130. if (timemonth >= 1 && timemonth <= 9) {
  2131. timemonth = "0" + timemonth;
  2132. }
  2133. var timedate = timeyear.toString() + timemonth.toString();
  2134. if(this.user.timeType.fillAhead == 0){
  2135. return currentdate < timedate;
  2136. }else{
  2137. return false
  2138. }
  2139. }
  2140. },
  2141. alalal: '8.0',
  2142. timeBasecostList:null,
  2143. tbload: false,
  2144. exportTimeDialog: false,
  2145. searchKeyword: '',
  2146. monthWorkDataS: [],
  2147. monthNotWorkDateS: [],
  2148. pickDateArray:[],
  2149. WorktimeDatepickValue: [],
  2150. activeName:"first",
  2151. isLeave: 0,
  2152. submitingReport: false,
  2153. importResultMsg:null,
  2154. showImportResult:false,
  2155. importingData: false,
  2156. isDraft: 0,
  2157. timeStamp: 0,
  2158. projectColumns:[],
  2159. checkinLoading:false,
  2160. importWxParam:{date:null,},
  2161. active:0,
  2162. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2163. importWxDialog:false,
  2164. importDialog:false,
  2165. denyForm:null,
  2166. denyReasonDialog:false,
  2167. monthWorkTimeDialog: false,
  2168. isSubstitude:false,
  2169. isFill:false,
  2170. unFillList:[],
  2171. fillList:[],
  2172. fillMembList:[],
  2173. fillMembList_leave: [],
  2174. membListVisible: false,
  2175. isBatch:0,//是否是批量填报
  2176. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2177. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2178. 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')],
  2179. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2180. fillStatusList: [],
  2181. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2182. exportDialog:false,
  2183. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2184. subProjectList:[],
  2185. canEdit: true,
  2186. originCanEdit: true,
  2187. 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],
  2188. selectTime:null,
  2189. reportTimeType:{},
  2190. curDate:'',
  2191. isAllSelect: false,
  2192. approveDialogVisible:false,
  2193. deptId:null,
  2194. targetUid: null,
  2195. membCount:0,
  2196. selectState:"-1",
  2197. user: JSON.parse(sessionStorage.getItem("user")),
  2198. allUsersList: [],
  2199. showAddMore:false,
  2200. allDate: [],
  2201. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2202. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2203. choseDay: 0,
  2204. tableHeight: 0,
  2205. listLoading: false,
  2206. projectList: [], //项目列表
  2207. fillProjectList: [],
  2208. reportList: [], //日报列表
  2209. reportNames:[], //批量审批列表
  2210. selCon:[], //筛选条件
  2211. selProjectList:[], //筛选后项目列表
  2212. selConShow: true,
  2213. usersList: [], // 全部人员列表
  2214. usersListId: '', // 选中的人员id
  2215. dialogVisible: false, //项目弹窗
  2216. report: '',
  2217. workForm: {
  2218. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2219. domains: [{
  2220. id: null,
  2221. projectId: "",
  2222. workingTime: "",
  2223. timeType:0,
  2224. content: "",
  2225. state: 2,
  2226. multiWorktime:0,
  2227. worktimeList:[],
  2228. degreeId: null,
  2229. auditUserList: [],
  2230. }],
  2231. },
  2232. workRules: {
  2233. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2234. },
  2235. chooseParticipVisible: false,
  2236. logining: false,
  2237. isDisable: false,
  2238. timeType:[],
  2239. deptMembData: [
  2240. ],
  2241. //部门人员树状结构
  2242. data: [
  2243. {
  2244. id: -1,
  2245. label: this.$t('lable.allStaff'),
  2246. membCount:0
  2247. },
  2248. {
  2249. id: 0,
  2250. label: this.$t('lable.unassigned'),
  2251. }
  2252. ],
  2253. allData:{},
  2254. batchShowData:{},
  2255. option: [],
  2256. deptOptionList: [],
  2257. depData: {
  2258. id: -1,
  2259. label: this.$t('lable.allStaff'),
  2260. },
  2261. defaultProps: {
  2262. children: 'children',
  2263. label: 'label'
  2264. },
  2265. isNew: false,
  2266. selected: false,
  2267. valuet: new Date(),
  2268. domObj: null,
  2269. participator:[],
  2270. chosenMembCount:0,
  2271. jsDay: 0,
  2272. jsTime: 0,
  2273. falsss: false,
  2274. weidu: [],
  2275. weiduList: [],
  2276. yonghuUser: [],
  2277. dateAr: [],
  2278. batchSubFillDialog: false,
  2279. isSubstiS: false,
  2280. fillWeekDialogVisi: false,
  2281. fillWeekDialogVisiCustom: false,
  2282. zhoData: [],
  2283. weekDateRange: [],
  2284. btnZho: false,
  2285. weekDataLoading: false,
  2286. changdu: 6,
  2287. tianxieDialogVisible: false,
  2288. scopess: {},
  2289. zhoBao: {
  2290. time: '',
  2291. workingTime: '',
  2292. progress: '',
  2293. con: '',
  2294. subProjectId: '',
  2295. stage: '',
  2296. subProjectList: [],
  2297. stages: [],
  2298. },
  2299. zhoBaoIdx: '',
  2300. zhoBaoName: '',
  2301. zhis: {},
  2302. dealList: [],
  2303. toViewDialogVisible: false,
  2304. toViewList: [],
  2305. toViewloading: true,
  2306. toViewForm: {
  2307. pageIndex: '1',
  2308. pageSize: '20',
  2309. total: 0,
  2310. },
  2311. toViewloadings: false,
  2312. tabPositionss: 'top',
  2313. monthTotal: 0,
  2314. monthTotalPage: 0,
  2315. monthTotalLages: 20,
  2316. monthWorkData: [],
  2317. monthNotWorkDate: [],
  2318. monthWorkDataS1: [],
  2319. monthnotTotal: 0,
  2320. monthnotTotalPage: 0,
  2321. monthnotTotalLages: 20,
  2322. monthNotWorkDateS1: [],
  2323. deptMembDataText: '',
  2324. isFlag: false,
  2325. isMore: false,
  2326. stateKey: '0',
  2327. expandDate: [],
  2328. notifySelList:[],
  2329. departmentList: [],
  2330. approvalProcessDialog: false,
  2331. approvalProcessData: [],
  2332. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2333. 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')],
  2334. isWeekend: false,
  2335. canCancelInDialog: false,
  2336. approveinData: {},
  2337. approveinDialog: false,
  2338. reportCanDelete: false,
  2339. weeklyFilledTimeDialog: false,
  2340. weeklyFilledTimeList: [],
  2341. weeklyFilledTimeLoading: false,
  2342. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2343. weeklyFilledTimeCanDelete: false,
  2344. weeklyFilledTimeDate: null,
  2345. leaveAllNum: 0,
  2346. dataLoading: false,
  2347. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2348. vacationTime: {},
  2349. integrationProjectList: [],
  2350. totalReportHours: 0, // 合计的工时
  2351. workTimeForMinYi:0,
  2352. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2353. weekIndex: 1,
  2354. weekParentData: {},
  2355. deptIdForNoReport:[],
  2356. nameAearch: '', // 企业微信姓名搜索
  2357. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2358. deptMembDataLoading: false,
  2359. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2360. {
  2361. id: 4811,
  2362. // id: 10,
  2363. name: '陕西柘中建设工程有限公司'
  2364. }
  2365. ],
  2366. pushWorkTimeLogDig:false,
  2367. pushWorkTimeLogData:[],
  2368. WorktimeDatepickValueForMonth:[],
  2369. };
  2370. },
  2371. watch: {
  2372. deptMembDataText(val) {
  2373. this.$refs.chooseMembTree.filter(val);
  2374. }
  2375. },
  2376. filters: {
  2377. // 过滤
  2378. amounts(value) {
  2379. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2380. return 0
  2381. }
  2382. var zhi = +value + 0
  2383. return zhi.toFixed(1)
  2384. },
  2385. // zhoData
  2386. zhoData(value, arr) {
  2387. var dateArray = value.split("-");
  2388. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2389. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2390. // console.log(arr[date.getDay()])
  2391. // return "周" + "日一二三四五六".charAt(date.getDay());
  2392. return arr[date.getDay()]
  2393. },
  2394. // 过滤数字
  2395. numbers(value) {
  2396. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2397. return 0
  2398. }
  2399. return value
  2400. },
  2401. },
  2402. computed: {},
  2403. mounted() {
  2404. var now = new Date();
  2405. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2406. this.today = t;
  2407. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2408. this.exportParam.dateRange = [startStr,t];
  2409. this.getAllDate(1);
  2410. this.getReportList();
  2411. this.getProjectList();
  2412. this.getFillProjectList();
  2413. this.getTimeType();
  2414. this.getDepartment();
  2415. this.scrollFunction()
  2416. this.userssHu();
  2417. this.getFirstAndLastDay()
  2418. if(this.user.timeType.reportAuditType == 3){
  2419. this.getAllUsersList()
  2420. }
  2421. if (this.user.company.packageProject == 1) {
  2422. this.getBasecostItemList();
  2423. }
  2424. if(this.user.timeType.lockWorktime){
  2425. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2426. }
  2427. //设置了下限
  2428. if (this.user.timeType.minReportTime) {
  2429. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2430. }
  2431. const that = this
  2432. if(this.user.userNameNeedTranslate == 1) {
  2433. that.dataLoading = that.$store.state.dataLoading
  2434. this.upDataLoading()
  2435. setTimeout(()=>{
  2436. that.dataLoading = that.$store.state.dataLoading
  2437. }, 1000)
  2438. }
  2439. if (this.user.companyId == this.yuzhongCompId) {
  2440. this.getJobResponList();
  2441. }
  2442. },
  2443. methods: {
  2444. ...mapMutations(['upDataLoading']),
  2445. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2446. isCustomization(userInfo, permissionArray) {
  2447. const { companyId } = userInfo
  2448. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2449. return isReportPictureRequired
  2450. },
  2451. //任务被选中
  2452. onTaskSelected(domainItem) {
  2453. //取服务
  2454. if (domainItem.taskId) {
  2455. var that = this;
  2456. var param = {taskId:domainItem.taskId};
  2457. if (this.isSubstitude) {
  2458. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2459. param.userId = this.workForm.userId[0];
  2460. }
  2461. }
  2462. this.http.post('/task/getMyTaskService',param, res => {
  2463. if (res.code == "ok") {
  2464. // domainItem.workContentList = res.data;
  2465. that.$set(domainItem, 'sapServiceId', null);
  2466. that.$set(domainItem, 'serviceList', res.data);
  2467. } else {
  2468. this.$message({
  2469. message: res.msg,
  2470. type: "error"
  2471. });
  2472. }
  2473. },error => {
  2474. this.$message({
  2475. message: error,
  2476. type: "error"
  2477. });
  2478. }
  2479. );
  2480. } else {
  2481. //清空服务
  2482. }
  2483. },
  2484. onBatchTimeChange() {
  2485. //反向计算每日工作时长
  2486. if (this.workForm.createDate) {
  2487. let sdate = new Date(this.workForm.createDate[0]);
  2488. let edate = new Date(this.workForm.createDate[1]);
  2489. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2490. console.log('days===', days)
  2491. if (days < 0) {
  2492. return;
  2493. }
  2494. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2495. //总时长发生改变,自动按比例计算
  2496. this.workForm.domains.forEach(d=>{
  2497. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2498. });
  2499. }
  2500. },
  2501. //更新工作内容列表
  2502. updateJobContent(domainItem) {
  2503. var that = this;
  2504. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2505. if (res.code == "ok") {
  2506. // domainItem.workContentList = res.data;
  2507. that.$set(domainItem, 'extraField3', null);
  2508. that.$set(domainItem, 'workContentList', res.data);
  2509. } else {
  2510. this.$message({
  2511. message: res.msg,
  2512. type: "error"
  2513. });
  2514. }
  2515. },error => {
  2516. this.$message({
  2517. message: error,
  2518. type: "error"
  2519. });
  2520. }
  2521. );
  2522. },
  2523. updateResponse(domainItem) {
  2524. var that = this;
  2525. var selectPid = domainItem.projectId;
  2526. domainItem.extraField2 = null;
  2527. domainItem.extraField3 = null;
  2528. if (selectPid && domainItem.extraField1) {
  2529. //是否非项目
  2530. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2531. console.log('==========','isPublic=='+isPublic);
  2532. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2533. console.log(filteredRespList);
  2534. domainItem.filteredRespList = filteredRespList;
  2535. }
  2536. },
  2537. getJobResponList() {
  2538. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2539. if (res.code == "ok") {
  2540. this.jobResponseList = res.data;
  2541. } else {
  2542. this.$message({
  2543. message: res.msg,
  2544. type: "error"
  2545. });
  2546. }
  2547. },error => {
  2548. this.$message({
  2549. message: error,
  2550. type: "error"
  2551. });
  2552. }
  2553. );
  2554. },
  2555. openModImportTime(row) {
  2556. this.showModImportTimeDialog = true;
  2557. this.modItemDataId = row.id;
  2558. },
  2559. delImportTime(row) {
  2560. let rowId = row.id;
  2561. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2562. confirmButtonText: this.$t('btn.determine'),
  2563. cancelButtonText: this.$t('btn.cancel'),
  2564. type: "warning"
  2565. })
  2566. .then(() => {
  2567. this.http.post('/report-import-log/delete',{
  2568. id: rowId
  2569. },res => {
  2570. if (res.code == "ok") {
  2571. this.$message({
  2572. message: '删除成功',
  2573. type: "success"
  2574. });
  2575. this.getToView();
  2576. } else {
  2577. this.$message({
  2578. message: res.msg,
  2579. type: "error"
  2580. });
  2581. }
  2582. },error => {
  2583. this.$message({
  2584. message: error,
  2585. type: "error"
  2586. });
  2587. }
  2588. );
  2589. }).catch(() => {this.startDeleting = false});
  2590. },
  2591. confirmChangeModTime() {
  2592. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2593. this.$message({
  2594. message: '请选择时间',
  2595. type: "error"
  2596. });
  2597. return;
  2598. }
  2599. this.http.post('/report-import-log/changeTime',{
  2600. modLogDateTime: this.modImportTime,
  2601. modImportUserId: this.modImportUserId,
  2602. id: this.modItemDataId
  2603. },res => {
  2604. if (res.code == "ok") {
  2605. this.$message({
  2606. message: '修改成功',
  2607. type: "success"
  2608. });
  2609. this.getToView();
  2610. this.showModImportTimeDialog = false;
  2611. } else {
  2612. this.$message({
  2613. message: res.msg,
  2614. type: "error"
  2615. });
  2616. }
  2617. },error => {
  2618. this.$message({
  2619. message: error,
  2620. type: "error"
  2621. });
  2622. }
  2623. );
  2624. },
  2625. confirmBatchApproveReport() {
  2626. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2627. this.$message({
  2628. message: '请选择日期范围',
  2629. type: "error"
  2630. });
  2631. return;
  2632. }
  2633. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2634. confirmButtonText: this.$t('btn.determine'),
  2635. cancelButtonText: this.$t('btn.cancel'),
  2636. type: "warning"
  2637. })
  2638. .then(() => {
  2639. this.startDeleting = true;
  2640. let obj = {
  2641. startDate: this.deleteReportParam.date[0],
  2642. endDate: this.deleteReportParam.date[1]
  2643. }
  2644. if(this.deleteReportParam.departmentId) {
  2645. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2646. } else {
  2647. obj.departmentId = null
  2648. }
  2649. this.http.post('/report/batchApproveByDate',obj,res => {
  2650. if (res.code == "ok") {
  2651. this.$message({
  2652. message: '审核通过',
  2653. type: "success"
  2654. });
  2655. this.getReportList();
  2656. this.getDepartment();
  2657. this.startDeleting = false;
  2658. } else {
  2659. this.$message({
  2660. message: res.msg,
  2661. type: "error"
  2662. });
  2663. }
  2664. },error => {
  2665. this.$message({
  2666. message: error,
  2667. type: "error"
  2668. });
  2669. }
  2670. );
  2671. }).catch(() => {this.startDeleting = false});
  2672. },
  2673. confirmBatchDelReport() {
  2674. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2675. this.$message({
  2676. message: '请选择部门或人员',
  2677. type: "error"
  2678. });
  2679. return;
  2680. }
  2681. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2682. this.$message({
  2683. message: '请选择日期范围',
  2684. type: "error"
  2685. });
  2686. return;
  2687. }
  2688. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2689. confirmButtonText: this.$t('btn.determine'),
  2690. cancelButtonText: this.$t('btn.cancel'),
  2691. type: "warning"
  2692. })
  2693. .then(() => {
  2694. this.startDeleting = true;
  2695. this.http.post('/report/batchDelete',{
  2696. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2697. startDate: this.deleteReportParam.date[0],
  2698. endDate: this.deleteReportParam.date[1],
  2699. deptId: this.deleteReportParam.deptId[0]
  2700. },res => {
  2701. if (res.code == "ok") {
  2702. this.$message({
  2703. message: this.$t('message.successfullyDeleted'),
  2704. type: "success"
  2705. });
  2706. this.getReportList();
  2707. this.getDepartment();
  2708. this.startDeleting = false;
  2709. } else {
  2710. this.$message({
  2711. message: res.msg,
  2712. type: "error"
  2713. });
  2714. }
  2715. },error => {
  2716. this.$message({
  2717. message: error,
  2718. type: "error"
  2719. });
  2720. }
  2721. );
  2722. }).catch(() => {this.startDeleting = false});
  2723. },
  2724. getRecentlyProject() {
  2725. this.http.post('/project/nearProject',{},res => {
  2726. if(res.code == 'ok'){
  2727. let topObj = {
  2728. label: '最近选择项目',
  2729. peojectList: res.data
  2730. }
  2731. let botomObj = {
  2732. label: '全部项目',
  2733. peojectList: this.fillProjectList
  2734. }
  2735. //最近项目如果在fillProjectList中不存在,需要移除
  2736. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2737. this.integrationProjectList = [topObj, botomObj]
  2738. }else {
  2739. this.$message({
  2740. message: res.msg,
  2741. type: 'error'
  2742. })
  2743. }
  2744. },err => {
  2745. this.$message({
  2746. message: err,
  2747. type: 'error'
  2748. })
  2749. })
  2750. },
  2751. handlePictureCardPreview(file, index) {
  2752. console.log(file, index)
  2753. let arr = []
  2754. let imgArr = this.workForm.domains[index].imgListUrl
  2755. for(var i in imgArr) {
  2756. arr.push(imgArr[i].url)
  2757. }
  2758. console.log(arr, '图片数据')
  2759. const $viewer = this.$viewerApi({
  2760. images: arr
  2761. });
  2762. },
  2763. // 图片上传
  2764. addImg(e, index) {
  2765. console.log(e, '数据')
  2766. let formData = new FormData()
  2767. formData.append('multipartFile', e.file)
  2768. this.http.uploadFile('/common/uploadFile', formData,
  2769. res => {
  2770. if (res.code == "ok") {
  2771. this.$message({
  2772. message: this.$t('uploadedsuccessfully'),
  2773. type: "success"
  2774. });
  2775. if(!this.workForm.domains[index].imgList) {
  2776. this.workForm.domains[index].imgList = []
  2777. this.workForm.domains[index].imgListUrl = []
  2778. }
  2779. this.workForm.domains[index].imgList.push(res.data)
  2780. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2781. } else {
  2782. this.$message({message: res.msg,type: "error"});
  2783. }
  2784. console.log(this.workForm.domains[index])
  2785. },
  2786. error => {this.$message({message: error,type: "error"});
  2787. });
  2788. },
  2789. // 删除图片
  2790. delImg(file,fileList, index) {
  2791. console.log(file, fileList)
  2792. let idx = 0
  2793. for(let i in fileList) {
  2794. if(fileList[i].uid == file.uid) {
  2795. idx = i
  2796. }
  2797. }
  2798. this.workForm.domains[index].imgList.splice(idx, 1)
  2799. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2800. console.log(this.workForm.domains[index])
  2801. },
  2802. test(){
  2803. console.log('test',this.workForm.domains);
  2804. },
  2805. getHour(s1, s2) {
  2806. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2807. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2808. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2809. var ms = s2.getTime() - s1.getTime();
  2810. if (ms < 0) return 0;
  2811. let ma = ms / 1000 / 60 / 60
  2812. return ma; //小时
  2813. },
  2814. refreshWXCardTime(workdate) {
  2815. if (!workdate) return;
  2816. this.syncTimeLoading = true;
  2817. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2818. date: workdate,
  2819. },res => {
  2820. this.syncTimeLoading = false;
  2821. if(res.code == 'ok'){
  2822. this.workForm.time = res.data.time;
  2823. }else {
  2824. this.$message({
  2825. message: res.msg,
  2826. type: 'error'
  2827. })
  2828. }
  2829. },err => {
  2830. this.syncTimeLoading = false;
  2831. this.$message({
  2832. message: err,
  2833. type: 'error'
  2834. })
  2835. })
  2836. },
  2837. refreshAttendance(workdate) {
  2838. if (!workdate) return;
  2839. this.syncTimeLoading = true;
  2840. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2841. startDate: workdate[0],
  2842. endDate: workdate[1]
  2843. },res => {
  2844. this.syncTimeLoading = false;
  2845. if(res.code == 'ok'){
  2846. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2847. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2848. this.totalReportHours = this.workTimeForMinYi;
  2849. }else {
  2850. this.$message({
  2851. message: res.msg,
  2852. type: 'error'
  2853. })
  2854. }
  2855. },err => {
  2856. this.syncTimeLoading = false;
  2857. this.$message({
  2858. message: err,
  2859. type: 'error'
  2860. })
  2861. })
  2862. },
  2863. refreshBeiSengAttendance(workdate) {
  2864. if (!workdate) return;
  2865. this.syncTimeLoading = true;
  2866. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2867. createDate: workdate
  2868. },res => {
  2869. this.syncTimeLoading = false;
  2870. if(res.code == 'ok'){
  2871. this.workForm.time = res.data;
  2872. }else {
  2873. this.$message({
  2874. message: res.msg,
  2875. type: 'error'
  2876. })
  2877. }
  2878. },err => {
  2879. this.syncTimeLoading = false;
  2880. this.$message({
  2881. message: err,
  2882. type: 'error'
  2883. })
  2884. })
  2885. },
  2886. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2887. this.weeklyFilledTimeDialog = true
  2888. this.weeklyFilledTimeLoading = true
  2889. this.weeklyFilledTimeDate = parameterDate
  2890. this.http.post('/report/getReportList',{
  2891. date: parameterDate,
  2892. userId: this.user.id
  2893. },res => {
  2894. this.weeklyFilledTimeLoading = false
  2895. if(res.code == 'ok'){
  2896. this.weeklyFilledTimeList = res.data[0].data
  2897. let candelete = true
  2898. for(let i in this.weeklyFilledTimeList){
  2899. if(this.weeklyFilledTimeList[i].state < 2){
  2900. candelete = false
  2901. }
  2902. }
  2903. this.weeklyFilledTimeCanDelete = candelete
  2904. }else {
  2905. this.$message({
  2906. message: res.msg,
  2907. type: 'error'
  2908. })
  2909. }
  2910. },err => {
  2911. this.weeklyFilledTimeLoading = false
  2912. this.$message({
  2913. message: err,
  2914. type: 'error'
  2915. })
  2916. })
  2917. },
  2918. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2919. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2920. confirmButtonText: this.$t('btn.determine'),
  2921. cancelButtonText: this.$t('btn.cancel'),
  2922. type: "warning"
  2923. })
  2924. .then(() => {
  2925. this.http.post('/report/delete',{
  2926. userId: this.user.id,
  2927. date: this.weeklyFilledTimeDate
  2928. },res => {
  2929. if (res.code == "ok") {
  2930. this.$message({
  2931. message: this.$t('message.successfullyDeleted'),
  2932. type: "success"
  2933. });
  2934. this.getWeeklyWorkTime()
  2935. this.getReportList();
  2936. this.getDepartment();
  2937. this.weeklyFilledTimeDialog = false;
  2938. } else {
  2939. this.$message({
  2940. message: res.msg,
  2941. type: "error"
  2942. });
  2943. }
  2944. },error => {
  2945. this.$message({
  2946. message: error,
  2947. type: "error"
  2948. });
  2949. }
  2950. );
  2951. }).catch(() => {});
  2952. },
  2953. getApprovalProcess(item){
  2954. // console.log('this.date',this.choseDate);
  2955. this.http.post('/report-log/get',{
  2956. creatorId: item.id,
  2957. createDate: sessionStorage.msg
  2958. },res => {
  2959. if(res.code == 'ok'){
  2960. this.approvalProcessDialog = true
  2961. if(this.user.userNameNeedTranslate == 1) {
  2962. for(var i in res.data) {
  2963. let obj = {
  2964. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2965. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2966. }
  2967. res.data[i].msgCon = obj
  2968. }
  2969. }
  2970. this.approvalProcessData = res.data
  2971. console.log(this.approvalProcessData, '数据卡看')
  2972. }else{
  2973. this.$message({
  2974. message: res.msg,
  2975. type: 'error'
  2976. })
  2977. }
  2978. },err => {
  2979. this.$message({
  2980. message: err,
  2981. type: 'error'
  2982. })
  2983. })
  2984. },
  2985. filterNode(value, data) {
  2986. if (!value) return true;
  2987. return data.label.indexOf(value) !== -1;
  2988. },
  2989. triggerCalculateOT(index) {
  2990. var str = this.workForm.domains[index].overtimeHours + ''
  2991. if(str.indexOf('.') != '-1') {
  2992. var s = str.split('.')[0]
  2993. var st = str.split('.')[1]
  2994. var sts = st.split('')
  2995. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2996. }
  2997. },
  2998. searchScreen(e){
  2999. if(e){
  3000. this.monthNotWorkDateS1 = []
  3001. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3002. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3003. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3004. }
  3005. }
  3006. if (this.monthNotWorkDateS1.length > 50) {
  3007. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3008. }else{
  3009. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3010. }
  3011. // if (this.monthNotWorkDateS1.length > 0) {
  3012. // setTimeout(() => {
  3013. // this.tableListenernot()
  3014. // }, 1000);
  3015. // }
  3016. }else{
  3017. this.monthWorkDataS1 = []
  3018. for (let i = 0; i < this.monthWorkData.length; i++) {
  3019. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3020. this.monthWorkDataS1.push(this.monthWorkData[i])
  3021. }
  3022. }
  3023. if (this.monthWorkDataS1.length > 50) {
  3024. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3025. }else{
  3026. this.monthWorkDataS = this.monthWorkDataS1
  3027. }
  3028. // if (this.monthWorkDataS1.length > 0) {
  3029. // setTimeout(() => {
  3030. // this.tableListener()
  3031. // }, 1000);
  3032. // }
  3033. }
  3034. },
  3035. addUpload(data) {
  3036. // var zhi = data.fileName.split('.')[0]
  3037. // var sss = zhi + '.xlsx'
  3038. // return
  3039. var filePath = '/upload/' + data.serverName;
  3040. const a = document.createElement('a'); // 创建a标签
  3041. a.setAttribute('download', data.fileName);// download属性
  3042. a.setAttribute('href', filePath);// href链接
  3043. a.click(); //自执行点击事件
  3044. a.remove();
  3045. },
  3046. restrictNumber(targetId) {
  3047. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3048. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3049. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3050. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3051. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3052. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3053. inpu.value = parseFloat(inpu.value);
  3054. }
  3055. },
  3056. //获取项目下的任务分组
  3057. getTaskGroups(domain, index) {
  3058. domain.groupId=null;
  3059. this.http.post('/task-group/listMyJoinGroup',{
  3060. projectId: domain.projectId,
  3061. isSubstitude: this.isSubstitude ? 1 : 0
  3062. },
  3063. res => {
  3064. if (res.code == "ok") {
  3065. this.workForm.domains[index].taskGroups = res.data;
  3066. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3067. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3068. // this.getGroupStages(domain, index);
  3069. // }
  3070. this.$forceUpdate();
  3071. }
  3072. },
  3073. error => {
  3074. this.$message({
  3075. message: error,
  3076. type: "error"
  3077. });
  3078. }
  3079. );
  3080. },
  3081. //下载填报工时占比报表
  3082. downloadProjectRatio() {
  3083. this.exportUserRatio = true;
  3084. // let now = new Date();
  3085. // let month = now.getMonth();//默认看上个月的
  3086. // let monthStr = month<10? ('0'+month): month;
  3087. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3088. const today = new Date();
  3089. const year = today.getFullYear();
  3090. const month = today.getMonth() + 1;
  3091. let lastMonthYear, lastMonth;
  3092. if (month === 1) {
  3093. lastMonthYear = year - 1;
  3094. lastMonth = 12;
  3095. } else {
  3096. lastMonthYear = year;
  3097. lastMonth = month - 1;
  3098. }
  3099. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3100. console.log('赋值 ==>', this.ratioYmonth)
  3101. },
  3102. confirmDownloadRatio() {
  3103. this.startRatioExporting = true;
  3104. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3105. ymonth: this.ratioYmonth
  3106. },
  3107. res => {
  3108. if (res.code == "ok") {
  3109. this.startRatioExporting = false;
  3110. var filePath = res.data;
  3111. const a = document.createElement('a'); // 创建a标签
  3112. var data = filePath.split("/");
  3113. a.setAttribute('download', data[data.length-1]);// download属性
  3114. a.setAttribute('href', filePath);// href链接
  3115. a.click(); //自执行点击事件
  3116. a.remove();
  3117. } else {
  3118. this.startRatioExporting = false;
  3119. this.$message({
  3120. message: res.msg,
  3121. type: "error"
  3122. });
  3123. }
  3124. },
  3125. error => {
  3126. this.checkinLoading = false;
  3127. this.$message({
  3128. message: error,
  3129. type: "error"
  3130. });
  3131. }
  3132. );
  3133. },
  3134. //下载带企业微信考勤数据的工时统计模板
  3135. downloadCheckInExcel() {
  3136. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3137. startDate: this.importWxParam.date[0],
  3138. endDate: this.importWxParam.date[1],
  3139. },
  3140. res => {
  3141. if (res.code == "ok") {
  3142. var filePath = res.data;
  3143. const a = document.createElement('a'); // 创建a标签
  3144. var data = filePath.split("/");
  3145. a.setAttribute('download', data[data.length-1]);// download属性
  3146. a.setAttribute('href', filePath);// href链接
  3147. a.click(); //自执行点击事件
  3148. a.remove();
  3149. } else {
  3150. this.$message({
  3151. message: res.msg,
  3152. type: "error"
  3153. });
  3154. }
  3155. },
  3156. error => {
  3157. this.checkinLoading = false;
  3158. this.$message({
  3159. message: error,
  3160. type: "error"
  3161. });
  3162. }
  3163. );
  3164. },
  3165. pre() {
  3166. if (this.active == 0) return;
  3167. this.active--;
  3168. },
  3169. next() {
  3170. this.active++;
  3171. },
  3172. triggerTotalTime(index) {
  3173. var item = this.checkinList[index];
  3174. var total = 0.0;
  3175. for (var i=0;i<this.projectColumns.length; i++) {
  3176. var key = this.projectColumns[i];
  3177. if (item[key] != null && item[key] != '') {
  3178. total += parseFloat(item[key]);
  3179. }
  3180. }
  3181. item.totalFillTime = total;
  3182. },
  3183. //提交批量代填的数据
  3184. submitBatchSubFillData() {
  3185. var data = JSON.stringify(this.checkinList);
  3186. this.http.post('/user-corpwx-time/submitProjectTime',{
  3187. json: data,
  3188. projectColumns: JSON.stringify(this.projectColumns)
  3189. },
  3190. res => {
  3191. if (res.code == "ok") {
  3192. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3193. this.importWxDialog = false;
  3194. }
  3195. },
  3196. error => {
  3197. this.checkinLoading = false;
  3198. this.$message({
  3199. message: error,
  3200. type: "error"
  3201. });
  3202. }
  3203. );
  3204. },
  3205. loadCheckInData() {
  3206. if (this.importWxParam.date == null) {
  3207. this.checkinList = [];
  3208. return;
  3209. }
  3210. this.checkinLoading = true;
  3211. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3212. startDate: this.importWxParam.date[0],
  3213. endDate: this.importWxParam.date[1],
  3214. },
  3215. res => {
  3216. if (res.code == "ok") {
  3217. this.checkinLoading = false;
  3218. this.checkinList = res.data.list;
  3219. this.projectColumns = res.data.projects;
  3220. // 自定义表格会导致表格错乱,需重新计算表格
  3221. this.$nextTick(()=>{
  3222. this.$refs.tab.doLayout()
  3223. })
  3224. }
  3225. },
  3226. error => {
  3227. this.checkinLoading = false;
  3228. this.$message({
  3229. message: error,
  3230. type: "error"
  3231. });
  3232. }
  3233. );
  3234. },
  3235. importCardTime(item) {
  3236. //首先判断文件类型
  3237. let str = item.file.name.split(".");
  3238. let format = str[str.length - 1];
  3239. if (format != "xls" && format != "xlsx") {
  3240. this.$message({
  3241. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3242. type: "error"
  3243. });
  3244. } else {
  3245. this.importingData = true;
  3246. let formData = new FormData();
  3247. formData.append("multipartFile", item.file);
  3248. formData.append("companyId", this.user.companyId);
  3249. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3250. res => {
  3251. this.$refs.uploadCardTime.clearFiles();
  3252. this.importingData = false;
  3253. if (res.code == "ok") {
  3254. //换成弹出框,以免有人等了半天回来啥也没看到
  3255. this.$message({
  3256. message: '导入考勤时长成功',
  3257. type: "success"
  3258. });
  3259. } else {
  3260. this.$message({
  3261. message: res.msg,
  3262. type: "error"
  3263. });
  3264. }
  3265. },
  3266. error => {
  3267. this.$refs.upload.clearFiles();
  3268. this.listLoading = false;
  3269. this.$message({
  3270. message: error,
  3271. type: "error"
  3272. });
  3273. });
  3274. }
  3275. },
  3276. batchImportWxData(item) {
  3277. //首先判断文件类型
  3278. let str = item.file.name.split(".");
  3279. let format = str[str.length - 1];
  3280. if (format != "xls" && format != "xlsx") {
  3281. this.$message({
  3282. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3283. type: "error"
  3284. });
  3285. } else {
  3286. this.importingData = true;
  3287. let formData = new FormData();
  3288. formData.append("file", item.file);
  3289. formData.append("companyId", this.user.companyId);
  3290. formData.append("withCheckIn", 1);
  3291. this.http.uploadFile('/report/importData', formData,
  3292. res => {
  3293. this.$refs.upload.clearFiles();
  3294. this.showImportResult = true;
  3295. this.importingData = false;
  3296. if (res.code == "ok") {
  3297. //换成弹出框,以免有人等了半天回来啥也没看到
  3298. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3299. this.getReportList();
  3300. this.importWxDialog = false;
  3301. } else {
  3302. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3303. }
  3304. },
  3305. error => {
  3306. this.$refs.upload.clearFiles();
  3307. this.listLoading = false;
  3308. this.$message({
  3309. message: error,
  3310. type: "error"
  3311. });
  3312. });
  3313. }
  3314. },
  3315. batchImportData(item) {
  3316. //首先判断文件类型
  3317. let str = item.file.name.split(".");
  3318. let format = str[str.length - 1];
  3319. if (format != "xls" && format != "xlsx") {
  3320. this.$message({
  3321. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3322. type: "error"
  3323. });
  3324. } else {
  3325. this.importingData = true;
  3326. let formData = new FormData();
  3327. formData.append("file", item.file);
  3328. formData.append("companyId", this.user.companyId);
  3329. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3330. this.http.uploadFile(url, formData,
  3331. res => {
  3332. this.$refs.upload.clearFiles();
  3333. this.importingData = false;
  3334. this.showImportResult = true;
  3335. if (res.code == "ok") {
  3336. //换成弹出框,以免有人等了半天回来啥也没看到
  3337. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3338. this.getReportList();
  3339. this.importWXDialog = false;
  3340. } else {
  3341. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3342. }
  3343. },
  3344. error => {
  3345. this.$refs.upload.clearFiles();
  3346. this.importingData = false;
  3347. this.$message({
  3348. message: error,
  3349. type: "error"
  3350. });
  3351. });
  3352. }
  3353. },
  3354. userssHu() {
  3355. this.http.post('/time-type/getCompanyTimeSetting',{
  3356. companyId: this.user.companyId
  3357. },
  3358. res => {
  3359. if (res.code == "ok") {
  3360. this.yonghuUser = res.data
  3361. }
  3362. },
  3363. error => {
  3364. this.$message({
  3365. message: error,
  3366. type: "error"
  3367. });
  3368. }
  3369. );
  3370. },
  3371. iptBlur(i) {
  3372. if(this.isBatch == 0) {
  3373. return
  3374. }
  3375. var reqParam = {
  3376. startDate: this.workForm.createDate[0],
  3377. endDate: this.workForm.createDate[1]
  3378. };
  3379. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3380. reqParam.userId = this.workForm.userId[0];
  3381. }
  3382. this.http.post('/report/getWorkDays',reqParam,
  3383. res => {
  3384. if (res.code == "ok") {
  3385. this.jsDay = res.data
  3386. this.chuji(i)
  3387. } else {
  3388. this.$message({
  3389. message: res.msg,
  3390. type: "error"
  3391. });
  3392. }
  3393. },
  3394. error => {
  3395. this.$message({
  3396. message: error,
  3397. type: "error"
  3398. });
  3399. }
  3400. );
  3401. //明夷硬编码获取
  3402. if (this.user.company.companyName == this.mingyiName) {
  3403. this.getWorkTimeForMinYi();
  3404. }
  3405. },
  3406. getWorkTimeForMinYi(){
  3407. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3408. startDate: this.workForm.createDate[0],
  3409. endDate: this.workForm.createDate[1]
  3410. },
  3411. res => {
  3412. if (res.code == "ok") {
  3413. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3414. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3415. this.totalReportHours = this.workTimeForMinYi;
  3416. } else {
  3417. this.$message({
  3418. message: res.msg,
  3419. type: "error"
  3420. });
  3421. this.workForm.createDate = [];
  3422. }
  3423. },
  3424. error => {
  3425. this.$message({
  3426. message: error,
  3427. type: "error"
  3428. });
  3429. }
  3430. );
  3431. },
  3432. chuji(i) {
  3433. if(i == 0) {
  3434. this.seleChn(1)
  3435. } else if(i == 1) {
  3436. this.seleChn(0)
  3437. } else if(i == 2) {
  3438. if(this.workForm.domains[0].multiWorktime > 0) {
  3439. this.iptChangs()
  3440. } else {
  3441. this.iptChang()
  3442. }
  3443. } else if(i == 3) {
  3444. this.seleChn(0)
  3445. }
  3446. },
  3447. seleChn(e,domain) {
  3448. if(e == 1) {
  3449. for(var i in this.workForm.domains) {
  3450. if(this.workForm.domains[i].timeType == 0) {
  3451. this.workForm.domains[i].workingTime = 8
  3452. } else {
  3453. this.workForm.domains[i].workingTime = 4
  3454. }
  3455. }
  3456. }
  3457. var quanbu = 0
  3458. var spl = this.workForm.domains
  3459. var zhi = ''
  3460. for(var i in spl) {
  3461. var sp = +spl[i].workingTime + 0
  3462. zhi = this.jsDay * sp
  3463. quanbu = +quanbu + zhi
  3464. }
  3465. this.jsTime = quanbu
  3466. this.totalReportHours = quanbu
  3467. let worktime = this.jsTime
  3468. // 自动计算加班时长
  3469. if(this.isBatch != 0){
  3470. worktime = this.jsTime / this.jsDay
  3471. }
  3472. if(this.user.timeType.fillOvertime && domain){
  3473. let isover = false
  3474. let alltime = 0
  3475. let allover = 0 //此处alltime同上面的worktime
  3476. for(let d in spl){
  3477. if(spl[d].isOvertime){
  3478. isover = true
  3479. allover += spl[d].overtimeHours*1
  3480. }
  3481. alltime += spl[d].workingTime*1
  3482. }
  3483. if(domain.overtimeHours){
  3484. allover = allover - domain.overtimeHours
  3485. }
  3486. if(worktime*1 > this.user.timeType.allday){
  3487. if(isover){
  3488. if(alltime > (allover + this.user.timeType.allday)){
  3489. this.$set(domain,'isOvertime',true)
  3490. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3491. }else{
  3492. this.$set(domain,'isOvertime',false)
  3493. this.$set(domain,'overtimeHours',null)
  3494. if(alltime < (allover + this.user.timeType.allday)){
  3495. let overtime = allover + this.user.timeType.allday - alltime
  3496. for(let pi in spl){
  3497. if(spl[pi].overtimeHours){
  3498. if((overtime - spl[pi].overtimeHours*1) > 0){
  3499. overtime = overtime - spl[pi].overtimeHours*1
  3500. this.$set(spl[pi],'isOvertime',false)
  3501. this.$set(spl[pi],'overtimeHours',null)
  3502. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3503. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3504. break
  3505. }else{
  3506. this.$set(spl[pi],'isOvertime',false)
  3507. this.$set(spl[pi],'overtimeHours',null)
  3508. break
  3509. }
  3510. }
  3511. }
  3512. }
  3513. }
  3514. }else{
  3515. this.$set(domain,'isOvertime',true)
  3516. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3517. }
  3518. }else{
  3519. for(let di in spl){
  3520. this.$set(spl[di],'isOvertime',false)
  3521. this.$set(spl[di],'overtimeHours',null)
  3522. }
  3523. }
  3524. }
  3525. },
  3526. iptChang() {
  3527. var sl = this.workForm.domains
  3528. let timeArr = []
  3529. for(var i in sl) {
  3530. if(sl[i].startTime && sl[i].endTime) {
  3531. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3532. }
  3533. }
  3534. this.getTimeHours(timeArr)
  3535. // for(let j in arrNum) {
  3536. // this.timeJsonStr += arrNum[j]
  3537. // if(flg) {
  3538. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3539. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3540. // }
  3541. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3542. // flg = true
  3543. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3544. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3545. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3546. // }
  3547. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3548. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3549. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3550. // }
  3551. // }
  3552. },
  3553. iptChangs() {
  3554. var sl = this.workForm.domains
  3555. let timeArr = []
  3556. for(var i in sl) {
  3557. for(var j in sl[i].worktimeList){
  3558. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3559. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3560. }
  3561. }
  3562. }
  3563. this.getTimeHours(timeArr)
  3564. },
  3565. // 调用接口或去数据
  3566. getTimeHours(arr) {
  3567. this.http.post('/report/getHoursByTimeRange',{
  3568. timeJsonStr: JSON.stringify(arr)
  3569. },res => {
  3570. if(res.code === 'ok') {
  3571. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3572. } else {
  3573. this.$message({
  3574. message: res.msg,
  3575. type: 'error'
  3576. })
  3577. }
  3578. },err => {
  3579. this.$message({
  3580. message: err,
  3581. type: 'error'
  3582. })
  3583. })
  3584. },
  3585. // 按周填报调用接口计算时间
  3586. async getWeekHoursByTimeRange(timeRange) {
  3587. const url = '/report/getHoursByTimeRange';
  3588. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3589. var that = this;
  3590. return new Promise((resolve, reject) => {
  3591. this.http.post(url, data, function(res) {
  3592. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3593. }, function(err) {
  3594. reject(err);
  3595. });
  3596. });
  3597. },
  3598. removeTimeItem(item, index) {
  3599. item.worktimeList.splice(index, 1);
  3600. this.iptChangs()
  3601. },
  3602. //添加工时
  3603. addNewWorktime(index, item) {
  3604. if(item.worktimeList == null ) {
  3605. item.worktimeList = []
  3606. }
  3607. item.worktimeList.push({});
  3608. },
  3609. //复制项目
  3610. copyProject(index) {
  3611. var leftProgress = 10;
  3612. if (this.reportTimeType.type == 3) {
  3613. //计算已经待分配工时比例
  3614. let array = this.workForm.domains;
  3615. let totalProgress = 0;
  3616. for (var i=0;i<array.length; i++) {
  3617. totalProgress += array[i].progress;
  3618. }
  3619. if (totalProgress < 100) {
  3620. leftProgress = 100 - totalProgress;
  3621. }
  3622. }
  3623. var newIndex = index+1;
  3624. var itemDomain = {
  3625. projectId: this.workForm.domains[index].projectId,
  3626. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3627. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3628. ),
  3629. content: "",
  3630. progress:leftProgress,
  3631. state:2,//2-表示待提交
  3632. };
  3633. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3634. if (this.reportTimeType.type == 0) {
  3635. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3636. var length = this.workForm.domains.length;
  3637. if (length == 2) {
  3638. this.showAddMore = false;
  3639. }
  3640. }
  3641. this.selectProject(itemDomain, newIndex);
  3642. },
  3643. pushWorkTime(reportId){
  3644. let url=''
  3645. if(this.user.timeType.syncSap == 1){
  3646. url='/report/pushProjectReportToSap'
  3647. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3648. var pushDate = this.date + day;
  3649. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3650. confirmButtonText: '确定',
  3651. cancelButtonText: '取消',
  3652. type: 'info'
  3653. }).then(() => {
  3654. const loading = this.$loading({
  3655. lock: true,
  3656. text: '正在推送中,请耐心等待。',
  3657. spinner: 'el-icon-loading',
  3658. background: 'rgba(0, 0, 0, 0.7)'
  3659. });
  3660. this.http.post(url,{
  3661. pushDate: pushDate,
  3662. reportId: reportId
  3663. },res => {
  3664. loading.close();
  3665. if(res.code == 'ok'){
  3666. this.$message({
  3667. type: 'success',
  3668. message: res.data
  3669. });
  3670. }else{
  3671. this.$message({
  3672. type: 'error',
  3673. message: res.msg
  3674. })
  3675. }
  3676. },err => {
  3677. loading.close();
  3678. this.$message({
  3679. type: 'error',
  3680. message: err
  3681. })
  3682. })
  3683. }).catch(() => {
  3684. });
  3685. }else{
  3686. url='/report/pushReportDataToThird'
  3687. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3688. confirmButtonText: '确定',
  3689. cancelButtonText: '取消',
  3690. type: 'info'
  3691. }).then(() => {
  3692. const loading = this.$loading({
  3693. lock: true,
  3694. text: '正在推送中,请耐心等待。',
  3695. spinner: 'el-icon-loading',
  3696. background: 'rgba(0, 0, 0, 0.7)'
  3697. });
  3698. this.http.post(url,{
  3699. yearMonth: this.date
  3700. },res => {
  3701. loading.close();
  3702. if(res.code == 'ok'){
  3703. this.$message({
  3704. type: 'success',
  3705. message: '推送成功!'
  3706. });
  3707. }else{
  3708. this.$message({
  3709. type: 'error',
  3710. message: res.msg
  3711. })
  3712. }
  3713. },err => {
  3714. loading.close();
  3715. this.$message({
  3716. type: 'error',
  3717. message: err
  3718. })
  3719. })
  3720. }).catch(() => {
  3721. });
  3722. }
  3723. },
  3724. showWorkTime(){
  3725. this.monthWorkTimeDialog = true;
  3726. this.searchKeyword = ''
  3727. this.WorktimeDatepickValue = this.istoMonth()
  3728. if(this.WorktimeDatepickValue.length == 0){
  3729. let newdate = new Date();
  3730. let nowdate = newdate.toLocaleDateString();
  3731. let getauto = this.getAutoWeekDate(nowdate)
  3732. let nowwd = [getauto[0],getauto[6]]
  3733. this.WorktimeDatepickValue = nowwd
  3734. }
  3735. this.showMonthWorkTime('first')
  3736. },
  3737. handleClick(t,e){
  3738. if (t.name == "second") {
  3739. this.showMonthNotWorkTime()
  3740. }else{
  3741. this.showMonthWorkTime(t.name)
  3742. }
  3743. },
  3744. //导出员工每日填报工时数
  3745. exportMembWorkHours() {
  3746. this.http.post(
  3747. "/report/exportUserDailyWorkTime",
  3748. {
  3749. // month: this.date,
  3750. startDate: this.WorktimeDatepickValue[0],
  3751. endDate: this.WorktimeDatepickValue[1],
  3752. },
  3753. (res) => {
  3754. if (res.code == "ok") {
  3755. let url = res.data;
  3756. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3757. }
  3758. },
  3759. (error) => {
  3760. this.$message({
  3761. message: error,
  3762. type: "error",
  3763. });
  3764. }
  3765. );
  3766. },
  3767. exportMembNotWorkHours() {
  3768. this.http.post(
  3769. "/report/exportNoReportUserList",
  3770. {
  3771. // month: this.date,
  3772. startDate: this.WorktimeDatepickValue[0],
  3773. endDate: this.WorktimeDatepickValue[1],
  3774. },
  3775. (res) => {
  3776. if (res.code == "ok") {
  3777. let url = res.data;
  3778. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3779. }
  3780. },
  3781. (error) => {
  3782. this.$message({
  3783. message: error,
  3784. type: "error",
  3785. });
  3786. }
  3787. );
  3788. },
  3789. downloadByA(name, url) {
  3790. const a = document.createElement("a"); // 创建a标签
  3791. a.setAttribute("download", name); // download属性
  3792. a.setAttribute("href", url); // href链接
  3793. a.click(); // 自执行点击事件
  3794. a.remove();
  3795. },
  3796. // 是否本月判断
  3797. istoMonth(){
  3798. let todate = new Date()
  3799. let tomonth = todate.getMonth() + 1
  3800. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3801. if(this.date == adate){
  3802. return []
  3803. }else{
  3804. let sedate = new Date(this.date)
  3805. let semonth = sedate.getMonth() + 1
  3806. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3807. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3808. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3809. return [sedates1, sedates2]
  3810. }
  3811. },
  3812. showMonthWorkTime(t) {
  3813. this.monthTotalPage = 0,
  3814. this.tbload = true
  3815. let parameter={}
  3816. if(t == "first"){
  3817. parameter={
  3818. startDate: this.WorktimeDatepickValue[0],
  3819. endDate: this.WorktimeDatepickValue[1],
  3820. }
  3821. }else{
  3822. parameter={
  3823. startDate: this.WorktimeDatepickValueForMonth[0],
  3824. endDate: this.WorktimeDatepickValueForMonth[1],
  3825. }
  3826. }
  3827. this.http.post(
  3828. "/report/getUserDailyWorkTime",
  3829. // "/report/getNoReportUserList",
  3830. parameter,
  3831. (res) => {
  3832. if (res.code == "ok") {
  3833. this.tbload = false;
  3834. this.pickDateArray = res.data.days;
  3835. // console.log('dataarray',res.data.days);
  3836. this.monthWorkData = res.data.list;
  3837. // this.monthWorkDataS = this.monthWorkData
  3838. // this.monthWorkDataS1 = res.data.list
  3839. this.monthTotal = res.data.list.length
  3840. if (this.monthWorkData.length > 50) {
  3841. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3842. }else{
  3843. this.monthWorkDataS = this.monthWorkData
  3844. }
  3845. this.searchScreen(0)
  3846. // this.monthWorkDataS = infoList
  3847. // 判断
  3848. // if (this.monthWorkDataS1.length > 0) {
  3849. // setTimeout(() => {
  3850. // this.tableListener()
  3851. // }, 1000);
  3852. // }
  3853. this.$nextTick(function(){
  3854. this.$refs.hasworkTbl.doLayout();
  3855. });
  3856. // this.$forceUpdate()
  3857. }
  3858. },
  3859. (error) => {
  3860. this.tbload = false
  3861. this.$message({
  3862. message: error,
  3863. type: "error",
  3864. });
  3865. }
  3866. );
  3867. },
  3868. // tableListener(){
  3869. // let that = this;
  3870. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3871. // // 添加scroll监听事件
  3872. // dom.addEventListener("scroll", function () {
  3873. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3874. // if (scrollDistance < 2) {
  3875. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3876. // that.monthTotalPage++; //当前页数自增
  3877. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3878. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3879. // var infoList = arrList.splice(
  3880. // that.monthTotalPage * that.monthTotalLages,
  3881. // that.monthTotalLages
  3882. // );
  3883. // // 数据添加
  3884. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3885. // }
  3886. // }
  3887. // })
  3888. // },
  3889. showMonthNotWorkTime() {
  3890. this.monthTotalPage = 0,
  3891. this.tbload = true,
  3892. this.http.post(
  3893. "/report/getNoReportUserList",
  3894. {
  3895. startDate: this.WorktimeDatepickValue[0],
  3896. endDate: this.WorktimeDatepickValue[1],
  3897. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3898. },
  3899. (res) => {
  3900. if (res.code == "ok") {
  3901. this.tbload = false
  3902. this.monthNotWorkDate = res.data;
  3903. // this.monthNotWorkDateS1 = res.data
  3904. this.monthnotTotal = res.data.length
  3905. // 2222111
  3906. if (this.monthNotWorkDate.length > 50) {
  3907. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3908. } else {
  3909. this.monthNotWorkDateS = this.monthNotWorkDate
  3910. }
  3911. this.searchScreen(1)
  3912. // 判断
  3913. // if (this.monthnotworkDateS1.length > 0) {
  3914. // setTimeout(() => {
  3915. // this.tableListenernot()
  3916. // }, 1000);
  3917. // }
  3918. this.$nextTick(function(){
  3919. this.$refs.hasworkTbl2.doLayout();
  3920. });
  3921. }
  3922. },
  3923. (error) => {
  3924. this.tbload = false
  3925. this.$message({
  3926. message: error,
  3927. type: "error",
  3928. });
  3929. }
  3930. );
  3931. },
  3932. // tableListenernot(){
  3933. // let that = this;
  3934. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3935. // dom.addEventListener("scroll", function () {
  3936. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3937. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3938. // if (scrollDistance2 < 2) {
  3939. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3940. // that.monthnotTotalPage++; //当前页数自增
  3941. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3942. // var infoList = arrList.splice(
  3943. // that.monthnotTotalPage * that.monthnotTotalLages,
  3944. // that.monthnotTotalLages
  3945. // );
  3946. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3947. // }
  3948. // }
  3949. // })
  3950. // },
  3951. listScroll(){
  3952. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3953. this.isMore = true
  3954. setTimeout(()=>{
  3955. this.isMore = false
  3956. },1000)
  3957. }else {
  3958. this.isFlag = true
  3959. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3960. this.monthWorkDataS = datalist
  3961. setTimeout(()=>{
  3962. this.isFlag = false
  3963. },300)
  3964. }
  3965. },
  3966. notListScroll(){
  3967. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3968. this.isMore = true
  3969. setTimeout(()=>{
  3970. this.isMore = false
  3971. },1000)
  3972. }else {
  3973. this.isFlag = true
  3974. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3975. this.monthNotWorkDateS = datalist
  3976. // console.log('length',this.monthNotWorkDateS.length)
  3977. setTimeout(()=>{
  3978. this.isFlag = false
  3979. },300)
  3980. }
  3981. },
  3982. getFirstAndLastDay() {
  3983. // 将选定的月份转换为Date对象
  3984. var monthDate = new Date();
  3985. var year = monthDate.getFullYear();
  3986. var month = monthDate.getMonth();
  3987. // 计算起始日和结束日
  3988. var startDay = new Date(year, month, 1);
  3989. var endDay = new Date(year, month + 1, 0);
  3990. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  3991. this.WorktimeDatepickValueForMonth=lastmd
  3992. },
  3993. formatDate(date) {
  3994. var year = date.getFullYear();
  3995. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  3996. var day = ("0" + date.getDate()).slice(-2);
  3997. return year + "-" + month + "-" + day;
  3998. },
  3999. // 获取默认这zhou日期参数 222
  4000. getLastWeek(e){
  4001. let newdate = new Date()
  4002. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4003. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4004. if(e){
  4005. this.WorktimeDatepickValue = lastwd
  4006. this.showMonthWorkTime()
  4007. }else{
  4008. this.WorktimeDatepickValue = lastwd
  4009. this.showMonthNotWorkTime()
  4010. }
  4011. },
  4012. getThisWeek(e){
  4013. let newdate = new Date();
  4014. let nowdate = newdate.toLocaleDateString();
  4015. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4016. if(e){
  4017. this.WorktimeDatepickValue = nowwd
  4018. this.showMonthWorkTime()
  4019. }else{
  4020. this.WorktimeDatepickValue = nowwd
  4021. this.showMonthNotWorkTime()
  4022. }
  4023. },
  4024. getDoubleLastWeek(e){
  4025. let newdate = new Date()
  4026. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4027. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4028. if(e){
  4029. this.WorktimeDatepickValue = nextwd
  4030. this.showMonthWorkTime()
  4031. }else{
  4032. this.WorktimeDatepickValue = nextwd
  4033. this.showMonthNotWorkTime()
  4034. }
  4035. },
  4036. alreadyAllDate(stime,etime){
  4037. let diffdate = new Array();
  4038. let i=0;
  4039. while(stime<=etime){
  4040. let dateArray = stime.split("-");
  4041. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4042. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4043. let stimewk = this.weekDay[date.getDay()]
  4044. 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')
  4045. 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])
  4046. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4047. let stime_ts = new Date(stime).getTime();
  4048. let next_date = stime_ts + (24*60*60*1000);
  4049. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4050. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4051. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4052. stime = next_dates_y+next_dates_m+next_dates_d;
  4053. i++;
  4054. }
  4055. return diffdate
  4056. },
  4057. getAutoWeekDate(e) {
  4058. let dateString = e;
  4059. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4060. if (dateString.match(dateStringReg)) {
  4061. let presentDate = new Date(dateString),
  4062. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4063. return Array.from(new Array(7), function (val, index) {
  4064. let formatDate = new Date(
  4065. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4066. );
  4067. return (
  4068. formatDate.getFullYear() +
  4069. "-" +
  4070. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4071. "-" +
  4072. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4073. );
  4074. });
  4075. } else {
  4076. throw new Error(
  4077. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4078. );
  4079. }
  4080. },
  4081. onProgressChange() {
  4082. this.$forceUpdate();
  4083. },
  4084. showChooseMembTree() {
  4085. this.chosenMembCount = this.participator.length;
  4086. this.chooseParticipVisible = true;
  4087. },
  4088. onTreeItemChange() {
  4089. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4090. var list = chosenList.filter(item=>item.isUser == 1);
  4091. this.chosenMembCount = list.length;
  4092. },
  4093. findUserInTree() {
  4094. if (this.filterName == '') {
  4095. this.deptMembData = this.allMembData;
  4096. } else {
  4097. var list = this.findRecursively(this.filterName, this.allMembData);
  4098. this.deptMembData = list;
  4099. }
  4100. },
  4101. findRecursively(username, list) {
  4102. var filterList = [];
  4103. for (var i=0;i<list.length; i++) {
  4104. if (list[i].isUser == 1) {
  4105. if (list[i].label.indexOf(username) >= 0) {
  4106. //匹配上了
  4107. filterList.push(list[i]);
  4108. }
  4109. } else if (list[i].children != null && list[i].children.length > 0) {
  4110. var subList = this.findRecursively(username, list[i].children);
  4111. if (subList.length > 0) {
  4112. subList.forEach(s=>filterList.push(s));
  4113. }
  4114. }
  4115. }
  4116. return filterList;
  4117. },
  4118. //确定选择参与人
  4119. chooseParticip() {
  4120. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4121. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4122. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4123. if (this.user.company.packageProject == 1) {
  4124. if (this.chosenMembList.length > 1) {
  4125. this.$message({
  4126. message: '每次仅支持代填一个人',
  4127. type: "error",
  4128. });
  4129. return;
  4130. }
  4131. }
  4132. this.chooseParticipVisible = false;
  4133. this.workForm.userNames = '';
  4134. this.workForm.userId = [];
  4135. this.participator = [];
  4136. for (var i=0;i<this.chosenMembList.length; i++) {
  4137. this.workForm.userId.push(this.chosenMembList[i].id);
  4138. this.workForm.userNames += this.chosenMembList[i].label+',';
  4139. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4140. this.participator.push(item);
  4141. }
  4142. if (this.workForm.userNames.length > 0) {
  4143. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4144. }
  4145. if(this.user.userNameNeedTranslate == 1) {
  4146. if(this.workForm.userNames) {
  4147. this.workForm.userNames = this.workForm.userNames.split(',')
  4148. }
  4149. }
  4150. },
  4151. notifySel(sel){
  4152. // console.log(sel);
  4153. this.notifySelList = sel
  4154. },
  4155. //微信通知人员填写
  4156. Notify(code) {
  4157. if (this.notifySelList.length == 0) return;
  4158. var ids = '';
  4159. this.notifySelList.forEach(f=>{
  4160. ids += f.id+',';
  4161. })
  4162. this.http.post('/user/pushFillReport',{
  4163. ids: ids, date: this.curDate,
  4164. code: code
  4165. },
  4166. res => {
  4167. if (res.code == "ok") {
  4168. this.$message({
  4169. message: this.$t('message.sentSuccessfully'),
  4170. type: "success"
  4171. });
  4172. }
  4173. },
  4174. error => {
  4175. this.$message({
  4176. message: error,
  4177. type: "error"
  4178. });
  4179. }
  4180. );
  4181. },
  4182. //导出人员列表
  4183. exportMemb() {
  4184. if (this.fillMembList.length == 0) return;
  4185. var ids = '';
  4186. this.fillMembList.forEach(f=>{
  4187. ids += f.id+',';
  4188. })
  4189. this.http.post('/user/exportMembList',{
  4190. ids: ids,isFill: this.isFill, date: this.curDate
  4191. },
  4192. res => {
  4193. if (res.code == "ok") {
  4194. var aTag = document.createElement('a');
  4195. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4196. aTag.href = res.data;
  4197. aTag.click();
  4198. }
  4199. },
  4200. error => {
  4201. this.$message({
  4202. message: error,
  4203. type: "error"
  4204. });
  4205. }
  4206. );
  4207. },
  4208. showMembList(fill) {
  4209. this.membListVisible = true;
  4210. if (fill == 0) {
  4211. this.fillMembList = this.unFillList;
  4212. this.isFill = false;
  4213. let leaveList = []
  4214. let unleaveList = []
  4215. for(let i in this.fillMembList){
  4216. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4217. leaveList.push(this.fillMembList[i])
  4218. }else{
  4219. unleaveList.push(this.fillMembList[i])
  4220. }
  4221. }
  4222. this.fillMembList = unleaveList
  4223. this.fillMembList_leave = leaveList
  4224. } else if(fill == 1){
  4225. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4226. this.isFill = true;
  4227. }else{
  4228. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4229. this.isFill = true;
  4230. }
  4231. },
  4232. //获取自己填写的日报状态
  4233. getReportFillStatus() {
  4234. this.http.post('/report/getReportFillStatus',{
  4235. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4236. },
  4237. res => {
  4238. if (res.code == "ok") {
  4239. this.fillStatusList = res.data;
  4240. this.allDate.forEach(d=>{
  4241. var fillInfo = null;
  4242. d.state = null;
  4243. this.fillStatusList.forEach(s=>{
  4244. // console.log(d)
  4245. var d1 = s.createDate.split('-')[2];
  4246. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4247. // console.log(d2, '我被执行了')
  4248. if (d1.indexOf('0') == 0) {
  4249. d1 = d1.substring(1,d1.length);
  4250. }
  4251. if (d1 == d2) {
  4252. d.state = s.state;
  4253. }
  4254. })
  4255. })
  4256. this.$forceUpdate();
  4257. }
  4258. },
  4259. error => {
  4260. this.$message({
  4261. message: error,
  4262. type: "error"
  4263. });
  4264. }
  4265. );
  4266. },
  4267. scrollFunction () {
  4268. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4269. if (this.domObj.attachEvent) { // IE
  4270. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4271. } else if (this.domObj.addEventListener) {
  4272. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4273. }
  4274. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4275. },
  4276. mouseScroll(event) { // google 浏览器下
  4277. let detail = event.wheelDelta || event.detail
  4278. let moveForwardStep = -1
  4279. let moveBackStep = 1
  4280. let step = 0
  4281. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4282. event.preventDefault() // 阻止浏览器默认事件
  4283. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4284. },
  4285. // //左右滚动
  4286. // wheel(e){
  4287. // var a = document.getElementById("dateScroll");
  4288. // var scroll_width = 80; //滚动一下的距离
  4289. // var e = e || window.event, v;
  4290. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4291. // if(v>3||-v>3) v=-v;
  4292. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4293. // e.preventDefault(); //阻止浏览器的默认滚动
  4294. // },
  4295. showExportDialog() {
  4296. this.exportType = 0
  4297. this.exportDialog = true;
  4298. },
  4299. showExportTimeDialog() {
  4300. this.exportTimeDialog = true;
  4301. },
  4302. changeAllTime() {
  4303. //总时长发生改变,自动按比例计算
  4304. this.workForm.domains.forEach(d=>{
  4305. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4306. });
  4307. //计算jsTime
  4308. if (this.workForm.createDate) {
  4309. let sdate = new Date(this.workForm.createDate[0]);
  4310. let edate = new Date(this.workForm.createDate[1]);
  4311. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4312. console.log('days===', days)
  4313. if (days < 0) {
  4314. days = 0;
  4315. }
  4316. this.jsTime = this.reportTimeType.allday * days;
  4317. }
  4318. },
  4319. // 是否加班的单机事件
  4320. check() {
  4321. this.selected = !this.selected
  4322. this.isNew = this.selected
  4323. },
  4324. updateSubProject() {
  4325. this.$forceUpdate();
  4326. },
  4327. selectDegreeId(domain, index) {
  4328. this.http.post('/report/defaultDegree',{
  4329. projectId: domain.projectId
  4330. },
  4331. res => {
  4332. if (res.code == "ok") {
  4333. if(res.data) {
  4334. this.workForm.domains[index].degreeId = res.data.id + ''
  4335. this.$forceUpdate();
  4336. }
  4337. }
  4338. },
  4339. error => {
  4340. this.$message({
  4341. message: error,
  4342. type: "error"
  4343. });
  4344. }
  4345. );
  4346. },
  4347. //项目选中了, 加载子项目
  4348. selectProject(domain, index) {
  4349. if(!domain.projectId){
  4350. return;
  4351. }
  4352. // 默认选中上次填写的自定义维度
  4353. if(this.yonghuUser.customDegreeActive == 1) {
  4354. this.selectDegreeId(domain, index)
  4355. }
  4356. // console.log('projectId===',domain.projectId);
  4357. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4358. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4359. this.http.post('/sub-project/list',{
  4360. projectId: domain.projectId,
  4361. isReport: true
  4362. },
  4363. res => {
  4364. //清空之前选中的子项目
  4365. // this.workForm.domains[index].subProjectId = 0;
  4366. if (res.code == "ok") {
  4367. this.workForm.domains[index].subProjectList = res.data;
  4368. this.workForm.domains[index].subProjectId = null;
  4369. this.$forceUpdate();
  4370. }
  4371. },
  4372. error => {
  4373. this.$message({
  4374. message: error,
  4375. type: "error"
  4376. });
  4377. }
  4378. );
  4379. //项目相关的近期任务
  4380. if (this.user.company.packageProject == 1) {
  4381. this.getRecentTaskList(domain, index);
  4382. //获取项目相关专业
  4383. if (this.user.company.packageEngineering == 1) {
  4384. this.getProjectProfessions(domain, index);
  4385. }
  4386. //获取项目下的任务分组
  4387. this.getTaskGroups(domain, index);
  4388. }
  4389. // 获取项目相关的维度
  4390. // domain.degreeId = null
  4391. this.$set(domain,'degreeId',null)
  4392. this.$set(domain,'multiDegrIdArray',null)
  4393. this.dimension(domain, index);
  4394. //获取项目审核人
  4395. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4396. this.getProjectAuditorList(domain, index);
  4397. } else {
  4398. //按分组的负责人来审核
  4399. domain.projectAuditorId = null;
  4400. domain.projectAuditorName = null;
  4401. domain.auditUserList = null;
  4402. }
  4403. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4404. if (this.reportTimeType.type == 3) {
  4405. //新增项目时,自动计算
  4406. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4407. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4408. }
  4409. //加载昱众的工作职责
  4410. if (this.user.companyId == this.yuzhongCompId) {
  4411. this.updateResponse(domain);
  4412. }
  4413. },
  4414. getRecentTaskList(domain, index) {
  4415. //刷新任务时,清空服务
  4416. this.$set(domain, 'sapServiceId', null);
  4417. this.$set(domain, 'taskId', null);
  4418. var param = {
  4419. projectId: domain.projectId,
  4420. isSubstitude:this.isSubstitude?1:0,
  4421. };
  4422. if (domain.groupId) {
  4423. param.groupId = domain.groupId;
  4424. }
  4425. if (domain.stage) {
  4426. param.stage = domain.stage;
  4427. }
  4428. //专业版代填,获取代填员工的任务
  4429. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4430. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4431. this.$message({
  4432. message: '请选择代填的员工',
  4433. type: "error"
  4434. });
  4435. return;
  4436. } else {
  4437. param.userId = this.workForm.userId[0];
  4438. }
  4439. }
  4440. this.http.post('/task/getRecentTask',param,
  4441. res => {
  4442. if (res.code == "ok") {
  4443. this.workForm.domains[index].allTaskList = res.data;
  4444. this.workForm.domains[index].taskList = res.data;
  4445. this.$forceUpdate();
  4446. }
  4447. },
  4448. error => {
  4449. this.$message({
  4450. message: error,
  4451. type: "error"
  4452. });
  4453. }
  4454. );
  4455. },
  4456. //获取项目审核人
  4457. getProjectAuditorList(domainItem, index) {
  4458. if(domainItem.projectId == '') {
  4459. return
  4460. }
  4461. domainItem.projectAuditorId = null;
  4462. domainItem.projectAuditorName = null;
  4463. this.http.post('/project-auditor/getList',{
  4464. projectId: domainItem.projectId,
  4465. },
  4466. res => {
  4467. if (res.code == "ok") {
  4468. domainItem.auditUserList = res.data;
  4469. if (res.data.length==0) {
  4470. this.$message({
  4471. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4472. type: "error"
  4473. });
  4474. } else if (res.data.length==1) {
  4475. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4476. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4477. }
  4478. this.$forceUpdate();
  4479. }
  4480. },
  4481. error => {
  4482. this.$message({
  4483. message: error,
  4484. type: "error"
  4485. });
  4486. }
  4487. );
  4488. },
  4489. // 获取维度数据
  4490. dimension(domain, index) {
  4491. if(domain.projectId == '') {
  4492. return
  4493. }
  4494. this.http.post('/project/getDegreeList',{
  4495. projectId: domain.projectId,
  4496. },
  4497. res => {
  4498. if (res.code == "ok") {
  4499. // console.log("维度数据",res.data);
  4500. this.workForm.domains[index].wuduList = res.data
  4501. // this.workForm = this.workForm
  4502. this.$forceUpdate()
  4503. }
  4504. },
  4505. error => {
  4506. this.$message({
  4507. message: error,
  4508. type: "error"
  4509. });
  4510. }
  4511. );
  4512. },
  4513. //切换任务阶段
  4514. changeStages(domain, index) {
  4515. if (domain.stage == null || domain.stage == '') {
  4516. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4517. } else {
  4518. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4519. }
  4520. this.getRecentTaskList(domain, index);
  4521. this.$forceUpdate();
  4522. },
  4523. getGroupStages(domain, index, keepStage) {
  4524. // console.log(domain);
  4525. if(!domain.groupId){
  4526. domain.projectAuditorId = ''
  4527. domain.stages = []
  4528. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4529. domain.taskId = ''
  4530. domain.sapServiceId = ''
  4531. }
  4532. if(this.user.timeType.reportAuditType >= 1){
  4533. domain.auditUserList = []
  4534. }
  4535. this.$forceUpdate();
  4536. return
  4537. }
  4538. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4539. res => {
  4540. if (res.code == "ok") {
  4541. if (!keepStage) {
  4542. domain.stage = '';
  4543. }
  4544. domain.stages = res.data;
  4545. this.getRecentTaskList(domain, index);
  4546. this.$forceUpdate();
  4547. }
  4548. },
  4549. error => {
  4550. this.$message({
  4551. message: error,
  4552. type: "error"
  4553. });
  4554. });
  4555. //检查当前的项目是否需要获取分组的负责人
  4556. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4557. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4558. res => {
  4559. if (res.code == "ok") {
  4560. domain.getProjectAuditorList = res.data;
  4561. domain.auditUserList = res.data;
  4562. if (res.data.length==1) {
  4563. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4564. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4565. } else if (res.data.length==0) {
  4566. domain.projectAuditorId = null;
  4567. domain.projectAuditorName = null;
  4568. }
  4569. this.$forceUpdate();
  4570. }
  4571. },
  4572. error => {
  4573. this.$message({
  4574. message: error,
  4575. type: "error"
  4576. });
  4577. });
  4578. }
  4579. },
  4580. getProjectProfessions(domain, index) {
  4581. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4582. res => {
  4583. if (res.code == "ok") {
  4584. this.workForm.domains[index].professionProgress = res.data;
  4585. this.$forceUpdate();
  4586. }
  4587. },
  4588. error => {
  4589. this.$message({
  4590. message: error,
  4591. type: "error"
  4592. });
  4593. });
  4594. },
  4595. //删除自己的日报
  4596. deleteReport() {
  4597. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4598. confirmButtonText: this.$t('btn.determine'),
  4599. cancelButtonText: this.$t('btn.cancel'),
  4600. type: "warning"
  4601. })
  4602. .then(() => {
  4603. this.listLoading = true;
  4604. this.http.post('/report/delete',{
  4605. userId: this.user.id,
  4606. date: this.workForm.createDate
  4607. },
  4608. res => {
  4609. this.listLoading = false;
  4610. if (res.code == "ok") {
  4611. this.$message({
  4612. message: this.$t('message.successfullyDeleted'),
  4613. type: "success"
  4614. });
  4615. this.getReportList();
  4616. this.getDepartment();
  4617. this.dialogVisible = false;
  4618. } else {
  4619. this.$message({
  4620. message: res.msg,
  4621. type: "error"
  4622. });
  4623. }
  4624. },
  4625. error => {
  4626. this.listLoading = false;
  4627. this.$message({
  4628. message: error,
  4629. type: "error"
  4630. });
  4631. }
  4632. );
  4633. })
  4634. .catch(() => {});
  4635. },
  4636. // 管理员删除日报
  4637. guanli(item) {
  4638. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4639. let param = {date: this.date + day, userId: item.id};
  4640. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4641. confirmButtonText: this.$t('btn.determine'),
  4642. cancelButtonText: this.$t('btn.cancel'),
  4643. type: "warning"
  4644. })
  4645. .then(() => {
  4646. this.listLoading = true;
  4647. this.http.post('/report/delete',param,
  4648. res => {
  4649. this.listLoading = false;
  4650. if (res.code == "ok") {
  4651. this.$message({
  4652. message: this.$t('message.successfullyDeleted'),
  4653. type: "success"
  4654. });
  4655. this.getReportList();
  4656. this.getDepartment();
  4657. this.dialogVisible = false;
  4658. } else {
  4659. this.$message({
  4660. message: res.msg,
  4661. type: "error"
  4662. });
  4663. }
  4664. },
  4665. error => {
  4666. this.listLoading = false;
  4667. this.$message({
  4668. message: error,
  4669. type: "error"
  4670. });
  4671. }
  4672. );
  4673. })
  4674. .catch(() => {});
  4675. },
  4676. selectAll() {
  4677. if (this.isAllSelect) {
  4678. var keys = [];
  4679. this.reportNames.forEach(b=>{
  4680. keys.push(b.id);
  4681. })
  4682. this.$refs.approveTree.setCheckedKeys(keys);
  4683. } else {
  4684. this.$refs.approveTree.setCheckedKeys([]);
  4685. }
  4686. },
  4687. removeEmptyNode(list) {
  4688. for (var i=0;i<list.length;i++) {
  4689. var cnt = 0;
  4690. if (list[i].membCount == 0) {
  4691. list.splice(i, 1);
  4692. i--;
  4693. } else if (list[i].children != null) {
  4694. this.removeEmptyNode(list[i].children);
  4695. }
  4696. }
  4697. },
  4698. calculateMembCount(list) {
  4699. for (var i in list) {
  4700. var cnt = 0;
  4701. if (list[i].children != null) {
  4702. this.calculateMembCount(list[i].children);
  4703. for (var m in list[i].children) {
  4704. cnt += list[i].children[m].membCount;
  4705. }
  4706. }
  4707. if (list[i].isUser == 1) {
  4708. cnt++;
  4709. this.membCount++;
  4710. }
  4711. list[i].membCount = cnt;
  4712. }
  4713. },
  4714. stateChange() {
  4715. // console.log(this.allData,'alldate');
  4716. this.membCount = 0;
  4717. if (this.selectState == -1) {
  4718. //全部状态
  4719. this.data = this.allData;
  4720. } else {
  4721. //未填报
  4722. this.seluserText = ''
  4723. var newData = JSON.parse(JSON.stringify(this.allData));
  4724. this.filterState(this.selectState, newData);
  4725. this.data = newData;
  4726. }
  4727. this.calculateMembCount(this.data);
  4728. this.data[0].membCount = this.membCount;//总人数
  4729. },
  4730. //按状态过滤部门人员
  4731. filterState(state, list) {
  4732. for (var i =0;i<list.length; i++) {
  4733. var obj = list[i];
  4734. if (obj.isUser == 1) {
  4735. var match = false;
  4736. if (state == -2) {
  4737. if (obj.state == null) {
  4738. match = true;
  4739. }
  4740. } else {
  4741. if (obj.state == state) {
  4742. match = true;
  4743. }
  4744. }
  4745. if (!match) {
  4746. list.splice(i, 1);
  4747. i--;
  4748. } else {
  4749. }
  4750. } else {
  4751. if (obj.children != null) {
  4752. this.filterState(state, obj.children);
  4753. }
  4754. }
  4755. }
  4756. },
  4757. //a按名称过滤部门人员
  4758. async seluserforText(){
  4759. const { userNameNeedTranslate } = this.user
  4760. this.membCount = 0;
  4761. var newData = JSON.parse(JSON.stringify(this.allData));
  4762. let textList = [this.seluserText]
  4763. if(userNameNeedTranslate == 1) {
  4764. this.dataLoading = true
  4765. let res = await this.postData('/user/getEmployeeList', {
  4766. keyword: this.seluserText,
  4767. cursor: '',
  4768. departmentId: -1,
  4769. pageIndex: 1,
  4770. pageSize: 1000
  4771. })
  4772. textList = res.data.records.map(item => item.name)
  4773. this.dataLoading = false
  4774. }
  4775. // return
  4776. console.log(textList, '<=== textList')
  4777. this.seluserforTextin(this.seluserText, newData, textList)
  4778. console.log(newData, 'Data')
  4779. this.data = newData;
  4780. this.calculateMembCount(this.data);
  4781. this.data[0].membCount = this.membCount;//总人数
  4782. },
  4783. seluserforTextin(text, list, textList = []){
  4784. for (var i =0;i<list.length; i++) {
  4785. var obj = list[i];
  4786. if (obj.isUser == 1) {
  4787. var match = false;
  4788. // if (obj.label.indexOf(text) != -1) {
  4789. // match = true
  4790. // }
  4791. if(textList.some(item => item.includes(obj.label))) {
  4792. match = true
  4793. }
  4794. if (!match) {
  4795. list.splice(i, 1);
  4796. i--;
  4797. } else {
  4798. }
  4799. } else {
  4800. if (obj.children != null) {
  4801. this.seluserforTextin(text, obj.children, textList);
  4802. }
  4803. }
  4804. }
  4805. },
  4806. // 当节点发生变化时
  4807. nodeChangeExpand(data) {
  4808. // 保存当前展开的节点
  4809. let flag = false
  4810. this.nodeModelData.some(item => {
  4811. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4812. flag = true
  4813. return true
  4814. }
  4815. })
  4816. if (!flag) { // 不存在则存到数组里
  4817. this.nodeModelData.push(data.id)
  4818. }
  4819. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4820. },
  4821. nodeChangeCollapse(data) {
  4822. console.log(this.nodeModelData)
  4823. this.nodeModelData.some((item, i) => {
  4824. if (item === data.id) {
  4825. this.nodeModelData.length = i
  4826. }
  4827. })
  4828. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4829. },
  4830. // 部门列表点击
  4831. handleNodeClick(data) {
  4832. // this.dealList = data
  4833. this.theValues(data.id, this.allData)
  4834. // this.depData = data;
  4835. var list = [];
  4836. if (data.id == -1) {
  4837. this.deptId = null;
  4838. this.targetUid = null;
  4839. list = this.data;
  4840. } else if (data.isUser == 1) {
  4841. this.deptId = null;
  4842. this.targetUid = data.id;
  4843. } else {
  4844. this.deptId = data.id;
  4845. this.targetUid = null;
  4846. list.push(data);
  4847. }
  4848. this.getReportList();
  4849. if (list.length > 0) {
  4850. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4851. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4852. }
  4853. },
  4854. exportPushLog(){
  4855. this.http.post('/sap-sync-log/export',{},
  4856. res => {
  4857. if (res.code == "ok") {
  4858. var filePath = res.data;
  4859. var fName = '推送日志.xlsx'
  4860. const a = document.createElement('a'); // 创建a标签
  4861. a.setAttribute('download', fName);// download属性
  4862. a.setAttribute('href', filePath);// href链接
  4863. a.click(); //自执行点击事件
  4864. a.remove();
  4865. } else {
  4866. this.$message({
  4867. message: res.msg,
  4868. type: "error"
  4869. });
  4870. }
  4871. },
  4872. error => {
  4873. this.$message({
  4874. message: error,
  4875. type: "error"
  4876. });
  4877. });
  4878. },
  4879. theValues(id, item) {
  4880. for(var i in item) {
  4881. if(item[i].id == id) {
  4882. this.depData = item[i]
  4883. if(id == '-1') {
  4884. this.translation = '1'
  4885. } else {
  4886. if(item[i].children) {
  4887. this.translation = '2'
  4888. } else {
  4889. this.translation = '3'
  4890. }
  4891. }
  4892. return
  4893. } else {
  4894. if(item[i].children) {
  4895. this.theValues(id, item[i].children)
  4896. }
  4897. }
  4898. }
  4899. },
  4900. //获取可以选择的代填的人员列表
  4901. getSubstitudeUserDeptList() {
  4902. if (this.deptMembData.length == 0) {
  4903. this.http.post("/department/listMyMembs", {},
  4904. res => {
  4905. if (res.code == "ok") {
  4906. let noAllData = JSON.parse(JSON.stringify(res.data));
  4907. if (noAllData.length > 0) {
  4908. // if (noAllData[0].label == '全部人员') {
  4909. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4910. noAllData.splice(0,1);
  4911. }
  4912. }
  4913. this.setUserToDept(noAllData);
  4914. this.deptMembData = noAllData;
  4915. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4916. console.log(this.deptMembData, '代填人员数据')
  4917. } else {
  4918. this.$message({
  4919. message: res.msg,
  4920. type: "error"
  4921. });
  4922. }
  4923. },
  4924. error => {
  4925. this.$message({
  4926. message: error,
  4927. type: "error"
  4928. });
  4929. });
  4930. }
  4931. },
  4932. // 获取部门列表
  4933. getDepartmentForApprove() {
  4934. this.http.post( this.port.manage.depList, {},
  4935. res => {
  4936. if (res.code == "ok") {
  4937. var list1 = JSON.parse(JSON.stringify(res.data));
  4938. this.deptOptionList = this.changeArr(list1);
  4939. console.log(this.deptOptionList, '部门')
  4940. } else {
  4941. this.$message({
  4942. message: res.msg,
  4943. type: "error"
  4944. });
  4945. }
  4946. },
  4947. error => {
  4948. this.$message({
  4949. message: error,
  4950. type: "error"
  4951. });
  4952. });
  4953. },
  4954. // 获取部门列表
  4955. getDepartment() {
  4956. //如果没有权限,就不需要获取
  4957. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4958. return;
  4959. }
  4960. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4961. var param = {date:this.date + day};
  4962. this.http.post("/report/getMembList", param,
  4963. res => {
  4964. if (res.code == "ok") {
  4965. if(res.data.length == 0){
  4966. return
  4967. }
  4968. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4969. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4970. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4971. // if (this.user.role > 0) {
  4972. // }
  4973. list.splice(0,0,{
  4974. id: -1,
  4975. label: this.$t('lable.allStaff'),
  4976. })
  4977. this.membCount = 0;
  4978. //设置员工到部门下面
  4979. this.setUserToDept(list);
  4980. this.data = list;
  4981. // console.log('data',this.data);
  4982. this.expandDate = [this.data[1].id]
  4983. this.allData = list;
  4984. // if (noAllData.length > 0) {
  4985. // if (noAllData[0].label == '全部人员') {
  4986. // noAllData.splice(0,1);
  4987. // }
  4988. // }
  4989. // this.setUserToDept(noAllData);
  4990. // this.deptMembData = noAllData;
  4991. this.option = this.changeArr(list1);
  4992. list[0].membCount = this.membCount;
  4993. if (this.depData.id == -1) {
  4994. this.depData.membCount = this.membCount;
  4995. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4996. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4997. } else {
  4998. if (this.depData.isUser == null) {
  4999. var dep = this.findTargetDept(this.data, this.depData.id);
  5000. var membDeptList = [];
  5001. membDeptList.push(dep);
  5002. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5003. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5004. }
  5005. }
  5006. if (this.depData.isUser == null) {
  5007. if (this.isFill) {
  5008. this.fillMembList = this.fillList;
  5009. } else {
  5010. this.fillMembList = this.unFillList;
  5011. }
  5012. }
  5013. this.leaveAllNum = 0
  5014. for(let i in this.unFillList){
  5015. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5016. this.leaveAllNum += 1
  5017. }
  5018. }
  5019. this.stateChange()
  5020. } else {
  5021. this.$message({
  5022. message: res.msg,
  5023. type: "error"
  5024. });
  5025. }
  5026. },
  5027. error => {
  5028. this.$message({
  5029. message: error,
  5030. type: "error"
  5031. });
  5032. });
  5033. this.getReportFillStatus();
  5034. },
  5035. findTargetDept(list, deptId) {
  5036. var t = null;
  5037. for (var i=0;i<list.length; i++) {
  5038. if (list[i].isUser == null && list[i].id == deptId) {
  5039. t = list[i];
  5040. break;
  5041. }
  5042. }
  5043. if (t == null) {
  5044. for (var i=0;i<list.length; i++) {
  5045. if (list[i].children != null && list[i].children.length > 0) {
  5046. t = this.findTargetDept(list[i].children, deptId);
  5047. if (t != null) {
  5048. break;
  5049. }
  5050. }
  5051. }
  5052. }
  5053. return t;
  5054. },
  5055. getUserMembListFromDeptList(list, isFill) {
  5056. var membList = [];
  5057. for (var i in list) {
  5058. var deptName = list[i].label;
  5059. if (list[i].userList != null) {
  5060. list[i].userList.forEach(element => {
  5061. if (isFill == 0) {
  5062. //获取未填的
  5063. if (element.state == null) {
  5064. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5065. membList.push(obj);
  5066. }
  5067. } else {
  5068. if (element.state != null) {
  5069. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5070. membList.push(obj);
  5071. }
  5072. }
  5073. });
  5074. }
  5075. if (list[i].children != null) {
  5076. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5077. }
  5078. }
  5079. return membList;
  5080. },
  5081. setUserToDept(list) {
  5082. for (var i in list) {
  5083. var cnt = 0;
  5084. if (list[i].children != null) {
  5085. this.setUserToDept(list[i].children);
  5086. for (var m in list[i].children) {
  5087. cnt += list[i].children[m].membCount;
  5088. }
  5089. }
  5090. if (list[i].userList != null) {
  5091. if (list[i].children == null) {
  5092. list[i].children = [];
  5093. }
  5094. list[i].userList.forEach(element => {
  5095. var obj = {
  5096. id: element.id,
  5097. label:element.name,
  5098. state:element.state,
  5099. parentId:element.departmentId,
  5100. isUser:1,
  5101. workingTime: element.workingTime,
  5102. leaveDays: element.leaveDays,
  5103. leaveTimes: element.leaveTimes
  5104. };
  5105. list[i].children.push(obj);
  5106. this.membCount++;
  5107. cnt++;
  5108. });
  5109. }
  5110. list[i].membCount = cnt;
  5111. }
  5112. },
  5113. // 修改数组
  5114. changeArr(arr) {
  5115. for (var i = 0; i < arr.length; i++) {
  5116. if(arr[i].id != -1 && arr[i].id != 0) {
  5117. if (arr[i].children != null && arr[i].children.length>0) {
  5118. arr[i].children = this.changeArr(arr[i].children);
  5119. }
  5120. arr[i].id && (arr[i].value = arr[i].id);
  5121. delete arr[i].id;
  5122. }
  5123. }
  5124. for(var i in arr) {
  5125. if(arr[i].id == -1 || arr[i].id == 0) {
  5126. arr.splice(i,1)
  5127. }
  5128. }
  5129. return arr;
  5130. },
  5131. //时间段范围设置改动,监听
  5132. onTimeTypeChange(timeType) {
  5133. this.seleChn(1)
  5134. this.showAddMore = true;
  5135. for(var i in this.workForm.domains) {
  5136. if (this.workForm.domains[i].timeType == 0) {
  5137. this.showAddMore = false;
  5138. break;
  5139. }
  5140. }
  5141. if (this.showAddMore) {
  5142. //检测数量
  5143. if (this.workForm.domains.length == 2) {
  5144. this.showAddMore = false;
  5145. } else {
  5146. this.showAddMore = true;
  5147. }
  5148. }
  5149. },
  5150. getTimeType() {
  5151. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5152. res => {
  5153. if (res.code == "ok") {
  5154. var t = res.data;
  5155. this.reportTimeType = t;
  5156. if (this.reportTimeType.type > 0) {
  5157. this.showAddMore = true;
  5158. }
  5159. //转化时间格式
  5160. if (t.allday != null) {
  5161. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5162. }
  5163. if (t.am != null) {
  5164. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5165. }
  5166. if (t.pm != null) {
  5167. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5168. }
  5169. let arr = []
  5170. for(var i in res.data.excludeTimeList) {
  5171. let obj = {
  5172. s: res.data.excludeTimeList[i].startTime,
  5173. e: res.data.excludeTimeList[i].endTime,
  5174. }
  5175. arr.push(obj)
  5176. }
  5177. this.vacationTime = arr
  5178. } else {
  5179. this.$message({
  5180. message: res.msg,
  5181. type: "error"
  5182. });
  5183. }
  5184. },
  5185. error => {
  5186. this.listLoading = false;
  5187. this.$message({
  5188. message: error,
  5189. type: "error"
  5190. });
  5191. });
  5192. },
  5193. // 改变月份 -------
  5194. changeMonthOut() {
  5195. this.getAllDate();
  5196. this.getReportList();
  5197. this.getDepartment();
  5198. },
  5199. // 选择日期
  5200. choseDate(i, item) {
  5201. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5202. return
  5203. }
  5204. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5205. this.choseDay = i;
  5206. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5207. sessionStorage.msg = this.date + day,
  5208. this.getReportList();
  5209. this.getDepartment();
  5210. this.curDate = item.date;
  5211. },
  5212. canClick(i, item){
  5213. let nowDate = new Date()
  5214. let nowDateYear = nowDate.getFullYear()
  5215. let itemYear = parseInt(this.date.split('-')[0])
  5216. let nowDateMonth = nowDate.getMonth() + 1
  5217. let itemMonth = parseInt(this.date.split('-')[1])
  5218. let nowDateDay = nowDate.getDate()
  5219. let itemDay = parseInt(item.showDate.split('.')[1])
  5220. if(nowDateYear < itemYear){
  5221. return false
  5222. }else if(nowDateYear == itemYear){
  5223. if(nowDateMonth < itemMonth){
  5224. return false
  5225. }else if(nowDateMonth == itemMonth){
  5226. if(nowDateDay < itemDay){
  5227. return false
  5228. }
  5229. }
  5230. }
  5231. },
  5232. // 获取日期列表
  5233. getAllDate(e) {
  5234. var dayArry = [];
  5235. var day = this.getCountDays();
  5236. let curMonthDay = null;
  5237. for (var k = 1; k <= day; k++) {
  5238. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5239. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5240. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5241. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5242. if(sessionStorage.msg) {
  5243. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5244. this.choseDay = k - 1;
  5245. curMonthDay = str;
  5246. }
  5247. } else {
  5248. if (new Date().getDate() == k) {
  5249. this.choseDay = k - 1;
  5250. }
  5251. }
  5252. } else {
  5253. this.choseDay = 0;
  5254. }
  5255. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5256. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5257. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5258. }
  5259. this.allDate = dayArry;
  5260. //不能超过最大日期
  5261. if (this.choseDay > day-1) {
  5262. this.choseDay = day-1;
  5263. }
  5264. if(sessionStorage.from != 1){
  5265. let nowmonth = new Date().getMonth() + 1
  5266. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5267. let nowdate = new Date().getDate()
  5268. if(nowd == this.date){
  5269. if(e && sessionStorage.msg){
  5270. }else{
  5271. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5272. }
  5273. let nowday = new Date(sessionStorage.msg).getDate()
  5274. this.choseDay = nowday - 1
  5275. let monthdate = new Date(sessionStorage.msg)
  5276. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5277. }else{
  5278. if(e && sessionStorage.msg){
  5279. }else{
  5280. sessionStorage.msg = this.date + '-01'
  5281. }
  5282. let monthdate = new Date(sessionStorage.msg)
  5283. this.choseDay = monthdate.getDate() - 1
  5284. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5285. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5286. }
  5287. }else{
  5288. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5289. }
  5290. //从消息点击跳转过来的,直接加载指定日期
  5291. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5292. this.curDate = sessionStorage.msg;
  5293. sessionStorage.from = 0;
  5294. } else {
  5295. // if (curMonthDay != null) {
  5296. // // this.curDate = curMonthDay;
  5297. // let d = new Date(sessionStorage.msg)
  5298. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5299. // } else {
  5300. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5301. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5302. // }
  5303. }
  5304. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5305. // if(!sessionStorage.msg){
  5306. // let msgday = this.choseDay + 1
  5307. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5308. // }
  5309. this.getReportFillStatus();
  5310. },
  5311. getCountDays() {
  5312. var newstr = this.date.replace(/-/g, "/");
  5313. var curDate = new Date(newstr+'/01');
  5314. var curMonth = curDate.getMonth();
  5315. curDate.setMonth(curMonth + 1);
  5316. curDate.setDate(0);
  5317. return curDate.getDate();
  5318. },
  5319. reqMore() {
  5320. if (this.hasMore) {
  5321. this.pageIndex++;
  5322. this.requestHttpReports();
  5323. }
  5324. },
  5325. //加载日报数据
  5326. requestHttpReports() {
  5327. //请求数据
  5328. this.listLoading = true;
  5329. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5330. let param = {date: this.date + day};
  5331. if (this.deptId) {
  5332. param.deptId = this.deptId;
  5333. }
  5334. if (this.targetUid) {
  5335. param.userId = this.targetUid;
  5336. }
  5337. //传页码
  5338. if (this.hasMore) {
  5339. param.pageIndex = this.pageIndex;
  5340. }
  5341. this.http.post( this.port.report.list, param,
  5342. res => {
  5343. this.listLoading = false;
  5344. if (res.code == "ok") {
  5345. //扩增
  5346. this.reportList = this.reportList.concat(res.data.data);
  5347. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5348. if(document.querySelector("#day"+this.choseDay)){
  5349. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5350. }
  5351. } else {
  5352. this.$message({
  5353. message: res.msg,
  5354. type: "error"
  5355. });
  5356. }
  5357. },
  5358. error => {
  5359. this.listLoading = false;
  5360. this.$message({
  5361. message: error,
  5362. type: "error"
  5363. });
  5364. });
  5365. },
  5366. //获取日报列表
  5367. getReportList() {
  5368. //初始化,重置数据
  5369. this.pageIndex = 0;
  5370. this.hasMore = true;
  5371. this.reportList = [];
  5372. this.requestHttpReports();
  5373. },
  5374. //刷新日报状态,用于审核后更新
  5375. refreshReportData(reportId) {
  5376. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5377. res => {
  5378. if (res.code == "ok") {
  5379. for (var m=0;m<this.reportList.length; m++) {
  5380. var d = this.reportList[m].data;
  5381. var find = d.filter(r=>r.id == reportId);
  5382. if (find.length > 0) {
  5383. find[0].state = res.data.state;
  5384. if (find[0].state == 2) {//被驳回,要可以编辑
  5385. this.reportList[m].state = 2;
  5386. }
  5387. find[0].isDeptAudit = res.data.isDeptAudit;
  5388. find[0].departmentAuditState = res.data.departmentAuditState;
  5389. find[0].projectAuditorName = res.data.projectAuditorName;
  5390. find[0].projectAuditorId = res.data.projectAuditorId;
  5391. find[0].projectAuditState = res.data.projectAuditState;
  5392. find[0].rejectUserid = res.data.rejectUserid;
  5393. find[0].rejectUsername = res.data.rejectUsername;
  5394. find[0].rejectReason = res.data.rejectReason;
  5395. this.$forceUpdate();
  5396. break;
  5397. }
  5398. }
  5399. } else {
  5400. this.$message({
  5401. message: res.msg,
  5402. type: "error"
  5403. });
  5404. }
  5405. },
  5406. error => {
  5407. this.listLoading = false;
  5408. this.$message({
  5409. message: error,
  5410. type: "error"
  5411. });
  5412. });
  5413. },
  5414. //导出员工工时统计
  5415. exportUserTime() {
  5416. this.listLoading = true;
  5417. var param = {};
  5418. if (this.exportParam.dateRange != null) {
  5419. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5420. }
  5421. this.http.post('/department/exportDeptStatistic', param,
  5422. res => {
  5423. this.listLoading = false;
  5424. if (res.code == "ok") {
  5425. location.href = res.data;
  5426. this.exportTimeDialog = false;
  5427. } else {
  5428. this.$message({
  5429. message: res.msg,
  5430. type: "error"
  5431. });
  5432. }
  5433. },
  5434. error => {
  5435. this.listLoading = false;
  5436. this.$message({
  5437. message: error,
  5438. type: "error"
  5439. });
  5440. });
  5441. },
  5442. //导出日报
  5443. exportReport() {
  5444. this.exportingData = true;
  5445. var param = {};
  5446. if (this.exportParam.dateRange != null) {
  5447. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5448. }
  5449. if (this.exportParam.projectId != null) {
  5450. param.projectId = this.exportParam.projectId;
  5451. }
  5452. if (this.exportParam.departmentId != null) {
  5453. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5454. }
  5455. param.stateKey = this.stateKey
  5456. // param.departmentId = this.user.departmentId
  5457. console.log(param, '《=== 导出传的参数');
  5458. console.log('开始调用exportReport接口');
  5459. this.http.post(this.port.report.export, param,
  5460. res => {
  5461. this.exportingData = false;
  5462. if (res.code == "ok") {
  5463. location.href = res.data;
  5464. this.exportDialog = false;
  5465. } else {
  5466. this.$message({
  5467. message: res.msg,
  5468. type: "error"
  5469. });
  5470. }
  5471. },
  5472. error => {
  5473. this.exportingData = false;
  5474. this.$message({
  5475. message: error,
  5476. type: "error"
  5477. });
  5478. });
  5479. },
  5480. //获取项目列表
  5481. getProjectList() {
  5482. this.listLoading = true;
  5483. this.http.post( this.port.project.list, {},
  5484. res => {
  5485. this.listLoading = false;
  5486. if (res.code == "ok") {
  5487. for(var i in res.data) {
  5488. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5489. res.data[i].projectCode = ''
  5490. }
  5491. }
  5492. this.projectList = res.data;
  5493. console.log("项目列表",this.projectList);
  5494. } else {
  5495. this.$message({
  5496. message: res.msg,
  5497. type: "error"
  5498. });
  5499. }
  5500. },
  5501. error => {
  5502. this.listLoading = false;
  5503. this.$message({
  5504. message: error,
  5505. type: "error"
  5506. });
  5507. });
  5508. },
  5509. // 获取填报日报的项目下拉列表
  5510. getFillProjectList() {
  5511. this.http.post( this.port.project.list, {
  5512. forReport: 1
  5513. },res => {
  5514. if (res.code == "ok") {
  5515. for(var i in res.data) {
  5516. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5517. res.data[i].projectCode = ''
  5518. }
  5519. }
  5520. this.fillProjectList = res.data;
  5521. this.getRecentlyProject()
  5522. } else {
  5523. this.$message({
  5524. message: res.msg,
  5525. type: "error"
  5526. });
  5527. }
  5528. },
  5529. error => {
  5530. this.$message({
  5531. message: error,
  5532. type: "error"
  5533. });
  5534. });
  5535. },
  5536. getBasecostItemList() {
  5537. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5538. companyId: this.user.companyId
  5539. },
  5540. res => {
  5541. if (res.code == "ok") {
  5542. this.timeBasecostList = res.data;
  5543. }
  5544. });
  5545. },
  5546. getAIReport(createDate) {
  5547. this.http.post('/report/getAIReport', {},
  5548. res => {
  5549. if (res.code == "ok") {
  5550. var quanbu = 0
  5551. this.jsDay = 1
  5552. var zhi = ''
  5553. var slp = res.data
  5554. for(var i in slp) {
  5555. var sp = +slp[i].workingTime + 0
  5556. zhi = this.jsDay * sp
  5557. quanbu = +quanbu + zhi
  5558. }
  5559. this.jsTime = quanbu
  5560. var aiReportData = res.data;
  5561. this.canCancelInDialog = false
  5562. if(aiReportData.length != 0) {
  5563. var arr = [];
  5564. for(var i in aiReportData) {
  5565. arr.push({
  5566. id: null,
  5567. projectId: aiReportData[i].projectId,
  5568. workingTime: aiReportData[i].workingTime,
  5569. content: '',
  5570. progress:100,
  5571. state: 2,
  5572. timeType: aiReportData[i].timeType,
  5573. subProjectList: aiReportData[i].subProjectList,
  5574. taskList: aiReportData[i].taskList,
  5575. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5576. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5577. taskId: aiReportData[i].taskId,
  5578. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5579. startTime: aiReportData[i].startTime,
  5580. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5581. endTime: aiReportData[i].endTime,
  5582. isOvertime: 0,
  5583. progress:aiReportData[i].progress,
  5584. professionProgress: aiReportData[i].professionProgressList,
  5585. stages:aiReportData[i].stages,
  5586. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5587. pics: null,
  5588. multiWorktime: aiReportData[i].multiWorktime,
  5589. worktimeList: [{}],
  5590. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5591. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5592. wuduList: aiReportData[i].degreeList,
  5593. taskGroups:aiReportData[i].taskGroups,
  5594. customData: aiReportData[i].customData,//自定义的数值
  5595. auditUserList: aiReportData[i].auditUserList,
  5596. projectAuditorId: aiReportData[i].projectAuditorId,
  5597. projectAuditorName: aiReportData[i].projectAuditorName,
  5598. overtimeHours: aiReportData[i].overtimeHours,
  5599. customText: aiReportData[i].customText,
  5600. basecostId: aiReportData[i].basecostId,
  5601. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5602. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5603. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5604. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5605. canEdit: true
  5606. })
  5607. }
  5608. this.workForm.domains = arr;
  5609. } else {
  5610. }
  5611. this.canEdit = true;
  5612. this.originCanEdit = true;
  5613. this.seleChn()
  5614. } else {
  5615. this.$message({
  5616. message: res.msg,
  5617. type: "error"
  5618. });
  5619. }
  5620. },
  5621. error => {
  5622. this.$message({
  5623. message: error,
  5624. type: "error"
  5625. });
  5626. });
  5627. },
  5628. // 获取个人某天的日报 111111
  5629. getReport() {
  5630. this.http.post( this.port.report.getPort, {
  5631. date: this.workForm.createDate
  5632. },
  5633. res => {
  5634. if (res.code == "ok") {
  5635. var quanbu = 0
  5636. this.jsDay = 1
  5637. var zhi = ''
  5638. var slp = res.data.report
  5639. for(var i in slp) {
  5640. var sp = +slp[i].workingTime + 0
  5641. zhi = this.jsDay * sp
  5642. quanbu = +quanbu + zhi
  5643. }
  5644. this.jsTime = quanbu
  5645. var list = res.data;
  5646. this.report = list;
  5647. this.reportTimeType = this.report.timeType;
  5648. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5649. this.isWeekend = !this.report.isWorkDay;
  5650. this.canCancelInDialog = false;
  5651. this.hasWrittenReport = list.report.length != 0;
  5652. if(list.report.length != 0) {
  5653. var arr = [];
  5654. this.canEdit = false;
  5655. let candelete = true
  5656. for(var i in list.report) {
  5657. var flg = null
  5658. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5659. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5660. var filteredRespList = null
  5661. if (targetP.length > 0) {
  5662. var isPublic = targetP[0].isPublic;
  5663. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5664. }
  5665. arr.push({
  5666. id: list.report[i].id,
  5667. projectId: list.report[i].projectId,
  5668. workingTime: list.report[i].workingTime,
  5669. content: list.report[i].content,
  5670. state: list.report[i].state,
  5671. timeType: list.report[i].timeType,
  5672. subProjectList: list.report[i].subProjectList,
  5673. taskList: list.report[i].taskList,
  5674. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5675. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5676. taskId: list.report[i].taskId,
  5677. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5678. startTime: list.report[i].startTime,
  5679. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5680. endTime: list.report[i].endTime,
  5681. isOvertime: flg,
  5682. progress:list.report[i].progress,
  5683. professionProgress: list.report[i].professionProgressList,
  5684. stages:list.report[i].stages,
  5685. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5686. pics: list.report[i].pics,
  5687. multiWorktime: list.report[i].multiWorktime,
  5688. worktimeList: list.report[i].worktimeList,
  5689. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5690. multiDegrIdArray: list.report[i].multiDegrIdList,
  5691. wuduList: list.report[i].degreeList,
  5692. taskGroups:list.report[i].taskGroups,
  5693. customData: list.report[i].customData,//自定义的数值
  5694. auditUserList: list.report[i].auditUserList,
  5695. projectAuditorId: list.report[i].projectAuditorId,
  5696. projectAuditorName: list.report[i].projectAuditorName,
  5697. overtimeHours: list.report[i].overtimeHours,
  5698. customText: list.report[i].customText,
  5699. basecostId: list.report[i].basecostId,
  5700. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5701. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5702. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5703. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5704. canEdit: list.report[i].state >= 2 ? true : false,
  5705. extraField1: list.report[i].extraField1,
  5706. extraField2: list.report[i].extraField2,
  5707. extraField3: list.report[i].extraField3,
  5708. workContentList: list.report[i].workContentList,
  5709. filteredRespList: filteredRespList,
  5710. serviceList: list.report[i].serviceList,
  5711. sapServiceId: list.report[i].sapServiceId,
  5712. })
  5713. if (list.report[i].state >= 2) {
  5714. this.canEdit = true;
  5715. }
  5716. if(list.report[i].state < 2){
  5717. candelete = false
  5718. }
  5719. if (list.report[i].state == 0){
  5720. this.canCancelInDialog = true
  5721. }
  5722. // 加判断
  5723. if(this.user.timeType.choseFromAlbum == 1) {
  5724. let arrList = []
  5725. for(var k in list.report[i].pics) {
  5726. let obj = {
  5727. name: k,
  5728. url: list.report[i].pics[k]
  5729. }
  5730. arrList.push(obj)
  5731. }
  5732. arr[i].imgListUrl = arrList
  5733. arr[i].imgList = list.report[i].pics
  5734. }
  5735. }
  5736. this.reportCanDelete = candelete
  5737. this.workForm = {
  5738. createDate: this.workForm.createDate,
  5739. domains: arr,
  5740. userNames:null,
  5741. userId:null,
  5742. time: list.time
  5743. }
  5744. console.log('workForm', this.workForm)
  5745. } else {
  5746. this.workForm = {
  5747. createDate: this.workForm.createDate,
  5748. domains: [{
  5749. id: null,
  5750. projectId: "",
  5751. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5752. content: "",
  5753. progress:100,
  5754. state: 2,
  5755. timeType:0,
  5756. multiWorktime: this.reportTimeType.multiWorktime,
  5757. worktimeList:[{}],
  5758. canEdit: true,
  5759. auditorFirst: '',
  5760. auditorSec: '',
  5761. auditorThird: '',
  5762. ccUserid: ''
  5763. }],
  5764. userId:null,
  5765. userNames:null,
  5766. time: this.report.time
  5767. }
  5768. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5769. this.$set(this.workForm.domains[0],'isOvertime',true)
  5770. if(this.reportTimeType.type != 2){
  5771. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5772. }
  5773. }
  5774. if(this.user.timeType.type == 1) {
  5775. var shuzhi = this.user.timeType.allday + ''
  5776. // console.log('执行一次', shuzhi.indexOf('.'))
  5777. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5778. }
  5779. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5780. //默认给第一个,必填字段
  5781. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5782. }
  5783. this.canEdit = true;
  5784. }
  5785. this.originCanEdit = this.canEdit;
  5786. this.seleChn()
  5787. } else {
  5788. this.$message({
  5789. message: res.msg,
  5790. type: "error"
  5791. });
  5792. }
  5793. },
  5794. error => {
  5795. this.$message({
  5796. message: error,
  5797. type: "error"
  5798. });
  5799. });
  5800. },
  5801. guanbi() {
  5802. this.falsss = false,
  5803. this.workTimeForMinYi=0
  5804. },
  5805. // 打开日报填写
  5806. fillInReport(i, isBatch) {
  5807. this.isWeekend = false
  5808. this.reportCanDelete = false
  5809. // console.log(this.user.timeType.type, '选择时长')
  5810. if(i != 1) {
  5811. this.falsss = false
  5812. } else {
  5813. this.falsss = true
  5814. }
  5815. if (this.isSubstitude) {
  5816. this.getSubstitudeUserDeptList();
  5817. }
  5818. if(i == -1 || this.isSubstitude) {
  5819. this.isDisable = false;
  5820. } else {
  5821. this.isDisable = true;
  5822. }
  5823. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5824. this.isBatch = isBatch;
  5825. if (this.isBatch == 0 && !this.isSubstitude) {
  5826. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5827. let weekday = new Date(this.workForm.createDate).getDay()
  5828. if(this.user.companyId == 817){
  5829. if(weekday == 0){
  5830. this.isWeekend = true
  5831. }
  5832. }else{
  5833. if(weekday == 0 || weekday == 6){
  5834. this.isWeekend = true
  5835. }
  5836. }
  5837. this.getReport(i);
  5838. } else {
  5839. // console.log('执行到了这里')
  5840. this.jsTime = 0
  5841. this.jsDay = 0
  5842. this.workForm = {
  5843. createDate: null,//批量填报没有日期
  5844. domains: [{
  5845. id: null,
  5846. projectId: "",
  5847. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5848. content: "",
  5849. progress:100,
  5850. state: 2,
  5851. timeType:0,
  5852. multiWorktime: this.reportTimeType.multiWorktime,
  5853. worktimeList:[{}],
  5854. canEdit: true,
  5855. }],
  5856. }
  5857. if(this.user.timeType.type == 1) {
  5858. var shuzhi = this.user.timeType.allday + ''
  5859. // console.log('执行二次')
  5860. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5861. }
  5862. // console.log(this.workForm)
  5863. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5864. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5865. }
  5866. this.canEdit = true;
  5867. }
  5868. this.dialogVisible = true;
  5869. },
  5870. //按周填报的弹窗口中编辑单项目相关数据
  5871. setWeekFormReportItem(reportId, i, names, row,sss) {
  5872. console.log(sss)
  5873. this.http.post('/report/getReportById', {
  5874. reportId: reportId
  5875. },
  5876. res => {
  5877. if (res.code == "ok") {
  5878. var data = res.data.report;
  5879. sss.subProjectId = data.subProjectId
  5880. sss.subProjectList = data.subProjectList;
  5881. sss.stage = data.stage
  5882. sss.subProjectList = data.subProjectList
  5883. sss.stages = data.stages
  5884. sss.taskGroups = data.taskGroups;
  5885. sss.auditUserList = data.auditUserList;
  5886. sss.degreeId = data.degreeId;
  5887. sss.customData = data.customData;
  5888. sss.wuduList = data.degreeList;
  5889. this.zhoBaoIdx = i
  5890. this.zhoBaoName = names
  5891. this.zhoBao = sss
  5892. this.zhis = row
  5893. if (sss.groupId) {
  5894. //最后一个参数表示是否保留stage的值,不要重置为空
  5895. this.getGroupStages(this.zhoBao, 0, true)
  5896. }
  5897. this.$forceUpdate();
  5898. }
  5899. });
  5900. },
  5901. // 按周填报里内容的填写
  5902. tianxies(item, i, names, row) {
  5903. if (item.state == 0) {
  5904. this.$message({
  5905. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5906. type: "error"
  5907. });
  5908. return;
  5909. }
  5910. if (item.state == 1) {
  5911. this.$message({
  5912. message: '已通过状态不可修改',
  5913. type: "error"
  5914. });
  5915. return;
  5916. }
  5917. if(this.user.timeType.notAllowedNoAttendance == 1){
  5918. if(this.zhoData[i].corpTime){
  5919. if(this.zhoData[i].corpTime.workHours == 0){
  5920. this.$message({
  5921. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5922. type: 'error'
  5923. })
  5924. return
  5925. }
  5926. }else{
  5927. this.$message({
  5928. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5929. type: 'error'
  5930. })
  5931. return
  5932. }
  5933. }
  5934. var idd = ''
  5935. var obj = {}
  5936. for(var l in this.projectList) {
  5937. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5938. }
  5939. obj.projectId = idd
  5940. this.tianxieDialogVisible = true
  5941. this.scopess = item
  5942. console.log(item, '《==== 当前的对象')
  5943. var sss = {}
  5944. if (item.id != null) {
  5945. sss.id = item.id;
  5946. sss.state = item.state;
  5947. } else {
  5948. sss.id = -1;
  5949. sss.state = 3;
  5950. }
  5951. sss.projectId = idd;
  5952. sss.progress = item.progress
  5953. sss.time = item.time
  5954. sss.content = item.content;
  5955. console.log('333', sss.content)
  5956. if (sss.time == '' && this.reportTimeType.type == 2) {
  5957. //取已填时间范围中最大的一个作为开始时间
  5958. var startTime = '09:00';
  5959. var fillStartTime = '00:00';
  5960. for (var t in this.selProjectList) {
  5961. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5962. if (fillItem.time) {
  5963. if (fillItem.time[1] > fillStartTime) {
  5964. fillStartTime = fillItem.time[1];
  5965. }
  5966. }
  5967. }
  5968. if (fillStartTime == '00:00') {
  5969. fillStartTime = '09:00';
  5970. }
  5971. var fillEndMax = '18:00';
  5972. if (fillStartTime >= '18:00') {
  5973. fillEndMax = '23:59';
  5974. }
  5975. sss.time = [fillStartTime, fillEndMax];
  5976. }
  5977. sss.groupId = item.groupId
  5978. sss.stage = item.stage;
  5979. sss.workingTime = item.workingTime
  5980. sss.projectAuditorId = item.projectAuditorId;
  5981. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5982. //默认选中第一个
  5983. sss.basecostId = this.timeBasecostList[0].id;
  5984. }
  5985. var hasEdited = this.zhoData[i][names].hasEdited;
  5986. if (hasEdited) {
  5987. sss = { ...item }
  5988. //编辑过了
  5989. sss.subProjectId = item.subProjectId
  5990. sss.stage = item.stage
  5991. sss.subProjectList = item.subProjectList
  5992. sss.stages = item.stages
  5993. sss.taskGroups = item.taskGroups;
  5994. console.log(sss.taskGroups, '33333');
  5995. sss.auditUserList = obj.auditUserList;
  5996. sss.degreeId = item.degreeId;
  5997. sss.customData = item.customData;
  5998. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5999. //只有一个审核人,自动设置上去
  6000. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6001. }
  6002. sss.wuduList = item.wuduList;
  6003. this.zhoBaoIdx = i
  6004. this.zhoBaoName = names
  6005. this.zhoBao = sss
  6006. this.zhis = row
  6007. if (sss.groupId) {
  6008. //最后一个参数表示是否保留stage的值,不要重置为空
  6009. this.getGroupStages(this.zhoBao, 0, true)
  6010. }
  6011. this.$forceUpdate();
  6012. this.getWeeklyTaskList(sss)
  6013. console.log('最后的周报 ===>', this.zhoBao)
  6014. } else {
  6015. //第一次打开,获取数据
  6016. if (sss.id == -1) {
  6017. //新填报的
  6018. this.selectProject(obj, 0);
  6019. var that = this
  6020. setTimeout(() =>{
  6021. sss.subProjectId = that.workForm.domains[0].subProjectId
  6022. sss.subProjectList = item.subProjectList;
  6023. sss.stage = that.workForm.domains[0].stage
  6024. sss.subProjectList = that.workForm.domains[0].subProjectList
  6025. sss.stages = that.workForm.domains[0].stages
  6026. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6027. sss.auditUserList = obj.auditUserList;
  6028. sss.degreeId = item.degreeId;
  6029. sss.customData = item.customData;
  6030. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6031. //只有一个审核人,自动设置上去
  6032. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6033. }
  6034. sss.wuduList = row[0].wuduList
  6035. that.zhoBaoIdx = i
  6036. that.zhoBaoName = names
  6037. that.zhoBao = sss
  6038. that.zhis = row
  6039. if (sss.groupId) {
  6040. //最后一个参数表示是否保留stage的值,不要重置为空
  6041. this.getGroupStages(that.zhoBao, 0, false)
  6042. }
  6043. that.$forceUpdate();
  6044. this.getWeeklyTaskList(sss)
  6045. },600);
  6046. } else {
  6047. //编辑填报过的;数据库已经存在的
  6048. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6049. }
  6050. }
  6051. },
  6052. // 按周填报里内容的填写点击确定
  6053. setWeekProItemData() {
  6054. //专业版模式下,任务分组和阶段必填
  6055. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6056. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6057. this.$message({
  6058. message: '任务分组和阶段必填,请检查',
  6059. type: "error"
  6060. });
  6061. return;
  6062. }
  6063. }
  6064. // 检查任务分组
  6065. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6066. this.$message({
  6067. message: '任务分组必填,请检查',
  6068. type: "error"
  6069. });
  6070. return
  6071. }
  6072. //检查子项目是否必填
  6073. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6074. this.$message({
  6075. message: '子项目必填,请检查',
  6076. type: "error"
  6077. });
  6078. return;
  6079. }
  6080. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6081. this.$message({
  6082. message: this.$t('message.Pleaseselectareviewer'),
  6083. type: "error"
  6084. });
  6085. return
  6086. }
  6087. if(this.user.timeType.reportAuditType == 3){
  6088. let auditTips = ''
  6089. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6090. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6091. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6092. if(auditTips){
  6093. auditTips = auditTips.substring(0,auditTips.length - 1)
  6094. this.$message({
  6095. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6096. type: 'error'
  6097. })
  6098. return
  6099. }
  6100. }
  6101. let errtips = ''
  6102. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6103. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6104. errtips += this.user.timeType.customDegreeName + '、'
  6105. }
  6106. }
  6107. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6108. errtips += this.user.timeType.customDataName + '、'
  6109. }
  6110. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6111. errtips += this.user.timeType.customTextName + '、'
  6112. }
  6113. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6114. errtips += this.$t('other.workMatters') +'、'
  6115. }
  6116. if(errtips){
  6117. errtips = errtips.substring(0,errtips.length - 1)
  6118. this.$message({
  6119. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6120. type: 'error'
  6121. })
  6122. return
  6123. }
  6124. this.tianxieDialogVisible = false
  6125. var zhong = this.zhoData
  6126. this.zhoBao.hasEdited = true;
  6127. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6128. this.zhoData = zhong
  6129. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6130. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6131. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6132. },
  6133. // 获取本周
  6134. getCurrentWeek() {
  6135. //今天
  6136. this.targetWeekDate = new Date();
  6137. this.initWeekFormData();
  6138. // this.jiazai()
  6139. },
  6140. // 获取上周
  6141. handleGetPrevWeek() {
  6142. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6143. this.initWeekFormData();
  6144. // this.jiazai()
  6145. },
  6146. // 获取下周
  6147. handleGetNextvWeek() {
  6148. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6149. this.initWeekFormData()
  6150. },
  6151. // 加载动画
  6152. jiazai() {
  6153. this.weekDataLoading = true
  6154. var that = this
  6155. setTimeout(() =>{
  6156. that.weekDataLoading = false
  6157. },1000);
  6158. },
  6159. // 转时间格式
  6160. dealdate(date) {
  6161. const dt = new Date(date)
  6162. const y = dt.getFullYear()
  6163. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6164. const d = (dt.getDate() + '').padStart(2, '0')
  6165. return `${y}-${m}-${d}`
  6166. },
  6167. // 按周填报
  6168. fillInReportss() {
  6169. window.addEventListener('scroll', this.handleScroll, true)
  6170. // this.jiazai()
  6171. this.fillWeekDialogVisi = true
  6172. this.getCurrentWeek();
  6173. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6174. //重新获取工时预警类型的预算项
  6175. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6176. companyId: this.user.companyId
  6177. },
  6178. res => {
  6179. if (res.code == "ok") {
  6180. this.timeBasecostList = res.data;
  6181. }
  6182. });
  6183. }
  6184. },
  6185. fillInReportCustom() {
  6186. this.weekIndex++
  6187. this.weekParentData = {
  6188. isSubstitude: this.isSubstitude
  6189. }
  6190. this.fillWeekDialogVisiCustom = true
  6191. },
  6192. // 按周填报的项目筛选
  6193. selListFun(){
  6194. this.selProjectList = []
  6195. if(this.selCon.length){
  6196. for (let i = 0; i < this.selCon.length; i++) {
  6197. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6198. }
  6199. this.selConShow = false ;
  6200. for (let i in this.zhoData) {
  6201. var obj = this.zhoData[i];
  6202. for(var j in this.selProjectList) {
  6203. var xinzhi = this.selProjectList[j].projectName
  6204. obj[xinzhi] = {}
  6205. obj[xinzhi].time = ''
  6206. obj[xinzhi].content = ''
  6207. obj[xinzhi].progress = 0
  6208. obj[xinzhi].workingTime = 0
  6209. }
  6210. }
  6211. this.initWeekFormData();
  6212. }else{
  6213. this.$message({
  6214. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6215. type:'error'
  6216. })
  6217. }
  6218. },
  6219. setWeekCardTimeData(list) {
  6220. for(let i in list){
  6221. let datei = '';
  6222. if (this.user.timeType.showDdCardtime == 1) {
  6223. datei = list[i].workDate;
  6224. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6225. datei = list[i].createDate;
  6226. } else if (this.user.timeType.syncFanwei == 1) {
  6227. datei = list[i].workDate;
  6228. }
  6229. for(let m in this.zhoData) {
  6230. if(datei == this.zhoData[m].zhoDataTime){
  6231. let item = {
  6232. startTime: list[i].startTime,
  6233. endTime: list[i].endTime,
  6234. workHours: list[i].workHours
  6235. }
  6236. this.$set(this.zhoData[m],'corpTime',item)
  6237. }
  6238. }
  6239. }
  6240. },
  6241. getWeeklyCardTime(){ //按周填报获取考勤信息
  6242. let dateStr = []
  6243. for(let i in this.zhoData){
  6244. dateStr.push(this.zhoData[i].zhoDataTime)
  6245. }
  6246. this.http.post('/report/getWeeklyCardTime',{
  6247. dateStr: JSON.stringify(dateStr)
  6248. },res => {
  6249. if(res.code == 'ok'){
  6250. for(let i in res.data){
  6251. let datei = '';
  6252. if (this.user.timeType.showDdCardtime == 1) {
  6253. datei = res.data[i].workDate.split('-');
  6254. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6255. datei = res.data[i].createDate.split('-');
  6256. }
  6257. for(let m in this.zhoData){
  6258. let datem = new Date(this.zhoData[m].zhoDataTime)
  6259. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6260. let item = {
  6261. startTime: res.data[i].startTime,
  6262. endTime: res.data[i].endTime,
  6263. workHours: res.data[i].workHours
  6264. }
  6265. this.$set(this.zhoData[m],'corpTime',item)
  6266. }
  6267. }
  6268. }
  6269. }else{
  6270. this.$message({
  6271. message: res.msg,
  6272. type: 'error'
  6273. })
  6274. }
  6275. },err => {
  6276. this.$message({
  6277. message: err,
  6278. type: 'error'
  6279. })
  6280. })
  6281. },
  6282. selListqx(){
  6283. this.fillWeekDialogVisi = false
  6284. this.selProjectList = []
  6285. this.selCon = []
  6286. },
  6287. handleScroll() {
  6288. this.changdu = this.projectList.length + 1
  6289. },
  6290. // 自动选择时间点的事件
  6291. // async zhoTimes(item, i) {
  6292. // var iss = i
  6293. // if(item.time == null) {
  6294. // return
  6295. // } else {
  6296. // const zhi = this.zhoData[iss];
  6297. // let he = 0;
  6298. // const timeArr = Object.values(zhi)
  6299. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6300. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6301. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6302. // console.log(data, 'data');
  6303. // zhi.he = `${he}h`;
  6304. // }
  6305. // },
  6306. async zhoTimes(item, index) {
  6307. const zho = this.zhoData[index];
  6308. if (!item.time) {
  6309. return;
  6310. }
  6311. const timeArr = Object.values(zho)
  6312. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6313. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6314. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6315. zho.he = `${totalHours[0]}h`;
  6316. },
  6317. // 判断两个时间段是否重叠
  6318. timeOverlap(idx, dateAr) {
  6319. let zhi = 0
  6320. for (let k in dateAr) {
  6321. if (idx !== k) {
  6322. 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))) {
  6323. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6324. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6325. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6326. }
  6327. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6328. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6329. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6330. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6331. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6332. } else {
  6333. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6334. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6335. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6336. }
  6337. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6338. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6339. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6340. }
  6341. }
  6342. }
  6343. }
  6344. }
  6345. return zhi
  6346. },
  6347. // 计算时间
  6348. getHourMinutes(str, end) {
  6349. var he = 0
  6350. var date2 = '2021/12/12 ' + end +':00'
  6351. var date1 = '2021/12/12 ' + str +':00'
  6352. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6353. var leave1=date3%(24*3600*1000)
  6354. var hours=Math.floor(leave1/(3600*1000))
  6355. var leave2=leave1%(3600*1000)
  6356. var minutes=Math.floor(leave2/(60*1000))
  6357. var shi = hours+'.'+ minutes
  6358. return he += +shi
  6359. },
  6360. // 自动选择事件长度的事件
  6361. zhoXuan(item, i) {
  6362. var iss = i
  6363. if(item.time == null) {
  6364. return
  6365. } else {
  6366. var zhi = this.zhoData[iss]
  6367. var he = 0
  6368. for(var i in zhi) {
  6369. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6370. he += +zhi[i].workingTime
  6371. }
  6372. }
  6373. zhi.he = he + 'h'
  6374. }
  6375. },
  6376. getPushWorkLogData(){
  6377. this.http.post('/sap-sync-log/list', {},
  6378. res => {
  6379. if (res.code == "ok") {
  6380. this.pushWorkTimeLogData = res.data;
  6381. } else {
  6382. this.$message({
  6383. message: res.msg,
  6384. type: "error"
  6385. });
  6386. }
  6387. },
  6388. error => {
  6389. this.$message({
  6390. message: error,
  6391. type: "error"
  6392. });
  6393. });
  6394. },
  6395. // 获取全部人员
  6396. getUsers() {
  6397. this.http.post('/user/getSimpleActiveUserList', {},
  6398. res => {
  6399. if (res.code == "ok") {
  6400. this.usersList = res.data;
  6401. } else {
  6402. this.$message({
  6403. message: res.msg,
  6404. type: "error"
  6405. });
  6406. }
  6407. },
  6408. error => {
  6409. this.$message({
  6410. message: error,
  6411. type: "error"
  6412. });
  6413. });
  6414. },
  6415. // 按时间比例
  6416. addBli(item, i) {
  6417. var iss = i
  6418. if(item.time == null) {
  6419. return
  6420. } else {
  6421. var zhi = this.zhoData[iss]
  6422. var he = 0
  6423. for(var i in zhi) {
  6424. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6425. he += +zhi[i].workingTime
  6426. }
  6427. }
  6428. zhi.he = he.toFixed(1) + 'h'
  6429. }
  6430. },
  6431. //按周填报选择的项目发生变化,需要设置列
  6432. onSelProjectChange() {
  6433. for (let i = 0; i < this.selCon.length; i++) {
  6434. var exists = false;
  6435. for (let j = 0; j < this.selProjectList.length; j++) {
  6436. if (this.selProjectList[j].id == this.selCon[i]) {
  6437. exists = true;
  6438. break;
  6439. }
  6440. }
  6441. if (!exists) {
  6442. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6443. this.selProjectList.push(newProject);
  6444. //添加新项目
  6445. for (var w in this.zhoData) {
  6446. var dayItem = this.zhoData[w];
  6447. var pName = newProject.projectName;
  6448. dayItem[pName] = {};
  6449. dayItem[pName].time = ''
  6450. dayItem[pName].content = ''
  6451. dayItem[pName].progress = 0
  6452. dayItem[pName].workingTime = 0
  6453. }
  6454. }
  6455. }
  6456. //去掉
  6457. for (let j = 0; j < this.selProjectList.length; j++) {
  6458. var exists = false;
  6459. for (let i = 0; i < this.selCon.length; i++) {
  6460. if (this.selProjectList[j].id == this.selCon[i]) {
  6461. exists = true;
  6462. break;
  6463. }
  6464. }
  6465. if (!exists) {
  6466. this.selProjectList.splice(j, 1);
  6467. j--;
  6468. }
  6469. }
  6470. this.loadFilledWeekReportItem();
  6471. //刷新表格
  6472. // this.$refs.weekTable.doLayout();
  6473. },
  6474. //根据选中的项目来刷新填写表格
  6475. loadFilledWeekReportItem() {
  6476. for (var w in this.zhoData) {
  6477. var dayItem = this.zhoData[w];
  6478. for (var i = 0; i < this.selProjectList.length; i++) {
  6479. var curColumnProject = this.selProjectList[i];
  6480. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6481. for (var t in dayItem.reportList) {
  6482. //有日报的项目,不能取消选择
  6483. for (var p in this.fillProjectList) {
  6484. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6485. }
  6486. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6487. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6488. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6489. if (this.reportTimeType.type == 2) {
  6490. //时间段模式
  6491. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6492. }
  6493. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6494. break;
  6495. }
  6496. }
  6497. // dayItem[curColumnProject.projectName] = matchReportItem;
  6498. }
  6499. }
  6500. this.$nextTick(()=>{
  6501. this.$refs.weekTable.doLayout();
  6502. });
  6503. },
  6504. initWeekFormData() {
  6505. this.weekDataLoading = true;
  6506. for (var p in this.fillProjectList) {
  6507. this.fillProjectList[p].canCancel = 1;
  6508. }
  6509. this.http.post('/report/getWeeklyReportData',{
  6510. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6511. },res => {
  6512. this.weekDataLoading = false;
  6513. if(res.code == 'ok'){
  6514. let projectList = res.data.projectList;
  6515. if (projectList.length > 0) {
  6516. //有选择过项目进行填报,直接选中
  6517. this.selProjectList = projectList;
  6518. this.selCon = [];
  6519. for (let i = 0; i < projectList.length; i++) {
  6520. this.selCon.push(projectList[i].id);
  6521. }
  6522. }
  6523. //设置日期
  6524. this.weekDateRange = res.data.dateList;
  6525. this.zhoData = [];
  6526. var arrst = []
  6527. for(var i in this.weekDateRange) {
  6528. var obj = {}
  6529. obj.zhoDataTime = this.weekDateRange[i].date
  6530. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6531. obj.he = this.weekDateRange[i].filledTime;
  6532. obj.canFill = this.weekDateRange[i].canFill;
  6533. // obj.filledTime = this.weekDateRange[i].filledTime;
  6534. obj.reportList = this.weekDateRange[i].reportList;
  6535. //初始化,防止渲染报错
  6536. for (var j = 0; j < this.selProjectList.length; j++) {
  6537. var pName = this.selProjectList[j].projectName
  6538. obj[pName] = {}
  6539. obj[pName].time = ''
  6540. obj[pName].content = ''
  6541. obj[pName].progress = 0
  6542. obj[pName].workingTime = 0
  6543. }
  6544. arrst.push(obj)
  6545. }
  6546. this.zhoData = arrst
  6547. this.setWeekCardTimeData(res.data.cardTimeList);
  6548. this.loadFilledWeekReportItem();
  6549. }else{
  6550. this.$message({
  6551. message: res.msg,
  6552. type: 'error'
  6553. })
  6554. }
  6555. },err => {
  6556. this.$message({
  6557. message: err,
  6558. type: 'error'
  6559. })
  6560. })
  6561. },
  6562. zhoZhi(res, i) {
  6563. var zhi = 0
  6564. for(var i in res) {
  6565. if(i != 'zhoDataTime' && i != 'he') {
  6566. zhi += +res[i]
  6567. }
  6568. }
  6569. res.he = zhi
  6570. },
  6571. zhoBtn(i) {
  6572. // this.zhoData.split(i, 1)
  6573. var arr = this.zhoData
  6574. arr.splice(i, 1)
  6575. },
  6576. zhoAddlast(){
  6577. this.selConShow = true
  6578. },
  6579. closeAddWeeklyReport(){
  6580. this.fillWeekDialogVisi = false
  6581. this.selConShow = true
  6582. this.selProjectList = []
  6583. this.selCon = []
  6584. },
  6585. // 提交按周填报
  6586. submitWeekReport(isDraft) {
  6587. var zhi = this.zhoData
  6588. var ll = 0
  6589. if(this.reportTimeType.type == 2) {
  6590. for(var i in zhi) {
  6591. this.dateAr = []
  6592. var alp = []
  6593. var zhis = zhi[i]
  6594. console.log(zhis)
  6595. for(var j in zhis) {
  6596. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6597. let objs = {}
  6598. objs.s = zhis[j].time[0]
  6599. objs.e = zhis[j].time[1]
  6600. objs.p = j
  6601. alp.push(objs)
  6602. }
  6603. }
  6604. console.log(alp)
  6605. this.dateAr = alp
  6606. if (this.reportTimeType.timeCanOverlap == 0) {
  6607. let str = this.$t('message.Filledtimeperiodsoverlap')
  6608. if(this.dateAr.length > 0) {
  6609. const trus = this.fns();
  6610. const overlapDataTime = this.getOverlapData(alp);
  6611. if (overlapDataTime.length > 0) {
  6612. const arrList = overlapDataTime.map((item) => item.p);
  6613. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6614. }
  6615. ll += 1
  6616. if(!trus) {
  6617. this.$message({
  6618. message: str,
  6619. type: 'error'
  6620. })
  6621. return false
  6622. }
  6623. }
  6624. } else {
  6625. if(this.dateAr.length > 0) {
  6626. ll +=1 ;
  6627. }
  6628. }
  6629. }
  6630. if(ll == 0) {
  6631. this.$message({
  6632. message: this.$t('message.Pleasefillinthetime'),
  6633. type: 'error'
  6634. })
  6635. return false
  6636. }
  6637. } else if(this.reportTimeType.type == 1){
  6638. for(var i in zhi) {
  6639. var zhis = zhi[i]
  6640. for(var j in zhis) {
  6641. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6642. ll += 1
  6643. }
  6644. }
  6645. }
  6646. if(ll == 0) {
  6647. this.$message({
  6648. message: this.$t('message.Pleaseselectatime'),
  6649. type: 'error'
  6650. })
  6651. return false
  6652. }
  6653. let overcorp = ''
  6654. for(let n in zhi){
  6655. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6656. overcorp += zhi[n].zhoDataTime + ','
  6657. }
  6658. }
  6659. if(overcorp != ''){
  6660. overcorp = overcorp.substring(0,overcorp.length - 1)
  6661. this.$message({
  6662. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6663. type: 'error'
  6664. })
  6665. return
  6666. }
  6667. }
  6668. var submits = []
  6669. let formData = new FormData();
  6670. formData.append("draft", isDraft);
  6671. if(this.reportTimeType.multiWorktime == 1){
  6672. for (var i in this.zhoData) {
  6673. var zhoD = this.zhoData[i]
  6674. var flgs = false
  6675. for(var j in zhoD) {
  6676. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6677. flgs = true
  6678. // formData.append("degreeId", "-1");
  6679. formData.append("id", '-1');
  6680. for(var s in this.projectList) {
  6681. if(j == this.projectList[s].projectName) {
  6682. formData.append("projectId", this.projectList[s].id);
  6683. }
  6684. }
  6685. if(this.user.timeType.reportAuditType == 3){
  6686. let audItem = {}
  6687. if(this.user.timeType.auditLevel > 0){
  6688. audItem.auditorFirst = zhoD[j].auditorFirst
  6689. }
  6690. if(this.user.timeType.auditLevel > 1){
  6691. audItem.auditorSec = zhoD[j].auditorSec
  6692. }
  6693. if(this.user.timeType.auditLevel > 2){
  6694. audItem.auditorThird = zhoD[j].auditorThird
  6695. }
  6696. if(zhoD[j].ccUserid){
  6697. audItem.ccUserid = zhoD[j].ccUserid
  6698. }
  6699. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6700. }
  6701. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6702. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6703. formData.append("reportTimeType", this.reportTimeType.type);
  6704. formData.append("endTime", '');
  6705. formData.append("startTime", '');
  6706. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6707. var lix = []
  6708. var objjs = {}
  6709. objjs.startTime = zhoD[j].time[0]
  6710. objjs.endTime = zhoD[j].time[1]
  6711. if (zhoD[j].content == null || zhoD[j].content == '') {
  6712. zhoD[j].content == '-'
  6713. }
  6714. objjs.content = zhoD[j].content
  6715. lix.push(objjs)
  6716. var zhiZhi = JSON.stringify(lix)
  6717. zhiZhi = zhiZhi.replace(/,/g,"@");
  6718. formData.append("content", zhiZhi)
  6719. formData.append("isOvertime", 0)
  6720. formData.append("professionProgress", "[]")
  6721. if (zhoD[j].groupId) {
  6722. formData.append("groupId",zhoD[j].groupId)
  6723. } else {
  6724. //解决后台groupId数组越界的问题
  6725. formData.append("groupId",0)
  6726. }
  6727. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6728. formData.append("createDate",zhoD.zhoDataTime)
  6729. if (zhoD[j].projectAuditorId) {
  6730. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6731. }
  6732. if(zhoD[j].basecostId) {
  6733. formData.append("basecostId", zhoD[j].basecostId);
  6734. } else {
  6735. formData.append("basecostId", 0);
  6736. }
  6737. if(this.user.timeType.customDegreeActive){
  6738. if (this.user.timeType.customDegreeMultiple) {
  6739. if (zhoD[j].multiDegrIdArray) {
  6740. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6741. } else {
  6742. formData.append('multiDegrId','[]')
  6743. }
  6744. } else {
  6745. if (zhoD[j].degreeId) {
  6746. formData.append('degreeId',zhoD[j].degreeId)
  6747. } else {
  6748. formData.append('degreeId','-1')
  6749. }
  6750. }
  6751. }else{
  6752. formData.append("degreeId", "-1");
  6753. }
  6754. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6755. formData.append('customData',zhoD[j].customData)
  6756. }else if(this.user.timeType.customDataActive){
  6757. formData.append('customData',0)
  6758. }
  6759. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6760. formData.append('customText',zhoD[j].customText)
  6761. }else if(this.user.timeType.customTextActive){
  6762. formData.append('customText','-')
  6763. }
  6764. }
  6765. }
  6766. }
  6767. } else {
  6768. for (var i in this.zhoData) {
  6769. var zhoD = this.zhoData[i]
  6770. var flgs = false
  6771. if(this.reportTimeType.type == 2) {
  6772. for(var k in this.selProjectList) {
  6773. var pItem = this.selProjectList[k];
  6774. var pName = pItem.projectName;
  6775. var j = pName;
  6776. console.log('j==周报中的项目='+j);
  6777. if(zhoD[j].time && zhoD[j].time != 'null') {
  6778. flgs = true
  6779. // formData.append("degreeId", "-1");
  6780. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6781. for(var s in this.projectList) {
  6782. if(j == this.projectList[s].projectName) {
  6783. formData.append("projectId", this.projectList[s].id);
  6784. }
  6785. }
  6786. if(this.user.timeType.reportAuditType == 3){
  6787. let audItem = {}
  6788. if(this.user.timeType.auditLevel > 0){
  6789. audItem.auditorFirst = zhoD[j].auditorFirst
  6790. }
  6791. if(this.user.timeType.auditLevel > 1){
  6792. audItem.auditorSec = zhoD[j].auditorSec
  6793. }
  6794. if(this.user.timeType.auditLevel > 2){
  6795. audItem.auditorThird = zhoD[j].auditorThird
  6796. }
  6797. if(zhoD[j].ccUserid){
  6798. audItem.ccUserid = zhoD[j].ccUserid
  6799. }
  6800. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6801. }
  6802. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6803. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6804. formData.append("reportTimeType", this.reportTimeType.type);
  6805. formData.append("endTime", zhoD[j].time[1]);
  6806. formData.append("startTime", zhoD[j].time[0]);
  6807. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6808. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6809. formData.append("isOvertime", 0)
  6810. formData.append("professionProgress", "[]")
  6811. if (zhoD[j].groupId) {
  6812. formData.append("groupId",zhoD[j].groupId)
  6813. } else {
  6814. //解决后台groupId数组越界的问题
  6815. formData.append("groupId",0)
  6816. }
  6817. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6818. formData.append("createDate",zhoD.zhoDataTime)
  6819. if (zhoD[j].projectAuditorId) {
  6820. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6821. }
  6822. if(zhoD[j].basecostId) {
  6823. formData.append("basecostId", zhoD[j].basecostId);
  6824. } else {
  6825. formData.append("basecostId", 0);
  6826. }
  6827. if(this.user.timeType.customDegreeActive){
  6828. if (this.user.timeType.customDegreeMultiple) {
  6829. if (zhoD[j].multiDegrIdArray) {
  6830. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6831. } else {
  6832. formData.append("multiDegrId", "[]");
  6833. }
  6834. } else {
  6835. if (zhoD[j].degreeId) {
  6836. formData.append('degreeId',zhoD[j].degreeId)
  6837. } else {
  6838. formData.append("degreeId", "-1");
  6839. }
  6840. }
  6841. }else{
  6842. formData.append("degreeId", "-1");
  6843. }
  6844. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6845. formData.append('customData',zhoD[j].customData)
  6846. }else if(this.user.timeType.customDataActive){
  6847. formData.append('customData',0)
  6848. }
  6849. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6850. formData.append('customText',zhoD[j].customText)
  6851. }else if(this.user.timeType.customTextActive){
  6852. formData.append('customText','-')
  6853. }
  6854. }
  6855. }
  6856. } else {
  6857. for(var k in this.selProjectList) {
  6858. var pItem = this.selProjectList[k];
  6859. var pName = pItem.projectName;
  6860. var j = pName;
  6861. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6862. flgs = true
  6863. // formData.append("degreeId", "-1");
  6864. console.log('进入了workFpppp==='+j);
  6865. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6866. for(var s in this.projectList) {
  6867. if(j == this.projectList[s].projectName) {
  6868. formData.append("projectId", this.projectList[s].id);
  6869. }
  6870. }
  6871. if(this.user.timeType.reportAuditType == 3){
  6872. let audItem = {}
  6873. if(this.user.timeType.auditLevel > 0){
  6874. audItem.auditorFirst = zhoD[j].auditorFirst
  6875. }
  6876. if(this.user.timeType.auditLevel > 1){
  6877. audItem.auditorSec = zhoD[j].auditorSec
  6878. }
  6879. if(this.user.timeType.auditLevel > 2){
  6880. audItem.auditorThird = zhoD[j].auditorThird
  6881. }
  6882. if(zhoD[j].ccUserid){
  6883. audItem.ccUserid = zhoD[j].ccUserid
  6884. }
  6885. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6886. }
  6887. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6888. // formData.append("subProjectId", zhoD[j].subProjectId);
  6889. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6890. formData.append("reportTimeType", this.reportTimeType.type);
  6891. if(this.reportTimeType.type == 1) {
  6892. formData.append("workingTime", zhoD[j].workingTime);
  6893. } else if(this.reportTimeType.type == 2) {
  6894. formData.append("endTime", zhoD[j].time[1]);
  6895. formData.append("startTime", zhoD[j].time[0]);
  6896. } else if(this.reportTimeType.type == 3) {
  6897. formData.append("progress", zhoD[j].progress);
  6898. formData.append("workingTime", zhoD[j].workingTime);
  6899. }
  6900. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6901. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6902. formData.append("isOvertime", 0)
  6903. formData.append("professionProgress", "[]")
  6904. if (zhoD[j].groupId) {
  6905. formData.append("groupId",zhoD[j].groupId)
  6906. } else {
  6907. //解决后台groupId数组越界的问题
  6908. formData.append("groupId",0)
  6909. }
  6910. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6911. formData.append("createDate",zhoD.zhoDataTime)
  6912. if (zhoD[j].projectAuditorId) {
  6913. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6914. }
  6915. if(zhoD[j].basecostId) {
  6916. formData.append("basecostId", zhoD[j].basecostId);
  6917. } else {
  6918. formData.append("basecostId", 0);
  6919. }
  6920. if(this.user.timeType.customDegreeActive){
  6921. if (this.user.timeType.customDegreeMultiple) {
  6922. if (zhoD[j].multiDegrIdArray) {
  6923. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6924. } else {
  6925. formData.append("multiDegrId", "[]");
  6926. }
  6927. } else {
  6928. if (zhoD[j].degreeId) {
  6929. formData.append('degreeId',zhoD[j].degreeId)
  6930. } else {
  6931. formData.append("degreeId", "-1");
  6932. }
  6933. }
  6934. }else{
  6935. formData.append("degreeId", "-1");
  6936. }
  6937. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6938. formData.append('customData',zhoD[j].customData)
  6939. }else if(this.user.timeType.customDataActive){
  6940. formData.append('customData',0)
  6941. }
  6942. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6943. formData.append('customText',zhoD[j].customText)
  6944. }else if(this.user.timeType.customTextActive){
  6945. formData.append('customText','-')
  6946. }
  6947. }
  6948. }
  6949. }
  6950. }
  6951. }
  6952. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6953. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6954. if(!next) {
  6955. this.$message({
  6956. message: `【${error.join('、')}】请填写任务分组`,
  6957. type: 'error'
  6958. })
  6959. return
  6960. }
  6961. // 自定义维度
  6962. this.submitingReport = true;
  6963. this.http.uploadFile( this.port.report.editPort, formData,
  6964. res => {
  6965. // this.listLoading = false;
  6966. this.submitingReport = false;
  6967. if (res.code == "ok") {
  6968. this.$message({
  6969. message: this.$t('message.fillinsuccessfully'),
  6970. type: "success"
  6971. });
  6972. this.fillWeekDialogVisi = false
  6973. this.selConShow = true
  6974. this.zhoData = []
  6975. this.weekDateRange = ''
  6976. this.getReportList();
  6977. this.getDepartment();
  6978. // 关闭弹窗 并 清空
  6979. this.selProjectList = []
  6980. this.selCon = []
  6981. this.getRecentlyProject()
  6982. } else {
  6983. this.$message({
  6984. message: res.msg,
  6985. type: "error"
  6986. });
  6987. }
  6988. },
  6989. error => {
  6990. this.submitingReport = false;
  6991. this.$message({
  6992. message: error,
  6993. type: "error"
  6994. });
  6995. });
  6996. },
  6997. handleGroupAuditorData(data) {
  6998. const { reportAuditType } = this.user.timeType
  6999. if(reportAuditType != 1 && reportAuditType != 2) {
  7000. return {next: true}
  7001. }
  7002. let arrList = [];
  7003. Object.entries(data).forEach(([key, obj]) => {
  7004. Object.entries(obj).forEach(([projectName, projectData]) => {
  7005. if (projectData.workingTime && !projectData.groupId) {
  7006. arrList.push({
  7007. projectName,
  7008. date: obj.zhoDataTime,
  7009. dateText: obj.zhoDataTimeTxt
  7010. });
  7011. }
  7012. });
  7013. });
  7014. if(arrList.length > 0) {
  7015. return {
  7016. next: false,
  7017. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7018. }
  7019. } else {
  7020. return {
  7021. next: true,
  7022. error: [],
  7023. }
  7024. }
  7025. },
  7026. ChangeHourMinutestr (str) {
  7027. if (str !== "0" && str !== "" && str !== null) {
  7028. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7029. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7030. } else {
  7031. return "";
  7032. }
  7033. },
  7034. // 得到两个日期中间的日期
  7035. getdiffdate(stime,etime){
  7036. //初始化日期列表,数组
  7037. var diffdate = new Array();
  7038. var i=0;
  7039. //开始日期小于等于结束日期,并循环
  7040. while(stime<=etime){
  7041. diffdate[i] = stime;
  7042. //获取开始日期时间戳
  7043. var stime_ts = new Date(stime).getTime();
  7044. //增加一天时间戳后的日期
  7045. var next_date = stime_ts + (24*60*60*1000);
  7046. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7047. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7048. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7049. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7050. stime = next_dates_y+next_dates_m+next_dates_d;
  7051. //增加数组key
  7052. i++;
  7053. }
  7054. return diffdate;
  7055. },
  7056. // 添加模块
  7057. addDomain(i) {
  7058. var leftProgress = 10;
  7059. if (this.reportTimeType.type == 3) {
  7060. //计算已经待分配工时比例
  7061. let array = this.workForm.domains;
  7062. let totalProgress = 0;
  7063. for (var i=0;i<array.length; i++) {
  7064. totalProgress += array[i].progress;
  7065. }
  7066. if (totalProgress < 100) {
  7067. leftProgress = 100 - totalProgress;
  7068. }
  7069. }
  7070. var addItem = {
  7071. projectId: "",
  7072. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7073. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7074. ),
  7075. content: "",
  7076. progress:leftProgress,
  7077. state:2,//2-表示待提交
  7078. multiWorktime: this.reportTimeType.multiWorktime,
  7079. worktimeList:[{}],
  7080. canEdit: true,
  7081. auditorFirst: '',
  7082. auditorSec: '',
  7083. auditorThird: '',
  7084. ccUserid: ''
  7085. // degreeId: '',
  7086. };
  7087. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7088. this.$set(addItem,'isOvertime',true)
  7089. if(this.reportTimeType.type == 3){
  7090. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7091. }
  7092. }
  7093. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7094. //默认给第一个,必填字段
  7095. addItem.basecostId = this.timeBasecostList[0].id;
  7096. }
  7097. this.workForm.domains.push(addItem);
  7098. document.getElementById('workFormsItemBottom').scrollIntoView()
  7099. this.canEdit = true
  7100. if (this.reportTimeType.type == 0) {
  7101. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7102. var length = this.workForm.domains.length;
  7103. if (length == 2) {
  7104. this.showAddMore = false;
  7105. }
  7106. }
  7107. this.chuji()
  7108. this.seleChn()
  7109. },
  7110. // 移除模块
  7111. delDomain(i) {
  7112. this.workForm.domains.splice(i,1)
  7113. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7114. if (!this.originCanEdit) {
  7115. let iscan = false
  7116. for(let i in this.workForm.domains){
  7117. if(this.workForm.domains[i].canEdit){
  7118. iscan = true
  7119. }
  7120. }
  7121. this.canEdit = iscan
  7122. }
  7123. //检测当前剩下的一个,时间类型是否是全天
  7124. if (this.reportTimeType.type == 0) {
  7125. if (this.workForm.domains[0].timeType == 0) {
  7126. this.showAddMore = false;
  7127. } else {
  7128. this.showAddMore = true;
  7129. }
  7130. }
  7131. if(this.user.timeType.multiWorktime == 1) {
  7132. this.iptChangs()
  7133. } else {
  7134. this.seleChn(0)
  7135. }
  7136. },
  7137. // 改变月份
  7138. changeMonth() {
  7139. this.isWeekend = false
  7140. let date = new Date()
  7141. let nowmon = date.getMonth() + 1
  7142. let nowday = date.getDate()
  7143. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7144. if (this.isBatch == 0) {
  7145. if(this.user.timeType.fillAhead == 0){
  7146. let date_a = new Date(this.workForm.createDate)
  7147. if(date_a.getTime() > date.getTime()){
  7148. this.workForm.createDate = nowdate
  7149. }
  7150. }
  7151. //只有按天填报才能获取当天的日报
  7152. if(!this.isSubstitude){
  7153. let weekday = new Date(this.workForm.createDate).getDay()
  7154. if(this.user.companyId == 817){
  7155. if(weekday == 0){
  7156. this.isWeekend = true
  7157. }
  7158. }else{
  7159. if(weekday == 0 || weekday == 6){
  7160. this.isWeekend = true
  7161. }
  7162. }
  7163. this.getReport()
  7164. }
  7165. }else {
  7166. if(this.user.timeType.fillAhead == 0){
  7167. let date_a = new Date(this.workForm.createDate[1])
  7168. if(date_a.getTime() > date.getTime()){
  7169. this.workForm.createDate[1] = nowdate
  7170. let sdate = new Date(this.workForm.createDate[0])
  7171. let edate = new Date(this.workForm.createDate[1])
  7172. if(sdate > edate){
  7173. this.workForm.createDate[0] = this.workForm.createDate[1]
  7174. }
  7175. }
  7176. }
  7177. }
  7178. },
  7179. // 判断时间段
  7180. fns() {
  7181. for (let k in this.dateAr) {
  7182. if (!this.judege(k)) {
  7183. return false
  7184. }
  7185. }
  7186. return true
  7187. },
  7188. judege(idx){
  7189. for (let k in this.dateAr) {
  7190. if (idx !== k) {
  7191. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7192. return false
  7193. }
  7194. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7195. return false
  7196. }
  7197. }
  7198. }
  7199. return true
  7200. },
  7201. getOverlapData(data) {
  7202. let overlapData = [];
  7203. for (let i = 0; i < data.length; i++) {
  7204. for (let j = i + 1; j < data.length; j++) {
  7205. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7206. overlapData.push(data[i], data[j]);
  7207. }
  7208. }
  7209. }
  7210. return overlapData;
  7211. },
  7212. // 保存日报111111
  7213. submitReport(isDraft) {
  7214. this.isDraft = isDraft;
  7215. this.$refs.workForm.validate(valid => {
  7216. if (valid) {
  7217. if(this.totalReportHours < this.user.timeType.allday){
  7218. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7219. confirmButtonText: '确定',
  7220. cancelButtonText: '取消',
  7221. type: 'warning'
  7222. }).then(() => {
  7223. this.submitReportSon()
  7224. }).catch(() => {
  7225. });
  7226. }else{
  7227. this.submitReportSon()
  7228. }
  7229. }
  7230. });
  7231. },
  7232. submitReportSon() {
  7233. this.dateAr = []
  7234. //检查重叠
  7235. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7236. let alp = []
  7237. if(this.user.timeType.multiWorktime != 1) {
  7238. for(var p in this.workForm.domains) {
  7239. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7240. let objs = {}
  7241. objs.s = this.workForm.domains[p].startTime
  7242. objs.e = this.workForm.domains[p].endTime
  7243. alp.push(objs)
  7244. }
  7245. }
  7246. this.dateAr = alp
  7247. if(this.dateAr.length > 0) {
  7248. let trus = this.fns()
  7249. if(!trus) {
  7250. this.$message({
  7251. message: this.$t('message.Filledtimeperiodsoverlap'),
  7252. type: "error"
  7253. });
  7254. return
  7255. }
  7256. }
  7257. } else {
  7258. for(var p in this.workForm.domains) {
  7259. var slll = this.workForm.domains[p]
  7260. for(var o in slll.worktimeList) {
  7261. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7262. let objs = {}
  7263. objs.s = slll.worktimeList[o].startTime
  7264. objs.e = slll.worktimeList[o].endTime
  7265. alp.push(objs)
  7266. }
  7267. }
  7268. }
  7269. this.dateAr = alp
  7270. if(this.dateAr.length > 0) {
  7271. let trus = this.fns()
  7272. if(!trus) {
  7273. this.$message({
  7274. message: this.$t('message.Filledtimeperiodsoverlap'),
  7275. type: "error"
  7276. });
  7277. return
  7278. }
  7279. }
  7280. }
  7281. }
  7282. //检查子项目
  7283. if (this.user.timeType.subProMustFill == 1) {
  7284. for(var p in this.workForm.domains) {
  7285. var oneProItem = this.workForm.domains[p]
  7286. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7287. //没有选择子项目
  7288. this.$message({
  7289. message: '子项目必填,请检查',
  7290. type: "error"
  7291. });
  7292. return
  7293. }
  7294. }
  7295. }
  7296. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7297. if (this.user.companyId == this.yuzhongCompId) {
  7298. for(var p in this.workForm.domains) {
  7299. var oneProItem = this.workForm.domains[p]
  7300. if (!oneProItem.extraField1) {
  7301. this.$message({
  7302. message: '角色必填,请检查',
  7303. type: "error"
  7304. });
  7305. return
  7306. }
  7307. if (!oneProItem.extraField2) {
  7308. this.$message({
  7309. message: '工作职责必填,请检查',
  7310. type: "error"
  7311. });
  7312. return
  7313. }
  7314. if (!oneProItem.extraField3) {
  7315. this.$message({
  7316. message: '工作内容必填,请检查',
  7317. type: "error"
  7318. });
  7319. return
  7320. }
  7321. }
  7322. }
  7323. // return
  7324. //代填的情况,检查人员是否已经选择
  7325. if (this.isSubstitude) {
  7326. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7327. this.$message({
  7328. message: this.$t('message.pleaseselectthepersontofillin'),
  7329. type: "error"
  7330. });
  7331. return;
  7332. }
  7333. }
  7334. //检查时间,全天和上下午不能同时存在
  7335. if (this.reportTimeType.type == 0) {
  7336. var alldayNum = 0;
  7337. var amNum = 0;
  7338. var pmNum = 0;
  7339. for(var i in this.workForm.domains) {
  7340. if (this.workForm.domains[i].timeType == 0) {
  7341. alldayNum ++;
  7342. } else if (this.workForm.domains[i].timeType == 1) {
  7343. amNum++;
  7344. } else if (this.workForm.domains[i].timeType == 2) {
  7345. pmNum++;
  7346. }
  7347. }
  7348. if (alldayNum > 1) {
  7349. this.$message({
  7350. // message: "工作时间-全天,只能选择一次",
  7351. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7352. type: "error"
  7353. });
  7354. return;
  7355. }
  7356. if (amNum > 1) {
  7357. this.$message({
  7358. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7359. type: "error"
  7360. });
  7361. return;
  7362. }
  7363. if (pmNum > 1) {
  7364. this.$message({
  7365. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7366. type: "error"
  7367. });
  7368. return;
  7369. }
  7370. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7371. this.$message({
  7372. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7373. type: "error"
  7374. });
  7375. return;
  7376. }
  7377. } else if (this.reportTimeType.type == 3) {
  7378. //总百分比不能超过100%
  7379. let total = 0;
  7380. this.workForm.domains.forEach(w=>{total += w.progress});
  7381. if (total > 100) {
  7382. this.$message({
  7383. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7384. type: "error"
  7385. });
  7386. return;
  7387. } else if (total < 100) {
  7388. this.$message({
  7389. message: this.$t('message.cannotbesubmitted'),
  7390. type: "error"
  7391. });
  7392. return;
  7393. }
  7394. }
  7395. this.listLoading = true;
  7396. let formData = new FormData();
  7397. formData.append("draft", this.isDraft);
  7398. var totalTime = 0;
  7399. for (var t=0;t<this.workForm.domains.length; t++) {
  7400. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7401. }
  7402. //批量填报不校验考勤时长,交给后台校验
  7403. if (!this.isBatch) {
  7404. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7405. if (this.workForm.time){
  7406. if (this.workForm.time.workHours == 0){
  7407. this.$message({
  7408. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7409. type: 'error'
  7410. })
  7411. return
  7412. }
  7413. }else{
  7414. this.$message({
  7415. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7416. type: 'error'
  7417. })
  7418. return
  7419. }
  7420. }
  7421. }
  7422. //针对凡己,不校验考勤时长
  7423. if (this.user.companyId != 3918 && this.reportTimeType.type == 1 && this.workForm.time) {
  7424. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7425. this.$message({
  7426. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7427. type: "error"
  7428. });
  7429. return;
  7430. }
  7431. }
  7432. for(var i in this.workForm.domains) {
  7433. // 检查任务/里程碑是否为必填
  7434. let taskRequired = this.user.timeType.taskRequired
  7435. if(taskRequired == 1) {
  7436. if(!this.workForm.domains[i].taskId) {
  7437. this.$message({
  7438. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7439. type: "error"
  7440. });
  7441. return
  7442. }
  7443. }
  7444. if(this.user.timeType.reportAuditType == 3){
  7445. let audItem = {}
  7446. let auditRule = ''
  7447. if(this.workForm.domains[i].id){
  7448. audItem.reportId = this.workForm.domains[i].id
  7449. }
  7450. if(this.user.timeType.auditLevel > 0){
  7451. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7452. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7453. }
  7454. if(this.user.timeType.auditLevel > 1){
  7455. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7456. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7457. }
  7458. if(this.user.timeType.auditLevel > 2){
  7459. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7460. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7461. }
  7462. if(this.workForm.domains[i].ccUserid){
  7463. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7464. }
  7465. if(auditRule){
  7466. auditRule = auditRule.substring(0,auditRule.length - 1)
  7467. this.$message({
  7468. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7469. type: 'error'
  7470. })
  7471. return
  7472. }
  7473. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7474. }
  7475. if (this.user.timeType.customDegreeActive) {
  7476. if (this.user.timeType.customDegreeMultiple) {
  7477. //多选
  7478. if (this.workForm.domains[i].multiDegrIdArray) {
  7479. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7480. degreeArray = degreeArray.replace(/,/g,"@");
  7481. formData.append("multiDegrId", degreeArray);
  7482. } else {
  7483. formData.append("multiDegrId", '[]');
  7484. }
  7485. } else {
  7486. //单选
  7487. if (this.workForm.domains[i].degreeId) {
  7488. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7489. } else {
  7490. formData.append("degreeId", -1);
  7491. }
  7492. }
  7493. } else {
  7494. formData.append("degreeId", -1);
  7495. }
  7496. if(this.workForm.domains[i].customData) {
  7497. // var sss = this.workForm.domains[i].degreeId.toString()
  7498. formData.append("customData", this.workForm.domains[i].customData);
  7499. } else {
  7500. formData.append("customData", 0);
  7501. }
  7502. if(this.workForm.domains[i].customText) {
  7503. formData.append("customText", this.workForm.domains[i].customText);
  7504. } else {
  7505. formData.append("customText", '-');
  7506. }
  7507. if (this.workForm.domains[i].id) {
  7508. formData.append("id", this.workForm.domains[i].id);
  7509. } else {
  7510. formData.append("id", -1);
  7511. }
  7512. formData.append("projectId", this.workForm.domains[i].projectId);
  7513. if (this.workForm.domains[i].subProjectId) {
  7514. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7515. } else {
  7516. formData.append("subProjectId", 0);
  7517. }
  7518. if (this.workForm.domains[i].groupId) {
  7519. formData.append("groupId", this.workForm.domains[i].groupId);
  7520. } else {
  7521. formData.append("groupId", 0);
  7522. }
  7523. if (this.workForm.domains[i].taskId) {
  7524. formData.append("taskId", this.workForm.domains[i].taskId);
  7525. } else {
  7526. formData.append("taskId", 0);
  7527. }
  7528. if (this.workForm.domains[i].taskFinish == true) {
  7529. formData.append("taskFinish", 1);
  7530. } else {
  7531. formData.append("taskFinish", 0);
  7532. }
  7533. formData.append("reportTimeType", this.reportTimeType.type);
  7534. if (this.reportTimeType.type == 0) {
  7535. formData.append("timeType", this.workForm.domains[i].timeType);
  7536. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7537. formData.append("workingTime", workingTime);
  7538. } else if (this.reportTimeType.type == 1){
  7539. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7540. } else if (this.reportTimeType.type == 2) {
  7541. formData.append("endTime", this.workForm.domains[i].endTime);
  7542. formData.append("startTime", this.workForm.domains[i].startTime);
  7543. } else if (this.reportTimeType.type == 3) {
  7544. //按比例分配
  7545. formData.append("progress", this.workForm.domains[i].progress);
  7546. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7547. }
  7548. if(this.user.timeType.choseFromAlbum == 1 ) {
  7549. console.log(this.workForm.domains[i].imgList)
  7550. if(this.workForm.domains[i].imgList) {
  7551. let imgListFor = this.workForm.domains[i].imgList
  7552. for(var b in imgListFor) {
  7553. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7554. }
  7555. console.log(imgListFor)
  7556. let m = JSON.stringify(imgListFor);
  7557. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7558. formData.append("picStr", m);
  7559. } else {
  7560. formData.append("picStr", '[]');
  7561. }
  7562. }
  7563. //处理多个时间事项
  7564. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7565. if (this.reportTimeType.multiWorktime == 1) {
  7566. //检查时间是否有重叠
  7567. var workList = this.workForm.domains[i].worktimeList;
  7568. for (var j=0;j<workList.length; j++) {
  7569. var curItem = workList[j];
  7570. //检查开始时间是否大于结束时间
  7571. if (curItem.startTime >= curItem.endTime) {
  7572. this.$message({
  7573. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7574. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7575. type: "error"
  7576. });
  7577. return;
  7578. }
  7579. //时间不可重叠
  7580. if (this.reportTimeType.timeCanOverlap == 0) {
  7581. for (var p = j+1;p<workList.length; p++) {
  7582. var jItem = workList[p];
  7583. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7584. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7585. this.$message({
  7586. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7587. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7588. type: "error"
  7589. });
  7590. return;
  7591. }
  7592. }
  7593. }
  7594. }
  7595. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7596. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7597. formData.append("content", m);
  7598. } else {
  7599. if (this.workForm.domains[i].content) {
  7600. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7601. m = m.replace(/,/g,",");
  7602. console.log(m, '需要传值的数据')
  7603. // formData.append("content", this.workForm.domains[i].content);
  7604. formData.append("content", m);
  7605. } else {
  7606. formData.append("content", '-');
  7607. }
  7608. }
  7609. if (this.isBatch == 0) {
  7610. formData.append("createDate", this.workForm.createDate);
  7611. } else {
  7612. //批量填报,时间范围
  7613. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7614. }
  7615. if(this.workForm.domains[i].isOvertime) {
  7616. formData.append("isOvertime", 1);
  7617. } else {
  7618. formData.append("isOvertime", 0);
  7619. }
  7620. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7621. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7622. } else {
  7623. formData.append("overtimeHours", 0);
  7624. }
  7625. if(this.workForm.domains[i].basecostId) {
  7626. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7627. } else {
  7628. formData.append("basecostId", 0);
  7629. }
  7630. if (this.workForm.userId != null) {
  7631. var targetUids = '';
  7632. this.workForm.userId.forEach(u=>{
  7633. targetUids += u + '@';
  7634. });
  7635. if (targetUids.length > 0) {
  7636. targetUids = targetUids.substring(0, targetUids.length -1);
  7637. formData.append("targetUids", targetUids);
  7638. }
  7639. }
  7640. //项目专业进度
  7641. if (this.workForm.domains[i].professionProgress) {
  7642. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7643. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7644. formData.append("professionProgress", m);
  7645. } else {
  7646. formData.append("professionProgress", "[]");
  7647. }
  7648. if (this.workForm.domains[i].stage) {
  7649. formData.append("stage", this.workForm.domains[i].stage);
  7650. } else {
  7651. formData.append("stage", "-");
  7652. }
  7653. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7654. if (this.workForm.domains[i].projectAuditorId) {
  7655. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7656. } else {
  7657. // console.log('执行到了这里')
  7658. // console.log(this.user.timeType.reportAuditType)
  7659. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7660. this.$message({
  7661. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7662. type: "error"
  7663. });
  7664. return;
  7665. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7666. //分组负责人先审核, 确定是选择了任务分组
  7667. if (this.workForm.domains[i].taskGroups.length == 0) {
  7668. this.$message({
  7669. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7670. type: "error"
  7671. });
  7672. } else if (!this.workForm.domains[i].groupId) {
  7673. // console.log(this.workForm.domains[i]);
  7674. this.$message({
  7675. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7676. type: "error"
  7677. });
  7678. } else {
  7679. this.$message({
  7680. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7681. type: "error"
  7682. });
  7683. }
  7684. return;
  7685. }
  7686. }
  7687. if (this.user.companyId == this.yuzhongCompId) {
  7688. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7689. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7690. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7691. }
  7692. //依斯贝的服务Id
  7693. if (this.user.companyId == this.yisibeiCompId) {
  7694. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7695. }
  7696. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7697. this.$message({
  7698. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7699. type: "error"
  7700. });
  7701. return
  7702. }
  7703. }
  7704. this.submitingReport = true;
  7705. this.http.uploadFile( this.port.report.editPort, formData,
  7706. res => {
  7707. this.listLoading = false;
  7708. this.submitingReport = false;
  7709. if (res.code == "ok") {
  7710. if(res.msg!=null){
  7711. this.$message({
  7712. dangerouslyUseHTMLString: true,
  7713. message: res.msg,
  7714. type: "warning",
  7715. showClose: true,
  7716. duration: 0
  7717. });
  7718. }else{
  7719. this.$message({
  7720. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7721. type: "success"
  7722. });
  7723. }
  7724. this.dialogVisible = false;
  7725. this.jsDay = 0
  7726. this.jsTime = 0
  7727. this.getReportList();
  7728. this.getDepartment();
  7729. this.getRecentlyProject()
  7730. } else {
  7731. this.$message({
  7732. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7733. type: "error"
  7734. });
  7735. }
  7736. },
  7737. error => {
  7738. this.listLoading = false;
  7739. this.submitingReport = false;
  7740. this.$message({
  7741. message: error,
  7742. type: "error"
  7743. });
  7744. });
  7745. },
  7746. // 判断是展示那个工时导入
  7747. imports() {
  7748. if(this.user.timeType.syncCorpwxTime == 0) {
  7749. this.importDialog = true
  7750. } else {
  7751. this.importWxDialog = true
  7752. }
  7753. },
  7754. // 跳转
  7755. junpToDeskTop(id) {
  7756. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7757. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7758. },
  7759. // 通过日报
  7760. approve(id, item) {
  7761. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7762. this.approveinData = {
  7763. id: id,
  7764. date: this.date +day,
  7765. reportIds: item.id
  7766. }
  7767. if(this.user.timeType.needEvaluate == 1){
  7768. this.$set(this.approveinData,'evaluate','')
  7769. this.approveinDialog = true
  7770. }else{
  7771. this.logining = true;
  7772. this.approveinfun()
  7773. }
  7774. },
  7775. approveinfun(){
  7776. this.http.post( this.port.report.approve, this.approveinData,
  7777. res => {
  7778. this.logining = false;
  7779. if (res.code == "ok") {
  7780. this.approveinDialog = false
  7781. this.$message({
  7782. message: this.$t('message.Reviewsucceeded'),
  7783. type: "success"
  7784. });
  7785. this.refreshReportData(this.approveinData.reportIds);
  7786. this.getDepartment();
  7787. } else {
  7788. this.$message({
  7789. message: res.msg,
  7790. type: "error"
  7791. });
  7792. }
  7793. },
  7794. error => {
  7795. this.logining = false;
  7796. this.$message({
  7797. message: error,
  7798. type: "error"
  7799. });
  7800. });
  7801. },
  7802. //撤回日报
  7803. cancel(item,e) {
  7804. // console.log('can can need',item);
  7805. this.logining = true;
  7806. var ids = '';
  7807. var data = e ? item : item.data;
  7808. data.forEach(element => {
  7809. if(element.id){
  7810. ids +=(element.id+',');
  7811. }
  7812. });
  7813. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7814. res => {
  7815. this.logining = false;
  7816. if (res.code == "ok") {
  7817. this.$message({
  7818. message:this.$t('message.Withdrawalsucceeded'),
  7819. type: "success"
  7820. });
  7821. this.getReportList();
  7822. if(e){this.getReport()}
  7823. this.getDepartment();
  7824. } else {
  7825. this.$message({
  7826. message: res.msg,
  7827. type: "error"
  7828. });
  7829. }
  7830. },
  7831. error => {
  7832. this.logining = false;
  7833. this.$message({
  7834. message: error,
  7835. type: "error"
  7836. });
  7837. });
  7838. },
  7839. showDenyDialog(id,i, item) {
  7840. this.denyReasonDialog = true;
  7841. this.isDenying = false;
  7842. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7843. var ids = item.id;
  7844. // var data = item.data;
  7845. // data.forEach(element => {
  7846. // ids +=(element.id+',');
  7847. // });
  7848. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7849. },
  7850. // 未通过日报
  7851. deny() {
  7852. this.logining = true;
  7853. this.isDenying = true;
  7854. this.http.post( this.port.report.deny, this.denyForm,
  7855. res => {
  7856. this.logining = false;
  7857. this.isDenying = false;
  7858. if (res.code == "ok") {
  7859. this.$message({
  7860. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7861. type: "success"
  7862. });
  7863. this.refreshReportData(this.denyForm.reportIds);
  7864. this.getDepartment();
  7865. this.denyReasonDialog = false;
  7866. } else {
  7867. this.$message({
  7868. message: res.msg,
  7869. type: "error"
  7870. });
  7871. }
  7872. },
  7873. error => {
  7874. this.logining = false;
  7875. this.$message({
  7876. message: error,
  7877. type: "error"
  7878. });
  7879. });
  7880. },
  7881. // 查看工时记录弹窗
  7882. toView() {
  7883. this.toViewDialogVisible = true
  7884. this.toViewloading = true
  7885. this.getToView()
  7886. },
  7887. getToView() {
  7888. this.http.post( '/report-import-log/getList', this.toViewForm,
  7889. res => {
  7890. this.toViewloading = false;
  7891. if (res.code == "ok") {
  7892. // console.log(res.data, '数据数据')
  7893. this.toViewList = res.data.records
  7894. this.toViewForm.total = res.data.total
  7895. } else {
  7896. this.toViewloading = false;
  7897. this.$message({
  7898. message: res.msg,
  7899. type: "error"
  7900. });
  7901. }
  7902. })
  7903. },
  7904. // 触发 selectCat 组件更改他的值
  7905. selectCatCli(obj) {
  7906. // console.log(obj, '看看')
  7907. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7908. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7909. },
  7910. vueCasader(obj) {
  7911. console.log(obj, '看看值')
  7912. if(obj.distinction == 1 && obj.item) {
  7913. let arr = []
  7914. arr.push(obj.item.value)
  7915. this.exportParam.departmentId = arr
  7916. }
  7917. },
  7918. //分页
  7919. handleCurrentChange(val) {
  7920. this.toViewForm.pageIndex = val;
  7921. this.getToView();
  7922. },
  7923. handleSizeChange(val) {
  7924. this.toViewForm.pageSize = val;
  7925. this.getToView();
  7926. },
  7927. getAllUsersList(){
  7928. this.http.post('/user/getSimpleActiveUserList',{
  7929. },res => {
  7930. if(res.code == 'ok'){
  7931. this.allUsersList = res.data
  7932. }else{
  7933. this.$message({
  7934. message: res.msg,
  7935. type: 'error'
  7936. })
  7937. }
  7938. },err => {
  7939. this.$message({
  7940. message: err,
  7941. type: 'error'
  7942. })
  7943. })
  7944. },
  7945. //景昱变更提醒
  7946. changeReminder(){
  7947. this.http.post('/report/changeReminder',{
  7948. },res => {
  7949. if(res.code == 'ok'){
  7950. }else{
  7951. this.$message({
  7952. message: res.msg,
  7953. type: 'error'
  7954. })
  7955. }
  7956. },err => {
  7957. this.$message({
  7958. message: err,
  7959. type: 'error'
  7960. })
  7961. })
  7962. },
  7963. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7964. fillWeekCustomClne() {
  7965. this.fillWeekDialogVisiCustom = false
  7966. },
  7967. fillWeekCustomSubmit() {
  7968. this.getReportList();
  7969. this.getDepartment();
  7970. this.getRecentlyProject()
  7971. },
  7972. // 待填日报姓名搜索
  7973. nameAearchSeek(flg) {
  7974. if(!this.nameAearch) {
  7975. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7976. return
  7977. }
  7978. if(flg) {
  7979. this.enterpriseWechatgetUser()
  7980. }
  7981. },
  7982. handleThreeData(userList) {
  7983. console.log(userList, '人员数据')
  7984. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7985. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7986. },
  7987. // 过滤树节点
  7988. filterTreeNodes(treeData, filterKeywords) {
  7989. return treeData.filter((node) => {
  7990. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7991. if (node.children && node.children.length > 0) {
  7992. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7993. }
  7994. return true;
  7995. }
  7996. if (node.children && node.children.length > 0) {
  7997. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7998. return node.children.length > 0;
  7999. }
  8000. return false;
  8001. });
  8002. },
  8003. // 企业微信获取人员
  8004. enterpriseWechatgetUser() {
  8005. this.deptMembDataLoading = true
  8006. this.http.post('/user/getEmployeeList',{
  8007. departmentId: -1,
  8008. pageIndex: 1,
  8009. pageSize: 100,
  8010. keyword: this.nameAearch,
  8011. status: '',
  8012. roleId: '',
  8013. cursor: '',
  8014. onlyDirect: '',
  8015. matchingType: ''
  8016. },res => {
  8017. if(res.code == 'ok'){
  8018. this.deptMembDataLoading = false
  8019. const userListName = res.data.records.map(item => item.name)
  8020. this.handleThreeData(userListName)
  8021. }else{
  8022. this.deptMembDataLoading = false
  8023. this.$message({
  8024. message: res.msg,
  8025. type: 'error'
  8026. })
  8027. }
  8028. },err => {
  8029. this.deptMembDataLoading = false
  8030. this.$message({
  8031. message: err,
  8032. type: 'error'
  8033. })
  8034. })
  8035. },
  8036. // 按周填报获取相关任务
  8037. async getWeeklyTaskList(item) {
  8038. console.log(item, '<=== 数据')
  8039. const { projectId, groupId, stage, taskId } = item
  8040. console.log(projectId, groupId, stage)
  8041. let parms = { projectId, isSubstitude: 0 }
  8042. groupId ? parms.groupId = groupId : ''
  8043. stage ? parms.stage = stage : ''
  8044. const { data } = await this.postData('/task/getRecentTask', parms)
  8045. this.zhoBao.taskId = taskId
  8046. this.$set(this.zhoBao, 'taskList', data)
  8047. console.log(this.zhoBao)
  8048. },
  8049. // 封装 post 请求
  8050. postData(url, params) {
  8051. return new Promise((resolve, reject) => {
  8052. this.http.post(url, { ...params },
  8053. res => {
  8054. resolve(res)
  8055. },
  8056. error => {
  8057. this.$message({
  8058. message: error,
  8059. type: "error"
  8060. });
  8061. reject(error)
  8062. })
  8063. })
  8064. },
  8065. // 自定义事件
  8066. selectCal(obj) {
  8067. console.log(obj, '传数据来源')
  8068. if(obj.distinction == '1') {
  8069. this.zhoBao.projectAuditorId = obj.id
  8070. } else if(obj.distinction == '2') {
  8071. this.zhoBao.auditorFirst = obj.id
  8072. } else if(obj.distinction == '3') {
  8073. this.zhoBao.auditorSec = obj.id
  8074. } else if(obj.distinction == '4') {
  8075. this.zhoBao.auditorThird = obj.id
  8076. } else if(obj.distinction == '5') {
  8077. this.zhoBao.ccUserid = obj.id
  8078. } else if(obj.distinction == '12') {
  8079. this.usersListId = obj.id
  8080. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8081. this.searchKeyword = obj.name
  8082. } else {
  8083. this.searchKeyword = ''
  8084. }
  8085. this.searchScreen(0)
  8086. } else if(obj.distinction == '13') {
  8087. this.usersListId = obj.id
  8088. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8089. this.searchKeyword = obj.name
  8090. } else {
  8091. this.searchKeyword = ''
  8092. }
  8093. this.searchScreen(1)
  8094. }
  8095. }
  8096. },
  8097. created() {
  8098. this.getUsers()
  8099. let height = window.innerHeight;
  8100. this.tableHeight = height - 178;
  8101. const that = this;
  8102. window.onresize = function temp() {
  8103. that.tableHeight = window.innerHeight - 178;
  8104. };
  8105. this.toViewForm.companyId = this.user.companyId
  8106. this.initDrag([{
  8107. type: "LR",
  8108. domClass: {
  8109. // 中间分割线的名字
  8110. resize: "line-line",
  8111. // 左侧盒子的名字
  8112. left: "box-left",
  8113. // 右侧盒子的名字
  8114. right: "box-right",
  8115. // 父级的名字
  8116. box: "box-father",
  8117. },
  8118. otherInfo: {
  8119. // 限制左边栏最低宽度
  8120. leftWidth: 120,
  8121. },
  8122. },
  8123. {
  8124. type: "LR",
  8125. domClass: {
  8126. // 中间分割线的名字
  8127. resize: "line-second",
  8128. // 左侧盒子的名字
  8129. left: "left-laowang",
  8130. // 右侧盒子的名字
  8131. right: "box-second-father",
  8132. // 父级的名字
  8133. box: "grand",
  8134. },
  8135. otherInfo: {
  8136. // 限制左边栏最低宽度
  8137. leftWidth: 120,
  8138. },
  8139. },
  8140. ]);
  8141. }
  8142. };
  8143. </script>
  8144. <style lang="scss" scoped>
  8145. .fillWeekDialogVisiCustom {
  8146. width: 100%;
  8147. height: 70vh;
  8148. }
  8149. .fillWeekCustom {
  8150. .el-dialog__body {
  8151. padding: 20px 20px !important;
  8152. }
  8153. }
  8154. .photos {
  8155. position: relative;
  8156. display: flex;
  8157. flex-wrap: wrap;
  8158. }
  8159. .photos_img {
  8160. width: 120px;
  8161. height: 120px;
  8162. margin-right: 20px;
  8163. margin-bottom: 20px;
  8164. cursor: pointer;
  8165. img {
  8166. width: 100%;
  8167. height: 100%;
  8168. }
  8169. }
  8170. .paginatis {
  8171. padding: 10px 10px;
  8172. background: #f2f2f2;
  8173. }
  8174. .waiting {
  8175. color:orange;
  8176. }
  8177. .filledReportStyle {
  8178. color:#32CD32;
  8179. }
  8180. .RejectStyle {
  8181. color:red;
  8182. }
  8183. .waitSubmitStyle{
  8184. color: #409eff;
  8185. }
  8186. .chooseDate {
  8187. .waiting {
  8188. color: #20a0ff;
  8189. }
  8190. .filledReportStyle {
  8191. color:#20a0ff;
  8192. }
  8193. .RejectStyle {
  8194. color: #20a0ff;
  8195. }
  8196. .waitSubmitStyle{
  8197. color: #20a0ff;
  8198. }
  8199. }
  8200. .allDaily {
  8201. width:100%;
  8202. }
  8203. .report_title {
  8204. padding:10px 0;
  8205. color:#666;
  8206. }
  8207. .clearfix {
  8208. overflow-x: auto;
  8209. white-space: nowrap;
  8210. padding: 15px 0 10px 0;
  8211. // overflow-y: hidden;
  8212. .date_item {
  8213. padding: 0 3px;
  8214. cursor: pointer;
  8215. position: relative;
  8216. }
  8217. .chooseDate {
  8218. position: absolute;
  8219. bottom: -3px;
  8220. width: 37px;
  8221. height: 2px;
  8222. left: 14px;
  8223. background: #20a0ff;
  8224. }
  8225. }
  8226. .one_daily {
  8227. i {
  8228. color: #9ed0ff;
  8229. margin-right: 5px;
  8230. }
  8231. .one_daily_body {
  8232. padding: 10px 0px;
  8233. p {
  8234. margin: 0;
  8235. line-height: 30px;
  8236. }
  8237. }
  8238. ul {
  8239. padding: 0;
  8240. }
  8241. }
  8242. .checkbtn {
  8243. float: right;
  8244. margin-top: -10px;
  8245. }
  8246. .selConStyle{
  8247. margin-top:9rem;
  8248. margin-bottom:11rem;
  8249. .selConStyle_title{
  8250. height: 3rem;
  8251. text-align: center;
  8252. font-size: 17px;
  8253. }
  8254. .el-select{
  8255. margin: 0 15%;
  8256. width: 70%;
  8257. }
  8258. }
  8259. </style>
  8260. <style lang="scss">
  8261. /*去除upload组件过渡效果*/
  8262. .photos .el-upload-list__item {
  8263. transition: none !important;
  8264. }
  8265. .daily {
  8266. .el-card__body {
  8267. height: 80%;
  8268. overflow-y: auto;
  8269. }
  8270. .el-card__header {
  8271. padding: 0 20px;
  8272. }
  8273. }
  8274. .membListClass{
  8275. .el-dialog__body{
  8276. padding-top: 10px;
  8277. }
  8278. }
  8279. // .editReportDialog .el-dialog__footer{
  8280. // position: sticky;
  8281. // bottom: 0;
  8282. // background: #fff;
  8283. // height: 70px;
  8284. // z-index: 1010;
  8285. // }
  8286. .editReportDialog{
  8287. min-width: 800px;
  8288. }
  8289. .touruxiangmu{
  8290. max-width: 1000px;
  8291. }
  8292. </style>
  8293. <style scoped>
  8294. /* 项目标签的样式 */
  8295. .el-tag + .el-tag {
  8296. margin-left: 10px;
  8297. }
  8298. .button-new-tag {
  8299. margin-left: 10px;
  8300. height: 32px;
  8301. line-height: 30px;
  8302. padding-top: 0;
  8303. padding-bottom: 0;
  8304. }
  8305. .input-new-tag {
  8306. width: 90px;
  8307. margin-left: 10px;
  8308. vertical-align: bottom;
  8309. }
  8310. .selectworktime .el-table__fixed-body-wrapper{
  8311. top: 48px !important;
  8312. }
  8313. .selectworktime_export .selectworktime_export_l{
  8314. width: 650px;
  8315. float: left;
  8316. height: 42px;
  8317. }
  8318. .approvalProcessBox{
  8319. margin-left: 30px;
  8320. font-size: 14px;
  8321. line-height: 16px;
  8322. cursor: pointer;
  8323. }
  8324. .approvalProcessBox i {
  8325. margin-right: 0;
  8326. height: 16px;
  8327. width: 16px;
  8328. display: inline-block;
  8329. transform: scale(1.2);
  8330. position: relative;
  8331. top: 0.5px;
  8332. color: #409eff;
  8333. }
  8334. .approvalProcessBox .approvalProcessClick{
  8335. cursor: pointer;
  8336. color: #409eff;
  8337. font-size: 14px;
  8338. }
  8339. .approvalProcessBox:hover .approvalProcessClick{
  8340. color: #3485fb;
  8341. }
  8342. </style>
  8343. <style lang="scss" scoped>
  8344. // 加班样式
  8345. .overtime {
  8346. display: inline-block;
  8347. margin-left: 20px;
  8348. input {
  8349. display: inline-block;
  8350. margin-top: 5px;
  8351. }
  8352. }
  8353. .plus {
  8354. display: inline-block;
  8355. }
  8356. // .tages {
  8357. // float: right;
  8358. // }
  8359. .overtime {
  8360. display: inline-block;
  8361. margin-left: 30px;
  8362. }
  8363. .bloks {
  8364. display: inline-block;
  8365. width: 380px;
  8366. }
  8367. .zhiss {
  8368. display: flex;
  8369. justify-content: space-around;
  8370. align-items: center;
  8371. }
  8372. .zhoFel {
  8373. display: flex;
  8374. justify-content: space-between;
  8375. align-items: center;
  8376. }
  8377. // 左右滑动样式
  8378. .line {
  8379. width: 30px;
  8380. /* height: 500px; */
  8381. background: #f2f2f2;
  8382. cursor: w-resize;
  8383. }
  8384. .box-father {
  8385. border: 8px solid #000;
  8386. }
  8387. .line-second {
  8388. width: 10px;
  8389. /* background: red; */
  8390. }
  8391. .flex {
  8392. display: flex;
  8393. width: 100%;
  8394. }
  8395. .box-left {
  8396. flex: 0 0 400px;
  8397. /* height: 600px; */
  8398. /* background: blue; */
  8399. }
  8400. .box-right {
  8401. /* height: 600px; */
  8402. /* background: green; */
  8403. flex: 1;
  8404. }
  8405. .box-postion {
  8406. width: 200px;
  8407. /* height: 400px; */
  8408. background: #ccc;
  8409. }
  8410. .custom-tree-node {
  8411. flex: 1;
  8412. display: flex;
  8413. align-items: center;
  8414. justify-content: space-between;
  8415. font-size: 14px;
  8416. padding-right: 8px;
  8417. }
  8418. .daitianrbao {
  8419. width: 100%;
  8420. box-sizing: border-box;
  8421. height: 40px;
  8422. border-radius: 4px;
  8423. border: 1px solid #DCDFE6;
  8424. overflow: hidden;
  8425. text-overflow: ellipsis;
  8426. display: flex;
  8427. // align-items: center;
  8428. }
  8429. .daitianrbao .spnn {
  8430. display: inline-block;
  8431. box-sizing: border-box;
  8432. padding: 0 15px;
  8433. overflow: hidden;
  8434. text-overflow: ellipsis;
  8435. }
  8436. .daitianrbao .hover {
  8437. color: #DCDFE6 !important;
  8438. }
  8439. </style>