daily.vue 337 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input placeholder="请输入姓名" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <el-tree :data="data" @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate">
  47. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  48. <!-- <span>{{ node.label }}</span> -->
  49. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  50. <span v-if="user.userNameNeedTranslate == '1'">
  51. <span v-if="node.data.children">
  52. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  53. </span>
  54. <span v-else>
  55. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  56. </span>
  57. </span>
  58. <span v-if="user.userNameNeedTranslate != '1'">
  59. {{ node.label }}
  60. </span>
  61. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  62. </span>
  63. <div style="position: absolute;right: 15px;">
  64. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  65. <!-- 未填报 -->
  66. {{$t('state.DidNotFillIn')}}
  67. </span>
  68. <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'">
  69. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  70. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  71. </span>
  72. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  73. <!-- 待审核 -->
  74. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  75. </span>
  76. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  77. <!-- 已通过 -->
  78. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  79. </span>
  80. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  81. <!-- 未通过 -->
  82. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  83. </span>
  84. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  85. <!-- 待提交 -->
  86. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  87. </span>
  88. </div>
  89. </span>
  90. </el-tree>
  91. </div>
  92. </div>
  93. </div>
  94. <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">
  95. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  96. -
  97. -
  98. -
  99. </div>
  100. </div>
  101. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  102. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  103. <div class="allDaily" style="float:left;flex-grow:1">
  104. <!--系统管理员和部门负责人 -->
  105. <div class="report_title" style="display:flex;justify-content: space-between;">
  106. <span>
  107. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  108. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  109. <!-- {{depData != null ?depData.label:""}} -->
  110. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  114. <span v-if="targetUid == null">
  115. <!-- - 已提交 -->
  116. -{{$t('state.hasBeenSubmitted')}}
  117. <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')}},
  118. <!-- 待提交 -->
  119. {{$t('state.waitingsubmit')}}
  120. <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')}},
  121. <!-- 漏填 -->
  122. {{$t('state.missFillReport')}}
  123. <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')}}
  124. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  125. </span>
  126. </span>
  127. </span>
  128. <span style="float:right;">
  129. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  130. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  131. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  132. <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  133. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. </span>
  138. </div>
  139. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  140. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  141. <i class="fa fa-circle"></i>
  142. <!-- {{item1.name}} -->
  143. <span v-if="user.userNameNeedTranslate == '1'">
  144. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  145. </span>
  146. <span v-if="user.userNameNeedTranslate != '1'">
  147. {{item1.name}}
  148. </span>
  149. <span style="margin-left:30px;">
  150. <span style="margin-right:20px;">
  151. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  152. <!-- 工作总时长: -->
  153. {{$t('other.totalWorkingHours')}}
  154. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  155. <span >{{item1.reportTime | amounts}}</span>h
  156. </span>
  157. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  158. <i class="iconfont firerock-iconliucheng1"></i>
  159. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  160. <!-- 审批流程 -->
  161. {{$t('other.approvalProcess')}}
  162. </span>
  163. </span>
  164. </span>
  165. <div class="checkbtn" style="padding-right:20px;">
  166. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  167. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  168. </div>
  169. <div class="one_daily_body">
  170. <el-timeline>
  171. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  172. <el-card shadow="never">
  173. <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>
  174. <span v-if="user.company.packageEngineering == 0">
  175. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  176. <span v-if="item2.isDeptAudit==0">
  177. <span v-if="item2.projectAuditState==0">
  178. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  179. <span v-if="item2.projectAuditorName != null">(
  180. <!-- {{item2.projectAuditorName}} -->
  181. <span v-if="user.userNameNeedTranslate == '1'">
  182. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  183. </span>
  184. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  185. )</span>
  186. <!-- 审核 --> {{$t('other.audit')}}
  187. </span>
  188. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  189. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  190. <span v-if="item2.projectAuditorName != null">(
  191. <!-- {{item2.projectAuditorName}} -->
  192. <span v-if="user.userNameNeedTranslate == '1'">
  193. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  194. </span>
  195. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  196. )</span>
  197. <!-- 审核通过 --> {{$t('state.approved')}}
  198. </span>
  199. </span>
  200. <span v-else-if="item2.isDeptAudit==1">
  201. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  202. ({{$t('other.await')}}
  203. <span v-if="user.userNameNeedTranslate == '1'">
  204. <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
  205. </span>
  206. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  207. {{$t('other.audit')}})
  208. </span>
  209. ]</span>
  210. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  211. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  212. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  213. </span>
  214. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  215. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  216. </span>
  217. <!-- <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> -->
  218. <span v-if="user.company.packageEngineering == 1">
  219. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  220. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  221. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  223. (
  224. <span v-if="user.userNameNeedTranslate != 1">
  225. {{item2.projectAuditorName}}
  226. </span>
  227. <span v-if="user.userNameNeedTranslate == 1">
  228. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  229. </span>
  230. )
  231. </span>{{$t('other.audit')}} ]</span>
  232. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  233. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  234. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  235. </span>
  236. <!--每个项目上单独审核 -->
  237. <span style="float:right;">
  238. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  239. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  240. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  241. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  242. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  243. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  244. <!--自己可以撤回待审核状态的报告 -->
  245. <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>
  246. </span>
  247. </p>
  248. <!--任务分组和阶段 -->
  249. <p v-if="item2.groupId != 0">{{$t('other.taskGroup')}}:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span></p>
  250. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  251. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  252. <!-- 自定义日报文本 -->
  253. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  254. <p v-if="user.company.packageEngineering == 1">
  255. {{$t('other.professionalProgress')}}:
  256. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  257. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  258. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  259. </el-tooltip>
  260. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  261. <i class="iconfont firerock-iconshenhetongguo"></i>
  262. </el-tooltip>
  263. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  264. <i class="iconfont firerock-iconshenhebohui"></i>
  265. </el-tooltip>
  266. </span>
  267. </p>
  268. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  269. </p>
  270. <div v-if="item2.multiWorktime==0">
  271. <p style="display: inline-block;">{{$t('time.duration')}}:
  272. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  273. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  274. {{item2.time.toFixed(1)}}h
  275. <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>
  276. </p>
  277. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  278. </div>
  279. <div v-if="item2.multiWorktime==1" >
  280. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  281. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  282. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  283. <p style="display: inline-block;">{{$t('time.duration')}}:
  284. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  285. {{timeItem.time.toFixed(1)}}h
  286. </p>
  287. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  288. </div>
  289. </div>
  290. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  291. <!--照片的显示 -->
  292. <p v-if="item2.pics != null && item2.pics.length > 0">
  293. <el-image v-for="(pic, index) in item2.pics" :key="index"
  294. style="width: 100px; height: 100px; margin-right:10px;"
  295. :src="pic"
  296. :preview-src-list="item2.pics">
  297. </el-image>
  298. </p>
  299. </el-card>
  300. </el-timeline-item>
  301. </el-timeline>
  302. </div>
  303. </div>
  304. <!-- 简陋的无报告提示 -->
  305. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. </div>
  311. </el-card>
  312. </div>
  313. <!-- 填写日报的dialog -->
  314. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" style="height:95%" :close-on-click-modal="false" @closed="guanbi()" custom-class="editReportDialog" ref="editReportDialog">
  315. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  316. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  317. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  318. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  319. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  320. <span class="spnn" v-if="workForm.userNames">
  321. <span v-for="(item, index) in workForm.userNames" :key="index">
  322. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  323. <span v-if="index < workForm.userNames.length - 1">,</span>
  324. </span>
  325. </span>
  326. <span class="spnn hover" v-else>
  327. {{$t('defaultText.pleaseSelectAsubstitute')}}
  328. </span>
  329. </div>
  330. </el-form-item>
  331. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  332. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  333. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  334. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  335. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  336. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{$t('other.fillInTheTotal')}} {{jsTime}} {{$t('time.hour')}}</div>
  337. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  338. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  339. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  340. <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
  341. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
  342. <span v-if="user.timeType.syncDingding==1&&!workForm.time">{{$t('other.noAttendanceRecord')}}</span>
  343. </el-form-item>
  344. <!-- 000000 -->
  345. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  346. <div v-if="reportTimeType.multiWorktime==0">
  347. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  348. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  349. <el-select v-model="domain.timeType" style="width:200px;"
  350. v-if="reportTimeType.type == 0"
  351. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  352. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  353. @change="onTimeTypeChange(domain.timeType)">
  354. <el-option
  355. v-for="item in timeType"
  356. :key="item.value"
  357. :label="item.label"
  358. :value="item.value">
  359. </el-option>
  360. </el-select>
  361. <!-- 数字时长选择 -->
  362. <el-select v-model="domain.workingTime" style="width:200px;"
  363. v-if="reportTimeType.type == 1"
  364. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  365. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  366. @change="seleChn(0,domain)">
  367. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  368. </el-select>
  369. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  370. <span v-if="reportTimeType.type == 2">
  371. <!--时间范围选择 -->
  372. <el-time-picker
  373. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  374. v-model="domain.startTime"
  375. :placeholder="$t('time.startTime')"
  376. style="width:120px;"
  377. format="HH:mm"
  378. value-format="HH:mm"
  379. :picker-options="{
  380. start: '08:00',
  381. end: '23:30'
  382. }"
  383. @change="iptChang()">
  384. </el-time-picker> - <el-time-picker
  385. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  386. v-model="domain.endTime"
  387. :placeholder="$t('time.endTime')"
  388. style="width:120px;"
  389. format="HH:mm"
  390. value-format="HH:mm"
  391. :picker-options="{
  392. start: '08:00',
  393. end: '23:30',
  394. minTime: domain.startTime
  395. }"
  396. @change="iptChang()">
  397. </el-time-picker>
  398. </span>
  399. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  400. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  401. <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>
  402. </div>
  403. </el-form-item>
  404. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  405. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  406. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  407. @change="selectProject(domain, index)"
  408. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  409. <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
  410. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  411. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  412. <span style="float: right;">{{ item.projectName }}</span>
  413. </el-option>
  414. </el-select>
  415. <template v-if="user.timeType.mainProjectState != 1">
  416. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  417. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  418. <!--子项目 -->
  419. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  420. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  421. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  422. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  423. </el-select>
  424. </template>
  425. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  426. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  427. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  428. </el-link>
  429. <!-- <el-link type="primary" v-if="canEdit"
  430. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  431. </el-form-item>
  432. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  433. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  434. </el-form-item>
  435. <!--如果设置了工时成本预警的预算成本项-->
  436. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  437. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  438. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  439. </el-select>
  440. </el-form-item>
  441. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  442. <!-- 任务分组 -->
  443. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  444. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  445. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  446. </el-select>
  447. <!-- 项目的阶段 -->
  448. <span v-if="domain.stages != null && domain.stages.length> 0"
  449. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  450. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  451. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  452. @change="changeStages(domain, index)"
  453. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  454. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  455. </el-select>
  456. </el-form-item>
  457. <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')" v-if="user.timeType.reportAuditType != 3">
  458. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  459. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  460. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  461. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  462. </el-option>
  463. </el-select>
  464. <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"></selectCat>
  465. </el-form-item>
  466. <!-- 111111 -->
  467. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  468. <el-select v-model="domain.auditorFirst" placeholder="第一审核人" :disabled="!domain.canEdit" style="width:200px;">
  469. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  470. </el-select>
  471. <template v-if="user.timeType.auditLevel > 1">
  472. <i class="el-icon-right"></i>
  473. <el-select v-model="domain.auditorSec" placeholder="第二审核人" :disabled="!domain.canEdit" style="width:200px;">
  474. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  475. </el-select>
  476. </template>
  477. <template v-if="user.timeType.auditLevel > 2">
  478. <i class="el-icon-right"></i>
  479. <el-select v-model="domain.auditorThird" placeholder="第三审核人" :disabled="!domain.canEdit" style="width:200px;">
  480. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  481. </el-select>
  482. </template>
  483. </el-form-item>
  484. <el-form-item label="抄送人" v-if="user.timeType.reportAuditType == 3">
  485. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  486. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </el-form-item>
  489. <!-- 相关维度/自定义维度 -->
  490. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  491. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;">
  492. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  493. </el-option>
  494. </el-select>
  495. </el-form-item>
  496. <!-- 相关数值 -->
  497. <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">
  498. <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>
  499. </el-form-item>
  500. <!-- 自定义文本 -->
  501. <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">
  502. <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>
  503. </el-form-item>
  504. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  505. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  506. <div style="width:300px;">
  507. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="5" :show-tooltip="false" :step="5" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  508. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}{{$t('time.hour')}}</span></el-col>
  509. </div>
  510. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  511. <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>
  512. </div>
  513. </el-form-item>
  514. <!--工程专业版本模式下, 各个专业的进度填报 -->
  515. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  516. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  517. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  518. <el-input size="mini" style="width:60px;" v-model="item.progress"
  519. @keyup.native="onProgressChange"
  520. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  521. </span>
  522. </el-form-item>
  523. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  524. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  525. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  526. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  527. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  528. </el-select>
  529. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  530. </el-form-item>
  531. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  532. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  533. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable
  534. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  535. </el-form-item>
  536. </div>
  537. <!--多个工作事项填报的情况 -->
  538. <div v-if="reportTimeType.multiWorktime==1">
  539. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  540. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  541. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  542. @change="selectProject(domain, index)"
  543. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  544. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  545. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  546. <span style="float: right;">{{ item.projectName }}</span>
  547. </el-option>
  548. </el-select>
  549. <template v-if="user.timeType.mainProjectState != 1">
  550. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  551. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  552. <!--子项目 -->
  553. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  554. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  555. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  556. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  557. </el-select>
  558. </template>
  559. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  560. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  561. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  562. </el-link>
  563. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  564. <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>
  565. </div>
  566. <!-- <el-link type="primary" v-if="canEdit"
  567. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  568. </el-form-item>
  569. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  570. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  571. </el-form-item>
  572. <!--如果设置了工时成本预警的预算成本项-->
  573. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  574. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  575. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  576. </el-select>
  577. </el-form-item>
  578. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  579. <!-- 任务分组 -->
  580. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  581. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  582. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  583. </el-select>
  584. <!-- 项目的阶段 -->
  585. <span v-if="domain.stages != null && domain.stages.length> 0"
  586. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  587. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  588. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  589. @change="changeStages(domain, index)"
  590. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  591. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  592. </el-select>
  593. </el-form-item>
  594. <el-form-item :label="$t('other.projectAuditor')" >
  595. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  596. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  597. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  598. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  599. </el-option>
  600. </el-select>
  601. <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>
  602. </el-form-item>
  603. <!--工程专业版本模式下, 各个专业的进度填报 -->
  604. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  605. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  606. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  607. <el-input size="mini" style="width:60px;" v-model="item.progress"
  608. @keyup.native="onProgressChange"
  609. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  610. </span>
  611. </el-form-item>
  612. <!-- 相关维度 -->
  613. <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'">
  614. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')">
  615. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  616. </el-option>
  617. </el-select>
  618. </el-form-item>
  619. <!-- 相关数值 -->
  620. <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">
  621. <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>
  622. </el-form-item>
  623. <!-- 自定义文本 -->
  624. <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">
  625. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  626. </el-form-item>
  627. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  628. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  629. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  630. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  631. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  632. </el-select>
  633. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  634. </el-form-item>
  635. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  636. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  637. <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>
  638. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  639. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  640. <span v-if="reportTimeType.type == 2">
  641. <!-- <span> -->
  642. <!--时间范围选择 -->
  643. <el-time-picker
  644. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  645. v-model="timeItem.startTime"
  646. :placeholder="$t('time.startTime')"
  647. style="width:120px;"
  648. format="HH:mm"
  649. value-format="HH:mm"
  650. :picker-options="{
  651. start: '00:00',
  652. end: '23:59',
  653. }"
  654. @change="iptChangs()">
  655. </el-time-picker> - <el-time-picker
  656. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  657. v-model="timeItem.endTime"
  658. :placeholder="$t('time.endTime')"
  659. style="width:120px;"
  660. format="HH:mm"
  661. value-format="HH:mm"
  662. :picker-options="{
  663. start: '00:00',
  664. end: '23:59',
  665. minTime: timeItem.startTime
  666. }"
  667. @change="iptChangs()">
  668. </el-time-picker>
  669. </span>
  670. </el-form-item>
  671. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  672. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  673. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  674. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  675. ></el-input>
  676. </el-form-item>
  677. </div>
  678. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  679. </div>
  680. <!--照片的显示 -->
  681. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  682. <el-image v-for="(pic, index) in domain.pics" :key="index"
  683. style="width: 100px; height: 100px; margin-right:10px;"
  684. :src="pic"
  685. :preview-src-list="domain.pics">
  686. </el-image>
  687. </p>
  688. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  689. </div>
  690. <span id="workFormsItemBottom"></span>
  691. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;position:sticky;bottom:70px;background:#fff;z-index:1010">{{$t('other.addMore')}}</el-link>
  692. </el-form>
  693. <span slot="footer" class="dialog-footer">
  694. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  695. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  696. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  697. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  698. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  699. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  700. </span>
  701. </el-dialog>
  702. <!-- 按周填报 -->
  703. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  704. <!-- 按周填报-已填工时-点击 -->
  705. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  706. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  707. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  708. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  709. <el-table-column prop="state" :label="$t('state.states')">
  710. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  711. </el-table-column>
  712. <!-- <el-table-column label="操作">
  713. <template slot-scope="scope">
  714. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  715. </template>
  716. </el-table-column> -->
  717. </el-table>
  718. <span slot="footer" class="dialog-footer">
  719. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  720. </span>
  721. </el-dialog>
  722. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  723. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  724. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" 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>
  725. <el-button @click="handleGetPrevWeek()">{{$t('time.lastWeek')}}</el-button>
  726. <el-button @click="handleGetNextvWeek()">{{$t('time.nextWeek')}}</el-button>
  727. <el-button @click="getCurrentWeek()">{{$t('time.thisWeek')}}</el-button>
  728. <el-button @click="newDates()">{{$t('time.addedDate')}}</el-button>
  729. </el-form-item>
  730. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
  731. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  732. <template slot-scope="scope">
  733. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData(weekDay)}})
  734. </template>
  735. </el-table-column>
  736. <el-table-column fixed="left" :label="$t('other.hoursFilled')+ '(h)'" width="100" prop="filledTime" align="center">
  737. <template slot-scope="scope">
  738. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  739. <p v-else></p>
  740. </template>
  741. </el-table-column>
  742. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  743. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
  744. <template slot-scope="scope">
  745. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  746. <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</el-button>
  747. <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</el-button>
  748. <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]}}</el-button>
  749. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  750. </div>
  751. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  752. <el-button v-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]}}</el-button>
  753. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  754. </div>
  755. </template>
  756. </el-table-column>
  757. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  758. <template slot-scope="scope">
  759. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
  760. <span v-else>{{$t('other.noAttendanceRecord')}}</span>
  761. </template>
  762. </el-table-column>
  763. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  764. <template slot-scope="scope">
  765. <div class="zhiss">
  766. <p>{{scope.row.filledTime ? parseFloat(scope.row.he) + scope.row.filledTime*1 : parseFloat(scope.row.he)}}</p>
  767. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  768. </div>
  769. </template>
  770. </el-table-column>
  771. </el-table>
  772. </el-form>
  773. <!-- 按周填报项目筛选 -->
  774. <div v-if="selConShow" class="selConStyle">
  775. <div class="selConStyle_title">{{$t('defaultText.pleaseSelectTheItemYouWantToFillIn')}}</div>
  776. <el-select v-model="selCon" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable>
  777. <el-option
  778. v-for="item in fillProjectList"
  779. :disabled="item.status!=1 && item.status!=4"
  780. :key="item.id"
  781. :label="item.projectName"
  782. :value="item.id">
  783. </el-option>
  784. </el-select>
  785. </div>
  786. <span slot="footer" class="dialog-footer" v-if="selConShow">
  787. <el-button @click="selListqx()">{{$t('btn.cancel')}}</el-button>
  788. <el-button type="primary" @click="selListFun()">{{$t('btn.nextStep')}}</el-button>
  789. <!-- :loading="submitingReport" -->
  790. </span>
  791. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  792. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button>
  793. <el-button @click="zhoAddqx()">{{$t('btn.cancel')}}</el-button>
  794. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  795. </span>
  796. </el-dialog>
  797. <!-- 选择时间 -->
  798. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  799. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  800. <span slot="footer" class="dialog-footer">
  801. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  802. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  803. </span>
  804. </el-dialog>
  805. <!-- 按周填报弹窗 -->
  806. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
  807. <div>
  808. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  809. <p>{{$t('lable.subproject')}}</p>
  810. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  811. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  812. </el-select>
  813. </div>
  814. <!--如果设置了工时成本预警的预算成本项-->
  815. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  816. <p>{{$t('lable.budgetSource')}}</p>
  817. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  818. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  819. </el-select>
  820. </div>
  821. <!-- 任务分组 -->
  822. <div class="zhoFel" v-if="user.company.packageProject == 1">
  823. <p>{{$t('lable.taskGrouping')}}</p>
  824. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  825. @change="getGroupStages(zhoBao, 0)">
  826. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  827. </el-select>
  828. </div>
  829. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  830. <p>{{$t('other.inputStage')}}</p>
  831. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  832. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  833. </el-select>
  834. </div>
  835. <div class="zhoFel" v-if="user.timeType.reportAuditType != 3">
  836. <p>{{$t('other.reviewer')}}</p>
  837. <el-select v-model="zhoBao.projectAuditorId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  838. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  839. </el-select>
  840. </div>
  841. <template v-if="user.timeType.reportAuditType == 3">
  842. <div class="zhoFel">
  843. <p>第一审核人</p>
  844. <el-select v-model="zhoBao.auditorFirst" placeholder="第一审核人" style="width: 355px">
  845. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  846. </el-select>
  847. </div>
  848. <div class="zhoFel">
  849. <p>第二审核人</p>
  850. <el-select v-model="zhoBao.auditorSec" placeholder="第二审核人" style="width: 355px">
  851. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  852. </el-select>
  853. </div>
  854. <div class="zhoFel">
  855. <p>第三审核人</p>
  856. <el-select v-model="zhoBao.auditorThird" placeholder="第三审核人" style="width: 355px">
  857. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  858. </el-select>
  859. </div>
  860. <div class="zhoFel">
  861. <p>抄送人</p>
  862. <el-select v-model="zhoBao.ccUserid" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  863. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  864. </el-select>
  865. </div>
  866. </template>
  867. <!-- 自定义维度 -->
  868. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  869. <p>{{user.timeType.customDegreeName}}</p>
  870. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  871. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  872. </el-select>
  873. </div>
  874. <!-- 自定义数值 -->
  875. <div class="zhoFel" v-if="user.timeType.customDataActive">
  876. <p>{{user.timeType.customDataName}}</p>
  877. <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>
  878. </div>
  879. <!-- 自定义文本 -->
  880. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  881. <p>{{user.timeType.customTextName}}</p>
  882. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  883. </div>
  884. <div class="zhoFel" v-if="reportTimeType.type == 2">
  885. <p>{{$t('other.timeSelection')}}</p>
  886. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  887. </div>
  888. <div class="zhoFel" v-if="reportTimeType.type == 1">
  889. <p>{{$t('other.chooseDuration')}}</p>
  890. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  891. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  892. </el-select>
  893. </div>
  894. <div class="zhoFel" v-if="reportTimeType.type == 3">
  895. <p>{{$t('lable.percentageOfTime')}}</p>
  896. <div style="width:355px;display: flex;align-items: center;">
  897. <el-col span="23"><el-slider style="margin-left: 5px;width:249px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)"></el-slider></el-col>
  898. <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>
  899. </div>
  900. </div>
  901. <div class="zhoFel">
  902. <p>{{$t('other.workMatters')}}</p>
  903. <el-input type="textarea" v-model="zhoBao.con" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  904. </div>
  905. </div>
  906. <span slot="footer" class="dialog-footer">
  907. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  908. <el-button type="primary" @click="btnTianxiaes()">{{$t('btn.determine')}}</el-button>
  909. </span>
  910. </el-dialog>
  911. <!-- 批量日报审核 -->
  912. <el-dialog :title="$t('other.bulkProjectReportReview')" :visible.sync="approveDialogVisible" width="500px" >
  913. <el-checkbox v-model="isAllSelect" :label="$t('btn.selectAll')" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  914. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  915. </el-tree>
  916. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">{{$t('other.responsibleForTheProjectLength')}}</div>
  917. <span slot="footer" class="dialog-footer">
  918. <el-button @click="approveDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  919. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">{{$t('state.approved')}}</el-button>
  920. </span>
  921. </el-dialog>
  922. <!--导出报表条件选择 -->
  923. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  924. <el-form ref="form3" :model="exportParam" >
  925. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  926. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  927. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  928. </el-select>
  929. </el-form-item>
  930. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  931. <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>
  932. <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>
  933. </el-form-item>
  934. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  935. <el-date-picker
  936. v-model="exportParam.dateRange" :editable="false"
  937. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  938. :clearable="true"
  939. :range-separator="$t('other.to')"
  940. type="daterange"
  941. :start-placeholder="$t('time.startDate')"
  942. :end-placeholder="$t('time.endDate')"
  943. ></el-date-picker>
  944. </el-form-item>
  945. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  946. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  947. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  948. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  949. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  950. </el-select>
  951. </el-form-item>
  952. </el-form>
  953. <div slot="footer" class="dialog-footer">
  954. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  955. </div>
  956. </el-dialog>
  957. <!--导出报表条件选择 -->
  958. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  959. <el-form ref="form3" :model="exportParam" >
  960. <el-form-item prop="range" :label="$t('time.dateRange')">
  961. <el-date-picker
  962. v-model="exportParam.dateRange" :editable="false"
  963. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  964. :clearable="true"
  965. :range-separator="$t('other.to')"
  966. type="daterange"
  967. :start-placeholder="$t('time.startDate')"
  968. :end-placeholder="$t('time.endDate')"
  969. ></el-date-picker>
  970. </el-form-item>
  971. </el-form>
  972. <div slot="footer" class="dialog-footer">
  973. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  974. </div>
  975. </el-dialog>
  976. <!--人员列表 -->
  977. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  978. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  979. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  980. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  981. <el-table-column type="selection"></el-table-column>
  982. <el-table-column prop="label" :label="$t('lable.name')" >
  983. <template slot-scope="scope">
  984. <span>
  985. <!-- {{(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}} -->
  986. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  987. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  988. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  989. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  990. </span>
  991. <span v-else>
  992. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  993. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  994. </span>
  995. </span>
  996. </template>
  997. </el-table-column>
  998. <el-table-column prop="deptName" :label="$t('lable.department')" >
  999. <template slot-scope="scope">
  1000. <div>
  1001. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1002. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1003. </div>
  1004. </template>
  1005. </el-table-column>
  1006. </el-table>
  1007. </el-tab-pane>
  1008. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1009. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1010. <el-table-column prop="label" :label="$t('lable.name')" >
  1011. <template slot-scope="scope">
  1012. <!-- <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> -->
  1013. <!-- <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> -->
  1014. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1015. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1016. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1017. <span>{{scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1018. </span>
  1019. <span v-else>
  1020. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1021. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1022. </span>
  1023. </template>
  1024. </el-table-column>
  1025. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1026. <template slot-scope="scope">
  1027. <div>
  1028. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1029. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1030. </div>
  1031. </template>
  1032. </el-table-column>
  1033. </el-table>
  1034. </el-tab-pane>
  1035. </el-tabs>
  1036. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1037. <el-table-column type="selection"></el-table-column>
  1038. <el-table-column prop="label" :label="$t('lable.name')" >
  1039. <template slot-scope="scope">
  1040. <div>
  1041. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.label'></ww-open-data></span>
  1042. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1043. </div>
  1044. </template>
  1045. </el-table-column>
  1046. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1047. <template slot-scope="scope">
  1048. <div>
  1049. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1050. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1051. </div>
  1052. </template>
  1053. </el-table-column>
  1054. </el-table>
  1055. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1056. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1057. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1058. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1059. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1060. </div>
  1061. </el-dialog>
  1062. <!-- 按部门选择人员 -->
  1063. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1064. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1065. <div class="tree" style="height:400px">
  1066. <el-scrollbar style="height:100%">
  1067. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1068. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1069. highlight-current :filter-node-method="filterNode">
  1070. <span class="custom-tree-node" slot-scope="{ node, data }">
  1071. <span v-if="user.userNameNeedTranslate == '1'">
  1072. <span v-if="node.data.children">
  1073. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1074. </span>
  1075. <span v-else>
  1076. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1077. </span>
  1078. </span>
  1079. <span v-if="user.userNameNeedTranslate != '1'">
  1080. {{ node.label }}
  1081. </span>
  1082. </span>
  1083. </el-tree>
  1084. </el-scrollbar>
  1085. </div>
  1086. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1087. <div slot="footer" class="dialog-footer">
  1088. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1089. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1090. </div>
  1091. </el-dialog>
  1092. <el-dialog
  1093. v-if="monthWorkTimeDialog"
  1094. :visible.sync="monthWorkTimeDialog"
  1095. :close-on-click-modal="false"
  1096. customClass="customWidth selectworktime"
  1097. width="63%"
  1098. title=""
  1099. >
  1100. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1101. <el-tabs v-model="activeName" @tab-click="handleClick">
  1102. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1103. <div class="selectworktime_export" style="margin-top:10px;">
  1104. <div class="selectworktime_export_l">
  1105. <el-date-picker
  1106. class="selecteworktime_datapick"
  1107. v-model="WorktimeDatepickValue"
  1108. value-format="yyyy-MM-dd"
  1109. type="daterange"
  1110. align="right"
  1111. unlink-panels
  1112. :range-separator="$t('other.to')"
  1113. :start-placeholder="$t('time.startDate')"
  1114. :end-placeholder="$t('time.endDate')"
  1115. :default-time="['12:00:00', '12:00:00']"
  1116. size="small"
  1117. popper-class="selecteorktime_datapick_popper"
  1118. @change="showMonthWorkTime()"
  1119. >
  1120. </el-date-picker>
  1121. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1122. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1123. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1124. <!-- 222 -->
  1125. </div>
  1126. <div>
  1127. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1128. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1129. </el-input>
  1130. </div>
  1131. <el-link
  1132. type="primary"
  1133. style="float: right; vertical-align: middle;height:32px"
  1134. @click="exportMembWorkHours()"
  1135. >{{$t('export.exportData')}}</el-link
  1136. >
  1137. </div>
  1138. <el-table ref="hasworkTbl"
  1139. :data="monthWorkDataS"
  1140. v-el-table-infinite-scroll="listScroll"
  1141. border
  1142. :height="500"
  1143. highlight-current-row
  1144. style="width: 100%"
  1145. v-loading="tbload"
  1146. :lazy="true"
  1147. >
  1148. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1149. <template slot-scope="scope">
  1150. {{ scope.$index + 1 }}
  1151. </template>
  1152. </el-table-column>
  1153. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1154. <template slot-scope="scope">
  1155. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1156. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1157. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1158. <!-- {{scope.row.name}} -->
  1159. </span>
  1160. </template>
  1161. </el-table-column>
  1162. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1163. <template slot-scope="scope">
  1164. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1165. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1166. </template>
  1167. </el-table-column>
  1168. <el-table-column
  1169. min-width="105"
  1170. v-for="(item, index) in pickDateArray"
  1171. :key="index"
  1172. :label="item.label"
  1173. align="center"
  1174. >
  1175. <template slot-scope="scope">
  1176. <div
  1177. style="color: red"
  1178. v-if="
  1179. scope.row.worktimeList.filter(
  1180. (w) =>
  1181. w.createDate==item.date
  1182. ).length > 0 &&
  1183. scope.row.worktimeList.filter(
  1184. (w) =>w.createDate==item.date
  1185. )[0].workingTime < reportTimeType.allday
  1186. "
  1187. >
  1188. {{
  1189. scope.row.worktimeList.filter(
  1190. (w) =>w.createDate==item.date
  1191. )[0].workingTime.toFixed(1)
  1192. }}
  1193. </div>
  1194. <div
  1195. style="color: #20a0ff"
  1196. v-if="
  1197. scope.row.worktimeList.filter(
  1198. (w) =>w.createDate==item.date
  1199. ).length > 0 &&
  1200. scope.row.worktimeList.filter(
  1201. (w) =>w.createDate==item.date
  1202. )[0].workingTime > reportTimeType.allday
  1203. "
  1204. >
  1205. {{
  1206. scope.row.worktimeList.filter(
  1207. (w) =>w.createDate==item.date
  1208. )[0].workingTime.toFixed(1)
  1209. }}
  1210. </div>
  1211. <div
  1212. v-if="
  1213. scope.row.worktimeList.filter(
  1214. (w) =>w.createDate==item.date
  1215. ).length > 0 &&
  1216. scope.row.worktimeList.filter(
  1217. (w) =>w.createDate==item.date
  1218. )[0].workingTime == reportTimeType.allday
  1219. "
  1220. >
  1221. {{
  1222. scope.row.worktimeList.filter(
  1223. (w) =>w.createDate==item.date
  1224. )[0].workingTime
  1225. }}
  1226. </div>
  1227. <div
  1228. v-if="
  1229. scope.row.worktimeList.filter(
  1230. (w) =>w.createDate==item.date
  1231. ).length == 0
  1232. "
  1233. >
  1234. 0
  1235. </div>
  1236. <div
  1237. v-if="
  1238. scope.row.worktimeList.filter(
  1239. (w) =>w.createDate==item.date
  1240. ).length > 0 &&
  1241. typeof scope.row.worktimeList.filter(
  1242. (w) =>w.createDate==item.date
  1243. )[0].workingTime == 'string'
  1244. "
  1245. >
  1246. {{
  1247. scope.row.worktimeList.filter(
  1248. (w) =>w.createDate==item.date
  1249. )[0].workingTime
  1250. }}
  1251. </div>
  1252. </template>
  1253. </el-table-column>
  1254. </el-table>
  1255. <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>
  1256. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1257. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1258. <label style="font-size: 16px">员工每日已填报工时数</label>
  1259. <el-link
  1260. type="primary"
  1261. style="float: right; margin-right: 60px"
  1262. @click="exportMembWorkHours()"
  1263. >导出已填报数据</el-link
  1264. > -->
  1265. <!-- <el-button >导出</el-button> -->
  1266. <!-- </div> -->
  1267. </el-tab-pane>
  1268. <el-tab-pane :label="$t('other.unfilledPersonList')" name="second" >
  1269. <div class="selectworktime_export" style="margin-top:10px">
  1270. <div class="selectworktime_export_l">
  1271. <el-date-picker
  1272. class="selecteworktime_datapick"
  1273. v-model="WorktimeDatepickValue"
  1274. value-format="yyyy-MM-dd"
  1275. type="daterange"
  1276. align="right"
  1277. unlink-panels
  1278. :range-separator="$t('other.to')"
  1279. :start-placeholder="$t('time.startDate')"
  1280. :end-placeholder="$t('time.endDate')"
  1281. :default-time="['12:00:00', '12:00:00']"
  1282. size="small"
  1283. popper-class="selecteorktime_datapick_popper"
  1284. @change="showMonthNotWorkTime()"
  1285. >
  1286. </el-date-picker>
  1287. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1288. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1289. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1290. </div>
  1291. <div>
  1292. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1293. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1294. </el-input>
  1295. </div>
  1296. <el-link
  1297. type="primary"
  1298. style="float: right; vertical-align: middle;height:32px"
  1299. @click="exportMembNotWorkHours()"
  1300. >{{$t('export.exportData')}}</el-link
  1301. >
  1302. </div>
  1303. <el-table
  1304. ref="hasworkTbl2"
  1305. :data="monthNotWorkDateS"
  1306. v-el-table-infinite-scroll="notListScroll"
  1307. border
  1308. :height="500"
  1309. highlight-current-row
  1310. style="width: 100%"
  1311. v-loading="tbload"
  1312. lazy
  1313. >
  1314. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1315. <template slot-scope="scope">
  1316. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1317. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1318. </template>
  1319. </el-table-column>
  1320. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1321. <template slot-scope="scope">
  1322. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1323. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1324. </template>
  1325. </el-table-column>
  1326. <el-table-column
  1327. min-width="200"
  1328. :label="$t('weekDay.date')"
  1329. align="center"
  1330. prop="createDate"
  1331. >
  1332. </el-table-column>
  1333. <el-table-column
  1334. min-width="200"
  1335. :label="$t('state.states')"
  1336. align="center"
  1337. prop="status"
  1338. />
  1339. <el-table-column
  1340. min-width="200"
  1341. :label="$t('other.attendanceData')"
  1342. prop="cardTime"
  1343. align="center"
  1344. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1345. </el-table>
  1346. <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>
  1347. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1348. </el-tab-pane>
  1349. </el-tabs>
  1350. </el-dialog>
  1351. <!--驳回弹出框 -->
  1352. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1353. <div>
  1354. <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')" />
  1355. </div>
  1356. <div slot="footer" class="dialog-footer">
  1357. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1358. <el-button type="primary" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1359. </div>
  1360. </el-dialog>
  1361. <!-- 通过弹出框 -->
  1362. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1363. <div>
  1364. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1365. </div>
  1366. <div slot="footer" class="dialog-footer">
  1367. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1368. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1369. </div>
  1370. </el-dialog>
  1371. <!--批量导入日报 -->
  1372. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1373. <p>1. {{$t('other.download')}}
  1374. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx'" :download="$t('template.EmployeeTimeImportTemplate')+'.xlsx'">{{$t('template.EmployeeHoursStatisticsTemplate') + '.xlsx'}}</el-link>
  1375. </p>
  1376. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1377. <p style="display: flex;justify-content: center;">
  1378. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1379. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1380. </el-upload>
  1381. </p>
  1382. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1383. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1384. </div>
  1385. </el-dialog>
  1386. <!-- 工时导入记录弹窗 -->
  1387. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1388. <div style="height: 452px">
  1389. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1390. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1391. <el-table-column prop="userName" :label="$t('other.operator')">
  1392. <template slot-scope="scope">
  1393. <div>
  1394. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1395. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1396. </div>
  1397. </template>
  1398. </el-table-column>
  1399. <el-table-column prop="datel" :label="$t('other.document')">
  1400. <template slot-scope="scope">
  1401. <div>
  1402. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1403. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1404. </div>
  1405. </template>
  1406. </el-table-column>
  1407. </el-table>
  1408. <el-col :span="24" class="paginatis">
  1409. <el-pagination
  1410. @size-change="handleSizeChange"
  1411. @current-change="handleCurrentChange"
  1412. :page-sizes="[20 , 50 , 80 , 100]"
  1413. :page-size="20"
  1414. layout="total, sizes, prev, pager, next"
  1415. :total="toViewForm.total"
  1416. style="float:right;"
  1417. ></el-pagination>
  1418. </el-col>
  1419. </div>
  1420. </el-dialog>
  1421. <!--基于企业微信考勤数据的工时导入 -->
  1422. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1423. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1424. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1425. </el-step>
  1426. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1427. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1428. </el-steps>
  1429. <div v-if="active==0" style="padding:30px;height:360px;">
  1430. <div style="margin-top:50px;margin-left:280px;">
  1431. <el-date-picker
  1432. v-model="importWxParam.date" :editable="false"
  1433. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1434. :clearable="true"
  1435. :range-separator="$t('other.to')"
  1436. type="daterange"
  1437. :start-placeholder="$t('time.startDate')"
  1438. :end-placeholder="$t('time.endDate')"
  1439. @change="loadCheckInData"
  1440. ></el-date-picker>
  1441. </div>
  1442. </div>
  1443. <div v-if="active==1" style="padding:10px;">
  1444. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1445. style="width: 100%;margin-top:5px;" >
  1446. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1447. <template slot-scope="scope">
  1448. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1449. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1450. </template>
  1451. </el-table-column>
  1452. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1453. </el-table-column>
  1454. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1455. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1456. <template slot-scope="scope">
  1457. <div>
  1458. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1459. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1460. </div>
  1461. </template>
  1462. </el-table-column>
  1463. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1464. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1465. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1466. <template slot-scope="scope">
  1467. {{scope.row.workHours.toFixed(1)}}h
  1468. </template>
  1469. </el-table-column>
  1470. </el-table>
  1471. </div>
  1472. <div v-if="active==2" >
  1473. <p style="display: flex;justify-content: center;height:390px;">
  1474. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1475. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1476. </el-upload>
  1477. </p>
  1478. </div>
  1479. <div slot="title">
  1480. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1481. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1482. </div>
  1483. <span slot="footer">
  1484. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1485. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1486. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1487. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1488. </span>
  1489. </el-dialog>
  1490. <!--工时批量代填 -->
  1491. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1492. <div>
  1493. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1494. v-model="importWxParam.date" :editable="false"
  1495. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1496. :clearable="true"
  1497. :range-separator="$t('other.to')"
  1498. type="daterange"
  1499. :start-placeholder="$t('time.startDate')"
  1500. :end-placeholder="$t('time.endDate')"
  1501. @change="loadCheckInData"
  1502. ></el-date-picker>
  1503. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1504. </div>
  1505. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1506. :key="timeStamp"
  1507. style="width: 100%;margin-top:5px;" ref="tab">
  1508. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1509. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1510. <template slot-scope="scope">
  1511. <div>
  1512. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1513. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1514. </div>
  1515. </template>
  1516. </el-table-column>
  1517. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1518. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1519. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1520. <template slot-scope="scope">
  1521. {{scope.row.workHours.toFixed(1)}}h
  1522. </template>
  1523. </el-table-column>
  1524. <!--项目名称列表 -->
  1525. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1526. <template slot-scope="scope">
  1527. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1528. </template>
  1529. </el-table-column>
  1530. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1531. <template slot-scope="scope">
  1532. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1533. </template>
  1534. </el-table-column>
  1535. </el-table>
  1536. </el-dialog>
  1537. <!--基于企业微信考勤数据的工时导入 -->
  1538. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1539. <div>
  1540. <span>{{importResultMsg}}</span>
  1541. </div>
  1542. <span slot="footer" class="dialog-footer">
  1543. <el-button type="primary" @click="showImportResult=false">{{$t('btn.submit')}}</el-button>
  1544. </span>
  1545. </el-dialog>
  1546. <!-- 审核流程展示 -->
  1547. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1548. <div style="padding:20px 40px 20px 0">
  1549. <el-timeline :reverse="false">
  1550. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">{{item.msg}}</el-timeline-item>
  1551. </el-timeline>
  1552. </div>
  1553. </el-dialog>
  1554. </section>
  1555. </template>
  1556. <script>
  1557. // 左右滑动
  1558. import dragMixin from "@/common/js/tensile.js";
  1559. import util from "../../common/js/util";
  1560. // 自定义select组件
  1561. import selectCat from "@/components/select.vue"
  1562. // 引入自定义级联组件
  1563. import vueCascader from "@/components/cascader.vue"
  1564. let _that = this
  1565. export default {
  1566. mixins: [dragMixin],
  1567. components: {
  1568. selectCat,
  1569. vueCascader
  1570. },
  1571. data() {
  1572. return {
  1573. seluserText: '',
  1574. translation: '1', // 1、文字, 2、部门, 3、人员
  1575. exportLoad: false,
  1576. getPickerOptions: {
  1577. disabledDate: (time) => {
  1578. var date = new Date();
  1579. var year = date.getFullYear();
  1580. var month = date.getMonth() + 1;
  1581. if (month >= 1 && month <= 9) {
  1582. month = "0" + month;
  1583. }
  1584. var currentdate = year.toString() + month.toString();
  1585. var timeyear = time.getFullYear();
  1586. var timemonth = time.getMonth() + 1;
  1587. if (timemonth >= 1 && timemonth <= 9) {
  1588. timemonth = "0" + timemonth;
  1589. }
  1590. var timedate = timeyear.toString() + timemonth.toString();
  1591. if(this.user.timeType.fillAhead == 0){
  1592. return currentdate < timedate;
  1593. }else{
  1594. return false
  1595. }
  1596. }
  1597. },
  1598. alalal: '8.0',
  1599. timeBasecostList:null,
  1600. tbload: false,
  1601. exportTimeDialog: false,
  1602. searchKeyword: '',
  1603. monthWorkDataS: [],
  1604. monthNotWorkDateS: [],
  1605. pickDateArray:[],
  1606. WorktimeDatepickValue: [],
  1607. activeName:"first",
  1608. isLeave: 0,
  1609. submitingReport: false,
  1610. importResultMsg:null,
  1611. showImportResult:false,
  1612. importingData: false,
  1613. isDraft: 0,
  1614. timeStamp: 0,
  1615. projectColumns:[],
  1616. checkinLoading:false,
  1617. importWxParam:{date:null,},
  1618. active:0,
  1619. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1620. importWxDialog:false,
  1621. importDialog:false,
  1622. denyForm:null,
  1623. denyReasonDialog:false,
  1624. monthWorkTimeDialog: false,
  1625. isSubstitude:false,
  1626. isFill:false,
  1627. unFillList:[],
  1628. fillList:[],
  1629. fillMembList:[],
  1630. fillMembList_leave: [],
  1631. membListVisible: false,
  1632. isBatch:0,//是否是批量填报
  1633. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1634. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1635. 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')],
  1636. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1637. fillStatusList: [],
  1638. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1639. exportDialog:false,
  1640. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1641. subProjectList:[],
  1642. canEdit: true,
  1643. timeRange:[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],
  1644. selectTime:null,
  1645. reportTimeType:{},
  1646. curDate:'',
  1647. isAllSelect: false,
  1648. approveDialogVisible:false,
  1649. deptId:null,
  1650. targetUid: null,
  1651. membCount:0,
  1652. selectState:"-1",
  1653. user: JSON.parse(sessionStorage.getItem("user")),
  1654. allUsersList: [],
  1655. showAddMore:false,
  1656. allDate: [],
  1657. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1658. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1659. choseDay: 0,
  1660. tableHeight: 0,
  1661. listLoading: false,
  1662. projectList: [], //项目列表
  1663. fillProjectList: [],
  1664. reportList: [], //日报列表
  1665. reportNames:[], //批量审批列表
  1666. selCon:[], //筛选条件
  1667. selProjectList:[], //筛选后项目列表
  1668. selConShow: true,
  1669. dialogVisible: false, //项目弹窗
  1670. report: '',
  1671. workForm: {
  1672. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1673. domains: [{
  1674. id: null,
  1675. projectId: "",
  1676. workingTime: "",
  1677. timeType:0,
  1678. content: "",
  1679. state: 2,
  1680. multiWorktime:0,
  1681. worktimeList:[],
  1682. degreeId: null,
  1683. auditUserList: []
  1684. }],
  1685. },
  1686. workRules: {
  1687. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  1688. },
  1689. chooseParticipVisible: false,
  1690. logining: false,
  1691. isDisable: false,
  1692. timeType:[],
  1693. deptMembData: [
  1694. ],
  1695. //部门人员树状结构
  1696. data: [
  1697. {
  1698. id: -1,
  1699. label: this.$t('lable.allStaff'),
  1700. membCount:0
  1701. },
  1702. {
  1703. id: 0,
  1704. label: this.$t('lable.unassigned'),
  1705. }
  1706. ],
  1707. allData:{},
  1708. batchShowData:{},
  1709. option: [],
  1710. depData: {
  1711. id: -1,
  1712. label: this.$t('lable.allStaff'),
  1713. },
  1714. defaultProps: {
  1715. children: 'children',
  1716. label: 'label'
  1717. },
  1718. isNew: false,
  1719. selected: false,
  1720. valuet: new Date(),
  1721. domObj: null,
  1722. participator:[],
  1723. chosenMembCount:0,
  1724. jsDay: 0,
  1725. jsTime: 0,
  1726. falsss: false,
  1727. weidu: [],
  1728. weiduList: [],
  1729. yonghuUser: [],
  1730. dateAr: [],
  1731. batchSubFillDialog: false,
  1732. isSubstiS: false,
  1733. diasZho: false,
  1734. zhoData: [],
  1735. zhoRqi: [],
  1736. btnZho: false,
  1737. zhoLoading: false,
  1738. changdu: 6,
  1739. tianxieDialogVisible: false,
  1740. scopess: {},
  1741. zhoBao: {
  1742. time: '',
  1743. workingTime: '',
  1744. progress: '',
  1745. con: '',
  1746. subProjectId: '',
  1747. stage: '',
  1748. subProjectList: [],
  1749. stages: [],
  1750. },
  1751. zhoBaoIdx: '',
  1752. zhoBaoName: '',
  1753. zhis: {},
  1754. dealList: [],
  1755. toViewDialogVisible: false,
  1756. toViewList: [],
  1757. toViewloading: true,
  1758. toViewForm: {
  1759. pageIndex: '1',
  1760. pageSize: '20',
  1761. total: 0,
  1762. },
  1763. toViewloadings: false,
  1764. tabPositionss: 'top',
  1765. monthTotal: 0,
  1766. monthTotalPage: 0,
  1767. monthTotalLages: 20,
  1768. monthWorkData: [],
  1769. monthNotWorkDate: [],
  1770. monthWorkDataS1: [],
  1771. monthnotTotal: 0,
  1772. monthnotTotalPage: 0,
  1773. monthnotTotalLages: 20,
  1774. monthNotWorkDateS1: [],
  1775. deptMembDataText: '',
  1776. isFlag: false,
  1777. isMore: false,
  1778. stateKey: '0',
  1779. expandDate: [],
  1780. notifySelList:[],
  1781. departmentList: [],
  1782. approvalProcessDialog: false,
  1783. approvalProcessData: [],
  1784. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  1785. 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')],
  1786. isWeekend: false,
  1787. canCancelInDialog: false,
  1788. approveinData: {},
  1789. approveinDialog: false,
  1790. reportCanDelete: false,
  1791. weeklyFilledTimeDialog: false,
  1792. weeklyFilledTimeList: [],
  1793. weeklyFilledTimeLoading: false,
  1794. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  1795. weeklyFilledTimeCanDelete: false,
  1796. weeklyFilledTimeDate: null,
  1797. leaveAllNum: 0
  1798. };
  1799. },
  1800. watch: {
  1801. deptMembDataText(val) {
  1802. this.$refs.chooseMembTree.filter(val);
  1803. }
  1804. },
  1805. filters: {
  1806. // 过滤
  1807. amounts(value) {
  1808. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1809. return 0
  1810. }
  1811. var zhi = +value + 0
  1812. return zhi.toFixed(1)
  1813. },
  1814. // zhoData
  1815. zhoData(value, arr) {
  1816. var dateArray = value.split("-");
  1817. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1818. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  1819. // console.log(arr[date.getDay()])
  1820. // return "周" + "日一二三四五六".charAt(date.getDay());
  1821. return arr[date.getDay()]
  1822. },
  1823. // 过滤数字
  1824. numbers(value) {
  1825. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1826. return 0
  1827. }
  1828. return value
  1829. },
  1830. },
  1831. methods: {
  1832. test(){
  1833. console.log('test',this.depData,this.data[0].membCount,this.reportList.length);
  1834. },
  1835. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  1836. this.weeklyFilledTimeDialog = true
  1837. this.weeklyFilledTimeLoading = true
  1838. this.weeklyFilledTimeDate = parameterDate
  1839. this.http.post('/report/getReportList',{
  1840. date: parameterDate,
  1841. userId: this.user.id
  1842. },res => {
  1843. this.weeklyFilledTimeLoading = false
  1844. if(res.code == 'ok'){
  1845. this.weeklyFilledTimeList = res.data[0].data
  1846. let candelete = true
  1847. for(let i in this.weeklyFilledTimeList){
  1848. if(this.weeklyFilledTimeList[i].state < 2){
  1849. candelete = false
  1850. }
  1851. }
  1852. this.weeklyFilledTimeCanDelete = candelete
  1853. }else {
  1854. this.$message({
  1855. message: res.msg,
  1856. type: 'error'
  1857. })
  1858. }
  1859. },err => {
  1860. this.weeklyFilledTimeLoading = false
  1861. this.$message({
  1862. message: err,
  1863. type: 'error'
  1864. })
  1865. })
  1866. },
  1867. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  1868. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  1869. confirmButtonText: this.$t('btn.determine'),
  1870. cancelButtonText: this.$t('btn.cancel'),
  1871. type: "warning"
  1872. })
  1873. .then(() => {
  1874. this.http.post('/report/delete',{
  1875. userId: this.user.id,
  1876. date: this.weeklyFilledTimeDate
  1877. },res => {
  1878. if (res.code == "ok") {
  1879. this.$message({
  1880. message: this.$t('message.successfullyDeleted'),
  1881. type: "success"
  1882. });
  1883. this.getWeeklyWorkTime()
  1884. this.getReportList();
  1885. this.getDepartment();
  1886. this.weeklyFilledTimeDialog = false;
  1887. } else {
  1888. this.$message({
  1889. message: res.msg,
  1890. type: "error"
  1891. });
  1892. }
  1893. },error => {
  1894. this.$message({
  1895. message: error,
  1896. type: "error"
  1897. });
  1898. }
  1899. );
  1900. }).catch(() => {});
  1901. },
  1902. getApprovalProcess(item){
  1903. // console.log('this.date',this.choseDate);
  1904. this.http.post('/report-log/get',{
  1905. creatorId: item.id,
  1906. createDate: sessionStorage.msg
  1907. },res => {
  1908. if(res.code == 'ok'){
  1909. this.approvalProcessDialog = true
  1910. this.approvalProcessData = res.data
  1911. }else{
  1912. this.$message({
  1913. message: res.msg,
  1914. type: 'error'
  1915. })
  1916. }
  1917. },err => {
  1918. this.$message({
  1919. message: err,
  1920. type: 'error'
  1921. })
  1922. })
  1923. },
  1924. filterNode(value, data) {
  1925. if (!value) return true;
  1926. return data.label.indexOf(value) !== -1;
  1927. },
  1928. triggerCalculateOT(index) {
  1929. var str = this.workForm.domains[index].overtimeHours + ''
  1930. if(str.indexOf('.') != '-1') {
  1931. var s = str.split('.')[0]
  1932. var st = str.split('.')[1]
  1933. var sts = st.split('')
  1934. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  1935. }
  1936. },
  1937. searchScreen(e){
  1938. if(e){
  1939. this.monthNotWorkDateS1 = []
  1940. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  1941. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  1942. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  1943. }
  1944. }
  1945. if (this.monthNotWorkDateS1.length > 50) {
  1946. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  1947. }else{
  1948. this.monthNotWorkDateS = this.monthNotWorkDateS1
  1949. }
  1950. // if (this.monthNotWorkDateS1.length > 0) {
  1951. // setTimeout(() => {
  1952. // this.tableListenernot()
  1953. // }, 1000);
  1954. // }
  1955. }else{
  1956. this.monthWorkDataS1 = []
  1957. for (let i = 0; i < this.monthWorkData.length; i++) {
  1958. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  1959. this.monthWorkDataS1.push(this.monthWorkData[i])
  1960. }
  1961. }
  1962. if (this.monthWorkDataS1.length > 50) {
  1963. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  1964. }else{
  1965. this.monthWorkDataS = this.monthWorkDataS1
  1966. }
  1967. // if (this.monthWorkDataS1.length > 0) {
  1968. // setTimeout(() => {
  1969. // this.tableListener()
  1970. // }, 1000);
  1971. // }
  1972. }
  1973. },
  1974. addUpload(data) {
  1975. // var zhi = data.fileName.split('.')[0]
  1976. // var sss = zhi + '.xlsx'
  1977. // return
  1978. var filePath = '/upload/' + data.serverName;
  1979. const a = document.createElement('a'); // 创建a标签
  1980. a.setAttribute('download', data.fileName);// download属性
  1981. a.setAttribute('href', filePath);// href链接
  1982. a.click(); //自执行点击事件
  1983. a.remove();
  1984. },
  1985. restrictNumber(targetId) {
  1986. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  1987. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1988. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1989. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1990. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1991. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1992. inpu.value = parseFloat(inpu.value);
  1993. }
  1994. },
  1995. //获取项目下的任务分组
  1996. getTaskGroups(domain, index) {
  1997. domain.groupId=null;
  1998. this.http.post('/task-group/listMyJoinGroup',{
  1999. projectId: domain.projectId,
  2000. isSubstitude: this.isSubstitude ? 1 : 0
  2001. },
  2002. res => {
  2003. if (res.code == "ok") {
  2004. this.workForm.domains[index].taskGroups = res.data;
  2005. this.$forceUpdate();
  2006. }
  2007. },
  2008. error => {
  2009. this.$message({
  2010. message: error,
  2011. type: "error"
  2012. });
  2013. }
  2014. );
  2015. },
  2016. //下载带企业微信考勤数据的工时统计模板
  2017. downloadCheckInExcel() {
  2018. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2019. startDate: this.importWxParam.date[0],
  2020. endDate: this.importWxParam.date[1],
  2021. },
  2022. res => {
  2023. if (res.code == "ok") {
  2024. var filePath = res.data;
  2025. const a = document.createElement('a'); // 创建a标签
  2026. var data = filePath.split("/");
  2027. a.setAttribute('download', data[data.length-1]);// download属性
  2028. a.setAttribute('href', filePath);// href链接
  2029. a.click(); //自执行点击事件
  2030. a.remove();
  2031. } else {
  2032. this.$message({
  2033. message: res.msg,
  2034. type: "error"
  2035. });
  2036. }
  2037. },
  2038. error => {
  2039. this.checkinLoading = false;
  2040. this.$message({
  2041. message: error,
  2042. type: "error"
  2043. });
  2044. }
  2045. );
  2046. },
  2047. pre() {
  2048. if (this.active == 0) return;
  2049. this.active--;
  2050. },
  2051. next() {
  2052. this.active++;
  2053. },
  2054. triggerTotalTime(index) {
  2055. var item = this.checkinList[index];
  2056. var total = 0.0;
  2057. for (var i=0;i<this.projectColumns.length; i++) {
  2058. var key = this.projectColumns[i];
  2059. if (item[key] != null && item[key] != '') {
  2060. total += parseFloat(item[key]);
  2061. }
  2062. }
  2063. item.totalFillTime = total;
  2064. },
  2065. //提交批量代填的数据
  2066. submitBatchSubFillData() {
  2067. var data = JSON.stringify(this.checkinList);
  2068. this.http.post('/user-corpwx-time/submitProjectTime',{
  2069. json: data,
  2070. projectColumns: JSON.stringify(this.projectColumns)
  2071. },
  2072. res => {
  2073. if (res.code == "ok") {
  2074. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2075. this.importWxDialog = false;
  2076. }
  2077. },
  2078. error => {
  2079. this.checkinLoading = false;
  2080. this.$message({
  2081. message: error,
  2082. type: "error"
  2083. });
  2084. }
  2085. );
  2086. },
  2087. loadCheckInData() {
  2088. if (this.importWxParam.date == null) {
  2089. this.checkinList = [];
  2090. return;
  2091. }
  2092. this.checkinLoading = true;
  2093. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2094. startDate: this.importWxParam.date[0],
  2095. endDate: this.importWxParam.date[1],
  2096. },
  2097. res => {
  2098. if (res.code == "ok") {
  2099. this.checkinLoading = false;
  2100. this.checkinList = res.data.list;
  2101. this.projectColumns = res.data.projects;
  2102. // 自定义表格会导致表格错乱,需重新计算表格
  2103. this.$nextTick(()=>{
  2104. this.$refs.tab.doLayout()
  2105. })
  2106. }
  2107. },
  2108. error => {
  2109. this.checkinLoading = false;
  2110. this.$message({
  2111. message: error,
  2112. type: "error"
  2113. });
  2114. }
  2115. );
  2116. },
  2117. batchImportWxData(item) {
  2118. //首先判断文件类型
  2119. let str = item.file.name.split(".");
  2120. let format = str[str.length - 1];
  2121. if (format != "xls" && format != "xlsx") {
  2122. this.$message({
  2123. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2124. type: "error"
  2125. });
  2126. } else {
  2127. this.importingData = true;
  2128. let formData = new FormData();
  2129. formData.append("file", item.file);
  2130. formData.append("companyId", this.user.companyId);
  2131. formData.append("withCheckIn", 1);
  2132. this.http.uploadFile('/report/importData', formData,
  2133. res => {
  2134. this.$refs.upload.clearFiles();
  2135. this.showImportResult = true;
  2136. this.importingData = false;
  2137. if (res.code == "ok") {
  2138. //换成弹出框,以免有人等了半天回来啥也没看到
  2139. this.importResultMsg = this.$t('other.successful') + ':' + this.$t('other.importSuccess') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  2140. this.getReportList();
  2141. this.importWxDialog = false;
  2142. } else {
  2143. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2144. }
  2145. },
  2146. error => {
  2147. this.$refs.upload.clearFiles();
  2148. this.listLoading = false;
  2149. this.$message({
  2150. message: error,
  2151. type: "error"
  2152. });
  2153. });
  2154. }
  2155. },
  2156. batchImportData(item) {
  2157. //首先判断文件类型
  2158. let str = item.file.name.split(".");
  2159. let format = str[str.length - 1];
  2160. if (format != "xls" && format != "xlsx") {
  2161. this.$message({
  2162. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2163. type: "error"
  2164. });
  2165. } else {
  2166. this.importingData = true;
  2167. let formData = new FormData();
  2168. formData.append("file", item.file);
  2169. formData.append("companyId", this.user.companyId);
  2170. this.http.uploadFile('/report/importData', formData,
  2171. res => {
  2172. this.$refs.upload.clearFiles();
  2173. this.importingData = false;
  2174. this.showImportResult = true;
  2175. if (res.code == "ok") {
  2176. //换成弹出框,以免有人等了半天回来啥也没看到
  2177. this.importResultMsg = this.$t('other.importSuccess')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  2178. this.getReportList();
  2179. this.importWXDialog = false;
  2180. } else {
  2181. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2182. }
  2183. },
  2184. error => {
  2185. this.$refs.upload.clearFiles();
  2186. this.importingData = false;
  2187. this.$message({
  2188. message: error,
  2189. type: "error"
  2190. });
  2191. });
  2192. }
  2193. },
  2194. userssHu() {
  2195. this.http.post('/time-type/getCompanyTimeSetting',{
  2196. companyId: this.user.companyId
  2197. },
  2198. res => {
  2199. if (res.code == "ok") {
  2200. this.yonghuUser = res.data
  2201. }
  2202. },
  2203. error => {
  2204. this.$message({
  2205. message: error,
  2206. type: "error"
  2207. });
  2208. }
  2209. );
  2210. },
  2211. iptBlur(i) {
  2212. if(this.isBatch == 0) {
  2213. return
  2214. }
  2215. this.http.post('/report/getWorkDays',{
  2216. startDate: this.workForm.createDate[0],
  2217. endDate: this.workForm.createDate[1]
  2218. },
  2219. res => {
  2220. if (res.code == "ok") {
  2221. this.jsDay = res.data
  2222. this.chuji(i)
  2223. } else {
  2224. this.$message({
  2225. message: res.msg,
  2226. type: "error"
  2227. });
  2228. this.workForm.createDate = [];
  2229. }
  2230. },
  2231. error => {
  2232. this.$message({
  2233. message: error,
  2234. type: "error"
  2235. });
  2236. }
  2237. );
  2238. var sl = this.workForm.domains
  2239. this.chuji(i)
  2240. },
  2241. chuji(i) {
  2242. if(i == 0) {
  2243. this.seleChn(1)
  2244. } else if(i == 1) {
  2245. this.seleChn(0)
  2246. } else if(i == 2) {
  2247. if(this.workForm.domains[0].multiWorktime > 0) {
  2248. this.iptChangs()
  2249. } else {
  2250. this.iptChang()
  2251. }
  2252. } else if(i == 3) {
  2253. this.seleChn(0)
  2254. }
  2255. },
  2256. seleChn(e,domain) {
  2257. if(e == 1) {
  2258. for(var i in this.workForm.domains) {
  2259. if(this.workForm.domains[i].timeType == 0) {
  2260. this.workForm.domains[i].workingTime = 8
  2261. } else {
  2262. this.workForm.domains[i].workingTime = 4
  2263. }
  2264. }
  2265. }
  2266. var quanbu = 0
  2267. var spl = this.workForm.domains
  2268. var zhi = ''
  2269. for(var i in spl) {
  2270. var sp = +spl[i].workingTime + 0
  2271. zhi = this.jsDay * sp
  2272. quanbu = +quanbu + zhi
  2273. }
  2274. this.jsTime = quanbu
  2275. let worktime = this.jsTime
  2276. // 自动计算加班时长
  2277. if(this.isBatch != 0){
  2278. worktime = this.jsTime / this.jsDay
  2279. }
  2280. if(this.user.timeType.fillOvertime && domain){
  2281. let isover = false
  2282. let alltime = 0
  2283. let allover = 0 //此处alltime同上面的worktime
  2284. for(let d in spl){
  2285. if(spl[d].isOvertime){
  2286. isover = true
  2287. allover += spl[d].overtimeHours*1
  2288. }
  2289. alltime += spl[d].workingTime*1
  2290. }
  2291. if(domain.overtimeHours){
  2292. allover = allover - domain.overtimeHours
  2293. }
  2294. if(worktime*1 > this.user.timeType.allday){
  2295. if(isover){
  2296. if(alltime > (allover + this.user.timeType.allday)){
  2297. this.$set(domain,'isOvertime',true)
  2298. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  2299. }else{
  2300. this.$set(domain,'isOvertime',false)
  2301. this.$set(domain,'overtimeHours',null)
  2302. if(alltime < (allover + this.user.timeType.allday)){
  2303. let overtime = allover + this.user.timeType.allday - alltime
  2304. for(let pi in spl){
  2305. if(spl[pi].overtimeHours){
  2306. if((overtime - spl[pi].overtimeHours*1) > 0){
  2307. overtime = overtime - spl[pi].overtimeHours*1
  2308. this.$set(spl[pi],'isOvertime',false)
  2309. this.$set(spl[pi],'overtimeHours',null)
  2310. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  2311. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  2312. break
  2313. }else{
  2314. this.$set(spl[pi],'isOvertime',false)
  2315. this.$set(spl[pi],'overtimeHours',null)
  2316. break
  2317. }
  2318. }
  2319. }
  2320. }
  2321. }
  2322. }else{
  2323. this.$set(domain,'isOvertime',true)
  2324. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  2325. }
  2326. }else{
  2327. for(let di in spl){
  2328. this.$set(spl[di],'isOvertime',false)
  2329. this.$set(spl[di],'overtimeHours',null)
  2330. }
  2331. }
  2332. }
  2333. },
  2334. iptChang() {
  2335. var sl = this.workForm.domains
  2336. var quanbu = 0
  2337. var zhi = ''
  2338. for(var i in sl) {
  2339. if(sl[i].startTime && sl[i].endTime) {
  2340. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  2341. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  2342. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2343. var leave1=date3%(24*3600*1000)
  2344. var hours=Math.floor(leave1/(3600*1000))
  2345. var leave2=leave1%(3600*1000)
  2346. var minutes=Math.floor(leave2/(60*1000))
  2347. var shi = hours+'.'+ minutes
  2348. var sll = +shi + 0
  2349. zhi = this.jsDay * sll
  2350. quanbu = +quanbu + zhi
  2351. }
  2352. }
  2353. this.jsTime = quanbu
  2354. },
  2355. iptChangs() {
  2356. var sl = this.workForm.domains
  2357. var quanbu = 0
  2358. var zhi = ''
  2359. for(var i in sl) {
  2360. for(var j in sl[i].worktimeList){
  2361. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  2362. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  2363. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  2364. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2365. var leave1=date3%(24*3600*1000)
  2366. var hours=Math.floor(leave1/(3600*1000))
  2367. var leave2=leave1%(3600*1000)
  2368. var minutes=Math.floor(leave2/(60*1000))
  2369. var shi = hours+'.'+ minutes
  2370. var sll = +shi + 0
  2371. zhi = this.jsDay * sll
  2372. quanbu = +quanbu + zhi
  2373. }
  2374. }
  2375. }
  2376. this.jsTime = quanbu
  2377. },
  2378. removeTimeItem(item, index) {
  2379. item.worktimeList.splice(index, 1);
  2380. this.iptChangs()
  2381. },
  2382. //添加工时
  2383. addNewWorktime(index, item) {
  2384. if(item.worktimeList == null ) {
  2385. item.worktimeList = []
  2386. }
  2387. item.worktimeList.push({});
  2388. },
  2389. //复制项目
  2390. copyProject(index) {
  2391. var leftProgress = 10;
  2392. if (this.reportTimeType.type == 3) {
  2393. //计算已经待分配工时比例
  2394. let array = this.workForm.domains;
  2395. let totalProgress = 0;
  2396. for (var i=0;i<array.length; i++) {
  2397. totalProgress += array[i].progress;
  2398. }
  2399. if (totalProgress < 100) {
  2400. leftProgress = 100 - totalProgress;
  2401. }
  2402. }
  2403. var newIndex = index+1;
  2404. var itemDomain = {
  2405. projectId: this.workForm.domains[index].projectId,
  2406. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  2407. content: "",
  2408. progress:leftProgress,
  2409. state:2,//2-表示待提交
  2410. };
  2411. this.workForm.domains.splice(newIndex, 0,itemDomain);
  2412. if (this.reportTimeType.type == 0) {
  2413. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  2414. var length = this.workForm.domains.length;
  2415. if (length == 2) {
  2416. this.showAddMore = false;
  2417. }
  2418. }
  2419. this.selectProject(itemDomain, newIndex);
  2420. },
  2421. showWorkTime(){
  2422. this.monthWorkTimeDialog = true;
  2423. this.searchKeyword = ''
  2424. this.WorktimeDatepickValue = this.istoMonth()
  2425. if(this.WorktimeDatepickValue.length == 0){
  2426. let newdate = new Date();
  2427. let nowdate = newdate.toLocaleDateString();
  2428. let getauto = this.getAutoWeekDate(nowdate)
  2429. let nowwd = [getauto[0],getauto[6]]
  2430. this.WorktimeDatepickValue = nowwd
  2431. }
  2432. this.showMonthWorkTime()
  2433. },
  2434. handleClick(t,e){
  2435. if (t.name == "first") {
  2436. this.showMonthWorkTime()
  2437. }else{
  2438. this.showMonthNotWorkTime()
  2439. }
  2440. },
  2441. //导出员工每日填报工时数
  2442. exportMembWorkHours() {
  2443. this.http.post(
  2444. "/report/exportUserDailyWorkTime",
  2445. {
  2446. // month: this.date,
  2447. startDate: this.WorktimeDatepickValue[0],
  2448. endDate: this.WorktimeDatepickValue[1],
  2449. },
  2450. (res) => {
  2451. if (res.code == "ok") {
  2452. let url = res.data;
  2453. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2454. }
  2455. },
  2456. (error) => {
  2457. this.$message({
  2458. message: error,
  2459. type: "error",
  2460. });
  2461. }
  2462. );
  2463. },
  2464. exportMembNotWorkHours() {
  2465. this.http.post(
  2466. "/report/exportNoReportUserList",
  2467. {
  2468. // month: this.date,
  2469. startDate: this.WorktimeDatepickValue[0],
  2470. endDate: this.WorktimeDatepickValue[1],
  2471. },
  2472. (res) => {
  2473. if (res.code == "ok") {
  2474. let url = res.data;
  2475. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2476. }
  2477. },
  2478. (error) => {
  2479. this.$message({
  2480. message: error,
  2481. type: "error",
  2482. });
  2483. }
  2484. );
  2485. },
  2486. downloadByA(name, url) {
  2487. const a = document.createElement("a"); // 创建a标签
  2488. a.setAttribute("download", name); // download属性
  2489. a.setAttribute("href", url); // href链接
  2490. a.click(); // 自执行点击事件
  2491. a.remove();
  2492. },
  2493. // 是否本月判断
  2494. istoMonth(){
  2495. let todate = new Date()
  2496. let tomonth = todate.getMonth() + 1
  2497. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  2498. if(this.date == adate){
  2499. return []
  2500. }else{
  2501. let sedate = new Date(this.date)
  2502. let semonth = sedate.getMonth() + 1
  2503. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  2504. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  2505. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  2506. return [sedates1, sedates2]
  2507. }
  2508. },
  2509. showMonthWorkTime() {
  2510. this.monthTotalPage = 0,
  2511. this.tbload = true
  2512. this.http.post(
  2513. "/report/getUserDailyWorkTime",
  2514. // "/report/getNoReportUserList",
  2515. {
  2516. // month: this.date,
  2517. startDate: this.WorktimeDatepickValue[0],
  2518. endDate: this.WorktimeDatepickValue[1],
  2519. },
  2520. (res) => {
  2521. if (res.code == "ok") {
  2522. this.tbload = false;
  2523. this.pickDateArray = res.data.days;
  2524. // console.log('dataarray',res.data.days);
  2525. this.monthWorkData = res.data.list;
  2526. // this.monthWorkDataS = this.monthWorkData
  2527. // this.monthWorkDataS1 = res.data.list
  2528. this.monthTotal = res.data.list.length
  2529. if (this.monthWorkData.length > 50) {
  2530. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  2531. }else{
  2532. this.monthWorkDataS = this.monthWorkData
  2533. }
  2534. this.searchScreen(0)
  2535. // this.monthWorkDataS = infoList
  2536. // 判断
  2537. // if (this.monthWorkDataS1.length > 0) {
  2538. // setTimeout(() => {
  2539. // this.tableListener()
  2540. // }, 1000);
  2541. // }
  2542. this.$nextTick(function(){
  2543. this.$refs.hasworkTbl.doLayout();
  2544. });
  2545. // this.$forceUpdate()
  2546. }
  2547. },
  2548. (error) => {
  2549. this.tbload = false
  2550. this.$message({
  2551. message: error,
  2552. type: "error",
  2553. });
  2554. }
  2555. );
  2556. },
  2557. // tableListener(){
  2558. // let that = this;
  2559. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  2560. // // 添加scroll监听事件
  2561. // dom.addEventListener("scroll", function () {
  2562. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2563. // if (scrollDistance < 2) {
  2564. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  2565. // that.monthTotalPage++; //当前页数自增
  2566. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  2567. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  2568. // var infoList = arrList.splice(
  2569. // that.monthTotalPage * that.monthTotalLages,
  2570. // that.monthTotalLages
  2571. // );
  2572. // // 数据添加
  2573. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  2574. // }
  2575. // }
  2576. // })
  2577. // },
  2578. showMonthNotWorkTime() {
  2579. this.monthTotalPage = 0,
  2580. this.tbload = true
  2581. this.http.post(
  2582. "/report/getNoReportUserList",
  2583. {
  2584. startDate: this.WorktimeDatepickValue[0],
  2585. endDate: this.WorktimeDatepickValue[1],
  2586. },
  2587. (res) => {
  2588. if (res.code == "ok") {
  2589. this.tbload = false
  2590. this.monthNotWorkDate = res.data;
  2591. // this.monthNotWorkDateS1 = res.data
  2592. this.monthnotTotal = res.data.length
  2593. // 2222111
  2594. if (this.monthNotWorkDate.length > 50) {
  2595. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  2596. } else {
  2597. this.monthNotWorkDateS = this.monthNotWorkDate
  2598. }
  2599. this.searchScreen(1)
  2600. // 判断
  2601. // if (this.monthnotworkDateS1.length > 0) {
  2602. // setTimeout(() => {
  2603. // this.tableListenernot()
  2604. // }, 1000);
  2605. // }
  2606. this.$nextTick(function(){
  2607. this.$refs.hasworkTbl2.doLayout();
  2608. });
  2609. }
  2610. },
  2611. (error) => {
  2612. this.tbload = false
  2613. this.$message({
  2614. message: error,
  2615. type: "error",
  2616. });
  2617. }
  2618. );
  2619. },
  2620. // tableListenernot(){
  2621. // let that = this;
  2622. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  2623. // dom.addEventListener("scroll", function () {
  2624. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  2625. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2626. // if (scrollDistance2 < 2) {
  2627. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  2628. // that.monthnotTotalPage++; //当前页数自增
  2629. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  2630. // var infoList = arrList.splice(
  2631. // that.monthnotTotalPage * that.monthnotTotalLages,
  2632. // that.monthnotTotalLages
  2633. // );
  2634. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  2635. // }
  2636. // }
  2637. // })
  2638. // },
  2639. listScroll(){
  2640. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  2641. this.isMore = true
  2642. setTimeout(()=>{
  2643. this.isMore = false
  2644. },1000)
  2645. }else {
  2646. this.isFlag = true
  2647. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  2648. this.monthWorkDataS = datalist
  2649. setTimeout(()=>{
  2650. this.isFlag = false
  2651. },300)
  2652. }
  2653. },
  2654. notListScroll(){
  2655. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  2656. this.isMore = true
  2657. setTimeout(()=>{
  2658. this.isMore = false
  2659. },1000)
  2660. }else {
  2661. this.isFlag = true
  2662. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  2663. this.monthNotWorkDateS = datalist
  2664. // console.log('length',this.monthNotWorkDateS.length)
  2665. setTimeout(()=>{
  2666. this.isFlag = false
  2667. },300)
  2668. }
  2669. },
  2670. // 获取默认这zhou日期参数 222
  2671. getLastWeek(e){
  2672. let newdate = new Date()
  2673. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  2674. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  2675. if(e){
  2676. this.WorktimeDatepickValue = lastwd
  2677. this.showMonthWorkTime()
  2678. }else{
  2679. this.WorktimeDatepickValue = lastwd
  2680. this.showMonthNotWorkTime()
  2681. }
  2682. },
  2683. getThisWeek(e){
  2684. let newdate = new Date();
  2685. let nowdate = newdate.toLocaleDateString();
  2686. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  2687. if(e){
  2688. this.WorktimeDatepickValue = nowwd
  2689. this.showMonthWorkTime()
  2690. }else{
  2691. this.WorktimeDatepickValue = nowwd
  2692. this.showMonthNotWorkTime()
  2693. }
  2694. },
  2695. getDoubleLastWeek(e){
  2696. let newdate = new Date()
  2697. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  2698. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  2699. if(e){
  2700. this.WorktimeDatepickValue = nextwd
  2701. this.showMonthWorkTime()
  2702. }else{
  2703. this.WorktimeDatepickValue = nextwd
  2704. this.showMonthNotWorkTime()
  2705. }
  2706. },
  2707. alreadyAllDate(stime,etime){
  2708. let diffdate = new Array();
  2709. let i=0;
  2710. while(stime<=etime){
  2711. let dateArray = stime.split("-");
  2712. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2713. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  2714. let stimewk = this.weekDay[date.getDay()]
  2715. 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')
  2716. 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])
  2717. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  2718. let stime_ts = new Date(stime).getTime();
  2719. let next_date = stime_ts + (24*60*60*1000);
  2720. let next_dates_y = new Date(next_date).getFullYear()+'-';
  2721. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  2722. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  2723. stime = next_dates_y+next_dates_m+next_dates_d;
  2724. i++;
  2725. }
  2726. return diffdate
  2727. },
  2728. getAutoWeekDate(e) {
  2729. let dateString = e;
  2730. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  2731. if (dateString.match(dateStringReg)) {
  2732. let presentDate = new Date(dateString),
  2733. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  2734. return Array.from(new Array(7), function (val, index) {
  2735. let formatDate = new Date(
  2736. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  2737. );
  2738. return (
  2739. formatDate.getFullYear() +
  2740. "-" +
  2741. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  2742. "-" +
  2743. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  2744. );
  2745. });
  2746. } else {
  2747. throw new Error(
  2748. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  2749. );
  2750. }
  2751. },
  2752. onProgressChange() {
  2753. this.$forceUpdate();
  2754. },
  2755. showChooseMembTree() {
  2756. this.chosenMembCount = this.participator.length;
  2757. this.chooseParticipVisible = true;
  2758. },
  2759. onTreeItemChange() {
  2760. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2761. var list = chosenList.filter(item=>item.isUser == 1);
  2762. this.chosenMembCount = list.length;
  2763. },
  2764. findUserInTree() {
  2765. if (this.filterName == '') {
  2766. this.deptMembData = this.allMembData;
  2767. } else {
  2768. var list = this.findRecursively(this.filterName, this.allMembData);
  2769. this.deptMembData = list;
  2770. }
  2771. },
  2772. findRecursively(username, list) {
  2773. var filterList = [];
  2774. for (var i=0;i<list.length; i++) {
  2775. if (list[i].isUser == 1) {
  2776. if (list[i].label.indexOf(username) >= 0) {
  2777. //匹配上了
  2778. filterList.push(list[i]);
  2779. }
  2780. } else if (list[i].children != null && list[i].children.length > 0) {
  2781. var subList = this.findRecursively(username, list[i].children);
  2782. if (subList.length > 0) {
  2783. subList.forEach(s=>filterList.push(s));
  2784. }
  2785. }
  2786. }
  2787. return filterList;
  2788. },
  2789. //确定选择参与人
  2790. chooseParticip() {
  2791. this.chooseParticipVisible = false;
  2792. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2793. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2794. this.workForm.userNames = '';
  2795. this.workForm.userId = [];
  2796. this.participator = [];
  2797. for (var i=0;i<this.chosenMembList.length; i++) {
  2798. this.workForm.userId.push(this.chosenMembList[i].id);
  2799. this.workForm.userNames += this.chosenMembList[i].label+',';
  2800. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2801. this.participator.push(item);
  2802. }
  2803. if (this.workForm.userNames.length > 0) {
  2804. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  2805. }
  2806. if(this.user.userNameNeedTranslate == 1) {
  2807. if(this.workForm.userNames) {
  2808. this.workForm.userNames = this.workForm.userNames.split(',')
  2809. }
  2810. }
  2811. },
  2812. notifySel(sel){
  2813. // console.log(sel);
  2814. this.notifySelList = sel
  2815. },
  2816. //微信通知人员填写
  2817. Notify(code) {
  2818. if (this.notifySelList.length == 0) return;
  2819. var ids = '';
  2820. this.notifySelList.forEach(f=>{
  2821. ids += f.id+',';
  2822. })
  2823. this.http.post('/user/pushFillReport',{
  2824. ids: ids, date: this.curDate,
  2825. code: code
  2826. },
  2827. res => {
  2828. if (res.code == "ok") {
  2829. this.$message({
  2830. message: this.$t('message.sentSuccessfully'),
  2831. type: "success"
  2832. });
  2833. }
  2834. },
  2835. error => {
  2836. this.$message({
  2837. message: error,
  2838. type: "error"
  2839. });
  2840. }
  2841. );
  2842. },
  2843. //导出人员列表
  2844. exportMemb() {
  2845. if (this.fillMembList.length == 0) return;
  2846. var ids = '';
  2847. this.fillMembList.forEach(f=>{
  2848. ids += f.id+',';
  2849. })
  2850. this.http.post('/user/exportMembList',{
  2851. ids: ids,isFill: this.isFill, date: this.curDate
  2852. },
  2853. res => {
  2854. if (res.code == "ok") {
  2855. var aTag = document.createElement('a');
  2856. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  2857. aTag.href = res.data;
  2858. aTag.click();
  2859. }
  2860. },
  2861. error => {
  2862. this.$message({
  2863. message: error,
  2864. type: "error"
  2865. });
  2866. }
  2867. );
  2868. },
  2869. showMembList(fill) {
  2870. this.membListVisible = true;
  2871. if (fill == 0) {
  2872. this.fillMembList = this.unFillList;
  2873. this.isFill = false;
  2874. let leaveList = []
  2875. let unleaveList = []
  2876. for(let i in this.fillMembList){
  2877. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  2878. leaveList.push(this.fillMembList[i])
  2879. }else{
  2880. unleaveList.push(this.fillMembList[i])
  2881. }
  2882. }
  2883. this.fillMembList = unleaveList
  2884. this.fillMembList_leave = leaveList
  2885. } else if(fill == 1){
  2886. this.fillMembList = this.fillList.filter(item => item.state != 3);
  2887. this.isFill = true;
  2888. }else{
  2889. this.fillMembList = this.fillList.filter(item => item.state == 3);
  2890. this.isFill = true;
  2891. }
  2892. },
  2893. //获取自己填写的日报状态
  2894. getReportFillStatus() {
  2895. this.http.post('/report/getReportFillStatus',{
  2896. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2897. },
  2898. res => {
  2899. if (res.code == "ok") {
  2900. this.fillStatusList = res.data;
  2901. this.allDate.forEach(d=>{
  2902. var fillInfo = null;
  2903. d.state = null;
  2904. this.fillStatusList.forEach(s=>{
  2905. // console.log(d)
  2906. var d1 = s.createDate.split('-')[2];
  2907. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  2908. // console.log(d2, '我被执行了')
  2909. if (d1.indexOf('0') == 0) {
  2910. d1 = d1.substring(1,d1.length);
  2911. }
  2912. if (d1 == d2) {
  2913. d.state = s.state;
  2914. }
  2915. })
  2916. })
  2917. this.$forceUpdate();
  2918. }
  2919. },
  2920. error => {
  2921. this.$message({
  2922. message: error,
  2923. type: "error"
  2924. });
  2925. }
  2926. );
  2927. },
  2928. scrollFunction () {
  2929. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  2930. if (this.domObj.attachEvent) { // IE
  2931. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  2932. } else if (this.domObj.addEventListener) {
  2933. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  2934. }
  2935. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  2936. },
  2937. mouseScroll(event) { // google 浏览器下
  2938. let detail = event.wheelDelta || event.detail
  2939. let moveForwardStep = -1
  2940. let moveBackStep = 1
  2941. let step = 0
  2942. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  2943. event.preventDefault() // 阻止浏览器默认事件
  2944. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  2945. },
  2946. // //左右滚动
  2947. // wheel(e){
  2948. // var a = document.getElementById("dateScroll");
  2949. // var scroll_width = 80; //滚动一下的距离
  2950. // var e = e || window.event, v;
  2951. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  2952. // if(v>3||-v>3) v=-v;
  2953. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  2954. // e.preventDefault(); //阻止浏览器的默认滚动
  2955. // },
  2956. showExportDialog() {
  2957. this.exportDialog = true;
  2958. },
  2959. showExportTimeDialog() {
  2960. this.exportTimeDialog = true;
  2961. },
  2962. changeAllTime() {
  2963. //总时长发生改变,自动按比例计算
  2964. this.workForm.domains.forEach(d=>{
  2965. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2966. });
  2967. },
  2968. // 是否加班的单机事件
  2969. check() {
  2970. this.selected = !this.selected
  2971. this.isNew = this.selected
  2972. },
  2973. updateSubProject() {
  2974. this.$forceUpdate();
  2975. },
  2976. //项目选中了, 加载子项目
  2977. selectProject(domain, index) {
  2978. if(!domain.projectId){
  2979. return;
  2980. }
  2981. // console.log('projectId===',domain.projectId);
  2982. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  2983. this.http.post('/sub-project/list',{
  2984. projectId: domain.projectId
  2985. },
  2986. res => {
  2987. //清空之前选中的子项目
  2988. // this.workForm.domains[index].subProjectId = 0;
  2989. if (res.code == "ok") {
  2990. this.workForm.domains[index].subProjectList = res.data;
  2991. this.workForm.domains[index].subProjectId = null;
  2992. this.$forceUpdate();
  2993. }
  2994. },
  2995. error => {
  2996. this.$message({
  2997. message: error,
  2998. type: "error"
  2999. });
  3000. }
  3001. );
  3002. //项目相关的近期任务
  3003. if (this.user.company.packageProject == 1) {
  3004. this.http.post('/task/getRecentTask',{
  3005. projectId: domain.projectId,
  3006. isSubstitude:this.isSubstitude?1:0
  3007. },
  3008. res => {
  3009. if (res.code == "ok") {
  3010. this.workForm.domains[index].allTaskList = res.data;
  3011. this.workForm.domains[index].taskList = res.data;
  3012. this.$forceUpdate();
  3013. }
  3014. },
  3015. error => {
  3016. this.$message({
  3017. message: error,
  3018. type: "error"
  3019. });
  3020. }
  3021. );
  3022. }
  3023. //获取项目相关专业
  3024. if (this.user.company.packageEngineering == 1) {
  3025. this.getProjectProfessions(domain, index);
  3026. }
  3027. // 获取项目相关的维度
  3028. // domain.degreeId = null
  3029. this.$set(domain,'degreeId',null)
  3030. this.dimension(domain, index);
  3031. //获取项目下的任务分组
  3032. this.getTaskGroups(domain, index);
  3033. //获取项目审核人
  3034. if (this.user.timeType.reportAuditType == 0) {
  3035. this.getProjectAuditorList(domain, index);
  3036. } else {
  3037. //按分组的负责人来审核
  3038. domain.projectAuditorId = null;
  3039. domain.projectAuditorName = null;
  3040. domain.auditUserList = null;
  3041. }
  3042. },
  3043. //获取项目审核人
  3044. getProjectAuditorList(domainItem, index) {
  3045. if(domainItem.projectId == '') {
  3046. return
  3047. }
  3048. domainItem.projectAuditorId = null;
  3049. domainItem.projectAuditorName = null;
  3050. this.http.post('/project-auditor/getList',{
  3051. projectId: domainItem.projectId,
  3052. },
  3053. res => {
  3054. if (res.code == "ok") {
  3055. domainItem.auditUserList = res.data;
  3056. if (res.data.length==0) {
  3057. this.$message({
  3058. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  3059. type: "error"
  3060. });
  3061. } else if (res.data.length==1) {
  3062. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  3063. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  3064. }
  3065. this.$forceUpdate();
  3066. }
  3067. },
  3068. error => {
  3069. this.$message({
  3070. message: error,
  3071. type: "error"
  3072. });
  3073. }
  3074. );
  3075. },
  3076. // 获取维度数据
  3077. dimension(domain, index) {
  3078. if(domain.projectId == '') {
  3079. return
  3080. }
  3081. this.http.post('/project/getDegreeList',{
  3082. projectId: domain.projectId,
  3083. },
  3084. res => {
  3085. if (res.code == "ok") {
  3086. // console.log("维度数据",res.data);
  3087. this.workForm.domains[index].wuduList = res.data
  3088. // this.workForm = this.workForm
  3089. this.$forceUpdate()
  3090. }
  3091. },
  3092. error => {
  3093. this.$message({
  3094. message: error,
  3095. type: "error"
  3096. });
  3097. }
  3098. );
  3099. },
  3100. //切换任务阶段
  3101. changeStages(domain, index) {
  3102. if (domain.stage == null || domain.stage == '') {
  3103. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  3104. } else {
  3105. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  3106. }
  3107. this.$forceUpdate();
  3108. },
  3109. getGroupStages(domain, index, keepStage) {
  3110. // console.log(domain);
  3111. if(!domain.groupId){
  3112. domain.projectAuditorId = ''
  3113. domain.stages = []
  3114. if(this.user.timeType.reportAuditType >= 1){
  3115. domain.auditUserList = []
  3116. }
  3117. this.$forceUpdate();
  3118. return
  3119. }
  3120. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  3121. res => {
  3122. if (res.code == "ok") {
  3123. if (!keepStage) {
  3124. domain.stage = '';
  3125. }
  3126. domain.stages = res.data;
  3127. this.$forceUpdate();
  3128. }
  3129. },
  3130. error => {
  3131. this.$message({
  3132. message: error,
  3133. type: "error"
  3134. });
  3135. });
  3136. //检查当前的项目是否需要获取分组的负责人
  3137. if (this.user.timeType.reportAuditType >= 1 && this.user.timeType.reportAuditType != 3) {
  3138. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  3139. res => {
  3140. if (res.code == "ok") {
  3141. domain.getProjectAuditorList = res.data;
  3142. domain.auditUserList = res.data;
  3143. if (res.data.length==1) {
  3144. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  3145. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  3146. } else if (res.data.length==0) {
  3147. domain.projectAuditorId = null;
  3148. domain.projectAuditorName = null;
  3149. }
  3150. this.$forceUpdate();
  3151. }
  3152. },
  3153. error => {
  3154. this.$message({
  3155. message: error,
  3156. type: "error"
  3157. });
  3158. });
  3159. }
  3160. },
  3161. getProjectProfessions(domain, index) {
  3162. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  3163. res => {
  3164. if (res.code == "ok") {
  3165. this.workForm.domains[index].professionProgress = res.data;
  3166. this.$forceUpdate();
  3167. }
  3168. },
  3169. error => {
  3170. this.$message({
  3171. message: error,
  3172. type: "error"
  3173. });
  3174. });
  3175. },
  3176. //删除自己的日报
  3177. deleteReport() {
  3178. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3179. confirmButtonText: this.$t('btn.determine'),
  3180. cancelButtonText: this.$t('btn.cancel'),
  3181. type: "warning"
  3182. })
  3183. .then(() => {
  3184. this.listLoading = true;
  3185. this.http.post('/report/delete',{
  3186. userId: this.user.id,
  3187. date: this.workForm.createDate
  3188. },
  3189. res => {
  3190. this.listLoading = false;
  3191. if (res.code == "ok") {
  3192. this.$message({
  3193. message: this.$t('message.successfullyDeleted'),
  3194. type: "success"
  3195. });
  3196. this.getReportList();
  3197. this.getDepartment();
  3198. this.dialogVisible = false;
  3199. } else {
  3200. this.$message({
  3201. message: res.msg,
  3202. type: "error"
  3203. });
  3204. }
  3205. },
  3206. error => {
  3207. this.listLoading = false;
  3208. this.$message({
  3209. message: error,
  3210. type: "error"
  3211. });
  3212. }
  3213. );
  3214. })
  3215. .catch(() => {});
  3216. },
  3217. // 管理员删除日报
  3218. guanli(item) {
  3219. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3220. let param = {date: this.date + day, userId: item.id};
  3221. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3222. confirmButtonText: this.$t('btn.determine'),
  3223. cancelButtonText: this.$t('btn.cancel'),
  3224. type: "warning"
  3225. })
  3226. .then(() => {
  3227. this.listLoading = true;
  3228. this.http.post('/report/delete',param,
  3229. res => {
  3230. this.listLoading = false;
  3231. if (res.code == "ok") {
  3232. this.$message({
  3233. message: this.$t('message.successfullyDeleted'),
  3234. type: "success"
  3235. });
  3236. this.getReportList();
  3237. this.getDepartment();
  3238. this.dialogVisible = false;
  3239. } else {
  3240. this.$message({
  3241. message: res.msg,
  3242. type: "error"
  3243. });
  3244. }
  3245. },
  3246. error => {
  3247. this.listLoading = false;
  3248. this.$message({
  3249. message: error,
  3250. type: "error"
  3251. });
  3252. }
  3253. );
  3254. })
  3255. .catch(() => {});
  3256. },
  3257. //提交批量审核数据
  3258. submitBatchApprove() {
  3259. var data = this.$refs.approveTree.getCheckedNodes();
  3260. var ids = '';
  3261. if (data.length == 0) {
  3262. this.$message({
  3263. message: this.$t('message.Pleaseselectthepersontoreview'),
  3264. type: "error"
  3265. });
  3266. return;
  3267. }
  3268. for (var i=0;i<data.length; i++) {
  3269. ids += data[i].id;
  3270. if (i < data.length-1) {
  3271. ids += ',';
  3272. }
  3273. }
  3274. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3275. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  3276. res => {
  3277. if (res.code == "ok") {
  3278. this.$message({
  3279. message: this.$t('message.Reviewsucceeded'),
  3280. type: "success"
  3281. });
  3282. this.getReportList();
  3283. this.getDepartment();
  3284. this.approveDialogVisible = false;
  3285. } else {
  3286. this.$message({
  3287. message: res.msg,
  3288. type: "error"
  3289. });
  3290. }
  3291. },
  3292. error => {
  3293. this.$message({
  3294. message: error,
  3295. type: "error"
  3296. });
  3297. });
  3298. },
  3299. selectAll() {
  3300. if (this.isAllSelect) {
  3301. var keys = [];
  3302. this.reportNames.forEach(b=>{
  3303. keys.push(b.id);
  3304. })
  3305. this.$refs.approveTree.setCheckedKeys(keys);
  3306. } else {
  3307. this.$refs.approveTree.setCheckedKeys([]);
  3308. }
  3309. },
  3310. //批量审核
  3311. batchApprove() {
  3312. this.approveDialogVisible = true;
  3313. this.reportNames = [];
  3314. for (var i=0;i<this.reportList.length; i++) {
  3315. var report = this.reportList[i];
  3316. var hasUnChecked =false;
  3317. var id = '';
  3318. for (var j=0;j<report.data.length; j++) {
  3319. if (report.data[j].state == 0
  3320. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  3321. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  3322. hasUnChecked = true;
  3323. id += report.data[j].id+',';
  3324. }
  3325. }
  3326. if (hasUnChecked) {
  3327. this.reportNames.push({id:id, label: report.name});
  3328. }
  3329. }
  3330. },
  3331. removeEmptyNode(list) {
  3332. for (var i=0;i<list.length;i++) {
  3333. var cnt = 0;
  3334. if (list[i].membCount == 0) {
  3335. list.splice(i, 1);
  3336. i--;
  3337. } else if (list[i].children != null) {
  3338. this.removeEmptyNode(list[i].children);
  3339. }
  3340. }
  3341. },
  3342. calculateMembCount(list) {
  3343. for (var i in list) {
  3344. var cnt = 0;
  3345. if (list[i].children != null) {
  3346. this.calculateMembCount(list[i].children);
  3347. for (var m in list[i].children) {
  3348. cnt += list[i].children[m].membCount;
  3349. }
  3350. }
  3351. if (list[i].isUser == 1) {
  3352. cnt++;
  3353. this.membCount++;
  3354. }
  3355. list[i].membCount = cnt;
  3356. }
  3357. },
  3358. stateChange() {
  3359. console.log(this.allData,'alldate');
  3360. this.membCount = 0;
  3361. if (this.selectState == -1) {
  3362. //全部状态
  3363. this.data = this.allData;
  3364. } else {
  3365. //未填报
  3366. this.seluserText = ''
  3367. var newData = JSON.parse(JSON.stringify(this.allData));
  3368. this.filterState(this.selectState, newData);
  3369. this.data = newData;
  3370. }
  3371. this.calculateMembCount(this.data);
  3372. this.data[0].membCount = this.membCount;//总人数
  3373. },
  3374. //按状态过滤部门人员
  3375. filterState(state, list) {
  3376. for (var i =0;i<list.length; i++) {
  3377. var obj = list[i];
  3378. if (obj.isUser == 1) {
  3379. var match = false;
  3380. if (state == -2) {
  3381. if (obj.state == null) {
  3382. match = true;
  3383. }
  3384. } else {
  3385. if (obj.state == state) {
  3386. match = true;
  3387. }
  3388. }
  3389. if (!match) {
  3390. list.splice(i, 1);
  3391. i--;
  3392. } else {
  3393. }
  3394. } else {
  3395. if (obj.children != null) {
  3396. this.filterState(state, obj.children);
  3397. }
  3398. }
  3399. }
  3400. },
  3401. //a按名称过滤部门人员
  3402. seluserforText(){
  3403. this.membCount = 0;
  3404. var newData = JSON.parse(JSON.stringify(this.allData));
  3405. this.seluserforTextin(this.seluserText, newData)
  3406. this.data = newData;
  3407. this.calculateMembCount(this.data);
  3408. this.data[0].membCount = this.membCount;//总人数
  3409. },
  3410. seluserforTextin(text, list){
  3411. for (var i =0;i<list.length; i++) {
  3412. var obj = list[i];
  3413. if (obj.isUser == 1) {
  3414. var match = false;
  3415. if (obj.label.indexOf(text) != -1) {
  3416. match = true
  3417. }
  3418. if (!match) {
  3419. list.splice(i, 1);
  3420. i--;
  3421. } else {
  3422. }
  3423. } else {
  3424. if (obj.children != null) {
  3425. this.seluserforTextin(text, obj.children);
  3426. }
  3427. }
  3428. }
  3429. },
  3430. // 部门列表点击
  3431. handleNodeClick(data) {
  3432. // this.dealList = data
  3433. this.theValues(data.id, this.allData)
  3434. // this.depData = data;
  3435. var list = [];
  3436. if (data.id == -1) {
  3437. this.deptId = null;
  3438. this.targetUid = null;
  3439. list = this.data;
  3440. } else if (data.isUser == 1) {
  3441. this.deptId = null;
  3442. this.targetUid = data.id;
  3443. } else {
  3444. this.deptId = data.id;
  3445. this.targetUid = null;
  3446. list.push(data);
  3447. }
  3448. this.getReportList();
  3449. if (list.length > 0) {
  3450. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  3451. this.fillList = this.getUserMembListFromDeptList(list, 1)
  3452. }
  3453. },
  3454. theValues(id, item) {
  3455. for(var i in item) {
  3456. if(item[i].id == id) {
  3457. this.depData = item[i]
  3458. if(id == '-1') {
  3459. this.translation = '1'
  3460. } else {
  3461. if(item[i].children) {
  3462. this.translation = '2'
  3463. } else {
  3464. this.translation = '3'
  3465. }
  3466. }
  3467. return
  3468. } else {
  3469. if(item[i].children) {
  3470. this.theValues(id, item[i].children)
  3471. }
  3472. }
  3473. }
  3474. },
  3475. //获取可以选择的代填的人员列表
  3476. getSubstitudeUserDeptList() {
  3477. if (this.deptMembData.length == 0) {
  3478. this.http.post("/department/listMyMembs", {},
  3479. res => {
  3480. if (res.code == "ok") {
  3481. let noAllData = JSON.parse(JSON.stringify(res.data));
  3482. if (noAllData.length > 0) {
  3483. // if (noAllData[0].label == '全部人员') {
  3484. if (noAllData[0].label == this.$t('lable.allStaff')) {
  3485. noAllData.splice(0,1);
  3486. }
  3487. }
  3488. this.setUserToDept(noAllData);
  3489. this.deptMembData = noAllData;
  3490. } else {
  3491. this.$message({
  3492. message: res.msg,
  3493. type: "error"
  3494. });
  3495. }
  3496. },
  3497. error => {
  3498. this.$message({
  3499. message: error,
  3500. type: "error"
  3501. });
  3502. });
  3503. }
  3504. },
  3505. // 获取部门列表
  3506. getDepartment() {
  3507. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3508. var param = {date:this.date + day};
  3509. this.http.post("/report/getMembList", param,
  3510. res => {
  3511. if (res.code == "ok") {
  3512. if(res.data.length == 0){
  3513. // this.$message({
  3514. // message: '请联系管理员设置负责部门',
  3515. // type: 'error'
  3516. // })
  3517. return
  3518. }
  3519. this.departmentList = JSON.parse(JSON.stringify(res.data))
  3520. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  3521. // let noAllData = JSON.parse(JSON.stringify(res.data));
  3522. // if (this.user.role > 0) {
  3523. // }
  3524. list.splice(0,0,{
  3525. id: -1,
  3526. label: this.$t('lable.allStaff'),
  3527. })
  3528. this.membCount = 0;
  3529. //设置员工到部门下面
  3530. this.setUserToDept(list);
  3531. this.data = list;
  3532. // console.log('data',this.data);
  3533. this.expandDate = [this.data[1].id]
  3534. this.allData = list;
  3535. // if (noAllData.length > 0) {
  3536. // if (noAllData[0].label == '全部人员') {
  3537. // noAllData.splice(0,1);
  3538. // }
  3539. // }
  3540. // this.setUserToDept(noAllData);
  3541. // this.deptMembData = noAllData;
  3542. this.option = this.changeArr(list1);
  3543. list[0].membCount = this.membCount;
  3544. if (this.depData.id == -1) {
  3545. this.depData.membCount = this.membCount;
  3546. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  3547. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  3548. } else {
  3549. if (this.depData.isUser == null) {
  3550. var dep = this.findTargetDept(this.data, this.depData.id);
  3551. var membDeptList = [];
  3552. membDeptList.push(dep);
  3553. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  3554. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  3555. }
  3556. }
  3557. if (this.depData.isUser == null) {
  3558. if (this.isFill) {
  3559. this.fillMembList = this.fillList;
  3560. } else {
  3561. this.fillMembList = this.unFillList;
  3562. }
  3563. }
  3564. this.leaveAllNum = 0
  3565. for(let i in this.unFillList){
  3566. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  3567. this.leaveAllNum += 1
  3568. }
  3569. }
  3570. this.stateChange()
  3571. } else {
  3572. this.$message({
  3573. message: res.msg,
  3574. type: "error"
  3575. });
  3576. }
  3577. },
  3578. error => {
  3579. this.$message({
  3580. message: error,
  3581. type: "error"
  3582. });
  3583. });
  3584. this.getReportFillStatus();
  3585. },
  3586. findTargetDept(list, deptId) {
  3587. var t = null;
  3588. for (var i=0;i<list.length; i++) {
  3589. if (list[i].isUser == null && list[i].id == deptId) {
  3590. t = list[i];
  3591. break;
  3592. }
  3593. }
  3594. if (t == null) {
  3595. for (var i=0;i<list.length; i++) {
  3596. if (list[i].children != null && list[i].children.length > 0) {
  3597. t = this.findTargetDept(list[i].children, deptId);
  3598. if (t != null) {
  3599. break;
  3600. }
  3601. }
  3602. }
  3603. }
  3604. return t;
  3605. },
  3606. getUserMembListFromDeptList(list, isFill) {
  3607. var membList = [];
  3608. for (var i in list) {
  3609. var deptName = list[i].label;
  3610. if (list[i].userList != null) {
  3611. list[i].userList.forEach(element => {
  3612. if (isFill == 0) {
  3613. //获取未填的
  3614. if (element.state == null) {
  3615. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  3616. membList.push(obj);
  3617. }
  3618. } else {
  3619. if (element.state != null) {
  3620. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  3621. membList.push(obj);
  3622. }
  3623. }
  3624. });
  3625. }
  3626. if (list[i].children != null) {
  3627. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  3628. }
  3629. }
  3630. return membList;
  3631. },
  3632. setUserToDept(list) {
  3633. for (var i in list) {
  3634. var cnt = 0;
  3635. if (list[i].children != null) {
  3636. this.setUserToDept(list[i].children);
  3637. for (var m in list[i].children) {
  3638. cnt += list[i].children[m].membCount;
  3639. }
  3640. }
  3641. if (list[i].userList != null) {
  3642. if (list[i].children == null) {
  3643. list[i].children = [];
  3644. }
  3645. list[i].userList.forEach(element => {
  3646. var obj = {
  3647. id: element.id,
  3648. label:element.name,
  3649. state:element.state,
  3650. parentId:element.departmentId,
  3651. isUser:1,
  3652. workingTime: element.workingTime,
  3653. leaveDays: element.leaveDays,
  3654. leaveTimes: element.leaveTimes
  3655. };
  3656. list[i].children.push(obj);
  3657. this.membCount++;
  3658. cnt++;
  3659. });
  3660. }
  3661. list[i].membCount = cnt;
  3662. }
  3663. },
  3664. // 修改数组
  3665. changeArr(arr) {
  3666. for (var i = 0; i < arr.length; i++) {
  3667. if(arr[i].id != -1 && arr[i].id != 0) {
  3668. if (arr[i].children != null && arr[i].children.length>0) {
  3669. arr[i].children = this.changeArr(arr[i].children);
  3670. }
  3671. arr[i].id && (arr[i].value = arr[i].id);
  3672. delete arr[i].id;
  3673. }
  3674. }
  3675. for(var i in arr) {
  3676. if(arr[i].id == -1 || arr[i].id == 0) {
  3677. arr.splice(i,1)
  3678. }
  3679. }
  3680. return arr;
  3681. },
  3682. //时间段范围设置改动,监听
  3683. onTimeTypeChange(timeType) {
  3684. this.seleChn(1)
  3685. this.showAddMore = true;
  3686. for(var i in this.workForm.domains) {
  3687. if (this.workForm.domains[i].timeType == 0) {
  3688. this.showAddMore = false;
  3689. break;
  3690. }
  3691. }
  3692. if (this.showAddMore) {
  3693. //检测数量
  3694. if (this.workForm.domains.length == 2) {
  3695. this.showAddMore = false;
  3696. } else {
  3697. this.showAddMore = true;
  3698. }
  3699. }
  3700. },
  3701. getTimeType() {
  3702. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  3703. res => {
  3704. if (res.code == "ok") {
  3705. var t = res.data;
  3706. this.reportTimeType = t;
  3707. if (this.reportTimeType.type > 0) {
  3708. this.showAddMore = true;
  3709. }
  3710. //转化时间格式
  3711. if (t.allday != null) {
  3712. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  3713. }
  3714. if (t.am != null) {
  3715. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  3716. }
  3717. if (t.pm != null) {
  3718. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  3719. }
  3720. } else {
  3721. this.$message({
  3722. message: res.msg,
  3723. type: "error"
  3724. });
  3725. }
  3726. },
  3727. error => {
  3728. this.listLoading = false;
  3729. this.$message({
  3730. message: error,
  3731. type: "error"
  3732. });
  3733. });
  3734. },
  3735. // 改变月份 -------
  3736. changeMonthOut() {
  3737. this.getAllDate();
  3738. this.getReportList();
  3739. this.getDepartment();
  3740. },
  3741. // 选择日期
  3742. choseDate(i, item) {
  3743. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  3744. return
  3745. }
  3746. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  3747. this.choseDay = i;
  3748. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3749. sessionStorage.msg = this.date + day,
  3750. this.getReportList();
  3751. this.getDepartment();
  3752. this.curDate = item.date;
  3753. },
  3754. canClick(i, item){
  3755. let nowDate = new Date()
  3756. let nowDateYear = nowDate.getFullYear()
  3757. let itemYear = parseInt(this.date.split('-')[0])
  3758. let nowDateMonth = nowDate.getMonth() + 1
  3759. let itemMonth = parseInt(this.date.split('-')[1])
  3760. let nowDateDay = nowDate.getDate()
  3761. let itemDay = parseInt(item.showDate.split('.')[1])
  3762. if(nowDateYear < itemYear){
  3763. return false
  3764. }else if(nowDateYear == itemYear){
  3765. if(nowDateMonth < itemMonth){
  3766. return false
  3767. }else if(nowDateMonth == itemMonth){
  3768. if(nowDateDay < itemDay){
  3769. return false
  3770. }
  3771. }
  3772. }
  3773. },
  3774. // 获取日期列表
  3775. getAllDate(e) {
  3776. var dayArry = [];
  3777. var day = this.getCountDays();
  3778. let curMonthDay = null;
  3779. for (var k = 1; k <= day; k++) {
  3780. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  3781. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  3782. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  3783. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  3784. if(sessionStorage.msg) {
  3785. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  3786. this.choseDay = k - 1;
  3787. curMonthDay = str;
  3788. }
  3789. } else {
  3790. if (new Date().getDate() == k) {
  3791. this.choseDay = k - 1;
  3792. }
  3793. }
  3794. } else {
  3795. this.choseDay = 0;
  3796. }
  3797. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  3798. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  3799. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  3800. }
  3801. this.allDate = dayArry;
  3802. //不能超过最大日期
  3803. if (this.choseDay > day-1) {
  3804. this.choseDay = day-1;
  3805. }
  3806. if(sessionStorage.from != 1){
  3807. let nowmonth = new Date().getMonth() + 1
  3808. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  3809. let nowdate = new Date().getDate()
  3810. if(nowd == this.date){
  3811. if(e && sessionStorage.msg){
  3812. }else{
  3813. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  3814. }
  3815. let nowday = new Date(sessionStorage.msg).getDate()
  3816. this.choseDay = nowday - 1
  3817. let monthdate = new Date(sessionStorage.msg)
  3818. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3819. }else{
  3820. if(e && sessionStorage.msg){
  3821. }else{
  3822. sessionStorage.msg = this.date + '-01'
  3823. }
  3824. let monthdate = new Date(sessionStorage.msg)
  3825. this.choseDay = monthdate.getDate() - 1
  3826. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3827. console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  3828. }
  3829. }else{
  3830. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  3831. }
  3832. //从消息点击跳转过来的,直接加载指定日期
  3833. if (sessionStorage.from == 1 && sessionStorage.msg) {
  3834. this.curDate = sessionStorage.msg;
  3835. sessionStorage.from = 0;
  3836. } else {
  3837. // if (curMonthDay != null) {
  3838. // // this.curDate = curMonthDay;
  3839. // let d = new Date(sessionStorage.msg)
  3840. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3841. // } else {
  3842. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  3843. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3844. // }
  3845. }
  3846. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  3847. // if(!sessionStorage.msg){
  3848. // let msgday = this.choseDay + 1
  3849. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  3850. // }
  3851. this.getReportFillStatus();
  3852. },
  3853. getCountDays() {
  3854. var newstr = this.date.replace(/-/g, "/");
  3855. var curDate = new Date(newstr+'/01');
  3856. var curMonth = curDate.getMonth();
  3857. curDate.setMonth(curMonth + 1);
  3858. curDate.setDate(0);
  3859. return curDate.getDate();
  3860. },
  3861. //获取日报列表
  3862. getReportList() {
  3863. this.listLoading = true;
  3864. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3865. let param = {date: this.date + day};
  3866. if (this.deptId) {
  3867. param.deptId = this.deptId;
  3868. }
  3869. if (this.targetUid) {
  3870. param.userId = this.targetUid;
  3871. }
  3872. this.http.post( this.port.report.list, param,
  3873. res => {
  3874. this.listLoading = false;
  3875. if (res.code == "ok") {
  3876. this.reportList = res.data;
  3877. if(document.querySelector("#day"+this.choseDay)){
  3878. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  3879. }
  3880. } else {
  3881. this.$message({
  3882. message: res.msg,
  3883. type: "error"
  3884. });
  3885. }
  3886. },
  3887. error => {
  3888. this.listLoading = false;
  3889. this.$message({
  3890. message: error,
  3891. type: "error"
  3892. });
  3893. });
  3894. },
  3895. // 处理数据
  3896. // dealWith() {
  3897. // var tianxie = 0
  3898. // var weixtianxie = 0
  3899. // if(this.selectState == -1) {
  3900. // } else {
  3901. // var arr = []
  3902. // for (var i in this.reportList) {
  3903. // arr.push(this.reportList[i].id)
  3904. // }
  3905. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  3906. // }
  3907. // },
  3908. // getDealWith(item, tx, wtx, arr) {
  3909. // for(var i in item) {
  3910. // if(item[i].children) {
  3911. // this.getDealWith(item[i].children, tx, wtx, arr)
  3912. // } else {
  3913. // if(arr.indexOf(item[i].id) != '-1') {
  3914. // tx = +tx + 1
  3915. // }
  3916. // }
  3917. // }
  3918. // },
  3919. //导出员工工时统计
  3920. exportUserTime() {
  3921. this.listLoading = true;
  3922. var param = {};
  3923. if (this.exportParam.dateRange != null) {
  3924. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3925. }
  3926. this.http.post('/department/exportDeptStatistic', param,
  3927. res => {
  3928. this.listLoading = false;
  3929. if (res.code == "ok") {
  3930. location.href = res.data;
  3931. this.exportTimeDialog = false;
  3932. } else {
  3933. this.$message({
  3934. message: res.msg,
  3935. type: "error"
  3936. });
  3937. }
  3938. },
  3939. error => {
  3940. this.listLoading = false;
  3941. this.$message({
  3942. message: error,
  3943. type: "error"
  3944. });
  3945. });
  3946. },
  3947. //导出日报
  3948. exportReport() {
  3949. this.listLoading = true;
  3950. var param = {};
  3951. if (this.exportParam.dateRange != null) {
  3952. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3953. }
  3954. if (this.exportParam.projectId != null) {
  3955. param.projectId = this.exportParam.projectId;
  3956. }
  3957. if (this.exportParam.departmentId != null) {
  3958. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  3959. }
  3960. param.stateKey = this.stateKey
  3961. // param.departmentId = this.user.departmentId
  3962. this.http.post( this.port.report.export, param,
  3963. res => {
  3964. this.listLoading = false;
  3965. if (res.code == "ok") {
  3966. location.href = res.data;
  3967. this.exportDialog = false;
  3968. } else {
  3969. this.$message({
  3970. message: res.msg,
  3971. type: "error"
  3972. });
  3973. }
  3974. },
  3975. error => {
  3976. this.listLoading = false;
  3977. this.$message({
  3978. message: error,
  3979. type: "error"
  3980. });
  3981. });
  3982. },
  3983. //获取项目列表
  3984. getProjectList() {
  3985. this.listLoading = true;
  3986. this.http.post( this.port.project.list, {},
  3987. res => {
  3988. this.listLoading = false;
  3989. if (res.code == "ok") {
  3990. for(var i in res.data) {
  3991. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3992. res.data[i].projectCode = ''
  3993. }
  3994. }
  3995. this.projectList = res.data;
  3996. // console.log("项目列表",this.projectList);
  3997. } else {
  3998. this.$message({
  3999. message: res.msg,
  4000. type: "error"
  4001. });
  4002. }
  4003. },
  4004. error => {
  4005. this.listLoading = false;
  4006. this.$message({
  4007. message: error,
  4008. type: "error"
  4009. });
  4010. });
  4011. },
  4012. // 获取填报日报的项目下拉列表
  4013. getFillProjectList() {
  4014. this.http.post( this.port.project.list, {
  4015. forReport: 1
  4016. },res => {
  4017. if (res.code == "ok") {
  4018. for(var i in res.data) {
  4019. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  4020. res.data[i].projectCode = ''
  4021. }
  4022. }
  4023. this.fillProjectList = res.data;
  4024. } else {
  4025. this.$message({
  4026. message: res.msg,
  4027. type: "error"
  4028. });
  4029. }
  4030. },
  4031. error => {
  4032. this.$message({
  4033. message: error,
  4034. type: "error"
  4035. });
  4036. });
  4037. },
  4038. getBasecostItemList() {
  4039. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4040. companyId: this.user.companyId
  4041. },
  4042. res => {
  4043. if (res.code == "ok") {
  4044. this.timeBasecostList = res.data;
  4045. }
  4046. });
  4047. },
  4048. // 获取个人某天的日报 111111
  4049. getReport() {
  4050. this.http.post( this.port.report.getPort, {
  4051. date: this.workForm.createDate
  4052. },
  4053. res => {
  4054. if (res.code == "ok") {
  4055. var quanbu = 0
  4056. this.jsDay = 1
  4057. var zhi = ''
  4058. var slp = res.data.report
  4059. for(var i in slp) {
  4060. var sp = +slp[i].workingTime + 0
  4061. zhi = this.jsDay * sp
  4062. quanbu = +quanbu + zhi
  4063. }
  4064. this.jsTime = quanbu
  4065. var list = res.data;
  4066. this.report = list;
  4067. this.reportTimeType = this.report.timeType;
  4068. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  4069. this.isWeekend = !this.report.isWorkDay;
  4070. this.canCancelInDialog = false
  4071. if(list.report.length != 0) {
  4072. var arr = [];
  4073. this.canEdit = false;
  4074. let candelete = true
  4075. for(var i in list.report) {
  4076. var flg = null
  4077. list.report[i].isOvertime == 1 ? flg = true : flg = false
  4078. arr.push({
  4079. id: list.report[i].id,
  4080. projectId: list.report[i].projectId,
  4081. workingTime: list.report[i].workingTime,
  4082. content: list.report[i].content,
  4083. state: list.report[i].state,
  4084. timeType: list.report[i].timeType,
  4085. subProjectList: list.report[i].subProjectList,
  4086. taskList: list.report[i].taskList,
  4087. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  4088. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  4089. taskId: list.report[i].taskId,
  4090. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  4091. startTime: list.report[i].startTime,
  4092. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  4093. endTime: list.report[i].endTime,
  4094. isOvertime: flg,
  4095. progress:list.report[i].progress,
  4096. professionProgress: list.report[i].professionProgressList,
  4097. stages:list.report[i].stages,
  4098. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  4099. pics: list.report[i].pics,
  4100. multiWorktime: list.report[i].multiWorktime,
  4101. worktimeList: list.report[i].worktimeList,
  4102. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  4103. wuduList: list.report[i].degreeList,
  4104. taskGroups:list.report[i].taskGroups,
  4105. customData: list.report[i].customData,//自定义的数值
  4106. auditUserList: list.report[i].auditUserList,
  4107. projectAuditorId: list.report[i].projectAuditorId,
  4108. projectAuditorName: list.report[i].projectAuditorName,
  4109. overtimeHours: list.report[i].overtimeHours,
  4110. customText: list.report[i].customText,
  4111. basecostId: list.report[i].basecostId,
  4112. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  4113. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  4114. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  4115. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  4116. canEdit: list.report[i].state >= 2 ? true : false
  4117. })
  4118. if (list.report[i].state >= 2) {
  4119. this.canEdit = true;
  4120. }
  4121. if(list.report[i].state < 2){
  4122. candelete = false
  4123. }
  4124. if (list.report[i].state == 0){
  4125. this.canCancelInDialog = true
  4126. }
  4127. }
  4128. this.reportCanDelete = candelete
  4129. this.workForm = {
  4130. createDate: this.workForm.createDate,
  4131. domains: arr,
  4132. userNames:null,
  4133. userId:null,
  4134. time: list.time
  4135. }
  4136. } else {
  4137. this.workForm = {
  4138. createDate: this.workForm.createDate,
  4139. domains: [{
  4140. id: null,
  4141. projectId: "",
  4142. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4143. content: "",
  4144. progress:100,
  4145. state: 2,
  4146. timeType:0,
  4147. multiWorktime: this.reportTimeType.multiWorktime,
  4148. worktimeList:[{}],
  4149. canEdit: true,
  4150. auditorFirst: '',
  4151. auditorSec: '',
  4152. auditorThird: '',
  4153. ccUserid: ''
  4154. }],
  4155. userId:null,
  4156. userNames:null,
  4157. time: this.report.time
  4158. }
  4159. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  4160. this.$set(this.workForm.domains[0],'isOvertime',true)
  4161. if(this.reportTimeType.type != 2){
  4162. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  4163. }
  4164. }
  4165. if(this.user.timeType.type == 1) {
  4166. var shuzhi = this.user.timeType.allday + ''
  4167. // console.log('执行一次', shuzhi.indexOf('.'))
  4168. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4169. }
  4170. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4171. //默认给第一个,必填字段
  4172. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4173. }
  4174. this.canEdit = true;
  4175. }
  4176. } else {
  4177. this.$message({
  4178. message: res.msg,
  4179. type: "error"
  4180. });
  4181. }
  4182. },
  4183. error => {
  4184. this.$message({
  4185. message: error,
  4186. type: "error"
  4187. });
  4188. });
  4189. },
  4190. guanbi() {
  4191. this.falsss = false
  4192. },
  4193. // 打开日报填写
  4194. fillInReport(i, isBatch) {
  4195. this.isWeekend = false
  4196. this.reportCanDelete = false
  4197. // console.log(this.user.timeType.type, '选择时长')
  4198. if(i != 1) {
  4199. this.falsss = false
  4200. } else {
  4201. this.falsss = true
  4202. }
  4203. if (this.isSubstitude) {
  4204. this.getSubstitudeUserDeptList();
  4205. }
  4206. if(i == -1 || this.isSubstitude) {
  4207. this.isDisable = false;
  4208. } else {
  4209. this.isDisable = true;
  4210. }
  4211. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4212. this.isBatch = isBatch;
  4213. if (this.isBatch == 0 && !this.isSubstitude) {
  4214. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  4215. let weekday = new Date(this.workForm.createDate).getDay()
  4216. if(this.user.companyId == 817){
  4217. if(weekday == 0){
  4218. this.isWeekend = true
  4219. }
  4220. }else{
  4221. if(weekday == 0 || weekday == 6){
  4222. this.isWeekend = true
  4223. }
  4224. }
  4225. this.getReport(i);
  4226. } else {
  4227. // console.log('执行到了这里')
  4228. this.jsTime = 0
  4229. this.jsDay = 0
  4230. this.workForm = {
  4231. createDate: null,//批量填报没有日期
  4232. domains: [{
  4233. id: null,
  4234. projectId: "",
  4235. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4236. content: "",
  4237. progress:100,
  4238. state: 2,
  4239. timeType:0,
  4240. multiWorktime: this.reportTimeType.multiWorktime,
  4241. worktimeList:[{}],
  4242. canEdit: true
  4243. }],
  4244. }
  4245. if(this.user.timeType.type == 1) {
  4246. var shuzhi = this.user.timeType.allday + ''
  4247. // console.log('执行二次')
  4248. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4249. }
  4250. // console.log(this.workForm)
  4251. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  4252. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4253. }
  4254. this.canEdit = true;
  4255. }
  4256. this.dialogVisible = true;
  4257. },
  4258. // 按周填报里内容的填写
  4259. tianxies(item, i, names, row) {
  4260. var idd = ''
  4261. var obj = {}
  4262. for(var l in this.projectList) {
  4263. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  4264. }
  4265. obj.projectId = idd
  4266. this.selectProject(obj, 0)
  4267. // console.log(this.workForm.domains[0], '打印出来的')
  4268. this.tianxieDialogVisible = true
  4269. this.scopess = item
  4270. var sss = {}
  4271. sss.projectId = idd;
  4272. sss.con = item.con
  4273. sss.progress = item.progress
  4274. sss.time = item.time
  4275. sss.groupId = item.groupId
  4276. sss.stage = item.stage;
  4277. sss.workingTime = item.workingTime
  4278. sss.projectAuditorId = item.projectAuditorId;
  4279. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4280. //默认选中第一个
  4281. sss.basecostId = this.timeBasecostList[0].id;
  4282. }
  4283. var that = this
  4284. setTimeout(() =>{
  4285. var isFirstEdit = false;
  4286. if(Object.keys(item).length < 5) {
  4287. //首次点开当前的这个cell,初始化数据
  4288. isFirstEdit = true;
  4289. sss.subProjectId = that.workForm.domains[0].subProjectId
  4290. sss.stage = that.workForm.domains[0].stage
  4291. sss.subProjectList = that.workForm.domains[0].subProjectList
  4292. sss.stages = that.workForm.domains[0].stages
  4293. sss.taskGroups = that.workForm.domains[0].taskGroups;
  4294. sss.auditUserList = obj.auditUserList;
  4295. } else {
  4296. sss.subProjectId = item.subProjectId
  4297. sss.stage = item.stage
  4298. sss.subProjectList = item.subProjectList
  4299. sss.stages = item.stages
  4300. sss.taskGroups = item.taskGroups;
  4301. sss.auditUserList = obj.auditUserList;
  4302. sss.degreeId = item.degreeId;
  4303. sss.customData = item.customData;
  4304. }
  4305. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  4306. //只有一个审核人,自动设置上去
  4307. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  4308. }
  4309. sss.wuduList = row[0].wuduList
  4310. // console.log(sss, '数据')
  4311. that.zhoBaoIdx = i
  4312. that.zhoBaoName = names
  4313. that.zhoBao = sss
  4314. that.zhis = row
  4315. if (sss.groupId) {
  4316. //最后一个参数表示是否保留stage的值,不要重置为空
  4317. this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
  4318. }
  4319. that.$forceUpdate();
  4320. },600);
  4321. },
  4322. // 按周填报里内容的填写点击确定
  4323. btnTianxiaes() {
  4324. if (!this.zhoBao.projectAuditorId && this.user.timeType.reportAuditType != 3) {
  4325. this.$message({
  4326. message: this.$t('message.Pleaseselectareviewer'),
  4327. type: "error"
  4328. });
  4329. return
  4330. }
  4331. if(this.user.timeType.reportAuditType == 3){
  4332. let auditTips = ''
  4333. if(!this.zhoBao.auditorFirst){ auditTips += '第一、' }
  4334. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  4335. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  4336. if(auditTips){
  4337. auditTips = auditTips.substring(0,auditTips.length - 1)
  4338. this.$message({
  4339. message: '请选择' + auditTips + '审核人',
  4340. type: 'warning'
  4341. })
  4342. return
  4343. }
  4344. }
  4345. let errtips = ''
  4346. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  4347. errtips += this.user.timeType.customDegreeName + '、'
  4348. }
  4349. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  4350. errtips += this.user.timeType.customDataName + '、'
  4351. }
  4352. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  4353. errtips += this.user.timeType.customTextName + '、'
  4354. }
  4355. if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
  4356. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  4357. }
  4358. if(errtips){
  4359. errtips = errtips.substring(0,errtips.length - 1)
  4360. this.$message({
  4361. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  4362. type: 'warning'
  4363. })
  4364. return
  4365. }
  4366. this.tianxieDialogVisible = false
  4367. var zhong = this.zhoData
  4368. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  4369. this.zhoData = zhong
  4370. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  4371. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  4372. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  4373. },
  4374. // 获取本周
  4375. getCurrentWeek() {
  4376. const currentDate = new Date()
  4377. const week = currentDate.getDay()
  4378. const millisecond = 1000 * 60 * 60 * 24
  4379. const minusDay = week != 0 ? week - 1 : 4
  4380. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  4381. var stat = this.dealdate(monday)
  4382. var end
  4383. if(this.user.timeType.fillAhead == 1){
  4384. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4385. const endDate = new Date(currentDate.getTime() + endDay * millisecond)
  4386. end = this.dealdate(endDate)
  4387. }else{
  4388. end = this.dealdate(currentDate)
  4389. }
  4390. this.zhoRqi = [stat, end]
  4391. // console.log('date',currentDate,this.zhoRqi);
  4392. this.zhoRqis()
  4393. // this.jiazai()
  4394. },
  4395. // 获取上周
  4396. handleGetPrevWeek() {
  4397. const Time = new Date(this.zhoRqi[0])
  4398. let weekNum = Time.getDay()
  4399. weekNum = weekNum == 0 ? 7 : weekNum
  4400. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  4401. let fitstDate = new Date(
  4402. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  4403. )
  4404. let startDate = `${fitstDate.getFullYear()}-${
  4405. fitstDate.getMonth() + 1 < 10
  4406. ? '0' + (fitstDate.getMonth() + 1)
  4407. : fitstDate.getMonth() + 1
  4408. }-${
  4409. fitstDate.getDate() < 10
  4410. ? '0' + fitstDate.getDate()
  4411. : fitstDate.getDate()
  4412. }`
  4413. let endDate = `${lastDate.getFullYear()}-${
  4414. lastDate.getMonth() + 1 < 10
  4415. ? '0' + (lastDate.getMonth() + 1)
  4416. : lastDate.getMonth() + 1
  4417. }-${
  4418. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4419. }`
  4420. var stat = this.dealdate(startDate)
  4421. var ends = this.dealdate(endDate)
  4422. var end = this.dateChange(-2, ends)
  4423. this.zhoRqi = [stat, end]
  4424. this.zhoRqis()
  4425. // this.jiazai()
  4426. },
  4427. // 获取下周
  4428. handleGetNextvWeek() {
  4429. const Time = new Date(this.zhoRqi[1])
  4430. let weekNum = Time.getDay()
  4431. weekNum = weekNum == 0 ? 7 : weekNum
  4432. let fitstDate = new Date(
  4433. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  4434. )
  4435. let lastDate = new Date(
  4436. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  4437. )
  4438. let startDate = `${fitstDate.getFullYear()}-${
  4439. fitstDate.getMonth() + 1 < 10
  4440. ? '0' + (fitstDate.getMonth() + 1)
  4441. : fitstDate.getMonth() + 1
  4442. }-${
  4443. fitstDate.getDate() < 10
  4444. ? '0' + fitstDate.getDate()
  4445. : fitstDate.getDate()
  4446. }`
  4447. let endDate = `${lastDate.getFullYear()}-${
  4448. lastDate.getMonth() + 1 < 10
  4449. ? '0' + (lastDate.getMonth() + 1)
  4450. : lastDate.getMonth() + 1
  4451. }-${
  4452. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4453. }`
  4454. var stat = this.dealdate(startDate)
  4455. var ends = this.dealdate(endDate)
  4456. var end = this.dateChange(-2, ends)
  4457. this.zhoRqi = [stat, end]
  4458. this.zhoRqis()
  4459. // this.jiazai()
  4460. },
  4461. // 新增日期
  4462. newDates() {
  4463. // console.log(this.zhoRqi, '看卡')
  4464. let edate = new Date(this.zhoRqi[1])
  4465. let nowdate = new Date()
  4466. let nowdate2
  4467. if(this.user.timeType.fillAhead == 1){
  4468. let week = nowdate.getDay()
  4469. const endDay = week > 5 ? 0 : 5 - week
  4470. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4471. nowdate2 = this.dealdate(endDate)
  4472. }else{
  4473. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4474. }
  4475. if(edate >= nowdate2){
  4476. return
  4477. }
  4478. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  4479. var obj = {}
  4480. obj.zhoDataTime = this.zhoRqi[1]
  4481. obj.he = 0
  4482. for(var j in this.projectList) {
  4483. var xinzhi = this.projectList[j].projectName
  4484. obj[xinzhi] = {}
  4485. obj[xinzhi].time = ''
  4486. obj[xinzhi].con = ''
  4487. obj[xinzhi].progress = 0
  4488. obj[xinzhi].workingTime = 0
  4489. }
  4490. this.zhoData.push(obj)
  4491. if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
  4492. this.getWeeklyCardTime();
  4493. }
  4494. this.getWeeklyWorkTime();
  4495. },
  4496. // 减去时间
  4497. dateChange(num = 1,date = false) {
  4498.   if (!date) {
  4499.     date = new Date();//没有传入值时,默认是当前日期
  4500.     date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  4501.   }
  4502.   date += " 00:00:00";//设置为当天凌晨12点
  4503.   date = Date.parse(new Date(date))/1000;//转换为时间戳
  4504.   date += (86400) * num;//修改后的时间戳
  4505.   var newDate = new Date(parseInt(date) * 1000);//转换为时间
  4506. var nian = newDate.getFullYear()
  4507. var yue = ''
  4508. var ri = ''
  4509. var yues = (newDate.getMonth() + 1)
  4510. var ris = newDate.getDate()
  4511. yues > 9 ? yue = yues : yue = '0' + yues
  4512. ris > 9 ? ri = ris : ri = '0' + ris
  4513. return nian +'-'+yue+'-'+ri
  4514. },
  4515. // 加载动画
  4516. jiazai() {
  4517. this.zhoLoading = true
  4518. var that = this
  4519. setTimeout(() =>{
  4520. that.zhoLoading = false
  4521. },1000);
  4522. },
  4523. // 转时间格式
  4524. dealdate(date) {
  4525. const dt = new Date(date)
  4526. const y = dt.getFullYear()
  4527. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  4528. const d = (dt.getDate() + '').padStart(2, '0')
  4529. return `${y}-${m}-${d}`
  4530. },
  4531. // 按周填报
  4532. fillInReportss() {
  4533. window.addEventListener('scroll', this.handleScroll, true)
  4534. // this.jiazai()
  4535. this.diasZho = true
  4536. this.getCurrentWeek()
  4537. // 项目数量判断 <=5
  4538. if(this.projectList.length < 5){
  4539. this.selProjectList = this.projectList
  4540. this.selConShow = false
  4541. }
  4542. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  4543. //重新获取工时预警类型的预算项
  4544. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4545. companyId: this.user.companyId
  4546. },
  4547. res => {
  4548. if (res.code == "ok") {
  4549. this.timeBasecostList = res.data;
  4550. }
  4551. });
  4552. }
  4553. },
  4554. // 按周填报的项目筛选
  4555. selListFun(){
  4556. this.selProjectList = []
  4557. if(this.selCon.length){
  4558. for (let i = 0; i < this.selCon.length; i++) {
  4559. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  4560. }
  4561. this.selConShow = false
  4562. }else{
  4563. this.$message({
  4564. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  4565. type:'error'
  4566. })
  4567. }
  4568. },
  4569. getWeeklyCardTime(){ //按周填报获取考勤信息
  4570. let dateStr = []
  4571. for(let i in this.zhoData){
  4572. dateStr.push(this.zhoData[i].zhoDataTime)
  4573. }
  4574. this.http.post('/report/getWeeklyCardTime',{
  4575. dateStr: JSON.stringify(dateStr)
  4576. },res => {
  4577. if(res.code == 'ok'){
  4578. for(let i in res.data){
  4579. let datei = '';
  4580. if (this.user.timeType.showDdCardtime == 1) {
  4581. datei = res.data[i].workDate.split('-');
  4582. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  4583. datei = res.data[i].createDate.split('-');
  4584. }
  4585. for(let m in this.zhoData){
  4586. let datem = new Date(this.zhoData[m].zhoDataTime)
  4587. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4588. let item = {
  4589. startTime: res.data[i].startTime,
  4590. endTime: res.data[i].endTime,
  4591. workHours: res.data[i].workHours
  4592. }
  4593. this.$set(this.zhoData[m],'corpTime',item)
  4594. }
  4595. }
  4596. }
  4597. }else{
  4598. this.$message({
  4599. message: res.msg,
  4600. type: 'error'
  4601. })
  4602. }
  4603. },err => {
  4604. this.$message({
  4605. message: err,
  4606. type: 'error'
  4607. })
  4608. })
  4609. },
  4610. getWeeklyWorkTime(){ //按周填报获取已填工时
  4611. let dateStr = []
  4612. for(let i in this.zhoData){
  4613. dateStr.push(this.zhoData[i].zhoDataTime)
  4614. }
  4615. this.http.post('/report/getWeeklyWorkTime',{
  4616. dateStr: JSON.stringify(dateStr)
  4617. },res => {
  4618. if(res.code == 'ok'){
  4619. for(let n in this.zhoData){
  4620. delete this.zhoData[n].filledTime
  4621. }
  4622. for(let i in res.data){
  4623. let datei = res.data[i].createDate.split('-');
  4624. for(let m in this.zhoData){
  4625. let datem = new Date(this.zhoData[m].zhoDataTime)
  4626. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4627. this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
  4628. let reportTimes = [];
  4629. if (res.data[i].startTime != null) {
  4630. reportTimes = res.data[i].startTime.split(',')
  4631. }
  4632. this.$set(this.zhoData[m],'reportTimes',reportTimes)
  4633. }
  4634. }
  4635. }
  4636. // console.log('zhodata',this.zhoData);
  4637. }else{
  4638. this.$message({
  4639. message: res.msg,
  4640. type: 'error'
  4641. })
  4642. }
  4643. },err => {
  4644. this.$message({
  4645. message: err,
  4646. type: 'error'
  4647. })
  4648. })
  4649. },
  4650. selListqx(){
  4651. this.diasZho = false
  4652. this.selProjectList = []
  4653. this.selCon = []
  4654. },
  4655. handleScroll() {
  4656. this.changdu = this.projectList.length + 1
  4657. },
  4658. // 自动选择时间点的事件
  4659. zhoTimes(item, i, ims, event) {
  4660. var iss = i
  4661. if(item.time == null) {
  4662. return
  4663. } else {
  4664. var zhi = this.zhoData[iss]
  4665. var he = 0
  4666. for(var i in zhi) {
  4667. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  4668. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  4669. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  4670. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  4671. var leave1=date3%(24*3600*1000)
  4672. var hours=Math.floor(leave1/(3600*1000))
  4673. var leave2=leave1%(3600*1000)
  4674. var minutes=Math.floor(leave2/(60*1000))
  4675. var shi = hours+'.'+ minutes
  4676. he += +shi
  4677. }
  4678. }
  4679. zhi.he = he + 'h'
  4680. }
  4681. },
  4682. // 自动选择事件长度的事件
  4683. zhoXuan(item, i) {
  4684. var iss = i
  4685. if(item.time == null) {
  4686. return
  4687. } else {
  4688. var zhi = this.zhoData[iss]
  4689. var he = 0
  4690. for(var i in zhi) {
  4691. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4692. he += +zhi[i].workingTime
  4693. }
  4694. }
  4695. zhi.he = he + 'h'
  4696. }
  4697. },
  4698. // 按时间比例
  4699. addBli(item, i) {
  4700. var iss = i
  4701. if(item.time == null) {
  4702. return
  4703. } else {
  4704. var zhi = this.zhoData[iss]
  4705. var he = 0
  4706. for(var i in zhi) {
  4707. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4708. he += +zhi[i].workingTime
  4709. }
  4710. }
  4711. zhi.he = he.toFixed(1) + 'h'
  4712. }
  4713. },
  4714. zhoRqis() {
  4715. let nowdate = new Date()
  4716. let nowdate2
  4717. if(this.user.timeType.fillAhead == 1){
  4718. const millisecond = 1000 * 60 * 60 * 24
  4719. let week = nowdate.getDay()
  4720. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4721. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4722. nowdate2 = this.dealdate(endDate)
  4723. }else{
  4724. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4725. }
  4726. let edate = new Date(this.zhoRqi[1])
  4727. if(edate >= nowdate2){
  4728. let emon = nowdate2.getMonth() + 1
  4729. let eday = nowdate2.getDate()
  4730. let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
  4731. this.zhoRqi[1] = edate2
  4732. }
  4733. this.zhoData = []
  4734. if(this.zhoRqi) {
  4735. var stime = this.zhoRqi[0]
  4736. var etime = this.zhoRqi[1]
  4737. var zhi = this.getdiffdate(stime, etime)
  4738. var arrst = []
  4739. for(var i in zhi) {
  4740. var obj = {}
  4741. obj.zhoDataTime = zhi[i]
  4742. obj.he = 0
  4743. for(var j in this.projectList) {
  4744. var xinzhi = this.projectList[j].projectName
  4745. obj[xinzhi] = {}
  4746. obj[xinzhi].time = ''
  4747. obj[xinzhi].con = ''
  4748. obj[xinzhi].progress = 0
  4749. obj[xinzhi].workingTime = 0
  4750. }
  4751. arrst.push(obj)
  4752. }
  4753. this.zhoData = arrst
  4754. }
  4755. if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
  4756. this.getWeeklyCardTime()
  4757. // this.getWeeklyFilledTime()
  4758. }
  4759. if (this.zhoData.length) {
  4760. this.getWeeklyWorkTime();
  4761. }
  4762. },
  4763. zhoZhi(res, i) {
  4764. var zhi = 0
  4765. for(var i in res) {
  4766. if(i != 'zhoDataTime' && i != 'he') {
  4767. zhi += +res[i]
  4768. }
  4769. }
  4770. res.he = zhi
  4771. },
  4772. zhoBtn(i) {
  4773. // this.zhoData.split(i, 1)
  4774. var arr = this.zhoData
  4775. arr.splice(i, 1)
  4776. },
  4777. zhoAddlast(){
  4778. this.selConShow = true
  4779. },
  4780. zhoAddqx(){
  4781. this.diasZho = false
  4782. this.selConShow = true
  4783. this.selProjectList = []
  4784. this.selCon = []
  4785. },
  4786. // 提交按周填报
  4787. zhoAdd() {
  4788. var zhi = this.zhoData
  4789. var ll = 0
  4790. if(this.reportTimeType.type == 2) {
  4791. for(var i in zhi) {
  4792. this.dateAr = []
  4793. var alp = []
  4794. var zhis = zhi[i]
  4795. for(var j in zhis) {
  4796. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  4797. let objs = {}
  4798. objs.s = zhis[j].time[0]
  4799. objs.e = zhis[j].time[1]
  4800. alp.push(objs)
  4801. }
  4802. }
  4803. if(zhis.reportTimes){
  4804. for(let k in zhis.reportTimes){
  4805. let objs = {}
  4806. objs.s = zhis.reportTimes[k].split('-')[0]
  4807. objs.e = zhis.reportTimes[k].split('-')[1]
  4808. alp.push(objs)
  4809. }
  4810. }
  4811. this.dateAr = alp
  4812. if(this.dateAr.length > 0) {
  4813. let trus = this.fns()
  4814. ll += 1
  4815. if(!trus) {
  4816. this.$message({
  4817. message: this.$t('message.Filledtimeperiodsoverlap'),
  4818. type: 'error'
  4819. })
  4820. return false
  4821. }
  4822. }
  4823. }
  4824. if(ll == 0) {
  4825. this.$message({
  4826. message: this.$t('message.Pleasefillinthetime'),
  4827. type: 'error'
  4828. })
  4829. return false
  4830. }
  4831. } else if(this.reportTimeType.type == 1){
  4832. for(var i in zhi) {
  4833. var zhis = zhi[i]
  4834. for(var j in zhis) {
  4835. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  4836. ll += 1
  4837. }
  4838. }
  4839. }
  4840. if(ll == 0) {
  4841. this.$message({
  4842. message: this.$t('message.Pleaseselectatime'),
  4843. type: 'error'
  4844. })
  4845. return false
  4846. }
  4847. let overcorp = ''
  4848. for(let n in zhi){
  4849. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  4850. overcorp += zhi[n].zhoDataTime + ','
  4851. }
  4852. }
  4853. if(overcorp != ''){
  4854. overcorp = overcorp.substring(0,overcorp.length - 1)
  4855. this.$message({
  4856. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  4857. type: 'error'
  4858. })
  4859. return
  4860. }
  4861. }
  4862. var submits = []
  4863. let formData = new FormData();
  4864. if(this.reportTimeType.multiWorktime == 1){
  4865. for (var i in this.zhoData) {
  4866. var zhoD = this.zhoData[i]
  4867. var flgs = false
  4868. for(var j in zhoD) {
  4869. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4870. flgs = true
  4871. // formData.append("degreeId", "-1");
  4872. formData.append("id", '-1');
  4873. for(var s in this.projectList) {
  4874. if(j == this.projectList[s].projectName) {
  4875. formData.append("projectId", this.projectList[s].id);
  4876. }
  4877. }
  4878. if(this.user.timeType.reportAuditType == 3){
  4879. let audItem = {}
  4880. if(this.user.timeType.auditLevel > 0){
  4881. audItem.auditorFirst = zhoD[j].auditorFirst
  4882. }
  4883. if(this.user.timeType.auditLevel > 1){
  4884. audItem.auditorSec = zhoD[j].auditorSec
  4885. }
  4886. if(this.user.timeType.auditLevel > 2){
  4887. audItem.auditorThird = zhoD[j].auditorThird
  4888. }
  4889. if(zhoD[j].ccUserid){
  4890. audItem.ccUserid = zhoD[j].ccUserid
  4891. }
  4892. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4893. }
  4894. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4895. formData.append("taskId", 0);
  4896. formData.append("reportTimeType", this.reportTimeType.type);
  4897. formData.append("endTime", '');
  4898. formData.append("startTime", '');
  4899. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4900. var lix = []
  4901. var objjs = {}
  4902. objjs.startTime = zhoD[j].time[0]
  4903. objjs.endTime = zhoD[j].time[1]
  4904. if (zhoD[j].con == null || zhoD[j].con == '') {
  4905. zhoD[j].con == '-'
  4906. }
  4907. objjs.content = zhoD[j].con
  4908. lix.push(objjs)
  4909. var zhiZhi = JSON.stringify(lix)
  4910. zhiZhi = zhiZhi.replace(/,/g,"@");
  4911. formData.append("content", zhiZhi)
  4912. formData.append("isOvertime", 0)
  4913. formData.append("professionProgress", "[]")
  4914. if (zhoD[j].groupId) {
  4915. formData.append("groupId",zhoD[j].groupId)
  4916. } else {
  4917. //解决后台groupId数组越界的问题
  4918. formData.append("groupId",0)
  4919. }
  4920. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4921. formData.append("createDate",zhoD.zhoDataTime)
  4922. if (zhoD[j].projectAuditorId) {
  4923. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4924. }
  4925. if(zhoD[j].basecostId) {
  4926. formData.append("basecostId", zhoD[j].basecostId);
  4927. } else {
  4928. formData.append("basecostId", 0);
  4929. }
  4930. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4931. formData.append('degreeId',zhoD[j].degreeId)
  4932. }else{
  4933. formData.append("degreeId", "-1");
  4934. }
  4935. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4936. formData.append('customData',zhoD[j].customData)
  4937. }else if(this.user.timeType.customDataActive){
  4938. formData.append('customData',0)
  4939. }
  4940. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4941. formData.append('customText',zhoD[j].customText)
  4942. }else if(this.user.timeType.customTextActive){
  4943. formData.append('customText','-')
  4944. }
  4945. }
  4946. }
  4947. }
  4948. } else {
  4949. for (var i in this.zhoData) {
  4950. var zhoD = this.zhoData[i]
  4951. var flgs = false
  4952. if(this.reportTimeType.type == 2) {
  4953. for(var j in zhoD) {
  4954. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4955. flgs = true
  4956. // formData.append("degreeId", "-1");
  4957. formData.append("id", '-1');
  4958. for(var s in this.projectList) {
  4959. if(j == this.projectList[s].projectName) {
  4960. formData.append("projectId", this.projectList[s].id);
  4961. }
  4962. }
  4963. if(this.user.timeType.reportAuditType == 3){
  4964. let audItem = {}
  4965. if(this.user.timeType.auditLevel > 0){
  4966. audItem.auditorFirst = zhoD[j].auditorFirst
  4967. }
  4968. if(this.user.timeType.auditLevel > 1){
  4969. audItem.auditorSec = zhoD[j].auditorSec
  4970. }
  4971. if(this.user.timeType.auditLevel > 2){
  4972. audItem.auditorThird = zhoD[j].auditorThird
  4973. }
  4974. if(zhoD[j].ccUserid){
  4975. audItem.ccUserid = zhoD[j].ccUserid
  4976. }
  4977. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4978. }
  4979. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4980. formData.append("taskId", 0);
  4981. formData.append("reportTimeType", this.reportTimeType.type);
  4982. formData.append("endTime", zhoD[j].time[1]);
  4983. formData.append("startTime", zhoD[j].time[0]);
  4984. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4985. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4986. formData.append("isOvertime", 0)
  4987. formData.append("professionProgress", "[]")
  4988. if (zhoD[j].groupId) {
  4989. formData.append("groupId",zhoD[j].groupId)
  4990. }
  4991. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4992. formData.append("createDate",zhoD.zhoDataTime)
  4993. if (zhoD[j].projectAuditorId) {
  4994. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4995. }
  4996. if(zhoD[j].basecostId) {
  4997. formData.append("basecostId", zhoD[j].basecostId);
  4998. } else {
  4999. formData.append("basecostId", 0);
  5000. }
  5001. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  5002. formData.append('degreeId',zhoD[j].degreeId)
  5003. }else{
  5004. formData.append("degreeId", "-1");
  5005. }
  5006. if(this.user.timeType.customDataActive && zhoD[j].customData){
  5007. formData.append('customData',zhoD[j].customData)
  5008. }else if(this.user.timeType.customDataActive){
  5009. formData.append('customData',0)
  5010. }
  5011. if(this.user.timeType.customTextActive && zhoD[j].customText){
  5012. formData.append('customText',zhoD[j].customText)
  5013. }else if(this.user.timeType.customTextActive){
  5014. formData.append('customText','-')
  5015. }
  5016. }
  5017. }
  5018. } else {
  5019. for(var j in zhoD) {
  5020. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].workingTime && zhoD[j].workingTime.length > 0 && zhoD[j].workingTime > 0 && zhoD[j].workingTime != null && zhoD[j].workingTime != 'null') {
  5021. flgs = true
  5022. // formData.append("degreeId", "-1");
  5023. formData.append("id", '-1');
  5024. for(var s in this.projectList) {
  5025. if(j == this.projectList[s].projectName) {
  5026. formData.append("projectId", this.projectList[s].id);
  5027. }
  5028. }
  5029. if(this.user.timeType.reportAuditType == 3){
  5030. let audItem = {}
  5031. if(this.user.timeType.auditLevel > 0){
  5032. audItem.auditorFirst = zhoD[j].auditorFirst
  5033. }
  5034. if(this.user.timeType.auditLevel > 1){
  5035. audItem.auditorSec = zhoD[j].auditorSec
  5036. }
  5037. if(this.user.timeType.auditLevel > 2){
  5038. audItem.auditorThird = zhoD[j].auditorThird
  5039. }
  5040. if(zhoD[j].ccUserid){
  5041. audItem.ccUserid = zhoD[j].ccUserid
  5042. }
  5043. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5044. }
  5045. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  5046. // formData.append("subProjectId", zhoD[j].subProjectId);
  5047. formData.append("taskId", 0);
  5048. formData.append("reportTimeType", this.reportTimeType.type);
  5049. if(this.reportTimeType.type == 1) {
  5050. formData.append("workingTime", zhoD[j].workingTime);
  5051. } else if(this.reportTimeType.type == 2) {
  5052. formData.append("endTime", zhoD[j].time[1]);
  5053. formData.append("startTime", zhoD[j].time[0]);
  5054. } else if(this.reportTimeType.type == 3) {
  5055. formData.append("progress", zhoD[j].progress);
  5056. formData.append("workingTime", zhoD[j].workingTime);
  5057. }
  5058. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  5059. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  5060. formData.append("isOvertime", 0)
  5061. formData.append("professionProgress", "[]")
  5062. if (zhoD[j].groupId) {
  5063. formData.append("groupId",zhoD[j].groupId)
  5064. }
  5065. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  5066. formData.append("createDate",zhoD.zhoDataTime)
  5067. if (zhoD[j].projectAuditorId) {
  5068. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  5069. }
  5070. if(zhoD[j].basecostId) {
  5071. formData.append("basecostId", zhoD[j].basecostId);
  5072. } else {
  5073. formData.append("basecostId", 0);
  5074. }
  5075. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  5076. formData.append('degreeId',zhoD[j].degreeId)
  5077. }else{
  5078. formData.append("degreeId", "-1");
  5079. }
  5080. if(this.user.timeType.customDataActive && zhoD[j].customData){
  5081. formData.append('customData',zhoD[j].customData)
  5082. }else if(this.user.timeType.customDataActive){
  5083. formData.append('customData',0)
  5084. }
  5085. if(this.user.timeType.customTextActive && zhoD[j].customText){
  5086. formData.append('customText',zhoD[j].customText)
  5087. }else if(this.user.timeType.customTextActive){
  5088. formData.append('customText','-')
  5089. }
  5090. }
  5091. }
  5092. }
  5093. }
  5094. }
  5095. // 自定义维度
  5096. this.submitingReport = true;
  5097. this.http.uploadFile( this.port.report.editPort, formData,
  5098. res => {
  5099. // this.listLoading = false;
  5100. this.submitingReport = false;
  5101. if (res.code == "ok") {
  5102. this.$message({
  5103. message: this.$t('message.fillinsuccessfully'),
  5104. type: "success"
  5105. });
  5106. this.diasZho = false
  5107. this.selConShow = true
  5108. this.zhoData = []
  5109. this.zhoRqi = ''
  5110. this.getReportList();
  5111. this.getDepartment();
  5112. // 关闭弹窗 并 清空
  5113. this.selProjectList = []
  5114. this.selCon = []
  5115. } else {
  5116. this.$message({
  5117. message: res.msg,
  5118. type: "error"
  5119. });
  5120. }
  5121. },
  5122. error => {
  5123. this.submitingReport = false;
  5124. this.$message({
  5125. message: error,
  5126. type: "error"
  5127. });
  5128. });
  5129. },
  5130. ChangeHourMinutestr (str) {
  5131. if (str !== "0" && str !== "" && str !== null) {
  5132. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  5133. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  5134. } else {
  5135. return "";
  5136. }
  5137. },
  5138. // 得到两个日期中间的日期
  5139. getdiffdate(stime,etime){
  5140. //初始化日期列表,数组
  5141. var diffdate = new Array();
  5142. var i=0;
  5143. //开始日期小于等于结束日期,并循环
  5144. while(stime<=etime){
  5145. diffdate[i] = stime;
  5146. //获取开始日期时间戳
  5147. var stime_ts = new Date(stime).getTime();
  5148. //增加一天时间戳后的日期
  5149. var next_date = stime_ts + (24*60*60*1000);
  5150. //拼接年月日,这里的月份会返回(0-11),所以要+1
  5151. var next_dates_y = new Date(next_date).getFullYear()+'-';
  5152. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  5153. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  5154. stime = next_dates_y+next_dates_m+next_dates_d;
  5155. //增加数组key
  5156. i++;
  5157. }
  5158. return diffdate;
  5159. },
  5160. // 添加模块
  5161. addDomain(i) {
  5162. var leftProgress = 10;
  5163. if (this.reportTimeType.type == 3) {
  5164. //计算已经待分配工时比例
  5165. let array = this.workForm.domains;
  5166. let totalProgress = 0;
  5167. for (var i=0;i<array.length; i++) {
  5168. totalProgress += array[i].progress;
  5169. }
  5170. if (totalProgress < 100) {
  5171. leftProgress = 100 - totalProgress;
  5172. }
  5173. }
  5174. var addItem = {
  5175. projectId: "",
  5176. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  5177. content: "",
  5178. progress:leftProgress,
  5179. state:2,//2-表示待提交
  5180. multiWorktime: this.reportTimeType.multiWorktime,
  5181. worktimeList:[{}],
  5182. canEdit: true,
  5183. auditorFirst: '',
  5184. auditorSec: '',
  5185. auditorThird: '',
  5186. ccUserid: ''
  5187. // degreeId: '',
  5188. };
  5189. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5190. this.$set(addItem,'isOvertime',true)
  5191. if(this.reportTimeType.type == 3){
  5192. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  5193. }
  5194. }
  5195. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5196. //默认给第一个,必填字段
  5197. addItem.basecostId = this.timeBasecostList[0].id;
  5198. }
  5199. this.workForm.domains.push(addItem);
  5200. document.getElementById('workFormsItemBottom').scrollIntoView()
  5201. this.canEdit = true
  5202. if (this.reportTimeType.type == 0) {
  5203. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  5204. var length = this.workForm.domains.length;
  5205. if (length == 2) {
  5206. this.showAddMore = false;
  5207. }
  5208. }
  5209. this.chuji()
  5210. },
  5211. // 移除模块
  5212. delDomain(i) {
  5213. this.workForm.domains.splice(i,1)
  5214. let iscan = false
  5215. for(let i in this.workForm.domains){
  5216. if(this.workForm.domains[i].canEdit){
  5217. iscan = true
  5218. }
  5219. }
  5220. this.canEdit = iscan
  5221. //检测当前剩下的一个,时间类型是否是全天
  5222. if (this.reportTimeType.type == 0) {
  5223. if (this.workForm.domains[0].timeType == 0) {
  5224. this.showAddMore = false;
  5225. } else {
  5226. this.showAddMore = true;
  5227. }
  5228. }
  5229. if(this.user.timeType.multiWorktime == 1) {
  5230. this.iptChangs()
  5231. } else {
  5232. this.seleChn(0)
  5233. }
  5234. },
  5235. // 改变月份
  5236. changeMonth() {
  5237. this.isWeekend = false
  5238. let date = new Date()
  5239. let nowmon = date.getMonth() + 1
  5240. let nowday = date.getDate()
  5241. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  5242. if (this.isBatch == 0) {
  5243. if(this.user.timeType.fillAhead == 0){
  5244. let date_a = new Date(this.workForm.createDate)
  5245. if(date_a.getTime() > date.getTime()){
  5246. this.workForm.createDate = nowdate
  5247. }
  5248. }
  5249. //只有按天填报才能获取当天的日报
  5250. if(!this.isSubstitude){
  5251. let weekday = new Date(this.workForm.createDate).getDay()
  5252. if(this.user.companyId == 817){
  5253. if(weekday == 0){
  5254. this.isWeekend = true
  5255. }
  5256. }else{
  5257. if(weekday == 0 || weekday == 6){
  5258. this.isWeekend = true
  5259. }
  5260. }
  5261. this.getReport()
  5262. }
  5263. }else {
  5264. if(this.user.timeType.fillAhead == 0){
  5265. let date_a = new Date(this.workForm.createDate[1])
  5266. if(date_a.getTime() > date.getTime()){
  5267. this.workForm.createDate[1] = nowdate
  5268. let sdate = new Date(this.workForm.createDate[0])
  5269. let edate = new Date(this.workForm.createDate[1])
  5270. if(sdate > edate){
  5271. this.workForm.createDate[0] = this.workForm.createDate[1]
  5272. }
  5273. }
  5274. }
  5275. }
  5276. },
  5277. // 判断时间段
  5278. fns() {
  5279. for (let k in this.dateAr) {
  5280. if (!this.judege(k)) {
  5281. return false
  5282. }
  5283. }
  5284. return true
  5285. },
  5286. judege(idx){
  5287. for (let k in this.dateAr) {
  5288. if (idx !== k) {
  5289. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  5290. return false
  5291. }
  5292. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  5293. return false
  5294. }
  5295. }
  5296. }
  5297. return true
  5298. },
  5299. // 保存日报111111
  5300. submitReport(isDraft) {
  5301. this.isDraft = isDraft;
  5302. this.$refs.workForm.validate(valid => {
  5303. if (valid) {
  5304. this.dateAr = []
  5305. let alp = []
  5306. if(this.user.timeType.multiWorktime != 1) {
  5307. for(var p in this.workForm.domains) {
  5308. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  5309. let objs = {}
  5310. objs.s = this.workForm.domains[p].startTime
  5311. objs.e = this.workForm.domains[p].endTime
  5312. alp.push(objs)
  5313. }
  5314. }
  5315. this.dateAr = alp
  5316. if(this.dateAr.length > 0) {
  5317. let trus = this.fns()
  5318. if(!trus) {
  5319. this.$message({
  5320. message: this.$t('message.Filledtimeperiodsoverlap'),
  5321. type: "error"
  5322. });
  5323. return
  5324. }
  5325. }
  5326. } else {
  5327. for(var p in this.workForm.domains) {
  5328. var slll = this.workForm.domains[p]
  5329. for(var o in slll.worktimeList) {
  5330. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  5331. let objs = {}
  5332. objs.s = slll.worktimeList[o].startTime
  5333. objs.e = slll.worktimeList[o].endTime
  5334. alp.push(objs)
  5335. }
  5336. }
  5337. }
  5338. this.dateAr = alp
  5339. if(this.dateAr.length > 0) {
  5340. let trus = this.fns()
  5341. if(!trus) {
  5342. this.$message({
  5343. message: this.$t('message.Filledtimeperiodsoverlap'),
  5344. type: "error"
  5345. });
  5346. return
  5347. }
  5348. }
  5349. }
  5350. // return
  5351. //代填的情况,检查人员是否已经选择
  5352. if (this.isSubstitude) {
  5353. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  5354. this.$message({
  5355. message: this.$t('message.pleaseselectthepersontofillin'),
  5356. type: "error"
  5357. });
  5358. return;
  5359. }
  5360. }
  5361. //检查时间,全天和上下午不能同时存在
  5362. if (this.reportTimeType.type == 0) {
  5363. var alldayNum = 0;
  5364. var amNum = 0;
  5365. var pmNum = 0;
  5366. for(var i in this.workForm.domains) {
  5367. if (this.workForm.domains[i].timeType == 0) {
  5368. alldayNum ++;
  5369. } else if (this.workForm.domains[i].timeType == 1) {
  5370. amNum++;
  5371. } else if (this.workForm.domains[i].timeType == 2) {
  5372. pmNum++;
  5373. }
  5374. }
  5375. if (alldayNum > 1) {
  5376. this.$message({
  5377. // message: "工作时间-全天,只能选择一次",
  5378. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  5379. type: "error"
  5380. });
  5381. return;
  5382. }
  5383. if (amNum > 1) {
  5384. this.$message({
  5385. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  5386. type: "error"
  5387. });
  5388. return;
  5389. }
  5390. if (pmNum > 1) {
  5391. this.$message({
  5392. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  5393. type: "error"
  5394. });
  5395. return;
  5396. }
  5397. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  5398. this.$message({
  5399. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  5400. type: "error"
  5401. });
  5402. return;
  5403. }
  5404. } else if (this.reportTimeType.type == 3) {
  5405. //总百分比不能超过100%
  5406. let total = 0;
  5407. this.workForm.domains.forEach(w=>{total += w.progress});
  5408. if (total > 100) {
  5409. this.$message({
  5410. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  5411. type: "error"
  5412. });
  5413. return;
  5414. } else if (total < 100) {
  5415. this.$message({
  5416. message: this.$t('message.cannotbesubmitted'),
  5417. type: "error"
  5418. });
  5419. return;
  5420. }
  5421. }
  5422. this.listLoading = true;
  5423. let formData = new FormData();
  5424. formData.append("draft", this.isDraft);
  5425. var totalTime = 0;
  5426. for (var t=0;t<this.workForm.domains.length; t++) {
  5427. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  5428. }
  5429. if(this.workForm.time){
  5430. if (this.workForm.time.workHours == 0 && this.user.timeType.notAllowedNoAttendance == 1){
  5431. this.$message({
  5432. message: '无考勤记录不可填报',
  5433. type: 'error'
  5434. })
  5435. return
  5436. }
  5437. }
  5438. if (this.reportTimeType.type == 1 && this.workForm.time) {
  5439. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  5440. this.$message({
  5441. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  5442. type: "error"
  5443. });
  5444. return;
  5445. }
  5446. }
  5447. for(var i in this.workForm.domains) {
  5448. if(this.user.timeType.reportAuditType == 3){
  5449. let audItem = {}
  5450. let auditRule = ''
  5451. if(this.workForm.domains[i].id){
  5452. audItem.reportId = this.workForm.domains[i].id
  5453. }
  5454. if(this.user.timeType.auditLevel > 0){
  5455. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第一、' }
  5456. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  5457. }
  5458. if(this.user.timeType.auditLevel > 1){
  5459. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  5460. audItem.auditorSec = this.workForm.domains[i].auditorSec
  5461. }
  5462. if(this.user.timeType.auditLevel > 2){
  5463. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  5464. audItem.auditorThird = this.workForm.domains[i].auditorThird
  5465. }
  5466. if(this.workForm.domains[i].ccUserid){
  5467. audItem.ccUserid = this.workForm.domains[i].ccUserid
  5468. }
  5469. if(auditRule){
  5470. auditRule = auditRule.substring(0,auditRule.length - 1)
  5471. this.$message({
  5472. message: '请指定' + auditRule + '审核人',
  5473. type: 'error'
  5474. })
  5475. return
  5476. }
  5477. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5478. }
  5479. if(this.workForm.domains[i].degreeId) {
  5480. // var sss = this.workForm.domains[i].degreeId.toString()
  5481. formData.append("degreeId", this.workForm.domains[i].degreeId);
  5482. } else {
  5483. formData.append("degreeId", -1);
  5484. }
  5485. if(this.workForm.domains[i].customData) {
  5486. // var sss = this.workForm.domains[i].degreeId.toString()
  5487. formData.append("customData", this.workForm.domains[i].customData);
  5488. } else {
  5489. formData.append("customData", 0);
  5490. }
  5491. if(this.workForm.domains[i].customText) {
  5492. formData.append("customText", this.workForm.domains[i].customText);
  5493. } else {
  5494. formData.append("customText", '-');
  5495. }
  5496. if (this.workForm.domains[i].id) {
  5497. formData.append("id", this.workForm.domains[i].id);
  5498. } else {
  5499. formData.append("id", -1);
  5500. }
  5501. formData.append("projectId", this.workForm.domains[i].projectId);
  5502. if (this.workForm.domains[i].subProjectId) {
  5503. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  5504. } else {
  5505. formData.append("subProjectId", 0);
  5506. }
  5507. if (this.workForm.domains[i].groupId) {
  5508. formData.append("groupId", this.workForm.domains[i].groupId);
  5509. } else {
  5510. formData.append("groupId", 0);
  5511. }
  5512. if (this.workForm.domains[i].taskId) {
  5513. formData.append("taskId", this.workForm.domains[i].taskId);
  5514. } else {
  5515. formData.append("taskId", 0);
  5516. }
  5517. if (this.workForm.domains[i].taskFinish == true) {
  5518. formData.append("taskFinish", 1);
  5519. } else {
  5520. formData.append("taskFinish", 0);
  5521. }
  5522. formData.append("reportTimeType", this.reportTimeType.type);
  5523. if (this.reportTimeType.type == 0) {
  5524. formData.append("timeType", this.workForm.domains[i].timeType);
  5525. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  5526. formData.append("workingTime", workingTime);
  5527. } else if (this.reportTimeType.type == 1){
  5528. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5529. } else if (this.reportTimeType.type == 2) {
  5530. formData.append("endTime", this.workForm.domains[i].endTime);
  5531. formData.append("startTime", this.workForm.domains[i].startTime);
  5532. } else if (this.reportTimeType.type == 3) {
  5533. //按比例分配
  5534. formData.append("progress", this.workForm.domains[i].progress);
  5535. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5536. }
  5537. //处理多个时间事项
  5538. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  5539. if (this.reportTimeType.multiWorktime == 1) {
  5540. //检查时间是否有重叠
  5541. var workList = this.workForm.domains[i].worktimeList;
  5542. for (var j=0;j<workList.length; j++) {
  5543. var curItem = workList[j];
  5544. //检查开始时间是否大于结束时间
  5545. if (curItem.startTime >= curItem.endTime) {
  5546. this.$message({
  5547. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  5548. this.$t('message.Endtimemustbegreaterthanstarttime'),
  5549. type: "error"
  5550. });
  5551. return;
  5552. }
  5553. for (var p = j+1;p<workList.length; p++) {
  5554. var jItem = workList[p];
  5555. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  5556. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  5557. this.$message({
  5558. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  5559. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  5560. type: "error"
  5561. });
  5562. return;
  5563. }
  5564. }
  5565. }
  5566. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  5567. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5568. formData.append("content", m);
  5569. } else {
  5570. if (this.workForm.domains[i].content) {
  5571. formData.append("content", this.workForm.domains[i].content);
  5572. } else {
  5573. formData.append("content", '-');
  5574. }
  5575. }
  5576. if (this.isBatch == 0) {
  5577. formData.append("createDate", this.workForm.createDate);
  5578. } else {
  5579. //批量填报,时间范围
  5580. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  5581. }
  5582. if(this.workForm.domains[i].isOvertime) {
  5583. formData.append("isOvertime", 1);
  5584. } else {
  5585. formData.append("isOvertime", 0);
  5586. }
  5587. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  5588. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  5589. } else {
  5590. formData.append("overtimeHours", 0);
  5591. }
  5592. if(this.workForm.domains[i].basecostId) {
  5593. formData.append("basecostId", this.workForm.domains[i].basecostId);
  5594. } else {
  5595. formData.append("basecostId", 0);
  5596. }
  5597. if (this.workForm.userId != null) {
  5598. var targetUids = '';
  5599. this.workForm.userId.forEach(u=>{
  5600. targetUids += u + '@';
  5601. });
  5602. if (targetUids.length > 0) {
  5603. targetUids = targetUids.substring(0, targetUids.length -1);
  5604. formData.append("targetUids", targetUids);
  5605. }
  5606. }
  5607. //项目专业进度
  5608. if (this.workForm.domains[i].professionProgress) {
  5609. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  5610. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5611. formData.append("professionProgress", m);
  5612. } else {
  5613. formData.append("professionProgress", "[]");
  5614. }
  5615. if (this.workForm.domains[i].stage) {
  5616. formData.append("stage", this.workForm.domains[i].stage);
  5617. } else {
  5618. formData.append("stage", "-");
  5619. }
  5620. console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  5621. if (this.workForm.domains[i].projectAuditorId) {
  5622. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  5623. } else {
  5624. console.log('执行到了这里')
  5625. console.log(this.user.timeType.reportAuditType)
  5626. if (this.user.timeType.reportAuditType == 0) {
  5627. this.$message({
  5628. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  5629. type: "error"
  5630. });
  5631. return;
  5632. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  5633. //分组负责人先审核, 确定是选择了任务分组
  5634. if (this.workForm.domains[i].taskGroups.length == 0) {
  5635. this.$message({
  5636. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  5637. type: "error"
  5638. });
  5639. } else if (!this.workForm.domains[i].groupId) {
  5640. // console.log(this.workForm.domains[i]);
  5641. this.$message({
  5642. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  5643. type: "error"
  5644. });
  5645. } else {
  5646. this.$message({
  5647. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  5648. type: "error"
  5649. });
  5650. }
  5651. return;
  5652. }
  5653. }
  5654. }
  5655. this.submitingReport = true;
  5656. this.http.uploadFile( this.port.report.editPort, formData,
  5657. res => {
  5658. this.listLoading = false;
  5659. this.submitingReport = false;
  5660. if (res.code == "ok") {
  5661. this.$message({
  5662. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  5663. type: "success"
  5664. });
  5665. this.dialogVisible = false;
  5666. this.jsDay = 0
  5667. this.jsTime = 0
  5668. this.getReportList();
  5669. this.getDepartment();
  5670. } else {
  5671. this.$message({
  5672. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  5673. type: "error"
  5674. });
  5675. }
  5676. },
  5677. error => {
  5678. this.listLoading = false;
  5679. this.submitingReport = false;
  5680. this.$message({
  5681. message: error,
  5682. type: "error"
  5683. });
  5684. });
  5685. }
  5686. });
  5687. },
  5688. cli() {
  5689. },
  5690. // 判断是展示那个工时导入
  5691. imports() {
  5692. if(this.user.timeType.syncCorpwxTime == 0) {
  5693. this.importDialog = true
  5694. } else {
  5695. this.importWxDialog = true
  5696. }
  5697. },
  5698. // 跳转
  5699. junpToDeskTop(id) {
  5700. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5701. this.$router.push("/desktop/" + id + "/" + this.date +day);
  5702. },
  5703. // 通过日报
  5704. approve(id, item) {
  5705. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5706. this.approveinData = {
  5707. id: id,
  5708. date: this.date +day,
  5709. reportIds: item.id
  5710. }
  5711. if(this.user.timeType.needEvaluate == 1){
  5712. this.$set(this.approveinData,'evaluate','')
  5713. this.approveinDialog = true
  5714. }else{
  5715. this.logining = true;
  5716. this.approveinfun()
  5717. }
  5718. },
  5719. approveinfun(){
  5720. this.http.post( this.port.report.approve, this.approveinData,
  5721. res => {
  5722. this.logining = false;
  5723. if (res.code == "ok") {
  5724. this.approveinDialog = false
  5725. this.$message({
  5726. message: this.$t('message.Reviewsucceeded'),
  5727. type: "success"
  5728. });
  5729. this.getReportList();
  5730. this.getDepartment();
  5731. } else {
  5732. this.$message({
  5733. message: res.msg,
  5734. type: "error"
  5735. });
  5736. }
  5737. },
  5738. error => {
  5739. this.logining = false;
  5740. this.$message({
  5741. message: error,
  5742. type: "error"
  5743. });
  5744. });
  5745. },
  5746. //撤回日报
  5747. cancel(item,e) {
  5748. console.log('can can need',item);
  5749. this.logining = true;
  5750. var ids = '';
  5751. var data = e ? item : item.data;
  5752. data.forEach(element => {
  5753. if(element.id){
  5754. ids +=(element.id+',');
  5755. }
  5756. });
  5757. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  5758. res => {
  5759. this.logining = false;
  5760. if (res.code == "ok") {
  5761. this.$message({
  5762. message:this.$t('message.Withdrawalsucceeded'),
  5763. type: "success"
  5764. });
  5765. this.getReportList();
  5766. if(e){this.getReport()}
  5767. this.getDepartment();
  5768. } else {
  5769. this.$message({
  5770. message: res.msg,
  5771. type: "error"
  5772. });
  5773. }
  5774. },
  5775. error => {
  5776. this.logining = false;
  5777. this.$message({
  5778. message: error,
  5779. type: "error"
  5780. });
  5781. });
  5782. },
  5783. showDenyDialog(id,i, item) {
  5784. this.denyReasonDialog = true;
  5785. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5786. var ids = item.id;
  5787. // var data = item.data;
  5788. // data.forEach(element => {
  5789. // ids +=(element.id+',');
  5790. // });
  5791. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  5792. },
  5793. // 未通过日报
  5794. deny() {
  5795. this.logining = true;
  5796. this.http.post( this.port.report.deny, this.denyForm,
  5797. res => {
  5798. this.logining = false;
  5799. if (res.code == "ok") {
  5800. this.$message({
  5801. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  5802. type: "success"
  5803. });
  5804. this.getReportList();
  5805. this.getDepartment();
  5806. this.denyReasonDialog = false;
  5807. } else {
  5808. this.$message({
  5809. message: res.msg,
  5810. type: "error"
  5811. });
  5812. }
  5813. },
  5814. error => {
  5815. this.logining = false;
  5816. this.$message({
  5817. message: error,
  5818. type: "error"
  5819. });
  5820. });
  5821. },
  5822. // 查看工时记录弹窗
  5823. toView() {
  5824. this.toViewDialogVisible = true
  5825. this.toViewloading = true
  5826. this.getToView()
  5827. },
  5828. getToView() {
  5829. this.http.post( '/report-import-log/getList', this.toViewForm,
  5830. res => {
  5831. this.toViewloading = false;
  5832. if (res.code == "ok") {
  5833. // console.log(res.data, '数据数据')
  5834. this.toViewList = res.data.records
  5835. this.toViewForm.total = res.data.total
  5836. } else {
  5837. this.toViewloading = false;
  5838. this.$message({
  5839. message: res.msg,
  5840. type: "error"
  5841. });
  5842. }
  5843. })
  5844. },
  5845. // 触发 selectCat 组件更改他的值
  5846. selectCatCli(obj) {
  5847. console.log(obj, '看看')
  5848. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  5849. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  5850. },
  5851. vueCasader(obj) {
  5852. console.log(obj, '看看值')
  5853. if(obj.distinction == 1) {
  5854. let arr = []
  5855. arr.push(obj.item.id)
  5856. this.exportParam.departmentId = arr
  5857. }
  5858. },
  5859. //分页
  5860. handleCurrentChange(val) {
  5861. this.toViewForm.pageIndex = val;
  5862. this.getToView();
  5863. },
  5864. handleSizeChange(val) {
  5865. this.toViewForm.pageSize = val;
  5866. this.getToView();
  5867. },
  5868. getAllUsersList(){
  5869. this.http.post('/user/getSimpleActiveUserList',{
  5870. },res => {
  5871. if(res.code == 'ok'){
  5872. this.allUsersList = res.data
  5873. }else{
  5874. this.$message({
  5875. message: res.msg,
  5876. type: 'error'
  5877. })
  5878. }
  5879. },err => {
  5880. this.$message({
  5881. message: err,
  5882. type: 'error'
  5883. })
  5884. })
  5885. }
  5886. },
  5887. created() {
  5888. let height = window.innerHeight;
  5889. this.tableHeight = height - 178;
  5890. const that = this;
  5891. window.onresize = function temp() {
  5892. that.tableHeight = window.innerHeight - 178;
  5893. };
  5894. this.toViewForm.companyId = this.user.companyId
  5895. this.initDrag([{
  5896. type: "LR",
  5897. domClass: {
  5898. // 中间分割线的名字
  5899. resize: "line-line",
  5900. // 左侧盒子的名字
  5901. left: "box-left",
  5902. // 右侧盒子的名字
  5903. right: "box-right",
  5904. // 父级的名字
  5905. box: "box-father",
  5906. },
  5907. otherInfo: {
  5908. // 限制左边栏最低宽度
  5909. leftWidth: 120,
  5910. },
  5911. },
  5912. {
  5913. type: "LR",
  5914. domClass: {
  5915. // 中间分割线的名字
  5916. resize: "line-second",
  5917. // 左侧盒子的名字
  5918. left: "left-laowang",
  5919. // 右侧盒子的名字
  5920. right: "box-second-father",
  5921. // 父级的名字
  5922. box: "grand",
  5923. },
  5924. otherInfo: {
  5925. // 限制左边栏最低宽度
  5926. leftWidth: 120,
  5927. },
  5928. },
  5929. ]);
  5930. },
  5931. mounted() {
  5932. var now = new Date();
  5933. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  5934. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  5935. this.exportParam.dateRange = [startStr,t];
  5936. this.getAllDate(1);
  5937. this.getReportList();
  5938. this.getProjectList();
  5939. this.getFillProjectList();
  5940. this.getTimeType();
  5941. this.getDepartment();
  5942. this.scrollFunction()
  5943. this.userssHu();
  5944. if(this.user.timeType.reportAuditType == 3){
  5945. this.getAllUsersList()
  5946. }
  5947. if (this.user.company.packageProject == 1) {
  5948. this.getBasecostItemList();
  5949. }
  5950. if(this.user.timeType.lockWorktime){
  5951. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  5952. }
  5953. }
  5954. };
  5955. </script>
  5956. <style lang="scss" scoped>
  5957. .paginatis {
  5958. padding: 10px 10px;
  5959. background: #f2f2f2;
  5960. }
  5961. .waiting {
  5962. color:orange;
  5963. }
  5964. .filledReportStyle {
  5965. color:#32CD32;
  5966. }
  5967. .RejectStyle {
  5968. color:red;
  5969. }
  5970. .waitSubmitStyle{
  5971. color: #409eff;
  5972. }
  5973. .chooseDate {
  5974. .waiting {
  5975. color: #20a0ff;
  5976. }
  5977. .filledReportStyle {
  5978. color:#20a0ff;
  5979. }
  5980. .RejectStyle {
  5981. color: #20a0ff;
  5982. }
  5983. .waitSubmitStyle{
  5984. color: #20a0ff;
  5985. }
  5986. }
  5987. .allDaily {
  5988. width:100%;
  5989. }
  5990. .report_title {
  5991. padding:10px 0;
  5992. color:#666;
  5993. }
  5994. .clearfix {
  5995. overflow-x: auto;
  5996. white-space: nowrap;
  5997. padding: 15px 0 10px 0;
  5998. // overflow-y: hidden;
  5999. .date_item {
  6000. padding: 0 3px;
  6001. cursor: pointer;
  6002. position: relative;
  6003. }
  6004. .chooseDate {
  6005. position: absolute;
  6006. bottom: -3px;
  6007. width: 37px;
  6008. height: 2px;
  6009. left: 14px;
  6010. background: #20a0ff;
  6011. }
  6012. }
  6013. .one_daily {
  6014. i {
  6015. color: #9ed0ff;
  6016. margin-right: 5px;
  6017. }
  6018. .one_daily_body {
  6019. padding: 10px 0px;
  6020. p {
  6021. margin: 0;
  6022. line-height: 30px;
  6023. }
  6024. }
  6025. ul {
  6026. padding: 0;
  6027. }
  6028. }
  6029. .checkbtn {
  6030. float: right;
  6031. margin-top: -10px;
  6032. }
  6033. .selConStyle{
  6034. margin-top:9rem;
  6035. margin-bottom:11rem;
  6036. .selConStyle_title{
  6037. height: 3rem;
  6038. text-align: center;
  6039. font-size: 17px;
  6040. }
  6041. .el-select{
  6042. margin: 0 15%;
  6043. width: 70%;
  6044. }
  6045. }
  6046. </style>
  6047. <style lang="scss">
  6048. .daily {
  6049. .el-card__body {
  6050. height: 80%;
  6051. overflow-y: auto;
  6052. }
  6053. .el-card__header {
  6054. padding: 0 20px;
  6055. }
  6056. }
  6057. .membListClass{
  6058. .el-dialog__body{
  6059. padding-top: 10px;
  6060. }
  6061. }
  6062. .editReportDialog .el-dialog__footer{
  6063. position: sticky;
  6064. bottom: 0;
  6065. background: #fff;
  6066. height: 70px;
  6067. z-index: 1010;
  6068. }
  6069. .touruxiangmu{
  6070. max-width: 1000px;
  6071. }
  6072. </style>
  6073. <style scoped>
  6074. /* 项目标签的样式 */
  6075. .el-tag + .el-tag {
  6076. margin-left: 10px;
  6077. }
  6078. .button-new-tag {
  6079. margin-left: 10px;
  6080. height: 32px;
  6081. line-height: 30px;
  6082. padding-top: 0;
  6083. padding-bottom: 0;
  6084. }
  6085. .input-new-tag {
  6086. width: 90px;
  6087. margin-left: 10px;
  6088. vertical-align: bottom;
  6089. }
  6090. .selectworktime .el-table__fixed-body-wrapper{
  6091. top: 48px !important;
  6092. }
  6093. .selectworktime_export .selectworktime_export_l{
  6094. width: 65%;
  6095. float: left;
  6096. height: 42px;
  6097. }
  6098. .approvalProcessBox{
  6099. margin-left: 30px;
  6100. font-size: 14px;
  6101. line-height: 16px;
  6102. cursor: pointer;
  6103. }
  6104. .approvalProcessBox i {
  6105. margin-right: 0;
  6106. height: 16px;
  6107. width: 16px;
  6108. display: inline-block;
  6109. transform: scale(1.2);
  6110. position: relative;
  6111. top: 0.5px;
  6112. color: #409eff;
  6113. }
  6114. .approvalProcessBox .approvalProcessClick{
  6115. cursor: pointer;
  6116. color: #409eff;
  6117. font-size: 14px;
  6118. }
  6119. .approvalProcessBox:hover .approvalProcessClick{
  6120. color: #3485fb;
  6121. }
  6122. </style>
  6123. <style lang="scss" scoped>
  6124. // 加班样式
  6125. .overtime {
  6126. display: inline-block;
  6127. margin-left: 20px;
  6128. input {
  6129. display: inline-block;
  6130. margin-top: 5px;
  6131. }
  6132. }
  6133. .plus {
  6134. display: inline-block;
  6135. }
  6136. // .tages {
  6137. // float: right;
  6138. // }
  6139. .overtime {
  6140. display: inline-block;
  6141. margin-left: 30px;
  6142. }
  6143. .bloks {
  6144. display: inline-block;
  6145. width: 380px;
  6146. }
  6147. .zhiss {
  6148. display: flex;
  6149. justify-content: space-around;
  6150. align-items: center;
  6151. }
  6152. .zhoFel {
  6153. display: flex;
  6154. justify-content: space-between;
  6155. align-items: center;
  6156. }
  6157. // 左右滑动样式
  6158. .line {
  6159. width: 30px;
  6160. /* height: 500px; */
  6161. background: #f2f2f2;
  6162. cursor: w-resize;
  6163. }
  6164. .box-father {
  6165. border: 8px solid #000;
  6166. }
  6167. .line-second {
  6168. width: 10px;
  6169. /* background: red; */
  6170. }
  6171. .flex {
  6172. display: flex;
  6173. width: 100%;
  6174. }
  6175. .box-left {
  6176. flex: 0 0 400px;
  6177. /* height: 600px; */
  6178. /* background: blue; */
  6179. }
  6180. .box-right {
  6181. /* height: 600px; */
  6182. /* background: green; */
  6183. flex: 1;
  6184. }
  6185. .box-postion {
  6186. width: 200px;
  6187. /* height: 400px; */
  6188. background: #ccc;
  6189. }
  6190. .custom-tree-node {
  6191. flex: 1;
  6192. display: flex;
  6193. align-items: center;
  6194. justify-content: space-between;
  6195. font-size: 14px;
  6196. padding-right: 8px;
  6197. }
  6198. .daitianrbao {
  6199. width: 100%;
  6200. box-sizing: border-box;
  6201. height: 40px;
  6202. border-radius: 4px;
  6203. border: 1px solid #DCDFE6;
  6204. overflow: hidden;
  6205. text-overflow: ellipsis;
  6206. display: flex;
  6207. // align-items: center;
  6208. }
  6209. .daitianrbao .spnn {
  6210. display: inline-block;
  6211. box-sizing: border-box;
  6212. padding: 0 15px;
  6213. overflow: hidden;
  6214. text-overflow: ellipsis;
  6215. }
  6216. .daitianrbao .hover {
  6217. color: #DCDFE6 !important;
  6218. }
  6219. </style>