daily.vue 348 KB

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