daily.vue 340 KB

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