daily.vue 370 KB

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