daily.vue 367 KB

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