daily.vue 353 KB

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