daily.vue 514 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665
  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;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree class="el-tree-resetStyles" :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <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'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{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)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="font-size:13px" class="themeFontColor">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <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">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <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')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <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')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <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')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <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>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  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" style="margin-left:20px;">
  182. <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. <p v-if="item1.attachment != null" >附件
  184. <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
  185. </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <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> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <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>
  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="primary" :loading="logining"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <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"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <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"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <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>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <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>
  275. </p>
  276. <!-- 工单号,行号 -->
  277. <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
  278. <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
  279. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  280. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  281. <!-- 自定义日报文本 -->
  282. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  283. <p v-if="user.company.packageEngineering == 1">
  284. {{$t('other.professionalProgress')}}:
  285. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  286. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  287. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhetongguo"></i>
  291. </el-tooltip>
  292. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  293. <i class="iconfont firerock-iconshenhebohui"></i>
  294. </el-tooltip>
  295. </span>
  296. </p>
  297. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  298. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  299. </p>
  300. <div v-if="item2.multiWorktime==0">
  301. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  303. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  304. {{item2.time.toFixed(1)}}h
  305. <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>
  306. </p>
  307. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  308. <span style="margin-right:10px;">{{item2.progress}}%</span>
  309. </p>
  310. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  311. </div>
  312. <div v-if="item2.multiWorktime==1" >
  313. <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>
  314. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  315. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  316. <p style="display: inline-block;">{{$t('time.duration')}}:
  317. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  318. {{timeItem.time.toFixed(1)}}h
  319. <span v-if="timeItem.detail" style="margin-left:10px;">
  320. {{timeItem.detail}}
  321. </span>
  322. </p>
  323. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  324. </div>
  325. </div>
  326. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  327. <!--照片的显示 -->
  328. <p v-if="item2.pics != null && item2.pics.length > 0">
  329. <el-image v-for="(pic, index) in item2.pics" :key="index"
  330. style="width: 100px; height: 100px; margin-right:10px;"
  331. :src="pic"
  332. :preview-src-list="item2.pics">
  333. </el-image>
  334. </p>
  335. </el-card>
  336. </el-timeline-item>
  337. </el-timeline>
  338. </div>
  339. </div>
  340. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false class="themeFontColor">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  341. <!-- 简陋的无报告提示 -->
  342. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </el-card>
  349. </div>
  350. <!-- 工时推送日志弹窗 -->
  351. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  352. <template>
  353. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  354. </template>
  355. <template>
  356. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  357. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  358. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  359. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  360. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  361. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  362. <template slot-scope="scope">
  363. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  364. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  368. </el-table>
  369. </template>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  372. </span>
  373. </el-dialog>
  374. <!-- 填写日报的dialog -->
  375. <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  376. <div style="height: 65vh;overflow: auto;">
  377. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  378. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  379. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  380. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  381. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  382. <span class="spnn" v-if="workForm.userNames">
  383. <span v-for="(item, index) in workForm.userNames" :key="index">
  384. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  385. <span v-if="index < workForm.userNames.length - 1">,</span>
  386. </span>
  387. </span>
  388. <span class="spnn hover" v-else>
  389. {{$t('defaultText.pleaseSelectAsubstitute')}}
  390. </span>
  391. </div>
  392. </el-form-item>
  393. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  394. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  395. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  396. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  397. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  398. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  399. <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>
  400. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  401. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  402. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  403. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  404. <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>
  405. <!-- AI智能填报 -->
  406. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  407. </el-form-item>
  408. <!--考勤时长显示-->
  409. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh">
  410. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  411. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  412. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  413. </span>
  414. <!--批量填报不显示考勤记录-->
  415. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  416. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  417. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  418. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  419. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  420. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  421. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  422. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  423. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  424. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  425. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  426. @click="refreshAttendance(workForm.createDate)"></el-button>
  427. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  428. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  429. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  430. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  431. </el-form-item>
  432. <!-- 000000 -->
  433. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  434. <div v-if="reportTimeType.multiWorktime==0">
  435. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  436. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  437. <el-select v-model="domain.timeType" style="width:200px;"
  438. v-if="reportTimeType.type == 0"
  439. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  440. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  441. @change="onTimeTypeChange(domain.timeType)">
  442. <el-option
  443. v-for="item in timeType"
  444. :key="item.value"
  445. :label="item.label"
  446. :value="item.value">
  447. </el-option>
  448. </el-select>
  449. <!-- 数字时长选择 -->
  450. <el-select v-model="domain.workingTime" style="width:200px;"
  451. v-if="reportTimeType.type == 1"
  452. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  453. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  454. @change="seleChn(0,domain)">
  455. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  456. </el-select>
  457. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  458. <span v-if="reportTimeType.type == 2">
  459. <!--时间范围选择 -->
  460. <el-time-picker
  461. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  462. v-model="domain.startTime"
  463. :placeholder="$t('time.startTime')"
  464. style="width:120px;"
  465. format="HH:mm"
  466. value-format="HH:mm"
  467. :picker-options="{
  468. start: '08:00',
  469. end: '23:30'
  470. }"
  471. @change="iptChang()">
  472. </el-time-picker> - <el-time-picker
  473. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  474. v-model="domain.endTime"
  475. :placeholder="$t('time.endTime')"
  476. style="width:120px;"
  477. format="HH:mm"
  478. value-format="HH:mm"
  479. :picker-options="{
  480. start: '08:00',
  481. end: '23:30',
  482. minTime: domain.startTime
  483. }"
  484. @change="iptChang()">
  485. </el-time-picker>
  486. </span>
  487. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  488. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  489. <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>
  490. </div>
  491. </el-form-item>
  492. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  493. :prop="'domains.' + index + '.reportTargetDeptId'"
  494. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  495. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  496. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  497. <span style="float: left">
  498. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  499. </span>
  500. </el-option>
  501. </el-select>
  502. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  503. </el-form-item>
  504. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  505. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  506. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  507. @change="selectProject(domain, index)"
  508. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  509. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  510. <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">
  511. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  512. <span style="float: right;">{{ item.projectName }}</span>
  513. </el-option>
  514. </el-option-group>
  515. </el-select>
  516. <!--昱众不显示子项目-->
  517. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  518. <span style="margin-left:45px;">
  519. {{$t('lable.subproject')}}</span>
  520. <!--子项目 -->
  521. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  522. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  523. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  524. </el-select>
  525. </template>
  526. <template v-if="user.companyId == yuzhongCompId">
  527. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  528. <!--角色选择 -->
  529. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  530. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  531. <el-option
  532. v-for="item in roleList"
  533. :key="item.value"
  534. :label="item.label"
  535. :value="item.value">
  536. </el-option>
  537. </el-select>
  538. </template>
  539. <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%;"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  541. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  542. </el-link>
  543. <!-- <el-link type="primary" v-if="canEdit"
  544. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  545. </el-form-item>
  546. <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">
  547. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  548. </el-form-item>
  549. <!--如果设置了工时成本预警的预算成本项-->
  550. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  551. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  552. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  553. </el-select>
  554. </el-form-item>
  555. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  556. <template slot="label">
  557. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  558. <span >{{$t('lable.taskGrouping')}}</span>
  559. </template>
  560. <!-- 任务分组 -->
  561. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  562. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  563. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  564. </el-select>
  565. <template v-if="user.companyId == yuzhongCompId">
  566. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  567. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  568. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  569. <el-option
  570. v-for="item in domain.filteredRespList"
  571. :key="item.id"
  572. :label="item.jobRespon"
  573. :value="item.id">
  574. </el-option>
  575. </el-select>
  576. </template>
  577. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  578. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  579. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  580. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  581. @change="changeStages(domain, index)"
  582. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  583. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  584. </el-select>
  585. </template>
  586. </el-form-item>
  587. <!-- 工单号,行号 -->
  588. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  589. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
  590. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  591. </el-option>
  592. </el-select>
  593. </el-form-item>
  594. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  595. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  596. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  597. </el-option>
  598. </el-select>
  599. </el-form-item>
  600. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
  601. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  602. <template slot="label">
  603. <span style="color:#FF0000;">*</span>
  604. <span >{{$t('other.projectAuditor')}}</span>
  605. </template>
  606. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  607. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  608. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  609. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  610. </el-option>
  611. </el-select>
  612. <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>
  613. </el-form-item>
  614. </div>
  615. <el-form-item v-if="user.companyId == yuzhongCompId">
  616. <template slot="label">
  617. <span style="color:#FF0000;">*</span>
  618. <span >{{ $t('gongZuoNeiRong') }}</span>
  619. </template>
  620. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  621. :disabled="(workForm.domains[index].state>=2?false:true)" >
  622. <el-option
  623. v-for="item in domain.workContentList"
  624. :key="item.id"
  625. :label="item.workContext"
  626. :value="item.id">
  627. </el-option>
  628. </el-select>
  629. </el-form-item>
  630. <!-- 111111 -->
  631. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  632. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  633. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  634. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  635. <span v-else>{{item.name}}</span>
  636. </el-option>
  637. </el-select>
  638. <template v-if="user.timeType.auditLevel > 1">
  639. <i class="el-icon-right"></i>
  640. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  641. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  642. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  643. <span v-else>{{item.name}}</span>
  644. </el-option>
  645. </el-select>
  646. </template>
  647. <template v-if="user.timeType.auditLevel > 2">
  648. <i class="el-icon-right"></i>
  649. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  650. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  651. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  652. <span v-else>{{item.name}}</span>
  653. </el-option>
  654. </el-select>
  655. </template>
  656. </el-form-item>
  657. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  658. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  659. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  660. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  661. <span v-else>{{item.name}}</span>
  662. </el-option>
  663. </el-select>
  664. </el-form-item>
  665. <!-- 相关维度/自定义维度 -->
  666. <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'">
  667. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  668. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  669. </el-option>
  670. </el-select>
  671. </el-form-item>
  672. <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'">
  673. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  674. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  675. </el-option>
  676. </el-select>
  677. </el-form-item>
  678. <!-- 相关数值 -->
  679. <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">
  680. <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>
  681. </el-form-item>
  682. <!-- 自定义文本 -->
  683. <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">
  684. <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>
  685. </el-form-item>
  686. <!--按比例填报-->
  687. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  688. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  689. <div style="width:400px;">
  690. <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>
  691. <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>
  692. </div>
  693. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  694. <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>
  695. </div>
  696. </el-form-item>
  697. <!--工程专业版本模式下, 各个专业的进度填报 -->
  698. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  699. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  700. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  701. <el-input size="mini" style="width:60px;" v-model="item.progress"
  702. @keyup.native="onProgressChange"
  703. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  704. </span>
  705. </el-form-item>
  706. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  707. <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))" >
  708. <template slot="label" v-if="user.timeType.taskRequired == 1">
  709. <span style="color:#FF0000;">*</span>
  710. <span >{{ $t('other.task') }}</span>
  711. </template>
  712. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  714. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  715. </el-select>
  716. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  717. </el-form-item>
  718. <!--针对依斯贝的SAP服务-->
  719. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  720. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  721. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  722. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  723. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  724. </el-select>
  725. </el-form-item>
  726. <!--工作事项-->
  727. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  728. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  729. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  730. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  731. </el-form-item>
  732. <!-- 拍照上传 -->
  733. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  734. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  735. <div class="photos">
  736. <div>
  737. <el-upload
  738. list-type="picture-card"
  739. :http-request="(file) => {return addImg(file, index)}"
  740. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  741. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  742. :file-list="domain.imgListUrl" :limit="9"
  743. :disabled="workForm.domains[index].state>=2?false:true">
  744. <i class="el-icon-plus"></i>
  745. </el-upload>
  746. </div>
  747. </div>
  748. </el-form-item>
  749. </div>
  750. <!--多个工作事项填报的情况 -->
  751. <div v-if="reportTimeType.multiWorktime==1">
  752. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  753. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  754. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  755. @change="selectProject(domain, index)"
  756. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  757. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  758. <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">
  759. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  760. <span style="float: right;">{{ item.projectName }}</span>
  761. </el-option>
  762. </el-option-group>
  763. </el-select>
  764. <template v-if="user.timeType.mainProjectState != 1">
  765. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  766. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  767. <!--子项目 -->
  768. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  769. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  770. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  771. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  772. </el-select>
  773. </template>
  774. <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;"
  775. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  776. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  777. </el-link>
  778. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  779. <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>
  780. </div>
  781. <!-- <el-link type="primary" v-if="canEdit"
  782. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  783. </el-form-item>
  784. <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">
  785. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  786. </el-form-item>
  787. <!--如果设置了工时成本预警的预算成本项-->
  788. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  789. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  790. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  791. </el-select>
  792. </el-form-item>
  793. <el-form-item v-if="user.company.packageProject == 1">
  794. <template slot="label">
  795. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  796. <span >{{$t('lable.taskGrouping')}}</span>
  797. </template>
  798. <!-- 任务分组 -->
  799. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  800. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  801. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  802. </el-select>
  803. <!-- 项目的阶段 -->
  804. <span v-if="domain.stages != null && domain.stages.length> 0"
  805. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  806. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  807. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  808. @change="changeStages(domain, index)"
  809. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  810. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  811. </el-select>
  812. </el-form-item>
  813. <el-form-item :label="$t('other.projectAuditor')" >
  814. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  815. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  816. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  817. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  818. </el-option>
  819. </el-select>
  820. <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>
  821. </el-form-item>
  822. <!--工程专业版本模式下, 各个专业的进度填报 -->
  823. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  824. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  825. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  826. <el-input size="mini" style="width:60px;" v-model="item.progress"
  827. @keyup.native="onProgressChange"
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  829. </span>
  830. </el-form-item>
  831. <!-- 相关维度 -->
  832. <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'">
  833. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  834. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  835. </el-option>
  836. </el-select>
  837. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  838. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  839. </el-option>
  840. </el-select>
  841. </el-form-item>
  842. <!-- 相关数值 -->
  843. <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">
  844. <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>
  845. </el-form-item>
  846. <!-- 自定义文本 -->
  847. <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">
  848. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  849. </el-form-item>
  850. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  851. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  852. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  853. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  854. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  855. </el-select>
  856. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  857. </el-form-item>
  858. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  859. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  860. <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>
  861. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  862. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  863. <span v-if="reportTimeType.type == 2">
  864. <!-- <span> -->
  865. <!--时间范围选择 -->
  866. <el-time-picker
  867. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  868. v-model="timeItem.startTime"
  869. :placeholder="$t('time.startTime')"
  870. style="width:120px;"
  871. format="HH:mm"
  872. value-format="HH:mm"
  873. :picker-options="{
  874. start: '00:00',
  875. end: '23:59',
  876. }"
  877. @change="iptChangs()">
  878. </el-time-picker> - <el-time-picker
  879. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  880. v-model="timeItem.endTime"
  881. :placeholder="$t('time.endTime')"
  882. style="width:120px;"
  883. format="HH:mm"
  884. value-format="HH:mm"
  885. :picker-options="{
  886. start: '00:00',
  887. end: '23:59',
  888. minTime: timeItem.startTime
  889. }"
  890. @change="iptChangs()">
  891. </el-time-picker>
  892. </span>
  893. <!--工作细项-->
  894. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0 && user.canFillMoreOption"
  895. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  896. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  897. </el-select>
  898. </el-form-item>
  899. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  900. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  901. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  902. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  903. ></el-input>
  904. </el-form-item>
  905. </div>
  906. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  907. </div>
  908. <!--照片的显示 -->
  909. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  910. <el-image v-for="(pic, index) in domain.pics" :key="index"
  911. style="width: 100px; height: 100px; margin-right:10px;"
  912. :src="pic"
  913. :preview-src-list="domain.pics">
  914. </el-image>
  915. </p>
  916. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  917. </div>
  918. <span id="workFormsItemBottom"></span>
  919. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  920. </el-form>
  921. </div>
  922. <span slot="footer" class="dialog-footer">
  923. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  924. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  925. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  926. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  927. <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>
  928. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  929. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  930. </span>
  931. </el-dialog>
  932. <!-- 按周填报 -->
  933. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  934. <!-- 按周填报-已填工时-点击 -->
  935. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  936. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  937. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  938. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  939. <el-table-column prop="state" :label="$t('state.states')">
  940. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  941. </el-table-column>
  942. </el-table>
  943. <span slot="footer" class="dialog-footer">
  944. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  945. </span>
  946. </el-dialog>
  947. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  948. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  949. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  950. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  951. <span class="spnn" v-if="workForm.userNames">
  952. <span v-for="(item, index) in workForm.userNames" :key="index">
  953. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  954. <span v-if="index < workForm.userNames.length - 1">,</span>
  955. </span>
  956. </span>
  957. <span class="spnn hover" v-else>
  958. {{$t('defaultText.pleaseSelectAsubstitute')}}
  959. </span>
  960. </div>
  961. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  962. </div>
  963. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  964. <el-form-item style="height:30px;margin-top:-72px;">
  965. <!-- <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> -->
  966. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  967. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  968. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  969. <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>
  970. <el-option
  971. v-for="item in fillProjectList"
  972. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  973. :key="item.id"
  974. :label="item.projectName + '\u3000' + item.projectCode"
  975. :value="item.id">
  976. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  977. <span style="float: right">{{ item.projectName }}</span>
  978. </el-option>
  979. </el-select>
  980. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  981. </el-form-item>
  982. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  983. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  984. <template slot-scope="scope">
  985. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  986. </template>
  987. </el-table-column>
  988. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  989. <template slot-scope="scope">
  990. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  991. <p v-else></p>
  992. </template>
  993. </el-table-column> -->
  994. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  995. <template slot-scope="scope">
  996. <div v-if="scope.row.canFill == 1">
  997. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  998. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  999. <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)" @input="onInputWorkTime(scope.$index)"></el-input-number>
  1000. <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
  1001. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1002. </div>
  1003. </template>
  1004. <template v-else>
  1005. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1006. <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>
  1007. <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>
  1008. <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>
  1009. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1010. </div>
  1011. </template>
  1012. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1013. <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>
  1014. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1015. </div>
  1016. </div>
  1017. <div v-else >
  1018. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1019. </div>
  1020. </template>
  1021. </el-table-column>
  1022. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1023. <template slot-scope="scope">
  1024. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1025. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1026. </span>
  1027. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1028. </template>
  1029. </el-table-column>
  1030. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1031. <template slot-scope="scope">
  1032. <div class="zhiss">
  1033. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1034. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1035. </div>
  1036. </template>
  1037. </el-table-column>
  1038. </el-table>
  1039. </el-form>
  1040. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1041. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1042. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1043. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1044. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1045. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1046. <!--针对景昱,先检查工时是否存在异常-->
  1047. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1048. </span>
  1049. </el-dialog>
  1050. <!-- 重庆物奇私人定制的按周填报 -->
  1051. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1052. <div class="fillWeekDialogVisiCustom">
  1053. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1054. </div>
  1055. </el-dialog>
  1056. <!-- enableNewWeeklyfill==2 -->
  1057. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1058. <div class="fillWeekDialogVisiCustom">
  1059. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1060. </div>
  1061. </el-dialog>
  1062. <!-- 选择时间 -->
  1063. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1064. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1065. <span slot="footer" class="dialog-footer">
  1066. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1067. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1068. </span>
  1069. </el-dialog>
  1070. <!-- 按周填报弹窗 -->
  1071. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1072. <div>
  1073. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1074. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1075. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1076. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <!--如果设置了工时成本预警的预算成本项-->
  1080. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1081. <p>{{$t('lable.budgetSource')}}</p>
  1082. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1083. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1084. </el-select>
  1085. </div>
  1086. <!-- 任务分组 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1088. <p>{{$t('lable.taskGrouping')}}</p>
  1089. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1090. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1091. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1092. </el-select>
  1093. </div>
  1094. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1095. <p>{{$t('other.inputStage')}}</p>
  1096. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1097. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1098. </el-select>
  1099. </div>
  1100. <!-- 工单号,行号 -->
  1101. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1102. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1103. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1104. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1105. </el-option>
  1106. </el-select>
  1107. </div>
  1108. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1109. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1110. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1111. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1112. </el-option>
  1113. </el-select>
  1114. </div>
  1115. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1116. <p>{{$t('other.reviewer')}}</p>
  1117. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1118. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1119. </el-select>
  1120. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1121. </div>
  1122. <template v-if="user.timeType.reportAuditType == 3">
  1123. <div class="zhoFel">
  1124. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1125. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1126. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1127. </el-select>
  1128. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1129. </div>
  1130. <div class="zhoFel">
  1131. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1132. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1133. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1134. </el-select>
  1135. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1136. </div>
  1137. <div class="zhoFel">
  1138. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1139. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1140. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1141. </el-select>
  1142. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1143. </div>
  1144. <div class="zhoFel">
  1145. <p>{{ $t('chao-song-ren') }}</p>
  1146. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1147. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1148. </el-select>
  1149. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1150. </div>
  1151. </template>
  1152. <!-- 自定义维度 -->
  1153. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1154. <p>{{user.timeType.customDegreeName}}</p>
  1155. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1156. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1157. </el-select>
  1158. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1159. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1160. </el-select>
  1161. </div>
  1162. <!-- 自定义数值 -->
  1163. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1164. <p>{{user.timeType.customDataName}}</p>
  1165. <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>
  1166. </div>
  1167. <!-- 自定义文本 -->
  1168. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1169. <p>{{user.timeType.customTextName}}</p>
  1170. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1171. </div>
  1172. <!-- 选择任务 -->
  1173. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1174. <p>{{ $t('renWuLiChengBei') }}</p>
  1175. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1176. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1177. </el-select>
  1178. </div>
  1179. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1180. <p>{{$t('other.timeSelection')}}</p>
  1181. <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>
  1182. </div>
  1183. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1184. <p>{{$t('other.chooseDuration')}}</p>
  1185. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1186. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1187. </el-select>
  1188. </div>
  1189. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1190. <p>{{$t('lable.percentageOfTime')}}</p>
  1191. <div style="width:400px;display: flex;align-items: center;">
  1192. <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>
  1193. <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>
  1194. </div>
  1195. </div>
  1196. <div class="zhoFel">
  1197. <p>{{$t('other.workMatters')}}</p>
  1198. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1199. </div>
  1200. </div>
  1201. <span slot="footer" class="dialog-footer">
  1202. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1203. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1204. </span>
  1205. </el-dialog>
  1206. <!--导出报表条件选择 -->
  1207. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1208. <el-form ref="form3" :model="exportParam" >
  1209. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1210. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1211. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1212. </el-select>
  1213. </el-form-item>
  1214. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1215. <!-- <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>
  1216. <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> -->
  1217. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1218. </el-form-item>
  1219. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1220. <el-date-picker
  1221. v-model="exportParam.dateRange" :editable="false"
  1222. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1223. :range-separator="$t('other.to')"
  1224. type="daterange"
  1225. :start-placeholder="$t('time.startDate')"
  1226. :end-placeholder="$t('time.endDate')"
  1227. ></el-date-picker>
  1228. </el-form-item>
  1229. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1230. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1231. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1232. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1233. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1234. </el-select>
  1235. </el-form-item>
  1236. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1237. <div class="exportReportRadio">
  1238. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1239. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1240. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1241. <i class="el-icon-question"></i>
  1242. </el-tooltip>
  1243. </div>
  1244. </el-form-item>
  1245. </el-form>
  1246. <div slot="footer" class="dialog-footer">
  1247. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1248. </div>
  1249. </el-dialog>
  1250. <!--导出报表条件选择 -->
  1251. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1252. <el-form ref="form3" :model="exportParam" >
  1253. <el-form-item prop="range" :label="$t('time.dateRange')">
  1254. <el-date-picker
  1255. v-model="exportParam.dateRange" :editable="false"
  1256. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1257. :clearable="true"
  1258. :range-separator="$t('other.to')"
  1259. type="daterange"
  1260. :start-placeholder="$t('time.startDate')"
  1261. :end-placeholder="$t('time.endDate')"
  1262. ></el-date-picker>
  1263. </el-form-item>
  1264. </el-form>
  1265. <div slot="footer" class="dialog-footer">
  1266. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1267. </div>
  1268. </el-dialog>
  1269. <!--人员列表 -->
  1270. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1271. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1272. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1273. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1274. <el-table-column type="selection"></el-table-column>
  1275. <el-table-column prop="label" :label="$t('lable.name')" >
  1276. <template slot-scope="scope">
  1277. <span>
  1278. <!-- {{(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}} -->
  1279. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1280. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1281. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1282. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1283. </span>
  1284. <span v-else>
  1285. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1286. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1287. </span>
  1288. </span>
  1289. </template>
  1290. </el-table-column>
  1291. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1292. <template slot-scope="scope">
  1293. <div>
  1294. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1295. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1296. </div>
  1297. </template>
  1298. </el-table-column>
  1299. </el-table>
  1300. </el-tab-pane>
  1301. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1302. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1303. <el-table-column prop="label" :label="$t('lable.name')" >
  1304. <template slot-scope="scope">
  1305. <!-- <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> -->
  1306. <!-- <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> -->
  1307. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1308. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1309. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1310. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1311. </span>
  1312. <span v-else>
  1313. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1314. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1315. </span>
  1316. </template>
  1317. </el-table-column>
  1318. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1319. <template slot-scope="scope">
  1320. <div>
  1321. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1322. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1323. </div>
  1324. </template>
  1325. </el-table-column>
  1326. </el-table>
  1327. </el-tab-pane>
  1328. </el-tabs>
  1329. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1330. <el-table-column type="selection"></el-table-column>
  1331. <el-table-column prop="label" :label="$t('lable.name')" >
  1332. <template slot-scope="scope">
  1333. <div>
  1334. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1335. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1336. </div>
  1337. </template>
  1338. </el-table-column>
  1339. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1340. <template slot-scope="scope">
  1341. <div>
  1342. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1343. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1344. </div>
  1345. </template>
  1346. </el-table-column>
  1347. </el-table>
  1348. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1349. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1350. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1351. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1352. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1353. </div>
  1354. </el-dialog>
  1355. <!-- 日报审核修改 -->
  1356. <el-dialog
  1357. :title="$t('riBaoShenHeXiuGai')"
  1358. :visible.sync="reportLogCheckDialog"
  1359. width="30%"
  1360. :before-close="handleClose">
  1361. <el-form ref="form3" :model="exportReportLogParam" >
  1362. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1363. <el-date-picker
  1364. v-model="exportReportLogParam.dateRange" :editable="false"
  1365. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1366. :range-separator="$t('other.to')"
  1367. type="daterange"
  1368. :start-placeholder="$t('time.startDate')"
  1369. :end-placeholder="$t('time.endDate')"
  1370. ></el-date-picker>
  1371. </el-form-item>
  1372. </el-form>
  1373. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1374. <br>
  1375. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1376. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1377. <span slot="footer" class="dialog-footer">
  1378. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1379. </span>
  1380. </el-dialog>
  1381. <!-- 按部门选择人员 -->
  1382. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1383. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1384. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1385. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1386. </el-input>
  1387. <div class="tree" style="height:400px">
  1388. <el-scrollbar style="height:100%">
  1389. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1390. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1391. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1392. <span class="custom-tree-node" slot-scope="{ node }">
  1393. <span v-if="user.userNameNeedTranslate == '1'">
  1394. <span v-if="node.data.children">
  1395. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1396. </span>
  1397. <span v-else>
  1398. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1399. </span>
  1400. </span>
  1401. <span v-if="user.userNameNeedTranslate != '1'">
  1402. {{ node.label }}
  1403. </span>
  1404. <!-- {{ node.label }} -->
  1405. </span>
  1406. </el-tree>
  1407. </el-scrollbar>
  1408. </div>
  1409. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1410. <div slot="footer" class="dialog-footer">
  1411. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1412. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1413. </div>
  1414. </el-dialog>
  1415. <el-dialog
  1416. v-if="monthWorkTimeDialog"
  1417. :visible.sync="monthWorkTimeDialog"
  1418. :close-on-click-modal="false"
  1419. customClass="customWidth selectworktime"
  1420. width="92%"
  1421. top="60px"
  1422. >
  1423. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1424. <el-tabs v-model="activeName" @tab-click="handleClick">
  1425. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1426. <div class="selectworktime_export" style="margin-top:10px;">
  1427. <div class="selectworktime_export_l">
  1428. <el-date-picker
  1429. class="selecteworktime_datapick"
  1430. v-model="WorktimeDatepickValue"
  1431. value-format="yyyy-MM-dd"
  1432. type="daterange"
  1433. align="right"
  1434. unlink-panels
  1435. :range-separator="$t('other.to')"
  1436. :start-placeholder="$t('time.startDate')"
  1437. :end-placeholder="$t('time.endDate')"
  1438. :default-time="['12:00:00', '12:00:00']"
  1439. size="small"
  1440. popper-class="selecteorktime_datapick_popper"
  1441. @change="showMonthWorkTime()"
  1442. >
  1443. </el-date-picker>
  1444. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1445. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1446. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1447. <!-- 222 -->
  1448. </div>
  1449. <div>
  1450. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1451. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1452. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1453. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1454. </el-input>
  1455. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1456. </div>
  1457. <div style="float: left; height:32px; padding-top:10px;">
  1458. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1459. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1460. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1461. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1462. </div>
  1463. <div style="float: right; vertical-align: middle;height:32px">
  1464. <el-link
  1465. type="primary"
  1466. @click="exportMembWorkHours()"
  1467. >{{$t('export.exportData')}}</el-link
  1468. >
  1469. </div>
  1470. </div>
  1471. <el-table ref="hasworkTbl"
  1472. :data="monthWorkDataS"
  1473. v-el-table-infinite-scroll="listScroll"
  1474. border
  1475. :height="'70vh'"
  1476. highlight-current-row
  1477. style="width: 100%"
  1478. v-loading="tbload"
  1479. :lazy="true"
  1480. :cell-style="hasworkTblCellStyle"
  1481. >
  1482. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1483. <template slot-scope="scope">
  1484. {{ scope.$index + 1 }}
  1485. </template>
  1486. </el-table-column>
  1487. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1488. <template slot-scope="scope">
  1489. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1490. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1491. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1492. <!-- {{scope.row.name}} -->
  1493. </span>
  1494. </template>
  1495. </el-table-column>
  1496. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1497. <template slot-scope="scope">
  1498. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1499. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1500. </template>
  1501. </el-table-column>
  1502. <el-table-column
  1503. min-width="60"
  1504. v-for="(item, index) in pickDateArray"
  1505. :key="index"
  1506. :label="item"
  1507. align="center"
  1508. >
  1509. <template slot="header" slot-scope="scope">
  1510. <div>{{ scope.column.label.dateStr }}</div>
  1511. <div>{{ scope.column.label.weekStr }}</div>
  1512. </template>
  1513. <template slot-scope="scope">
  1514. <div
  1515. v-if="
  1516. scope.row.worktimeList.filter(
  1517. (w) =>
  1518. w.createDate==item.date
  1519. ).length > 0 &&
  1520. scope.row.worktimeList.filter(
  1521. (w) =>w.createDate==item.date
  1522. )[0].workingTime < reportTimeType.allday
  1523. "
  1524. >
  1525. {{
  1526. scope.row.worktimeList.filter(
  1527. (w) =>w.createDate==item.date
  1528. )[0].workingTime.toFixed(1)
  1529. }}
  1530. </div>
  1531. <div
  1532. v-if="
  1533. scope.row.worktimeList.filter(
  1534. (w) =>w.createDate==item.date
  1535. ).length > 0 &&
  1536. scope.row.worktimeList.filter(
  1537. (w) =>w.createDate==item.date
  1538. )[0].workingTime > reportTimeType.allday
  1539. "
  1540. >
  1541. {{
  1542. scope.row.worktimeList.filter(
  1543. (w) =>w.createDate==item.date
  1544. )[0].workingTime.toFixed(1)
  1545. }}
  1546. </div>
  1547. <div
  1548. v-if="
  1549. scope.row.worktimeList.filter(
  1550. (w) =>w.createDate==item.date
  1551. ).length > 0 &&
  1552. scope.row.worktimeList.filter(
  1553. (w) =>w.createDate==item.date
  1554. )[0].workingTime == reportTimeType.allday
  1555. "
  1556. >
  1557. {{
  1558. scope.row.worktimeList.filter(
  1559. (w) =>w.createDate==item.date
  1560. )[0].workingTime
  1561. }}
  1562. </div>
  1563. <div
  1564. v-if="
  1565. scope.row.worktimeList.filter(
  1566. (w) =>w.createDate==item.date
  1567. ).length == 0
  1568. "
  1569. >
  1570. 0
  1571. </div>
  1572. <div
  1573. v-if="
  1574. scope.row.worktimeList.filter(
  1575. (w) =>w.createDate==item.date
  1576. ).length > 0 &&
  1577. typeof scope.row.worktimeList.filter(
  1578. (w) =>w.createDate==item.date
  1579. )[0].workingTime == 'string'
  1580. "
  1581. >
  1582. {{
  1583. scope.row.worktimeList.filter(
  1584. (w) =>w.createDate==item.date
  1585. )[0].workingTime
  1586. }}
  1587. </div>
  1588. </template>
  1589. </el-table-column>
  1590. </el-table>
  1591. <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>
  1592. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1593. </el-tab-pane>
  1594. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1595. <div class="selectworktime_export" style="margin-top:10px">
  1596. <div class="selectworktime_export_l">
  1597. <el-date-picker
  1598. class="selecteworktime_datapick"
  1599. v-model="WorktimeDatepickValue"
  1600. value-format="yyyy-MM-dd"
  1601. type="daterange"
  1602. align="right"
  1603. unlink-panels
  1604. :range-separator="$t('other.to')"
  1605. :start-placeholder="$t('time.startDate')"
  1606. :end-placeholder="$t('time.endDate')"
  1607. :default-time="['12:00:00', '12:00:00']"
  1608. size="small"
  1609. popper-class="selecteorktime_datapick_popper"
  1610. @change="showMonthNotWorkTime()"
  1611. >
  1612. </el-date-picker>
  1613. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1614. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1615. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1616. </div>
  1617. <div>
  1618. <div style="margin-top:10px;">
  1619. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1620. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1621. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1622. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1623. </el-input>
  1624. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1625. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1626. <el-link
  1627. type="primary"
  1628. style="float: right; vertical-align: middle;height:32px"
  1629. @click="exportMembNotWorkHours()"
  1630. >{{$t('export.exportData')}}</el-link
  1631. >
  1632. </div>
  1633. </div>
  1634. </div>
  1635. <el-table
  1636. ref="hasworkTbl2"
  1637. :data="monthNotWorkDateS"
  1638. v-el-table-infinite-scroll="notListScroll"
  1639. border
  1640. :height="'70vh'"
  1641. highlight-current-row
  1642. style="width: 100%"
  1643. v-loading="tbload"
  1644. lazy
  1645. >
  1646. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1647. <template slot-scope="scope">
  1648. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1649. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1650. </template>
  1651. </el-table-column>
  1652. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1653. <template slot-scope="scope">
  1654. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1655. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1656. </template>
  1657. </el-table-column>
  1658. <el-table-column
  1659. min-width="200"
  1660. :label="$t('weekDay.date')"
  1661. align="center"
  1662. prop="createDate"
  1663. >
  1664. </el-table-column>
  1665. <el-table-column
  1666. min-width="200"
  1667. :label="$t('state.states')"
  1668. align="center"
  1669. prop="status"
  1670. />
  1671. <el-table-column
  1672. min-width="200"
  1673. :label="$t('other.attendanceData')"
  1674. prop="cardTime"
  1675. align="center"
  1676. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1677. </el-table>
  1678. <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>
  1679. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1680. </el-tab-pane>
  1681. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1">
  1682. <div class="selectworktime_export" style="margin-top:10px">
  1683. <div class="selectworktime_export_l">
  1684. <el-date-picker
  1685. class="selecteworktime_datapick"
  1686. v-model="notfullSelectDateMonth"
  1687. value-format="yyyy-MM"
  1688. type="month"
  1689. align="right"
  1690. unlink-panels
  1691. size="small"
  1692. popper-class="selecteorktime_datapick_popper"
  1693. @change="showReportTimeLessThanCardTimeList()"
  1694. >
  1695. </el-date-picker>
  1696. </div>
  1697. <div>
  1698. <div style="margin-top:10px;">
  1699. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showReportTimeLessThanCardTimeList()"></el-cascader>
  1700. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'17'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1701. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(2)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1702. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1703. </el-input>
  1704. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1705. <!-- <el-link
  1706. type="primary"
  1707. style="float: right; vertical-align: middle;height:32px"
  1708. @click="exportMembNotWorkHours()"
  1709. >{{$t('export.exportData')}}</el-link
  1710. > -->
  1711. </div>
  1712. </div>
  1713. </div>
  1714. <el-table
  1715. ref="hasworkTbl4"
  1716. :data="notFullData"
  1717. border
  1718. :height="'70vh'"
  1719. highlight-current-row
  1720. style="width: 100%"
  1721. v-loading="tbload"
  1722. lazy
  1723. >
  1724. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1725. <template slot-scope="scope">
  1726. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1727. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1728. </template>
  1729. </el-table-column>
  1730. <el-table-column
  1731. min-width="200"
  1732. :label="$t('weekDay.date')"
  1733. align="center"
  1734. prop="createDate"
  1735. >
  1736. </el-table-column>
  1737. <el-table-column
  1738. min-width="200"
  1739. :label="$t('fillReportTime')"
  1740. align="center"
  1741. prop="reportTime"
  1742. />
  1743. <el-table-column
  1744. min-width="200"
  1745. :label="$t('workAttendance')"
  1746. prop="workHours"
  1747. align="center"></el-table-column>
  1748. </el-table>
  1749. </el-tab-pane>
  1750. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1751. <div class="selectworktime_export" style="margin-top:10px;">
  1752. <div class="selectworktime_export_l">
  1753. <el-date-picker
  1754. class="selecteworktime_datapick"
  1755. v-model="WorktimeDatepickValue"
  1756. value-format="yyyy-MM-dd"
  1757. type="daterange"
  1758. align="right"
  1759. unlink-panels
  1760. :range-separator="$t('other.to')"
  1761. :start-placeholder="$t('time.startDate')"
  1762. :end-placeholder="$t('time.endDate')"
  1763. :default-time="['12:00:00', '12:00:00']"
  1764. size="small"
  1765. popper-class="selecteorktime_datapick_popper"
  1766. @change="showMonthWorkTimeReminder()"
  1767. >
  1768. </el-date-picker>
  1769. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1770. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1771. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1772. </div>
  1773. <div>
  1774. <div style="margin-top:10px;">
  1775. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1776. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1777. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1778. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1779. </el-input>
  1780. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1781. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1782. </div>
  1783. </div>
  1784. <div style="float: right; vertical-align: middle;height:32px">
  1785. <el-link
  1786. type="primary" v-loading="remindering"
  1787. @click="changeReminder()"
  1788. >{{ $t('bianGengTiXing') }}</el-link
  1789. >
  1790. <el-link
  1791. type="primary"
  1792. @click="exportMembWorkHoursReminder()"
  1793. >{{$t('export.exportData')}}</el-link
  1794. >
  1795. </div>
  1796. </div>
  1797. <el-table ref="hasworkTbl"
  1798. :data="monthWorkDataS"
  1799. v-el-table-infinite-scroll="listScroll"
  1800. border
  1801. :height="'70vh'"
  1802. highlight-current-row
  1803. style="width: 100%"
  1804. v-loading="tbload"
  1805. :lazy="true"
  1806. >
  1807. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1808. <template slot-scope="scope">
  1809. {{ scope.row.createDate}}
  1810. </template>
  1811. </el-table-column>
  1812. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1813. <template slot-scope="scope">
  1814. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1815. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1816. <!-- {{scope.row.name}} -->
  1817. </template>
  1818. </el-table-column>
  1819. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1820. <template slot-scope="scope">
  1821. {{scope.row.invokeValue}}
  1822. </template>
  1823. </el-table-column>
  1824. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1825. <template slot-scope="scope">
  1826. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1827. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1828. </template>
  1829. </el-table-column>
  1830. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1831. <template slot-scope="scope">
  1832. {{ scope.row.workingTime}}
  1833. </template>
  1834. </el-table-column>
  1835. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1836. <template slot-scope="scope">
  1837. {{ scope.row.cardTime}}
  1838. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1839. </template>
  1840. </el-table-column>
  1841. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1842. <template slot-scope="scope">
  1843. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1844. </template>
  1845. </el-table-column>
  1846. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1847. <template slot-scope="scope">
  1848. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1849. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1850. </template>
  1851. </el-table-column>
  1852. </el-table>
  1853. <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>
  1854. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1855. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1856. <label style="font-size: 16px">员工每日已填报工时数</label>
  1857. <el-link
  1858. type="primary"
  1859. style="float: right; margin-right: 60px"
  1860. @click="exportMembWorkHours()"
  1861. >导出已填报数据</el-link
  1862. > -->
  1863. <!-- <el-button >导出</el-button> -->
  1864. <!-- </div> -->
  1865. </el-tab-pane>
  1866. </el-tabs>
  1867. </el-dialog>
  1868. <!--驳回弹出框 -->
  1869. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1870. <div>
  1871. <span style="color:red;">*</span><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')" />
  1872. </div>
  1873. <div slot="footer" class="dialog-footer">
  1874. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1875. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1876. </div>
  1877. </el-dialog>
  1878. <!-- 通过弹出框 -->
  1879. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1880. <div>
  1881. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1882. </div>
  1883. <div slot="footer" class="dialog-footer">
  1884. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1885. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1886. </div>
  1887. </el-dialog>
  1888. <!--批量导入日报 -->
  1889. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1890. <p>1. {{$t('other.download')}}
  1891. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./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>
  1892. </p>
  1893. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1894. <p style="display: flex;justify-content: center;">
  1895. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1896. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1897. </el-upload>
  1898. </p>
  1899. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1900. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1901. </div>
  1902. </el-dialog>
  1903. <!-- 工时导入记录弹窗 -->
  1904. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1905. <div style="height: 452px">
  1906. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1907. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1908. <el-table-column prop="userName" :label="$t('other.operator')">
  1909. <template slot-scope="scope">
  1910. <div>
  1911. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1912. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1913. </div>
  1914. </template>
  1915. </el-table-column>
  1916. <el-table-column prop="datel" :label="$t('other.document')">
  1917. <template slot-scope="scope">
  1918. <div>
  1919. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1920. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1921. </div>
  1922. </template>
  1923. </el-table-column>
  1924. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1925. <template slot-scope="scope">
  1926. <div>
  1927. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1928. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1929. </div>
  1930. </template>
  1931. </el-table-column>
  1932. </el-table>
  1933. <el-col :span="24" class="paginatis">
  1934. <el-pagination
  1935. @size-change="handleSizeChange"
  1936. @current-change="handleCurrentChange"
  1937. :page-sizes="[20 , 50 , 80 , 100]"
  1938. :page-size="20"
  1939. layout="total, sizes, prev, pager, next"
  1940. :total="toViewForm.total"
  1941. style="float:right;"
  1942. ></el-pagination>
  1943. </el-col>
  1944. </div>
  1945. </el-dialog>
  1946. <!--基于企业微信考勤数据的工时导入 -->
  1947. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1948. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1949. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1950. </el-step>
  1951. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1952. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1953. </el-steps>
  1954. <div v-if="active==0" style="padding:30px;height:360px;">
  1955. <div style="margin-top:50px;margin-left:280px;">
  1956. <el-date-picker
  1957. v-model="importWxParam.date" :editable="false"
  1958. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1959. :clearable="true"
  1960. :range-separator="$t('other.to')"
  1961. type="daterange"
  1962. :start-placeholder="$t('time.startDate')"
  1963. :end-placeholder="$t('time.endDate')"
  1964. @change="loadCheckInData"
  1965. ></el-date-picker>
  1966. </div>
  1967. </div>
  1968. <div v-if="active==1" style="padding:10px;">
  1969. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1970. style="width: 100%;margin-top:5px;" >
  1971. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1972. <template slot-scope="scope">
  1973. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1974. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1975. </template>
  1976. </el-table-column>
  1977. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1978. </el-table-column>
  1979. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1980. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1981. <template slot-scope="scope">
  1982. <div>
  1983. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1984. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1985. </div>
  1986. </template>
  1987. </el-table-column>
  1988. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1989. <template slot-scope="scope">
  1990. <div>
  1991. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1992. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1993. </div>
  1994. </template>
  1995. </el-table-column>
  1996. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1997. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1998. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1999. <template slot-scope="scope">
  2000. {{scope.row.workHours.toFixed(1)}}h
  2001. </template>
  2002. </el-table-column>
  2003. </el-table>
  2004. </div>
  2005. <div v-if="active==2" >
  2006. <p style="display: flex;justify-content: center;height:390px;">
  2007. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2008. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2009. </el-upload>
  2010. </p>
  2011. </div>
  2012. <div slot="title">
  2013. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2014. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2015. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2016. <el-link v-if="active==0 && ((showHidden && user.companyId == 469) || user.companyId == 7703) && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2017. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  2018. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  2019. </div>
  2020. <span slot="footer">
  2021. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2022. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2023. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2024. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2025. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2026. </span>
  2027. </el-dialog>
  2028. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2029. <p style="display: flex;justify-content: center;height:100px;">
  2030. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2031. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2032. </el-upload>
  2033. </p>
  2034. </el-dialog>
  2035. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2036. <div>
  2037. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2038. v-model="deleteReportParam.date" :editable="false"
  2039. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2040. :clearable="true"
  2041. :range-separator="$t('other.to')"
  2042. type="daterange"
  2043. :start-placeholder="$t('time.startDate')"
  2044. :end-placeholder="$t('time.endDate')"
  2045. ></el-date-picker>
  2046. </div>
  2047. <div style="margin-top:10px;">
  2048. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2049. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  2050. <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>
  2051. </div>
  2052. <div style="margin-top:10px;">
  2053. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2054. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2055. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2056. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2057. <span v-else>{{item.name}}</span>
  2058. </el-option>
  2059. </el-select>
  2060. </div>
  2061. <span slot="footer">
  2062. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2063. </span>
  2064. </el-dialog>
  2065. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2066. <div>
  2067. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2068. v-model="deleteReportParam.date" :editable="false"
  2069. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2070. :clearable="true"
  2071. :range-separator="$t('other.to')"
  2072. type="daterange"
  2073. :start-placeholder="$t('time.startDate')"
  2074. :end-placeholder="$t('time.endDate')"
  2075. ></el-date-picker>
  2076. </div>
  2077. <div style="margin-top:15px;">
  2078. <span>{{ $t('other.selectdepartment') }}:</span>
  2079. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2080. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2081. size="small" v-if="user.userNameNeedTranslate != 1"
  2082. ></el-cascader>
  2083. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2084. </div>
  2085. <span slot="footer">
  2086. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2087. </span>
  2088. </el-dialog>
  2089. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2090. <div>
  2091. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2092. v-model="modImportTime"
  2093. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2094. :clearable="true"
  2095. type="datetime"
  2096. ></el-date-picker>
  2097. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2098. v-model="modImportUserId"
  2099. >
  2100. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2101. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2102. <span v-else>{{item.name}}</span>
  2103. </el-option>
  2104. </el-select>
  2105. </div>
  2106. <span slot="footer">
  2107. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2108. </span>
  2109. </el-dialog>
  2110. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2111. <div>
  2112. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2113. <el-date-picker
  2114. v-model="ratioYmonth" :editable="false"
  2115. format="yyyyMM" value-format="yyyyMM"
  2116. type="month"
  2117. ></el-date-picker>
  2118. </div>
  2119. <span slot="footer">
  2120. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2121. </span>
  2122. </el-dialog>
  2123. <!--工时批量代填 -->
  2124. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2125. <div>
  2126. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2127. v-model="importWxParam.date" :editable="false"
  2128. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2129. :clearable="true"
  2130. :range-separator="$t('other.to')"
  2131. type="daterange"
  2132. :start-placeholder="$t('time.startDate')"
  2133. :end-placeholder="$t('time.endDate')"
  2134. @change="loadCheckInData"
  2135. ></el-date-picker>
  2136. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2137. </div>
  2138. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2139. :key="timeStamp"
  2140. style="width: 100%;margin-top:5px;" ref="tab">
  2141. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2142. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2143. <template slot-scope="scope">
  2144. <div>
  2145. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2146. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2147. </div>
  2148. </template>
  2149. </el-table-column>
  2150. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2151. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2152. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2153. <template slot-scope="scope">
  2154. {{scope.row.workHours.toFixed(1)}}h
  2155. </template>
  2156. </el-table-column>
  2157. <!--项目名称列表 -->
  2158. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2159. <template slot-scope="scope">
  2160. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2161. </template>
  2162. </el-table-column>
  2163. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2164. <template slot-scope="scope">
  2165. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2166. </template>
  2167. </el-table-column>
  2168. </el-table>
  2169. </el-dialog>
  2170. <!--基于企业微信考勤数据的工时导入 -->
  2171. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2172. <div style="padding-bottom:10px;">
  2173. <p>{{importResultMsg}}</p>
  2174. </div>
  2175. <!-- <span slot="footer" class="dialog-footer">
  2176. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2177. </span> -->
  2178. </el-dialog>
  2179. <!-- 审核流程展示 -->
  2180. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2181. <div style="padding:20px 40px 20px 0">
  2182. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2183. <el-step title="待提交"></el-step>
  2184. <el-step title="员工提交"></el-step>
  2185. <el-step title="审核通过"></el-step>
  2186. </el-steps>
  2187. <el-divider v-if="user.companyId == 7544"></el-divider>
  2188. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2189. <el-timeline :reverse="false" style="margin-top:10px;">
  2190. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2191. <!-- {{item.msg}} -->
  2192. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2193. <span v-if="user.userNameNeedTranslate == 1">
  2194. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2195. <span>{{item.msgCon.two}}</span>
  2196. </span>
  2197. </el-timeline-item>
  2198. </el-timeline>
  2199. </div>
  2200. </el-dialog>
  2201. <!-- 威派格定制 -->
  2202. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2203. </section>
  2204. </template>
  2205. <script>
  2206. // 左右滑动
  2207. import dragMixin from "@/common/js/tensile.js";
  2208. import util from "../../common/js/util";
  2209. // 自定义select组件
  2210. import selectCat from "@/components/select.vue"
  2211. // 引入自定义级联组件
  2212. import vueCascader from "@/components/cascader.vue"
  2213. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2214. // 重庆物奇定制组件
  2215. import WeeklyCustomization from "./weeklyCustomization.vue"
  2216. // 威派格定制转移工时
  2217. import TransferWorkingHours from "./transferWorkingHours.vue"
  2218. // 新的按周填报
  2219. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2220. import { mapMutations } from 'vuex'
  2221. let _that = this
  2222. export default {
  2223. mixins: [dragMixin],
  2224. components: {
  2225. selectCat,
  2226. vueCascader,
  2227. WeeklyCustomization,
  2228. vueMultipleDept,
  2229. TransferWorkingHours,
  2230. NewWeeklyCustomization
  2231. },
  2232. data() {
  2233. return {
  2234. remindering: false,
  2235. onlyHaveAttendance: false,
  2236. notFullData:[],
  2237. notFullOriginList:[],
  2238. singleDate:1,
  2239. subFillProjectList:[],
  2240. curAuditNode: 1,
  2241. refreshingTime: false,
  2242. substitudeStep: 1,
  2243. showHidden: false,
  2244. pageIndex: 0,
  2245. hasMore: true,
  2246. exportType: 0,
  2247. exportingData: false,
  2248. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2249. jobResponseList:[],
  2250. yisibeiCompId: 3092,
  2251. yuzhongCompId: 3385,
  2252. mingyiName : '成都明夷电子科技有限公司',
  2253. // mingyiName : '明夷',
  2254. modItemDataId: null,
  2255. modImportTime: null,
  2256. modImportUserId: null,
  2257. showModImportTimeDialog: false,
  2258. showBatchSimpleApproveReport: false,
  2259. startDeleting: false,
  2260. showBatchDeleteReport: false,
  2261. deleteReportParam: {date:null, userIds:[]},
  2262. isDenying: false,
  2263. targetWeekDate: null,//填写周报中的周日期
  2264. importCardTimeVisi: false,
  2265. startRatioExporting: false,
  2266. exportUserRatio: false,
  2267. ratioYmonth:null,
  2268. hasWrittenReport: false,
  2269. today:null,
  2270. syncTimeLoading: false,
  2271. seluserText: '',
  2272. translation: '1', // 1、文字, 2、部门, 3、人员
  2273. exportLoad: false,
  2274. getPickerOptions: {
  2275. disabledDate: (time) => {
  2276. var date = new Date();
  2277. var year = date.getFullYear();
  2278. var month = date.getMonth() + 1;
  2279. if (month >= 1 && month <= 9) {
  2280. month = "0" + month;
  2281. }
  2282. var currentdate = year.toString() + month.toString();
  2283. var timeyear = time.getFullYear();
  2284. var timemonth = time.getMonth() + 1;
  2285. if (timemonth >= 1 && timemonth <= 9) {
  2286. timemonth = "0" + timemonth;
  2287. }
  2288. var timedate = timeyear.toString() + timemonth.toString();
  2289. if(this.user.timeType.fillAhead == 0){
  2290. return currentdate < timedate;
  2291. }else{
  2292. return false
  2293. }
  2294. }
  2295. },
  2296. alalal: '8.0',
  2297. timeBasecostList:null,
  2298. tbload: false,
  2299. exportTimeDialog: false,
  2300. searchKeyword: '',
  2301. monthWorkDataS: [],
  2302. monthNotWorkDateS: [],
  2303. pickDateArray:[],
  2304. WorktimeDatepickValue: [],
  2305. activeName:"first",
  2306. isLeave: 0,
  2307. submitingReport: false,
  2308. importResultMsg:null,
  2309. showImportResult:false,
  2310. importingData: false,
  2311. isDraft: 0,
  2312. timeStamp: 0,
  2313. projectColumns:[],
  2314. checkinLoading:false,
  2315. importWxParam:{date:null,},
  2316. active:0,
  2317. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2318. importWxDialog:false,
  2319. importDialog:false,
  2320. denyForm:null,
  2321. denyReasonDialog:false,
  2322. monthWorkTimeDialog: false,
  2323. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2324. isSubstitude:false,
  2325. isFill:false,
  2326. unFillList:[],
  2327. fillList:[],
  2328. fillMembList:[],
  2329. fillMembList_leave: [],
  2330. membListVisible: false,
  2331. isBatch:0,//是否是批量填报
  2332. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2333. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2334. 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')],
  2335. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2336. fillStatusList: [],
  2337. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2338. exportReportLogParam:{dateRange:[]},
  2339. exportDialog:false,
  2340. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2341. subProjectList:[],
  2342. canEdit: true,
  2343. originCanEdit: true,
  2344. 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],
  2345. selectTime:null,
  2346. reportTimeType:{},
  2347. curDate:'',
  2348. isAllSelect: false,
  2349. approveDialogVisible:false,
  2350. deptId:null,
  2351. targetUid: null,
  2352. membCount:0,
  2353. selectState:"-1",
  2354. user: JSON.parse(sessionStorage.getItem("user")),
  2355. allUsersList: [],
  2356. showAddMore:false,
  2357. allDate: [],
  2358. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2359. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2360. choseDay: 0,
  2361. tableHeight: 0,
  2362. listLoading: false,
  2363. projectList: [], //项目列表
  2364. fillProjectList: [],
  2365. reportList: [], //日报列表
  2366. reportNames:[], //批量审批列表
  2367. selCon:[], //筛选条件
  2368. selProjectList:[], //筛选后项目列表
  2369. selConShow: true,
  2370. usersList: [], // 全部人员列表
  2371. usersListId: '', // 选中的人员id
  2372. dialogVisible: false, //项目弹窗
  2373. report: '',
  2374. workForm: {
  2375. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2376. domains: [{
  2377. id: null,
  2378. projectId: "",
  2379. workingTime: "",
  2380. timeType:0,
  2381. content: "",
  2382. state: 2,
  2383. multiWorktime:0,
  2384. worktimeList:[],
  2385. degreeId: null,
  2386. auditUserList: [],
  2387. }],
  2388. showRefresh: false,
  2389. },
  2390. workRules: {
  2391. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2392. },
  2393. chooseParticipVisible: false,
  2394. logining: false,
  2395. isDisable: false,
  2396. timeType:[],
  2397. deptMembData: [
  2398. ],
  2399. //部门人员树状结构
  2400. data: [
  2401. {
  2402. id: -1,
  2403. label: this.$t('lable.allStaff'),
  2404. membCount:0
  2405. },
  2406. {
  2407. id: 0,
  2408. label: this.$t('lable.unassigned'),
  2409. }
  2410. ],
  2411. allData:{},
  2412. batchShowData:{},
  2413. option: [],
  2414. deptOptionList: [],
  2415. depData: {
  2416. id: -1,
  2417. label: this.$t('lable.allStaff'),
  2418. },
  2419. defaultProps: {
  2420. children: 'children',
  2421. label: 'label'
  2422. },
  2423. isNew: false,
  2424. selected: false,
  2425. valuet: new Date(),
  2426. domObj: null,
  2427. participator:[],
  2428. chosenMembCount:0,
  2429. jsDay: 0,
  2430. jsTime: 0,
  2431. falsss: false,
  2432. weidu: [],
  2433. weiduList: [],
  2434. yonghuUser: [],
  2435. dateAr: [],
  2436. batchSubFillDialog: false,
  2437. isSubstiS: false,
  2438. fillWeekDialogVisi: false,
  2439. fillWeekDialogVisiCustom: false,
  2440. fillWeekDialogVisiCustomTwo: false,
  2441. zhoData: [],
  2442. weekDateRange: [],
  2443. btnZho: false,
  2444. weekDataLoading: false,
  2445. changdu: 6,
  2446. tianxieDialogVisible: false,
  2447. scopess: {},
  2448. zhoBao: {
  2449. time: '',
  2450. workingTime: '',
  2451. progress: '',
  2452. con: '',
  2453. subProjectId: '',
  2454. stage: '',
  2455. subProjectList: [],
  2456. stages: [],
  2457. },
  2458. zhoBaoIdx: '',
  2459. zhoBaoName: '',
  2460. zhis: {},
  2461. dealList: [],
  2462. toViewDialogVisible: false,
  2463. toViewList: [],
  2464. toViewloading: true,
  2465. toViewForm: {
  2466. pageIndex: '1',
  2467. pageSize: '20',
  2468. total: 0,
  2469. },
  2470. toViewloadings: false,
  2471. tabPositionss: 'top',
  2472. monthTotal: 0,
  2473. monthTotalPage: 0,
  2474. monthTotalLages: 20,
  2475. monthWorkData: [],
  2476. monthNotWorkDate: [],
  2477. monthWorkDataS1: [],
  2478. monthnotTotal: 0,
  2479. monthnotTotalPage: 0,
  2480. monthnotTotalLages: 20,
  2481. monthNotWorkDateS1: [],
  2482. deptMembDataText: '',
  2483. isFlag: false,
  2484. isMore: false,
  2485. stateKey: '0',
  2486. expandDate: [],
  2487. notifySelList:[],
  2488. departmentList: [],
  2489. trandepartmentList:[],
  2490. approvalProcessDialog: false,
  2491. approvalProcessData: [],
  2492. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2493. 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')],
  2494. isWeekend: false,
  2495. canCancelInDialog: false,
  2496. approveinData: {},
  2497. approveinDialog: false,
  2498. reportCanDelete: false,
  2499. weeklyFilledTimeDialog: false,
  2500. weeklyFilledTimeList: [],
  2501. weeklyFilledTimeLoading: false,
  2502. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2503. weeklyFilledTimeCanDelete: false,
  2504. weeklyFilledTimeDate: null,
  2505. leaveAllNum: 0,
  2506. dataLoading: false,
  2507. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2508. vacationTime: {},
  2509. integrationProjectList: [],
  2510. totalReportHours: 0, // 合计的工时
  2511. workTimeForMinYi:0,
  2512. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2513. weekIndex: 1,
  2514. weekParentData: {},
  2515. deptIdForNoReport:[],
  2516. deptIdForReminder:[],
  2517. nameAearch: '', // 企业微信姓名搜索
  2518. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2519. deptMembDataLoading: false,
  2520. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2521. {
  2522. id: 4811,
  2523. // id: 10,
  2524. name: '陕西柘中建设工程有限公司'
  2525. }
  2526. ],
  2527. pushWorkTimeLogDig:false,
  2528. pushWorkTimeLogData:[],
  2529. userReportDeptList: [],
  2530. isReminder:true,
  2531. reportLogCheckDialog:false,
  2532. deptIdForHasReport:[],
  2533. transferWorkingHoursVisable: false,
  2534. multiOptionData:[],
  2535. businessTripsArray: [],
  2536. };
  2537. },
  2538. watch: {
  2539. deptMembDataText(val) {
  2540. this.$refs.chooseMembTree.filter(val);
  2541. }
  2542. },
  2543. filters: {
  2544. // 过滤
  2545. amounts(value) {
  2546. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2547. return 0
  2548. }
  2549. var zhi = +value + 0
  2550. return zhi.toFixed(1)
  2551. },
  2552. // zhoData
  2553. zhoData(value, arr) {
  2554. var dateArray = value.split("-");
  2555. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2556. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2557. // console.log(arr[date.getDay()])
  2558. // return "周" + "日一二三四五六".charAt(date.getDay());
  2559. return arr[date.getDay()]
  2560. },
  2561. // 过滤数字
  2562. numbers(value) {
  2563. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2564. return 0
  2565. }
  2566. return value
  2567. },
  2568. },
  2569. computed: {},
  2570. mounted() {
  2571. var now = new Date();
  2572. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2573. this.today = t;
  2574. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2575. this.exportParam.dateRange = [startStr,t];
  2576. this.exportReportLogParam.dateRange = [startStr,t];
  2577. this.getAllDate(1);
  2578. this.getReportList();
  2579. this.getProjectList();
  2580. this.getFillProjectList();
  2581. this.getTimeType();
  2582. this.getDepartment();
  2583. this.scrollFunction()
  2584. this.userssHu();
  2585. this.getFirstAndLastDay()
  2586. this.getMultiOptionData();
  2587. if(this.user.timeType.reportAuditType == 3){
  2588. this.getAllUsersList()
  2589. }
  2590. if (this.user.company.packageProject == 1) {
  2591. this.getBasecostItemList();
  2592. }
  2593. if(this.user.timeType.userWithMultiDept == 1) {
  2594. this.getDeptMembData();
  2595. }
  2596. if(this.user.timeType.lockWorktime){
  2597. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2598. }
  2599. //设置了下限
  2600. if (this.user.timeType.minReportTime) {
  2601. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2602. }
  2603. const that = this
  2604. if(this.user.userNameNeedTranslate == 1) {
  2605. that.dataLoading = that.$store.state.dataLoading
  2606. this.upDataLoading()
  2607. setTimeout(()=>{
  2608. that.dataLoading = that.$store.state.dataLoading
  2609. }, 1000)
  2610. }
  2611. if (this.user.companyId == this.yuzhongCompId) {
  2612. this.getJobResponList();
  2613. }
  2614. },
  2615. methods: {
  2616. ...mapMutations(['upDataLoading']),
  2617. // 已填工时情况表设置背景色
  2618. hasworkTblCellStyle({ columnIndex, row, column }) {
  2619. if(columnIndex > 2) {
  2620. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2621. const worktimeList = row.worktimeList || []
  2622. const times = this.reportTimeType.allday
  2623. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2624. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2625. const missReport = filterData[0] && filterData[0].missReport;
  2626. const state = filterData[0] && filterData[0].state
  2627. if (missReport) {
  2628. return "backgroundColor: red"
  2629. } else {
  2630. if (state == 0 || state == -1) {
  2631. return "backgroundColor: orange"
  2632. } else if (state == 1) {
  2633. //审核通过
  2634. return "backgroundColor: #32CD32"
  2635. } else if (state == 2) {
  2636. return "backgroundColor: red"
  2637. } else {
  2638. return "backgroundColor: #E0E0E0"
  2639. }
  2640. }
  2641. }
  2642. },
  2643. getMultiOptionData() {
  2644. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2645. res => {
  2646. if (res.code == "ok") {
  2647. this.multiOptionData = res.data;
  2648. } else {
  2649. this.$message({
  2650. message: res.msg,
  2651. type: "error"
  2652. });
  2653. }
  2654. },
  2655. error => {
  2656. this.$message({
  2657. message: error,
  2658. type: "error"
  2659. });
  2660. }
  2661. );
  2662. },
  2663. showReportTimeLessThanCardTimeList() {
  2664. this.monthTotalPage = 0,
  2665. this.tbload = true,
  2666. this.http.post(
  2667. "/report/getReportTimeLessThanCardTimeList",
  2668. {
  2669. date: this.notfullSelectDateMonth,
  2670. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2671. userId: this.usersListId
  2672. },
  2673. (res) => {
  2674. if (res.code == "ok") {
  2675. this.tbload = false
  2676. this.notFullData = res.data;
  2677. this.notFullOriginList = res.data;
  2678. }
  2679. },
  2680. (error) => {
  2681. this.tbload = false
  2682. this.$message({
  2683. message: error,
  2684. type: "error",
  2685. });
  2686. }
  2687. );
  2688. },
  2689. //按选择的日期范围刷新考勤
  2690. refreshWXCardTimeByRange() {
  2691. this.refreshingTime = true;
  2692. this.http.post('/wxcorp/getUserCheckInDayData',{
  2693. companyId: this.user.companyId,
  2694. userId: this.user.id,
  2695. startDate: this.importWxParam.date[0],
  2696. endDate: this.importWxParam.date[1],
  2697. },res => {
  2698. this.refreshingTime = false;
  2699. if(res.code == 'ok'){
  2700. this.loadCheckInData();
  2701. }else {
  2702. this.$message({
  2703. message: res.msg,
  2704. type: 'error'
  2705. })
  2706. }
  2707. },err => {
  2708. this.syncTimeLoading = false;
  2709. this.$message({
  2710. message: err,
  2711. type: 'error'
  2712. })
  2713. })
  2714. },
  2715. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2716. isCustomization(userInfo, permissionArray) {
  2717. const { companyId } = userInfo
  2718. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2719. return isReportPictureRequired
  2720. },
  2721. showHiddenFunction() {
  2722. this.showHidden = true;
  2723. },
  2724. // 获取如何信息选的可填写部门
  2725. getDeptMembData() {
  2726. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2727. if (res.code == "ok") {
  2728. let lists = res.data.userReportDeptList || []
  2729. const optimizedList = lists.map(item => ({
  2730. ...item,
  2731. label: item.departmentName,
  2732. value: item.departmentId,
  2733. }));
  2734. this.$set(this, 'userReportDeptList', optimizedList || []);
  2735. } else {
  2736. this.$message({
  2737. message: res.msg,
  2738. type: "error"
  2739. });
  2740. }
  2741. },error => { });
  2742. },
  2743. //任务被选中
  2744. onTaskSelected(domainItem) {
  2745. //取服务
  2746. if (domainItem.taskId) {
  2747. var that = this;
  2748. var param = {taskId:domainItem.taskId};
  2749. if (this.isSubstitude) {
  2750. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2751. param.userId = this.workForm.userId[0];
  2752. }
  2753. }
  2754. this.http.post('/task/getMyTaskService',param, res => {
  2755. if (res.code == "ok") {
  2756. // domainItem.workContentList = res.data;
  2757. that.$set(domainItem, 'sapServiceId', null);
  2758. that.$set(domainItem, 'serviceList', res.data);
  2759. } else {
  2760. this.$message({
  2761. message: res.msg,
  2762. type: "error"
  2763. });
  2764. }
  2765. },error => {
  2766. this.$message({
  2767. message: error,
  2768. type: "error"
  2769. });
  2770. }
  2771. );
  2772. } else {
  2773. //清空服务
  2774. }
  2775. },
  2776. onBatchTimeChange() {
  2777. //反向计算每日工作时长
  2778. if (this.workForm.createDate) {
  2779. let sdate = new Date(this.workForm.createDate[0]);
  2780. let edate = new Date(this.workForm.createDate[1]);
  2781. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2782. if (days < 0) {
  2783. return;
  2784. }
  2785. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2786. //总时长发生改变,自动按比例计算
  2787. this.workForm.domains.forEach(d=>{
  2788. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2789. });
  2790. }
  2791. },
  2792. //更新工作内容列表
  2793. updateJobContent(domainItem) {
  2794. var that = this;
  2795. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2796. if (res.code == "ok") {
  2797. // domainItem.workContentList = res.data;
  2798. that.$set(domainItem, 'extraField3', null);
  2799. that.$set(domainItem, 'workContentList', res.data);
  2800. } else {
  2801. this.$message({
  2802. message: res.msg,
  2803. type: "error"
  2804. });
  2805. }
  2806. },error => {
  2807. this.$message({
  2808. message: error,
  2809. type: "error"
  2810. });
  2811. }
  2812. );
  2813. },
  2814. updateResponse(domainItem) {
  2815. var that = this;
  2816. var selectPid = domainItem.projectId;
  2817. domainItem.extraField2 = null;
  2818. domainItem.extraField3 = null;
  2819. if (selectPid && domainItem.extraField1) {
  2820. //是否非项目
  2821. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2822. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2823. domainItem.filteredRespList = filteredRespList;
  2824. }
  2825. },
  2826. getJobResponList() {
  2827. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2828. if (res.code == "ok") {
  2829. this.jobResponseList = res.data;
  2830. } else {
  2831. this.$message({
  2832. message: res.msg,
  2833. type: "error"
  2834. });
  2835. }
  2836. },error => {
  2837. this.$message({
  2838. message: error,
  2839. type: "error"
  2840. });
  2841. }
  2842. );
  2843. },
  2844. openModImportTime(row) {
  2845. this.showModImportTimeDialog = true;
  2846. this.modItemDataId = row.id;
  2847. },
  2848. delImportTime(row) {
  2849. let rowId = row.id;
  2850. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2851. confirmButtonText: this.$t('btn.determine'),
  2852. cancelButtonText: this.$t('btn.cancel'),
  2853. type: "warning"
  2854. })
  2855. .then(() => {
  2856. this.http.post('/report-import-log/delete',{
  2857. id: rowId
  2858. },res => {
  2859. if (res.code == "ok") {
  2860. this.$message({
  2861. message: this.$t('message.successfullyDeleted'),
  2862. type: "success"
  2863. });
  2864. this.getToView();
  2865. } else {
  2866. this.$message({
  2867. message: res.msg,
  2868. type: "error"
  2869. });
  2870. }
  2871. },error => {
  2872. this.$message({
  2873. message: error,
  2874. type: "error"
  2875. });
  2876. }
  2877. );
  2878. }).catch(() => {this.startDeleting = false});
  2879. },
  2880. confirmChangeModTime() {
  2881. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2882. this.$message({
  2883. message: this.$t('message.Pleaseselectatime'),
  2884. type: "error"
  2885. });
  2886. return;
  2887. }
  2888. this.http.post('/report-import-log/changeTime',{
  2889. modLogDateTime: this.modImportTime,
  2890. modImportUserId: this.modImportUserId,
  2891. id: this.modItemDataId
  2892. },res => {
  2893. if (res.code == "ok") {
  2894. this.$message({
  2895. message: this.$t('message.modifyTheSuccess'),
  2896. type: "success"
  2897. });
  2898. this.getToView();
  2899. this.showModImportTimeDialog = false;
  2900. } else {
  2901. this.$message({
  2902. message: res.msg,
  2903. type: "error"
  2904. });
  2905. }
  2906. },error => {
  2907. this.$message({
  2908. message: error,
  2909. type: "error"
  2910. });
  2911. }
  2912. );
  2913. },
  2914. confirmBatchApproveReport() {
  2915. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2916. this.$message({
  2917. message: this.$t('qingXuanZeRiQiFanWei'),
  2918. type: "error"
  2919. });
  2920. return;
  2921. }
  2922. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2923. confirmButtonText: this.$t('btn.determine'),
  2924. cancelButtonText: this.$t('btn.cancel'),
  2925. type: "warning"
  2926. })
  2927. .then(() => {
  2928. this.startDeleting = true;
  2929. let obj = {
  2930. startDate: this.deleteReportParam.date[0],
  2931. endDate: this.deleteReportParam.date[1]
  2932. }
  2933. if(this.deleteReportParam.departmentId) {
  2934. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2935. } else {
  2936. obj.departmentId = null
  2937. }
  2938. this.http.post('/report/batchApproveByDate',obj,res => {
  2939. if (res.code == "ok") {
  2940. this.$message({
  2941. message: this.$t('state.approved'),
  2942. type: "success"
  2943. });
  2944. this.getReportList();
  2945. this.getDepartment();
  2946. this.startDeleting = false;
  2947. } else {
  2948. this.$message({
  2949. message: res.msg,
  2950. type: "error"
  2951. });
  2952. }
  2953. },error => {
  2954. this.$message({
  2955. message: error,
  2956. type: "error"
  2957. });
  2958. }
  2959. );
  2960. }).catch(() => {this.startDeleting = false});
  2961. },
  2962. confirmBatchDelReport() {
  2963. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2964. this.$message({
  2965. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2966. type: "error"
  2967. });
  2968. return;
  2969. }
  2970. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2971. this.$message({
  2972. message: this.$t('qingXuanZeRiQiFanWei'),
  2973. type: "error"
  2974. });
  2975. return;
  2976. }
  2977. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2978. confirmButtonText: this.$t('btn.determine'),
  2979. cancelButtonText: this.$t('btn.cancel'),
  2980. type: "warning"
  2981. })
  2982. .then(() => {
  2983. this.startDeleting = true;
  2984. this.http.post('/report/batchDelete',{
  2985. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2986. startDate: this.deleteReportParam.date[0],
  2987. endDate: this.deleteReportParam.date[1],
  2988. deptId: this.deleteReportParam.deptId[0]
  2989. },res => {
  2990. if (res.code == "ok") {
  2991. this.$message({
  2992. message: this.$t('message.successfullyDeleted'),
  2993. type: "success"
  2994. });
  2995. this.getReportList();
  2996. this.getDepartment();
  2997. this.startDeleting = false;
  2998. } else {
  2999. this.$message({
  3000. message: res.msg,
  3001. type: "error"
  3002. });
  3003. }
  3004. },error => {
  3005. this.$message({
  3006. message: error,
  3007. type: "error"
  3008. });
  3009. }
  3010. );
  3011. }).catch(() => {this.startDeleting = false});
  3012. },
  3013. getRecentlyProject(userId) {
  3014. this.http.post('/project/nearProject',{userId: userId},res => {
  3015. if(res.code == 'ok'){
  3016. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3017. let topObj = {
  3018. label: this.$t('zuiJinXuanZeXiangMu'),
  3019. peojectList: res.data
  3020. }
  3021. let botomObj = {
  3022. label: this.$t('other.allProject'),
  3023. peojectList: bottomList
  3024. }
  3025. //最近项目如果在fillProjectList中不存在,需要移除
  3026. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3027. this.integrationProjectList = [topObj, botomObj]
  3028. }else {
  3029. this.$message({
  3030. message: res.msg,
  3031. type: 'error'
  3032. })
  3033. }
  3034. },err => {
  3035. this.$message({
  3036. message: err,
  3037. type: 'error'
  3038. })
  3039. })
  3040. },
  3041. handlePictureCardPreview(file, index) {
  3042. let arr = []
  3043. let imgArr = this.workForm.domains[index].imgListUrl
  3044. for(var i in imgArr) {
  3045. arr.push(imgArr[i].url)
  3046. }
  3047. const $viewer = this.$viewerApi({
  3048. images: arr
  3049. });
  3050. },
  3051. // 图片上传
  3052. addImg(e, index) {
  3053. let formData = new FormData()
  3054. formData.append('multipartFile', e.file)
  3055. this.http.uploadFile('/common/uploadFile', formData,
  3056. res => {
  3057. if (res.code == "ok") {
  3058. this.$message({
  3059. message: this.$t('uploadedsuccessfully'),
  3060. type: "success"
  3061. });
  3062. if(!this.workForm.domains[index].imgList) {
  3063. this.workForm.domains[index].imgList = []
  3064. this.workForm.domains[index].imgListUrl = []
  3065. }
  3066. this.workForm.domains[index].imgList.push(res.data)
  3067. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3068. } else {
  3069. this.$message({message: res.msg,type: "error"});
  3070. }
  3071. },
  3072. error => {this.$message({message: error,type: "error"});
  3073. });
  3074. },
  3075. // 删除图片
  3076. delImg(file,fileList, index) {
  3077. let idx = 0
  3078. for(let i in fileList) {
  3079. if(fileList[i].uid == file.uid) {
  3080. idx = i
  3081. }
  3082. }
  3083. this.workForm.domains[index].imgList.splice(idx, 1)
  3084. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3085. },
  3086. test(){
  3087. console.log('test',this.workForm.domains);
  3088. },
  3089. getHour(s1, s2) {
  3090. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3091. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3092. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3093. var ms = s2.getTime() - s1.getTime();
  3094. if (ms < 0) return 0;
  3095. let ma = ms / 1000 / 60 / 60
  3096. return ma; //小时
  3097. },
  3098. refreshDDCardTime(workdate) {
  3099. if (!workdate) return;
  3100. this.syncTimeLoading = true;
  3101. this.http.post('/dingding/refreshUserCardTime',{
  3102. companyId: this.user.companyId,
  3103. userId: this.user.id,
  3104. date: workdate,
  3105. },res => {
  3106. this.syncTimeLoading = false;
  3107. if(res.code == 'ok'){
  3108. if (!res.data) {
  3109. this.$message({
  3110. message: '获取考勤失败',
  3111. type: 'error'
  3112. })
  3113. } else {
  3114. this.workForm.time = res.data;
  3115. }
  3116. }else {
  3117. this.$message({
  3118. message: res.msg,
  3119. type: 'error'
  3120. })
  3121. }
  3122. },err => {
  3123. this.syncTimeLoading = false;
  3124. this.$message({
  3125. message: err,
  3126. type: 'error'
  3127. })
  3128. })
  3129. },
  3130. refreshWXCardTime(workdate) {
  3131. if (!workdate) return;
  3132. this.syncTimeLoading = true;
  3133. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3134. date: workdate,
  3135. },res => {
  3136. this.syncTimeLoading = false;
  3137. if(res.code == 'ok'){
  3138. this.workForm.time = res.data.time;
  3139. }else {
  3140. this.$message({
  3141. message: res.msg,
  3142. type: 'error'
  3143. })
  3144. }
  3145. },err => {
  3146. this.syncTimeLoading = false;
  3147. this.$message({
  3148. message: err,
  3149. type: 'error'
  3150. })
  3151. })
  3152. },
  3153. refreshAttendance(workdate) {
  3154. if (!workdate) return;
  3155. this.syncTimeLoading = true;
  3156. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3157. startDate: workdate[0],
  3158. endDate: workdate[1]
  3159. },res => {
  3160. this.syncTimeLoading = false;
  3161. if(res.code == 'ok'){
  3162. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3163. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3164. this.totalReportHours = this.workTimeForMinYi;
  3165. }else {
  3166. this.$message({
  3167. message: res.msg,
  3168. type: 'error'
  3169. })
  3170. }
  3171. },err => {
  3172. this.syncTimeLoading = false;
  3173. this.$message({
  3174. message: err,
  3175. type: 'error'
  3176. })
  3177. })
  3178. },
  3179. refreshBeiSengAttendance(workdate) {
  3180. if (!workdate) return;
  3181. this.syncTimeLoading = true;
  3182. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3183. createDate: workdate
  3184. },res => {
  3185. this.syncTimeLoading = false;
  3186. if(res.code == 'ok'){
  3187. this.workForm.time = res.data;
  3188. }else {
  3189. this.$message({
  3190. message: res.msg,
  3191. type: 'error'
  3192. })
  3193. }
  3194. },err => {
  3195. this.syncTimeLoading = false;
  3196. this.$message({
  3197. message: err,
  3198. type: 'error'
  3199. })
  3200. })
  3201. },
  3202. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3203. this.weeklyFilledTimeDialog = true
  3204. this.weeklyFilledTimeLoading = true
  3205. this.weeklyFilledTimeDate = parameterDate
  3206. this.http.post('/report/getReportList',{
  3207. date: parameterDate,
  3208. userId: this.user.id
  3209. },res => {
  3210. this.weeklyFilledTimeLoading = false
  3211. if(res.code == 'ok'){
  3212. this.weeklyFilledTimeList = res.data[0].data
  3213. let candelete = true
  3214. for(let i in this.weeklyFilledTimeList){
  3215. if(this.weeklyFilledTimeList[i].state < 2){
  3216. candelete = false
  3217. }
  3218. }
  3219. this.weeklyFilledTimeCanDelete = candelete
  3220. }else {
  3221. this.$message({
  3222. message: res.msg,
  3223. type: 'error'
  3224. })
  3225. }
  3226. },err => {
  3227. this.weeklyFilledTimeLoading = false
  3228. this.$message({
  3229. message: err,
  3230. type: 'error'
  3231. })
  3232. })
  3233. },
  3234. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3235. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3236. confirmButtonText: this.$t('btn.determine'),
  3237. cancelButtonText: this.$t('btn.cancel'),
  3238. type: "warning"
  3239. })
  3240. .then(() => {
  3241. this.http.post('/report/delete',{
  3242. userId: this.user.id,
  3243. date: this.weeklyFilledTimeDate
  3244. },res => {
  3245. if (res.code == "ok") {
  3246. this.$message({
  3247. message: this.$t('message.successfullyDeleted'),
  3248. type: "success"
  3249. });
  3250. this.getWeeklyWorkTime()
  3251. this.getReportList();
  3252. this.getDepartment();
  3253. this.weeklyFilledTimeDialog = false;
  3254. } else {
  3255. this.$message({
  3256. message: res.msg,
  3257. type: "error"
  3258. });
  3259. }
  3260. },error => {
  3261. this.$message({
  3262. message: error,
  3263. type: "error"
  3264. });
  3265. }
  3266. );
  3267. }).catch(() => {});
  3268. },
  3269. getApprovalProcess(item){
  3270. // console.log('this.date',this.choseDate);
  3271. this.http.post('/report-log/get',{
  3272. creatorId: item.id,
  3273. createDate: sessionStorage.msg
  3274. },res => {
  3275. if(res.code == 'ok'){
  3276. this.approvalProcessDialog = true
  3277. if(this.user.userNameNeedTranslate == 1) {
  3278. for(var i in res.data) {
  3279. let obj = {
  3280. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3281. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3282. }
  3283. res.data[i].msgCon = obj
  3284. }
  3285. }
  3286. this.approvalProcessData = res.data
  3287. }else{
  3288. this.$message({
  3289. message: res.msg,
  3290. type: 'error'
  3291. })
  3292. }
  3293. },err => {
  3294. this.$message({
  3295. message: err,
  3296. type: 'error'
  3297. })
  3298. })
  3299. //获取审批节点状态
  3300. if (this.user.companyId == 7544) {
  3301. this.http.post('/report/getCurAuditNode',{
  3302. userId: item.id,
  3303. date: sessionStorage.msg
  3304. },res => {
  3305. if(res.code == 'ok'){
  3306. this.curAuditNode = res.data
  3307. }else{
  3308. }
  3309. },err => {
  3310. this.$message({
  3311. message: err,
  3312. type: 'error'
  3313. })
  3314. })
  3315. }
  3316. },
  3317. filterNode(value, data) {
  3318. if (!value) return true;
  3319. return data.label.indexOf(value) !== -1;
  3320. },
  3321. triggerCalculateOT(index) {
  3322. var str = this.workForm.domains[index].overtimeHours + ''
  3323. if(str.indexOf('.') != '-1') {
  3324. var s = str.split('.')[0]
  3325. var st = str.split('.')[1]
  3326. var sts = st.split('')
  3327. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3328. }
  3329. },
  3330. searchScreen(e){
  3331. if(e == 1){
  3332. this.monthNotWorkDateS1 = []
  3333. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3334. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3335. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3336. }
  3337. }
  3338. if (this.monthNotWorkDateS1.length > 50) {
  3339. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3340. }else{
  3341. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3342. }
  3343. } else if (e == 0) {
  3344. this.monthWorkDataS1 = []
  3345. for (let i = 0; i < this.monthWorkData.length; i++) {
  3346. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3347. this.monthWorkDataS1.push(this.monthWorkData[i])
  3348. }
  3349. }
  3350. if (this.monthWorkDataS1.length > 50) {
  3351. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3352. }else{
  3353. this.monthWorkDataS = this.monthWorkDataS1
  3354. }
  3355. } else if (e == 2) {
  3356. this.monthWorkDataS1 = []
  3357. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3358. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3359. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3360. }
  3361. }
  3362. if (this.monthWorkDataS1.length > 50) {
  3363. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3364. }else{
  3365. this.notFullData = this.monthWorkDataS1
  3366. }
  3367. }
  3368. },
  3369. addUpload(data) {
  3370. // var zhi = data.fileName.split('.')[0]
  3371. // var sss = zhi + '.xlsx'
  3372. // return
  3373. var filePath = '/upload/' + data.serverName;
  3374. const a = document.createElement('a'); // 创建a标签
  3375. a.setAttribute('download', data.fileName);// download属性
  3376. a.setAttribute('href', filePath);// href链接
  3377. a.click(); //自执行点击事件
  3378. a.remove();
  3379. },
  3380. restrictNumber(targetId) {
  3381. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3382. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3383. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3384. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3385. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3386. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3387. inpu.value = parseFloat(inpu.value);
  3388. }
  3389. },
  3390. //获取项目下的任务分组
  3391. getTaskGroups(domain, index) {
  3392. domain.groupId=null;
  3393. this.http.post('/task-group/listMyJoinGroup',{
  3394. projectId: domain.projectId,
  3395. isSubstitude: this.isSubstitude ? 1 : 0
  3396. },
  3397. res => {
  3398. if (res.code == "ok") {
  3399. this.workForm.domains[index].taskGroups = res.data;
  3400. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3401. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3402. // this.getGroupStages(domain, index);
  3403. // }
  3404. const projectIdStr = domain.projectId;
  3405. const businessTripsArray = this.businessTripsArray
  3406. const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
  3407. if(list.length > 0) {
  3408. const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
  3409. this.workForm.domains[index].groupId = obj.id || ''
  3410. }
  3411. this.$forceUpdate();
  3412. }
  3413. },
  3414. error => {
  3415. this.$message({
  3416. message: error,
  3417. type: "error"
  3418. });
  3419. }
  3420. );
  3421. },
  3422. //下载填报工时占比报表
  3423. downloadProjectRatio() {
  3424. this.exportUserRatio = true;
  3425. // let now = new Date();
  3426. // let month = now.getMonth();//默认看上个月的
  3427. // let monthStr = month<10? ('0'+month): month;
  3428. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3429. const today = new Date();
  3430. const year = today.getFullYear();
  3431. const month = today.getMonth() + 1;
  3432. let lastMonthYear, lastMonth;
  3433. if (month === 1) {
  3434. lastMonthYear = year - 1;
  3435. lastMonth = 12;
  3436. } else {
  3437. lastMonthYear = year;
  3438. lastMonth = month - 1;
  3439. }
  3440. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3441. },
  3442. confirmDownloadRatio() {
  3443. this.startRatioExporting = true;
  3444. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3445. ymonth: this.ratioYmonth
  3446. },
  3447. res => {
  3448. if (res.code == "ok") {
  3449. this.startRatioExporting = false;
  3450. var filePath = res.data;
  3451. const a = document.createElement('a'); // 创建a标签
  3452. var data = filePath.split("/");
  3453. a.setAttribute('download', data[data.length-1]);// download属性
  3454. a.setAttribute('href', filePath);// href链接
  3455. a.click(); //自执行点击事件
  3456. a.remove();
  3457. } else {
  3458. this.startRatioExporting = false;
  3459. this.$message({
  3460. message: res.msg,
  3461. type: "error"
  3462. });
  3463. }
  3464. },
  3465. error => {
  3466. this.checkinLoading = false;
  3467. this.$message({
  3468. message: error,
  3469. type: "error"
  3470. });
  3471. }
  3472. );
  3473. },
  3474. //下载带企业微信考勤数据的工时统计模板
  3475. downloadCheckInExcel() {
  3476. var param = {
  3477. startDate: this.importWxParam.date[0],
  3478. endDate: this.importWxParam.date[1],
  3479. };
  3480. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3481. param.onlySelfData = false;
  3482. }
  3483. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3484. res => {
  3485. if (res.code == "ok") {
  3486. var filePath = res.data;
  3487. const a = document.createElement('a'); // 创建a标签
  3488. var data = filePath.split("/");
  3489. a.setAttribute('download', data[data.length-1]);// download属性
  3490. a.setAttribute('href', filePath);// href链接
  3491. a.click(); //自执行点击事件
  3492. a.remove();
  3493. } else {
  3494. this.$message({
  3495. message: res.msg,
  3496. type: "error"
  3497. });
  3498. }
  3499. },
  3500. error => {
  3501. this.checkinLoading = false;
  3502. this.$message({
  3503. message: error,
  3504. type: "error"
  3505. });
  3506. }
  3507. );
  3508. },
  3509. pre() {
  3510. if (this.active == 0) return;
  3511. this.active--;
  3512. },
  3513. next() {
  3514. this.active++;
  3515. },
  3516. triggerTotalTime(index) {
  3517. var item = this.checkinList[index];
  3518. var total = 0.0;
  3519. for (var i=0;i<this.projectColumns.length; i++) {
  3520. var key = this.projectColumns[i];
  3521. if (item[key] != null && item[key] != '') {
  3522. total += parseFloat(item[key]);
  3523. }
  3524. }
  3525. item.totalFillTime = total;
  3526. },
  3527. //提交批量代填的数据
  3528. submitBatchSubFillData() {
  3529. var data = JSON.stringify(this.checkinList);
  3530. this.http.post('/user-corpwx-time/submitProjectTime',{
  3531. json: data,
  3532. projectColumns: JSON.stringify(this.projectColumns)
  3533. },
  3534. res => {
  3535. if (res.code == "ok") {
  3536. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3537. this.importWxDialog = false;
  3538. }
  3539. },
  3540. error => {
  3541. this.checkinLoading = false;
  3542. this.$message({
  3543. message: error,
  3544. type: "error"
  3545. });
  3546. }
  3547. );
  3548. },
  3549. loadCheckInData() {
  3550. if (this.importWxParam.date == null) {
  3551. this.checkinList = [];
  3552. return;
  3553. }
  3554. this.checkinLoading = true;
  3555. this.http.post('/user-corpwx-time/getMyData',{
  3556. startDate: this.importWxParam.date[0],
  3557. endDate: this.importWxParam.date[1],
  3558. },
  3559. res => {
  3560. if (res.code == "ok") {
  3561. this.checkinLoading = false;
  3562. this.checkinList = res.data.list;
  3563. this.projectColumns = res.data.projects;
  3564. // 自定义表格会导致表格错乱,需重新计算表格
  3565. this.$nextTick(()=>{
  3566. this.$refs.tab.doLayout()
  3567. })
  3568. }
  3569. },
  3570. error => {
  3571. this.checkinLoading = false;
  3572. this.$message({
  3573. message: error,
  3574. type: "error"
  3575. });
  3576. }
  3577. );
  3578. },
  3579. importCardTime(item) {
  3580. //首先判断文件类型
  3581. let str = item.file.name.split(".");
  3582. let format = str[str.length - 1];
  3583. if (format != "xls" && format != "xlsx") {
  3584. this.$message({
  3585. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3586. type: "error"
  3587. });
  3588. } else {
  3589. this.importingData = true;
  3590. let formData = new FormData();
  3591. formData.append("multipartFile", item.file);
  3592. formData.append("companyId", this.user.companyId);
  3593. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3594. res => {
  3595. this.$refs.uploadCardTime.clearFiles();
  3596. this.importingData = false;
  3597. if (res.code == "ok") {
  3598. //换成弹出框,以免有人等了半天回来啥也没看到
  3599. this.$message({
  3600. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3601. type: "success"
  3602. });
  3603. } else {
  3604. this.$message({
  3605. message: res.msg,
  3606. type: "error"
  3607. });
  3608. }
  3609. },
  3610. error => {
  3611. this.$refs.upload.clearFiles();
  3612. this.listLoading = false;
  3613. this.$message({
  3614. message: error,
  3615. type: "error"
  3616. });
  3617. });
  3618. }
  3619. },
  3620. batchImportWxData(item) {
  3621. //首先判断文件类型
  3622. let str = item.file.name.split(".");
  3623. let format = str[str.length - 1];
  3624. if (format != "xls" && format != "xlsx") {
  3625. this.$message({
  3626. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3627. type: "error"
  3628. });
  3629. } else {
  3630. this.importingData = true;
  3631. let formData = new FormData();
  3632. formData.append("file", item.file);
  3633. formData.append("companyId", this.user.companyId);
  3634. formData.append("withCheckIn", 1);
  3635. this.http.uploadFile('/report/importData', formData,
  3636. res => {
  3637. this.$refs.upload.clearFiles();
  3638. this.showImportResult = true;
  3639. this.importingData = false;
  3640. if (res.code == "ok") {
  3641. //换成弹出框,以免有人等了半天回来啥也没看到
  3642. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3643. this.getReportList();
  3644. this.importWxDialog = false;
  3645. } else {
  3646. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3647. }
  3648. },
  3649. error => {
  3650. this.$refs.upload.clearFiles();
  3651. this.listLoading = false;
  3652. this.$message({
  3653. message: error,
  3654. type: "error"
  3655. });
  3656. });
  3657. }
  3658. },
  3659. batchImportData(item) {
  3660. //首先判断文件类型
  3661. let str = item.file.name.split(".");
  3662. let format = str[str.length - 1];
  3663. if (format != "xls" && format != "xlsx") {
  3664. this.$message({
  3665. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3666. type: "error"
  3667. });
  3668. } else {
  3669. this.importingData = true;
  3670. let formData = new FormData();
  3671. formData.append("file", item.file);
  3672. formData.append("companyId", this.user.companyId);
  3673. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3674. this.http.uploadFile(url, formData,
  3675. res => {
  3676. this.$refs.upload.clearFiles();
  3677. this.importingData = false;
  3678. this.showImportResult = true;
  3679. if (res.code == "ok") {
  3680. //换成弹出框,以免有人等了半天回来啥也没看到
  3681. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3682. this.getReportList();
  3683. this.importWXDialog = false;
  3684. } else {
  3685. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3686. }
  3687. },
  3688. error => {
  3689. this.$refs.upload.clearFiles();
  3690. this.importingData = false;
  3691. this.$message({
  3692. message: error,
  3693. type: "error"
  3694. });
  3695. });
  3696. }
  3697. },
  3698. userssHu() {
  3699. this.http.post('/time-type/getCompanyTimeSetting',{
  3700. companyId: this.user.companyId
  3701. },
  3702. res => {
  3703. if (res.code == "ok") {
  3704. this.yonghuUser = res.data
  3705. }
  3706. },
  3707. error => {
  3708. this.$message({
  3709. message: error,
  3710. type: "error"
  3711. });
  3712. }
  3713. );
  3714. },
  3715. iptBlur(i) {
  3716. if(this.isBatch == 0) {
  3717. return
  3718. }
  3719. var reqParam = {
  3720. startDate: this.workForm.createDate[0],
  3721. endDate: this.workForm.createDate[1]
  3722. };
  3723. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3724. reqParam.userId = this.workForm.userId[0];
  3725. }
  3726. this.http.post('/report/getWorkDays',reqParam,
  3727. res => {
  3728. if (res.code == "ok") {
  3729. this.jsDay = res.data
  3730. this.chuji(i)
  3731. } else {
  3732. this.$message({
  3733. message: res.msg,
  3734. type: "error"
  3735. });
  3736. }
  3737. },
  3738. error => {
  3739. this.$message({
  3740. message: error,
  3741. type: "error"
  3742. });
  3743. }
  3744. );
  3745. //明夷硬编码获取
  3746. if (this.user.company.companyName == this.mingyiName) {
  3747. this.getWorkTimeForMinYi();
  3748. }
  3749. },
  3750. getWorkTimeForMinYi(){
  3751. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3752. startDate: this.workForm.createDate[0],
  3753. endDate: this.workForm.createDate[1]
  3754. },
  3755. res => {
  3756. if (res.code == "ok") {
  3757. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3758. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3759. this.totalReportHours = this.workTimeForMinYi;
  3760. } else {
  3761. this.$message({
  3762. message: res.msg,
  3763. type: "error"
  3764. });
  3765. this.workForm.createDate = [];
  3766. }
  3767. },
  3768. error => {
  3769. this.$message({
  3770. message: error,
  3771. type: "error"
  3772. });
  3773. }
  3774. );
  3775. },
  3776. chuji(i) {
  3777. if(i == 0) {
  3778. this.seleChn(1)
  3779. } else if(i == 1) {
  3780. this.seleChn(0)
  3781. } else if(i == 2) {
  3782. if(this.workForm.domains[0].multiWorktime > 0) {
  3783. this.iptChangs()
  3784. } else {
  3785. this.iptChang()
  3786. }
  3787. } else if(i == 3) {
  3788. this.seleChn(0)
  3789. }
  3790. },
  3791. seleChn(e,domain) {
  3792. if(e == 1) {
  3793. for(var i in this.workForm.domains) {
  3794. if(this.workForm.domains[i].timeType == 0) {
  3795. this.workForm.domains[i].workingTime = 8
  3796. } else {
  3797. this.workForm.domains[i].workingTime = 4
  3798. }
  3799. }
  3800. }
  3801. var quanbu = 0
  3802. var spl = this.workForm.domains
  3803. var zhi = ''
  3804. for(var i in spl) {
  3805. var sp = +spl[i].workingTime + 0
  3806. zhi = this.jsDay * sp
  3807. quanbu = +quanbu + zhi
  3808. }
  3809. this.jsTime = quanbu
  3810. this.totalReportHours = quanbu
  3811. let worktime = this.jsTime
  3812. // 自动计算加班时长
  3813. if(this.isBatch != 0){
  3814. worktime = this.jsTime / this.jsDay
  3815. }
  3816. if(this.user.timeType.fillOvertime && domain){
  3817. let isover = false
  3818. let alltime = 0
  3819. let allover = 0 //此处alltime同上面的worktime
  3820. for(let d in spl){
  3821. if(spl[d].isOvertime){
  3822. isover = true
  3823. allover += spl[d].overtimeHours*1
  3824. }
  3825. alltime += spl[d].workingTime*1
  3826. }
  3827. if(domain.overtimeHours){
  3828. allover = allover - domain.overtimeHours
  3829. }
  3830. if(worktime*1 > this.user.timeType.allday){
  3831. if(isover){
  3832. if(alltime > (allover + this.user.timeType.allday)){
  3833. this.$set(domain,'isOvertime',true)
  3834. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3835. }else{
  3836. this.$set(domain,'isOvertime',false)
  3837. this.$set(domain,'overtimeHours',null)
  3838. if(alltime < (allover + this.user.timeType.allday)){
  3839. let overtime = allover + this.user.timeType.allday - alltime
  3840. for(let pi in spl){
  3841. if(spl[pi].overtimeHours){
  3842. if((overtime - spl[pi].overtimeHours*1) > 0){
  3843. overtime = overtime - spl[pi].overtimeHours*1
  3844. this.$set(spl[pi],'isOvertime',false)
  3845. this.$set(spl[pi],'overtimeHours',null)
  3846. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3847. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3848. break
  3849. }else{
  3850. this.$set(spl[pi],'isOvertime',false)
  3851. this.$set(spl[pi],'overtimeHours',null)
  3852. break
  3853. }
  3854. }
  3855. }
  3856. }
  3857. }
  3858. }else{
  3859. this.$set(domain,'isOvertime',true)
  3860. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3861. }
  3862. }else{
  3863. for(let di in spl){
  3864. this.$set(spl[di],'isOvertime',false)
  3865. this.$set(spl[di],'overtimeHours',null)
  3866. }
  3867. }
  3868. }
  3869. },
  3870. iptChang() {
  3871. var sl = this.workForm.domains
  3872. let timeArr = []
  3873. for(var i in sl) {
  3874. if(sl[i].startTime && sl[i].endTime) {
  3875. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3876. }
  3877. }
  3878. this.getTimeHours(timeArr)
  3879. },
  3880. iptChangs() {
  3881. var sl = this.workForm.domains
  3882. let timeArr = []
  3883. for(var i in sl) {
  3884. for(var j in sl[i].worktimeList){
  3885. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3886. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3887. }
  3888. }
  3889. }
  3890. this.getTimeHours(timeArr)
  3891. },
  3892. // 调用接口或去数据
  3893. getTimeHours(arr) {
  3894. this.http.post('/report/getHoursByTimeRange',{
  3895. timeJsonStr: JSON.stringify(arr)
  3896. },res => {
  3897. if(res.code === 'ok') {
  3898. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3899. } else {
  3900. this.$message({
  3901. message: res.msg,
  3902. type: 'error'
  3903. })
  3904. }
  3905. },err => {
  3906. this.$message({
  3907. message: err,
  3908. type: 'error'
  3909. })
  3910. })
  3911. },
  3912. // 按周填报调用接口计算时间
  3913. async getWeekHoursByTimeRange(timeRange) {
  3914. const url = '/report/getHoursByTimeRange';
  3915. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3916. var that = this;
  3917. return new Promise((resolve, reject) => {
  3918. this.http.post(url, data, function(res) {
  3919. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3920. }, function(err) {
  3921. reject(err);
  3922. });
  3923. });
  3924. },
  3925. removeTimeItem(item, index) {
  3926. item.worktimeList.splice(index, 1);
  3927. this.iptChangs()
  3928. },
  3929. //添加工时
  3930. addNewWorktime(index, item) {
  3931. if(item.worktimeList == null ) {
  3932. item.worktimeList = []
  3933. }
  3934. item.worktimeList.push({});
  3935. },
  3936. //复制项目
  3937. copyProject(index) {
  3938. var leftProgress = 10;
  3939. if (this.reportTimeType.type == 3) {
  3940. //计算已经待分配工时比例
  3941. let array = this.workForm.domains;
  3942. let totalProgress = 0;
  3943. for (var i=0;i<array.length; i++) {
  3944. totalProgress += array[i].progress;
  3945. }
  3946. if (totalProgress < 100) {
  3947. leftProgress = 100 - totalProgress;
  3948. }
  3949. }
  3950. var newIndex = index+1;
  3951. var itemDomain = {
  3952. projectId: this.workForm.domains[index].projectId,
  3953. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3954. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3955. ),
  3956. content: "",
  3957. progress:leftProgress,
  3958. state:2,//2-表示待提交
  3959. };
  3960. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3961. if (this.reportTimeType.type == 0) {
  3962. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3963. var length = this.workForm.domains.length;
  3964. if (length == 2) {
  3965. this.showAddMore = false;
  3966. }
  3967. }
  3968. this.selectProject(itemDomain, newIndex);
  3969. },
  3970. pushWorkTime(reportId){
  3971. let url=''
  3972. if(this.user.timeType.syncSap == 1){
  3973. url='/report/pushProjectReportToSap'
  3974. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3975. var pushDate = this.date + day;
  3976. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3977. confirmButtonText: this.$t('btn.determine'),
  3978. cancelButtonText: this.$t('btn.cancel'),
  3979. type: 'info'
  3980. }).then(() => {
  3981. const loading = this.$loading({
  3982. lock: true,
  3983. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3984. spinner: 'el-icon-loading',
  3985. background: 'rgba(0, 0, 0, 0.7)'
  3986. });
  3987. this.http.post(url,{
  3988. pushDate: pushDate,
  3989. reportId: reportId
  3990. },res => {
  3991. loading.close();
  3992. if(res.code == 'ok'){
  3993. this.$message({
  3994. type: 'success',
  3995. message: res.data
  3996. });
  3997. }else{
  3998. this.$message({
  3999. type: 'error',
  4000. message: res.msg
  4001. })
  4002. }
  4003. },err => {
  4004. loading.close();
  4005. this.$message({
  4006. type: 'error',
  4007. message: err
  4008. })
  4009. })
  4010. }).catch(() => {
  4011. });
  4012. }else{
  4013. url='/report/pushReportDataToThird'
  4014. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4015. confirmButtonText: this.$t('btn.determine'),
  4016. cancelButtonText: this.$t('btn.cancel'),
  4017. type: 'info'
  4018. }).then(() => {
  4019. const loading = this.$loading({
  4020. lock: true,
  4021. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4022. spinner: 'el-icon-loading',
  4023. background: 'rgba(0, 0, 0, 0.7)'
  4024. });
  4025. this.http.post(url,{
  4026. yearMonth: this.date
  4027. },res => {
  4028. loading.close();
  4029. if(res.code == 'ok'){
  4030. this.$message({
  4031. type: 'success',
  4032. message: this.$t('tuiSongChengGong')
  4033. });
  4034. }else{
  4035. this.$message({
  4036. type: 'error',
  4037. message: res.msg
  4038. })
  4039. }
  4040. },err => {
  4041. loading.close();
  4042. this.$message({
  4043. type: 'error',
  4044. message: err
  4045. })
  4046. })
  4047. }).catch(() => {
  4048. });
  4049. }
  4050. },
  4051. showWorkTime(){
  4052. this.monthWorkTimeDialog = true;
  4053. this.searchKeyword = ''
  4054. this.WorktimeDatepickValue = this.istoMonth()
  4055. if(this.WorktimeDatepickValue.length == 0){
  4056. let newdate = new Date();
  4057. let nowdate = newdate.toLocaleDateString();
  4058. let getauto = this.getAutoWeekDate(nowdate)
  4059. let nowwd = [getauto[0],getauto[6]]
  4060. this.WorktimeDatepickValue = nowwd
  4061. }
  4062. this.showMonthWorkTime()
  4063. },
  4064. handleClick(t,e){
  4065. if (t.name == "second") {
  4066. this.showMonthNotWorkTime()
  4067. }else if(t.name == "first"){
  4068. this.showMonthWorkTime()
  4069. }else if(t.name == "third"){
  4070. this.showMonthWorkTimeReminder()
  4071. } else if (t.name == "fourth") {
  4072. this.showReportTimeLessThanCardTimeList();
  4073. }
  4074. },
  4075. //导出员工每日填报工时数
  4076. exportMembWorkHours() {
  4077. this.http.post(
  4078. "/report/exportUserDailyWorkTime",
  4079. {
  4080. // month: this.date,
  4081. startDate: this.WorktimeDatepickValue[0],
  4082. endDate: this.WorktimeDatepickValue[1],
  4083. },
  4084. (res) => {
  4085. if (res.code == "ok") {
  4086. let url = res.data;
  4087. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4088. }
  4089. },
  4090. (error) => {
  4091. this.$message({
  4092. message: error,
  4093. type: "error",
  4094. });
  4095. }
  4096. );
  4097. },
  4098. exportMembWorkHoursReminder() {
  4099. this.http.post(
  4100. "/report/exportUserDailyWorkTimeReminder",
  4101. {
  4102. // month: this.date,
  4103. startDate: this.WorktimeDatepickValue[0],
  4104. endDate: this.WorktimeDatepickValue[1],
  4105. },
  4106. (res) => {
  4107. if (res.code == "ok") {
  4108. let url = res.data;
  4109. this.downloadByA('工时异常表.xlsx', url);
  4110. }
  4111. },
  4112. (error) => {
  4113. this.$message({
  4114. message: error,
  4115. type: "error",
  4116. });
  4117. }
  4118. );
  4119. },
  4120. exportMembNotWorkHours() {
  4121. this.http.post(
  4122. "/report/exportNoReportUserList",
  4123. {
  4124. // month: this.date,
  4125. startDate: this.WorktimeDatepickValue[0],
  4126. endDate: this.WorktimeDatepickValue[1],
  4127. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4128. },
  4129. (res) => {
  4130. if (res.code == "ok") {
  4131. let url = res.data;
  4132. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4133. }
  4134. },
  4135. (error) => {
  4136. this.$message({
  4137. message: error,
  4138. type: "error",
  4139. });
  4140. }
  4141. );
  4142. },
  4143. downloadByA(name, url) {
  4144. const a = document.createElement("a"); // 创建a标签
  4145. a.setAttribute("download", name); // download属性
  4146. a.setAttribute("href", url); // href链接
  4147. a.click(); // 自执行点击事件
  4148. a.remove();
  4149. },
  4150. // 是否本月判断
  4151. istoMonth(){
  4152. let todate = new Date()
  4153. let tomonth = todate.getMonth() + 1
  4154. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4155. if(this.date == adate){
  4156. return []
  4157. }else{
  4158. let sedate = new Date(this.date)
  4159. let semonth = sedate.getMonth() + 1
  4160. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4161. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4162. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4163. return [sedates1, sedates2]
  4164. }
  4165. },
  4166. showMonthWorkTime() {
  4167. this.monthTotalPage = 0,
  4168. this.tbload = true
  4169. let parameter={
  4170. startDate: this.WorktimeDatepickValue[0],
  4171. endDate: this.WorktimeDatepickValue[1],
  4172. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4173. }
  4174. this.http.post(
  4175. "/report/getUserDailyWorkTime",
  4176. // "/report/getNoReportUserList",
  4177. parameter,
  4178. (res) => {
  4179. if (res.code == "ok") {
  4180. this.tbload = false;
  4181. this.pickDateArray = res.data.days.map(item => {
  4182. return {
  4183. ...item,
  4184. dateStr: item.label.split('/')[0],
  4185. weekStr: item.label.split('/')[1]
  4186. }
  4187. });
  4188. // console.log('dataarray',res.data.days);
  4189. this.monthWorkData = res.data.list;
  4190. // this.monthWorkDataS = this.monthWorkData
  4191. // this.monthWorkDataS1 = res.data.list
  4192. this.monthTotal = res.data.list.length
  4193. if (this.monthWorkData.length > 50) {
  4194. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4195. }else{
  4196. this.monthWorkDataS = this.monthWorkData
  4197. }
  4198. this.searchScreen(0)
  4199. // this.monthWorkDataS = infoList
  4200. // 判断
  4201. // if (this.monthWorkDataS1.length > 0) {
  4202. // setTimeout(() => {
  4203. // this.tableListener()
  4204. // }, 1000);
  4205. // }
  4206. this.$nextTick(function(){
  4207. this.$refs.hasworkTbl.doLayout();
  4208. });
  4209. // this.$forceUpdate()
  4210. }
  4211. },
  4212. (error) => {
  4213. this.tbload = false
  4214. this.$message({
  4215. message: error,
  4216. type: "error",
  4217. });
  4218. }
  4219. );
  4220. },
  4221. showMonthWorkTimeReminder() {
  4222. this.monthTotalPage = 0,
  4223. this.tbload = true
  4224. let parameter={}
  4225. parameter={
  4226. startDate: this.WorktimeDatepickValue[0],
  4227. endDate: this.WorktimeDatepickValue[1],
  4228. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4229. viewValue:this.isReminder?1:0
  4230. }
  4231. this.http.post(
  4232. "/report/getUserDailyWorkTimeReminder",
  4233. parameter,
  4234. (res) => {
  4235. if (res.code == "ok") {
  4236. this.tbload = false;
  4237. this.monthWorkData = res.data.list;
  4238. this.monthTotal = res.data.list.length
  4239. if (this.monthWorkData.length > 50) {
  4240. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4241. }else{
  4242. this.monthWorkDataS = this.monthWorkData
  4243. }
  4244. this.searchScreen(0)
  4245. this.$nextTick(function(){
  4246. this.$refs.hasworkTbl.doLayout();
  4247. });
  4248. }
  4249. },
  4250. (error) => {
  4251. this.tbload = false
  4252. this.$message({
  4253. message: error,
  4254. type: "error",
  4255. });
  4256. }
  4257. );
  4258. },
  4259. showMonthNotWorkTime() {
  4260. this.monthTotalPage = 0,
  4261. this.tbload = true,
  4262. this.http.post(
  4263. "/report/getNoReportUserList",
  4264. {
  4265. startDate: this.WorktimeDatepickValue[0],
  4266. endDate: this.WorktimeDatepickValue[1],
  4267. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4268. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4269. },
  4270. (res) => {
  4271. if (res.code == "ok") {
  4272. this.tbload = false
  4273. this.monthNotWorkDate = res.data;
  4274. this.monthnotTotal = res.data.length
  4275. if (this.monthNotWorkDate.length > 50) {
  4276. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4277. } else {
  4278. this.monthNotWorkDateS = this.monthNotWorkDate
  4279. }
  4280. this.searchScreen(1)
  4281. this.$nextTick(function(){
  4282. this.$refs.hasworkTbl2.doLayout();
  4283. });
  4284. }
  4285. },
  4286. (error) => {
  4287. this.tbload = false
  4288. this.$message({
  4289. message: error,
  4290. type: "error",
  4291. });
  4292. }
  4293. );
  4294. },
  4295. listScroll(){
  4296. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4297. this.isMore = true
  4298. setTimeout(()=>{
  4299. this.isMore = false
  4300. },1000)
  4301. }else {
  4302. this.isFlag = true
  4303. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4304. this.monthWorkDataS = datalist
  4305. setTimeout(()=>{
  4306. this.isFlag = false
  4307. },300)
  4308. }
  4309. },
  4310. notListScroll(){
  4311. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4312. this.isMore = true
  4313. setTimeout(()=>{
  4314. this.isMore = false
  4315. },1000)
  4316. }else {
  4317. this.isFlag = true
  4318. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4319. this.monthNotWorkDateS = datalist
  4320. // console.log('length',this.monthNotWorkDateS.length)
  4321. setTimeout(()=>{
  4322. this.isFlag = false
  4323. },300)
  4324. }
  4325. },
  4326. getFirstAndLastDay() {
  4327. // 将选定的月份转换为Date对象
  4328. var monthDate = new Date();
  4329. var year = monthDate.getFullYear();
  4330. var month = monthDate.getMonth();
  4331. // 计算起始日和结束日
  4332. var startDay = new Date(year, month, 1);
  4333. var endDay = new Date(year, month + 1, 0);
  4334. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4335. this.WorktimeDatepickValueForMonth=lastmd
  4336. },
  4337. formatDate(date) {
  4338. var year = date.getFullYear();
  4339. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4340. var day = ("0" + date.getDate()).slice(-2);
  4341. return year + "-" + month + "-" + day;
  4342. },
  4343. // 获取默认这zhou日期参数 222
  4344. getLastWeek(e){
  4345. let newdate = new Date()
  4346. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4347. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4348. if(e==1){
  4349. this.WorktimeDatepickValue = lastwd
  4350. this.showMonthWorkTime()
  4351. }else if(e==2){
  4352. this.WorktimeDatepickValue = lastwd
  4353. this.showMonthWorkTimeReminder()
  4354. }else{
  4355. this.WorktimeDatepickValue = lastwd
  4356. this.showMonthNotWorkTime()
  4357. }
  4358. },
  4359. getThisWeek(e){
  4360. let newdate = new Date();
  4361. let nowdate = newdate.toLocaleDateString();
  4362. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4363. if(e==1){
  4364. this.WorktimeDatepickValue = nowwd
  4365. this.showMonthWorkTime()
  4366. }else if(e==2){
  4367. this.WorktimeDatepickValue = nowwd
  4368. this.showMonthWorkTimeReminder()
  4369. }else{
  4370. this.WorktimeDatepickValue = nowwd
  4371. this.showMonthNotWorkTime()
  4372. }
  4373. },
  4374. getDoubleLastWeek(e){
  4375. let newdate = new Date()
  4376. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4377. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4378. if(e==1){
  4379. this.WorktimeDatepickValue = nextwd
  4380. this.showMonthWorkTime()
  4381. }else if(e==2){
  4382. this.WorktimeDatepickValue = nextwd
  4383. this.showMonthWorkTimeReminder()
  4384. }else{
  4385. this.WorktimeDatepickValue = nextwd
  4386. this.showMonthNotWorkTime()
  4387. }
  4388. },
  4389. alreadyAllDate(stime,etime){
  4390. let diffdate = new Array();
  4391. let i=0;
  4392. while(stime<=etime){
  4393. let dateArray = stime.split("-");
  4394. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4395. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4396. let stimewk = this.weekDay[date.getDay()]
  4397. 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')
  4398. 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])
  4399. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4400. let stime_ts = new Date(stime).getTime();
  4401. let next_date = stime_ts + (24*60*60*1000);
  4402. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4403. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4404. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4405. stime = next_dates_y+next_dates_m+next_dates_d;
  4406. i++;
  4407. }
  4408. return diffdate
  4409. },
  4410. getAutoWeekDate(e) {
  4411. let dateString = e;
  4412. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4413. if (dateString.match(dateStringReg)) {
  4414. let presentDate = new Date(dateString),
  4415. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4416. return Array.from(new Array(7), function (val, index) {
  4417. let formatDate = new Date(
  4418. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4419. );
  4420. return (
  4421. formatDate.getFullYear() +
  4422. "-" +
  4423. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4424. "-" +
  4425. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4426. );
  4427. });
  4428. } else {
  4429. throw new Error(
  4430. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4431. );
  4432. }
  4433. },
  4434. onProgressChange() {
  4435. this.$forceUpdate();
  4436. },
  4437. showChooseMembTree() {
  4438. this.chosenMembCount = this.participator.length;
  4439. this.chooseParticipVisible = true;
  4440. },
  4441. onTreeItemChange() {
  4442. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4443. var list = chosenList.filter(item=>item.isUser == 1);
  4444. this.chosenMembCount = list.length;
  4445. },
  4446. findUserInTree() {
  4447. if (this.filterName == '') {
  4448. this.deptMembData = this.allMembData;
  4449. } else {
  4450. var list = this.findRecursively(this.filterName, this.allMembData);
  4451. this.deptMembData = list;
  4452. }
  4453. },
  4454. findRecursively(username, list) {
  4455. var filterList = [];
  4456. for (var i=0;i<list.length; i++) {
  4457. if (list[i].isUser == 1) {
  4458. if (list[i].label.indexOf(username) >= 0) {
  4459. //匹配上了
  4460. filterList.push(list[i]);
  4461. }
  4462. } else if (list[i].children != null && list[i].children.length > 0) {
  4463. var subList = this.findRecursively(username, list[i].children);
  4464. if (subList.length > 0) {
  4465. subList.forEach(s=>filterList.push(s));
  4466. }
  4467. }
  4468. }
  4469. return filterList;
  4470. },
  4471. //确定选择参与人
  4472. chooseParticip() {
  4473. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4474. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4475. //只能选择一个人进行代填,防止任务有问题
  4476. if (this.chosenMembList.length > 1) {
  4477. this.$message({
  4478. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4479. type: "error",
  4480. });
  4481. return;
  4482. }
  4483. this.chooseParticipVisible = false;
  4484. this.workForm.userNames = '';
  4485. this.workForm.userId = [];
  4486. this.participator = [];
  4487. for (var i=0;i<this.chosenMembList.length; i++) {
  4488. this.workForm.userId.push(this.chosenMembList[i].id);
  4489. this.workForm.userNames += this.chosenMembList[i].label+',';
  4490. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4491. this.participator.push(item);
  4492. }
  4493. if (this.workForm.userNames.length > 0) {
  4494. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4495. }
  4496. if(this.user.userNameNeedTranslate == 1) {
  4497. if(this.workForm.userNames) {
  4498. this.workForm.userNames = this.workForm.userNames.split(',')
  4499. }
  4500. }
  4501. //加载该人员的可填报项目
  4502. if (this.workForm.userId.length > 0) {
  4503. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4504. }
  4505. //打通企业微信考勤的情况,获取考勤
  4506. if (this.user.timeType.showCorpwxCardtime) {
  4507. this.getTargetUserCardTime();
  4508. }
  4509. },
  4510. getTargetUserCardTime() {
  4511. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4512. this.http.post('/user-corpwx-time/getUserCardTime',{
  4513. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4514. },
  4515. res => {
  4516. if (res.code == "ok") {
  4517. this.$set(this.workForm,'time', res.data);
  4518. }
  4519. },
  4520. error => {
  4521. this.$message({
  4522. message: error,
  4523. type: "error"
  4524. });
  4525. }
  4526. );
  4527. }
  4528. },
  4529. notifySel(sel){
  4530. // console.log(sel);
  4531. this.notifySelList = sel
  4532. },
  4533. //微信通知人员填写
  4534. Notify(code) {
  4535. if (this.notifySelList.length == 0) return;
  4536. var ids = '';
  4537. this.notifySelList.forEach(f=>{
  4538. ids += f.id+',';
  4539. })
  4540. this.http.post('/user/pushFillReport',{
  4541. ids: ids, date: this.curDate,
  4542. code: code
  4543. },
  4544. res => {
  4545. if (res.code == "ok") {
  4546. this.$message({
  4547. message: this.$t('message.sentSuccessfully'),
  4548. type: "success"
  4549. });
  4550. }
  4551. },
  4552. error => {
  4553. this.$message({
  4554. message: error,
  4555. type: "error"
  4556. });
  4557. }
  4558. );
  4559. },
  4560. //导出人员列表
  4561. exportMemb() {
  4562. if (this.fillMembList.length == 0) return;
  4563. var ids = '';
  4564. this.fillMembList.forEach(f=>{
  4565. ids += f.id+',';
  4566. })
  4567. this.http.post('/user/exportMembList',{
  4568. ids: ids,isFill: this.isFill, date: this.curDate
  4569. },
  4570. res => {
  4571. if (res.code == "ok") {
  4572. var aTag = document.createElement('a');
  4573. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4574. aTag.href = res.data;
  4575. aTag.click();
  4576. }
  4577. },
  4578. error => {
  4579. this.$message({
  4580. message: error,
  4581. type: "error"
  4582. });
  4583. }
  4584. );
  4585. },
  4586. showMembList(fill) {
  4587. this.membListVisible = true;
  4588. if (fill == 0) {
  4589. this.fillMembList = this.unFillList;
  4590. this.isFill = false;
  4591. let leaveList = []
  4592. let unleaveList = []
  4593. for(let i in this.fillMembList){
  4594. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4595. leaveList.push(this.fillMembList[i])
  4596. }else{
  4597. unleaveList.push(this.fillMembList[i])
  4598. }
  4599. }
  4600. this.fillMembList = unleaveList
  4601. this.fillMembList_leave = leaveList
  4602. } else if(fill == 1){
  4603. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4604. this.isFill = true;
  4605. }else{
  4606. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4607. this.isFill = true;
  4608. }
  4609. },
  4610. //获取自己填写的日报状态
  4611. getReportFillStatus() {
  4612. this.http.post('/report/getReportFillStatus',{
  4613. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4614. },
  4615. res => {
  4616. if (res.code == "ok") {
  4617. this.fillStatusList = res.data;
  4618. this.allDate.forEach(d=>{
  4619. var fillInfo = null;
  4620. d.state = null;
  4621. this.fillStatusList.forEach(s=>{
  4622. var d1 = s.createDate.split('-')[2];
  4623. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4624. if (d1.indexOf('0') == 0) {
  4625. d1 = d1.substring(1,d1.length);
  4626. }
  4627. if (d1 == d2) {
  4628. d.state = s.state;
  4629. d.missReport = s.missReport;//是否漏填
  4630. d.exceedCardTime = s.exceedCardTime
  4631. }
  4632. })
  4633. })
  4634. this.$forceUpdate();
  4635. }
  4636. },
  4637. error => {
  4638. this.$message({
  4639. message: error,
  4640. type: "error"
  4641. });
  4642. }
  4643. );
  4644. },
  4645. scrollFunction () {
  4646. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4647. if (this.domObj.attachEvent) { // IE
  4648. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4649. } else if (this.domObj.addEventListener) {
  4650. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4651. }
  4652. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4653. },
  4654. mouseScroll(event) { // google 浏览器下
  4655. let detail = event.wheelDelta || event.detail
  4656. let moveForwardStep = -1
  4657. let moveBackStep = 1
  4658. let step = 0
  4659. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4660. event.preventDefault() // 阻止浏览器默认事件
  4661. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4662. },
  4663. // //左右滚动
  4664. // wheel(e){
  4665. // var a = document.getElementById("dateScroll");
  4666. // var scroll_width = 80; //滚动一下的距离
  4667. // var e = e || window.event, v;
  4668. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4669. // if(v>3||-v>3) v=-v;
  4670. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4671. // e.preventDefault(); //阻止浏览器的默认滚动
  4672. // },
  4673. showExportDialog() {
  4674. this.exportType = 0
  4675. this.exportDialog = true;
  4676. },
  4677. showExportTimeDialog() {
  4678. this.exportTimeDialog = true;
  4679. },
  4680. changeAllTime() {
  4681. //总时长发生改变,自动按比例计算
  4682. this.workForm.domains.forEach(d=>{
  4683. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4684. });
  4685. //计算jsTime
  4686. if (this.workForm.createDate) {
  4687. let sdate = new Date(this.workForm.createDate[0]);
  4688. let edate = new Date(this.workForm.createDate[1]);
  4689. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4690. if (days < 0) {
  4691. days = 0;
  4692. }
  4693. this.jsTime = this.reportTimeType.allday * days;
  4694. }
  4695. },
  4696. // 是否加班的单机事件
  4697. check() {
  4698. this.selected = !this.selected
  4699. this.isNew = this.selected
  4700. },
  4701. updateSubProject() {
  4702. this.$forceUpdate();
  4703. },
  4704. selectDegreeId(domain, index) {
  4705. this.http.post('/report/defaultDegree',{
  4706. projectId: domain.projectId
  4707. },
  4708. res => {
  4709. if (res.code == "ok") {
  4710. if(res.data) {
  4711. this.workForm.domains[index].degreeId = res.data.id + ''
  4712. this.$forceUpdate();
  4713. }
  4714. }
  4715. },
  4716. error => {
  4717. this.$message({
  4718. message: error,
  4719. type: "error"
  4720. });
  4721. }
  4722. );
  4723. },
  4724. //项目选中了, 加载子项目
  4725. selectProject(domain, index) {
  4726. if(!domain.projectId){
  4727. return;
  4728. }
  4729. // 默认选中上次填写的自定义维度
  4730. if(this.yonghuUser.customDegreeActive == 1) {
  4731. this.selectDegreeId(domain, index)
  4732. }
  4733. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4734. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4735. this.http.post('/sub-project/list',{
  4736. projectId: domain.projectId,
  4737. isReport: true
  4738. },
  4739. res => {
  4740. //清空之前选中的子项目
  4741. // this.workForm.domains[index].subProjectId = 0;
  4742. if (res.code == "ok") {
  4743. this.workForm.domains[index].subProjectList = res.data;
  4744. this.workForm.domains[index].subProjectId = null;
  4745. this.$forceUpdate();
  4746. }
  4747. },
  4748. error => {
  4749. this.$message({
  4750. message: error,
  4751. type: "error"
  4752. });
  4753. }
  4754. );
  4755. //项目相关的近期任务
  4756. if (this.user.company.packageProject == 1) {
  4757. this.getRecentTaskList(domain, index);
  4758. //获取项目相关专业
  4759. if (this.user.company.packageEngineering == 1) {
  4760. this.getProjectProfessions(domain, index);
  4761. }
  4762. //获取项目下的任务分组
  4763. this.getTaskGroups(domain, index);
  4764. }
  4765. // 获取项目相关的维度
  4766. // domain.degreeId = null
  4767. this.$set(domain,'degreeId',null)
  4768. this.$set(domain,'multiDegrIdArray',null)
  4769. this.dimension(domain, index);
  4770. //获取项目审核人
  4771. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4772. this.getProjectAuditorList(domain, index);
  4773. } else {
  4774. //按分组的负责人来审核
  4775. domain.projectAuditorId = null;
  4776. domain.projectAuditorName = null;
  4777. domain.auditUserList = null;
  4778. }
  4779. if (this.reportTimeType.type == 3) {
  4780. //新增项目时,自动计算
  4781. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4782. }
  4783. //加载昱众的工作职责
  4784. if (this.user.companyId == this.yuzhongCompId) {
  4785. this.updateResponse(domain);
  4786. }
  4787. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4788. if(reportExtraField4Name || reportExtraField5Name) {
  4789. this.getInfoByProjectId(domain, index)
  4790. }
  4791. },
  4792. getInfoByProjectId(domain, index, flag = true) {
  4793. const { projectId } = domain
  4794. const projectList = this.fillProjectList || this.subFillProjectList
  4795. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4796. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  4797. projectId: projectCode
  4798. },
  4799. res => {
  4800. if (res.code == "ok") {
  4801. if(flag) {
  4802. this.workForm.domains[index].extraField4 = ''
  4803. this.workForm.domains[index].extraField5 = ''
  4804. }
  4805. if((res.data.orderIds || []).length > 0) {
  4806. this.workForm.domains[index].extraField4 = res.data.orderIds[0]
  4807. }
  4808. this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
  4809. this.workForm.domains[index].reportExtraField5List = res.data.lines || []
  4810. this.$forceUpdate();
  4811. }
  4812. },
  4813. error => {
  4814. this.$message({
  4815. message: error,
  4816. type: "error"
  4817. });
  4818. }
  4819. );
  4820. },
  4821. getRecentTaskList(domain, index) {
  4822. //刷新任务时,清空服务
  4823. this.$set(domain, 'sapServiceId', null);
  4824. this.$set(domain, 'taskId', null);
  4825. var param = {
  4826. projectId: domain.projectId,
  4827. isSubstitude:this.isSubstitude?1:0,
  4828. };
  4829. if (domain.groupId) {
  4830. param.groupId = domain.groupId;
  4831. }
  4832. if (domain.stage) {
  4833. param.stage = domain.stage;
  4834. }
  4835. //专业版代填,获取代填员工的任务
  4836. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4837. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4838. this.$message({
  4839. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4840. type: "error"
  4841. });
  4842. return;
  4843. } else {
  4844. param.userId = this.workForm.userId[0];
  4845. }
  4846. }
  4847. this.http.post('/task/getRecentTask',param,
  4848. res => {
  4849. if (res.code == "ok") {
  4850. this.workForm.domains[index].allTaskList = res.data;
  4851. this.workForm.domains[index].taskList = res.data;
  4852. this.$forceUpdate();
  4853. }
  4854. },
  4855. error => {
  4856. this.$message({
  4857. message: error,
  4858. type: "error"
  4859. });
  4860. }
  4861. );
  4862. },
  4863. //获取项目审核人
  4864. getProjectAuditorList(domainItem, index) {
  4865. if(domainItem.projectId == '') {
  4866. return
  4867. }
  4868. domainItem.projectAuditorId = null;
  4869. domainItem.projectAuditorName = null;
  4870. var param = { projectId: domainItem.projectId};
  4871. if (this.isSubstitude) {
  4872. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4873. param.userId = this.workForm.userId[0];
  4874. }
  4875. }
  4876. this.http.post('/project-auditor/getList',param,
  4877. res => {
  4878. if (res.code == "ok") {
  4879. domainItem.auditUserList = res.data;
  4880. if (res.data.length==0) {
  4881. this.$message({
  4882. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4883. type: "error"
  4884. });
  4885. } else if (res.data.length==1) {
  4886. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4887. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4888. }
  4889. this.$forceUpdate();
  4890. }
  4891. },
  4892. error => {
  4893. this.$message({
  4894. message: error,
  4895. type: "error"
  4896. });
  4897. }
  4898. );
  4899. },
  4900. // 获取维度数据
  4901. dimension(domain, index) {
  4902. if(domain.projectId == '') {
  4903. return
  4904. }
  4905. this.http.post('/project/getDegreeList',{
  4906. projectId: domain.projectId,
  4907. },
  4908. res => {
  4909. if (res.code == "ok") {
  4910. // console.log("维度数据",res.data);
  4911. this.workForm.domains[index].wuduList = res.data
  4912. // this.workForm = this.workForm
  4913. this.$forceUpdate()
  4914. }
  4915. },
  4916. error => {
  4917. this.$message({
  4918. message: error,
  4919. type: "error"
  4920. });
  4921. }
  4922. );
  4923. },
  4924. //切换任务阶段
  4925. changeStages(domain, index) {
  4926. if (domain.stage == null || domain.stage == '') {
  4927. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4928. } else {
  4929. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4930. }
  4931. this.getRecentTaskList(domain, index);
  4932. this.$forceUpdate();
  4933. },
  4934. getGroupStages(domain, index, keepStage) {
  4935. // console.log(domain);
  4936. if(!domain.groupId){
  4937. domain.projectAuditorId = ''
  4938. domain.stages = []
  4939. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4940. domain.taskId = ''
  4941. domain.sapServiceId = ''
  4942. }
  4943. if(this.user.timeType.reportAuditType >= 1){
  4944. domain.auditUserList = []
  4945. }
  4946. this.$forceUpdate();
  4947. return
  4948. }
  4949. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4950. res => {
  4951. if (res.code == "ok") {
  4952. if (!keepStage) {
  4953. domain.stage = '';
  4954. }
  4955. domain.stages = res.data;
  4956. this.getRecentTaskList(domain, index);
  4957. this.$forceUpdate();
  4958. }
  4959. },
  4960. error => {
  4961. this.$message({
  4962. message: error,
  4963. type: "error"
  4964. });
  4965. });
  4966. //检查当前的项目是否需要获取分组的负责人
  4967. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4968. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4969. res => {
  4970. if (res.code == "ok") {
  4971. domain.getProjectAuditorList = res.data;
  4972. domain.auditUserList = res.data;
  4973. if (res.data.length==1) {
  4974. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4975. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4976. } else if (res.data.length==0) {
  4977. domain.projectAuditorId = null;
  4978. domain.projectAuditorName = null;
  4979. }
  4980. this.$forceUpdate();
  4981. }
  4982. },
  4983. error => {
  4984. this.$message({
  4985. message: error,
  4986. type: "error"
  4987. });
  4988. });
  4989. }
  4990. },
  4991. getProjectProfessions(domain, index) {
  4992. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4993. res => {
  4994. if (res.code == "ok") {
  4995. this.workForm.domains[index].professionProgress = res.data;
  4996. this.$forceUpdate();
  4997. }
  4998. },
  4999. error => {
  5000. this.$message({
  5001. message: error,
  5002. type: "error"
  5003. });
  5004. });
  5005. },
  5006. //删除自己的日报
  5007. deleteReport() {
  5008. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5009. confirmButtonText: this.$t('btn.determine'),
  5010. cancelButtonText: this.$t('btn.cancel'),
  5011. type: "warning"
  5012. })
  5013. .then(() => {
  5014. this.listLoading = true;
  5015. this.http.post('/report/delete',{
  5016. userId: this.user.id,
  5017. date: this.workForm.createDate
  5018. },
  5019. res => {
  5020. this.listLoading = false;
  5021. if (res.code == "ok") {
  5022. this.$message({
  5023. message: this.$t('message.successfullyDeleted'),
  5024. type: "success"
  5025. });
  5026. this.getReportList();
  5027. this.getDepartment();
  5028. this.dialogVisible = false;
  5029. } else {
  5030. this.$message({
  5031. message: res.msg,
  5032. type: "error"
  5033. });
  5034. }
  5035. },
  5036. error => {
  5037. this.listLoading = false;
  5038. this.$message({
  5039. message: error,
  5040. type: "error"
  5041. });
  5042. }
  5043. );
  5044. })
  5045. .catch(() => {});
  5046. },
  5047. // 管理员删除日报
  5048. guanli(item) {
  5049. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5050. let param = {date: this.date + day, userId: item.id};
  5051. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5052. confirmButtonText: this.$t('btn.determine'),
  5053. cancelButtonText: this.$t('btn.cancel'),
  5054. type: "warning"
  5055. })
  5056. .then(() => {
  5057. this.listLoading = true;
  5058. this.http.post('/report/delete',param,
  5059. res => {
  5060. this.listLoading = false;
  5061. if (res.code == "ok") {
  5062. this.$message({
  5063. message: this.$t('message.successfullyDeleted'),
  5064. type: "success"
  5065. });
  5066. this.getReportList();
  5067. this.getDepartment();
  5068. this.dialogVisible = false;
  5069. } else {
  5070. this.$message({
  5071. message: res.msg,
  5072. type: "error"
  5073. });
  5074. }
  5075. },
  5076. error => {
  5077. this.listLoading = false;
  5078. this.$message({
  5079. message: error,
  5080. type: "error"
  5081. });
  5082. }
  5083. );
  5084. })
  5085. .catch(() => {});
  5086. },
  5087. selectAll() {
  5088. if (this.isAllSelect) {
  5089. var keys = [];
  5090. this.reportNames.forEach(b=>{
  5091. keys.push(b.id);
  5092. })
  5093. this.$refs.approveTree.setCheckedKeys(keys);
  5094. } else {
  5095. this.$refs.approveTree.setCheckedKeys([]);
  5096. }
  5097. },
  5098. removeEmptyNode(list) {
  5099. for (var i=0;i<list.length;i++) {
  5100. var cnt = 0;
  5101. if (list[i].membCount == 0) {
  5102. list.splice(i, 1);
  5103. i--;
  5104. } else if (list[i].children != null) {
  5105. this.removeEmptyNode(list[i].children);
  5106. }
  5107. }
  5108. },
  5109. calculateMembCount(list) {
  5110. for (var i in list) {
  5111. var cnt = 0;
  5112. if (list[i].children != null) {
  5113. this.calculateMembCount(list[i].children);
  5114. for (var m in list[i].children) {
  5115. cnt += list[i].children[m].membCount;
  5116. }
  5117. }
  5118. if (list[i].isUser == 1) {
  5119. cnt++;
  5120. this.membCount++;
  5121. }
  5122. list[i].membCount = cnt;
  5123. }
  5124. },
  5125. stateChange() {
  5126. // console.log(this.allData,'alldate');
  5127. this.membCount = 0;
  5128. if (this.selectState == -1) {
  5129. //全部状态
  5130. this.data = this.allData;
  5131. } else {
  5132. //未填报
  5133. this.seluserText = ''
  5134. var newData = JSON.parse(JSON.stringify(this.allData));
  5135. this.filterState(this.selectState, newData);
  5136. this.data = newData;
  5137. }
  5138. this.calculateMembCount(this.data);
  5139. this.data[0].membCount = this.membCount;//总人数
  5140. },
  5141. //按状态过滤部门人员
  5142. filterState(state, list) {
  5143. for (var i =0;i<list.length; i++) {
  5144. var obj = list[i];
  5145. if (obj.isUser == 1) {
  5146. var match = false;
  5147. if (state == -2) {
  5148. if (obj.state == null) {
  5149. match = true;
  5150. }
  5151. } else {
  5152. if (obj.state == state) {
  5153. match = true;
  5154. }
  5155. }
  5156. if (!match) {
  5157. list.splice(i, 1);
  5158. i--;
  5159. } else {
  5160. }
  5161. } else {
  5162. if (obj.children != null) {
  5163. this.filterState(state, obj.children);
  5164. }
  5165. }
  5166. }
  5167. },
  5168. //a按名称过滤部门人员
  5169. async seluserforText(){
  5170. const { userNameNeedTranslate } = this.user
  5171. this.membCount = 0;
  5172. var newData = JSON.parse(JSON.stringify(this.allData));
  5173. let textList = [this.seluserText]
  5174. if(userNameNeedTranslate == 1) {
  5175. this.dataLoading = true
  5176. let res = await this.postData('/user/getEmployeeList', {
  5177. keyword: this.seluserText,
  5178. cursor: '',
  5179. departmentId: -1,
  5180. pageIndex: 1,
  5181. pageSize: 1000
  5182. })
  5183. textList = res.data.records.map(item => item.name)
  5184. this.dataLoading = false
  5185. }
  5186. // return
  5187. this.seluserforTextin(this.seluserText, newData, textList)
  5188. this.data = newData;
  5189. this.calculateMembCount(this.data);
  5190. this.data[0].membCount = this.membCount;//总人数
  5191. },
  5192. seluserforTextin(text, list, textList = []){
  5193. for (var i =0;i<list.length; i++) {
  5194. var obj = list[i];
  5195. if (obj.isUser == 1) {
  5196. var match = false;
  5197. // if (obj.label.indexOf(text) != -1) {
  5198. // match = true
  5199. // }
  5200. if(textList.some(item => item.includes(obj.label))) {
  5201. match = true
  5202. }
  5203. if (!match) {
  5204. list.splice(i, 1);
  5205. i--;
  5206. } else {
  5207. }
  5208. } else {
  5209. if (obj.children != null) {
  5210. this.seluserforTextin(text, obj.children, textList);
  5211. }
  5212. }
  5213. }
  5214. },
  5215. // 当节点发生变化时
  5216. nodeChangeExpand(data) {
  5217. // 保存当前展开的节点
  5218. let flag = false
  5219. this.nodeModelData.some(item => {
  5220. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5221. flag = true
  5222. return true
  5223. }
  5224. })
  5225. if (!flag) { // 不存在则存到数组里
  5226. this.nodeModelData.push(data.id)
  5227. }
  5228. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5229. },
  5230. nodeChangeCollapse(data) {
  5231. this.nodeModelData.some((item, i) => {
  5232. if (item === data.id) {
  5233. this.nodeModelData.length = i
  5234. }
  5235. })
  5236. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5237. },
  5238. // 部门列表点击
  5239. handleNodeClick(data) {
  5240. // this.dealList = data
  5241. this.theValues(data.id, this.allData)
  5242. // this.depData = data;
  5243. var list = [];
  5244. if (data.id == -1) {
  5245. this.deptId = null;
  5246. this.targetUid = null;
  5247. list = this.data;
  5248. } else if (data.isUser == 1) {
  5249. this.deptId = null;
  5250. this.targetUid = data.id;
  5251. } else {
  5252. this.deptId = data.id;
  5253. this.targetUid = null;
  5254. list.push(data);
  5255. }
  5256. this.getReportList();
  5257. if (list.length > 0) {
  5258. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5259. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5260. }
  5261. },
  5262. exportPushLog(){
  5263. this.http.post('/sap-sync-log/export',{},
  5264. res => {
  5265. if (res.code == "ok") {
  5266. var filePath = res.data;
  5267. var fName = '推送日志.xlsx'
  5268. const a = document.createElement('a'); // 创建a标签
  5269. a.setAttribute('download', fName);// download属性
  5270. a.setAttribute('href', filePath);// href链接
  5271. a.click(); //自执行点击事件
  5272. a.remove();
  5273. } else {
  5274. this.$message({
  5275. message: res.msg,
  5276. type: "error"
  5277. });
  5278. }
  5279. },
  5280. error => {
  5281. this.$message({
  5282. message: error,
  5283. type: "error"
  5284. });
  5285. });
  5286. },
  5287. theValues(id, item) {
  5288. for(var i in item) {
  5289. if(item[i].id == id) {
  5290. this.depData = item[i]
  5291. if(id == '-1') {
  5292. this.translation = '1'
  5293. } else {
  5294. if(item[i].children) {
  5295. this.translation = '2'
  5296. } else {
  5297. this.translation = '3'
  5298. }
  5299. }
  5300. return
  5301. } else {
  5302. if(item[i].children) {
  5303. this.theValues(id, item[i].children)
  5304. }
  5305. }
  5306. }
  5307. },
  5308. //获取可以选择的代填的人员列表
  5309. getSubstitudeUserDeptList() {
  5310. if (this.deptMembData.length == 0) {
  5311. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5312. res => {
  5313. if (res.code == "ok") {
  5314. let noAllData = JSON.parse(JSON.stringify(res.data));
  5315. if (noAllData.length > 0) {
  5316. // if (noAllData[0].label == '全部人员') {
  5317. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5318. noAllData.splice(0,1);
  5319. }
  5320. }
  5321. this.setUserToDept(noAllData);
  5322. this.deptMembData = noAllData;
  5323. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5324. } else {
  5325. this.$message({
  5326. message: res.msg,
  5327. type: "error"
  5328. });
  5329. }
  5330. },
  5331. error => {
  5332. this.$message({
  5333. message: error,
  5334. type: "error"
  5335. });
  5336. });
  5337. }
  5338. },
  5339. // 获取部门列表
  5340. getDepartmentForApprove() {
  5341. this.http.post( this.port.manage.depList, {},
  5342. res => {
  5343. if (res.code == "ok") {
  5344. var list1 = JSON.parse(JSON.stringify(res.data));
  5345. this.deptOptionList = this.changeArr(list1);
  5346. } else {
  5347. this.$message({
  5348. message: res.msg,
  5349. type: "error"
  5350. });
  5351. }
  5352. },
  5353. error => {
  5354. this.$message({
  5355. message: error,
  5356. type: "error"
  5357. });
  5358. });
  5359. },
  5360. // 获取部门列表
  5361. getDepartment() {
  5362. //如果没有权限,就不需要获取
  5363. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5364. return;
  5365. }
  5366. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5367. var param = {date:this.date + day};
  5368. this.http.post("/report/getMembList", param,
  5369. res => {
  5370. if (res.code == "ok") {
  5371. if(res.data.length == 0){
  5372. return
  5373. }
  5374. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5375. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5376. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5377. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5378. // if (this.user.role > 0) {
  5379. // }
  5380. list.splice(0,0,{
  5381. id: -1,
  5382. label: this.$t('lable.allStaff'),
  5383. })
  5384. this.membCount = 0;
  5385. //设置员工到部门下面
  5386. this.setUserToDept(list);
  5387. this.data = list;
  5388. // console.log('data',this.data);
  5389. this.expandDate = [this.data[1].id]
  5390. this.allData = list;
  5391. // if (noAllData.length > 0) {
  5392. // if (noAllData[0].label == '全部人员') {
  5393. // noAllData.splice(0,1);
  5394. // }
  5395. // }
  5396. // this.setUserToDept(noAllData);
  5397. // this.deptMembData = noAllData;
  5398. this.option = this.changeArr(list1);
  5399. list[0].membCount = this.membCount;
  5400. if (this.depData.id == -1) {
  5401. this.depData.membCount = this.membCount;
  5402. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5403. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5404. } else {
  5405. if (this.depData.isUser == null) {
  5406. var dep = this.findTargetDept(this.data, this.depData.id);
  5407. var membDeptList = [];
  5408. membDeptList.push(dep);
  5409. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5410. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5411. }
  5412. }
  5413. if (this.depData.isUser == null) {
  5414. if (this.isFill) {
  5415. this.fillMembList = this.fillList;
  5416. } else {
  5417. this.fillMembList = this.unFillList;
  5418. }
  5419. }
  5420. this.leaveAllNum = 0
  5421. for(let i in this.unFillList){
  5422. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5423. this.leaveAllNum += 1
  5424. }
  5425. }
  5426. this.stateChange()
  5427. } else {
  5428. this.$message({
  5429. message: res.msg,
  5430. type: "error"
  5431. });
  5432. }
  5433. },
  5434. error => {
  5435. this.$message({
  5436. message: error,
  5437. type: "error"
  5438. });
  5439. });
  5440. this.getReportFillStatus();
  5441. },
  5442. findTargetDept(list, deptId) {
  5443. var t = null;
  5444. for (var i=0;i<list.length; i++) {
  5445. if (list[i].isUser == null && list[i].id == deptId) {
  5446. t = list[i];
  5447. break;
  5448. }
  5449. }
  5450. if (t == null) {
  5451. for (var i=0;i<list.length; i++) {
  5452. if (list[i].children != null && list[i].children.length > 0) {
  5453. t = this.findTargetDept(list[i].children, deptId);
  5454. if (t != null) {
  5455. break;
  5456. }
  5457. }
  5458. }
  5459. }
  5460. return t;
  5461. },
  5462. getUserMembListFromDeptList(list, isFill) {
  5463. var membList = [];
  5464. for (var i in list) {
  5465. var deptName = list[i].label;
  5466. if (list[i].userList != null) {
  5467. list[i].userList.forEach(element => {
  5468. if (isFill == 0) {
  5469. //获取未填的
  5470. if (element.state == null) {
  5471. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5472. membList.push(obj);
  5473. }
  5474. } else {
  5475. if (element.state != null) {
  5476. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5477. membList.push(obj);
  5478. }
  5479. }
  5480. });
  5481. }
  5482. if (list[i].children != null) {
  5483. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5484. }
  5485. }
  5486. return membList;
  5487. },
  5488. setUserToDept(list) {
  5489. for (var i in list) {
  5490. var cnt = 0;
  5491. if (list[i].children != null) {
  5492. this.setUserToDept(list[i].children);
  5493. for (var m in list[i].children) {
  5494. cnt += list[i].children[m].membCount;
  5495. }
  5496. }
  5497. if (list[i].userList != null) {
  5498. if (list[i].children == null) {
  5499. list[i].children = [];
  5500. }
  5501. list[i].userList.forEach(element => {
  5502. var obj = {
  5503. id: element.id,
  5504. label:element.name,
  5505. state:element.state,
  5506. parentId:element.departmentId,
  5507. isUser:1,
  5508. workingTime: element.workingTime,
  5509. leaveDays: element.leaveDays,
  5510. leaveTimes: element.leaveTimes
  5511. };
  5512. list[i].children.push(obj);
  5513. this.membCount++;
  5514. cnt++;
  5515. });
  5516. }
  5517. list[i].membCount = cnt;
  5518. }
  5519. },
  5520. // 修改数组
  5521. changeArr(arr) {
  5522. for (var i = 0; i < arr.length; i++) {
  5523. if(arr[i].id != -1 && arr[i].id != 0) {
  5524. if (arr[i].children != null && arr[i].children.length>0) {
  5525. arr[i].children = this.changeArr(arr[i].children);
  5526. }
  5527. arr[i].id && (arr[i].value = arr[i].id);
  5528. delete arr[i].id;
  5529. }
  5530. }
  5531. for(var i in arr) {
  5532. if(arr[i].id == -1 || arr[i].id == 0) {
  5533. arr.splice(i,1)
  5534. }
  5535. }
  5536. return arr;
  5537. },
  5538. //时间段范围设置改动,监听
  5539. onTimeTypeChange(timeType) {
  5540. this.seleChn(1)
  5541. this.showAddMore = true;
  5542. for(var i in this.workForm.domains) {
  5543. if (this.workForm.domains[i].timeType == 0) {
  5544. this.showAddMore = false;
  5545. break;
  5546. }
  5547. }
  5548. if (this.showAddMore) {
  5549. //检测数量
  5550. if (this.workForm.domains.length == 2) {
  5551. this.showAddMore = false;
  5552. } else {
  5553. this.showAddMore = true;
  5554. }
  5555. }
  5556. },
  5557. getTimeType() {
  5558. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5559. res => {
  5560. if (res.code == "ok") {
  5561. var t = res.data;
  5562. this.reportTimeType = t;
  5563. if (this.reportTimeType.type > 0) {
  5564. this.showAddMore = true;
  5565. }
  5566. //转化时间格式
  5567. if (t.allday != null) {
  5568. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5569. }
  5570. if (t.am != null) {
  5571. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5572. }
  5573. if (t.pm != null) {
  5574. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5575. }
  5576. let arr = []
  5577. for(var i in res.data.excludeTimeList) {
  5578. let obj = {
  5579. s: res.data.excludeTimeList[i].startTime,
  5580. e: res.data.excludeTimeList[i].endTime,
  5581. }
  5582. arr.push(obj)
  5583. }
  5584. this.vacationTime = arr
  5585. } else {
  5586. this.$message({
  5587. message: res.msg,
  5588. type: "error"
  5589. });
  5590. }
  5591. },
  5592. error => {
  5593. this.listLoading = false;
  5594. this.$message({
  5595. message: error,
  5596. type: "error"
  5597. });
  5598. });
  5599. },
  5600. // 改变月份 -------
  5601. changeMonthOut() {
  5602. this.getAllDate();
  5603. this.getReportList();
  5604. this.getDepartment();
  5605. },
  5606. // 选择日期
  5607. choseDate(i, item) {
  5608. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5609. return
  5610. }
  5611. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5612. this.choseDay = i;
  5613. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5614. sessionStorage.msg = this.date + day,
  5615. this.getReportList();
  5616. this.getDepartment();
  5617. this.curDate = item.date;
  5618. },
  5619. canClick(i, item){
  5620. let nowDate = new Date()
  5621. let nowDateYear = nowDate.getFullYear()
  5622. let itemYear = parseInt(this.date.split('-')[0])
  5623. let nowDateMonth = nowDate.getMonth() + 1
  5624. let itemMonth = parseInt(this.date.split('-')[1])
  5625. let nowDateDay = nowDate.getDate()
  5626. let itemDay = parseInt(item.showDate.split('.')[1])
  5627. if(nowDateYear < itemYear){
  5628. return false
  5629. }else if(nowDateYear == itemYear){
  5630. if(nowDateMonth < itemMonth){
  5631. return false
  5632. }else if(nowDateMonth == itemMonth){
  5633. if(nowDateDay < itemDay){
  5634. return false
  5635. }
  5636. }
  5637. }
  5638. },
  5639. // 获取日期列表
  5640. getAllDate(e) {
  5641. var dayArry = [];
  5642. var day = this.getCountDays();
  5643. let curMonthDay = null;
  5644. for (var k = 1; k <= day; k++) {
  5645. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5646. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5647. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5648. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5649. if(sessionStorage.msg) {
  5650. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5651. this.choseDay = k - 1;
  5652. curMonthDay = str;
  5653. }
  5654. } else {
  5655. if (new Date().getDate() == k) {
  5656. this.choseDay = k - 1;
  5657. }
  5658. }
  5659. } else {
  5660. this.choseDay = 0;
  5661. }
  5662. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5663. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5664. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5665. }
  5666. this.allDate = dayArry;
  5667. //不能超过最大日期
  5668. if (this.choseDay > day-1) {
  5669. this.choseDay = day-1;
  5670. }
  5671. if(sessionStorage.from != 1){
  5672. let nowmonth = new Date().getMonth() + 1
  5673. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5674. let nowdate = new Date().getDate()
  5675. if(nowd == this.date){
  5676. if(e && sessionStorage.msg){
  5677. }else{
  5678. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5679. }
  5680. let nowday = new Date(sessionStorage.msg).getDate()
  5681. this.choseDay = nowday - 1
  5682. let monthdate = new Date(sessionStorage.msg)
  5683. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5684. }else{
  5685. if(e && sessionStorage.msg){
  5686. }else{
  5687. sessionStorage.msg = this.date + '-01'
  5688. }
  5689. let monthdate = new Date(sessionStorage.msg)
  5690. this.choseDay = monthdate.getDate() - 1
  5691. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5692. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5693. }
  5694. }else{
  5695. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5696. }
  5697. //从消息点击跳转过来的,直接加载指定日期
  5698. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5699. this.curDate = sessionStorage.msg;
  5700. sessionStorage.from = 0;
  5701. } else {
  5702. // if (curMonthDay != null) {
  5703. // // this.curDate = curMonthDay;
  5704. // let d = new Date(sessionStorage.msg)
  5705. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5706. // } else {
  5707. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5708. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5709. // }
  5710. }
  5711. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5712. // if(!sessionStorage.msg){
  5713. // let msgday = this.choseDay + 1
  5714. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5715. // }
  5716. this.getReportFillStatus();
  5717. },
  5718. getCountDays() {
  5719. var newstr = this.date.replace(/-/g, "/");
  5720. var curDate = new Date(newstr+'/01');
  5721. var curMonth = curDate.getMonth();
  5722. curDate.setMonth(curMonth + 1);
  5723. curDate.setDate(0);
  5724. return curDate.getDate();
  5725. },
  5726. reqMore() {
  5727. if (this.hasMore) {
  5728. this.pageIndex++;
  5729. this.requestHttpReports();
  5730. }
  5731. },
  5732. //加载日报数据
  5733. requestHttpReports() {
  5734. //请求数据
  5735. this.listLoading = true;
  5736. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5737. let param = {date: this.date + day};
  5738. if (this.deptId) {
  5739. param.deptId = this.deptId;
  5740. }
  5741. if (this.targetUid) {
  5742. param.userId = this.targetUid;
  5743. }
  5744. //传页码
  5745. if (this.hasMore) {
  5746. param.pageIndex = this.pageIndex;
  5747. }
  5748. this.http.post( this.port.report.list, param,
  5749. res => {
  5750. this.listLoading = false;
  5751. if (res.code == "ok") {
  5752. //扩增
  5753. if (res.data.data.length > 0) {
  5754. this.reportList = this.reportList.concat(res.data.data);
  5755. } else if (this.pageIndex > 1){
  5756. this.$message({
  5757. message: this.$t('meiYouGengDuoShuJuLe'),
  5758. type: "info"
  5759. });
  5760. }
  5761. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5762. if(document.querySelector("#day"+this.choseDay)){
  5763. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5764. }
  5765. } else {
  5766. this.$message({
  5767. message: res.msg,
  5768. type: "error"
  5769. });
  5770. }
  5771. },
  5772. error => {
  5773. this.listLoading = false;
  5774. this.$message({
  5775. message: error,
  5776. type: "error"
  5777. });
  5778. });
  5779. },
  5780. //获取日报列表
  5781. getReportList() {
  5782. //初始化,重置数据
  5783. this.pageIndex = 0;
  5784. this.hasMore = true;
  5785. this.reportList = [];
  5786. this.requestHttpReports();
  5787. },
  5788. //刷新日报状态,用于审核后更新
  5789. refreshReportData(reportId) {
  5790. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5791. res => {
  5792. if (res.code == "ok") {
  5793. for (var m=0;m<this.reportList.length; m++) {
  5794. var d = this.reportList[m].data;
  5795. var find = d.filter(r=>r.id == reportId);
  5796. if (find.length > 0) {
  5797. find[0].state = res.data.state;
  5798. if (find[0].state == 2) {//被驳回,要可以编辑
  5799. this.reportList[m].state = 2;
  5800. }
  5801. find[0].isDeptAudit = res.data.isDeptAudit;
  5802. find[0].departmentAuditState = res.data.departmentAuditState;
  5803. find[0].projectAuditorName = res.data.projectAuditorName;
  5804. find[0].projectAuditorId = res.data.projectAuditorId;
  5805. find[0].projectAuditState = res.data.projectAuditState;
  5806. find[0].rejectUserid = res.data.rejectUserid;
  5807. find[0].rejectUsername = res.data.rejectUsername;
  5808. find[0].rejectReason = res.data.rejectReason;
  5809. this.$forceUpdate();
  5810. break;
  5811. }
  5812. }
  5813. } else {
  5814. this.$message({
  5815. message: res.msg,
  5816. type: "error"
  5817. });
  5818. }
  5819. },
  5820. error => {
  5821. this.listLoading = false;
  5822. this.$message({
  5823. message: error,
  5824. type: "error"
  5825. });
  5826. });
  5827. },
  5828. //导出员工工时统计
  5829. exportUserTime() {
  5830. this.listLoading = true;
  5831. var param = {};
  5832. if (this.exportParam.dateRange != null) {
  5833. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5834. }
  5835. this.http.post('/department/exportDeptStatistic', param,
  5836. res => {
  5837. this.listLoading = false;
  5838. if (res.code == "ok") {
  5839. location.href = res.data;
  5840. this.exportTimeDialog = false;
  5841. } else {
  5842. this.$message({
  5843. message: res.msg,
  5844. type: "error"
  5845. });
  5846. }
  5847. },
  5848. error => {
  5849. this.listLoading = false;
  5850. this.$message({
  5851. message: error,
  5852. type: "error"
  5853. });
  5854. });
  5855. },
  5856. //导出日报
  5857. exportReport() {
  5858. this.exportingData = true;
  5859. var param = {};
  5860. if (this.exportParam.dateRange != null) {
  5861. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5862. }
  5863. if (this.exportParam.projectId != null) {
  5864. param.projectId = this.exportParam.projectId;
  5865. }
  5866. if (this.exportParam.departmentId != null) {
  5867. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5868. param.departmentIds = this.exportParam.departmentId.join(',')
  5869. }
  5870. param.stateKey = this.stateKey
  5871. // param.departmentId = this.user.departmentId
  5872. this.http.post(this.port.report.export, param,
  5873. res => {
  5874. this.exportingData = false;
  5875. if (res.code == "ok") {
  5876. var filePath = res.data;
  5877. const a = document.createElement('a'); // 创建a标签
  5878. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5879. a.setAttribute('href', filePath);// href链接
  5880. a.click(); //自执行点击事件
  5881. a.remove();
  5882. this.exportDialog = false;
  5883. } else {
  5884. this.$message({
  5885. message: res.msg,
  5886. type: "error"
  5887. });
  5888. }
  5889. },
  5890. error => {
  5891. this.exportingData = false;
  5892. this.$message({
  5893. message: error,
  5894. type: "error"
  5895. });
  5896. });
  5897. },
  5898. //导出日报审核记录
  5899. exportReportLog() {
  5900. this.exportingData = true;
  5901. var param = {};
  5902. if (this.exportReportLogParam.dateRange != null) {
  5903. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5904. }
  5905. this.http.post('/report-log/exportReportLog', param,
  5906. res => {
  5907. this.exportingData = false;
  5908. if (res.code == "ok") {
  5909. var filePath = res.data;
  5910. const a = document.createElement('a'); // 创建a标签
  5911. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5912. a.setAttribute('href', filePath);// href链接
  5913. a.click(); //自执行点击事件
  5914. a.remove();
  5915. this.exportDialog = false;
  5916. } else {
  5917. this.$message({
  5918. message: res.msg,
  5919. type: "error"
  5920. });
  5921. }
  5922. },
  5923. error => {
  5924. this.exportingData = false;
  5925. this.$message({
  5926. message: error,
  5927. type: "error"
  5928. });
  5929. });
  5930. },
  5931. restUserCardTime(item){
  5932. let param={}
  5933. param.userId=item.userId
  5934. param.createDate=item.createDate
  5935. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5936. res => {
  5937. if (res.code == "ok") {
  5938. this.showMonthWorkTimeReminder()
  5939. } else {
  5940. this.$message({
  5941. message: res.msg,
  5942. type: "error"
  5943. });
  5944. }
  5945. },
  5946. error => {
  5947. this.$message({
  5948. message: error,
  5949. type: "error"
  5950. });
  5951. });
  5952. },
  5953. importReportLog(item){
  5954. //首先判断文件类型
  5955. let str = item.file.name.split(".");
  5956. let format = str[str.length - 1];
  5957. if (format != "xls" && format != "xlsx") {
  5958. this.$message({
  5959. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5960. type: "error"
  5961. });
  5962. } else {
  5963. const loading = this.$loading({
  5964. lock: true,
  5965. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5966. spinner: 'el-icon-loading',
  5967. background: 'rgba(0, 0, 0, 0.7)'
  5968. });
  5969. let formData = new FormData();
  5970. formData.append("multipartFile", item.file);
  5971. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5972. res => {
  5973. this.$refs.upload.clearFiles();
  5974. loading.close();
  5975. if (res.code == "ok") {
  5976. this.$message({
  5977. message: res.msg,
  5978. type: "success"
  5979. });
  5980. } else {
  5981. this.$message({
  5982. message: res.msg,
  5983. type: "error"
  5984. });
  5985. }
  5986. },
  5987. error => {
  5988. this.$refs.upload.clearFiles();
  5989. loading.close();
  5990. this.$message({
  5991. message: error,
  5992. type: "error"
  5993. });
  5994. });
  5995. }
  5996. },
  5997. //获取项目列表
  5998. getProjectList() {
  5999. this.listLoading = true;
  6000. this.http.post( this.port.project.list, {},
  6001. res => {
  6002. this.listLoading = false;
  6003. if (res.code == "ok") {
  6004. for(var i in res.data) {
  6005. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6006. res.data[i].projectCode = ''
  6007. }
  6008. }
  6009. this.projectList = res.data;
  6010. } else {
  6011. this.$message({
  6012. message: res.msg,
  6013. type: "error"
  6014. });
  6015. }
  6016. },
  6017. error => {
  6018. this.listLoading = false;
  6019. this.$message({
  6020. message: error,
  6021. type: "error"
  6022. });
  6023. });
  6024. },
  6025. getSubUsersFillProjectList(userId) {
  6026. this.http.post( this.port.project.list, {
  6027. forReport: 1,
  6028. userId: userId
  6029. },res => {
  6030. if (res.code == "ok") {
  6031. for(var i in res.data) {
  6032. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6033. res.data[i].projectCode = ''
  6034. }
  6035. }
  6036. this.subFillProjectList = res.data;
  6037. this.getRecentlyProject(userId)
  6038. } else {
  6039. this.$message({
  6040. message: res.msg,
  6041. type: "error"
  6042. });
  6043. }
  6044. },
  6045. error => {
  6046. this.$message({
  6047. message: error,
  6048. type: "error"
  6049. });
  6050. });
  6051. },
  6052. // 获取填报日报的项目下拉列表
  6053. getFillProjectList() {
  6054. this.http.post( this.port.project.list, {
  6055. forReport: 1
  6056. },res => {
  6057. if (res.code == "ok") {
  6058. for(var i in res.data) {
  6059. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6060. res.data[i].projectCode = ''
  6061. }
  6062. }
  6063. this.fillProjectList = res.data;
  6064. this.getRecentlyProject()
  6065. } else {
  6066. this.$message({
  6067. message: res.msg,
  6068. type: "error"
  6069. });
  6070. }
  6071. },
  6072. error => {
  6073. this.$message({
  6074. message: error,
  6075. type: "error"
  6076. });
  6077. });
  6078. },
  6079. //自己填写日报时,刷新到自己的可填报日报列表
  6080. refreshToMyReportProjectList() {
  6081. this.getRecentlyProject();
  6082. },
  6083. getBasecostItemList() {
  6084. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6085. companyId: this.user.companyId
  6086. },
  6087. res => {
  6088. if (res.code == "ok") {
  6089. this.timeBasecostList = res.data;
  6090. }
  6091. });
  6092. },
  6093. getAIReport(createDate) {
  6094. this.http.post('/report/getAIReport', {},
  6095. res => {
  6096. if (res.code == "ok") {
  6097. var quanbu = 0
  6098. this.jsDay = 1
  6099. var zhi = ''
  6100. var slp = res.data
  6101. for(var i in slp) {
  6102. var sp = +slp[i].workingTime + 0
  6103. zhi = this.jsDay * sp
  6104. quanbu = +quanbu + zhi
  6105. }
  6106. this.jsTime = quanbu
  6107. var aiReportData = res.data;
  6108. this.canCancelInDialog = false
  6109. if(aiReportData.length != 0) {
  6110. var arr = [];
  6111. for(var i in aiReportData) {
  6112. arr.push({
  6113. id: null,
  6114. projectId: aiReportData[i].projectId,
  6115. workingTime: aiReportData[i].workingTime,
  6116. content: '',
  6117. progress:100,
  6118. state: 2,
  6119. timeType: aiReportData[i].timeType,
  6120. subProjectList: aiReportData[i].subProjectList,
  6121. taskList: aiReportData[i].taskList,
  6122. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6123. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6124. taskId: aiReportData[i].taskId,
  6125. startTime: aiReportData[i].startTime,
  6126. endTime: aiReportData[i].endTime,
  6127. isOvertime: 0,
  6128. progress:aiReportData[i].progress,
  6129. professionProgress: aiReportData[i].professionProgressList,
  6130. stages:aiReportData[i].stages,
  6131. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6132. pics: null,
  6133. multiWorktime: aiReportData[i].multiWorktime || 0,
  6134. worktimeList: [{}],
  6135. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6136. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6137. wuduList: aiReportData[i].degreeList,
  6138. taskGroups:aiReportData[i].taskGroups,
  6139. customData: aiReportData[i].customData,//自定义的数值
  6140. auditUserList: aiReportData[i].auditUserList,
  6141. projectAuditorId: aiReportData[i].projectAuditorId,
  6142. projectAuditorName: aiReportData[i].projectAuditorName,
  6143. overtimeHours: aiReportData[i].overtimeHours,
  6144. customText: aiReportData[i].customText,
  6145. basecostId: aiReportData[i].basecostId,
  6146. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6147. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6148. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6149. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6150. canEdit: true
  6151. })
  6152. }
  6153. this.workForm.domains = arr;
  6154. } else {
  6155. }
  6156. this.canEdit = true;
  6157. this.originCanEdit = true;
  6158. this.seleChn()
  6159. } else {
  6160. this.$message({
  6161. message: res.msg,
  6162. type: "error"
  6163. });
  6164. }
  6165. },
  6166. error => {
  6167. this.$message({
  6168. message: error,
  6169. type: "error"
  6170. });
  6171. });
  6172. },
  6173. // 获取个人某天的日报 111111
  6174. getReport() {
  6175. this.http.post( this.port.report.getPort, {
  6176. date: this.workForm.createDate
  6177. },
  6178. res => {
  6179. if (res.code == "ok") {
  6180. var quanbu = 0
  6181. this.jsDay = 1
  6182. var zhi = ''
  6183. var slp = res.data.report
  6184. for(var i in slp) {
  6185. var sp = +slp[i].workingTime + 0
  6186. zhi = this.jsDay * sp
  6187. quanbu = +quanbu + zhi
  6188. }
  6189. this.jsTime = quanbu
  6190. var list = res.data;
  6191. this.report = list;
  6192. this.reportTimeType = this.report.timeType;
  6193. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6194. this.isWeekend = !this.report.isWorkDay;
  6195. this.canCancelInDialog = false;
  6196. this.hasWrittenReport = list.report.length != 0;
  6197. if(list.report.length != 0) {
  6198. var arr = [];
  6199. this.canEdit = false;
  6200. let candelete = true
  6201. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6202. for(var i in list.report) {
  6203. var flg = null
  6204. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6205. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6206. var filteredRespList = null
  6207. if (targetP.length > 0) {
  6208. var isPublic = targetP[0].isPublic;
  6209. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  6210. }
  6211. let copyData = {
  6212. id: list.report[i].id,
  6213. projectId: list.report[i].projectId,
  6214. workingTime: list.report[i].workingTime,
  6215. content: list.report[i].content,
  6216. state: list.report[i].state,
  6217. timeType: list.report[i].timeType,
  6218. subProjectList: list.report[i].subProjectList,
  6219. taskList: list.report[i].taskList,
  6220. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6221. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6222. taskId: list.report[i].taskId,
  6223. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6224. startTime: list.report[i].startTime,
  6225. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6226. endTime: list.report[i].endTime,
  6227. isOvertime: flg,
  6228. progress:list.report[i].progress,
  6229. professionProgress: list.report[i].professionProgressList,
  6230. stages:list.report[i].stages,
  6231. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6232. pics: list.report[i].pics,
  6233. multiWorktime: list.report[i].multiWorktime,
  6234. worktimeList: list.report[i].worktimeList,
  6235. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6236. multiDegrIdArray: list.report[i].multiDegrIdList,
  6237. wuduList: list.report[i].degreeList,
  6238. taskGroups:list.report[i].taskGroups,
  6239. customData: list.report[i].customData,//自定义的数值
  6240. auditUserList: list.report[i].auditUserList,
  6241. overtimeHours: list.report[i].overtimeHours,
  6242. customText: list.report[i].customText,
  6243. basecostId: list.report[i].basecostId,
  6244. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6245. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6246. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6247. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6248. canEdit: list.report[i].state >= 2 ? true : false,
  6249. extraField1: list.report[i].extraField1,
  6250. extraField2: list.report[i].extraField2,
  6251. extraField3: list.report[i].extraField3,
  6252. extraField4: list.report[i].extraField4,
  6253. extraField5: list.report[i].extraField5,
  6254. workContentList: list.report[i].workContentList,
  6255. filteredRespList: filteredRespList,
  6256. serviceList: list.report[i].serviceList,
  6257. sapServiceId: list.report[i].sapServiceId,
  6258. reportTargetDeptId: list.report[i].deptId
  6259. }
  6260. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6261. //分组负责人审核的情况下,前端不需要显示,无需设置
  6262. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6263. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6264. }
  6265. arr.push(copyData);
  6266. if (list.report[i].state >= 2) {
  6267. this.canEdit = true;
  6268. }
  6269. if(list.report[i].state < 2){
  6270. candelete = false
  6271. }
  6272. if (list.report[i].state == 0){
  6273. this.canCancelInDialog = true
  6274. }
  6275. // 加判断
  6276. if(this.user.timeType.choseFromAlbum == 1) {
  6277. let arrList = []
  6278. for(var k in list.report[i].pics) {
  6279. let obj = {
  6280. name: k,
  6281. url: list.report[i].pics[k]
  6282. }
  6283. arrList.push(obj)
  6284. }
  6285. arr[i].imgListUrl = arrList
  6286. arr[i].imgList = list.report[i].pics
  6287. }
  6288. if(reportExtraField4Name || reportExtraField5Name) {
  6289. this.getInfoByProjectId(copyData, i, false)
  6290. }
  6291. }
  6292. this.reportCanDelete = candelete
  6293. this.workForm = {
  6294. createDate: this.workForm.createDate,
  6295. domains: arr,
  6296. userNames:null,
  6297. userId:null,
  6298. time: list.time,
  6299. showRefresh: list.showRefresh
  6300. }
  6301. } else {
  6302. this.workForm = {
  6303. createDate: this.workForm.createDate,
  6304. domains: [{
  6305. id: null,
  6306. projectId: "",
  6307. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6308. content: "",
  6309. progress:100,
  6310. state: 2,
  6311. timeType:0,
  6312. multiWorktime: this.reportTimeType.multiWorktime,
  6313. worktimeList:[{}],
  6314. canEdit: true,
  6315. auditorFirst: '',
  6316. auditorSec: '',
  6317. auditorThird: '',
  6318. ccUserid: ''
  6319. }],
  6320. userId:null,
  6321. userNames:null,
  6322. time: this.report.time,
  6323. showRefresh: list.showRefresh
  6324. }
  6325. // businessTrips 有数据的情况下
  6326. const businessTrips = res.data.businessTrips || []
  6327. this.businessTripsArray = res.data.businessTrips || []
  6328. if(businessTrips.length > 0) {
  6329. this.workForm.domains = businessTrips.map((item, index) => {
  6330. return {
  6331. id: null,
  6332. projectId: item.projectId,
  6333. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6334. content: "",
  6335. progress:100,
  6336. state: 2,
  6337. timeType:0,
  6338. multiWorktime: this.reportTimeType.multiWorktime,
  6339. worktimeList:[{}],
  6340. canEdit: true,
  6341. auditorFirst: '',
  6342. auditorSec: '',
  6343. auditorThird: '',
  6344. ccUserid: ''
  6345. }
  6346. })
  6347. for(let domainsIndex in this.workForm.domains) {
  6348. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6349. }
  6350. }
  6351. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6352. this.$set(this.workForm.domains[0],'isOvertime',true)
  6353. if(this.reportTimeType.type != 2){
  6354. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6355. }
  6356. }
  6357. if(this.user.timeType.type == 1) {
  6358. var shuzhi = this.user.timeType.allday + ''
  6359. // console.log('执行一次', shuzhi.indexOf('.'))
  6360. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6361. }
  6362. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6363. //默认给第一个,必填字段
  6364. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6365. }
  6366. this.canEdit = true;
  6367. }
  6368. this.originCanEdit = this.canEdit;
  6369. this.seleChn()
  6370. } else {
  6371. this.$message({
  6372. message: res.msg,
  6373. type: "error"
  6374. });
  6375. }
  6376. },
  6377. error => {
  6378. this.$message({
  6379. message: error,
  6380. type: "error"
  6381. });
  6382. });
  6383. },
  6384. guanbi() {
  6385. this.falsss = false,
  6386. this.workTimeForMinYi=0
  6387. },
  6388. // 打开日报填写
  6389. fillInReport(i, isBatch) {
  6390. this.isWeekend = false
  6391. this.reportCanDelete = false
  6392. // console.log(this.user.timeType.type, '选择时长')
  6393. if(i != 1) {
  6394. this.falsss = false
  6395. } else {
  6396. this.falsss = true
  6397. }
  6398. if (this.isSubstitude) {
  6399. this.getSubstitudeUserDeptList();
  6400. } else {
  6401. this.refreshToMyReportProjectList();
  6402. }
  6403. if(i == -1 || this.isSubstitude) {
  6404. this.isDisable = false;
  6405. } else {
  6406. this.isDisable = true;
  6407. }
  6408. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6409. this.isBatch = isBatch;
  6410. if (this.isBatch == 0 && !this.isSubstitude) {
  6411. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6412. let weekday = new Date(this.workForm.createDate).getDay()
  6413. if(this.user.companyId == 817){
  6414. if(weekday == 0){
  6415. this.isWeekend = true
  6416. }
  6417. }else{
  6418. if(weekday == 0 || weekday == 6){
  6419. this.isWeekend = true
  6420. }
  6421. }
  6422. this.getReport(i);
  6423. } else {
  6424. this.jsTime = 0
  6425. this.jsDay = 0
  6426. this.workForm = {
  6427. createDate: null,//批量填报没有日期
  6428. domains: [{
  6429. id: null,
  6430. projectId: "",
  6431. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6432. content: "",
  6433. progress:100,
  6434. state: 2,
  6435. timeType:0,
  6436. multiWorktime: this.reportTimeType.multiWorktime,
  6437. worktimeList:[{}],
  6438. canEdit: true,
  6439. }],
  6440. }
  6441. if(this.user.timeType.type == 1) {
  6442. var shuzhi = this.user.timeType.allday + ''
  6443. // console.log('执行二次')
  6444. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6445. }
  6446. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6447. this.workForm.showRefresh = true;
  6448. }
  6449. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6450. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6451. }
  6452. this.canEdit = true;
  6453. }
  6454. if (this.isSubstitude) {
  6455. //代填情况,默认计算合计工时
  6456. this.jsDay = 1
  6457. this.seleChn();
  6458. }
  6459. this.dialogVisible = true;
  6460. },
  6461. //按周填报的弹窗口中编辑单项目相关数据
  6462. setWeekFormReportItem(reportId, i, names, row,sss) {
  6463. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6464. this.http.post('/report/getReportById', {
  6465. reportId: reportId
  6466. },
  6467. res => {
  6468. if (res.code == "ok") {
  6469. var data = res.data.report;
  6470. sss.subProjectId = data.subProjectId
  6471. sss.subProjectList = data.subProjectList;
  6472. sss.stage = data.stage
  6473. sss.subProjectList = data.subProjectList
  6474. sss.stages = data.stages
  6475. sss.taskGroups = data.taskGroups;
  6476. sss.auditUserList = data.auditUserList;
  6477. sss.degreeId = data.degreeId;
  6478. sss.customData = data.customData;
  6479. sss.wuduList = data.degreeList;
  6480. if(reportExtraField4Name || reportExtraField5Name) {
  6481. sss.extraField4 = data.extraField4 || ''
  6482. sss.extraField5 = data.extraField5 || ''
  6483. }
  6484. this.zhoBaoIdx = i
  6485. this.zhoBaoName = names
  6486. this.zhoBao = sss
  6487. this.zhis = row
  6488. if (sss.groupId) {
  6489. //最后一个参数表示是否保留stage的值,不要重置为空
  6490. this.getGroupStages(this.zhoBao, 0, true)
  6491. }
  6492. if(reportExtraField4Name || reportExtraField5Name) {
  6493. this.weekGetInfoByProjectId(sss)
  6494. }
  6495. this.$forceUpdate();
  6496. }
  6497. });
  6498. },
  6499. // 重新计算合计
  6500. fillInThePedometerOnAWeeklyBasis(index) {
  6501. const weeklyItem = this.zhoData[index] || {}
  6502. const dynamicProjectList = this.selProjectList || []
  6503. const collectionArray = dynamicProjectList.map(item => {
  6504. const name = item.projectName
  6505. return Number(weeklyItem[name].workingTime || 0)
  6506. })
  6507. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6508. this.zhoData[index].he = totalNum
  6509. },
  6510. //输入工时触发
  6511. onInputWorkTime(index) {
  6512. const weeklyItem = this.zhoData[index] || {}
  6513. },
  6514. // 按周填报里内容的填写
  6515. showWeekItemEdit(item, i, projectId,names, row) {
  6516. if (item.state == 0) {
  6517. this.$message({
  6518. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6519. type: "error"
  6520. });
  6521. return;
  6522. }
  6523. if (item.state == 1) {
  6524. this.$message({
  6525. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6526. type: "error"
  6527. });
  6528. return;
  6529. }
  6530. if(this.user.timeType.notAllowedNoAttendance == 1){
  6531. if(this.zhoData[i].corpTime){
  6532. if(this.zhoData[i].corpTime.workHours == 0){
  6533. this.$message({
  6534. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6535. type: 'error'
  6536. })
  6537. return
  6538. }
  6539. }else{
  6540. this.$message({
  6541. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6542. type: 'error'
  6543. })
  6544. return
  6545. }
  6546. }
  6547. var obj = {}
  6548. obj.projectId = projectId
  6549. this.tianxieDialogVisible = true
  6550. this.scopess = item
  6551. var sss = {}
  6552. if (item.id != null) {
  6553. sss.id = item.id;
  6554. sss.state = item.state;
  6555. } else {
  6556. sss.id = -1;
  6557. sss.state = 3;
  6558. }
  6559. sss.projectId = projectId;
  6560. sss.progress = item.progress
  6561. sss.time = item.time
  6562. sss.content = item.content;
  6563. if (sss.time == '' && this.reportTimeType.type == 2) {
  6564. //取已填时间范围中最大的一个作为开始时间
  6565. var startTime = '09:00';
  6566. var fillStartTime = '00:00';
  6567. for (var t in this.selProjectList) {
  6568. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6569. if (fillItem.time) {
  6570. if (fillItem.time[1] > fillStartTime) {
  6571. fillStartTime = fillItem.time[1];
  6572. }
  6573. }
  6574. }
  6575. if (fillStartTime == '00:00') {
  6576. fillStartTime = '09:00';
  6577. }
  6578. var fillEndMax = '18:00';
  6579. if (fillStartTime >= '18:00') {
  6580. fillEndMax = '23:59';
  6581. }
  6582. sss.time = [fillStartTime, fillEndMax];
  6583. }
  6584. sss.groupId = item.groupId
  6585. sss.stage = item.stage;
  6586. sss.workingTime = item.workingTime
  6587. sss.projectAuditorId = item.projectAuditorId;
  6588. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6589. //默认选中第一个
  6590. sss.basecostId = this.timeBasecostList[0].id;
  6591. }
  6592. var hasEdited = this.zhoData[i][names].hasEdited;
  6593. if (hasEdited) {
  6594. console.log('执行到了这个')
  6595. console.log('执行到了这个', { ...item }, obj)
  6596. sss = { ...item }
  6597. //编辑过了
  6598. sss.subProjectId = item.subProjectId
  6599. sss.stage = item.stage
  6600. sss.subProjectList = item.subProjectList
  6601. sss.stages = item.stages
  6602. sss.taskGroups = item.taskGroups;
  6603. // sss.auditUserList = obj.auditUserList ;
  6604. sss.degreeId = item.degreeId;
  6605. sss.customData = item.customData;
  6606. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6607. //只有一个审核人,自动设置上去
  6608. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6609. }
  6610. sss.wuduList = item.wuduList;
  6611. this.zhoBaoIdx = i
  6612. this.zhoBaoName = names
  6613. this.zhoBao = sss
  6614. this.zhis = row
  6615. if (sss.groupId) {
  6616. //最后一个参数表示是否保留stage的值,不要重置为空
  6617. this.getGroupStages(this.zhoBao, 0, true)
  6618. }
  6619. this.$forceUpdate();
  6620. this.getWeeklyTaskList(sss)
  6621. } else {
  6622. //第一次打开,获取数据
  6623. if (sss.id == -1) {
  6624. //新填报的
  6625. this.selectProject(obj, 0);
  6626. var that = this
  6627. setTimeout(() =>{
  6628. sss.subProjectId = that.workForm.domains[0].subProjectId
  6629. sss.subProjectList = item.subProjectList;
  6630. sss.stage = that.workForm.domains[0].stage
  6631. sss.subProjectList = that.workForm.domains[0].subProjectList
  6632. sss.stages = that.workForm.domains[0].stages
  6633. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6634. sss.auditUserList = obj.auditUserList;
  6635. sss.degreeId = item.degreeId;
  6636. sss.customData = item.customData;
  6637. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6638. //只有一个审核人,自动设置上去
  6639. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6640. }
  6641. sss.wuduList = row[0].wuduList
  6642. that.zhoBaoIdx = i
  6643. that.zhoBaoName = names
  6644. that.zhoBao = sss
  6645. that.zhis = row
  6646. if (sss.groupId) {
  6647. //最后一个参数表示是否保留stage的值,不要重置为空
  6648. this.getGroupStages(that.zhoBao, 0, false)
  6649. }
  6650. that.$forceUpdate();
  6651. this.getWeeklyTaskList(sss)
  6652. },600);
  6653. } else {
  6654. //编辑填报过的;数据库已经存在的
  6655. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6656. }
  6657. if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
  6658. setTimeout(() => {
  6659. this.weekGetInfoByProjectId(sss)
  6660. }, 1000)
  6661. }
  6662. }
  6663. },
  6664. weekGetInfoByProjectId(item) {
  6665. console.log(item, '<=== item')
  6666. const { projectId } = item
  6667. const projectList = this.fillProjectList || this.subFillProjectList
  6668. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6669. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  6670. projectId: projectCode
  6671. },
  6672. res => {
  6673. if (res.code == "ok") {
  6674. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6675. this.zhoBao.reportExtraField5List = res.data.lines || []
  6676. if((res.data.orderIds || []).length > 0) {
  6677. this.zhoBao.extraField4 = res.data.orderIds[0]
  6678. }
  6679. console.log(this.zhoBao, '<===== this.zhoBao')
  6680. this.$forceUpdate();
  6681. }
  6682. },
  6683. error => {
  6684. this.$message({
  6685. message: error,
  6686. type: "error"
  6687. });
  6688. });
  6689. // console.log(item)
  6690. // console.log(this.zhoBao)
  6691. },
  6692. // 按周填报里内容的填写点击确定
  6693. setWeekProItemData() {
  6694. //专业版模式下,任务分组和阶段必填
  6695. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6696. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6697. this.$message({
  6698. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6699. type: "error"
  6700. });
  6701. return;
  6702. }
  6703. }
  6704. // 检查任务分组
  6705. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6706. this.$message({
  6707. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6708. type: "error"
  6709. });
  6710. return
  6711. }
  6712. //检查子项目是否必填
  6713. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6714. this.$message({
  6715. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6716. type: "error"
  6717. });
  6718. return;
  6719. }
  6720. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6721. this.$message({
  6722. message: this.$t('message.Pleaseselectareviewer'),
  6723. type: "error"
  6724. });
  6725. return
  6726. }
  6727. if(this.user.timeType.reportAuditType == 3){
  6728. let auditTips = ''
  6729. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6730. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6731. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6732. if(auditTips){
  6733. auditTips = auditTips.substring(0,auditTips.length - 1)
  6734. this.$message({
  6735. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6736. type: 'error'
  6737. })
  6738. return
  6739. }
  6740. }
  6741. let errtips = ''
  6742. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6743. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6744. errtips += this.user.timeType.customDegreeName + '、'
  6745. }
  6746. }
  6747. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6748. errtips += this.user.timeType.customDataName + '、'
  6749. }
  6750. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6751. errtips += this.user.timeType.customTextName + '、'
  6752. }
  6753. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6754. errtips += this.$t('other.workMatters') +'、'
  6755. }
  6756. if(errtips){
  6757. errtips = errtips.substring(0,errtips.length - 1)
  6758. this.$message({
  6759. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6760. type: 'error'
  6761. })
  6762. return
  6763. }
  6764. this.tianxieDialogVisible = false
  6765. var zhong = this.zhoData
  6766. this.zhoBao.hasEdited = true;
  6767. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6768. this.zhoData = zhong
  6769. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6770. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6771. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6772. },
  6773. // 获取本周
  6774. getCurrentWeek() {
  6775. //今天
  6776. this.targetWeekDate = new Date();
  6777. this.initWeekFormData();
  6778. // this.jiazai()
  6779. },
  6780. // 获取上周
  6781. handleGetPrevWeek() {
  6782. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6783. this.initWeekFormData();
  6784. // this.jiazai()
  6785. },
  6786. // 获取下周
  6787. handleGetNextvWeek() {
  6788. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6789. this.initWeekFormData()
  6790. },
  6791. // 加载动画
  6792. jiazai() {
  6793. this.weekDataLoading = true
  6794. var that = this
  6795. setTimeout(() =>{
  6796. that.weekDataLoading = false
  6797. },1000);
  6798. },
  6799. // 转时间格式
  6800. dealdate(date) {
  6801. const dt = new Date(date)
  6802. const y = dt.getFullYear()
  6803. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6804. const d = (dt.getDate() + '').padStart(2, '0')
  6805. return `${y}-${m}-${d}`
  6806. },
  6807. // 按周填报
  6808. fillInReportss() {
  6809. window.addEventListener('scroll', this.handleScroll, true)
  6810. // this.jiazai()
  6811. this.fillWeekDialogVisi = true;
  6812. if (this.isSubstitude) {
  6813. this.substitudeStep = 1;
  6814. this.getSubstitudeUserDeptList();
  6815. } else {
  6816. this.getCurrentWeek();
  6817. }
  6818. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6819. //重新获取工时预警类型的预算项
  6820. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6821. companyId: this.user.companyId
  6822. },
  6823. res => {
  6824. if (res.code == "ok") {
  6825. this.timeBasecostList = res.data;
  6826. }
  6827. });
  6828. }
  6829. },
  6830. fillInReportCustom() {
  6831. this.weekIndex++
  6832. this.weekParentData = {
  6833. isSubstitude: this.isSubstitude
  6834. }
  6835. this.fillWeekDialogVisiCustom = true
  6836. },
  6837. // 按周填报的项目筛选
  6838. selListFun(){
  6839. this.selProjectList = []
  6840. if(this.selCon.length){
  6841. for (let i = 0; i < this.selCon.length; i++) {
  6842. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6843. }
  6844. this.selConShow = false ;
  6845. for (let i in this.zhoData) {
  6846. var obj = this.zhoData[i];
  6847. for(var j in this.selProjectList) {
  6848. var xinzhi = this.selProjectList[j].projectName
  6849. obj[xinzhi] = {}
  6850. obj[xinzhi].time = ''
  6851. obj[xinzhi].content = ''
  6852. obj[xinzhi].progress = 0
  6853. obj[xinzhi].workingTime = 0
  6854. }
  6855. }
  6856. this.initWeekFormData();
  6857. }else{
  6858. this.$message({
  6859. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6860. type:'error'
  6861. })
  6862. }
  6863. },
  6864. setWeekCardTimeData(list) {
  6865. for(let i in list){
  6866. let datei = '';
  6867. if (this.user.timeType.showDdCardtime == 1) {
  6868. datei = list[i].workDate;
  6869. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6870. datei = list[i].createDate;
  6871. } else if (this.user.timeType.syncFanwei == 1) {
  6872. datei = list[i].workDate;
  6873. }
  6874. for(let m in this.zhoData) {
  6875. if(datei == this.zhoData[m].zhoDataTime){
  6876. let item = {
  6877. startTime: list[i].startTime,
  6878. endTime: list[i].endTime,
  6879. workHours: list[i].workHours,
  6880. otTime: list[i].otTime
  6881. }
  6882. this.$set(this.zhoData[m],'corpTime',item)
  6883. }
  6884. }
  6885. }
  6886. },
  6887. getWeeklyCardTime(){ //按周填报获取考勤信息
  6888. let dateStr = []
  6889. for(let i in this.zhoData){
  6890. dateStr.push(this.zhoData[i].zhoDataTime)
  6891. }
  6892. this.http.post('/report/getWeeklyCardTime',{
  6893. dateStr: JSON.stringify(dateStr)
  6894. },res => {
  6895. if(res.code == 'ok'){
  6896. for(let i in res.data){
  6897. let datei = '';
  6898. if (this.user.timeType.showDdCardtime == 1) {
  6899. datei = res.data[i].workDate.split('-');
  6900. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6901. datei = res.data[i].createDate.split('-');
  6902. }
  6903. for(let m in this.zhoData){
  6904. let datem = new Date(this.zhoData[m].zhoDataTime)
  6905. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6906. let item = {
  6907. startTime: res.data[i].startTime,
  6908. endTime: res.data[i].endTime,
  6909. workHours: res.data[i].workHours
  6910. }
  6911. this.$set(this.zhoData[m],'corpTime',item)
  6912. }
  6913. }
  6914. }
  6915. }else{
  6916. this.$message({
  6917. message: res.msg,
  6918. type: 'error'
  6919. })
  6920. }
  6921. },err => {
  6922. this.$message({
  6923. message: err,
  6924. type: 'error'
  6925. })
  6926. })
  6927. },
  6928. selListqx(){
  6929. this.fillWeekDialogVisi = false
  6930. this.selProjectList = []
  6931. this.selCon = []
  6932. },
  6933. handleScroll() {
  6934. this.changdu = this.projectList.length + 1
  6935. },
  6936. // 自动选择时间点的事件
  6937. // async zhoTimes(item, i) {
  6938. // var iss = i
  6939. // if(item.time == null) {
  6940. // return
  6941. // } else {
  6942. // const zhi = this.zhoData[iss];
  6943. // let he = 0;
  6944. // const timeArr = Object.values(zhi)
  6945. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6946. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6947. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6948. // console.log(data, 'data');
  6949. // zhi.he = `${he}h`;
  6950. // }
  6951. // },
  6952. async zhoTimes(item, index) {
  6953. const zho = this.zhoData[index];
  6954. if (!item.time) {
  6955. return;
  6956. }
  6957. const timeArr = Object.values(zho)
  6958. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6959. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6960. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6961. zho.he = `${totalHours[0]}h`;
  6962. },
  6963. // 判断两个时间段是否重叠
  6964. timeOverlap(idx, dateAr) {
  6965. let zhi = 0
  6966. for (let k in dateAr) {
  6967. if (idx !== k) {
  6968. 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))) {
  6969. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6970. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6971. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6972. }
  6973. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6974. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6975. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6976. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6977. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6978. } else {
  6979. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6980. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6981. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6982. }
  6983. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6984. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6985. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6986. }
  6987. }
  6988. }
  6989. }
  6990. }
  6991. return zhi
  6992. },
  6993. // 计算时间
  6994. getHourMinutes(str, end) {
  6995. var he = 0
  6996. var date2 = '2021/12/12 ' + end +':00'
  6997. var date1 = '2021/12/12 ' + str +':00'
  6998. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6999. var leave1=date3%(24*3600*1000)
  7000. var hours=Math.floor(leave1/(3600*1000))
  7001. var leave2=leave1%(3600*1000)
  7002. var minutes=Math.floor(leave2/(60*1000))
  7003. var shi = hours+'.'+ minutes
  7004. return he += +shi
  7005. },
  7006. // 自动选择事件长度的事件
  7007. zhoXuan(item, i) {
  7008. var iss = i
  7009. if(item.time == null) {
  7010. return
  7011. } else {
  7012. var zhi = this.zhoData[iss]
  7013. var he = 0
  7014. for(var i in zhi) {
  7015. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  7016. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  7017. console.log('执行')
  7018. he += +zhi[i].workingTime
  7019. }
  7020. }
  7021. zhi.he = he + 'h'
  7022. }
  7023. },
  7024. getPushWorkLogData(){
  7025. this.http.post('/sap-sync-log/list', {},
  7026. res => {
  7027. if (res.code == "ok") {
  7028. this.pushWorkTimeLogData = res.data;
  7029. } else {
  7030. this.$message({
  7031. message: res.msg,
  7032. type: "error"
  7033. });
  7034. }
  7035. },
  7036. error => {
  7037. this.$message({
  7038. message: error,
  7039. type: "error"
  7040. });
  7041. });
  7042. },
  7043. // 获取全部人员
  7044. getUsers() {
  7045. this.http.post('/user/getSimpleActiveUserList', {},
  7046. res => {
  7047. if (res.code == "ok") {
  7048. this.usersList = res.data;
  7049. } else {
  7050. this.$message({
  7051. message: res.msg,
  7052. type: "error"
  7053. });
  7054. }
  7055. },
  7056. error => {
  7057. this.$message({
  7058. message: error,
  7059. type: "error"
  7060. });
  7061. });
  7062. },
  7063. // 按时间比例
  7064. addBli(item, i) {
  7065. var iss = i
  7066. if(item.time == null) {
  7067. return
  7068. } else {
  7069. var zhi = this.zhoData[iss]
  7070. var he = 0
  7071. for(var i in zhi) {
  7072. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7073. he += +zhi[i].workingTime
  7074. }
  7075. }
  7076. zhi.he = he.toFixed(1) + 'h'
  7077. }
  7078. },
  7079. //按周填报选择的项目发生变化,需要设置列
  7080. onSelProjectChange() {
  7081. for (let i = 0; i < this.selCon.length; i++) {
  7082. var exists = false;
  7083. for (let j = 0; j < this.selProjectList.length; j++) {
  7084. if (this.selProjectList[j].id == this.selCon[i]) {
  7085. exists = true;
  7086. break;
  7087. }
  7088. }
  7089. if (!exists) {
  7090. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7091. this.selProjectList.push(newProject);
  7092. //添加新项目
  7093. for (var w in this.zhoData) {
  7094. var dayItem = this.zhoData[w];
  7095. var pName = newProject.projectName;
  7096. dayItem[pName] = {};
  7097. dayItem[pName].time = ''
  7098. dayItem[pName].content = ''
  7099. dayItem[pName].progress = 0
  7100. dayItem[pName].workingTime = 0
  7101. }
  7102. }
  7103. }
  7104. //去掉
  7105. for (let j = 0; j < this.selProjectList.length; j++) {
  7106. var exists = false;
  7107. for (let i = 0; i < this.selCon.length; i++) {
  7108. if (this.selProjectList[j].id == this.selCon[i]) {
  7109. exists = true;
  7110. break;
  7111. }
  7112. }
  7113. if (!exists) {
  7114. this.selProjectList.splice(j, 1);
  7115. j--;
  7116. }
  7117. }
  7118. this.loadFilledWeekReportItem();
  7119. //刷新表格
  7120. // this.$refs.weekTable.doLayout();
  7121. },
  7122. //根据选中的项目来刷新填写表格
  7123. loadFilledWeekReportItem() {
  7124. for (var w in this.zhoData) {
  7125. var dayItem = this.zhoData[w];
  7126. for (var i = 0; i < this.selProjectList.length; i++) {
  7127. var curColumnProject = this.selProjectList[i];
  7128. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7129. for (var t in dayItem.reportList) {
  7130. //有日报的项目,不能取消选择
  7131. for (var p in this.fillProjectList) {
  7132. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7133. }
  7134. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7135. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7136. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7137. if (this.reportTimeType.type == 2) {
  7138. //时间段模式
  7139. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7140. }
  7141. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7142. break;
  7143. }
  7144. }
  7145. // dayItem[curColumnProject.projectName] = matchReportItem;
  7146. }
  7147. }
  7148. this.$nextTick(()=>{
  7149. this.$refs.weekTable.doLayout();
  7150. });
  7151. },
  7152. initWeekFormData() {
  7153. this.weekDataLoading = true;
  7154. for (var p in this.fillProjectList) {
  7155. this.fillProjectList[p].canCancel = 1;
  7156. }
  7157. var param = {
  7158. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7159. };
  7160. if (this.isSubstitude) {
  7161. //传代填人的userId
  7162. param.targetUserId = this.workForm.userId[0];
  7163. }
  7164. this.http.post('/report/getWeeklyReportData',param,res => {
  7165. this.weekDataLoading = false;
  7166. if(res.code == 'ok'){
  7167. let projectList = res.data.projectList;
  7168. if (projectList.length > 0) {
  7169. //有选择过项目进行填报,直接选中
  7170. this.selProjectList = projectList;
  7171. this.selCon = [];
  7172. for (let i = 0; i < projectList.length; i++) {
  7173. this.selCon.push(projectList[i].id);
  7174. }
  7175. }
  7176. //设置日期
  7177. this.weekDateRange = res.data.dateList;
  7178. this.zhoData = [];
  7179. var arrst = []
  7180. for(var i in this.weekDateRange) {
  7181. var obj = {}
  7182. obj.zhoDataTime = this.weekDateRange[i].date
  7183. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7184. obj.he = this.weekDateRange[i].filledTime;
  7185. obj.canFill = this.weekDateRange[i].canFill;
  7186. // obj.filledTime = this.weekDateRange[i].filledTime;
  7187. obj.reportList = this.weekDateRange[i].reportList;
  7188. //初始化,防止渲染报错
  7189. for (var j = 0; j < this.selProjectList.length; j++) {
  7190. var pName = this.selProjectList[j].projectName
  7191. obj[pName] = {}
  7192. obj[pName].time = ''
  7193. obj[pName].content = ''
  7194. obj[pName].progress = 0
  7195. obj[pName].workingTime = 0
  7196. }
  7197. arrst.push(obj)
  7198. }
  7199. this.zhoData = arrst
  7200. this.setWeekCardTimeData(res.data.cardTimeList);
  7201. this.loadFilledWeekReportItem();
  7202. }else{
  7203. this.$message({
  7204. message: res.msg,
  7205. type: 'error'
  7206. })
  7207. }
  7208. },err => {
  7209. this.$message({
  7210. message: err,
  7211. type: 'error'
  7212. })
  7213. })
  7214. },
  7215. zhoZhi(res, i) {
  7216. var zhi = 0
  7217. for(var i in res) {
  7218. if(i != 'zhoDataTime' && i != 'he') {
  7219. zhi += +res[i]
  7220. }
  7221. }
  7222. res.he = zhi
  7223. },
  7224. zhoBtn(i) {
  7225. // this.zhoData.split(i, 1)
  7226. var arr = this.zhoData
  7227. arr.splice(i, 1)
  7228. },
  7229. zhoAddlast(){
  7230. this.selConShow = true
  7231. },
  7232. closeAddWeeklyReport(){
  7233. this.fillWeekDialogVisi = false
  7234. this.selConShow = true
  7235. this.selProjectList = []
  7236. this.selCon = []
  7237. },
  7238. checkDateWorkTime() {
  7239. //针对苏州景昱,单独的检查逻辑
  7240. if (this.user.companyId == 5978) {
  7241. //调接口,先检查工时是否存在异常
  7242. var zhi = this.zhoData;
  7243. var array = [];
  7244. for(let n in zhi){
  7245. if(zhi[n].he){
  7246. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7247. array.push(workData)
  7248. }
  7249. }
  7250. this.submitingReport = true;
  7251. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7252. res => {
  7253. this.submitingReport = false;
  7254. if (res.code == "ok") {
  7255. this.submitWeekReport(0)
  7256. } else {
  7257. this.$confirm(res.msg, this.$t('other.prompts'), {
  7258. confirmButtonText: this.$t('huLveBingTiJiao'),
  7259. cancelButtonText: this.$t('btn.cancel'),
  7260. type: 'error'
  7261. }).then(() => {
  7262. this.submitWeekReport(0)
  7263. }).catch(() => {
  7264. });
  7265. }
  7266. },
  7267. error => {
  7268. this.$message({
  7269. message: error,
  7270. type: "error"
  7271. });
  7272. });
  7273. }
  7274. },
  7275. // 提交按周填报
  7276. submitWeekReport(isDraft) {
  7277. var zhi = this.zhoData
  7278. var ll = 0
  7279. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7280. if(this.reportTimeType.type == 2) {
  7281. for(var i in zhi) {
  7282. this.dateAr = []
  7283. var alp = []
  7284. var zhis = zhi[i]
  7285. for(var j in zhis) {
  7286. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7287. let objs = {}
  7288. objs.s = zhis[j].time[0]
  7289. objs.e = zhis[j].time[1]
  7290. objs.p = j
  7291. alp.push(objs)
  7292. }
  7293. }
  7294. this.dateAr = alp
  7295. if (this.reportTimeType.timeCanOverlap == 0) {
  7296. let str = this.$t('message.Filledtimeperiodsoverlap')
  7297. if(this.dateAr.length > 0) {
  7298. const trus = this.fns();
  7299. const overlapDataTime = this.getOverlapData(alp);
  7300. if (overlapDataTime.length > 0) {
  7301. const arrList = overlapDataTime.map((item) => item.p);
  7302. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7303. }
  7304. ll += 1
  7305. if(!trus) {
  7306. this.$message({
  7307. message: str,
  7308. type: 'error'
  7309. })
  7310. return false
  7311. }
  7312. }
  7313. } else {
  7314. if(this.dateAr.length > 0) {
  7315. ll +=1 ;
  7316. }
  7317. }
  7318. }
  7319. if(ll == 0) {
  7320. this.$message({
  7321. message: this.$t('message.Pleasefillinthetime'),
  7322. type: 'error'
  7323. })
  7324. return false
  7325. }
  7326. } else if(this.reportTimeType.type == 1){
  7327. for(var i in zhi) {
  7328. var zhis = zhi[i]
  7329. for(var j in zhis) {
  7330. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7331. ll += 1
  7332. }
  7333. }
  7334. }
  7335. if(ll == 0) {
  7336. this.$message({
  7337. message: this.$t('message.Pleaseselectatime'),
  7338. type: 'error'
  7339. })
  7340. return false
  7341. }
  7342. let overcorp = ''
  7343. for(let n in zhi){
  7344. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7345. overcorp += zhi[n].zhoDataTime + ','
  7346. }
  7347. }
  7348. if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
  7349. overcorp = overcorp.substring(0,overcorp.length - 1)
  7350. this.$message({
  7351. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7352. type: 'error'
  7353. })
  7354. return
  7355. }
  7356. }
  7357. var submits = []
  7358. let formData = new FormData();
  7359. formData.append("draft", isDraft);
  7360. if(this.reportTimeType.multiWorktime == 1){
  7361. for (var i in this.zhoData) {
  7362. var zhoD = this.zhoData[i]
  7363. var flgs = false
  7364. for(var j in zhoD) {
  7365. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7366. flgs = true
  7367. // formData.append("degreeId", "-1");
  7368. formData.append("id", '-1');
  7369. if (this.isSubstitude) {
  7370. formData.append('targetUids',this.workForm.userId[0]);
  7371. }
  7372. for(var s in this.selProjectList) {
  7373. if(j == this.selProjectList[s].projectName) {
  7374. formData.append("projectId", this.selProjectList[s].id);
  7375. break;
  7376. }
  7377. }
  7378. if(this.user.timeType.reportAuditType == 3){
  7379. let audItem = {}
  7380. if(this.user.timeType.auditLevel > 0){
  7381. audItem.auditorFirst = zhoD[j].auditorFirst
  7382. }
  7383. if(this.user.timeType.auditLevel > 1){
  7384. audItem.auditorSec = zhoD[j].auditorSec
  7385. }
  7386. if(this.user.timeType.auditLevel > 2){
  7387. audItem.auditorThird = zhoD[j].auditorThird
  7388. }
  7389. if(zhoD[j].ccUserid){
  7390. audItem.ccUserid = zhoD[j].ccUserid
  7391. }
  7392. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7393. }
  7394. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7395. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7396. formData.append("reportTimeType", this.reportTimeType.type);
  7397. formData.append("endTime", '');
  7398. formData.append("startTime", '');
  7399. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7400. var lix = []
  7401. var objjs = {}
  7402. objjs.startTime = zhoD[j].time[0]
  7403. objjs.endTime = zhoD[j].time[1]
  7404. if (zhoD[j].content == null || zhoD[j].content == '') {
  7405. zhoD[j].content == '-'
  7406. }
  7407. objjs.content = zhoD[j].content
  7408. lix.push(objjs)
  7409. var zhiZhi = JSON.stringify(lix)
  7410. zhiZhi = zhiZhi.replace(/,/g,"@");
  7411. formData.append("content", zhiZhi)
  7412. formData.append("isOvertime", 0)
  7413. formData.append("professionProgress", "[]")
  7414. if (zhoD[j].groupId) {
  7415. formData.append("groupId",zhoD[j].groupId)
  7416. } else {
  7417. //解决后台groupId数组越界的问题
  7418. formData.append("groupId",0)
  7419. }
  7420. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7421. formData.append("createDate",zhoD.zhoDataTime)
  7422. if (zhoD[j].projectAuditorId) {
  7423. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7424. }
  7425. if(zhoD[j].basecostId) {
  7426. formData.append("basecostId", zhoD[j].basecostId);
  7427. } else {
  7428. formData.append("basecostId", 0);
  7429. }
  7430. if(this.user.timeType.customDegreeActive){
  7431. if (this.user.timeType.customDegreeMultiple) {
  7432. if (zhoD[j].multiDegrIdArray) {
  7433. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7434. } else {
  7435. formData.append('multiDegrId','[]')
  7436. }
  7437. } else {
  7438. if (zhoD[j].degreeId) {
  7439. formData.append('degreeId',zhoD[j].degreeId)
  7440. } else {
  7441. formData.append('degreeId','-1')
  7442. }
  7443. }
  7444. }else{
  7445. formData.append("degreeId", "-1");
  7446. }
  7447. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7448. formData.append('customData',zhoD[j].customData)
  7449. }else if(this.user.timeType.customDataActive){
  7450. formData.append('customData',0)
  7451. }
  7452. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7453. formData.append('customText',zhoD[j].customText)
  7454. }else if(this.user.timeType.customTextActive){
  7455. formData.append('customText','-')
  7456. }
  7457. if(reportExtraField4Name || reportExtraField5Name) {
  7458. formData.append('extraField4', zhoD[j].extraField4 || '')
  7459. formData.append('extraField5', zhoD[j].extraField5 || '')
  7460. }
  7461. }
  7462. }
  7463. }
  7464. } else {
  7465. for (var i in this.zhoData) {
  7466. var zhoD = this.zhoData[i]
  7467. var flgs = false
  7468. if(this.reportTimeType.type == 2) {
  7469. for(var k in this.selProjectList) {
  7470. var pItem = this.selProjectList[k];
  7471. var pName = pItem.projectName;
  7472. var j = pName;
  7473. var pid = pItem.id;
  7474. console.log('j==周报中的项目='+j);
  7475. if(zhoD[j].time && zhoD[j].time != 'null') {
  7476. flgs = true
  7477. // formData.append("degreeId", "-1");
  7478. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7479. if (this.isSubstitude) {
  7480. formData.append('targetUids',this.workForm.userId[0]);
  7481. }
  7482. formData.append("projectId", pid);
  7483. if(this.user.timeType.reportAuditType == 3){
  7484. let audItem = {}
  7485. if(this.user.timeType.auditLevel > 0){
  7486. audItem.auditorFirst = zhoD[j].auditorFirst
  7487. }
  7488. if(this.user.timeType.auditLevel > 1){
  7489. audItem.auditorSec = zhoD[j].auditorSec
  7490. }
  7491. if(this.user.timeType.auditLevel > 2){
  7492. audItem.auditorThird = zhoD[j].auditorThird
  7493. }
  7494. if(zhoD[j].ccUserid){
  7495. audItem.ccUserid = zhoD[j].ccUserid
  7496. }
  7497. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7498. }
  7499. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7500. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7501. formData.append("reportTimeType", this.reportTimeType.type);
  7502. formData.append("endTime", zhoD[j].time[1]);
  7503. formData.append("startTime", zhoD[j].time[0]);
  7504. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7505. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7506. formData.append("isOvertime", 0)
  7507. formData.append("professionProgress", "[]")
  7508. if (zhoD[j].groupId) {
  7509. formData.append("groupId",zhoD[j].groupId)
  7510. } else {
  7511. //解决后台groupId数组越界的问题
  7512. formData.append("groupId",0)
  7513. }
  7514. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7515. formData.append("createDate",zhoD.zhoDataTime)
  7516. if (zhoD[j].projectAuditorId) {
  7517. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7518. } else {
  7519. //对齐数据
  7520. formData.append("projectAuditorId",'-');
  7521. }
  7522. if(zhoD[j].basecostId) {
  7523. formData.append("basecostId", zhoD[j].basecostId);
  7524. } else {
  7525. formData.append("basecostId", 0);
  7526. }
  7527. if(this.user.timeType.customDegreeActive){
  7528. if (this.user.timeType.customDegreeMultiple) {
  7529. if (zhoD[j].multiDegrIdArray) {
  7530. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7531. } else {
  7532. formData.append("multiDegrId", "[]");
  7533. }
  7534. } else {
  7535. if (zhoD[j].degreeId) {
  7536. formData.append('degreeId',zhoD[j].degreeId)
  7537. } else {
  7538. formData.append("degreeId", "-1");
  7539. }
  7540. }
  7541. }else{
  7542. formData.append("degreeId", "-1");
  7543. }
  7544. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7545. formData.append('customData',zhoD[j].customData)
  7546. }else if(this.user.timeType.customDataActive){
  7547. formData.append('customData',0)
  7548. }
  7549. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7550. formData.append('customText',zhoD[j].customText)
  7551. }else if(this.user.timeType.customTextActive){
  7552. formData.append('customText','-')
  7553. }
  7554. if(reportExtraField4Name || reportExtraField5Name) {
  7555. formData.append('extraField4', zhoD[j].extraField4 || '')
  7556. formData.append('extraField5', zhoD[j].extraField5 || '')
  7557. }
  7558. }
  7559. }
  7560. } else {
  7561. for(var k in this.selProjectList) {
  7562. var pItem = this.selProjectList[k];
  7563. var pName = pItem.projectName;
  7564. var j = pName;
  7565. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7566. flgs = true
  7567. // formData.append("degreeId", "-1");
  7568. console.log('进入了workFpppp==='+j);
  7569. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7570. if (this.isSubstitude) {
  7571. formData.append('targetUids',this.workForm.userId[0]);
  7572. }
  7573. formData.append("projectId", pItem.id);
  7574. if(this.user.timeType.reportAuditType == 3){
  7575. let audItem = {}
  7576. if(this.user.timeType.auditLevel > 0){
  7577. audItem.auditorFirst = zhoD[j].auditorFirst
  7578. }
  7579. if(this.user.timeType.auditLevel > 1){
  7580. audItem.auditorSec = zhoD[j].auditorSec
  7581. }
  7582. if(this.user.timeType.auditLevel > 2){
  7583. audItem.auditorThird = zhoD[j].auditorThird
  7584. }
  7585. if(zhoD[j].ccUserid){
  7586. audItem.ccUserid = zhoD[j].ccUserid
  7587. }
  7588. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7589. }
  7590. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7591. // formData.append("subProjectId", zhoD[j].subProjectId);
  7592. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7593. formData.append("reportTimeType", this.reportTimeType.type);
  7594. if(this.reportTimeType.type == 1) {
  7595. formData.append("workingTime", zhoD[j].workingTime);
  7596. } else if(this.reportTimeType.type == 2) {
  7597. formData.append("endTime", zhoD[j].time[1]);
  7598. formData.append("startTime", zhoD[j].time[0]);
  7599. } else if(this.reportTimeType.type == 3) {
  7600. formData.append("progress", zhoD[j].progress);
  7601. formData.append("workingTime", zhoD[j].workingTime);
  7602. }
  7603. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7604. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7605. formData.append("isOvertime", 0)
  7606. formData.append("professionProgress", "[]")
  7607. if (zhoD[j].groupId) {
  7608. formData.append("groupId",zhoD[j].groupId)
  7609. } else {
  7610. //解决后台groupId数组越界的问题
  7611. formData.append("groupId",0)
  7612. }
  7613. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7614. formData.append("createDate",zhoD.zhoDataTime)
  7615. if (zhoD[j].projectAuditorId) {
  7616. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7617. } else {
  7618. //对齐数据
  7619. formData.append("projectAuditorId",'-')
  7620. }
  7621. if(zhoD[j].basecostId) {
  7622. formData.append("basecostId", zhoD[j].basecostId);
  7623. } else {
  7624. formData.append("basecostId", 0);
  7625. }
  7626. if(this.user.timeType.customDegreeActive){
  7627. if (this.user.timeType.customDegreeMultiple) {
  7628. if (zhoD[j].multiDegrIdArray) {
  7629. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7630. } else {
  7631. formData.append("multiDegrId", "[]");
  7632. }
  7633. } else {
  7634. if (zhoD[j].degreeId) {
  7635. formData.append('degreeId',zhoD[j].degreeId)
  7636. } else {
  7637. formData.append("degreeId", "-1");
  7638. }
  7639. }
  7640. }else{
  7641. formData.append("degreeId", "-1");
  7642. }
  7643. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7644. formData.append('customData',zhoD[j].customData)
  7645. }else if(this.user.timeType.customDataActive){
  7646. formData.append('customData',0)
  7647. }
  7648. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7649. formData.append('customText',zhoD[j].customText)
  7650. }else if(this.user.timeType.customTextActive){
  7651. formData.append('customText','-')
  7652. }
  7653. if(reportExtraField4Name || reportExtraField5Name) {
  7654. formData.append('extraField4', zhoD[j].extraField4 || '')
  7655. formData.append('extraField5', zhoD[j].extraField5 || '')
  7656. }
  7657. }
  7658. }
  7659. }
  7660. }
  7661. }
  7662. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7663. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7664. if(!next) {
  7665. this.$message({
  7666. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7667. type: 'error'
  7668. })
  7669. return
  7670. }
  7671. // 自定义维度
  7672. this.submitingReport = true;
  7673. this.http.uploadFile( this.port.report.editPort, formData,
  7674. res => {
  7675. // this.listLoading = false;
  7676. this.submitingReport = false;
  7677. if (res.code == "ok") {
  7678. this.$message({
  7679. message: this.$t('message.fillinsuccessfully'),
  7680. type: "success"
  7681. });
  7682. this.fillWeekDialogVisi = false
  7683. this.selConShow = true
  7684. this.zhoData = []
  7685. this.weekDateRange = ''
  7686. this.getReportList();
  7687. this.getDepartment();
  7688. // 关闭弹窗 并 清空
  7689. this.selProjectList = []
  7690. this.selCon = []
  7691. this.getRecentlyProject()
  7692. } else {
  7693. this.$message({
  7694. message: res.msg,
  7695. type: "error"
  7696. });
  7697. }
  7698. },
  7699. error => {
  7700. this.submitingReport = false;
  7701. this.$message({
  7702. message: error,
  7703. type: "error"
  7704. });
  7705. });
  7706. },
  7707. handleGroupAuditorData(data) {
  7708. const { reportAuditType } = this.user.timeType
  7709. if(reportAuditType != 1 && reportAuditType != 2) {
  7710. return {next: true}
  7711. }
  7712. let arrList = [];
  7713. Object.entries(data).forEach(([key, obj]) => {
  7714. Object.entries(obj).forEach(([projectName, projectData]) => {
  7715. if (projectData.workingTime && !projectData.groupId) {
  7716. arrList.push({
  7717. projectName,
  7718. date: obj.zhoDataTime,
  7719. dateText: obj.zhoDataTimeTxt
  7720. });
  7721. }
  7722. });
  7723. });
  7724. if(arrList.length > 0) {
  7725. return {
  7726. next: false,
  7727. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7728. }
  7729. } else {
  7730. return {
  7731. next: true,
  7732. error: [],
  7733. }
  7734. }
  7735. },
  7736. ChangeHourMinutestr (str) {
  7737. if (str !== "0" && str !== "" && str !== null) {
  7738. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7739. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7740. } else {
  7741. return "";
  7742. }
  7743. },
  7744. // 得到两个日期中间的日期
  7745. getdiffdate(stime,etime){
  7746. //初始化日期列表,数组
  7747. var diffdate = new Array();
  7748. var i=0;
  7749. //开始日期小于等于结束日期,并循环
  7750. while(stime<=etime){
  7751. diffdate[i] = stime;
  7752. //获取开始日期时间戳
  7753. var stime_ts = new Date(stime).getTime();
  7754. //增加一天时间戳后的日期
  7755. var next_date = stime_ts + (24*60*60*1000);
  7756. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7757. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7758. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7759. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7760. stime = next_dates_y+next_dates_m+next_dates_d;
  7761. //增加数组key
  7762. i++;
  7763. }
  7764. return diffdate;
  7765. },
  7766. // 添加模块
  7767. addDomain(i) {
  7768. var leftProgress = 10;
  7769. if (this.reportTimeType.type == 3) {
  7770. //计算已经待分配工时比例
  7771. let array = this.workForm.domains;
  7772. let totalProgress = 0;
  7773. for (var i=0;i<array.length; i++) {
  7774. totalProgress += array[i].progress;
  7775. }
  7776. if (totalProgress < 100) {
  7777. leftProgress = 100 - totalProgress;
  7778. }
  7779. }
  7780. var addItem = {
  7781. projectId: "",
  7782. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7783. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7784. ),
  7785. content: "",
  7786. progress:leftProgress,
  7787. state:2,//2-表示待提交
  7788. multiWorktime: this.reportTimeType.multiWorktime,
  7789. worktimeList:[{}],
  7790. canEdit: true,
  7791. auditorFirst: '',
  7792. auditorSec: '',
  7793. auditorThird: '',
  7794. ccUserid: ''
  7795. // degreeId: '',
  7796. };
  7797. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7798. this.$set(addItem,'isOvertime',true)
  7799. if(this.reportTimeType.type == 3){
  7800. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7801. }
  7802. }
  7803. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7804. //默认给第一个,必填字段
  7805. addItem.basecostId = this.timeBasecostList[0].id;
  7806. }
  7807. this.workForm.domains.push(addItem);
  7808. document.getElementById('workFormsItemBottom').scrollIntoView()
  7809. this.canEdit = true
  7810. if (this.reportTimeType.type == 0) {
  7811. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7812. var length = this.workForm.domains.length;
  7813. if (length == 2) {
  7814. this.showAddMore = false;
  7815. }
  7816. }
  7817. this.chuji()
  7818. this.seleChn()
  7819. },
  7820. // 移除模块
  7821. delDomain(i) {
  7822. this.workForm.domains.splice(i,1)
  7823. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7824. if (!this.originCanEdit) {
  7825. let iscan = false
  7826. for(let i in this.workForm.domains){
  7827. if(this.workForm.domains[i].canEdit){
  7828. iscan = true
  7829. }
  7830. }
  7831. this.canEdit = iscan
  7832. }
  7833. //检测当前剩下的一个,时间类型是否是全天
  7834. if (this.reportTimeType.type == 0) {
  7835. if (this.workForm.domains[0].timeType == 0) {
  7836. this.showAddMore = false;
  7837. } else {
  7838. this.showAddMore = true;
  7839. }
  7840. }
  7841. if(this.user.timeType.multiWorktime == 1) {
  7842. this.iptChangs()
  7843. } else {
  7844. this.seleChn(0)
  7845. }
  7846. },
  7847. // 改变月份
  7848. changeMonth() {
  7849. this.isWeekend = false
  7850. let date = new Date()
  7851. let nowmon = date.getMonth() + 1
  7852. let nowday = date.getDate()
  7853. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7854. if (this.isBatch == 0) {
  7855. if(this.user.timeType.fillAhead == 0){
  7856. let date_a = new Date(this.workForm.createDate)
  7857. if(date_a.getTime() > date.getTime()){
  7858. this.workForm.createDate = nowdate
  7859. }
  7860. }
  7861. //只有按天填报才能获取当天的日报
  7862. if(!this.isSubstitude){
  7863. let weekday = new Date(this.workForm.createDate).getDay()
  7864. if(this.user.companyId == 817){
  7865. if(weekday == 0){
  7866. this.isWeekend = true
  7867. }
  7868. }else{
  7869. if(weekday == 0 || weekday == 6){
  7870. this.isWeekend = true
  7871. }
  7872. }
  7873. this.getReport()
  7874. } else {
  7875. //获取代填人员的考勤
  7876. if (this.user.timeType.showCorpwxCardtime == 1) {
  7877. this.getTargetUserCardTime();
  7878. }
  7879. }
  7880. }else {
  7881. if(this.user.timeType.fillAhead == 0){
  7882. let date_a = new Date(this.workForm.createDate[1])
  7883. if(date_a.getTime() > date.getTime()){
  7884. this.workForm.createDate[1] = nowdate
  7885. let sdate = new Date(this.workForm.createDate[0])
  7886. let edate = new Date(this.workForm.createDate[1])
  7887. if(sdate > edate){
  7888. this.workForm.createDate[0] = this.workForm.createDate[1]
  7889. }
  7890. }
  7891. }
  7892. }
  7893. },
  7894. // 判断时间段
  7895. fns() {
  7896. for (let k in this.dateAr) {
  7897. if (!this.judege(k)) {
  7898. return false
  7899. }
  7900. }
  7901. return true
  7902. },
  7903. judege(idx){
  7904. for (let k in this.dateAr) {
  7905. if (idx !== k) {
  7906. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7907. return false
  7908. }
  7909. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7910. return false
  7911. }
  7912. }
  7913. }
  7914. return true
  7915. },
  7916. getOverlapData(data) {
  7917. let overlapData = [];
  7918. for (let i = 0; i < data.length; i++) {
  7919. for (let j = i + 1; j < data.length; j++) {
  7920. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7921. overlapData.push(data[i], data[j]);
  7922. }
  7923. }
  7924. }
  7925. return overlapData;
  7926. },
  7927. // 保存日报111111
  7928. submitReport(isDraft) {
  7929. this.isDraft = isDraft;
  7930. this.$refs.workForm.validate(valid => {
  7931. if (valid) {
  7932. if (!isDraft) {
  7933. //针对苏州景昱,单独的检查逻辑
  7934. if (this.user.companyId == 5978) {
  7935. //调接口,先检查工时是否存在异常
  7936. var totalTime = 0;
  7937. for (var t=0;t<this.workForm.domains.length; t++) {
  7938. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7939. }
  7940. var array = [];
  7941. if (this.isBatch) {
  7942. var startDate = new Date(this.workForm.createDate[0]);
  7943. var endDate = new Date(this.workForm.createDate[1]);
  7944. if (startDate > endDate) {
  7945. this.$message({
  7946. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7947. type: "error"
  7948. });
  7949. return
  7950. } else {
  7951. while(true){
  7952. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7953. array.push(workData);
  7954. startDate.setDate(startDate.getDate() + 1);
  7955. if (startDate > endDate) {
  7956. break;
  7957. }
  7958. }
  7959. }
  7960. } else {
  7961. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7962. array.push(workData)
  7963. }
  7964. this.submitingReport = true;
  7965. var passUserId = this.user.id;
  7966. if (this.isSubstitude) {
  7967. passUserId = this.targetUids;
  7968. }
  7969. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7970. res => {
  7971. this.submitingReport = false;
  7972. if (res.code == "ok") {
  7973. this.submitReportSon()
  7974. } else {
  7975. this.$confirm(res.msg, this.$t('other.prompts'), {
  7976. confirmButtonText: this.$t('huLveBingTiJiao'),
  7977. cancelButtonText: this.$t('btn.cancel'),
  7978. type: 'error'
  7979. }).then(() => {
  7980. this.submitReportSon()
  7981. }).catch(() => {
  7982. });
  7983. }
  7984. },
  7985. error => {
  7986. this.$message({
  7987. message: error,
  7988. type: "error"
  7989. });
  7990. });
  7991. } else if (this.user.companyId == 469) {
  7992. //试点,针对赛元微电子校验考勤工时
  7993. if (this.workForm.time && this.workForm.time.workHours) {
  7994. if (this.totalReportHours > this.workForm.time.workHours) {
  7995. this.$message({
  7996. message: '填报工时不得超过考勤时长',
  7997. type: "error"
  7998. });
  7999. } else if (this.totalReportHours < this.workForm.time.workHours) {
  8000. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  8001. confirmButtonText: this.$t('btn.determine'),
  8002. cancelButtonText: this.$t('btn.cancel'),
  8003. type: 'warning'
  8004. }).then(() => {
  8005. this.submitReportSon()
  8006. }).catch(() => {
  8007. });
  8008. } else {
  8009. this.submitReportSon();
  8010. }
  8011. } else {
  8012. this.$message({
  8013. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  8014. type: "error"
  8015. });
  8016. }
  8017. } else {
  8018. if(this.totalReportHours < this.user.timeType.allday){
  8019. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  8020. confirmButtonText: this.$t('btn.determine'),
  8021. cancelButtonText: this.$t('btn.cancel'),
  8022. type: 'warning'
  8023. }).then(() => {
  8024. this.submitReportSon()
  8025. }).catch(() => {
  8026. });
  8027. }else{
  8028. this.submitReportSon()
  8029. }
  8030. }
  8031. } else {
  8032. //暂存,不需要检查工时是否超过考勤
  8033. this.submitReportSon()
  8034. }
  8035. }
  8036. });
  8037. },
  8038. submitReportSon() {
  8039. this.dateAr = []
  8040. //检查重叠
  8041. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8042. let alp = []
  8043. if(this.user.timeType.multiWorktime != 1) {
  8044. for(var p in this.workForm.domains) {
  8045. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8046. let objs = {}
  8047. objs.s = this.workForm.domains[p].startTime
  8048. objs.e = this.workForm.domains[p].endTime
  8049. alp.push(objs)
  8050. }
  8051. }
  8052. this.dateAr = alp
  8053. if(this.dateAr.length > 0) {
  8054. let trus = this.fns()
  8055. if(!trus) {
  8056. this.$message({
  8057. message: this.$t('message.Filledtimeperiodsoverlap'),
  8058. type: "error"
  8059. });
  8060. return
  8061. }
  8062. }
  8063. } else {
  8064. for(var p in this.workForm.domains) {
  8065. var slll = this.workForm.domains[p]
  8066. for(var o in slll.worktimeList) {
  8067. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8068. let objs = {}
  8069. objs.s = slll.worktimeList[o].startTime
  8070. objs.e = slll.worktimeList[o].endTime
  8071. alp.push(objs)
  8072. }
  8073. }
  8074. }
  8075. this.dateAr = alp
  8076. if(this.dateAr.length > 0) {
  8077. let trus = this.fns()
  8078. if(!trus) {
  8079. this.$message({
  8080. message: this.$t('message.Filledtimeperiodsoverlap'),
  8081. type: "error"
  8082. });
  8083. return
  8084. }
  8085. }
  8086. }
  8087. }
  8088. //检查子项目
  8089. if (this.user.timeType.subProMustFill == 1) {
  8090. for(var p in this.workForm.domains) {
  8091. var oneProItem = this.workForm.domains[p]
  8092. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8093. //没有选择子项目
  8094. this.$message({
  8095. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8096. type: "error"
  8097. });
  8098. return
  8099. }
  8100. }
  8101. }
  8102. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8103. if (this.user.companyId == this.yuzhongCompId) {
  8104. for(var p in this.workForm.domains) {
  8105. var oneProItem = this.workForm.domains[p]
  8106. if (!oneProItem.extraField1) {
  8107. this.$message({
  8108. message: this.$t('jiaoSeBiTianQingJianCha'),
  8109. type: "error"
  8110. });
  8111. return
  8112. }
  8113. if (!oneProItem.extraField2) {
  8114. this.$message({
  8115. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8116. type: "error"
  8117. });
  8118. return
  8119. }
  8120. if (!oneProItem.extraField3) {
  8121. this.$message({
  8122. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8123. type: "error"
  8124. });
  8125. return
  8126. }
  8127. }
  8128. }
  8129. // return
  8130. //代填的情况,检查人员是否已经选择
  8131. if (this.isSubstitude) {
  8132. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8133. this.$message({
  8134. message: this.$t('message.pleaseselectthepersontofillin'),
  8135. type: "error"
  8136. });
  8137. return;
  8138. }
  8139. }
  8140. //检查时间,全天和上下午不能同时存在
  8141. if (this.reportTimeType.type == 0) {
  8142. var alldayNum = 0;
  8143. var amNum = 0;
  8144. var pmNum = 0;
  8145. for(var i in this.workForm.domains) {
  8146. if (this.workForm.domains[i].timeType == 0) {
  8147. alldayNum ++;
  8148. } else if (this.workForm.domains[i].timeType == 1) {
  8149. amNum++;
  8150. } else if (this.workForm.domains[i].timeType == 2) {
  8151. pmNum++;
  8152. }
  8153. }
  8154. if (alldayNum > 1) {
  8155. this.$message({
  8156. // message: "工作时间-全天,只能选择一次",
  8157. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8158. type: "error"
  8159. });
  8160. return;
  8161. }
  8162. if (amNum > 1) {
  8163. this.$message({
  8164. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8165. type: "error"
  8166. });
  8167. return;
  8168. }
  8169. if (pmNum > 1) {
  8170. this.$message({
  8171. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8172. type: "error"
  8173. });
  8174. return;
  8175. }
  8176. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8177. this.$message({
  8178. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8179. type: "error"
  8180. });
  8181. return;
  8182. }
  8183. } else if (this.reportTimeType.type == 3) {
  8184. //总百分比不能超过100%
  8185. let total = 0;
  8186. this.workForm.domains.forEach(w=>{total += w.progress});
  8187. if (total > 100) {
  8188. this.$message({
  8189. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8190. type: "error"
  8191. });
  8192. return;
  8193. } else if (total < 100) {
  8194. this.$message({
  8195. message: this.$t('message.cannotbesubmitted'),
  8196. type: "error"
  8197. });
  8198. return;
  8199. }
  8200. }
  8201. this.listLoading = true;
  8202. let formData = new FormData();
  8203. formData.append("draft", this.isDraft);
  8204. var totalTime = 0;
  8205. for (var t=0;t<this.workForm.domains.length; t++) {
  8206. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8207. }
  8208. //批量填报不校验考勤时长,交给后台校验
  8209. if (!this.isBatch) {
  8210. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8211. if (this.workForm.time){
  8212. if (this.workForm.time.workHours == 0){
  8213. this.$message({
  8214. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8215. type: 'error'
  8216. })
  8217. return
  8218. }
  8219. }else{
  8220. this.$message({
  8221. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8222. type: 'error'
  8223. })
  8224. return
  8225. }
  8226. }
  8227. }
  8228. //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
  8229. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
  8230. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8231. this.$message({
  8232. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8233. type: "error"
  8234. });
  8235. return;
  8236. }
  8237. }
  8238. for(var i in this.workForm.domains) {
  8239. // 检查任务/里程碑是否为必填
  8240. let taskRequired = this.user.timeType.taskRequired
  8241. if(taskRequired == 1) {
  8242. if(!this.workForm.domains[i].taskId) {
  8243. this.$message({
  8244. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8245. type: "error"
  8246. });
  8247. return
  8248. }
  8249. }
  8250. if(this.user.timeType.reportAuditType == 3){
  8251. let audItem = {}
  8252. let auditRule = ''
  8253. if(this.workForm.domains[i].id){
  8254. audItem.reportId = this.workForm.domains[i].id
  8255. }
  8256. if(this.user.timeType.auditLevel > 0){
  8257. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8258. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8259. }
  8260. if(this.user.timeType.auditLevel > 1){
  8261. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8262. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8263. }
  8264. if(this.user.timeType.auditLevel > 2){
  8265. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8266. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8267. }
  8268. if(this.workForm.domains[i].ccUserid){
  8269. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8270. }
  8271. if(auditRule){
  8272. auditRule = auditRule.substring(0,auditRule.length - 1)
  8273. this.$message({
  8274. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8275. type: 'error'
  8276. })
  8277. return
  8278. }
  8279. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8280. }
  8281. if (this.user.timeType.customDegreeActive) {
  8282. if (this.user.timeType.customDegreeMultiple) {
  8283. //多选
  8284. if (this.workForm.domains[i].multiDegrIdArray) {
  8285. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8286. degreeArray = degreeArray.replace(/,/g,"@");
  8287. formData.append("multiDegrId", degreeArray);
  8288. } else {
  8289. formData.append("multiDegrId", '[]');
  8290. }
  8291. } else {
  8292. //单选
  8293. if (this.workForm.domains[i].degreeId) {
  8294. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8295. } else {
  8296. formData.append("degreeId", -1);
  8297. }
  8298. }
  8299. } else {
  8300. formData.append("degreeId", -1);
  8301. }
  8302. if(this.workForm.domains[i].customData) {
  8303. // var sss = this.workForm.domains[i].degreeId.toString()
  8304. formData.append("customData", this.workForm.domains[i].customData);
  8305. } else {
  8306. formData.append("customData", 0);
  8307. }
  8308. if(this.workForm.domains[i].customText) {
  8309. formData.append("customText", this.workForm.domains[i].customText);
  8310. } else {
  8311. formData.append("customText", '-');
  8312. }
  8313. if (this.workForm.domains[i].id) {
  8314. formData.append("id", this.workForm.domains[i].id);
  8315. } else {
  8316. formData.append("id", -1);
  8317. }
  8318. formData.append("projectId", this.workForm.domains[i].projectId);
  8319. if (this.workForm.domains[i].subProjectId) {
  8320. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8321. } else {
  8322. formData.append("subProjectId", 0);
  8323. }
  8324. if (this.workForm.domains[i].groupId) {
  8325. formData.append("groupId", this.workForm.domains[i].groupId);
  8326. } else {
  8327. formData.append("groupId", 0);
  8328. }
  8329. if (this.workForm.domains[i].taskId) {
  8330. formData.append("taskId", this.workForm.domains[i].taskId);
  8331. } else {
  8332. formData.append("taskId", 0);
  8333. }
  8334. if (this.workForm.domains[i].taskFinish == true) {
  8335. formData.append("taskFinish", 1);
  8336. } else {
  8337. formData.append("taskFinish", 0);
  8338. }
  8339. formData.append("reportTimeType", this.reportTimeType.type);
  8340. if (this.reportTimeType.type == 0) {
  8341. formData.append("timeType", this.workForm.domains[i].timeType);
  8342. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8343. formData.append("workingTime", workingTime);
  8344. } else if (this.reportTimeType.type == 1){
  8345. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8346. } else if (this.reportTimeType.type == 2) {
  8347. formData.append("endTime", this.workForm.domains[i].endTime);
  8348. formData.append("startTime", this.workForm.domains[i].startTime);
  8349. } else if (this.reportTimeType.type == 3) {
  8350. //按比例分配
  8351. formData.append("progress", this.workForm.domains[i].progress);
  8352. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8353. }
  8354. if(this.user.timeType.choseFromAlbum == 1 ) {
  8355. console.log(this.workForm.domains[i].imgList)
  8356. if(this.workForm.domains[i].imgList) {
  8357. let imgListFor = this.workForm.domains[i].imgList
  8358. for(var b in imgListFor) {
  8359. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8360. }
  8361. console.log(imgListFor)
  8362. let m = JSON.stringify(imgListFor);
  8363. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8364. formData.append("picStr", m);
  8365. } else {
  8366. formData.append("picStr", '[]');
  8367. }
  8368. }
  8369. //处理多个时间事项
  8370. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8371. if (this.reportTimeType.multiWorktime == 1) {
  8372. //检查时间是否有重叠
  8373. var workList = this.workForm.domains[i].worktimeList;
  8374. for (var j=0;j<workList.length; j++) {
  8375. var curItem = workList[j];
  8376. //检查开始时间是否大于结束时间
  8377. if (curItem.startTime >= curItem.endTime) {
  8378. this.$message({
  8379. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8380. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8381. type: "error"
  8382. });
  8383. return;
  8384. }
  8385. //时间不可重叠
  8386. if (this.reportTimeType.timeCanOverlap == 0) {
  8387. for (var p = j+1;p<workList.length; p++) {
  8388. var jItem = workList[p];
  8389. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8390. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8391. this.$message({
  8392. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8393. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8394. type: "error"
  8395. });
  8396. return;
  8397. }
  8398. }
  8399. }
  8400. }
  8401. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8402. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8403. formData.append("content", m);
  8404. } else {
  8405. if (this.workForm.domains[i].content) {
  8406. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8407. m = m.replace(/,/g,",");
  8408. console.log(m, '需要传值的数据')
  8409. // formData.append("content", this.workForm.domains[i].content);
  8410. formData.append("content", m);
  8411. } else {
  8412. formData.append("content", '-');
  8413. }
  8414. }
  8415. if (this.isBatch == 0) {
  8416. formData.append("createDate", this.workForm.createDate);
  8417. } else {
  8418. //批量填报,时间范围
  8419. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8420. }
  8421. if(this.workForm.domains[i].isOvertime) {
  8422. formData.append("isOvertime", 1);
  8423. } else {
  8424. formData.append("isOvertime", 0);
  8425. }
  8426. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8427. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8428. } else {
  8429. formData.append("overtimeHours", 0);
  8430. }
  8431. if(this.workForm.domains[i].basecostId) {
  8432. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8433. } else {
  8434. formData.append("basecostId", 0);
  8435. }
  8436. if (this.workForm.userId != null) {
  8437. var targetUids = '';
  8438. this.workForm.userId.forEach(u=>{
  8439. targetUids += u + '@';
  8440. });
  8441. if (targetUids.length > 0) {
  8442. targetUids = targetUids.substring(0, targetUids.length -1);
  8443. formData.append("targetUids", targetUids);
  8444. }
  8445. }
  8446. //项目专业进度
  8447. if (this.workForm.domains[i].professionProgress) {
  8448. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8449. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8450. formData.append("professionProgress", m);
  8451. } else {
  8452. formData.append("professionProgress", "[]");
  8453. }
  8454. if (this.workForm.domains[i].stage) {
  8455. formData.append("stage", this.workForm.domains[i].stage);
  8456. } else {
  8457. formData.append("stage", "-");
  8458. }
  8459. if (this.workForm.domains[i].projectAuditorId) {
  8460. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8461. } else {
  8462. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8463. this.$message({
  8464. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8465. type: "error"
  8466. });
  8467. return;
  8468. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8469. //分组负责人先审核, 确定是选择了任务分组
  8470. if (this.workForm.domains[i].taskGroups.length == 0) {
  8471. this.$message({
  8472. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8473. type: "error"
  8474. });
  8475. return;
  8476. } else if (!this.workForm.domains[i].groupId) {
  8477. // console.log(this.workForm.domains[i]);
  8478. this.$message({
  8479. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8480. type: "error"
  8481. });
  8482. return;
  8483. }
  8484. }
  8485. }
  8486. if (this.user.companyId == this.yuzhongCompId) {
  8487. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8488. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8489. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8490. }
  8491. //依斯贝的服务Id
  8492. if (this.user.companyId == this.yisibeiCompId) {
  8493. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8494. }
  8495. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8496. this.$message({
  8497. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8498. type: "error"
  8499. });
  8500. return
  8501. }
  8502. if(this.user.timeType.userWithMultiDept == 1) {
  8503. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8504. }
  8505. if(this.user.timeType.reportExtraField4Name) {
  8506. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8507. }
  8508. if(this.user.timeType.reportExtraField5Name) {
  8509. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8510. }
  8511. }
  8512. this.submitingReport = true;
  8513. this.http.uploadFile( this.port.report.editPort, formData,
  8514. res => {
  8515. this.listLoading = false;
  8516. this.submitingReport = false;
  8517. if (res.code == "ok") {
  8518. if(res.msg!=null){
  8519. this.$message({
  8520. dangerouslyUseHTMLString: true,
  8521. message: res.msg,
  8522. type: "warning",
  8523. showClose: true,
  8524. duration: 0
  8525. });
  8526. }else{
  8527. this.$message({
  8528. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8529. type: "success"
  8530. });
  8531. }
  8532. this.dialogVisible = false;
  8533. this.jsDay = 0
  8534. this.jsTime = 0
  8535. this.getReportList();
  8536. this.getDepartment();
  8537. this.getRecentlyProject()
  8538. } else {
  8539. this.$message({
  8540. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8541. type: "error"
  8542. });
  8543. }
  8544. },
  8545. error => {
  8546. this.listLoading = false;
  8547. this.submitingReport = false;
  8548. this.$message({
  8549. message: error,
  8550. type: "error"
  8551. });
  8552. });
  8553. },
  8554. // 判断是展示那个工时导入
  8555. imports() {
  8556. if(this.user.timeType.syncCorpwxTime == 0) {
  8557. this.importDialog = true
  8558. } else {
  8559. this.importWxDialog = true
  8560. }
  8561. },
  8562. // 跳转
  8563. junpToDeskTop(id) {
  8564. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8565. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8566. },
  8567. // 通过日报
  8568. approve(id, item) {
  8569. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8570. this.approveinData = {
  8571. id: id,
  8572. date: this.date +day,
  8573. reportIds: item.id
  8574. }
  8575. if(this.user.timeType.needEvaluate == 1){
  8576. this.$set(this.approveinData,'evaluate','')
  8577. this.approveinDialog = true
  8578. }else{
  8579. this.logining = true;
  8580. this.approveinfun()
  8581. }
  8582. },
  8583. approveinfun(){
  8584. this.http.post( this.port.report.approve, this.approveinData,
  8585. res => {
  8586. this.logining = false;
  8587. if (res.code == "ok") {
  8588. this.approveinDialog = false
  8589. this.$message({
  8590. message: this.$t('message.Reviewsucceeded'),
  8591. type: "success"
  8592. });
  8593. this.refreshReportData(this.approveinData.reportIds);
  8594. this.getDepartment();
  8595. } else {
  8596. this.$message({
  8597. message: res.msg,
  8598. type: "error"
  8599. });
  8600. }
  8601. },
  8602. error => {
  8603. this.logining = false;
  8604. this.$message({
  8605. message: error,
  8606. type: "error"
  8607. });
  8608. });
  8609. },
  8610. //撤回日报
  8611. cancel(item,e) {
  8612. // console.log('can can need',item);
  8613. this.logining = true;
  8614. var ids = '';
  8615. var data = e ? item : item.data;
  8616. data.forEach(element => {
  8617. if(element.id){
  8618. ids +=(element.id+',');
  8619. }
  8620. });
  8621. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8622. res => {
  8623. this.logining = false;
  8624. if (res.code == "ok") {
  8625. this.$message({
  8626. message:this.$t('message.Withdrawalsucceeded'),
  8627. type: "success"
  8628. });
  8629. this.getReportList();
  8630. if(e){this.getReport()}
  8631. this.getDepartment();
  8632. } else {
  8633. this.$message({
  8634. message: res.msg,
  8635. type: "error"
  8636. });
  8637. }
  8638. },
  8639. error => {
  8640. this.logining = false;
  8641. this.$message({
  8642. message: error,
  8643. type: "error"
  8644. });
  8645. });
  8646. },
  8647. showDenyDialog(id,i, item) {
  8648. this.denyReasonDialog = true;
  8649. this.isDenying = false;
  8650. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8651. var ids = item.id;
  8652. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8653. },
  8654. // 未通过日报
  8655. deny() {
  8656. this.logining = true;
  8657. this.isDenying = true;
  8658. this.http.post( this.port.report.deny, this.denyForm,
  8659. res => {
  8660. this.logining = false;
  8661. this.isDenying = false;
  8662. if (res.code == "ok") {
  8663. this.$message({
  8664. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8665. type: "success"
  8666. });
  8667. this.refreshReportData(this.denyForm.reportIds);
  8668. this.getDepartment();
  8669. this.denyReasonDialog = false;
  8670. } else {
  8671. this.$message({
  8672. message: res.msg,
  8673. type: "error"
  8674. });
  8675. }
  8676. },
  8677. error => {
  8678. this.logining = false;
  8679. this.$message({
  8680. message: error,
  8681. type: "error"
  8682. });
  8683. });
  8684. },
  8685. // 查看工时记录弹窗
  8686. toView() {
  8687. this.toViewDialogVisible = true
  8688. this.toViewloading = true
  8689. this.getToView()
  8690. },
  8691. getToView() {
  8692. this.http.post( '/report-import-log/getList', this.toViewForm,
  8693. res => {
  8694. this.toViewloading = false;
  8695. if (res.code == "ok") {
  8696. // console.log(res.data, '数据数据')
  8697. this.toViewList = res.data.records
  8698. this.toViewForm.total = res.data.total
  8699. } else {
  8700. this.toViewloading = false;
  8701. this.$message({
  8702. message: res.msg,
  8703. type: "error"
  8704. });
  8705. }
  8706. })
  8707. },
  8708. // 触发 selectCat 组件更改他的值
  8709. selectCatCli(obj) {
  8710. // console.log(obj, '看看')
  8711. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8712. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8713. },
  8714. vueCasader(obj) {
  8715. if(obj.distinction == 1 && obj.item) {
  8716. let arr = []
  8717. arr.push(obj.item.value)
  8718. this.exportParam.departmentId = arr
  8719. }
  8720. if(obj.distinction == '10' && obj) {
  8721. const { id, other } = obj
  8722. this.workForm.domains[other].reportTargetDeptId = id
  8723. }
  8724. if(obj.distinction == '14' && obj) {
  8725. let arr = []
  8726. arr.push(obj.id)
  8727. this.deptIdForHasReport = arr
  8728. this.showMonthWorkTime()
  8729. }
  8730. if(obj.distinction == '15' && obj) {
  8731. let arr = []
  8732. arr.push(obj.id)
  8733. this.deptIdForNoReport = arr
  8734. this.showMonthNotWorkTime()
  8735. }
  8736. if(obj.distinction == '16' && obj) {
  8737. let arr = []
  8738. arr.push(obj.id)
  8739. this.deptIdForReminder = arr
  8740. this.showMonthWorkTimeReminder()
  8741. }
  8742. if(obj.distinction == '17' && obj) {
  8743. let arr = []
  8744. arr.push(obj.id)
  8745. this.deptIdForHasReport = arr
  8746. this.showReportTimeLessThanCardTimeList();
  8747. }
  8748. },
  8749. //分页
  8750. handleCurrentChange(val) {
  8751. this.toViewForm.pageIndex = val;
  8752. this.getToView();
  8753. },
  8754. handleSizeChange(val) {
  8755. this.toViewForm.pageSize = val;
  8756. this.getToView();
  8757. },
  8758. getAllUsersList(){
  8759. this.http.post('/user/getSimpleActiveUserList',{
  8760. },res => {
  8761. if(res.code == 'ok'){
  8762. this.allUsersList = res.data
  8763. }else{
  8764. this.$message({
  8765. message: res.msg,
  8766. type: 'error'
  8767. })
  8768. }
  8769. },err => {
  8770. this.$message({
  8771. message: err,
  8772. type: 'error'
  8773. })
  8774. })
  8775. },
  8776. //景昱变更提醒
  8777. changeReminder(item){
  8778. let parameter={
  8779. startDate: this.WorktimeDatepickValue[0],
  8780. endDate: this.WorktimeDatepickValue[1],
  8781. }
  8782. if(item){
  8783. parameter.createDate=item.createDate,
  8784. parameter.userId=item.userId
  8785. }
  8786. this.remindering = true;
  8787. this.http.post('/report/changeReminder',parameter,res => {
  8788. this.remindering = false;
  8789. if(res.code == 'ok'){
  8790. this.$message({
  8791. message: res.msg,
  8792. type: 'success'
  8793. })
  8794. }else{
  8795. this.$message({
  8796. message: res.msg,
  8797. type: 'error'
  8798. })
  8799. }
  8800. },err => {
  8801. this.$message({
  8802. message: err,
  8803. type: 'error'
  8804. })
  8805. })
  8806. },
  8807. //景昱取消异常
  8808. cancelReminder(item){
  8809. let parameter={}
  8810. if(item){
  8811. parameter.createDate=item.createDate,
  8812. parameter.userId=item.userId
  8813. }
  8814. this.http.post('/report/cancelReminder',parameter,res => {
  8815. if(res.code == 'ok'){
  8816. this.$message({
  8817. message: res.msg,
  8818. type: 'success'
  8819. })
  8820. }else{
  8821. this.$message({
  8822. message: res.msg,
  8823. type: 'error'
  8824. })
  8825. }
  8826. },err => {
  8827. this.$message({
  8828. message: err,
  8829. type: 'error'
  8830. })
  8831. })
  8832. this.showMonthWorkTimeReminder()
  8833. },
  8834. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8835. fillWeekCustomClne() {
  8836. this.fillWeekDialogVisiCustom = false
  8837. },
  8838. fillWeekCustomClneTwo() {
  8839. this.fillWeekDialogVisiCustomTwo = false
  8840. },
  8841. fillWeekCustomSubmit() {
  8842. this.getReportList();
  8843. this.getDepartment();
  8844. this.getRecentlyProject()
  8845. },
  8846. // 待填日报姓名搜索
  8847. nameAearchSeek(flg) {
  8848. if(!this.nameAearch) {
  8849. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8850. return
  8851. }
  8852. if(flg) {
  8853. this.enterpriseWechatgetUser()
  8854. }
  8855. },
  8856. handleThreeData(userList) {
  8857. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8858. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8859. },
  8860. // 过滤树节点
  8861. filterTreeNodes(treeData, filterKeywords) {
  8862. return treeData.filter((node) => {
  8863. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8864. if (node.children && node.children.length > 0) {
  8865. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8866. }
  8867. return true;
  8868. }
  8869. if (node.children && node.children.length > 0) {
  8870. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8871. return node.children.length > 0;
  8872. }
  8873. return false;
  8874. });
  8875. },
  8876. // 企业微信获取人员
  8877. enterpriseWechatgetUser() {
  8878. this.deptMembDataLoading = true
  8879. this.http.post('/user/getEmployeeList',{
  8880. departmentId: -1,
  8881. pageIndex: 1,
  8882. pageSize: 100,
  8883. keyword: this.nameAearch,
  8884. status: '',
  8885. roleId: '',
  8886. cursor: '',
  8887. onlyDirect: '',
  8888. matchingType: ''
  8889. },res => {
  8890. if(res.code == 'ok'){
  8891. this.deptMembDataLoading = false
  8892. const userListName = res.data.records.map(item => item.name)
  8893. this.handleThreeData(userListName)
  8894. setTimeout(() => {
  8895. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8896. }, 200)
  8897. }else{
  8898. this.deptMembDataLoading = false
  8899. this.$message({
  8900. message: res.msg,
  8901. type: 'error'
  8902. })
  8903. }
  8904. },err => {
  8905. this.deptMembDataLoading = false
  8906. this.$message({
  8907. message: err,
  8908. type: 'error'
  8909. })
  8910. })
  8911. },
  8912. changeTreeNodeStatus(node) {
  8913. let allZt = true
  8914. node.expanded = allZt
  8915. for (let i = 0; i < node.childNodes.length; i++) {
  8916. node.childNodes[i].expanded = allZt
  8917. if (node.childNodes[i].childNodes.length > 0) {
  8918. this.changeTreeNodeStatus(node.childNodes[i])
  8919. }
  8920. }
  8921. },
  8922. // 按周填报获取相关任务
  8923. async getWeeklyTaskList(item) {
  8924. const { projectId, groupId, stage, taskId } = item
  8925. let parms = { projectId, isSubstitude: 0 }
  8926. groupId ? parms.groupId = groupId : ''
  8927. stage ? parms.stage = stage : ''
  8928. const { data } = await this.postData('/task/getRecentTask', parms)
  8929. this.zhoBao.taskId = taskId
  8930. this.$set(this.zhoBao, 'taskList', data)
  8931. },
  8932. // 封装 post 请求
  8933. postData(url, params) {
  8934. return new Promise((resolve, reject) => {
  8935. this.http.post(url, { ...params },
  8936. res => {
  8937. resolve(res)
  8938. },
  8939. error => {
  8940. this.$message({
  8941. message: error,
  8942. type: "error"
  8943. });
  8944. reject(error)
  8945. })
  8946. })
  8947. },
  8948. // 自定义事件
  8949. selectCal(obj) {
  8950. if(obj.distinction == '1') {
  8951. this.zhoBao.projectAuditorId = obj.id
  8952. } else if(obj.distinction == '2') {
  8953. this.zhoBao.auditorFirst = obj.id
  8954. } else if(obj.distinction == '3') {
  8955. this.zhoBao.auditorSec = obj.id
  8956. } else if(obj.distinction == '4') {
  8957. this.zhoBao.auditorThird = obj.id
  8958. } else if(obj.distinction == '5') {
  8959. this.zhoBao.ccUserid = obj.id
  8960. } else if(obj.distinction == '12') {
  8961. this.usersListId = obj.id
  8962. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8963. this.searchKeyword = obj.name
  8964. } else {
  8965. this.searchKeyword = ''
  8966. }
  8967. this.searchScreen(0)
  8968. } else if(obj.distinction == '13') {
  8969. this.usersListId = obj.id
  8970. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8971. this.searchKeyword = obj.name
  8972. } else {
  8973. this.searchKeyword = ''
  8974. }
  8975. this.searchScreen(1)
  8976. } else if(obj.distinction == '15') {
  8977. this.usersListId = obj.id
  8978. this.showReportTimeLessThanCardTimeList();
  8979. }
  8980. }
  8981. },
  8982. created() {
  8983. this.getUsers()
  8984. let height = window.innerHeight;
  8985. this.tableHeight = height - 178;
  8986. const that = this;
  8987. window.onresize = function temp() {
  8988. that.tableHeight = window.innerHeight - 178;
  8989. };
  8990. this.toViewForm.companyId = this.user.companyId
  8991. this.initDrag([{
  8992. type: "LR",
  8993. domClass: {
  8994. // 中间分割线的名字
  8995. resize: "line-line",
  8996. // 左侧盒子的名字
  8997. left: "box-left",
  8998. // 右侧盒子的名字
  8999. right: "box-right",
  9000. // 父级的名字
  9001. box: "box-father",
  9002. },
  9003. otherInfo: {
  9004. // 限制左边栏最低宽度
  9005. leftWidth: 120,
  9006. },
  9007. },
  9008. {
  9009. type: "LR",
  9010. domClass: {
  9011. // 中间分割线的名字
  9012. resize: "line-second",
  9013. // 左侧盒子的名字
  9014. left: "left-laowang",
  9015. // 右侧盒子的名字
  9016. right: "box-second-father",
  9017. // 父级的名字
  9018. box: "grand",
  9019. },
  9020. otherInfo: {
  9021. // 限制左边栏最低宽度
  9022. leftWidth: 120,
  9023. },
  9024. },
  9025. ]);
  9026. }
  9027. };
  9028. </script>
  9029. <style lang="scss" scoped>
  9030. @import "../../assets/scss/handle";
  9031. .themeFontColor {
  9032. @include font_color("color");
  9033. }
  9034. .fillWeekDialogVisiCustom {
  9035. width: 100%;
  9036. height: 70vh;
  9037. }
  9038. .fillWeekCustom {
  9039. .el-dialog__body {
  9040. padding: 20px 20px !important;
  9041. }
  9042. }
  9043. .photos {
  9044. position: relative;
  9045. display: flex;
  9046. flex-wrap: wrap;
  9047. }
  9048. .photos_img {
  9049. width: 120px;
  9050. height: 120px;
  9051. margin-right: 20px;
  9052. margin-bottom: 20px;
  9053. cursor: pointer;
  9054. img {
  9055. width: 100%;
  9056. height: 100%;
  9057. }
  9058. }
  9059. .paginatis {
  9060. padding: 10px 10px;
  9061. background: #f2f2f2;
  9062. }
  9063. .waiting {
  9064. color:orange;
  9065. }
  9066. .filledReportStyle {
  9067. color:#32CD32;
  9068. }
  9069. .RejectStyle {
  9070. color:red;
  9071. }
  9072. .waitSubmitStyle{
  9073. @include font_color("color");
  9074. }
  9075. .chooseDate {
  9076. .waiting {
  9077. @include font_color("color");
  9078. }
  9079. .filledReportStyle {
  9080. @include font_color("color");
  9081. }
  9082. .RejectStyle {
  9083. @include font_color("color");
  9084. }
  9085. .waitSubmitStyle{
  9086. @include font_color("color");
  9087. }
  9088. }
  9089. .allDaily {
  9090. width:100%;
  9091. }
  9092. .report_title {
  9093. padding:10px 0;
  9094. color:#666;
  9095. }
  9096. .clearfix {
  9097. overflow-x: auto;
  9098. white-space: nowrap;
  9099. padding: 15px 0 10px 0;
  9100. // overflow-y: hidden;
  9101. .date_item {
  9102. padding: 0 3px;
  9103. cursor: pointer;
  9104. position: relative;
  9105. }
  9106. .chooseDate {
  9107. position: absolute;
  9108. bottom: -3px;
  9109. width: 37px;
  9110. height: 2px;
  9111. left: 14px;
  9112. @include background_color("background_color");
  9113. }
  9114. }
  9115. .one_daily {
  9116. i {
  9117. @include font_color("color1");
  9118. margin-right: 5px;
  9119. }
  9120. .one_daily_body {
  9121. padding: 10px 0px;
  9122. p {
  9123. margin: 0;
  9124. line-height: 30px;
  9125. }
  9126. }
  9127. ul {
  9128. padding: 0;
  9129. }
  9130. }
  9131. .checkbtn {
  9132. float: right;
  9133. margin-top: -10px;
  9134. }
  9135. .selConStyle{
  9136. margin-top:9rem;
  9137. margin-bottom:11rem;
  9138. .selConStyle_title{
  9139. height: 3rem;
  9140. text-align: center;
  9141. font-size: 17px;
  9142. }
  9143. .el-select{
  9144. margin: 0 15%;
  9145. width: 70%;
  9146. }
  9147. }
  9148. </style>
  9149. <style lang="scss">
  9150. /*去除upload组件过渡效果*/
  9151. .photos .el-upload-list__item {
  9152. transition: none !important;
  9153. }
  9154. .daily {
  9155. .el-card__body {
  9156. height: 80%;
  9157. overflow-y: auto;
  9158. }
  9159. .el-card__header {
  9160. padding: 0 20px;
  9161. }
  9162. }
  9163. .membListClass{
  9164. .el-dialog__body{
  9165. padding-top: 10px;
  9166. }
  9167. }
  9168. // .editReportDialog .el-dialog__footer{
  9169. // position: sticky;
  9170. // bottom: 0;
  9171. // background: #fff;
  9172. // height: 70px;
  9173. // z-index: 1010;
  9174. // }
  9175. .editReportDialog{
  9176. min-width: 800px;
  9177. }
  9178. .touruxiangmu{
  9179. max-width: 1000px;
  9180. }
  9181. </style>
  9182. <style scoped>
  9183. /* 项目标签的样式 */
  9184. .el-tag + .el-tag {
  9185. margin-left: 10px;
  9186. }
  9187. .button-new-tag {
  9188. margin-left: 10px;
  9189. height: 32px;
  9190. line-height: 30px;
  9191. padding-top: 0;
  9192. padding-bottom: 0;
  9193. }
  9194. .input-new-tag {
  9195. width: 90px;
  9196. margin-left: 10px;
  9197. vertical-align: bottom;
  9198. }
  9199. .selectworktime .el-table__fixed-body-wrapper{
  9200. top: 48px !important;
  9201. }
  9202. .selectworktime_export .selectworktime_export_l{
  9203. width: 650px;
  9204. float: left;
  9205. height: 42px;
  9206. }
  9207. .approvalProcessBox{
  9208. margin-left: 30px;
  9209. font-size: 14px;
  9210. line-height: 16px;
  9211. cursor: pointer;
  9212. }
  9213. .approvalProcessBox i {
  9214. margin-right: 0;
  9215. height: 16px;
  9216. width: 16px;
  9217. display: inline-block;
  9218. transform: scale(1.2);
  9219. position: relative;
  9220. top: 0.5px;
  9221. @include font_color("color");
  9222. }
  9223. .approvalProcessBox .approvalProcessClick{
  9224. cursor: pointer;
  9225. @include font_color("color");
  9226. font-size: 14px;
  9227. }
  9228. .approvalProcessBox:hover .approvalProcessClick{
  9229. color: #3485fb;
  9230. }
  9231. </style>
  9232. <style lang="scss" scoped>
  9233. .bionicClass {
  9234. -webkit-appearance: none;
  9235. background-color: #FFF;
  9236. background-image: none;
  9237. border-radius: 4px;
  9238. border: 1px solid #DCDFE6;
  9239. box-sizing: border-box;
  9240. color: #606266;
  9241. display: inline-block;
  9242. height: 40px;
  9243. line-height: 40px;
  9244. outline: 0;
  9245. padding: 0 15px;
  9246. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9247. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9248. width: 350px;
  9249. cursor: pointer;
  9250. .bionicClassText {
  9251. color: #C0C4CC;
  9252. }
  9253. }
  9254. // 加班样式
  9255. .overtime {
  9256. display: inline-block;
  9257. margin-left: 20px;
  9258. input {
  9259. display: inline-block;
  9260. margin-top: 5px;
  9261. }
  9262. }
  9263. .plus {
  9264. display: inline-block;
  9265. }
  9266. // .tages {
  9267. // float: right;
  9268. // }
  9269. .overtime {
  9270. display: inline-block;
  9271. margin-left: 30px;
  9272. }
  9273. .bloks {
  9274. display: inline-block;
  9275. width: 380px;
  9276. }
  9277. .zhiss {
  9278. display: flex;
  9279. justify-content: space-around;
  9280. align-items: center;
  9281. }
  9282. .zhoFel {
  9283. display: flex;
  9284. justify-content: space-between;
  9285. align-items: center;
  9286. }
  9287. // 左右滑动样式
  9288. .line {
  9289. width: 30px;
  9290. /* height: 500px; */
  9291. background: #f2f2f2;
  9292. cursor: w-resize;
  9293. }
  9294. .box-father {
  9295. border: 8px solid #000;
  9296. }
  9297. .line-second {
  9298. width: 10px;
  9299. /* background: red; */
  9300. }
  9301. .flex {
  9302. display: flex;
  9303. width: 100%;
  9304. }
  9305. .box-left {
  9306. flex: 0 0 400px;
  9307. /* height: 600px; */
  9308. /* background: blue; */
  9309. }
  9310. .box-right {
  9311. /* height: 600px; */
  9312. /* background: green; */
  9313. flex: 1;
  9314. }
  9315. .box-postion {
  9316. width: 200px;
  9317. /* height: 400px; */
  9318. background: #ccc;
  9319. }
  9320. .custom-tree-node {
  9321. flex: 1;
  9322. display: flex;
  9323. align-items: center;
  9324. justify-content: space-between;
  9325. font-size: 14px;
  9326. padding-right: 8px;
  9327. }
  9328. .daitianrbao {
  9329. width: 100%;
  9330. box-sizing: border-box;
  9331. height: 40px;
  9332. border-radius: 4px;
  9333. border: 1px solid #DCDFE6;
  9334. overflow: hidden;
  9335. text-overflow: ellipsis;
  9336. display: flex;
  9337. // align-items: center;
  9338. }
  9339. .daitianrbao .spnn {
  9340. display: inline-block;
  9341. box-sizing: border-box;
  9342. padding: 0 15px;
  9343. overflow: hidden;
  9344. text-overflow: ellipsis;
  9345. }
  9346. .daitianrbao .hover {
  9347. color: #DCDFE6 !important;
  9348. }
  9349. </style>