daily.vue 368 KB

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