daily.vue 367 KB

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