12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665 |
- <template>
- <section >
- <!--列表-->
- <div>
- <el-card class="box-card daily" shadow="never">
- <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
- <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;">
- <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
- style="width:190px;"
- @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
- </div>
- <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
- <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
- @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;' : '') ">
- <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
- <div style="text-align:center;">
- <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
- <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
- <br>
- <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
- <span class="chooseDate" v-if="index == choseDay"></span>
- <!--针对景昱-->
- <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
- <i class="el-icon-warning" style="color:red;"></i>
- </el-tooltip>
- <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
- <i class="el-icon-warning" style="color:red;"></i>
- </el-tooltip>
- </div>
- </div>
- </span>
- </div>
- </div>
- <div style="display:flex;">
- <div class="grand flex">
- <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
- <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
- <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
-
- </div> -->
- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
- <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
- <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
- </el-input>
- <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
- <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
- <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
- <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
- <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
- <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
- <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
- </el-select>
- </div>
- <div>
- <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">
- <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
- <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
- <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
-
- <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
- </span>
-
- <div style="position: absolute;right: 15px;">
- <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
- <!-- 未填报 -->
- {{$t('state.DidNotFillIn')}}
- </span>
- <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'">
- <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
- {{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)')}}
- </span>
- <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
- <!-- 待审核 -->
- {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
- <!-- 已通过 -->
- {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
- <!-- 未通过 -->
- {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- <span v-if="data.isUser == 1 && data.state == 3" style="font-size:13px" class="themeFontColor">
- <!-- 待提交 -->
- {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- </div>
- </span>
- </el-tree>
- </div>
- </div>
- </div>
- <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">
- <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
- -
- -
- -
- </div>
- </div>
- <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
- <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
- <div class="allDaily" style="float:left;flex-grow:1">
- <!--系统管理员和部门负责人 -->
- <div class="report_title" style="display:flex;justify-content: space-between;">
- <span>
- <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
- <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
- <!-- {{depData != null ?depData.label:""}} -->
- <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
- <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
- <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
- </span>
- <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
- <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
- <span v-if="targetUid == null">
- <!-- - 已提交 -->
- -{{$t('state.hasBeenSubmitted')}}
- <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')}},
- <!-- 待提交 -->
- {{$t('state.waitingsubmit')}}
- <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')}},
- <!-- 漏填 -->
- <!-- {{$t('state.missFillReport')}} -->
- {{ $t('other.unfilled') }}
- <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')}}
- <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
- </span>
- </span>
- </span>
- <span style="float:right;">
- <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>
- <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>
- <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>
- <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
- <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>
- <!-- 苏州景昱,按周填报的模式进行代填日报 -->
- <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>
-
- <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>
- <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>
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
- <!--部门负责人给个导出工时的功能 -->
- <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
- <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
- <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>
- <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
- <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>
- <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
- </span>
- </div>
- <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
- <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
- <i class="fa fa-circle"></i>
- <!-- {{item1.name}} -->
- <span v-if="user.userNameNeedTranslate == '1'">
- <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{item1.name}}
- </span>
- <span style="margin-left:30px;">
- <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
- <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
- <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
- </span>
- <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
- <i class="iconfont firerock-iconliucheng1"></i>
- <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
- <!-- 审批流程 -->
- {{$t('other.approvalProcess')}}
- </span>
- </span>
-
- </span>
- <div class="checkbtn" style="padding-right:20px;">
- <!--编辑和删除日报-->
-
- <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>
- <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>
- <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
- </div>
- <div v-if="user.timeType.enableNewWeeklyfill == 1" style="margin-left:20px;">
- <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
- <p v-if="item1.attachment != null" >附件
- <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
- </p>
- </div>
- <div class="one_daily_body">
- <el-timeline>
- <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
- <el-card shadow="never">
- <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
- <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
- <span v-if="user.company.packageEngineering == 0">
- <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
- <span v-if="user.timeType.reportAuditType == 7" >
- {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
- <span v-if="item2.deptAuditorName">、</span>
- <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
- </span>
- <span v-else>
- <span v-if="item2.isDeptAudit==0">
- <span v-if="item2.projectAuditState==0">
- <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
- <span v-if="item2.projectAuditorName != null">(
- <!-- {{item2.projectAuditorName}} -->
- <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
- )</span>
- <!-- 审核 --> {{$t('other.audit')}}
- </span>
- <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
- <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
- <span v-if="item2.projectAuditorName != null">(
- <!-- {{item2.projectAuditorName}} -->
- <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
- )</span>
- <!-- 审核通过 --> {{$t('state.approved')}}
- </span>
- </span>
- <span v-else-if="item2.isDeptAudit==1">
- <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
- ({{$t('other.await')}}
- <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
- {{$t('other.audit')}})
- </span>
- </span>
- ]</span>
- <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
- <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
- </span>
-
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
- </span>
- <!-- <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> -->
- <span v-if="user.company.packageEngineering == 1">
- <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
- <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
- <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
- <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
- (
- <!-- <span v-if="user.userNameNeedTranslate != 1">
- {{item2.projectAuditorName}}
- </span>
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
- </span> -->
- <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
- )
- </span>{{$t('other.audit')}} ]</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
- </span>
- <!--每个项目上单独审核 -->
- <span style="float:right;">
- <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>
- <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"
- size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
- <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"
- size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
- <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"
- @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
- <!--自己可以撤回待审核状态的报告 -->
- <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>
- </span>
- </p>
- <p v-if="user.companyId == yuzhongCompId">
- <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
- <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
- <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
- <!--任务分组和阶段 -->
- <p v-if="item2.groupId != 0">
- {{$t('other.taskGroup')}}:{{item2.groupName}}
- <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>
- </p>
- <!-- 工单号,行号 -->
- <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
- <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
- <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
- <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
- <!-- 自定义日报文本 -->
- <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
- <p v-if="user.company.packageEngineering == 1">
- {{$t('other.professionalProgress')}}:
- <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
- <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
- <i class="iconfont firerock-icondaibandengdaishenhe"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhetongguo"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhebohui"></i>
- </el-tooltip>
- </span>
- </p>
- <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
- <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
- </p>
- <div v-if="item2.multiWorktime==0">
- <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
- <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
- {{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>
- <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
- <span style="margin-right:10px;">{{item2.progress}}%</span>
- </p>
-
- <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
- </div>
- <div v-if="item2.multiWorktime==1" >
- <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>
- <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
- <p style="display: inline-block;">{{$t('time.duration')}}:
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
- {{timeItem.time.toFixed(1)}}h
- <span v-if="timeItem.detail" style="margin-left:10px;">
- {{timeItem.detail}}
- </span>
- </p>
- <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
- </div>
- </div>
- <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
- <!--照片的显示 -->
- <p v-if="item2.pics != null && item2.pics.length > 0">
- <el-image v-for="(pic, index) in item2.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="item2.pics">
- </el-image>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- <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>
- <!-- 简陋的无报告提示 -->
- <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- <!-- 工时推送日志弹窗 -->
- <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
- <template>
- <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
- </template>
- <template>
- <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
- <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
- <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
- <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
- <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
- <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
- <template slot-scope="scope">
- <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
- <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
- </el-table>
- </template>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
- </span>
- </el-dialog>
- <!-- 填写日报的dialog -->
- <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">
- <div style="height: 65vh;overflow: auto;">
- <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
- <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
- <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
- :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
- <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
- <span class="spnn" v-if="workForm.userNames">
- <span v-for="(item, index) in workForm.userNames" :key="index">
- <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
- <span v-if="index < workForm.userNames.length - 1">,</span>
- </span>
- </span>
- <span class="spnn hover" v-else>
- {{$t('defaultText.pleaseSelectAsubstitute')}}
- </span>
- </div>
- </el-form-item>
- <el-form-item :label="$t('screening.workingDate')" prop="createDate">
- <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
- @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
- <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
- <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
- <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>
- <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
- v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
- <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
- <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
- <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>
- <!-- AI智能填报 -->
- <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
- </el-form-item>
- <!--考勤时长显示-->
- <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh">
- <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
- <span v-if="workForm.time.askLeaveTime">| {{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
- <span v-if="workForm.time.otTime" style="color:#FFA500;">| 加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
- </span>
- <!--批量填报不显示考勤记录-->
- <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
- <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
- <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
- <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
- v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
- @click="refreshWXCardTime(workForm.createDate)"></el-button>
- <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
- v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
- @click="refreshDDCardTime(workForm.createDate)"></el-button>
- <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
- v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
- @click="refreshAttendance(workForm.createDate)"></el-button>
- <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
- v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
- @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
-
- <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
- </el-form-item>
- <!-- 000000 -->
- <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
- <div v-if="reportTimeType.multiWorktime==0">
- <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
- <el-select v-model="domain.timeType" style="width:200px;"
- v-if="reportTimeType.type == 0"
- :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- @change="onTimeTypeChange(domain.timeType)">
- <el-option
- v-for="item in timeType"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <!-- 数字时长选择 -->
- <el-select v-model="domain.workingTime" style="width:200px;"
- v-if="reportTimeType.type == 1"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
- @change="seleChn(0,domain)">
- <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
- </el-select>
- <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
- <span v-if="reportTimeType.type == 2">
- <!--时间范围选择 -->
- <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="domain.startTime"
- :placeholder="$t('time.startTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '08:00',
- end: '23:30'
- }"
- @change="iptChang()">
- </el-time-picker> - <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="domain.endTime"
- :placeholder="$t('time.endTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '08:00',
- end: '23:30',
- minTime: domain.startTime
- }"
- @change="iptChang()">
- </el-time-picker>
- </span>
- <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
- <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
- <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>
- </div>
- </el-form-item>
- <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
- :prop="'domains.' + index + '.reportTargetDeptId'"
- :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
- <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
- <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
- <span style="float: left">
- <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
- </span>
- </el-option>
- </el-select>
- <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>
- </el-form-item>
-
- <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
- <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
- @change="selectProject(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
- <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
- <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">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option>
- </el-option-group>
- </el-select>
- <!--昱众不显示子项目-->
- <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
- <span style="margin-left:45px;">
- {{$t('lable.subproject')}}</span>
- <!--子项目 -->
- <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
- <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </template>
- <template v-if="user.companyId == yuzhongCompId">
- <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
- <!--角色选择 -->
- <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
- :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
- <el-option
- v-for="item in roleList"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </template>
-
- <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%;"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
- </el-link>
- <!-- <el-link type="primary" v-if="canEdit"
- :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
- </el-form-item>
- <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">
- <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
- </el-form-item>
- <!--如果设置了工时成本预警的预算成本项-->
- <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
- <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
- <template slot="label">
- <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
- <span >{{$t('lable.taskGrouping')}}</span>
- </template>
- <!-- 任务分组 -->
- <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
- <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <template v-if="user.companyId == yuzhongCompId">
- <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
- <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
- :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
- <el-option
- v-for="item in domain.filteredRespList"
- :key="item.id"
- :label="item.jobRespon"
- :value="item.id">
- </el-option>
- </el-select>
- </template>
- <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
- <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>
- <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
- clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
- @change="changeStages(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </template>
- </el-form-item>
- <!-- 工单号,行号 -->
- <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
- <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
- <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
- <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
- <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
- </el-option>
- </el-select>
- </el-form-item>
- <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">
- <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
- <template slot="label">
- <span style="color:#FF0000;">*</span>
- <span >{{$t('other.projectAuditor')}}</span>
- </template>
-
- <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
- <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
- <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
- <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
- </el-option>
- </el-select>
- <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>
- </el-form-item>
- </div>
- <el-form-item v-if="user.companyId == yuzhongCompId">
- <template slot="label">
- <span style="color:#FF0000;">*</span>
- <span >{{ $t('gongZuoNeiRong') }}</span>
- </template>
- <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
- :disabled="(workForm.domains[index].state>=2?false:true)" >
- <el-option
- v-for="item in domain.workContentList"
- :key="item.id"
- :label="item.workContext"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 111111 -->
- <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
- <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- <template v-if="user.timeType.auditLevel > 1">
- <i class="el-icon-right"></i>
- <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </template>
- <template v-if="user.timeType.auditLevel > 2">
- <i class="el-icon-right"></i>
- <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </template>
- </el-form-item>
- <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
- <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关维度/自定义维度 -->
- <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'">
- <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <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'">
- <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关数值 -->
- <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">
- <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>
- </el-form-item>
- <!-- 自定义文本 -->
- <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">
- <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>
- </el-form-item>
- <!--按比例填报-->
- <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
- <div style="width:400px;">
- <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>
- <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>
- </div>
- <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
- <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>
- </div>
- </el-form-item>
- <!--工程专业版本模式下, 各个专业的进度填报 -->
- <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
- <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
- <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
- <el-input size="mini" style="width:60px;" v-model="item.progress"
- @keyup.native="onProgressChange"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
- </span>
- </el-form-item>
- <!--项目管理专业版模式下,项目下的近期执行的任务 -->
- <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))" >
- <template slot="label" v-if="user.timeType.taskRequired == 1">
- <span style="color:#FF0000;">*</span>
- <span >{{ $t('other.task') }}</span>
- </template>
- <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
- <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
- </el-form-item>
- <!--针对依斯贝的SAP服务-->
- <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
- :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
- <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
- <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!--工作事项-->
- <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
- :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
- <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
- </el-form-item>
- <!-- 拍照上传 -->
- <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
- :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
- <div class="photos">
- <div>
- <el-upload
- list-type="picture-card"
- :http-request="(file) => {return addImg(file, index)}"
- :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
- :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
- :file-list="domain.imgListUrl" :limit="9"
- :disabled="workForm.domains[index].state>=2?false:true">
- <i class="el-icon-plus"></i>
- </el-upload>
- </div>
- </div>
- </el-form-item>
- </div>
- <!--多个工作事项填报的情况 -->
- <div v-if="reportTimeType.multiWorktime==1">
- <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
- <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
- @change="selectProject(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
- <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
- <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">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option>
- </el-option-group>
- </el-select>
- <template v-if="user.timeType.mainProjectState != 1">
- <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
- <!--子项目 -->
- <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
- v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
- <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </template>
- <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;"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
- </el-link>
- <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
- <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>
- </div>
-
- <!-- <el-link type="primary" v-if="canEdit"
- :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
- </el-form-item>
- <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">
- <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
- </el-form-item>
- <!--如果设置了工时成本预警的预算成本项-->
- <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
- <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item v-if="user.company.packageProject == 1">
- <template slot="label">
- <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
- <span >{{$t('lable.taskGrouping')}}</span>
- </template>
- <!-- 任务分组 -->
- <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
- <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <!-- 项目的阶段 -->
- <span v-if="domain.stages != null && domain.stages.length> 0"
- style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
- <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
- clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
- @change="changeStages(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('other.projectAuditor')" >
- <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
- <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
- <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
- <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
- </el-option>
- </el-select>
- <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>
- </el-form-item>
-
- <!--工程专业版本模式下, 各个专业的进度填报 -->
- <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
- <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
- <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
- <el-input size="mini" style="width:60px;" v-model="item.progress"
- @keyup.native="onProgressChange"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
- </span>
- </el-form-item>
- <!-- 相关维度 -->
- <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'">
- <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关数值 -->
- <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">
- <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>
- </el-form-item>
- <!-- 自定义文本 -->
- <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">
- <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
- </el-form-item>
- <!--项目管理专业版模式下,项目下的近期执行的任务 -->
- <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
- <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
- </el-form-item>
- <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
- <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>
- <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
-
- <span v-if="reportTimeType.type == 2">
- <!-- <span> -->
- <!--时间范围选择 -->
- <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="timeItem.startTime"
- :placeholder="$t('time.startTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '00:00',
- end: '23:59',
- }"
- @change="iptChangs()">
- </el-time-picker> - <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="timeItem.endTime"
- :placeholder="$t('time.endTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '00:00',
- end: '23:59',
- minTime: timeItem.startTime
- }"
- @change="iptChangs()">
- </el-time-picker>
- </span>
- <!--工作细项-->
- <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"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
- :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
- <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- ></el-input>
- </el-form-item>
- </div>
- <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
- </div>
- <!--照片的显示 -->
- <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
- <el-image v-for="(pic, index) in domain.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="domain.pics">
- </el-image>
- </p>
- <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
- </div>
- <span id="workFormsItemBottom"></span>
- <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
- <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
- <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
- <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
- <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>
- <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
- :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
- </span>
- </el-dialog>
- <!-- 按周填报 -->
- <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
- <!-- 按周填报-已填工时-点击 -->
- <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
- <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
- <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
- <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
- <el-table-column prop="state" :label="$t('state.states')">
- <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
- </el-table-column>
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
- </span>
- </el-dialog>
- <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
- <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
- :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
- <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
- <span class="spnn" v-if="workForm.userNames">
- <span v-for="(item, index) in workForm.userNames" :key="index">
- <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
- <span v-if="index < workForm.userNames.length - 1">,</span>
- </span>
- </span>
- <span class="spnn hover" v-else>
- {{$t('defaultText.pleaseSelectAsubstitute')}}
- </span>
- </div>
- <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
- </div>
- <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
- <el-form-item style="height:30px;margin-top:-72px;">
- <!-- <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> -->
- <el-button @click="handleGetPrevWeek()" size="small"><<</el-button>
- <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
- <el-button @click="handleGetNextvWeek()" size="small">>></el-button>
- <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>
- <el-option
- v-for="item in fillProjectList"
- :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
- :key="item.id"
- :label="item.projectName + '\u3000' + item.projectCode"
- :value="item.id">
- <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
- <span style="float: right">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
- </el-form-item>
- <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
- <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
- <template slot-scope="scope">
- {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
- </template>
- </el-table-column>
- <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
- <template slot-scope="scope">
- <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
- <p v-else></p>
- </template>
- </el-table-column> -->
- <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
- <template slot-scope="scope">
- <div v-if="scope.row.canFill == 1">
- <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
- <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
- <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>
- <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>
- <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
- </div>
- </template>
- <template v-else>
- <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
- <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>
- <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>
- <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>
- <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
- </div>
- </template>
- <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
- <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>
- <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
- </div>
- </div>
- <div v-else >
- <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
- <template slot-scope="scope">
- <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
- <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
- </span>
- <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
- </template>
- </el-table-column>
-
- <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
- <template slot-scope="scope">
- <div class="zhiss">
- <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
- <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
- <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
- <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
- <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
- <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
- <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
- <!--针对景昱,先检查工时是否存在异常-->
- <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
- </span>
- </el-dialog>
- <!-- 重庆物奇私人定制的按周填报 -->
- <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
- <div class="fillWeekDialogVisiCustom">
- <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
- </div>
- </el-dialog>
- <!-- enableNewWeeklyfill==2 -->
- <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
- <div class="fillWeekDialogVisiCustom">
- <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
- </div>
- </el-dialog>
- <!-- 选择时间 -->
- <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
- <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
- </span>
- </el-dialog>
- <!-- 按周填报弹窗 -->
- <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
- <div>
- <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
- <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
- <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <!--如果设置了工时成本预警的预算成本项-->
- <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
- <p>{{$t('lable.budgetSource')}}</p>
- <el-select v-model="zhoBao.basecostId" style="width: 355px">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </div>
- <!-- 任务分组 -->
- <div class="zhoFel" v-if="user.company.packageProject == 1">
- <p>{{$t('lable.taskGrouping')}}</p>
- <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
- @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
- <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
- <p>{{$t('other.inputStage')}}</p>
- <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
- <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </div>
- <!-- 工单号,行号 -->
- <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
- <p>{{ user.timeType.reportExtraField4Name }}</p>
- <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
- <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
- </el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
- <p>{{ user.timeType.reportExtraField5Name }}</p>
- <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
- <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
- </el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
- <p>{{$t('other.reviewer')}}</p>
- <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
- </div>
- <template v-if="user.timeType.reportAuditType == 3">
- <div class="zhoFel">
- <p>{{ $t('di-yi-shen-he-ren') }}</p>
- <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
- </div>
- <div class="zhoFel">
- <p>{{ $t('di-er-shen-he-ren') }}</p>
- <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
- </div>
- <div class="zhoFel">
- <p>{{ $t('di-san-shen-he-ren') }}</p>
- <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
- </div>
- <div class="zhoFel">
- <p>{{ $t('chao-song-ren') }}</p>
- <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
- </div>
- </template>
- <!-- 自定义维度 -->
- <div class="zhoFel" v-if="user.timeType.customDegreeActive">
- <p>{{user.timeType.customDegreeName}}</p>
- <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
- <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
- <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <!-- 自定义数值 -->
- <div class="zhoFel" v-if="user.timeType.customDataActive">
- <p>{{user.timeType.customDataName}}</p>
- <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>
- </div>
- <!-- 自定义文本 -->
- <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
- <p>{{user.timeType.customTextName}}</p>
- <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
- </div>
- <!-- 选择任务 -->
- <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
- <p>{{ $t('renWuLiChengBei') }}</p>
- <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
- <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 2">
- <p>{{$t('other.timeSelection')}}</p>
- <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>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 1">
- <p>{{$t('other.chooseDuration')}}</p>
- <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
- <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 3">
- <p>{{$t('lable.percentageOfTime')}}</p>
- <div style="width:400px;display: flex;align-items: center;">
- <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>
- <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>
- </div>
- </div>
- <div class="zhoFel">
- <p>{{$t('other.workMatters')}}</p>
- <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
- </span>
- </el-dialog>
- <!--导出报表条件选择 -->
- <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
- <el-form ref="form3" :model="exportParam" >
- <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
- <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
- <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
- <!-- <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>
- <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> -->
- <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
- </el-form-item>
- <el-form-item prop="projectId" :label="$t('time.dateRange')">
- <el-date-picker
- v-model="exportParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </el-form-item>
- <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
- <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
- <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
- <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
- <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
- <div class="exportReportRadio">
- <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
- <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
- <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
- <i class="el-icon-question"></i>
- </el-tooltip>
- </div>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
- </div>
- </el-dialog>
- <!--导出报表条件选择 -->
- <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
- <el-form ref="form3" :model="exportParam" >
- <el-form-item prop="range" :label="$t('time.dateRange')">
- <el-date-picker
- v-model="exportParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
- </div>
- </el-dialog>
- <!--人员列表 -->
- <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
- <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
- <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
- <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="label" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <span>
- <!-- {{(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}} -->
- <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
- <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
- </span>
- <span v-else>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
- </span>
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="deptName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
- <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
- <el-table-column prop="label" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <!-- <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> -->
- <!-- <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> -->
- <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
- <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
- </span>
- <span v-else>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="deptName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="label" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="deptName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
- <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
- <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
- <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
- <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
- </div>
- </el-dialog>
- <!-- 日报审核修改 -->
- <el-dialog
- :title="$t('riBaoShenHeXiuGai')"
- :visible.sync="reportLogCheckDialog"
- width="30%"
- :before-close="handleClose">
- <el-form ref="form3" :model="exportReportLogParam" >
- <el-form-item prop="projectId" :label="$t('time.dateRange')">
- <el-date-picker
- v-model="exportReportLogParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </el-form-item>
- </el-form>
- <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
- <br>
- <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
- <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
- </span>
- </el-dialog>
-
- <!-- 按部门选择人员 -->
- <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
- <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)">
- <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
- </el-input>
- <div class="tree" style="height:400px">
- <el-scrollbar style="height:100%">
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
- ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
- highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
- <span class="custom-tree-node" slot-scope="{ node }">
- <span v-if="user.userNameNeedTranslate == '1'">
- <span v-if="node.data.children">
- <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
- </span>
- <span v-else>
- <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
- </span>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{ node.label }}
- </span>
- <!-- {{ node.label }} -->
- </span>
- </el-tree>
- </el-scrollbar>
- </div>
- <div>{{$t('btn.choose')}} {{chosenMembCount}} {{$t('other.people')}}</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
- </div>
- </el-dialog>
- <el-dialog
- v-if="monthWorkTimeDialog"
- :visible.sync="monthWorkTimeDialog"
- :close-on-click-modal="false"
- customClass="customWidth selectworktime"
- width="92%"
- top="60px"
- >
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane :label="$t('other.completedHours')" name="first">
- <div class="selectworktime_export" style="margin-top:10px;">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- :range-separator="$t('other.to')"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthWorkTime()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
- <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
- <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
-
- <!-- 222 -->
- </div>
- <div>
- <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>
- <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>
- <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">
- <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
- </el-input>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
- </div>
- <div style="float: left; height:32px; padding-top:10px;">
- <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
- <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
- <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
- <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
- </div>
- <div style="float: right; vertical-align: middle;height:32px">
- <el-link
- type="primary"
- @click="exportMembWorkHours()"
- >{{$t('export.exportData')}}</el-link
- >
- </div>
-
-
- </div>
- <el-table ref="hasworkTbl"
- :data="monthWorkDataS"
- v-el-table-infinite-scroll="listScroll"
- border
- :height="'70vh'"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- :lazy="true"
- :cell-style="hasworkTblCellStyle"
- >
- <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
- <template slot-scope="scope">
- {{ scope.$index + 1 }}
- </template>
- </el-table-column>
- <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
- <template slot-scope="scope">
- <span :style="scope.row.worktimeList.length==0?'color:red':''">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
- <!-- {{scope.row.name}} -->
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
- </template>
- </el-table-column>
- <el-table-column
- min-width="60"
- v-for="(item, index) in pickDateArray"
- :key="index"
- :label="item"
- align="center"
- >
- <template slot="header" slot-scope="scope">
- <div>{{ scope.column.label.dateStr }}</div>
- <div>{{ scope.column.label.weekStr }}</div>
- </template>
- <template slot-scope="scope">
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>
- w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime < reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime.toFixed(1)
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime > reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime.toFixed(1)
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime == reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length == 0
- "
- >
- 0
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- typeof scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime == 'string'
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <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>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
- </el-tab-pane>
- <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
- <div class="selectworktime_export" style="margin-top:10px">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- :range-separator="$t('other.to')"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthNotWorkTime()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
- <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
- <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
-
- </div>
- <div>
- <div style="margin-top:10px;">
- <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>
- <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>
- <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">
- <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
- </el-input>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
- <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
- <el-link
- type="primary"
- style="float: right; vertical-align: middle;height:32px"
- @click="exportMembNotWorkHours()"
- >{{$t('export.exportData')}}</el-link
- >
- </div>
- </div>
-
- </div>
- <el-table
- ref="hasworkTbl2"
- :data="monthNotWorkDateS"
- v-el-table-infinite-scroll="notListScroll"
- border
- :height="'70vh'"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- lazy
- >
- <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
- </template>
- </el-table-column>
- <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
- </template>
- </el-table-column>
- <el-table-column
- min-width="200"
- :label="$t('weekDay.date')"
- align="center"
- prop="createDate"
- >
- </el-table-column>
- <el-table-column
- min-width="200"
- :label="$t('state.states')"
- align="center"
- prop="status"
- />
- <el-table-column
- min-width="200"
- :label="$t('other.attendanceData')"
- prop="cardTime"
- align="center"
- v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
- </el-table>
- <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>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
- </el-tab-pane>
- <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1">
- <div class="selectworktime_export" style="margin-top:10px">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="notfullSelectDateMonth"
- value-format="yyyy-MM"
- type="month"
- align="right"
- unlink-panels
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showReportTimeLessThanCardTimeList()"
- >
- </el-date-picker>
- </div>
- <div>
- <div style="margin-top:10px;">
- <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>
- <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>
- <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">
- <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
- </el-input>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
- <!-- <el-link
- type="primary"
- style="float: right; vertical-align: middle;height:32px"
- @click="exportMembNotWorkHours()"
- >{{$t('export.exportData')}}</el-link
- > -->
- </div>
- </div>
-
- </div>
- <el-table
- ref="hasworkTbl4"
- :data="notFullData"
- border
- :height="'70vh'"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- lazy
- >
- <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
- </template>
- </el-table-column>
- <el-table-column
- min-width="200"
- :label="$t('weekDay.date')"
- align="center"
- prop="createDate"
- >
- </el-table-column>
- <el-table-column
- min-width="200"
- :label="$t('fillReportTime')"
- align="center"
- prop="reportTime"
- />
- <el-table-column
- min-width="200"
- :label="$t('workAttendance')"
- prop="workHours"
- align="center"></el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
- <div class="selectworktime_export" style="margin-top:10px;">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- :range-separator="$t('other.to')"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthWorkTimeReminder()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
- <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
- <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
- </div>
- <div>
- <div style="margin-top:10px;">
- <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>
- <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>
- <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">
- <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
- </el-input>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
- <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
- </div>
- </div>
- <div style="float: right; vertical-align: middle;height:32px">
- <el-link
- type="primary" v-loading="remindering"
- @click="changeReminder()"
- >{{ $t('bianGengTiXing') }}</el-link
- >
- <el-link
- type="primary"
- @click="exportMembWorkHoursReminder()"
- >{{$t('export.exportData')}}</el-link
- >
- </div>
-
- </div>
- <el-table ref="hasworkTbl"
- :data="monthWorkDataS"
- v-el-table-infinite-scroll="listScroll"
- border
- :height="'70vh'"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- :lazy="true"
- >
- <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
- <template slot-scope="scope">
- {{ scope.row.createDate}}
- </template>
- </el-table-column>
- <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
- <!-- {{scope.row.name}} -->
- </template>
- </el-table-column>
- <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
- <template slot-scope="scope">
- {{scope.row.invokeValue}}
- </template>
- </el-table-column>
- <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
- </template>
- </el-table-column>
- <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
- <template slot-scope="scope">
- {{ scope.row.workingTime}}
- </template>
- </el-table-column>
- <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
- <template slot-scope="scope">
- {{ scope.row.cardTime}}
- <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
- </template>
- </el-table-column>
- <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
- <template slot-scope="scope">
- {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
- </template>
- </el-table-column>
- <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
- <template slot-scope="scope">
- <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
- <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
- </template>
- </el-table-column>
- </el-table>
- <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>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
- <!-- <div slot="title" class="dialog-title selectworktime_title">
- <label style="font-size: 16px">员工每日已填报工时数</label>
- <el-link
- type="primary"
- style="float: right; margin-right: 60px"
- @click="exportMembWorkHours()"
- >导出已填报数据</el-link
- > -->
- <!-- <el-button >导出</el-button> -->
- <!-- </div> -->
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- <!--驳回弹出框 -->
- <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <div>
- <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')" />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
- </div>
- </el-dialog>
- <!-- 通过弹出框 -->
- <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <div>
- <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
- </div>
- </el-dialog>
- <!--批量导入日报 -->
- <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
- <p>1. {{$t('other.download')}}
- <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>
- </p>
- <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
- <p style="display: flex;justify-content: center;">
- <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
- </el-upload>
- </p>
- <div style="display: flex;justify-content: end;padding-bottom: 1em;">
- <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
- </div>
- </el-dialog>
- <!-- 工时导入记录弹窗 -->
- <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
- <div style="height: 452px">
- <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
- <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
- <el-table-column prop="userName" :label="$t('other.operator')">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="datel" :label="$t('other.document')">
- <template slot-scope="scope">
- <div>
- <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
- <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
- </div>
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
- <template slot-scope="scope">
- <div>
- <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
- <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-col :span="24" class="paginatis">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20 , 50 , 80 , 100]"
- :page-size="20"
- layout="total, sizes, prev, pager, next"
- :total="toViewForm.total"
- style="float:right;"
- ></el-pagination>
- </el-col>
- </div>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
- <el-steps :active="active" finish-status="success" style="margin-left:50px;">
- <el-step :title="$t('other.selectadaterangetoimporthours')">
- </el-step>
- <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
- <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
- </el-steps>
-
-
- <div v-if="active==0" style="padding:30px;height:360px;">
- <div style="margin-top:50px;margin-left:280px;">
- <el-date-picker
- v-model="importWxParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- @change="loadCheckInData"
- ></el-date-picker>
- </div>
- </div>
- <div v-if="active==1" style="padding:10px;">
- <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
- style="width: 100%;margin-top:5px;" >
- <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
- <template slot-scope="scope">
- <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
- <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
- </el-table-column>
- <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
- <el-table-column prop="username" :label="$t('screening.employeename')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="departmentName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
- <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
- <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
- <template slot-scope="scope">
- {{scope.row.workHours.toFixed(1)}}h
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="active==2" >
- <p style="display: flex;justify-content: center;height:390px;">
- <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
- </el-upload>
- </p>
- </div>
- <div slot="title">
- <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
- <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
- <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
- <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>
- <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>
- <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>
- </div>
-
- <span slot="footer">
-
- <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
- type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
-
- <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
- <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
-
- <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
-
- </span>
- </el-dialog>
- <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
- <p style="display: flex;justify-content: center;height:100px;">
- <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
- </el-upload>
- </p>
- </el-dialog>
- <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
- <div>
- <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
- v-model="deleteReportParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </div>
- <div style="margin-top:10px;">
- <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
- <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>
- <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>
- </div>
- <div style="margin-top:10px;">
- <span>{{ $t('qingXuanZeYuanGong') }}:</span>
- <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
- <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </div>
- <span slot="footer">
- <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
- </span>
- </el-dialog>
- <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
- <div>
- <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
- v-model="deleteReportParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </div>
- <div style="margin-top:15px;">
- <span>{{ $t('other.selectdepartment') }}:</span>
- <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
- :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
- size="small" v-if="user.userNameNeedTranslate != 1"
- ></el-cascader>
- <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
-
- </div>
-
- <span slot="footer">
- <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
- </span>
- </el-dialog>
- <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
- <div>
- <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
- v-model="modImportTime"
- format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
- :clearable="true"
- type="datetime"
- ></el-date-picker>
- <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
- v-model="modImportUserId"
- >
- <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </div>
- <span slot="footer">
- <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
- </span>
- </el-dialog>
-
-
- <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
- <div>
- <span>{{ $t('qingXuanZeNianYue') }}</span>
- <el-date-picker
- v-model="ratioYmonth" :editable="false"
- format="yyyyMM" value-format="yyyyMM"
- type="month"
- ></el-date-picker>
- </div>
- <span slot="footer">
- <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
- </span>
- </el-dialog>
- <!--工时批量代填 -->
- <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
- <div>
- <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
- v-model="importWxParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- @change="loadCheckInData"
- ></el-date-picker>
- <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
- </div>
- <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
- :key="timeStamp"
- style="width: 100%;margin-top:5px;" ref="tab">
- <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
- <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
- <template slot-scope="scope">
- {{scope.row.workHours.toFixed(1)}}h
- </template>
- </el-table-column>
- <!--项目名称列表 -->
- <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
- <template slot-scope="scope">
- <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input> h
- </template>
- </el-table-column>
- <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
- <template slot-scope="scope">
- {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}} h
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
- <div style="padding-bottom:10px;">
- <p>{{importResultMsg}}</p>
- </div>
- <!-- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="showImportResult=false">关闭</el-button>
- </span> -->
- </el-dialog>
-
- <!-- 审核流程展示 -->
- <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
- <div style="padding:20px 40px 20px 0">
- <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
- <el-step title="待提交"></el-step>
- <el-step title="员工提交"></el-step>
- <el-step title="审核通过"></el-step>
- </el-steps>
- <el-divider v-if="user.companyId == 7544"></el-divider>
- <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
- <el-timeline :reverse="false" style="margin-top:10px;">
- <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
- <!-- {{item.msg}} -->
- <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
- <span v-if="user.userNameNeedTranslate == 1">
- <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
- <span>{{item.msgCon.two}}</span>
- </span>
- </el-timeline-item>
- </el-timeline>
- </div>
- </el-dialog>
-
- <!-- 威派格定制 -->
- <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
- </section>
- </template>
- <script>
- // 左右滑动
- import dragMixin from "@/common/js/tensile.js";
- import util from "../../common/js/util";
- // 自定义select组件
- import selectCat from "@/components/select.vue"
- // 引入自定义级联组件
- import vueCascader from "@/components/cascader.vue"
- import vueMultipleDept from "@/components/vueMultipleDept.vue"
- // 重庆物奇定制组件
- import WeeklyCustomization from "./weeklyCustomization.vue"
- // 威派格定制转移工时
- import TransferWorkingHours from "./transferWorkingHours.vue"
- // 新的按周填报
- import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
-
- import { mapMutations } from 'vuex'
- let _that = this
- export default {
- mixins: [dragMixin],
- components: {
- selectCat,
- vueCascader,
- WeeklyCustomization,
- vueMultipleDept,
- TransferWorkingHours,
- NewWeeklyCustomization
- },
- data() {
- return {
- remindering: false,
- onlyHaveAttendance: false,
- notFullData:[],
- notFullOriginList:[],
- singleDate:1,
- subFillProjectList:[],
- curAuditNode: 1,
- refreshingTime: false,
- substitudeStep: 1,
- showHidden: false,
- pageIndex: 0,
- hasMore: true,
- exportType: 0,
- exportingData: false,
- roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
- jobResponseList:[],
- yisibeiCompId: 3092,
- yuzhongCompId: 3385,
- mingyiName : '成都明夷电子科技有限公司',
- // mingyiName : '明夷',
- modItemDataId: null,
- modImportTime: null,
- modImportUserId: null,
- showModImportTimeDialog: false,
- showBatchSimpleApproveReport: false,
- startDeleting: false,
- showBatchDeleteReport: false,
- deleteReportParam: {date:null, userIds:[]},
- isDenying: false,
- targetWeekDate: null,//填写周报中的周日期
- importCardTimeVisi: false,
- startRatioExporting: false,
- exportUserRatio: false,
- ratioYmonth:null,
- hasWrittenReport: false,
- today:null,
- syncTimeLoading: false,
- seluserText: '',
- translation: '1', // 1、文字, 2、部门, 3、人员
- exportLoad: false,
- getPickerOptions: {
- disabledDate: (time) => {
- var date = new Date();
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- var currentdate = year.toString() + month.toString();
-
- var timeyear = time.getFullYear();
- var timemonth = time.getMonth() + 1;
- if (timemonth >= 1 && timemonth <= 9) {
- timemonth = "0" + timemonth;
- }
- var timedate = timeyear.toString() + timemonth.toString();
- if(this.user.timeType.fillAhead == 0){
- return currentdate < timedate;
- }else{
- return false
- }
-
- }
- },
- alalal: '8.0',
- timeBasecostList:null,
- tbload: false,
- exportTimeDialog: false,
- searchKeyword: '',
- monthWorkDataS: [],
- monthNotWorkDateS: [],
- pickDateArray:[],
- WorktimeDatepickValue: [],
- activeName:"first",
- isLeave: 0,
- submitingReport: false,
- importResultMsg:null,
- showImportResult:false,
- importingData: false,
- isDraft: 0,
- timeStamp: 0,
- projectColumns:[],
- checkinLoading:false,
- importWxParam:{date:null,},
- active:0,
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- importWxDialog:false,
- importDialog:false,
- denyForm:null,
- denyReasonDialog:false,
- monthWorkTimeDialog: false,
- notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
- isSubstitude:false,
- isFill:false,
- unFillList:[],
- fillList:[],
- fillMembList:[],
- fillMembList_leave: [],
- membListVisible: false,
- isBatch:0,//是否是批量填报
- editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
- // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
- 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')],
- statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
- fillStatusList: [],
- exportParam:{projectId: null, dateRange:[], departmentId: null},
- exportReportLogParam:{dateRange:[]},
- exportDialog:false,
- timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
- subProjectList:[],
- canEdit: true,
- originCanEdit: true,
- 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],
- selectTime:null,
- reportTimeType:{},
- curDate:'',
- isAllSelect: false,
- approveDialogVisible:false,
- deptId:null,
- targetUid: null,
- membCount:0,
- selectState:"-1",
- user: JSON.parse(sessionStorage.getItem("user")),
- allUsersList: [],
- showAddMore:false,
- allDate: [],
- typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
- date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
- choseDay: 0,
- tableHeight: 0,
- listLoading: false,
- projectList: [], //项目列表
- fillProjectList: [],
- reportList: [], //日报列表
- reportNames:[], //批量审批列表
- selCon:[], //筛选条件
- selProjectList:[], //筛选后项目列表
- selConShow: true,
- usersList: [], // 全部人员列表
- usersListId: '', // 选中的人员id
- dialogVisible: false, //项目弹窗
- report: '',
- workForm: {
- createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
- domains: [{
- id: null,
- projectId: "",
- workingTime: "",
- timeType:0,
- content: "",
- state: 2,
- multiWorktime:0,
- worktimeList:[],
- degreeId: null,
- auditUserList: [],
- }],
- showRefresh: false,
- },
- workRules: {
- createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
- },
- chooseParticipVisible: false,
- logining: false,
- isDisable: false,
- timeType:[],
- deptMembData: [
-
- ],
- //部门人员树状结构
- data: [
- {
- id: -1,
- label: this.$t('lable.allStaff'),
- membCount:0
- },
- {
- id: 0,
- label: this.$t('lable.unassigned'),
- }
- ],
- allData:{},
- batchShowData:{},
- option: [],
- deptOptionList: [],
- depData: {
- id: -1,
- label: this.$t('lable.allStaff'),
- },
- defaultProps: {
- children: 'children',
- label: 'label'
- },
- isNew: false,
- selected: false,
- valuet: new Date(),
- domObj: null,
- participator:[],
- chosenMembCount:0,
- jsDay: 0,
- jsTime: 0,
- falsss: false,
- weidu: [],
- weiduList: [],
- yonghuUser: [],
- dateAr: [],
- batchSubFillDialog: false,
- isSubstiS: false,
- fillWeekDialogVisi: false,
- fillWeekDialogVisiCustom: false,
- fillWeekDialogVisiCustomTwo: false,
- zhoData: [],
- weekDateRange: [],
- btnZho: false,
- weekDataLoading: false,
- changdu: 6,
- tianxieDialogVisible: false,
- scopess: {},
- zhoBao: {
- time: '',
- workingTime: '',
- progress: '',
- con: '',
- subProjectId: '',
- stage: '',
- subProjectList: [],
- stages: [],
- },
- zhoBaoIdx: '',
- zhoBaoName: '',
- zhis: {},
- dealList: [],
- toViewDialogVisible: false,
- toViewList: [],
- toViewloading: true,
- toViewForm: {
- pageIndex: '1',
- pageSize: '20',
- total: 0,
- },
- toViewloadings: false,
- tabPositionss: 'top',
- monthTotal: 0,
- monthTotalPage: 0,
- monthTotalLages: 20,
- monthWorkData: [],
- monthNotWorkDate: [],
- monthWorkDataS1: [],
- monthnotTotal: 0,
- monthnotTotalPage: 0,
- monthnotTotalLages: 20,
- monthNotWorkDateS1: [],
- deptMembDataText: '',
- isFlag: false,
- isMore: false,
- stateKey: '0',
- expandDate: [],
- notifySelList:[],
- departmentList: [],
- trandepartmentList:[],
- approvalProcessDialog: false,
- approvalProcessData: [],
- // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
- 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')],
- isWeekend: false,
- canCancelInDialog: false,
- approveinData: {},
- approveinDialog: false,
- reportCanDelete: false,
- weeklyFilledTimeDialog: false,
- weeklyFilledTimeList: [],
- weeklyFilledTimeLoading: false,
- workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
- weeklyFilledTimeCanDelete: false,
- weeklyFilledTimeDate: null,
- leaveAllNum: 0,
- dataLoading: false,
- zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
- vacationTime: {},
- integrationProjectList: [],
- totalReportHours: 0, // 合计的工时
- workTimeForMinYi:0,
- nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
- weekIndex: 1,
- weekParentData: {},
- deptIdForNoReport:[],
- deptIdForReminder:[],
- nameAearch: '', // 企业微信姓名搜索
- deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
- deptMembDataLoading: false,
- reportPictureRequired: [ // 针对填写日报图片必填得公司
- {
- id: 4811,
- // id: 10,
- name: '陕西柘中建设工程有限公司'
- }
- ],
- pushWorkTimeLogDig:false,
- pushWorkTimeLogData:[],
- userReportDeptList: [],
- isReminder:true,
- reportLogCheckDialog:false,
- deptIdForHasReport:[],
- transferWorkingHoursVisable: false,
- multiOptionData:[],
- businessTripsArray: [],
- };
- },
- watch: {
- deptMembDataText(val) {
- this.$refs.chooseMembTree.filter(val);
- }
- },
- filters: {
-
- // 过滤
- amounts(value) {
- if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
- return 0
- }
- var zhi = +value + 0
- return zhi.toFixed(1)
- },
- // zhoData
- zhoData(value, arr) {
- var dateArray = value.split("-");
- var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
- // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
- // console.log(arr[date.getDay()])
- // return "周" + "日一二三四五六".charAt(date.getDay());
- return arr[date.getDay()]
- },
- // 过滤数字
- numbers(value) {
- if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
- return 0
- }
- return value
- },
-
- },
- computed: {},
- mounted() {
- var now = new Date();
- var t = util.formatDate.format(now, 'yyyy-MM-dd');
- this.today = t;
- var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
- this.exportParam.dateRange = [startStr,t];
- this.exportReportLogParam.dateRange = [startStr,t];
- this.getAllDate(1);
- this.getReportList();
- this.getProjectList();
- this.getFillProjectList();
- this.getTimeType();
- this.getDepartment();
- this.scrollFunction()
- this.userssHu();
- this.getFirstAndLastDay()
- this.getMultiOptionData();
- if(this.user.timeType.reportAuditType == 3){
- this.getAllUsersList()
- }
- if (this.user.company.packageProject == 1) {
- this.getBasecostItemList();
- }
- if(this.user.timeType.userWithMultiDept == 1) {
- this.getDeptMembData();
- }
- if(this.user.timeType.lockWorktime){
- this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
- }
- //设置了下限
- if (this.user.timeType.minReportTime) {
- this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
- }
- const that = this
- if(this.user.userNameNeedTranslate == 1) {
- that.dataLoading = that.$store.state.dataLoading
- this.upDataLoading()
- setTimeout(()=>{
- that.dataLoading = that.$store.state.dataLoading
- }, 1000)
- }
- if (this.user.companyId == this.yuzhongCompId) {
- this.getJobResponList();
- }
- },
- methods: {
- ...mapMutations(['upDataLoading']),
- // 已填工时情况表设置背景色
- hasworkTblCellStyle({ columnIndex, row, column }) {
- if(columnIndex > 2) {
- const dateSingle = this.pickDateArray[columnIndex - 3].date
- const worktimeList = row.worktimeList || []
- const times = this.reportTimeType.allday
- const filterData = worktimeList.filter(item => item.createDate == dateSingle)
- const isWorkDate = filterData[0] && filterData[0].workingTime;
- const missReport = filterData[0] && filterData[0].missReport;
- const state = filterData[0] && filterData[0].state
- if (missReport) {
- return "backgroundColor: red"
- } else {
- if (state == 0 || state == -1) {
- return "backgroundColor: orange"
- } else if (state == 1) {
- //审核通过
- return "backgroundColor: #32CD32"
- } else if (state == 2) {
- return "backgroundColor: red"
- } else {
- return "backgroundColor: #E0E0E0"
- }
- }
-
- }
- },
- getMultiOptionData() {
- this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
- res => {
- if (res.code == "ok") {
- this.multiOptionData = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- showReportTimeLessThanCardTimeList() {
- this.monthTotalPage = 0,
- this.tbload = true,
- this.http.post(
- "/report/getReportTimeLessThanCardTimeList",
- {
- date: this.notfullSelectDateMonth,
- deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
- userId: this.usersListId
- },
- (res) => {
- if (res.code == "ok") {
- this.tbload = false
- this.notFullData = res.data;
- this.notFullOriginList = res.data;
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- //按选择的日期范围刷新考勤
- refreshWXCardTimeByRange() {
- this.refreshingTime = true;
- this.http.post('/wxcorp/getUserCheckInDayData',{
- companyId: this.user.companyId,
- userId: this.user.id,
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- },res => {
- this.refreshingTime = false;
- if(res.code == 'ok'){
- this.loadCheckInData();
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.syncTimeLoading = false;
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
- isCustomization(userInfo, permissionArray) {
- const { companyId } = userInfo
- const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
- return isReportPictureRequired
- },
- showHiddenFunction() {
- this.showHidden = true;
- },
- // 获取如何信息选的可填写部门
- getDeptMembData() {
- this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
- if (res.code == "ok") {
- let lists = res.data.userReportDeptList || []
- const optimizedList = lists.map(item => ({
- ...item,
- label: item.departmentName,
- value: item.departmentId,
- }));
- this.$set(this, 'userReportDeptList', optimizedList || []);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => { });
- },
- //任务被选中
- onTaskSelected(domainItem) {
- //取服务
- if (domainItem.taskId) {
- var that = this;
- var param = {taskId:domainItem.taskId};
- if (this.isSubstitude) {
- if (this.workForm.userId != null && this.workForm.userId.length>0) {
- param.userId = this.workForm.userId[0];
- }
- }
- this.http.post('/task/getMyTaskService',param, res => {
- if (res.code == "ok") {
- // domainItem.workContentList = res.data;
- that.$set(domainItem, 'sapServiceId', null);
- that.$set(domainItem, 'serviceList', res.data);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- } else {
- //清空服务
- }
- },
- onBatchTimeChange() {
- //反向计算每日工作时长
- if (this.workForm.createDate) {
- let sdate = new Date(this.workForm.createDate[0]);
- let edate = new Date(this.workForm.createDate[1]);
- let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
- if (days < 0) {
- return;
- }
- this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
- //总时长发生改变,自动按比例计算
- this.workForm.domains.forEach(d=>{
- d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
- });
- }
- },
- //更新工作内容列表
- updateJobContent(domainItem) {
- var that = this;
- this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
- if (res.code == "ok") {
- // domainItem.workContentList = res.data;
- that.$set(domainItem, 'extraField3', null);
- that.$set(domainItem, 'workContentList', res.data);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- updateResponse(domainItem) {
- var that = this;
- var selectPid = domainItem.projectId;
- domainItem.extraField2 = null;
- domainItem.extraField3 = null;
- if (selectPid && domainItem.extraField1) {
- //是否非项目
- var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
- 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));
- domainItem.filteredRespList = filteredRespList;
- }
-
- },
- getJobResponList() {
- this.http.post('/project/getFunctionalDivisionList',{},res => {
- if (res.code == "ok") {
- this.jobResponseList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- openModImportTime(row) {
- this.showModImportTimeDialog = true;
- this.modItemDataId = row.id;
- },
- delImportTime(row) {
- let rowId = row.id;
- this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.http.post('/report-import-log/delete',{
- id: rowId
- },res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getToView();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }).catch(() => {this.startDeleting = false});
- },
- confirmChangeModTime() {
- if (this.modImportTime == null || this.modImportTime.length == 0) {
- this.$message({
- message: this.$t('message.Pleaseselectatime'),
- type: "error"
- });
- return;
- }
- this.http.post('/report-import-log/changeTime',{
- modLogDateTime: this.modImportTime,
- modImportUserId: this.modImportUserId,
- id: this.modItemDataId
- },res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.modifyTheSuccess'),
- type: "success"
- });
- this.getToView();
- this.showModImportTimeDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- confirmBatchApproveReport() {
- if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
- this.$message({
- message: this.$t('qingXuanZeRiQiFanWei'),
- type: "error"
- });
- return;
- }
-
- this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.startDeleting = true;
- let obj = {
- startDate: this.deleteReportParam.date[0],
- endDate: this.deleteReportParam.date[1]
- }
- if(this.deleteReportParam.departmentId) {
- obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
- } else {
- obj.departmentId = null
- }
-
- this.http.post('/report/batchApproveByDate',obj,res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('state.approved'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.startDeleting = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }).catch(() => {this.startDeleting = false});
- },
- confirmBatchDelReport() {
- if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
- this.$message({
- message: this.$t('qingXuanZeBuMenHuoRenYuan'),
- type: "error"
- });
- return;
- }
- if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
- this.$message({
- message: this.$t('qingXuanZeRiQiFanWei'),
- type: "error"
- });
- return;
- }
-
- this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.startDeleting = true;
- this.http.post('/report/batchDelete',{
- userIds: JSON.stringify(this.deleteReportParam.userIds),
- startDate: this.deleteReportParam.date[0],
- endDate: this.deleteReportParam.date[1],
- deptId: this.deleteReportParam.deptId[0]
- },res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.startDeleting = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }).catch(() => {this.startDeleting = false});
- },
- getRecentlyProject(userId) {
- this.http.post('/project/nearProject',{userId: userId},res => {
- if(res.code == 'ok'){
- var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
- let topObj = {
- label: this.$t('zuiJinXuanZeXiangMu'),
- peojectList: res.data
- }
- let botomObj = {
- label: this.$t('other.allProject'),
- peojectList: bottomList
- }
- //最近项目如果在fillProjectList中不存在,需要移除
- topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
- this.integrationProjectList = [topObj, botomObj]
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
-
- handlePictureCardPreview(file, index) {
- let arr = []
- let imgArr = this.workForm.domains[index].imgListUrl
- for(var i in imgArr) {
- arr.push(imgArr[i].url)
- }
- const $viewer = this.$viewerApi({
- images: arr
- });
- },
- // 图片上传
- addImg(e, index) {
- let formData = new FormData()
- formData.append('multipartFile', e.file)
- this.http.uploadFile('/common/uploadFile', formData,
- res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('uploadedsuccessfully'),
- type: "success"
- });
- if(!this.workForm.domains[index].imgList) {
- this.workForm.domains[index].imgList = []
- this.workForm.domains[index].imgListUrl = []
- }
- this.workForm.domains[index].imgList.push(res.data)
- this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
- } else {
- this.$message({message: res.msg,type: "error"});
- }
- },
- error => {this.$message({message: error,type: "error"});
- });
- },
- // 删除图片
- delImg(file,fileList, index) {
- let idx = 0
- for(let i in fileList) {
- if(fileList[i].uid == file.uid) {
- idx = i
- }
- }
- this.workForm.domains[index].imgList.splice(idx, 1)
- this.workForm.domains[index].imgListUrl.splice(idx, 1)
- },
- test(){
- console.log('test',this.workForm.domains);
- },
- getHour(s1, s2) {
- var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
- s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
- s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
- var ms = s2.getTime() - s1.getTime();
- if (ms < 0) return 0;
- let ma = ms / 1000 / 60 / 60
- return ma; //小时
- },
- refreshDDCardTime(workdate) {
- if (!workdate) return;
- this.syncTimeLoading = true;
- this.http.post('/dingding/refreshUserCardTime',{
- companyId: this.user.companyId,
- userId: this.user.id,
- date: workdate,
- },res => {
- this.syncTimeLoading = false;
- if(res.code == 'ok'){
- if (!res.data) {
- this.$message({
- message: '获取考勤失败',
- type: 'error'
- })
- } else {
- this.workForm.time = res.data;
- }
-
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.syncTimeLoading = false;
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- refreshWXCardTime(workdate) {
- if (!workdate) return;
- this.syncTimeLoading = true;
- this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
- date: workdate,
- },res => {
- this.syncTimeLoading = false;
- if(res.code == 'ok'){
- this.workForm.time = res.data.time;
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.syncTimeLoading = false;
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- refreshAttendance(workdate) {
- if (!workdate) return;
- this.syncTimeLoading = true;
- this.http.post('/user-fv-time/syncAttendanceForMingYi',{
- startDate: workdate[0],
- endDate: workdate[1]
- },res => {
- this.syncTimeLoading = false;
- if(res.code == 'ok'){
- this.workTimeForMinYi = parseFloat(res.data.workHours);
- this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
- this.totalReportHours = this.workTimeForMinYi;
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.syncTimeLoading = false;
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- refreshBeiSengAttendance(workdate) {
- if (!workdate) return;
- this.syncTimeLoading = true;
- this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
- createDate: workdate
- },res => {
- this.syncTimeLoading = false;
- if(res.code == 'ok'){
- this.workForm.time = res.data;
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.syncTimeLoading = false;
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
- this.weeklyFilledTimeDialog = true
- this.weeklyFilledTimeLoading = true
- this.weeklyFilledTimeDate = parameterDate
- this.http.post('/report/getReportList',{
- date: parameterDate,
- userId: this.user.id
- },res => {
- this.weeklyFilledTimeLoading = false
- if(res.code == 'ok'){
- this.weeklyFilledTimeList = res.data[0].data
- let candelete = true
- for(let i in this.weeklyFilledTimeList){
- if(this.weeklyFilledTimeList[i].state < 2){
- candelete = false
- }
- }
- this.weeklyFilledTimeCanDelete = candelete
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.weeklyFilledTimeLoading = false
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
- this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.http.post('/report/delete',{
- userId: this.user.id,
- date: this.weeklyFilledTimeDate
- },res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getWeeklyWorkTime()
- this.getReportList();
- this.getDepartment();
- this.weeklyFilledTimeDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }).catch(() => {});
- },
- getApprovalProcess(item){
- // console.log('this.date',this.choseDate);
- this.http.post('/report-log/get',{
- creatorId: item.id,
- createDate: sessionStorage.msg
- },res => {
- if(res.code == 'ok'){
- this.approvalProcessDialog = true
- if(this.user.userNameNeedTranslate == 1) {
- for(var i in res.data) {
- let obj = {
- one: res.data[i].msg.split('$userName=')[1].split('$')[0],
- two: res.data[i].msg.split('$userName=')[1].split('$')[1],
- }
- res.data[i].msgCon = obj
- }
- }
- this.approvalProcessData = res.data
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- //获取审批节点状态
- if (this.user.companyId == 7544) {
- this.http.post('/report/getCurAuditNode',{
- userId: item.id,
- date: sessionStorage.msg
- },res => {
- if(res.code == 'ok'){
- this.curAuditNode = res.data
- }else{
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- }
- },
- filterNode(value, data) {
- if (!value) return true;
- return data.label.indexOf(value) !== -1;
- },
- triggerCalculateOT(index) {
- var str = this.workForm.domains[index].overtimeHours + ''
- if(str.indexOf('.') != '-1') {
- var s = str.split('.')[0]
- var st = str.split('.')[1]
- var sts = st.split('')
- this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
- }
- },
- searchScreen(e){
- if(e == 1){
- this.monthNotWorkDateS1 = []
- for (let i = 0; i < this.monthNotWorkDate.length; i++) {
- if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
- this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
- }
- }
- if (this.monthNotWorkDateS1.length > 50) {
- this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
- }else{
- this.monthNotWorkDateS = this.monthNotWorkDateS1
- }
- } else if (e == 0) {
- this.monthWorkDataS1 = []
- for (let i = 0; i < this.monthWorkData.length; i++) {
- if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
- this.monthWorkDataS1.push(this.monthWorkData[i])
- }
- }
- if (this.monthWorkDataS1.length > 50) {
- this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkDataS1
- }
- } else if (e == 2) {
- this.monthWorkDataS1 = []
- for (let i = 0; i < this.notFullOriginList.length; i++) {
- if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
- this.monthWorkDataS1.push(this.notFullOriginList[i])
- }
- }
- if (this.monthWorkDataS1.length > 50) {
- this.notFullData = this.monthWorkDataS1.slice(0,50);
- }else{
- this.notFullData = this.monthWorkDataS1
- }
- }
- },
- addUpload(data) {
- // var zhi = data.fileName.split('.')[0]
- // var sss = zhi + '.xlsx'
- // return
- var filePath = '/upload/' + data.serverName;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', data.fileName);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- },
- restrictNumber(targetId) {
- let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
- inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
- inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
- inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
- inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
- if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
- inpu.value = parseFloat(inpu.value);
- }
- },
-
-
- //获取项目下的任务分组
- getTaskGroups(domain, index) {
- domain.groupId=null;
- this.http.post('/task-group/listMyJoinGroup',{
- projectId: domain.projectId,
- isSubstitude: this.isSubstitude ? 1 : 0
- },
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].taskGroups = res.data;
- // if (this.workForm.domains[index].taskGroups.length > 0) {
- // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
- // this.getGroupStages(domain, index);
- // }
- const projectIdStr = domain.projectId;
- const businessTripsArray = this.businessTripsArray
- const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
- if(list.length > 0) {
- const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
- this.workForm.domains[index].groupId = obj.id || ''
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //下载填报工时占比报表
- downloadProjectRatio() {
- this.exportUserRatio = true;
- // let now = new Date();
- // let month = now.getMonth();//默认看上个月的
- // let monthStr = month<10? ('0'+month): month;
- // this.ratioYmonth = now.getFullYear()+''+monthStr;
- const today = new Date();
- const year = today.getFullYear();
- const month = today.getMonth() + 1;
- let lastMonthYear, lastMonth;
- if (month === 1) {
- lastMonthYear = year - 1;
- lastMonth = 12;
- } else {
- lastMonthYear = year;
- lastMonth = month - 1;
- }
- this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
- },
- confirmDownloadRatio() {
- this.startRatioExporting = true;
- this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
- ymonth: this.ratioYmonth
- },
- res => {
- if (res.code == "ok") {
- this.startRatioExporting = false;
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- var data = filePath.split("/");
- a.setAttribute('download', data[data.length-1]);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- } else {
- this.startRatioExporting = false;
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //下载带企业微信考勤数据的工时统计模板
- downloadCheckInExcel() {
- var param = {
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- };
- if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
- param.onlySelfData = false;
- }
- this.http.post('/user-corpwx-time/exportCheckInExcel',param,
- res => {
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- var data = filePath.split("/");
- a.setAttribute('download', data[data.length-1]);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- pre() {
- if (this.active == 0) return;
- this.active--;
- },
- next() {
- this.active++;
- },
- triggerTotalTime(index) {
- var item = this.checkinList[index];
- var total = 0.0;
- for (var i=0;i<this.projectColumns.length; i++) {
- var key = this.projectColumns[i];
- if (item[key] != null && item[key] != '') {
- total += parseFloat(item[key]);
- }
- }
- item.totalFillTime = total;
- },
- //提交批量代填的数据
- submitBatchSubFillData() {
- var data = JSON.stringify(this.checkinList);
- this.http.post('/user-corpwx-time/submitProjectTime',{
- json: data,
- projectColumns: JSON.stringify(this.projectColumns)
- },
- res => {
- if (res.code == "ok") {
- this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
- this.importWxDialog = false;
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- loadCheckInData() {
- if (this.importWxParam.date == null) {
- this.checkinList = [];
- return;
- }
- this.checkinLoading = true;
- this.http.post('/user-corpwx-time/getMyData',{
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- },
- res => {
- if (res.code == "ok") {
- this.checkinLoading = false;
- this.checkinList = res.data.list;
- this.projectColumns = res.data.projects;
- // 自定义表格会导致表格错乱,需重新计算表格
- this.$nextTick(()=>{
- this.$refs.tab.doLayout()
- })
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- importCardTime(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("multipartFile", item.file);
- formData.append("companyId", this.user.companyId);
- this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
- res => {
- this.$refs.uploadCardTime.clearFiles();
- this.importingData = false;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.$message({
- message: this.$t('daoRuKaoQinShiChangChengGong'),
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- batchImportWxData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("companyId", this.user.companyId);
- formData.append("withCheckIn", 1);
- this.http.uploadFile('/report/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.showImportResult = true;
- this.importingData = false;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
- this.getReportList();
- this.importWxDialog = false;
- } else {
- this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- batchImportData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("companyId", this.user.companyId);
- let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
- this.http.uploadFile(url, formData,
- res => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.showImportResult = true;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
- this.getReportList();
- this.importWXDialog = false;
- } else {
- this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- userssHu() {
- this.http.post('/time-type/getCompanyTimeSetting',{
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.yonghuUser = res.data
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- iptBlur(i) {
- if(this.isBatch == 0) {
- return
- }
- var reqParam = {
- startDate: this.workForm.createDate[0],
- endDate: this.workForm.createDate[1]
- };
- if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
- reqParam.userId = this.workForm.userId[0];
- }
- this.http.post('/report/getWorkDays',reqParam,
- res => {
- if (res.code == "ok") {
- this.jsDay = res.data
- this.chuji(i)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- //明夷硬编码获取
- if (this.user.company.companyName == this.mingyiName) {
- this.getWorkTimeForMinYi();
- }
- },
- getWorkTimeForMinYi(){
- this.http.post('/user-fv-time/getMinYiWorkHour',{
- startDate: this.workForm.createDate[0],
- endDate: this.workForm.createDate[1]
- },
- res => {
- if (res.code == "ok") {
- this.workTimeForMinYi = parseFloat(res.data.workHours);
- this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
- this.totalReportHours = this.workTimeForMinYi;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- this.workForm.createDate = [];
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- chuji(i) {
- if(i == 0) {
- this.seleChn(1)
- } else if(i == 1) {
- this.seleChn(0)
- } else if(i == 2) {
- if(this.workForm.domains[0].multiWorktime > 0) {
- this.iptChangs()
- } else {
- this.iptChang()
- }
- } else if(i == 3) {
- this.seleChn(0)
- }
- },
- seleChn(e,domain) {
- if(e == 1) {
- for(var i in this.workForm.domains) {
- if(this.workForm.domains[i].timeType == 0) {
- this.workForm.domains[i].workingTime = 8
- } else {
- this.workForm.domains[i].workingTime = 4
- }
- }
- }
- var quanbu = 0
- var spl = this.workForm.domains
- var zhi = ''
- for(var i in spl) {
- var sp = +spl[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- this.totalReportHours = quanbu
- let worktime = this.jsTime
-
- // 自动计算加班时长
- if(this.isBatch != 0){
- worktime = this.jsTime / this.jsDay
- }
- if(this.user.timeType.fillOvertime && domain){
- let isover = false
- let alltime = 0
- let allover = 0 //此处alltime同上面的worktime
- for(let d in spl){
- if(spl[d].isOvertime){
- isover = true
- allover += spl[d].overtimeHours*1
- }
- alltime += spl[d].workingTime*1
- }
- if(domain.overtimeHours){
- allover = allover - domain.overtimeHours
- }
- if(worktime*1 > this.user.timeType.allday){
- if(isover){
- if(alltime > (allover + this.user.timeType.allday)){
- this.$set(domain,'isOvertime',true)
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
- }else{
- this.$set(domain,'isOvertime',false)
- this.$set(domain,'overtimeHours',null)
- if(alltime < (allover + this.user.timeType.allday)){
- let overtime = allover + this.user.timeType.allday - alltime
- for(let pi in spl){
- if(spl[pi].overtimeHours){
- if((overtime - spl[pi].overtimeHours*1) > 0){
- overtime = overtime - spl[pi].overtimeHours*1
- this.$set(spl[pi],'isOvertime',false)
- this.$set(spl[pi],'overtimeHours',null)
- }else if((overtime - spl[pi].overtimeHours*1) < 0){
- this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
- break
- }else{
- this.$set(spl[pi],'isOvertime',false)
- this.$set(spl[pi],'overtimeHours',null)
- break
- }
- }
- }
- }
- }
- }else{
- this.$set(domain,'isOvertime',true)
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
- }
- }else{
- for(let di in spl){
- this.$set(spl[di],'isOvertime',false)
- this.$set(spl[di],'overtimeHours',null)
- }
- }
- }
- },
- iptChang() {
- var sl = this.workForm.domains
- let timeArr = []
- for(var i in sl) {
- if(sl[i].startTime && sl[i].endTime) {
- timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
- }
- }
- this.getTimeHours(timeArr)
- },
- iptChangs() {
- var sl = this.workForm.domains
- let timeArr = []
- for(var i in sl) {
- for(var j in sl[i].worktimeList){
- if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
- timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
- }
- }
- }
- this.getTimeHours(timeArr)
- },
- // 调用接口或去数据
- getTimeHours(arr) {
- this.http.post('/report/getHoursByTimeRange',{
- timeJsonStr: JSON.stringify(arr)
- },res => {
- if(res.code === 'ok') {
- this.$set(this, 'totalReportHours', +res.data * this.jsDay)
- } else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 按周填报调用接口计算时间
- async getWeekHoursByTimeRange(timeRange) {
- const url = '/report/getHoursByTimeRange';
- const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
- var that = this;
- return new Promise((resolve, reject) => {
- this.http.post(url, data, function(res) {
- res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
- }, function(err) {
- reject(err);
- });
- });
- },
- removeTimeItem(item, index) {
- item.worktimeList.splice(index, 1);
- this.iptChangs()
- },
- //添加工时
- addNewWorktime(index, item) {
- if(item.worktimeList == null ) {
- item.worktimeList = []
- }
- item.worktimeList.push({});
- },
- //复制项目
- copyProject(index) {
- var leftProgress = 10;
- if (this.reportTimeType.type == 3) {
- //计算已经待分配工时比例
- let array = this.workForm.domains;
- let totalProgress = 0;
- for (var i=0;i<array.length; i++) {
- totalProgress += array[i].progress;
- }
- if (totalProgress < 100) {
- leftProgress = 100 - totalProgress;
- }
- }
- var newIndex = index+1;
- var itemDomain = {
- projectId: this.workForm.domains[index].projectId,
- workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
- this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
- ),
- content: "",
- progress:leftProgress,
- state:2,//2-表示待提交
- };
- this.workForm.domains.splice(newIndex, 0,itemDomain);
-
- if (this.reportTimeType.type == 0) {
- //全天上下午模式下,检测时间段数量,达到2个,不能再加了
- var length = this.workForm.domains.length;
- if (length == 2) {
- this.showAddMore = false;
- }
- }
- this.selectProject(itemDomain, newIndex);
- },
- pushWorkTime(reportId){
- let url=''
- if(this.user.timeType.syncSap == 1){
- url='/report/pushProjectReportToSap'
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var pushDate = this.date + day;
- this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'info'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
- this.http.post(url,{
- pushDate: pushDate,
- reportId: reportId
- },res => {
- loading.close();
- if(res.code == 'ok'){
- this.$message({
- type: 'success',
- message: res.data
- });
- }else{
- this.$message({
- type: 'error',
- message: res.msg
- })
- }
- },err => {
- loading.close();
- this.$message({
- type: 'error',
- message: err
- })
- })
-
- }).catch(() => {
- });
- }else{
- url='/report/pushReportDataToThird'
- this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'info'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
- this.http.post(url,{
- yearMonth: this.date
- },res => {
- loading.close();
- if(res.code == 'ok'){
- this.$message({
- type: 'success',
- message: this.$t('tuiSongChengGong')
- });
- }else{
- this.$message({
- type: 'error',
- message: res.msg
- })
- }
- },err => {
- loading.close();
- this.$message({
- type: 'error',
- message: err
- })
- })
-
- }).catch(() => {
- });
- }
- },
- showWorkTime(){
- this.monthWorkTimeDialog = true;
- this.searchKeyword = ''
- this.WorktimeDatepickValue = this.istoMonth()
- if(this.WorktimeDatepickValue.length == 0){
- let newdate = new Date();
- let nowdate = newdate.toLocaleDateString();
- let getauto = this.getAutoWeekDate(nowdate)
- let nowwd = [getauto[0],getauto[6]]
- this.WorktimeDatepickValue = nowwd
- }
- this.showMonthWorkTime()
- },
- handleClick(t,e){
- if (t.name == "second") {
- this.showMonthNotWorkTime()
- }else if(t.name == "first"){
- this.showMonthWorkTime()
- }else if(t.name == "third"){
- this.showMonthWorkTimeReminder()
- } else if (t.name == "fourth") {
- this.showReportTimeLessThanCardTimeList();
- }
- },
- //导出员工每日填报工时数
- exportMembWorkHours() {
- this.http.post(
- "/report/exportUserDailyWorkTime",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- exportMembWorkHoursReminder() {
- this.http.post(
- "/report/exportUserDailyWorkTimeReminder",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- this.downloadByA('工时异常表.xlsx', url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- exportMembNotWorkHours() {
-
- this.http.post(
- "/report/exportNoReportUserList",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- onlyHaveAttendance: this.onlyHaveAttendance?1:0
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- downloadByA(name, url) {
- const a = document.createElement("a"); // 创建a标签
- a.setAttribute("download", name); // download属性
- a.setAttribute("href", url); // href链接
- a.click(); // 自执行点击事件
- a.remove();
- },
- // 是否本月判断
- istoMonth(){
- let todate = new Date()
- let tomonth = todate.getMonth() + 1
- let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
- if(this.date == adate){
- return []
- }else{
- let sedate = new Date(this.date)
- let semonth = sedate.getMonth() + 1
- let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
- let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
- let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
- return [sedates1, sedates2]
- }
- },
- showMonthWorkTime() {
- this.monthTotalPage = 0,
- this.tbload = true
- let parameter={
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
- }
- this.http.post(
- "/report/getUserDailyWorkTime",
- // "/report/getNoReportUserList",
- parameter,
- (res) => {
- if (res.code == "ok") {
- this.tbload = false;
- this.pickDateArray = res.data.days.map(item => {
- return {
- ...item,
- dateStr: item.label.split('/')[0],
- weekStr: item.label.split('/')[1]
- }
- });
- // console.log('dataarray',res.data.days);
- this.monthWorkData = res.data.list;
- // this.monthWorkDataS = this.monthWorkData
- // this.monthWorkDataS1 = res.data.list
- this.monthTotal = res.data.list.length
- if (this.monthWorkData.length > 50) {
- this.monthWorkDataS = this.monthWorkData.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkData
- }
- this.searchScreen(0)
- // this.monthWorkDataS = infoList
- // 判断
- // if (this.monthWorkDataS1.length > 0) {
- // setTimeout(() => {
- // this.tableListener()
- // }, 1000);
- // }
- this.$nextTick(function(){
- this.$refs.hasworkTbl.doLayout();
- });
- // this.$forceUpdate()
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- showMonthWorkTimeReminder() {
- this.monthTotalPage = 0,
- this.tbload = true
- let parameter={}
- parameter={
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
- viewValue:this.isReminder?1:0
- }
- this.http.post(
- "/report/getUserDailyWorkTimeReminder",
- parameter,
- (res) => {
- if (res.code == "ok") {
- this.tbload = false;
- this.monthWorkData = res.data.list;
- this.monthTotal = res.data.list.length
- if (this.monthWorkData.length > 50) {
- this.monthWorkDataS = this.monthWorkData.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkData
- }
- this.searchScreen(0)
- this.$nextTick(function(){
- this.$refs.hasworkTbl.doLayout();
- });
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- showMonthNotWorkTime() {
- this.monthTotalPage = 0,
- this.tbload = true,
- this.http.post(
- "/report/getNoReportUserList",
- {
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
- onlyHaveAttendance:this.onlyHaveAttendance?1:0
- },
- (res) => {
- if (res.code == "ok") {
- this.tbload = false
- this.monthNotWorkDate = res.data;
- this.monthnotTotal = res.data.length
- if (this.monthNotWorkDate.length > 50) {
- this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
- } else {
- this.monthNotWorkDateS = this.monthNotWorkDate
- }
- this.searchScreen(1)
- this.$nextTick(function(){
- this.$refs.hasworkTbl2.doLayout();
- });
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- listScroll(){
- if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
- this.isMore = true
- setTimeout(()=>{
- this.isMore = false
- },1000)
- }else {
- this.isFlag = true
- let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
- this.monthWorkDataS = datalist
- setTimeout(()=>{
- this.isFlag = false
- },300)
- }
- },
- notListScroll(){
- if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
- this.isMore = true
- setTimeout(()=>{
- this.isMore = false
- },1000)
- }else {
- this.isFlag = true
- let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
- this.monthNotWorkDateS = datalist
- // console.log('length',this.monthNotWorkDateS.length)
- setTimeout(()=>{
- this.isFlag = false
- },300)
- }
- },
- getFirstAndLastDay() {
- // 将选定的月份转换为Date对象
- var monthDate = new Date();
- var year = monthDate.getFullYear();
- var month = monthDate.getMonth();
-
- // 计算起始日和结束日
- var startDay = new Date(year, month, 1);
- var endDay = new Date(year, month + 1, 0);
- let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
- this.WorktimeDatepickValueForMonth=lastmd
- },
- formatDate(date) {
- var year = date.getFullYear();
- var month = ("0" + (date.getMonth() + 1)).slice(-2);
- var day = ("0" + date.getDate()).slice(-2);
-
- return year + "-" + month + "-" + day;
- },
- // 获取默认这zhou日期参数 222
- getLastWeek(e){
- let newdate = new Date()
- let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
- let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
- if(e==1){
- this.WorktimeDatepickValue = lastwd
- this.showMonthWorkTime()
- }else if(e==2){
- this.WorktimeDatepickValue = lastwd
- this.showMonthWorkTimeReminder()
- }else{
- this.WorktimeDatepickValue = lastwd
- this.showMonthNotWorkTime()
- }
- },
- getThisWeek(e){
- let newdate = new Date();
- let nowdate = newdate.toLocaleDateString();
- let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
- if(e==1){
- this.WorktimeDatepickValue = nowwd
- this.showMonthWorkTime()
- }else if(e==2){
- this.WorktimeDatepickValue = nowwd
- this.showMonthWorkTimeReminder()
- }else{
- this.WorktimeDatepickValue = nowwd
- this.showMonthNotWorkTime()
- }
- },
- getDoubleLastWeek(e){
- let newdate = new Date()
- let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
- let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
- if(e==1){
- this.WorktimeDatepickValue = nextwd
- this.showMonthWorkTime()
- }else if(e==2){
- this.WorktimeDatepickValue = nextwd
- this.showMonthWorkTimeReminder()
- }else{
- this.WorktimeDatepickValue = nextwd
- this.showMonthNotWorkTime()
- }
- },
- alreadyAllDate(stime,etime){
- let diffdate = new Array();
- let i=0;
- while(stime<=etime){
- let dateArray = stime.split("-");
- let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
- // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
- let stimewk = this.weekDay[date.getDay()]
- 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')
- 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])
- diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
- let stime_ts = new Date(stime).getTime();
- let next_date = stime_ts + (24*60*60*1000);
- let next_dates_y = new Date(next_date).getFullYear()+'-';
- let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
- let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
- stime = next_dates_y+next_dates_m+next_dates_d;
- i++;
- }
- return diffdate
- },
- getAutoWeekDate(e) {
- let dateString = e;
- let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
- if (dateString.match(dateStringReg)) {
- let presentDate = new Date(dateString),
- today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
- return Array.from(new Array(7), function (val, index) {
- let formatDate = new Date(
- presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
- );
- return (
- formatDate.getFullYear() +
- "-" +
- ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
- "-" +
- (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
- );
- });
- } else {
- throw new Error(
- 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
- );
- }
- },
- onProgressChange() {
- this.$forceUpdate();
- },
- showChooseMembTree() {
- this.chosenMembCount = this.participator.length;
- this.chooseParticipVisible = true;
- },
- onTreeItemChange() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- findUserInTree() {
- if (this.filterName == '') {
- this.deptMembData = this.allMembData;
- } else {
- var list = this.findRecursively(this.filterName, this.allMembData);
- this.deptMembData = list;
- }
- },
- findRecursively(username, list) {
- var filterList = [];
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == 1) {
- if (list[i].label.indexOf(username) >= 0) {
- //匹配上了
- filterList.push(list[i]);
- }
- } else if (list[i].children != null && list[i].children.length > 0) {
- var subList = this.findRecursively(username, list[i].children);
- if (subList.length > 0) {
- subList.forEach(s=>filterList.push(s));
- }
- }
- }
- return filterList;
- },
- //确定选择参与人
- chooseParticip() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
- //只能选择一个人进行代填,防止任务有问题
- if (this.chosenMembList.length > 1) {
- this.$message({
- message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
- type: "error",
- });
- return;
- }
- this.chooseParticipVisible = false;
- this.workForm.userNames = '';
- this.workForm.userId = [];
- this.participator = [];
- for (var i=0;i<this.chosenMembList.length; i++) {
- this.workForm.userId.push(this.chosenMembList[i].id);
- this.workForm.userNames += this.chosenMembList[i].label+',';
- var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
- this.participator.push(item);
- }
- if (this.workForm.userNames.length > 0) {
- this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
- }
- if(this.user.userNameNeedTranslate == 1) {
- if(this.workForm.userNames) {
- this.workForm.userNames = this.workForm.userNames.split(',')
- }
- }
- //加载该人员的可填报项目
- if (this.workForm.userId.length > 0) {
- this.getSubUsersFillProjectList(this.workForm.userId[0]);
- }
- //打通企业微信考勤的情况,获取考勤
- if (this.user.timeType.showCorpwxCardtime) {
- this.getTargetUserCardTime();
- }
- },
- getTargetUserCardTime() {
- if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
- this.http.post('/user-corpwx-time/getUserCardTime',{
- userId: this.workForm.userId[0], date: this.workForm.createDate,
- },
- res => {
- if (res.code == "ok") {
- this.$set(this.workForm,'time', res.data);
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- },
- notifySel(sel){
- // console.log(sel);
- this.notifySelList = sel
- },
- //微信通知人员填写
- Notify(code) {
- if (this.notifySelList.length == 0) return;
- var ids = '';
- this.notifySelList.forEach(f=>{
- ids += f.id+',';
- })
- this.http.post('/user/pushFillReport',{
- ids: ids, date: this.curDate,
- code: code
- },
- res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.sentSuccessfully'),
- type: "success"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //导出人员列表
- exportMemb() {
- if (this.fillMembList.length == 0) return;
- var ids = '';
- this.fillMembList.forEach(f=>{
- ids += f.id+',';
- })
- this.http.post('/user/exportMembList',{
- ids: ids,isFill: this.isFill, date: this.curDate
- },
- res => {
- if (res.code == "ok") {
- var aTag = document.createElement('a');
- aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
- aTag.href = res.data;
- aTag.click();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- showMembList(fill) {
- this.membListVisible = true;
- if (fill == 0) {
- this.fillMembList = this.unFillList;
- this.isFill = false;
- let leaveList = []
- let unleaveList = []
- for(let i in this.fillMembList){
- if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
- leaveList.push(this.fillMembList[i])
- }else{
- unleaveList.push(this.fillMembList[i])
- }
- }
- this.fillMembList = unleaveList
- this.fillMembList_leave = leaveList
- } else if(fill == 1){
- this.fillMembList = this.fillList.filter(item => item.state != 3);
- this.isFill = true;
- }else{
- this.fillMembList = this.fillList.filter(item => item.state == 3);
- this.isFill = true;
- }
- },
- //获取自己填写的日报状态
- getReportFillStatus() {
- this.http.post('/report/getReportFillStatus',{
- startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
- },
- res => {
- if (res.code == "ok") {
- this.fillStatusList = res.data;
- this.allDate.forEach(d=>{
- var fillInfo = null;
- d.state = null;
- this.fillStatusList.forEach(s=>{
- var d1 = s.createDate.split('-')[2];
- var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
- if (d1.indexOf('0') == 0) {
- d1 = d1.substring(1,d1.length);
- }
- if (d1 == d2) {
- d.state = s.state;
- d.missReport = s.missReport;//是否漏填
- d.exceedCardTime = s.exceedCardTime
- }
- })
- })
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- scrollFunction () {
- this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
- if (this.domObj.attachEvent) { // IE
- this.domObj.attachEvent('onmousewheel', this.mouseScroll)
- } else if (this.domObj.addEventListener) {
- this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
- }
- this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
- },
- mouseScroll(event) { // google 浏览器下
- let detail = event.wheelDelta || event.detail
- let moveForwardStep = -1
- let moveBackStep = 1
- let step = 0
- step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
- event.preventDefault() // 阻止浏览器默认事件
- this.domObj.scrollLeft = this.domObj.scrollLeft + step
- },
- // //左右滚动
- // wheel(e){
- // var a = document.getElementById("dateScroll");
- // var scroll_width = 80; //滚动一下的距离
- // var e = e || window.event, v;
- // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
- // if(v>3||-v>3) v=-v;
- // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
-
- // e.preventDefault(); //阻止浏览器的默认滚动
- // },
- showExportDialog() {
- this.exportType = 0
- this.exportDialog = true;
- },
- showExportTimeDialog() {
- this.exportTimeDialog = true;
- },
- changeAllTime() {
- //总时长发生改变,自动按比例计算
- this.workForm.domains.forEach(d=>{
- d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
- });
- //计算jsTime
- if (this.workForm.createDate) {
- let sdate = new Date(this.workForm.createDate[0]);
- let edate = new Date(this.workForm.createDate[1]);
- let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
- if (days < 0) {
- days = 0;
- }
- this.jsTime = this.reportTimeType.allday * days;
- }
- },
- // 是否加班的单机事件
- check() {
- this.selected = !this.selected
- this.isNew = this.selected
-
- },
- updateSubProject() {
- this.$forceUpdate();
- },
- selectDegreeId(domain, index) {
- this.http.post('/report/defaultDegree',{
- projectId: domain.projectId
- },
- res => {
- if (res.code == "ok") {
- if(res.data) {
- this.workForm.domains[index].degreeId = res.data.id + ''
- this.$forceUpdate();
- }
-
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //项目选中了, 加载子项目
- selectProject(domain, index) {
- if(!domain.projectId){
- return;
- }
- // 默认选中上次填写的自定义维度
- if(this.yonghuUser.customDegreeActive == 1) {
- this.selectDegreeId(domain, index)
- }
-
- domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
- domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
- this.http.post('/sub-project/list',{
- projectId: domain.projectId,
- isReport: true
- },
- res => {
- //清空之前选中的子项目
- // this.workForm.domains[index].subProjectId = 0;
- if (res.code == "ok") {
- this.workForm.domains[index].subProjectList = res.data;
- this.workForm.domains[index].subProjectId = null;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- //项目相关的近期任务
- if (this.user.company.packageProject == 1) {
- this.getRecentTaskList(domain, index);
- //获取项目相关专业
- if (this.user.company.packageEngineering == 1) {
- this.getProjectProfessions(domain, index);
- }
- //获取项目下的任务分组
- this.getTaskGroups(domain, index);
- }
-
-
- // 获取项目相关的维度
- // domain.degreeId = null
- this.$set(domain,'degreeId',null)
- this.$set(domain,'multiDegrIdArray',null)
- this.dimension(domain, index);
-
- //获取项目审核人
- if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
- this.getProjectAuditorList(domain, index);
- } else {
- //按分组的负责人来审核
- domain.projectAuditorId = null;
- domain.projectAuditorName = null;
- domain.auditUserList = null;
- }
- if (this.reportTimeType.type == 3) {
- //新增项目时,自动计算
- domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
- }
- //加载昱众的工作职责
- if (this.user.companyId == this.yuzhongCompId) {
- this.updateResponse(domain);
- }
- const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
- if(reportExtraField4Name || reportExtraField5Name) {
- this.getInfoByProjectId(domain, index)
- }
- },
- getInfoByProjectId(domain, index, flag = true) {
- const { projectId } = domain
- const projectList = this.fillProjectList || this.subFillProjectList
- const { projectCode = '' } = projectList.find(item => item.id == projectId)
- this.http.post('/erpOrderInfo/getInfoByProjectId',{
- projectId: projectCode
- },
- res => {
- if (res.code == "ok") {
- if(flag) {
- this.workForm.domains[index].extraField4 = ''
- this.workForm.domains[index].extraField5 = ''
- }
- if((res.data.orderIds || []).length > 0) {
- this.workForm.domains[index].extraField4 = res.data.orderIds[0]
- }
- this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
- this.workForm.domains[index].reportExtraField5List = res.data.lines || []
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- getRecentTaskList(domain, index) {
- //刷新任务时,清空服务
- this.$set(domain, 'sapServiceId', null);
- this.$set(domain, 'taskId', null);
- var param = {
- projectId: domain.projectId,
- isSubstitude:this.isSubstitude?1:0,
- };
- if (domain.groupId) {
- param.groupId = domain.groupId;
- }
- if (domain.stage) {
- param.stage = domain.stage;
- }
- //专业版代填,获取代填员工的任务
- if (this.user.company.packageProject==1 && this.isSubstitude) {
- if (!this.workForm.userId || this.workForm.userId.length == 0) {
- this.$message({
- message: this.$t('qingXuanZeDaiTianDeYuanGong'),
- type: "error"
- });
- return;
- } else {
- param.userId = this.workForm.userId[0];
- }
- }
-
- this.http.post('/task/getRecentTask',param,
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].allTaskList = res.data;
- this.workForm.domains[index].taskList = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //获取项目审核人
- getProjectAuditorList(domainItem, index) {
- if(domainItem.projectId == '') {
- return
- }
- domainItem.projectAuditorId = null;
- domainItem.projectAuditorName = null;
- var param = { projectId: domainItem.projectId};
- if (this.isSubstitude) {
- if (this.workForm.userId != null && this.workForm.userId.length>0) {
- param.userId = this.workForm.userId[0];
- }
- }
- this.http.post('/project-auditor/getList',param,
- res => {
- if (res.code == "ok") {
- domainItem.auditUserList = res.data;
- if (res.data.length==0) {
- this.$message({
- message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
- type: "error"
- });
- } else if (res.data.length==1) {
- domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
- domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- // 获取维度数据
- dimension(domain, index) {
- if(domain.projectId == '') {
- return
- }
- this.http.post('/project/getDegreeList',{
- projectId: domain.projectId,
- },
- res => {
- if (res.code == "ok") {
- // console.log("维度数据",res.data);
- this.workForm.domains[index].wuduList = res.data
- // this.workForm = this.workForm
- this.$forceUpdate()
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //切换任务阶段
- changeStages(domain, index) {
- if (domain.stage == null || domain.stage == '') {
- this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
- } else {
- this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
- }
- this.getRecentTaskList(domain, index);
- this.$forceUpdate();
- },
- getGroupStages(domain, index, keepStage) {
- // console.log(domain);
- if(!domain.groupId){
- domain.projectAuditorId = ''
- domain.stages = []
- if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
- domain.taskId = ''
- domain.sapServiceId = ''
- }
- if(this.user.timeType.reportAuditType >= 1){
- domain.auditUserList = []
- }
- this.$forceUpdate();
- return
- }
- this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
- res => {
- if (res.code == "ok") {
- if (!keepStage) {
- domain.stage = '';
- }
- domain.stages = res.data;
- this.getRecentTaskList(domain, index);
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- //检查当前的项目是否需要获取分组的负责人
- if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
- this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
- res => {
- if (res.code == "ok") {
- domain.getProjectAuditorList = res.data;
- domain.auditUserList = res.data;
- if (res.data.length==1) {
- domain.projectAuditorId = domain.auditUserList[0].auditorId;
- domain.projectAuditorName = domain.auditUserList[0].auditorName;
- } else if (res.data.length==0) {
- domain.projectAuditorId = null;
- domain.projectAuditorName = null;
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- getProjectProfessions(domain, index) {
- this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].professionProgress = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //删除自己的日报
- deleteReport() {
- this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/report/delete',{
- userId: this.user.id,
- date: this.workForm.createDate
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.dialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
-
- },
- // 管理员删除日报
- guanli(item) {
-
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- let param = {date: this.date + day, userId: item.id};
-
- this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/report/delete',param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.dialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
-
- selectAll() {
- if (this.isAllSelect) {
- var keys = [];
- this.reportNames.forEach(b=>{
- keys.push(b.id);
- })
- this.$refs.approveTree.setCheckedKeys(keys);
- } else {
- this.$refs.approveTree.setCheckedKeys([]);
- }
- },
-
- removeEmptyNode(list) {
- for (var i=0;i<list.length;i++) {
- var cnt = 0;
- if (list[i].membCount == 0) {
- list.splice(i, 1);
- i--;
- } else if (list[i].children != null) {
- this.removeEmptyNode(list[i].children);
- }
- }
- },
- calculateMembCount(list) {
- for (var i in list) {
- var cnt = 0;
- if (list[i].children != null) {
- this.calculateMembCount(list[i].children);
- for (var m in list[i].children) {
- cnt += list[i].children[m].membCount;
- }
- }
-
- if (list[i].isUser == 1) {
- cnt++;
- this.membCount++;
- }
- list[i].membCount = cnt;
- }
- },
- stateChange() {
- // console.log(this.allData,'alldate');
- this.membCount = 0;
- if (this.selectState == -1) {
- //全部状态
- this.data = this.allData;
- } else {
- //未填报
- this.seluserText = ''
- var newData = JSON.parse(JSON.stringify(this.allData));
- this.filterState(this.selectState, newData);
- this.data = newData;
- }
- this.calculateMembCount(this.data);
- this.data[0].membCount = this.membCount;//总人数
- },
- //按状态过滤部门人员
- filterState(state, list) {
- for (var i =0;i<list.length; i++) {
- var obj = list[i];
- if (obj.isUser == 1) {
- var match = false;
- if (state == -2) {
- if (obj.state == null) {
- match = true;
- }
- } else {
- if (obj.state == state) {
- match = true;
- }
- }
- if (!match) {
- list.splice(i, 1);
- i--;
- } else {
- }
- } else {
- if (obj.children != null) {
- this.filterState(state, obj.children);
- }
- }
- }
- },
- //a按名称过滤部门人员
- async seluserforText(){
- const { userNameNeedTranslate } = this.user
- this.membCount = 0;
- var newData = JSON.parse(JSON.stringify(this.allData));
- let textList = [this.seluserText]
- if(userNameNeedTranslate == 1) {
- this.dataLoading = true
- let res = await this.postData('/user/getEmployeeList', {
- keyword: this.seluserText,
- cursor: '',
- departmentId: -1,
- pageIndex: 1,
- pageSize: 1000
- })
- textList = res.data.records.map(item => item.name)
- this.dataLoading = false
- }
- // return
- this.seluserforTextin(this.seluserText, newData, textList)
- this.data = newData;
- this.calculateMembCount(this.data);
- this.data[0].membCount = this.membCount;//总人数
- },
- seluserforTextin(text, list, textList = []){
- for (var i =0;i<list.length; i++) {
- var obj = list[i];
- if (obj.isUser == 1) {
- var match = false;
- // if (obj.label.indexOf(text) != -1) {
- // match = true
- // }
- if(textList.some(item => item.includes(obj.label))) {
- match = true
- }
- if (!match) {
- list.splice(i, 1);
- i--;
- } else {
- }
- } else {
- if (obj.children != null) {
- this.seluserforTextin(text, obj.children, textList);
- }
- }
- }
- },
- // 当节点发生变化时
- nodeChangeExpand(data) {
- // 保存当前展开的节点
- let flag = false
- this.nodeModelData.some(item => {
- if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
- flag = true
- return true
- }
- })
- if (!flag) { // 不存在则存到数组里
- this.nodeModelData.push(data.id)
- }
- localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
- },
- nodeChangeCollapse(data) {
- this.nodeModelData.some((item, i) => {
- if (item === data.id) {
- this.nodeModelData.length = i
- }
- })
- localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
- },
- // 部门列表点击
- handleNodeClick(data) {
- // this.dealList = data
- this.theValues(data.id, this.allData)
- // this.depData = data;
- var list = [];
- if (data.id == -1) {
- this.deptId = null;
- this.targetUid = null;
- list = this.data;
- } else if (data.isUser == 1) {
- this.deptId = null;
- this.targetUid = data.id;
- } else {
- this.deptId = data.id;
- this.targetUid = null;
- list.push(data);
- }
- this.getReportList();
- if (list.length > 0) {
- this.unFillList = this.getUserMembListFromDeptList(list, 0);
- this.fillList = this.getUserMembListFromDeptList(list, 1)
- }
- },
- exportPushLog(){
- this.http.post('/sap-sync-log/export',{},
- res => {
- if (res.code == "ok") {
- var filePath = res.data;
- var fName = '推送日志.xlsx'
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', fName);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- theValues(id, item) {
- for(var i in item) {
- if(item[i].id == id) {
- this.depData = item[i]
- if(id == '-1') {
- this.translation = '1'
- } else {
- if(item[i].children) {
- this.translation = '2'
- } else {
- this.translation = '3'
- }
- }
- return
- } else {
- if(item[i].children) {
- this.theValues(id, item[i].children)
- }
- }
- }
- },
- //获取可以选择的代填的人员列表
- getSubstitudeUserDeptList() {
- if (this.deptMembData.length == 0) {
- this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
- res => {
- if (res.code == "ok") {
- let noAllData = JSON.parse(JSON.stringify(res.data));
- if (noAllData.length > 0) {
- // if (noAllData[0].label == '全部人员') {
- if (noAllData[0].label == this.$t('lable.allStaff')) {
- noAllData.splice(0,1);
- }
- }
- this.setUserToDept(noAllData);
- this.deptMembData = noAllData;
- this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- // 获取部门列表
- getDepartmentForApprove() {
- this.http.post( this.port.manage.depList, {},
- res => {
- if (res.code == "ok") {
- var list1 = JSON.parse(JSON.stringify(res.data));
- this.deptOptionList = this.changeArr(list1);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取部门列表
- getDepartment() {
- //如果没有权限,就不需要获取
- if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
- return;
- }
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var param = {date:this.date + day};
- this.http.post("/report/getMembList", param,
- res => {
- if (res.code == "ok") {
- if(res.data.length == 0){
- return
- }
- this.departmentList = JSON.parse(JSON.stringify(res.data))
- var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
- this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
- // let noAllData = JSON.parse(JSON.stringify(res.data));
- // if (this.user.role > 0) {
-
- // }
- list.splice(0,0,{
- id: -1,
- label: this.$t('lable.allStaff'),
- })
- this.membCount = 0;
- //设置员工到部门下面
- this.setUserToDept(list);
- this.data = list;
- // console.log('data',this.data);
- this.expandDate = [this.data[1].id]
- this.allData = list;
-
- // if (noAllData.length > 0) {
- // if (noAllData[0].label == '全部人员') {
- // noAllData.splice(0,1);
- // }
- // }
- // this.setUserToDept(noAllData);
- // this.deptMembData = noAllData;
- this.option = this.changeArr(list1);
- list[0].membCount = this.membCount;
- if (this.depData.id == -1) {
- this.depData.membCount = this.membCount;
- this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
- this.fillList = this.getUserMembListFromDeptList(this.data, 1);
- } else {
- if (this.depData.isUser == null) {
- var dep = this.findTargetDept(this.data, this.depData.id);
- var membDeptList = [];
- membDeptList.push(dep);
- this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
- this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
- }
- }
- if (this.depData.isUser == null) {
- if (this.isFill) {
- this.fillMembList = this.fillList;
- } else {
- this.fillMembList = this.unFillList;
- }
- }
- this.leaveAllNum = 0
- for(let i in this.unFillList){
- if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
- this.leaveAllNum += 1
- }
- }
- this.stateChange()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- this.getReportFillStatus();
- },
- findTargetDept(list, deptId) {
- var t = null;
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == null && list[i].id == deptId) {
- t = list[i];
- break;
- }
- }
- if (t == null) {
- for (var i=0;i<list.length; i++) {
- if (list[i].children != null && list[i].children.length > 0) {
- t = this.findTargetDept(list[i].children, deptId);
- if (t != null) {
- break;
- }
- }
- }
- }
- return t;
- },
- getUserMembListFromDeptList(list, isFill) {
- var membList = [];
- for (var i in list) {
- var deptName = list[i].label;
- if (list[i].userList != null) {
- list[i].userList.forEach(element => {
- if (isFill == 0) {
- //获取未填的
- if (element.state == null) {
- var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
- membList.push(obj);
- }
- } else {
- if (element.state != null) {
- var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
- membList.push(obj);
- }
- }
-
- });
- }
- if (list[i].children != null) {
- membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
- }
- }
- return membList;
- },
- setUserToDept(list) {
- for (var i in list) {
- var cnt = 0;
- if (list[i].children != null) {
- this.setUserToDept(list[i].children);
- for (var m in list[i].children) {
- cnt += list[i].children[m].membCount;
- }
- }
-
- if (list[i].userList != null) {
- if (list[i].children == null) {
- list[i].children = [];
- }
- list[i].userList.forEach(element => {
- var obj = {
- id: element.id,
- label:element.name,
- state:element.state,
- parentId:element.departmentId,
- isUser:1,
- workingTime: element.workingTime,
- leaveDays: element.leaveDays,
- leaveTimes: element.leaveTimes
- };
- list[i].children.push(obj);
- this.membCount++;
- cnt++;
- });
- }
- list[i].membCount = cnt;
- }
- },
- // 修改数组
- changeArr(arr) {
- for (var i = 0; i < arr.length; i++) {
- if(arr[i].id != -1 && arr[i].id != 0) {
- if (arr[i].children != null && arr[i].children.length>0) {
- arr[i].children = this.changeArr(arr[i].children);
- }
- arr[i].id && (arr[i].value = arr[i].id);
- delete arr[i].id;
- }
- }
- for(var i in arr) {
- if(arr[i].id == -1 || arr[i].id == 0) {
- arr.splice(i,1)
- }
- }
- return arr;
- },
- //时间段范围设置改动,监听
- onTimeTypeChange(timeType) {
- this.seleChn(1)
- this.showAddMore = true;
- for(var i in this.workForm.domains) {
- if (this.workForm.domains[i].timeType == 0) {
- this.showAddMore = false;
- break;
- }
- }
- if (this.showAddMore) {
- //检测数量
- if (this.workForm.domains.length == 2) {
- this.showAddMore = false;
- } else {
- this.showAddMore = true;
- }
- }
- },
- getTimeType() {
- this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
- res => {
- if (res.code == "ok") {
- var t = res.data;
- this.reportTimeType = t;
- if (this.reportTimeType.type > 0) {
- this.showAddMore = true;
- }
- //转化时间格式
- if (t.allday != null) {
- this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
- }
- if (t.am != null) {
- this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
- }
- if (t.pm != null) {
- this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
- }
- let arr = []
- for(var i in res.data.excludeTimeList) {
- let obj = {
- s: res.data.excludeTimeList[i].startTime,
- e: res.data.excludeTimeList[i].endTime,
- }
- arr.push(obj)
- }
- this.vacationTime = arr
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 改变月份 -------
- changeMonthOut() {
- this.getAllDate();
-
- this.getReportList();
- this.getDepartment();
- },
- // 选择日期
- choseDate(i, item) {
- if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
- return
- }
- // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
- this.choseDay = i;
- let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- sessionStorage.msg = this.date + day,
- this.getReportList();
- this.getDepartment();
- this.curDate = item.date;
- },
- canClick(i, item){
- let nowDate = new Date()
- let nowDateYear = nowDate.getFullYear()
- let itemYear = parseInt(this.date.split('-')[0])
- let nowDateMonth = nowDate.getMonth() + 1
- let itemMonth = parseInt(this.date.split('-')[1])
- let nowDateDay = nowDate.getDate()
- let itemDay = parseInt(item.showDate.split('.')[1])
- if(nowDateYear < itemYear){
- return false
- }else if(nowDateYear == itemYear){
- if(nowDateMonth < itemMonth){
- return false
- }else if(nowDateMonth == itemMonth){
- if(nowDateDay < itemDay){
- return false
- }
- }
- }
- },
- // 获取日期列表
- getAllDate(e) {
- var dayArry = [];
- var day = this.getCountDays();
- let curMonthDay = null;
- for (var k = 1; k <= day; k++) {
- var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
- var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
- if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
- new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
- if(sessionStorage.msg) {
- if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
- this.choseDay = k - 1;
- curMonthDay = str;
- }
- } else {
- if (new Date().getDate() == k) {
- this.choseDay = k - 1;
- }
- }
- } else {
- this.choseDay = 0;
- }
- var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
- var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
- dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
- }
- this.allDate = dayArry;
- //不能超过最大日期
- if (this.choseDay > day-1) {
- this.choseDay = day-1;
- }
- if(sessionStorage.from != 1){
- let nowmonth = new Date().getMonth() + 1
- let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
- let nowdate = new Date().getDate()
- if(nowd == this.date){
-
- if(e && sessionStorage.msg){
- }else{
- sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
- }
- let nowday = new Date(sessionStorage.msg).getDate()
- this.choseDay = nowday - 1
-
- let monthdate = new Date(sessionStorage.msg)
- this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
-
- }else{
- if(e && sessionStorage.msg){
- }else{
- sessionStorage.msg = this.date + '-01'
- }
- let monthdate = new Date(sessionStorage.msg)
- this.choseDay = monthdate.getDate() - 1
- this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
- // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
- }
- }else{
- this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
- }
-
- //从消息点击跳转过来的,直接加载指定日期
- if (sessionStorage.from == 1 && sessionStorage.msg) {
- this.curDate = sessionStorage.msg;
- sessionStorage.from = 0;
- } else {
- // if (curMonthDay != null) {
- // // this.curDate = curMonthDay;
- // let d = new Date(sessionStorage.msg)
- // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
- // } else {
- // let d = new Date(this.date.replace(/-/g, "/")+'/01')
- // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
- // }
- }
- // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
- // if(!sessionStorage.msg){
- // let msgday = this.choseDay + 1
- // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
- // }
-
- this.getReportFillStatus();
- },
- getCountDays() {
- var newstr = this.date.replace(/-/g, "/");
- var curDate = new Date(newstr+'/01');
- var curMonth = curDate.getMonth();
- curDate.setMonth(curMonth + 1);
- curDate.setDate(0);
- return curDate.getDate();
- },
- reqMore() {
- if (this.hasMore) {
- this.pageIndex++;
- this.requestHttpReports();
- }
- },
- //加载日报数据
- requestHttpReports() {
- //请求数据
- this.listLoading = true;
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- let param = {date: this.date + day};
- if (this.deptId) {
- param.deptId = this.deptId;
- }
- if (this.targetUid) {
- param.userId = this.targetUid;
- }
- //传页码
- if (this.hasMore) {
- param.pageIndex = this.pageIndex;
- }
- this.http.post( this.port.report.list, param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- //扩增
- if (res.data.data.length > 0) {
- this.reportList = this.reportList.concat(res.data.data);
- } else if (this.pageIndex > 1){
- this.$message({
- message: this.$t('meiYouGengDuoShuJuLe'),
- type: "info"
- });
- }
-
- this.hasMore = res.data.hasMore;//标记是否还有更多数据
- if(document.querySelector("#day"+this.choseDay)){
- document.querySelector("#day"+this.choseDay).scrollIntoView(true);
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取日报列表
- getReportList() {
- //初始化,重置数据
- this.pageIndex = 0;
- this.hasMore = true;
- this.reportList = [];
- this.requestHttpReports();
- },
- //刷新日报状态,用于审核后更新
- refreshReportData(reportId) {
- this.http.post('/report/getDetailReportById', {reportId:reportId},
- res => {
- if (res.code == "ok") {
- for (var m=0;m<this.reportList.length; m++) {
- var d = this.reportList[m].data;
- var find = d.filter(r=>r.id == reportId);
- if (find.length > 0) {
- find[0].state = res.data.state;
- if (find[0].state == 2) {//被驳回,要可以编辑
- this.reportList[m].state = 2;
- }
- find[0].isDeptAudit = res.data.isDeptAudit;
- find[0].departmentAuditState = res.data.departmentAuditState;
- find[0].projectAuditorName = res.data.projectAuditorName;
- find[0].projectAuditorId = res.data.projectAuditorId;
- find[0].projectAuditState = res.data.projectAuditState;
- find[0].rejectUserid = res.data.rejectUserid;
- find[0].rejectUsername = res.data.rejectUsername;
- find[0].rejectReason = res.data.rejectReason;
- this.$forceUpdate();
- break;
- }
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
-
- //导出员工工时统计
- exportUserTime() {
- this.listLoading = true;
- var param = {};
- if (this.exportParam.dateRange != null) {
- param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
- }
- this.http.post('/department/exportDeptStatistic', param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- location.href = res.data;
- this.exportTimeDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //导出日报
- exportReport() {
- this.exportingData = true;
- var param = {};
- if (this.exportParam.dateRange != null) {
- param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
- }
- if (this.exportParam.projectId != null) {
- param.projectId = this.exportParam.projectId;
- }
- if (this.exportParam.departmentId != null) {
- // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
- param.departmentIds = this.exportParam.departmentId.join(',')
- }
- param.stateKey = this.stateKey
- // param.departmentId = this.user.departmentId
- this.http.post(this.port.report.export, param,
- res => {
- this.exportingData = false;
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- this.exportDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.exportingData = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //导出日报审核记录
- exportReportLog() {
- this.exportingData = true;
- var param = {};
- if (this.exportReportLogParam.dateRange != null) {
- param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
- }
- this.http.post('/report-log/exportReportLog', param,
- res => {
- this.exportingData = false;
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download','日报审核记录.xlsx');// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- this.exportDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.exportingData = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- restUserCardTime(item){
- let param={}
- param.userId=item.userId
- param.createDate=item.createDate
- this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
- res => {
- if (res.code == "ok") {
- this.showMonthWorkTimeReminder()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- importReportLog(item){
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- const loading = this.$loading({
- lock: true,
- text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
- let formData = new FormData();
- formData.append("multipartFile", item.file);
- this.http.uploadFile('/report-log/importReportLogChange', formData,
- res => {
- this.$refs.upload.clearFiles();
- loading.close();
- if (res.code == "ok") {
- this.$message({
- message: res.msg,
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- loading.close();
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- //获取项目列表
- getProjectList() {
- this.listLoading = true;
- this.http.post( this.port.project.list, {},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.projectList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getSubUsersFillProjectList(userId) {
- this.http.post( this.port.project.list, {
- forReport: 1,
- userId: userId
- },res => {
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.subFillProjectList = res.data;
- this.getRecentlyProject(userId)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取填报日报的项目下拉列表
- getFillProjectList() {
- this.http.post( this.port.project.list, {
- forReport: 1
- },res => {
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.fillProjectList = res.data;
- this.getRecentlyProject()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //自己填写日报时,刷新到自己的可填报日报列表
- refreshToMyReportProjectList() {
- this.getRecentlyProject();
- },
- getBasecostItemList() {
- this.http.post('/project-basecost-setting/getReportBasecostList', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.timeBasecostList = res.data;
- }
- });
-
- },
- getAIReport(createDate) {
- this.http.post('/report/getAIReport', {},
- res => {
- if (res.code == "ok") {
- var quanbu = 0
- this.jsDay = 1
- var zhi = ''
- var slp = res.data
- for(var i in slp) {
- var sp = +slp[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- var aiReportData = res.data;
-
- this.canCancelInDialog = false
- if(aiReportData.length != 0) {
- var arr = [];
- for(var i in aiReportData) {
- arr.push({
- id: null,
- projectId: aiReportData[i].projectId,
- workingTime: aiReportData[i].workingTime,
- content: '',
- progress:100,
- state: 2,
- timeType: aiReportData[i].timeType,
- subProjectList: aiReportData[i].subProjectList,
- taskList: aiReportData[i].taskList,
- subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
- groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
- taskId: aiReportData[i].taskId,
- startTime: aiReportData[i].startTime,
- endTime: aiReportData[i].endTime,
- isOvertime: 0,
- progress:aiReportData[i].progress,
- professionProgress: aiReportData[i].professionProgressList,
- stages:aiReportData[i].stages,
- stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
- pics: null,
- multiWorktime: aiReportData[i].multiWorktime || 0,
- worktimeList: [{}],
- degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
- multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
- wuduList: aiReportData[i].degreeList,
- taskGroups:aiReportData[i].taskGroups,
- customData: aiReportData[i].customData,//自定义的数值
- auditUserList: aiReportData[i].auditUserList,
- projectAuditorId: aiReportData[i].projectAuditorId,
- projectAuditorName: aiReportData[i].projectAuditorName,
- overtimeHours: aiReportData[i].overtimeHours,
- customText: aiReportData[i].customText,
- basecostId: aiReportData[i].basecostId,
- auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
- auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
- auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
- ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
- canEdit: true
- })
- }
- this.workForm.domains = arr;
- } else {
-
- }
- this.canEdit = true;
- this.originCanEdit = true;
- this.seleChn()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取个人某天的日报 111111
- getReport() {
- this.http.post( this.port.report.getPort, {
- date: this.workForm.createDate
- },
- res => {
- if (res.code == "ok") {
- var quanbu = 0
- this.jsDay = 1
- var zhi = ''
- var slp = res.data.report
- for(var i in slp) {
- var sp = +slp[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- var list = res.data;
- this.report = list;
- this.reportTimeType = this.report.timeType;
- //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
- this.isWeekend = !this.report.isWorkDay;
-
- this.canCancelInDialog = false;
- this.hasWrittenReport = list.report.length != 0;
- if(list.report.length != 0) {
- var arr = [];
- this.canEdit = false;
- let candelete = true
- const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
- for(var i in list.report) {
- var flg = null
- list.report[i].isOvertime == 1 ? flg = true : flg = false
- var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
- var filteredRespList = null
- if (targetP.length > 0) {
- var isPublic = targetP[0].isPublic;
- 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);
- }
- let copyData = {
- id: list.report[i].id,
- projectId: list.report[i].projectId,
- workingTime: list.report[i].workingTime,
- content: list.report[i].content,
- state: list.report[i].state,
- timeType: list.report[i].timeType,
- subProjectList: list.report[i].subProjectList,
- taskList: list.report[i].taskList,
- subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
- groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
- taskId: list.report[i].taskId,
- // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
- startTime: list.report[i].startTime,
- // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
- endTime: list.report[i].endTime,
- isOvertime: flg,
- progress:list.report[i].progress,
- professionProgress: list.report[i].professionProgressList,
- stages:list.report[i].stages,
- stage:list.report[i].stage == '-'?null:list.report[i].stage,
- pics: list.report[i].pics,
- multiWorktime: list.report[i].multiWorktime,
- worktimeList: list.report[i].worktimeList,
- degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
- multiDegrIdArray: list.report[i].multiDegrIdList,
- wuduList: list.report[i].degreeList,
- taskGroups:list.report[i].taskGroups,
- customData: list.report[i].customData,//自定义的数值
- auditUserList: list.report[i].auditUserList,
- overtimeHours: list.report[i].overtimeHours,
- customText: list.report[i].customText,
- basecostId: list.report[i].basecostId,
- auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
- auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
- auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
- ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
- canEdit: list.report[i].state >= 2 ? true : false,
- extraField1: list.report[i].extraField1,
- extraField2: list.report[i].extraField2,
- extraField3: list.report[i].extraField3,
- extraField4: list.report[i].extraField4,
- extraField5: list.report[i].extraField5,
- workContentList: list.report[i].workContentList,
- filteredRespList: filteredRespList,
- serviceList: list.report[i].serviceList,
- sapServiceId: list.report[i].sapServiceId,
- reportTargetDeptId: list.report[i].deptId
- }
- if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
- //分组负责人审核的情况下,前端不需要显示,无需设置
- copyData.projectAuditorId = list.report[i].projectAuditorId;
- copyData.projectAuditorName = list.report[i].projectAuditorName;
- }
- arr.push(copyData);
- if (list.report[i].state >= 2) {
- this.canEdit = true;
- }
- if(list.report[i].state < 2){
- candelete = false
- }
- if (list.report[i].state == 0){
- this.canCancelInDialog = true
- }
- // 加判断
- if(this.user.timeType.choseFromAlbum == 1) {
- let arrList = []
- for(var k in list.report[i].pics) {
- let obj = {
- name: k,
- url: list.report[i].pics[k]
- }
- arrList.push(obj)
- }
- arr[i].imgListUrl = arrList
- arr[i].imgList = list.report[i].pics
- }
- if(reportExtraField4Name || reportExtraField5Name) {
- this.getInfoByProjectId(copyData, i, false)
- }
- }
- this.reportCanDelete = candelete
- this.workForm = {
- createDate: this.workForm.createDate,
- domains: arr,
- userNames:null,
- userId:null,
- time: list.time,
- showRefresh: list.showRefresh
- }
- } else {
- this.workForm = {
- createDate: this.workForm.createDate,
- domains: [{
- id: null,
- projectId: "",
- workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- auditorFirst: '',
- auditorSec: '',
- auditorThird: '',
- ccUserid: ''
- }],
- userId:null,
- userNames:null,
- time: this.report.time,
- showRefresh: list.showRefresh
- }
- // businessTrips 有数据的情况下
- const businessTrips = res.data.businessTrips || []
- this.businessTripsArray = res.data.businessTrips || []
- if(businessTrips.length > 0) {
- this.workForm.domains = businessTrips.map((item, index) => {
- return {
- id: null,
- projectId: item.projectId,
- workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- auditorFirst: '',
- auditorSec: '',
- auditorThird: '',
- ccUserid: ''
- }
- })
- for(let domainsIndex in this.workForm.domains) {
- this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
- }
- }
- if(this.isWeekend && this.user.timeType.lockWorktime != 1){
- this.$set(this.workForm.domains[0],'isOvertime',true)
- if(this.reportTimeType.type != 2){
- this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
- }
- }
- if(this.user.timeType.type == 1) {
- var shuzhi = this.user.timeType.allday + ''
- // console.log('执行一次', shuzhi.indexOf('.'))
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
- }
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认给第一个,必填字段
- this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
- }
-
- this.canEdit = true;
- }
- this.originCanEdit = this.canEdit;
- this.seleChn()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- guanbi() {
- this.falsss = false,
- this.workTimeForMinYi=0
- },
- // 打开日报填写
- fillInReport(i, isBatch) {
- this.isWeekend = false
- this.reportCanDelete = false
- // console.log(this.user.timeType.type, '选择时长')
- if(i != 1) {
- this.falsss = false
- } else {
- this.falsss = true
- }
- if (this.isSubstitude) {
- this.getSubstitudeUserDeptList();
- } else {
- this.refreshToMyReportProjectList();
- }
- if(i == -1 || this.isSubstitude) {
- this.isDisable = false;
- } else {
- this.isDisable = true;
- }
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.isBatch = isBatch;
- if (this.isBatch == 0 && !this.isSubstitude) {
- this.workForm.createDate = this.date + day; // 获取个人某天的日报
- let weekday = new Date(this.workForm.createDate).getDay()
- if(this.user.companyId == 817){
- if(weekday == 0){
- this.isWeekend = true
- }
- }else{
- if(weekday == 0 || weekday == 6){
- this.isWeekend = true
- }
- }
- this.getReport(i);
- } else {
- this.jsTime = 0
- this.jsDay = 0
- this.workForm = {
- createDate: null,//批量填报没有日期
- domains: [{
- id: null,
- projectId: "",
- workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- }],
- }
- if(this.user.timeType.type == 1) {
- var shuzhi = this.user.timeType.allday + ''
- // console.log('执行二次')
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
- }
- if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
- this.workForm.showRefresh = true;
- }
- if (this.timeBasecostList&&this.timeBasecostList.length>0) {
- this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
- }
- this.canEdit = true;
- }
- if (this.isSubstitude) {
- //代填情况,默认计算合计工时
- this.jsDay = 1
- this.seleChn();
- }
- this.dialogVisible = true;
- },
- //按周填报的弹窗口中编辑单项目相关数据
- setWeekFormReportItem(reportId, i, names, row,sss) {
- const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
- this.http.post('/report/getReportById', {
- reportId: reportId
- },
- res => {
- if (res.code == "ok") {
- var data = res.data.report;
- sss.subProjectId = data.subProjectId
- sss.subProjectList = data.subProjectList;
- sss.stage = data.stage
- sss.subProjectList = data.subProjectList
- sss.stages = data.stages
- sss.taskGroups = data.taskGroups;
- sss.auditUserList = data.auditUserList;
- sss.degreeId = data.degreeId;
- sss.customData = data.customData;
- sss.wuduList = data.degreeList;
- if(reportExtraField4Name || reportExtraField5Name) {
- sss.extraField4 = data.extraField4 || ''
- sss.extraField5 = data.extraField5 || ''
- }
- this.zhoBaoIdx = i
- this.zhoBaoName = names
- this.zhoBao = sss
- this.zhis = row
- if (sss.groupId) {
- //最后一个参数表示是否保留stage的值,不要重置为空
- this.getGroupStages(this.zhoBao, 0, true)
- }
- if(reportExtraField4Name || reportExtraField5Name) {
- this.weekGetInfoByProjectId(sss)
- }
- this.$forceUpdate();
- }
- });
- },
- // 重新计算合计
- fillInThePedometerOnAWeeklyBasis(index) {
- const weeklyItem = this.zhoData[index] || {}
- const dynamicProjectList = this.selProjectList || []
- const collectionArray = dynamicProjectList.map(item => {
- const name = item.projectName
- return Number(weeklyItem[name].workingTime || 0)
- })
- const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
- this.zhoData[index].he = totalNum
- },
- //输入工时触发
- onInputWorkTime(index) {
- const weeklyItem = this.zhoData[index] || {}
- },
- // 按周填报里内容的填写
- showWeekItemEdit(item, i, projectId,names, row) {
- if (item.state == 0) {
- this.$message({
- message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
- type: "error"
- });
- return;
- }
- if (item.state == 1) {
- this.$message({
- message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
- type: "error"
- });
- return;
- }
-
- if(this.user.timeType.notAllowedNoAttendance == 1){
- if(this.zhoData[i].corpTime){
- if(this.zhoData[i].corpTime.workHours == 0){
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }else{
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }
- var obj = {}
- obj.projectId = projectId
- this.tianxieDialogVisible = true
- this.scopess = item
- var sss = {}
- if (item.id != null) {
- sss.id = item.id;
- sss.state = item.state;
- } else {
- sss.id = -1;
- sss.state = 3;
- }
- sss.projectId = projectId;
- sss.progress = item.progress
- sss.time = item.time
- sss.content = item.content;
- if (sss.time == '' && this.reportTimeType.type == 2) {
- //取已填时间范围中最大的一个作为开始时间
- var startTime = '09:00';
- var fillStartTime = '00:00';
- for (var t in this.selProjectList) {
- var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
- if (fillItem.time) {
- if (fillItem.time[1] > fillStartTime) {
- fillStartTime = fillItem.time[1];
- }
- }
- }
- if (fillStartTime == '00:00') {
- fillStartTime = '09:00';
- }
- var fillEndMax = '18:00';
- if (fillStartTime >= '18:00') {
- fillEndMax = '23:59';
- }
- sss.time = [fillStartTime, fillEndMax];
- }
- sss.groupId = item.groupId
- sss.stage = item.stage;
- sss.workingTime = item.workingTime
- sss.projectAuditorId = item.projectAuditorId;
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认选中第一个
- sss.basecostId = this.timeBasecostList[0].id;
- }
- var hasEdited = this.zhoData[i][names].hasEdited;
- if (hasEdited) {
- console.log('执行到了这个')
- console.log('执行到了这个', { ...item }, obj)
- sss = { ...item }
- //编辑过了
- sss.subProjectId = item.subProjectId
- sss.stage = item.stage
- sss.subProjectList = item.subProjectList
- sss.stages = item.stages
- sss.taskGroups = item.taskGroups;
- // sss.auditUserList = obj.auditUserList ;
- sss.degreeId = item.degreeId;
- sss.customData = item.customData;
- if (sss.auditUserList != null && sss.auditUserList.length == 1) {
- //只有一个审核人,自动设置上去
- sss.projectAuditorId = sss.auditUserList[0].auditorId;
- }
- sss.wuduList = item.wuduList;
- this.zhoBaoIdx = i
- this.zhoBaoName = names
- this.zhoBao = sss
- this.zhis = row
- if (sss.groupId) {
- //最后一个参数表示是否保留stage的值,不要重置为空
- this.getGroupStages(this.zhoBao, 0, true)
- }
- this.$forceUpdate();
- this.getWeeklyTaskList(sss)
- } else {
- //第一次打开,获取数据
- if (sss.id == -1) {
- //新填报的
- this.selectProject(obj, 0);
- var that = this
- setTimeout(() =>{
- sss.subProjectId = that.workForm.domains[0].subProjectId
- sss.subProjectList = item.subProjectList;
- sss.stage = that.workForm.domains[0].stage
- sss.subProjectList = that.workForm.domains[0].subProjectList
- sss.stages = that.workForm.domains[0].stages
- sss.taskGroups = that.workForm.domains[0].taskGroups;
- sss.auditUserList = obj.auditUserList;
- sss.degreeId = item.degreeId;
- sss.customData = item.customData;
- if (sss.auditUserList != null && sss.auditUserList.length==1) {
- //只有一个审核人,自动设置上去
- sss.projectAuditorId = sss.auditUserList[0].auditorId;
- }
- sss.wuduList = row[0].wuduList
- that.zhoBaoIdx = i
- that.zhoBaoName = names
- that.zhoBao = sss
- that.zhis = row
- if (sss.groupId) {
- //最后一个参数表示是否保留stage的值,不要重置为空
- this.getGroupStages(that.zhoBao, 0, false)
- }
- that.$forceUpdate();
- this.getWeeklyTaskList(sss)
- },600);
- } else {
- //编辑填报过的;数据库已经存在的
- this.setWeekFormReportItem(sss.id, i, names, row, sss);
- }
- if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
- setTimeout(() => {
- this.weekGetInfoByProjectId(sss)
- }, 1000)
- }
- }
- },
- weekGetInfoByProjectId(item) {
- console.log(item, '<=== item')
- const { projectId } = item
- const projectList = this.fillProjectList || this.subFillProjectList
- const { projectCode = '' } = projectList.find(item => item.id == projectId)
- this.http.post('/erpOrderInfo/getInfoByProjectId',{
- projectId: projectCode
- },
- res => {
- if (res.code == "ok") {
- this.zhoBao.reportExtraField4List = res.data.orderIds || []
- this.zhoBao.reportExtraField5List = res.data.lines || []
- if((res.data.orderIds || []).length > 0) {
- this.zhoBao.extraField4 = res.data.orderIds[0]
- }
- console.log(this.zhoBao, '<===== this.zhoBao')
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- // console.log(item)
- // console.log(this.zhoBao)
- },
- // 按周填报里内容的填写点击确定
- setWeekProItemData() {
- //专业版模式下,任务分组和阶段必填
- if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
- if (!this.zhoBao.groupId || !this.zhoBao.stage) {
- this.$message({
- message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
- type: "error"
- });
- return;
- }
- }
- // 检查任务分组
- if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
- this.$message({
- message: this.$t('renWuFenZuBiTianQingJianCha'),
- type: "error"
- });
- return
- }
- //检查子项目是否必填
- if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
- this.$message({
- message: this.$t('ziXiangMuBiTianQingJianCha'),
- type: "error"
- });
- return;
- }
- if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
- this.$message({
- message: this.$t('message.Pleaseselectareviewer'),
- type: "error"
- });
- return
- }
- if(this.user.timeType.reportAuditType == 3){
- let auditTips = ''
- if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
- // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
- // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
- if(auditTips){
- auditTips = auditTips.substring(0,auditTips.length - 1)
- this.$message({
- message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
- type: 'error'
- })
- return
- }
- }
- let errtips = ''
- if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
- if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
- errtips += this.user.timeType.customDegreeName + '、'
- }
- }
- if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
- errtips += this.user.timeType.customDataName + '、'
- }
- if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
- errtips += this.user.timeType.customTextName + '、'
- }
- if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
- errtips += this.$t('other.workMatters') +'、'
- }
- if(errtips){
- errtips = errtips.substring(0,errtips.length - 1)
- this.$message({
- message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
- type: 'error'
- })
- return
- }
- this.tianxieDialogVisible = false
- var zhong = this.zhoData
- this.zhoBao.hasEdited = true;
- zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
- this.zhoData = zhong
- if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
- if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
- if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
- },
- // 获取本周
- getCurrentWeek() {
- //今天
- this.targetWeekDate = new Date();
- this.initWeekFormData();
- // this.jiazai()
- },
- // 获取上周
- handleGetPrevWeek() {
- this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
- this.initWeekFormData();
- // this.jiazai()
- },
- // 获取下周
- handleGetNextvWeek() {
- this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
- this.initWeekFormData()
- },
-
- // 加载动画
- jiazai() {
- this.weekDataLoading = true
- var that = this
- setTimeout(() =>{
- that.weekDataLoading = false
- },1000);
- },
- // 转时间格式
- dealdate(date) {
- const dt = new Date(date)
- const y = dt.getFullYear()
- const m = (dt.getMonth() + 1 + '').padStart(2, '0')
- const d = (dt.getDate() + '').padStart(2, '0')
- return `${y}-${m}-${d}`
- },
- // 按周填报
- fillInReportss() {
- window.addEventListener('scroll', this.handleScroll, true)
- // this.jiazai()
- this.fillWeekDialogVisi = true;
- if (this.isSubstitude) {
- this.substitudeStep = 1;
- this.getSubstitudeUserDeptList();
- } else {
- this.getCurrentWeek();
- }
-
- if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
- //重新获取工时预警类型的预算项
- this.http.post('/project-basecost-setting/getReportBasecostList', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.timeBasecostList = res.data;
- }
- });
- }
- },
- fillInReportCustom() {
- this.weekIndex++
- this.weekParentData = {
- isSubstitude: this.isSubstitude
- }
- this.fillWeekDialogVisiCustom = true
- },
- // 按周填报的项目筛选
- selListFun(){
- this.selProjectList = []
- if(this.selCon.length){
- for (let i = 0; i < this.selCon.length; i++) {
- this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
- }
- this.selConShow = false ;
- for (let i in this.zhoData) {
- var obj = this.zhoData[i];
- for(var j in this.selProjectList) {
- var xinzhi = this.selProjectList[j].projectName
- obj[xinzhi] = {}
- obj[xinzhi].time = ''
- obj[xinzhi].content = ''
- obj[xinzhi].progress = 0
- obj[xinzhi].workingTime = 0
- }
- }
- this.initWeekFormData();
- }else{
- this.$message({
- message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
- type:'error'
- })
- }
- },
- setWeekCardTimeData(list) {
- for(let i in list){
- let datei = '';
- if (this.user.timeType.showDdCardtime == 1) {
- datei = list[i].workDate;
- } else if (this.user.timeType.showCorpwxCardtime == 1) {
- datei = list[i].createDate;
- } else if (this.user.timeType.syncFanwei == 1) {
- datei = list[i].workDate;
- }
-
- for(let m in this.zhoData) {
- if(datei == this.zhoData[m].zhoDataTime){
- let item = {
- startTime: list[i].startTime,
- endTime: list[i].endTime,
- workHours: list[i].workHours,
- otTime: list[i].otTime
- }
- this.$set(this.zhoData[m],'corpTime',item)
- }
- }
- }
- },
- getWeeklyCardTime(){ //按周填报获取考勤信息
- let dateStr = []
- for(let i in this.zhoData){
- dateStr.push(this.zhoData[i].zhoDataTime)
- }
- this.http.post('/report/getWeeklyCardTime',{
- dateStr: JSON.stringify(dateStr)
- },res => {
- if(res.code == 'ok'){
- for(let i in res.data){
- let datei = '';
- if (this.user.timeType.showDdCardtime == 1) {
- datei = res.data[i].workDate.split('-');
- } else if (this.user.timeType.showCorpwxCardtime == 1) {
- datei = res.data[i].createDate.split('-');
- }
-
- for(let m in this.zhoData){
- let datem = new Date(this.zhoData[m].zhoDataTime)
-
- if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
- let item = {
- startTime: res.data[i].startTime,
- endTime: res.data[i].endTime,
- workHours: res.data[i].workHours
- }
- this.$set(this.zhoData[m],'corpTime',item)
- }
- }
- }
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
-
- selListqx(){
- this.fillWeekDialogVisi = false
- this.selProjectList = []
- this.selCon = []
- },
- handleScroll() {
- this.changdu = this.projectList.length + 1
- },
- // 自动选择时间点的事件
- // async zhoTimes(item, i) {
- // var iss = i
- // if(item.time == null) {
- // return
- // } else {
- // const zhi = this.zhoData[iss];
- // let he = 0;
- // const timeArr = Object.values(zhi)
- // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
- // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
- // const data = await this.getWeekHoursByTimeRange(timeArr);
- // console.log(data, 'data');
- // zhi.he = `${he}h`;
- // }
- // },
- async zhoTimes(item, index) {
- const zho = this.zhoData[index];
- if (!item.time) {
- return;
- }
- const timeArr = Object.values(zho)
- .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
- .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
- const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
- zho.he = `${totalHours[0]}h`;
- },
- // 判断两个时间段是否重叠
- timeOverlap(idx, dateAr) {
- let zhi = 0
- for (let k in dateAr) {
- if (idx !== k) {
- 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))) {
- // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
- zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
- }
- // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
- zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
- } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
- } else {
- // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
- if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
- }
- // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
- }
- }
- }
- }
- }
- return zhi
- },
- // 计算时间
- getHourMinutes(str, end) {
- var he = 0
- var date2 = '2021/12/12 ' + end +':00'
- var date1 = '2021/12/12 ' + str +':00'
- var date3 = new Date(date2).getTime() - new Date(date1).getTime();
- var leave1=date3%(24*3600*1000)
- var hours=Math.floor(leave1/(3600*1000))
- var leave2=leave1%(3600*1000)
- var minutes=Math.floor(leave2/(60*1000))
- var shi = hours+'.'+ minutes
- return he += +shi
- },
- // 自动选择事件长度的事件
- zhoXuan(item, i) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
- if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
- console.log('执行')
- he += +zhi[i].workingTime
- }
- }
- zhi.he = he + 'h'
- }
- },
- getPushWorkLogData(){
- this.http.post('/sap-sync-log/list', {},
- res => {
- if (res.code == "ok") {
- this.pushWorkTimeLogData = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取全部人员
- getUsers() {
- this.http.post('/user/getSimpleActiveUserList', {},
- res => {
- if (res.code == "ok") {
- this.usersList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 按时间比例
- addBli(item, i) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
- he += +zhi[i].workingTime
- }
- }
- zhi.he = he.toFixed(1) + 'h'
- }
- },
- //按周填报选择的项目发生变化,需要设置列
- onSelProjectChange() {
- for (let i = 0; i < this.selCon.length; i++) {
- var exists = false;
- for (let j = 0; j < this.selProjectList.length; j++) {
- if (this.selProjectList[j].id == this.selCon[i]) {
- exists = true;
- break;
- }
- }
- if (!exists) {
- var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
- this.selProjectList.push(newProject);
- //添加新项目
- for (var w in this.zhoData) {
- var dayItem = this.zhoData[w];
- var pName = newProject.projectName;
- dayItem[pName] = {};
- dayItem[pName].time = ''
- dayItem[pName].content = ''
- dayItem[pName].progress = 0
- dayItem[pName].workingTime = 0
- }
- }
- }
- //去掉
- for (let j = 0; j < this.selProjectList.length; j++) {
- var exists = false;
- for (let i = 0; i < this.selCon.length; i++) {
- if (this.selProjectList[j].id == this.selCon[i]) {
- exists = true;
- break;
- }
- }
-
- if (!exists) {
- this.selProjectList.splice(j, 1);
- j--;
- }
- }
- this.loadFilledWeekReportItem();
- //刷新表格
- // this.$refs.weekTable.doLayout();
- },
- //根据选中的项目来刷新填写表格
- loadFilledWeekReportItem() {
- for (var w in this.zhoData) {
- var dayItem = this.zhoData[w];
- for (var i = 0; i < this.selProjectList.length; i++) {
- var curColumnProject = this.selProjectList[i];
- var dayProjectReportItem = dayItem[curColumnProject.projectName];
- for (var t in dayItem.reportList) {
- //有日报的项目,不能取消选择
- for (var p in this.fillProjectList) {
- if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
- }
- if (dayItem.reportList[t].projectId == curColumnProject.id) {
- // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
- dayItem[curColumnProject.projectName] = dayItem.reportList[t];
- if (this.reportTimeType.type == 2) {
- //时间段模式
- dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
- }
- // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
- break;
- }
- }
- // dayItem[curColumnProject.projectName] = matchReportItem;
- }
- }
- this.$nextTick(()=>{
- this.$refs.weekTable.doLayout();
- });
- },
- initWeekFormData() {
- this.weekDataLoading = true;
- for (var p in this.fillProjectList) {
- this.fillProjectList[p].canCancel = 1;
- }
- var param = {
- targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
- };
- if (this.isSubstitude) {
- //传代填人的userId
- param.targetUserId = this.workForm.userId[0];
- }
- this.http.post('/report/getWeeklyReportData',param,res => {
- this.weekDataLoading = false;
- if(res.code == 'ok'){
- let projectList = res.data.projectList;
- if (projectList.length > 0) {
- //有选择过项目进行填报,直接选中
- this.selProjectList = projectList;
- this.selCon = [];
- for (let i = 0; i < projectList.length; i++) {
- this.selCon.push(projectList[i].id);
- }
- }
- //设置日期
- this.weekDateRange = res.data.dateList;
- this.zhoData = [];
- var arrst = []
- for(var i in this.weekDateRange) {
- var obj = {}
- obj.zhoDataTime = this.weekDateRange[i].date
- obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
- obj.he = this.weekDateRange[i].filledTime;
- obj.canFill = this.weekDateRange[i].canFill;
- // obj.filledTime = this.weekDateRange[i].filledTime;
- obj.reportList = this.weekDateRange[i].reportList;
- //初始化,防止渲染报错
- for (var j = 0; j < this.selProjectList.length; j++) {
- var pName = this.selProjectList[j].projectName
- obj[pName] = {}
- obj[pName].time = ''
- obj[pName].content = ''
- obj[pName].progress = 0
- obj[pName].workingTime = 0
- }
- arrst.push(obj)
- }
- this.zhoData = arrst
- this.setWeekCardTimeData(res.data.cardTimeList);
- this.loadFilledWeekReportItem();
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- zhoZhi(res, i) {
- var zhi = 0
- for(var i in res) {
- if(i != 'zhoDataTime' && i != 'he') {
- zhi += +res[i]
- }
- }
- res.he = zhi
- },
- zhoBtn(i) {
- // this.zhoData.split(i, 1)
- var arr = this.zhoData
- arr.splice(i, 1)
- },
- zhoAddlast(){
- this.selConShow = true
- },
- closeAddWeeklyReport(){
- this.fillWeekDialogVisi = false
- this.selConShow = true
- this.selProjectList = []
- this.selCon = []
- },
- checkDateWorkTime() {
- //针对苏州景昱,单独的检查逻辑
- if (this.user.companyId == 5978) {
- //调接口,先检查工时是否存在异常
- var zhi = this.zhoData;
- var array = [];
- for(let n in zhi){
- if(zhi[n].he){
- var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
- array.push(workData)
- }
- }
- this.submitingReport = true;
- this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
- res => {
- this.submitingReport = false;
- if (res.code == "ok") {
- this.submitWeekReport(0)
- } else {
- this.$confirm(res.msg, this.$t('other.prompts'), {
- confirmButtonText: this.$t('huLveBingTiJiao'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'error'
- }).then(() => {
- this.submitWeekReport(0)
- }).catch(() => {
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- // 提交按周填报
- submitWeekReport(isDraft) {
- var zhi = this.zhoData
- var ll = 0
- const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
- if(this.reportTimeType.type == 2) {
- for(var i in zhi) {
- this.dateAr = []
- var alp = []
- var zhis = zhi[i]
- for(var j in zhis) {
- if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
- let objs = {}
- objs.s = zhis[j].time[0]
- objs.e = zhis[j].time[1]
- objs.p = j
- alp.push(objs)
- }
- }
- this.dateAr = alp
- if (this.reportTimeType.timeCanOverlap == 0) {
- let str = this.$t('message.Filledtimeperiodsoverlap')
- if(this.dateAr.length > 0) {
- const trus = this.fns();
- const overlapDataTime = this.getOverlapData(alp);
- if (overlapDataTime.length > 0) {
- const arrList = overlapDataTime.map((item) => item.p);
- str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
- }
- ll += 1
- if(!trus) {
- this.$message({
- message: str,
- type: 'error'
- })
- return false
- }
- }
- } else {
- if(this.dateAr.length > 0) {
- ll +=1 ;
- }
- }
- }
- if(ll == 0) {
- this.$message({
- message: this.$t('message.Pleasefillinthetime'),
- type: 'error'
- })
- return false
- }
- } else if(this.reportTimeType.type == 1){
- for(var i in zhi) {
- var zhis = zhi[i]
- for(var j in zhis) {
- if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
- ll += 1
- }
- }
- }
- if(ll == 0) {
- this.$message({
- message: this.$t('message.Pleaseselectatime'),
- type: 'error'
- })
- return false
- }
- let overcorp = ''
- for(let n in zhi){
- if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
- overcorp += zhi[n].zhoDataTime + ','
- }
- }
- if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
- overcorp = overcorp.substring(0,overcorp.length - 1)
- this.$message({
- message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
- type: 'error'
- })
- return
- }
- }
- var submits = []
- let formData = new FormData();
- formData.append("draft", isDraft);
- if(this.reportTimeType.multiWorktime == 1){
- for (var i in this.zhoData) {
- var zhoD = this.zhoData[i]
- var flgs = false
- for(var j in zhoD) {
- if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- if (this.isSubstitude) {
- formData.append('targetUids',this.workForm.userId[0]);
- }
- for(var s in this.selProjectList) {
- if(j == this.selProjectList[s].projectName) {
- formData.append("projectId", this.selProjectList[s].id);
- break;
- }
- }
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- if(this.user.timeType.auditLevel > 0){
- audItem.auditorFirst = zhoD[j].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- audItem.auditorSec = zhoD[j].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- audItem.auditorThird = zhoD[j].auditorThird
- }
- if(zhoD[j].ccUserid){
- audItem.ccUserid = zhoD[j].ccUserid
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
- formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- formData.append("endTime", '');
- formData.append("startTime", '');
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- var lix = []
- var objjs = {}
- objjs.startTime = zhoD[j].time[0]
- objjs.endTime = zhoD[j].time[1]
- if (zhoD[j].content == null || zhoD[j].content == '') {
- zhoD[j].content == '-'
- }
- objjs.content = zhoD[j].content
- lix.push(objjs)
- var zhiZhi = JSON.stringify(lix)
- zhiZhi = zhiZhi.replace(/,/g,"@");
- formData.append("content", zhiZhi)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- if (zhoD[j].groupId) {
- formData.append("groupId",zhoD[j].groupId)
- } else {
- //解决后台groupId数组越界的问题
- formData.append("groupId",0)
- }
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive){
- if (this.user.timeType.customDegreeMultiple) {
- if (zhoD[j].multiDegrIdArray) {
- formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
- } else {
- formData.append('multiDegrId','[]')
- }
- } else {
- if (zhoD[j].degreeId) {
- formData.append('degreeId',zhoD[j].degreeId)
- } else {
- formData.append('degreeId','-1')
- }
- }
-
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- if(reportExtraField4Name || reportExtraField5Name) {
- formData.append('extraField4', zhoD[j].extraField4 || '')
- formData.append('extraField5', zhoD[j].extraField5 || '')
- }
- }
- }
- }
- } else {
- for (var i in this.zhoData) {
- var zhoD = this.zhoData[i]
- var flgs = false
- if(this.reportTimeType.type == 2) {
- for(var k in this.selProjectList) {
- var pItem = this.selProjectList[k];
- var pName = pItem.projectName;
- var j = pName;
- var pid = pItem.id;
- console.log('j==周报中的项目='+j);
- if(zhoD[j].time && zhoD[j].time != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
- if (this.isSubstitude) {
- formData.append('targetUids',this.workForm.userId[0]);
- }
- formData.append("projectId", pid);
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- if(this.user.timeType.auditLevel > 0){
- audItem.auditorFirst = zhoD[j].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- audItem.auditorSec = zhoD[j].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- audItem.auditorThird = zhoD[j].auditorThird
- }
- if(zhoD[j].ccUserid){
- audItem.ccUserid = zhoD[j].ccUserid
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
- formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- formData.append("endTime", zhoD[j].time[1]);
- formData.append("startTime", zhoD[j].time[0]);
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- if (zhoD[j].groupId) {
- formData.append("groupId",zhoD[j].groupId)
- } else {
- //解决后台groupId数组越界的问题
- formData.append("groupId",0)
- }
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- } else {
- //对齐数据
- formData.append("projectAuditorId",'-');
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive){
- if (this.user.timeType.customDegreeMultiple) {
- if (zhoD[j].multiDegrIdArray) {
- formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
- } else {
- formData.append("multiDegrId", "[]");
- }
- } else {
- if (zhoD[j].degreeId) {
- formData.append('degreeId',zhoD[j].degreeId)
- } else {
- formData.append("degreeId", "-1");
- }
- }
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- if(reportExtraField4Name || reportExtraField5Name) {
- formData.append('extraField4', zhoD[j].extraField4 || '')
- formData.append('extraField5', zhoD[j].extraField5 || '')
- }
- }
- }
- } else {
- for(var k in this.selProjectList) {
- var pItem = this.selProjectList[k];
- var pName = pItem.projectName;
- var j = pName;
- if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- console.log('进入了workFpppp==='+j);
- formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
- if (this.isSubstitude) {
- formData.append('targetUids',this.workForm.userId[0]);
- }
- formData.append("projectId", pItem.id);
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- if(this.user.timeType.auditLevel > 0){
- audItem.auditorFirst = zhoD[j].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- audItem.auditorSec = zhoD[j].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- audItem.auditorThird = zhoD[j].auditorThird
- }
- if(zhoD[j].ccUserid){
- audItem.ccUserid = zhoD[j].ccUserid
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
- // formData.append("subProjectId", zhoD[j].subProjectId);
- formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- if(this.reportTimeType.type == 1) {
- formData.append("workingTime", zhoD[j].workingTime);
- } else if(this.reportTimeType.type == 2) {
- formData.append("endTime", zhoD[j].time[1]);
- formData.append("startTime", zhoD[j].time[0]);
- } else if(this.reportTimeType.type == 3) {
- formData.append("progress", zhoD[j].progress);
- formData.append("workingTime", zhoD[j].workingTime);
- }
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- if (zhoD[j].groupId) {
- formData.append("groupId",zhoD[j].groupId)
- } else {
- //解决后台groupId数组越界的问题
- formData.append("groupId",0)
- }
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- } else {
- //对齐数据
- formData.append("projectAuditorId",'-')
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive){
- if (this.user.timeType.customDegreeMultiple) {
- if (zhoD[j].multiDegrIdArray) {
- formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
- } else {
- formData.append("multiDegrId", "[]");
- }
- } else {
- if (zhoD[j].degreeId) {
- formData.append('degreeId',zhoD[j].degreeId)
- } else {
- formData.append("degreeId", "-1");
- }
- }
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- if(reportExtraField4Name || reportExtraField5Name) {
- formData.append('extraField4', zhoD[j].extraField4 || '')
- formData.append('extraField5', zhoD[j].extraField5 || '')
- }
- }
- }
- }
- }
- }
- // 对于先分组负责人审核再项目经理审核的模式,分组要必选
- let { next, error } = this.handleGroupAuditorData(this.zhoData)
- if(!next) {
- this.$message({
- message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
- type: 'error'
- })
- return
- }
- // 自定义维度
- this.submitingReport = true;
- this.http.uploadFile( this.port.report.editPort, formData,
- res => {
- // this.listLoading = false;
- this.submitingReport = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.fillinsuccessfully'),
- type: "success"
- });
- this.fillWeekDialogVisi = false
- this.selConShow = true
- this.zhoData = []
- this.weekDateRange = ''
- this.getReportList();
- this.getDepartment();
- // 关闭弹窗 并 清空
- this.selProjectList = []
- this.selCon = []
- this.getRecentlyProject()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.submitingReport = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- handleGroupAuditorData(data) {
- const { reportAuditType } = this.user.timeType
- if(reportAuditType != 1 && reportAuditType != 2) {
- return {next: true}
- }
- let arrList = [];
- Object.entries(data).forEach(([key, obj]) => {
- Object.entries(obj).forEach(([projectName, projectData]) => {
- if (projectData.workingTime && !projectData.groupId) {
- arrList.push({
- projectName,
- date: obj.zhoDataTime,
- dateText: obj.zhoDataTimeTxt
- });
- }
- });
- });
-
- if(arrList.length > 0) {
- return {
- next: false,
- error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
- }
- } else {
- return {
- next: true,
- error: [],
- }
- }
- },
- ChangeHourMinutestr (str) {
- if (str !== "0" && str !== "" && str !== null) {
- return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
- (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
- } else {
- return "";
- }
- },
- // 得到两个日期中间的日期
- getdiffdate(stime,etime){
- //初始化日期列表,数组
- var diffdate = new Array();
- var i=0;
- //开始日期小于等于结束日期,并循环
- while(stime<=etime){
- diffdate[i] = stime;
-
- //获取开始日期时间戳
- var stime_ts = new Date(stime).getTime();
-
- //增加一天时间戳后的日期
- var next_date = stime_ts + (24*60*60*1000);
-
- //拼接年月日,这里的月份会返回(0-11),所以要+1
- var next_dates_y = new Date(next_date).getFullYear()+'-';
- var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
- var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
-
- stime = next_dates_y+next_dates_m+next_dates_d;
-
- //增加数组key
- i++;
- }
- return diffdate;
- },
- // 添加模块
- addDomain(i) {
- var leftProgress = 10;
- if (this.reportTimeType.type == 3) {
- //计算已经待分配工时比例
- let array = this.workForm.domains;
- let totalProgress = 0;
- for (var i=0;i<array.length; i++) {
- totalProgress += array[i].progress;
- }
- if (totalProgress < 100) {
- leftProgress = 100 - totalProgress;
- }
- }
- var addItem = {
- projectId: "",
- workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
- this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
- ),
- content: "",
- progress:leftProgress,
- state:2,//2-表示待提交
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- auditorFirst: '',
- auditorSec: '',
- auditorThird: '',
- ccUserid: ''
- // degreeId: '',
- };
- if(this.isWeekend && this.user.timeType.lockWorktime != 1){
- this.$set(addItem,'isOvertime',true)
- if(this.reportTimeType.type == 3){
- this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
- }
- }
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认给第一个,必填字段
- addItem.basecostId = this.timeBasecostList[0].id;
- }
- this.workForm.domains.push(addItem);
- document.getElementById('workFormsItemBottom').scrollIntoView()
- this.canEdit = true
- if (this.reportTimeType.type == 0) {
- //全天上下午模式下,检测时间段数量,达到2个,不能再加了
- var length = this.workForm.domains.length;
- if (length == 2) {
- this.showAddMore = false;
- }
- }
- this.chuji()
-
- this.seleChn()
- },
- // 移除模块
- delDomain(i) {
- this.workForm.domains.splice(i,1)
- //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
- if (!this.originCanEdit) {
- let iscan = false
- for(let i in this.workForm.domains){
- if(this.workForm.domains[i].canEdit){
- iscan = true
- }
- }
- this.canEdit = iscan
- }
-
- //检测当前剩下的一个,时间类型是否是全天
- if (this.reportTimeType.type == 0) {
- if (this.workForm.domains[0].timeType == 0) {
- this.showAddMore = false;
- } else {
- this.showAddMore = true;
- }
- }
-
- if(this.user.timeType.multiWorktime == 1) {
- this.iptChangs()
- } else {
- this.seleChn(0)
- }
- },
- // 改变月份
- changeMonth() {
- this.isWeekend = false
- let date = new Date()
- let nowmon = date.getMonth() + 1
- let nowday = date.getDate()
- let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
- if (this.isBatch == 0) {
- if(this.user.timeType.fillAhead == 0){
- let date_a = new Date(this.workForm.createDate)
- if(date_a.getTime() > date.getTime()){
- this.workForm.createDate = nowdate
- }
- }
- //只有按天填报才能获取当天的日报
- if(!this.isSubstitude){
- let weekday = new Date(this.workForm.createDate).getDay()
- if(this.user.companyId == 817){
- if(weekday == 0){
- this.isWeekend = true
- }
- }else{
- if(weekday == 0 || weekday == 6){
- this.isWeekend = true
- }
- }
- this.getReport()
- } else {
- //获取代填人员的考勤
- if (this.user.timeType.showCorpwxCardtime == 1) {
- this.getTargetUserCardTime();
- }
- }
- }else {
- if(this.user.timeType.fillAhead == 0){
- let date_a = new Date(this.workForm.createDate[1])
- if(date_a.getTime() > date.getTime()){
- this.workForm.createDate[1] = nowdate
- let sdate = new Date(this.workForm.createDate[0])
- let edate = new Date(this.workForm.createDate[1])
- if(sdate > edate){
- this.workForm.createDate[0] = this.workForm.createDate[1]
- }
- }
- }
- }
- },
- // 判断时间段
- fns() {
- for (let k in this.dateAr) {
- if (!this.judege(k)) {
- return false
- }
- }
- return true
- },
- judege(idx){
- for (let k in this.dateAr) {
- if (idx !== k) {
- if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
- return false
- }
- if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
- return false
- }
- }
- }
- return true
- },
- getOverlapData(data) {
- let overlapData = [];
- for (let i = 0; i < data.length; i++) {
- for (let j = i + 1; j < data.length; j++) {
- if (data[i].s < data[j].e && data[j].s < data[i].e) {
- overlapData.push(data[i], data[j]);
- }
- }
- }
- return overlapData;
- },
- // 保存日报111111
- submitReport(isDraft) {
- this.isDraft = isDraft;
- this.$refs.workForm.validate(valid => {
- if (valid) {
- if (!isDraft) {
- //针对苏州景昱,单独的检查逻辑
- if (this.user.companyId == 5978) {
- //调接口,先检查工时是否存在异常
- var totalTime = 0;
- for (var t=0;t<this.workForm.domains.length; t++) {
- totalTime += parseFloat(this.workForm.domains[t].workingTime);
- }
- var array = [];
- if (this.isBatch) {
- var startDate = new Date(this.workForm.createDate[0]);
- var endDate = new Date(this.workForm.createDate[1]);
- if (startDate > endDate) {
- this.$message({
- message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
- type: "error"
- });
- return
- } else {
- while(true){
- var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
- array.push(workData);
- startDate.setDate(startDate.getDate() + 1);
- if (startDate > endDate) {
- break;
- }
- }
- }
- } else {
- var workData = {date: this.workForm.createDate, workingTime: totalTime};
- array.push(workData)
- }
- this.submitingReport = true;
- var passUserId = this.user.id;
- if (this.isSubstitude) {
- passUserId = this.targetUids;
- }
- this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
- res => {
- this.submitingReport = false;
- if (res.code == "ok") {
- this.submitReportSon()
- } else {
- this.$confirm(res.msg, this.$t('other.prompts'), {
- confirmButtonText: this.$t('huLveBingTiJiao'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'error'
- }).then(() => {
- this.submitReportSon()
- }).catch(() => {
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- } else if (this.user.companyId == 469) {
- //试点,针对赛元微电子校验考勤工时
- if (this.workForm.time && this.workForm.time.workHours) {
- if (this.totalReportHours > this.workForm.time.workHours) {
- this.$message({
- message: '填报工时不得超过考勤时长',
- type: "error"
- });
- } else if (this.totalReportHours < this.workForm.time.workHours) {
- this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'warning'
- }).then(() => {
- this.submitReportSon()
- }).catch(() => {
- });
- } else {
- this.submitReportSon();
- }
- } else {
- this.$message({
- message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
- type: "error"
- });
- }
- } else {
- if(this.totalReportHours < this.user.timeType.allday){
- this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: 'warning'
- }).then(() => {
- this.submitReportSon()
- }).catch(() => {
- });
- }else{
- this.submitReportSon()
- }
- }
- } else {
- //暂存,不需要检查工时是否超过考勤
- this.submitReportSon()
- }
- }
- });
- },
- submitReportSon() {
- this.dateAr = []
- //检查重叠
- if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
- let alp = []
- if(this.user.timeType.multiWorktime != 1) {
- for(var p in this.workForm.domains) {
- if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
- let objs = {}
- objs.s = this.workForm.domains[p].startTime
- objs.e = this.workForm.domains[p].endTime
- alp.push(objs)
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- if(!trus) {
- this.$message({
- message: this.$t('message.Filledtimeperiodsoverlap'),
- type: "error"
- });
- return
- }
- }
- } else {
- for(var p in this.workForm.domains) {
- var slll = this.workForm.domains[p]
- for(var o in slll.worktimeList) {
- if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
- let objs = {}
- objs.s = slll.worktimeList[o].startTime
- objs.e = slll.worktimeList[o].endTime
- alp.push(objs)
- }
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- if(!trus) {
- this.$message({
- message: this.$t('message.Filledtimeperiodsoverlap'),
- type: "error"
- });
- return
- }
- }
- }
- }
-
- //检查子项目
- if (this.user.timeType.subProMustFill == 1) {
- for(var p in this.workForm.domains) {
- var oneProItem = this.workForm.domains[p]
- if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
- //没有选择子项目
- this.$message({
- message: this.$t('ziXiangMuBiTianQingJianCha'),
- type: "error"
- });
- return
- }
- }
- }
- //昱众需要检查新增的角色,工作职责,工作内容是否填写
- if (this.user.companyId == this.yuzhongCompId) {
- for(var p in this.workForm.domains) {
- var oneProItem = this.workForm.domains[p]
- if (!oneProItem.extraField1) {
- this.$message({
- message: this.$t('jiaoSeBiTianQingJianCha'),
- type: "error"
- });
- return
- }
- if (!oneProItem.extraField2) {
- this.$message({
- message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
- type: "error"
- });
- return
- }
- if (!oneProItem.extraField3) {
- this.$message({
- message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
- type: "error"
- });
- return
- }
- }
- }
- // return
- //代填的情况,检查人员是否已经选择
- if (this.isSubstitude) {
- if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
- this.$message({
- message: this.$t('message.pleaseselectthepersontofillin'),
- type: "error"
- });
- return;
- }
- }
-
- //检查时间,全天和上下午不能同时存在
- if (this.reportTimeType.type == 0) {
- var alldayNum = 0;
- var amNum = 0;
- var pmNum = 0;
- for(var i in this.workForm.domains) {
- if (this.workForm.domains[i].timeType == 0) {
- alldayNum ++;
- } else if (this.workForm.domains[i].timeType == 1) {
- amNum++;
- } else if (this.workForm.domains[i].timeType == 2) {
- pmNum++;
- }
- }
- if (alldayNum > 1) {
- this.$message({
- // message: "工作时间-全天,只能选择一次",
- message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
- type: "error"
- });
- return;
- }
- if (amNum > 1) {
- this.$message({
- message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
- type: "error"
- });
- return;
- }
- if (pmNum > 1) {
- this.$message({
- message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
- type: "error"
- });
- return;
- }
- if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
- this.$message({
- message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
- type: "error"
- });
- return;
- }
- } else if (this.reportTimeType.type == 3) {
- //总百分比不能超过100%
- let total = 0;
- this.workForm.domains.forEach(w=>{total += w.progress});
- if (total > 100) {
- this.$message({
- message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
- type: "error"
- });
- return;
- } else if (total < 100) {
- this.$message({
- message: this.$t('message.cannotbesubmitted'),
- type: "error"
- });
- return;
- }
- }
-
- this.listLoading = true;
- let formData = new FormData();
- formData.append("draft", this.isDraft);
- var totalTime = 0;
- for (var t=0;t<this.workForm.domains.length; t++) {
- totalTime += parseFloat(this.workForm.domains[t].workingTime);
- }
- //批量填报不校验考勤时长,交给后台校验
- if (!this.isBatch) {
- if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
- if (this.workForm.time){
- if (this.workForm.time.workHours == 0){
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }else{
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }
- }
- //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
- if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
- if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
- this.$message({
- message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
- type: "error"
- });
- return;
- }
- }
- for(var i in this.workForm.domains) {
- // 检查任务/里程碑是否为必填
- let taskRequired = this.user.timeType.taskRequired
- if(taskRequired == 1) {
- if(!this.workForm.domains[i].taskId) {
- this.$message({
- message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
- type: "error"
- });
- return
- }
- }
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- let auditRule = ''
- if(this.workForm.domains[i].id){
- audItem.reportId = this.workForm.domains[i].id
- }
- if(this.user.timeType.auditLevel > 0){
- if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
- audItem.auditorFirst = this.workForm.domains[i].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
- audItem.auditorSec = this.workForm.domains[i].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
- audItem.auditorThird = this.workForm.domains[i].auditorThird
- }
- if(this.workForm.domains[i].ccUserid){
- audItem.ccUserid = this.workForm.domains[i].ccUserid
- }
- if(auditRule){
- auditRule = auditRule.substring(0,auditRule.length - 1)
- this.$message({
- message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
- type: 'error'
- })
- return
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- if (this.user.timeType.customDegreeActive) {
- if (this.user.timeType.customDegreeMultiple) {
- //多选
- if (this.workForm.domains[i].multiDegrIdArray) {
- var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
- degreeArray = degreeArray.replace(/,/g,"@");
- formData.append("multiDegrId", degreeArray);
- } else {
- formData.append("multiDegrId", '[]');
- }
- } else {
- //单选
- if (this.workForm.domains[i].degreeId) {
- formData.append("degreeId", this.workForm.domains[i].degreeId);
- } else {
- formData.append("degreeId", -1);
- }
- }
- } else {
- formData.append("degreeId", -1);
- }
- if(this.workForm.domains[i].customData) {
- // var sss = this.workForm.domains[i].degreeId.toString()
- formData.append("customData", this.workForm.domains[i].customData);
- } else {
- formData.append("customData", 0);
- }
- if(this.workForm.domains[i].customText) {
- formData.append("customText", this.workForm.domains[i].customText);
- } else {
- formData.append("customText", '-');
- }
- if (this.workForm.domains[i].id) {
- formData.append("id", this.workForm.domains[i].id);
- } else {
- formData.append("id", -1);
- }
- formData.append("projectId", this.workForm.domains[i].projectId);
- if (this.workForm.domains[i].subProjectId) {
- formData.append("subProjectId", this.workForm.domains[i].subProjectId);
- } else {
- formData.append("subProjectId", 0);
- }
- if (this.workForm.domains[i].groupId) {
- formData.append("groupId", this.workForm.domains[i].groupId);
- } else {
- formData.append("groupId", 0);
- }
- if (this.workForm.domains[i].taskId) {
- formData.append("taskId", this.workForm.domains[i].taskId);
- } else {
- formData.append("taskId", 0);
- }
- if (this.workForm.domains[i].taskFinish == true) {
- formData.append("taskFinish", 1);
- } else {
- formData.append("taskFinish", 0);
- }
-
- formData.append("reportTimeType", this.reportTimeType.type);
- if (this.reportTimeType.type == 0) {
- formData.append("timeType", this.workForm.domains[i].timeType);
- var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
- formData.append("workingTime", workingTime);
- } else if (this.reportTimeType.type == 1){
- formData.append("workingTime", this.workForm.domains[i].workingTime);
- } else if (this.reportTimeType.type == 2) {
- formData.append("endTime", this.workForm.domains[i].endTime);
- formData.append("startTime", this.workForm.domains[i].startTime);
- } else if (this.reportTimeType.type == 3) {
- //按比例分配
- formData.append("progress", this.workForm.domains[i].progress);
- formData.append("workingTime", this.workForm.domains[i].workingTime);
- }
-
- if(this.user.timeType.choseFromAlbum == 1 ) {
- console.log(this.workForm.domains[i].imgList)
- if(this.workForm.domains[i].imgList) {
- let imgListFor = this.workForm.domains[i].imgList
- for(var b in imgListFor) {
- imgListFor[b] = imgListFor[b].replace('/upload/', '')
- }
- console.log(imgListFor)
- let m = JSON.stringify(imgListFor);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("picStr", m);
- } else {
- formData.append("picStr", '[]');
- }
- }
-
-
- //处理多个时间事项
- formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
- if (this.reportTimeType.multiWorktime == 1) {
- //检查时间是否有重叠
- var workList = this.workForm.domains[i].worktimeList;
- for (var j=0;j<workList.length; j++) {
- var curItem = workList[j];
- //检查开始时间是否大于结束时间
- if (curItem.startTime >= curItem.endTime) {
- this.$message({
- message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
- this.$t('message.Endtimemustbegreaterthanstarttime'),
- type: "error"
- });
- return;
- }
- //时间不可重叠
- if (this.reportTimeType.timeCanOverlap == 0) {
- for (var p = j+1;p<workList.length; p++) {
- var jItem = workList[p];
- if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
- || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
- this.$message({
- message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
- jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
- type: "error"
- });
- return;
- }
- }
- }
- }
- let m = JSON.stringify(this.workForm.domains[i].worktimeList);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("content", m);
- } else {
- if (this.workForm.domains[i].content) {
- let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
- m = m.replace(/,/g,",");
- console.log(m, '需要传值的数据')
- // formData.append("content", this.workForm.domains[i].content);
- formData.append("content", m);
- } else {
- formData.append("content", '-');
- }
- }
-
- if (this.isBatch == 0) {
- formData.append("createDate", this.workForm.createDate);
- } else {
- //批量填报,时间范围
- formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
- }
-
- if(this.workForm.domains[i].isOvertime) {
- formData.append("isOvertime", 1);
- } else {
- formData.append("isOvertime", 0);
- }
- if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
- formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
- } else {
- formData.append("overtimeHours", 0);
- }
- if(this.workForm.domains[i].basecostId) {
- formData.append("basecostId", this.workForm.domains[i].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if (this.workForm.userId != null) {
- var targetUids = '';
- this.workForm.userId.forEach(u=>{
- targetUids += u + '@';
- });
- if (targetUids.length > 0) {
- targetUids = targetUids.substring(0, targetUids.length -1);
- formData.append("targetUids", targetUids);
- }
- }
- //项目专业进度
- if (this.workForm.domains[i].professionProgress) {
- var m = JSON.stringify(this.workForm.domains[i].professionProgress);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("professionProgress", m);
- } else {
- formData.append("professionProgress", "[]");
- }
- if (this.workForm.domains[i].stage) {
- formData.append("stage", this.workForm.domains[i].stage);
- } else {
- formData.append("stage", "-");
- }
- if (this.workForm.domains[i].projectAuditorId) {
- formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
- } else {
- if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
- this.$message({
- message: this.$t('message.Pleasespecifyaprojectreviewer'),
- type: "error"
- });
- return;
- } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
- //分组负责人先审核, 确定是选择了任务分组
- if (this.workForm.domains[i].taskGroups.length == 0) {
- this.$message({
- message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
- type: "error"
- });
- return;
- } else if (!this.workForm.domains[i].groupId) {
- // console.log(this.workForm.domains[i]);
- this.$message({
- message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
- type: "error"
- });
- return;
- }
- }
- }
- if (this.user.companyId == this.yuzhongCompId) {
- formData.append('extraField1', this.workForm.domains[i].extraField1);
- formData.append('extraField2', this.workForm.domains[i].extraField2);
- formData.append('extraField3', this.workForm.domains[i].extraField3);
- }
- //依斯贝的服务Id
- if (this.user.companyId == this.yisibeiCompId) {
- formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
- }
- if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
- this.$message({
- message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
- type: "error"
- });
- return
- }
- if(this.user.timeType.userWithMultiDept == 1) {
- formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
- }
- if(this.user.timeType.reportExtraField4Name) {
- formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
- }
- if(this.user.timeType.reportExtraField5Name) {
- formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
- }
- }
- this.submitingReport = true;
- this.http.uploadFile( this.port.report.editPort, formData,
- res => {
- this.listLoading = false;
- this.submitingReport = false;
- if (res.code == "ok") {
- if(res.msg!=null){
- this.$message({
- dangerouslyUseHTMLString: true,
- message: res.msg,
- type: "warning",
- showClose: true,
- duration: 0
- });
- }else{
- this.$message({
- message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
- type: "success"
- });
- }
- this.dialogVisible = false;
- this.jsDay = 0
- this.jsTime = 0
- this.getReportList();
- this.getDepartment();
- this.getRecentlyProject()
- } else {
- this.$message({
- message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.submitingReport = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 判断是展示那个工时导入
- imports() {
- if(this.user.timeType.syncCorpwxTime == 0) {
- this.importDialog = true
- } else {
- this.importWxDialog = true
- }
- },
- // 跳转
- junpToDeskTop(id) {
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.$router.push("/desktop/" + id + "/" + this.date +day);
- },
- // 通过日报
- approve(id, item) {
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.approveinData = {
- id: id,
- date: this.date +day,
- reportIds: item.id
- }
- if(this.user.timeType.needEvaluate == 1){
- this.$set(this.approveinData,'evaluate','')
- this.approveinDialog = true
- }else{
- this.logining = true;
- this.approveinfun()
- }
-
- },
- approveinfun(){
- this.http.post( this.port.report.approve, this.approveinData,
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.approveinDialog = false
- this.$message({
- message: this.$t('message.Reviewsucceeded'),
- type: "success"
- });
- this.refreshReportData(this.approveinData.reportIds);
- this.getDepartment();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //撤回日报
- cancel(item,e) {
- // console.log('can can need',item);
- this.logining = true;
-
- var ids = '';
- var data = e ? item : item.data;
- data.forEach(element => {
- if(element.id){
- ids +=(element.id+',');
- }
- });
- this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message:this.$t('message.Withdrawalsucceeded'),
- type: "success"
- });
- this.getReportList();
- if(e){this.getReport()}
- this.getDepartment();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- showDenyDialog(id,i, item) {
- this.denyReasonDialog = true;
- this.isDenying = false;
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var ids = item.id;
- this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
- },
- // 未通过日报
- deny() {
- this.logining = true;
- this.isDenying = true;
- this.http.post( this.port.report.deny, this.denyForm,
- res => {
- this.logining = false;
- this.isDenying = false;
- if (res.code == "ok") {
- this.$message({
- message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
- type: "success"
- });
- this.refreshReportData(this.denyForm.reportIds);
- this.getDepartment();
- this.denyReasonDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 查看工时记录弹窗
- toView() {
- this.toViewDialogVisible = true
- this.toViewloading = true
- this.getToView()
- },
- getToView() {
- this.http.post( '/report-import-log/getList', this.toViewForm,
- res => {
- this.toViewloading = false;
- if (res.code == "ok") {
- // console.log(res.data, '数据数据')
- this.toViewList = res.data.records
- this.toViewForm.total = res.data.total
- } else {
- this.toViewloading = false;
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- })
- },
- // 触发 selectCat 组件更改他的值
- selectCatCli(obj) {
- // console.log(obj, '看看')
- // obj.id 是 选中人员的id, obj.idx 是 当前的索引
- this.workForm.domains[obj.idx].projectAuditorId = obj.id
- },
- vueCasader(obj) {
- if(obj.distinction == 1 && obj.item) {
- let arr = []
- arr.push(obj.item.value)
- this.exportParam.departmentId = arr
- }
- if(obj.distinction == '10' && obj) {
- const { id, other } = obj
- this.workForm.domains[other].reportTargetDeptId = id
- }
- if(obj.distinction == '14' && obj) {
- let arr = []
- arr.push(obj.id)
- this.deptIdForHasReport = arr
- this.showMonthWorkTime()
- }
- if(obj.distinction == '15' && obj) {
- let arr = []
- arr.push(obj.id)
- this.deptIdForNoReport = arr
- this.showMonthNotWorkTime()
- }
- if(obj.distinction == '16' && obj) {
- let arr = []
- arr.push(obj.id)
- this.deptIdForReminder = arr
- this.showMonthWorkTimeReminder()
- }
- if(obj.distinction == '17' && obj) {
- let arr = []
- arr.push(obj.id)
- this.deptIdForHasReport = arr
- this.showReportTimeLessThanCardTimeList();
- }
- },
- //分页
- handleCurrentChange(val) {
- this.toViewForm.pageIndex = val;
- this.getToView();
- },
- handleSizeChange(val) {
- this.toViewForm.pageSize = val;
- this.getToView();
- },
- getAllUsersList(){
- this.http.post('/user/getSimpleActiveUserList',{
- },res => {
- if(res.code == 'ok'){
- this.allUsersList = res.data
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- //景昱变更提醒
- changeReminder(item){
- let parameter={
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- }
- if(item){
- parameter.createDate=item.createDate,
- parameter.userId=item.userId
- }
- this.remindering = true;
- this.http.post('/report/changeReminder',parameter,res => {
- this.remindering = false;
- if(res.code == 'ok'){
- this.$message({
- message: res.msg,
- type: 'success'
- })
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- //景昱取消异常
- cancelReminder(item){
- let parameter={}
- if(item){
- parameter.createDate=item.createDate,
- parameter.userId=item.userId
- }
- this.http.post('/report/cancelReminder',parameter,res => {
- if(res.code == 'ok'){
- this.$message({
- message: res.msg,
- type: 'success'
- })
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- this.showMonthWorkTimeReminder()
- },
- // 重庆物奇私人定制的按周填报弹窗关闭事件
- fillWeekCustomClne() {
- this.fillWeekDialogVisiCustom = false
- },
- fillWeekCustomClneTwo() {
- this.fillWeekDialogVisiCustomTwo = false
- },
- fillWeekCustomSubmit() {
- this.getReportList();
- this.getDepartment();
- this.getRecentlyProject()
- },
- // 待填日报姓名搜索
- nameAearchSeek(flg) {
- if(!this.nameAearch) {
- this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
- return
- }
- if(flg) {
- this.enterpriseWechatgetUser()
- }
- },
- handleThreeData(userList) {
- let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
- this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
- },
- // 过滤树节点
- filterTreeNodes(treeData, filterKeywords) {
- return treeData.filter((node) => {
- if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
- if (node.children && node.children.length > 0) {
- node.children = this.filterTreeNodes(node.children, filterKeywords);
- }
- return true;
- }
- if (node.children && node.children.length > 0) {
- node.children = this.filterTreeNodes(node.children, filterKeywords);
- return node.children.length > 0;
- }
- return false;
- });
- },
- // 企业微信获取人员
- enterpriseWechatgetUser() {
- this.deptMembDataLoading = true
- this.http.post('/user/getEmployeeList',{
- departmentId: -1,
- pageIndex: 1,
- pageSize: 100,
- keyword: this.nameAearch,
- status: '',
- roleId: '',
- cursor: '',
- onlyDirect: '',
- matchingType: ''
- },res => {
- if(res.code == 'ok'){
- this.deptMembDataLoading = false
- const userListName = res.data.records.map(item => item.name)
- this.handleThreeData(userListName)
- setTimeout(() => {
- this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
- }, 200)
- }else{
- this.deptMembDataLoading = false
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.deptMembDataLoading = false
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- changeTreeNodeStatus(node) {
- let allZt = true
- node.expanded = allZt
- for (let i = 0; i < node.childNodes.length; i++) {
- node.childNodes[i].expanded = allZt
- if (node.childNodes[i].childNodes.length > 0) {
- this.changeTreeNodeStatus(node.childNodes[i])
- }
- }
- },
- // 按周填报获取相关任务
- async getWeeklyTaskList(item) {
- const { projectId, groupId, stage, taskId } = item
- let parms = { projectId, isSubstitude: 0 }
- groupId ? parms.groupId = groupId : ''
- stage ? parms.stage = stage : ''
- const { data } = await this.postData('/task/getRecentTask', parms)
- this.zhoBao.taskId = taskId
- this.$set(this.zhoBao, 'taskList', data)
- },
- // 封装 post 请求
- postData(url, params) {
- return new Promise((resolve, reject) => {
- this.http.post(url, { ...params },
- res => {
- resolve(res)
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- reject(error)
- })
- })
- },
- // 自定义事件
- selectCal(obj) {
- if(obj.distinction == '1') {
- this.zhoBao.projectAuditorId = obj.id
- } else if(obj.distinction == '2') {
- this.zhoBao.auditorFirst = obj.id
- } else if(obj.distinction == '3') {
- this.zhoBao.auditorSec = obj.id
- } else if(obj.distinction == '4') {
- this.zhoBao.auditorThird = obj.id
- } else if(obj.distinction == '5') {
- this.zhoBao.ccUserid = obj.id
- } else if(obj.distinction == '12') {
- this.usersListId = obj.id
- if(obj.name != this.$t('defaultText.pleaseChoose')) {
- this.searchKeyword = obj.name
- } else {
- this.searchKeyword = ''
- }
- this.searchScreen(0)
- } else if(obj.distinction == '13') {
- this.usersListId = obj.id
- if(obj.name != this.$t('defaultText.pleaseChoose')) {
- this.searchKeyword = obj.name
- } else {
- this.searchKeyword = ''
- }
- this.searchScreen(1)
- } else if(obj.distinction == '15') {
- this.usersListId = obj.id
- this.showReportTimeLessThanCardTimeList();
- }
- }
- },
- created() {
- this.getUsers()
- let height = window.innerHeight;
- this.tableHeight = height - 178;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 178;
- };
- this.toViewForm.companyId = this.user.companyId
- this.initDrag([{
- type: "LR",
- domClass: {
- // 中间分割线的名字
- resize: "line-line",
- // 左侧盒子的名字
- left: "box-left",
- // 右侧盒子的名字
- right: "box-right",
- // 父级的名字
- box: "box-father",
- },
- otherInfo: {
- // 限制左边栏最低宽度
- leftWidth: 120,
- },
- },
- {
- type: "LR",
- domClass: {
- // 中间分割线的名字
- resize: "line-second",
- // 左侧盒子的名字
- left: "left-laowang",
- // 右侧盒子的名字
- right: "box-second-father",
- // 父级的名字
- box: "grand",
- },
- otherInfo: {
- // 限制左边栏最低宽度
- leftWidth: 120,
- },
- },
- ]);
- }
- };
- </script>
- <style lang="scss" scoped>
- @import "../../assets/scss/handle";
- .themeFontColor {
- @include font_color("color");
- }
- .fillWeekDialogVisiCustom {
- width: 100%;
- height: 70vh;
- }
- .fillWeekCustom {
- .el-dialog__body {
- padding: 20px 20px !important;
- }
- }
- .photos {
- position: relative;
- display: flex;
- flex-wrap: wrap;
- }
- .photos_img {
- width: 120px;
- height: 120px;
- margin-right: 20px;
- margin-bottom: 20px;
- cursor: pointer;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .paginatis {
- padding: 10px 10px;
- background: #f2f2f2;
- }
- .waiting {
- color:orange;
- }
- .filledReportStyle {
- color:#32CD32;
- }
- .RejectStyle {
- color:red;
- }
- .waitSubmitStyle{
- @include font_color("color");
- }
- .chooseDate {
- .waiting {
- @include font_color("color");
- }
- .filledReportStyle {
- @include font_color("color");
- }
- .RejectStyle {
- @include font_color("color");
- }
- .waitSubmitStyle{
- @include font_color("color");
- }
- }
- .allDaily {
- width:100%;
- }
- .report_title {
- padding:10px 0;
- color:#666;
- }
- .clearfix {
- overflow-x: auto;
- white-space: nowrap;
- padding: 15px 0 10px 0;
- // overflow-y: hidden;
- .date_item {
- padding: 0 3px;
- cursor: pointer;
- position: relative;
- }
- .chooseDate {
- position: absolute;
- bottom: -3px;
- width: 37px;
- height: 2px;
- left: 14px;
- @include background_color("background_color");
- }
- }
- .one_daily {
- i {
- @include font_color("color1");
- margin-right: 5px;
- }
- .one_daily_body {
- padding: 10px 0px;
- p {
- margin: 0;
- line-height: 30px;
- }
- }
- ul {
- padding: 0;
- }
- }
- .checkbtn {
- float: right;
- margin-top: -10px;
- }
- .selConStyle{
- margin-top:9rem;
- margin-bottom:11rem;
- .selConStyle_title{
- height: 3rem;
- text-align: center;
- font-size: 17px;
- }
- .el-select{
- margin: 0 15%;
- width: 70%;
- }
- }
- </style>
- <style lang="scss">
- /*去除upload组件过渡效果*/
- .photos .el-upload-list__item {
- transition: none !important;
- }
- .daily {
- .el-card__body {
- height: 80%;
- overflow-y: auto;
- }
- .el-card__header {
- padding: 0 20px;
- }
- }
- .membListClass{
- .el-dialog__body{
- padding-top: 10px;
- }
- }
- // .editReportDialog .el-dialog__footer{
- // position: sticky;
- // bottom: 0;
- // background: #fff;
- // height: 70px;
- // z-index: 1010;
- // }
- .editReportDialog{
- min-width: 800px;
- }
- .touruxiangmu{
- max-width: 1000px;
- }
- </style>
- <style scoped>
- /* 项目标签的样式 */
- .el-tag + .el-tag {
- margin-left: 10px;
- }
- .button-new-tag {
- margin-left: 10px;
- height: 32px;
- line-height: 30px;
- padding-top: 0;
- padding-bottom: 0;
- }
- .input-new-tag {
- width: 90px;
- margin-left: 10px;
- vertical-align: bottom;
- }
- .selectworktime .el-table__fixed-body-wrapper{
- top: 48px !important;
- }
- .selectworktime_export .selectworktime_export_l{
- width: 650px;
- float: left;
- height: 42px;
- }
- .approvalProcessBox{
- margin-left: 30px;
- font-size: 14px;
- line-height: 16px;
- cursor: pointer;
- }
- .approvalProcessBox i {
- margin-right: 0;
- height: 16px;
- width: 16px;
- display: inline-block;
- transform: scale(1.2);
- position: relative;
- top: 0.5px;
- @include font_color("color");
- }
- .approvalProcessBox .approvalProcessClick{
- cursor: pointer;
- @include font_color("color");
- font-size: 14px;
- }
- .approvalProcessBox:hover .approvalProcessClick{
- color: #3485fb;
- }
- </style>
- <style lang="scss" scoped>
- .bionicClass {
- -webkit-appearance: none;
- background-color: #FFF;
- background-image: none;
- border-radius: 4px;
- border: 1px solid #DCDFE6;
- box-sizing: border-box;
- color: #606266;
- display: inline-block;
- height: 40px;
- line-height: 40px;
- outline: 0;
- padding: 0 15px;
- -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
- transition: border-color .2s cubic-bezier(.645,.045,.355,1);
- width: 350px;
- cursor: pointer;
- .bionicClassText {
- color: #C0C4CC;
- }
- }
- // 加班样式
- .overtime {
- display: inline-block;
- margin-left: 20px;
- input {
- display: inline-block;
- margin-top: 5px;
- }
- }
- .plus {
- display: inline-block;
- }
- // .tages {
- // float: right;
- // }
- .overtime {
- display: inline-block;
- margin-left: 30px;
- }
- .bloks {
- display: inline-block;
- width: 380px;
- }
- .zhiss {
- display: flex;
- justify-content: space-around;
- align-items: center;
- }
- .zhoFel {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- // 左右滑动样式
- .line {
- width: 30px;
- /* height: 500px; */
- background: #f2f2f2;
- cursor: w-resize;
- }
- .box-father {
- border: 8px solid #000;
- }
- .line-second {
- width: 10px;
- /* background: red; */
- }
- .flex {
- display: flex;
- width: 100%;
- }
- .box-left {
- flex: 0 0 400px;
- /* height: 600px; */
- /* background: blue; */
- }
- .box-right {
- /* height: 600px; */
- /* background: green; */
- flex: 1;
- }
- .box-postion {
- width: 200px;
- /* height: 400px; */
- background: #ccc;
- }
- .custom-tree-node {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 14px;
- padding-right: 8px;
- }
- .daitianrbao {
- width: 100%;
- box-sizing: border-box;
- height: 40px;
- border-radius: 4px;
- border: 1px solid #DCDFE6;
- overflow: hidden;
- text-overflow: ellipsis;
- display: flex;
- // align-items: center;
- }
- .daitianrbao .spnn {
- display: inline-block;
- box-sizing: border-box;
- padding: 0 15px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .daitianrbao .hover {
- color: #DCDFE6 !important;
- }
- </style>
|