daily.vue 443 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" 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.toFixed(1) + $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. 未填
  125. <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')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  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('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <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> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  252. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  253. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  254. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  255. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  256. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  257. <!--自己可以撤回待审核状态的报告 -->
  258. <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>
  259. </span>
  260. </p>
  261. <p v-if="user.companyId == yuzhongCompId">
  262. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  263. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  264. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  265. <!--任务分组和阶段 -->
  266. <p v-if="item2.groupId != 0">
  267. {{$t('other.taskGroup')}}:{{item2.groupName}}
  268. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  269. </p>
  270. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  271. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  272. <!-- 自定义日报文本 -->
  273. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  274. <p v-if="user.company.packageEngineering == 1">
  275. {{$t('other.professionalProgress')}}:
  276. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  277. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  278. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  279. </el-tooltip>
  280. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  281. <i class="iconfont firerock-iconshenhetongguo"></i>
  282. </el-tooltip>
  283. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  284. <i class="iconfont firerock-iconshenhebohui"></i>
  285. </el-tooltip>
  286. </span>
  287. </p>
  288. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  289. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  290. </p>
  291. <div v-if="item2.multiWorktime==0">
  292. <p style="display: inline-block;">{{$t('time.duration')}}:
  293. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  295. {{item2.time.toFixed(1)}}h
  296. <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>
  297. </p>
  298. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  299. </div>
  300. <div v-if="item2.multiWorktime==1" >
  301. <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>
  302. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  303. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  304. <p style="display: inline-block;">{{$t('time.duration')}}:
  305. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  306. {{timeItem.time.toFixed(1)}}h
  307. </p>
  308. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  309. </div>
  310. </div>
  311. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  312. <!--照片的显示 -->
  313. <p v-if="item2.pics != null && item2.pics.length > 0">
  314. <el-image v-for="(pic, index) in item2.pics" :key="index"
  315. style="width: 100px; height: 100px; margin-right:10px;"
  316. :src="pic"
  317. :preview-src-list="item2.pics">
  318. </el-image>
  319. </p>
  320. </el-card>
  321. </el-timeline-item>
  322. </el-timeline>
  323. </div>
  324. </div>
  325. <!-- 简陋的无报告提示 -->
  326. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </el-card>
  333. </div>
  334. <!-- 工时推送日志弹窗 -->
  335. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  336. <template>
  337. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  338. </template>
  339. <template>
  340. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  341. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  342. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  343. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  344. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  345. <el-table-column prop="result" label="推送结果" width="250">
  346. <template slot-scope="scope">
  347. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  348. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  352. </el-table>
  353. </template>
  354. <span slot="footer" class="dialog-footer">
  355. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  356. </span>
  357. </el-dialog>
  358. <!-- 填写日报的dialog -->
  359. <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">
  360. <div style="height: 65vh;overflow: auto;">
  361. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  362. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  363. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  364. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  365. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  366. <span class="spnn" v-if="workForm.userNames">
  367. <span v-for="(item, index) in workForm.userNames" :key="index">
  368. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  369. <span v-if="index < workForm.userNames.length - 1">,</span>
  370. </span>
  371. </span>
  372. <span class="spnn hover" v-else>
  373. {{$t('defaultText.pleaseSelectAsubstitute')}}
  374. </span>
  375. </div>
  376. </el-form-item>
  377. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  378. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  379. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  380. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  381. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  382. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  383. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  384. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  385. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  386. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  387. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  388. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  389. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  390. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  391. </span>
  392. <!--批量填报和批量代填不显示考勤记录-->
  393. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  394. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  395. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  396. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  397. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  398. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  399. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  400. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  401. @click="refreshAttendance(workForm.createDate)"></el-button>
  402. <!-- AI智能填报 -->
  403. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  404. </el-form-item>
  405. <!-- 000000 -->
  406. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  407. <div v-if="reportTimeType.multiWorktime==0">
  408. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  409. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  410. <el-select v-model="domain.timeType" style="width:200px;"
  411. v-if="reportTimeType.type == 0"
  412. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  413. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  414. @change="onTimeTypeChange(domain.timeType)">
  415. <el-option
  416. v-for="item in timeType"
  417. :key="item.value"
  418. :label="item.label"
  419. :value="item.value">
  420. </el-option>
  421. </el-select>
  422. <!-- 数字时长选择 -->
  423. <el-select v-model="domain.workingTime" style="width:200px;"
  424. v-if="reportTimeType.type == 1"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  427. @change="seleChn(0,domain)">
  428. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  429. </el-select>
  430. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  431. <span v-if="reportTimeType.type == 2">
  432. <!--时间范围选择 -->
  433. <el-time-picker
  434. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  435. v-model="domain.startTime"
  436. :placeholder="$t('time.startTime')"
  437. style="width:120px;"
  438. format="HH:mm"
  439. value-format="HH:mm"
  440. :picker-options="{
  441. start: '08:00',
  442. end: '23:30'
  443. }"
  444. @change="iptChang()">
  445. </el-time-picker> - <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.endTime"
  448. :placeholder="$t('time.endTime')"
  449. style="width:120px;"
  450. format="HH:mm"
  451. value-format="HH:mm"
  452. :picker-options="{
  453. start: '08:00',
  454. end: '23:30',
  455. minTime: domain.startTime
  456. }"
  457. @change="iptChang()">
  458. </el-time-picker>
  459. </span>
  460. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  461. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  462. <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>
  463. </div>
  464. </el-form-item>
  465. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  466. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  467. <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"
  468. @change="selectProject(domain, index)"
  469. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  470. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  471. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  472. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  473. <span style="float: right;">{{ item.projectName }}</span>
  474. </el-option>
  475. </el-option-group>
  476. </el-select>
  477. <!--昱众不显示子项目-->
  478. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  479. <span style="margin-left:45px;">
  480. {{$t('lable.subproject')}}</span>
  481. <!--子项目 -->
  482. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  483. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  484. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  485. </el-select>
  486. </template>
  487. <template v-if="user.companyId == yuzhongCompId">
  488. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  489. <!--角色选择 -->
  490. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  491. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  492. <el-option
  493. v-for="item in roleList"
  494. :key="item.value"
  495. :label="item.label"
  496. :value="item.value">
  497. </el-option>
  498. </el-select>
  499. </template>
  500. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
  501. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  502. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  503. </el-link>
  504. <!-- <el-link type="primary" v-if="canEdit"
  505. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  506. </el-form-item>
  507. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  508. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  509. </el-form-item>
  510. <!--如果设置了工时成本预警的预算成本项-->
  511. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  512. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  513. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  514. </el-select>
  515. </el-form-item>
  516. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  517. <template slot="label">
  518. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  519. <span >{{$t('lable.taskGrouping')}}</span>
  520. </template>
  521. <!-- 任务分组 -->
  522. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  523. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  524. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  525. </el-select>
  526. <template v-if="user.companyId == yuzhongCompId">
  527. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  528. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  529. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  530. <el-option
  531. v-for="item in domain.filteredRespList"
  532. :key="item.id"
  533. :label="item.jobRespon"
  534. :value="item.id">
  535. </el-option>
  536. </el-select>
  537. </template>
  538. <template v-else><!-- 项目的阶段 -->
  539. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  540. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  541. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  542. @change="changeStages(domain, index)"
  543. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  544. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  545. </el-select>
  546. </template>
  547. </el-form-item>
  548. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  549. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  550. <template slot="label">
  551. <span style="color:#FF0000;">*</span>
  552. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  553. </template>
  554. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  555. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  556. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  557. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  558. </el-option>
  559. </el-select>
  560. <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>
  561. </el-form-item>
  562. </div>
  563. <el-form-item v-if="user.companyId == yuzhongCompId">
  564. <template slot="label">
  565. <span style="color:#FF0000;">*</span>
  566. <span >工作内容</span>
  567. </template>
  568. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  569. :disabled="(workForm.domains[index].state>=2?false:true)" >
  570. <el-option
  571. v-for="item in domain.workContentList"
  572. :key="item.id"
  573. :label="item.workContext"
  574. :value="item.id">
  575. </el-option>
  576. </el-select>
  577. </el-form-item>
  578. <!-- 111111 -->
  579. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  580. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  581. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  582. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  583. <span v-else>{{item.name}}</span>
  584. </el-option>
  585. </el-select>
  586. <template v-if="user.timeType.auditLevel > 1">
  587. <i class="el-icon-right"></i>
  588. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  589. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  590. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  591. <span v-else>{{item.name}}</span>
  592. </el-option>
  593. </el-select>
  594. </template>
  595. <template v-if="user.timeType.auditLevel > 2">
  596. <i class="el-icon-right"></i>
  597. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  598. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  599. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  600. <span v-else>{{item.name}}</span>
  601. </el-option>
  602. </el-select>
  603. </template>
  604. </el-form-item>
  605. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  606. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  607. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  608. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  609. <span v-else>{{item.name}}</span>
  610. </el-option>
  611. </el-select>
  612. </el-form-item>
  613. <!-- 相关维度/自定义维度 -->
  614. <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'">
  615. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  616. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  617. </el-option>
  618. </el-select>
  619. <el-select v-else v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  620. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  621. </el-option>
  622. </el-select>
  623. </el-form-item>
  624. <!-- 相关数值 -->
  625. <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">
  626. <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>
  627. </el-form-item>
  628. <!-- 自定义文本 -->
  629. <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">
  630. <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>
  631. </el-form-item>
  632. <!--按比例填报-->
  633. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  634. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  635. <div style="width:400px;">
  636. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  637. <el-col :span="isBatch?6:10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span><span v-if="isBatch == 0">{{domain.workingTime}}{{$t('time.hour')}}</span></span></el-col>
  638. </div>
  639. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  640. <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>
  641. </div>
  642. </el-form-item>
  643. <!--工程专业版本模式下, 各个专业的进度填报 -->
  644. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  645. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  646. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  647. <el-input size="mini" style="width:60px;" v-model="item.progress"
  648. @keyup.native="onProgressChange"
  649. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  650. </span>
  651. </el-form-item>
  652. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  653. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  654. <template slot="label" v-if="user.companyId == 3092">
  655. <span style="color:#FF0000;">*</span>
  656. <span >任务</span>
  657. </template>
  658. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  659. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  660. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  661. </el-select>
  662. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  663. </el-form-item>
  664. <!--针对依斯贝的SAP服务-->
  665. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  666. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  667. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  668. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  669. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  670. </el-select>
  671. </el-form-item>
  672. <!--工作事项-->
  673. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  674. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  675. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  676. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  677. </el-form-item>
  678. <!-- 拍照上传 -->
  679. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  680. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  681. <div class="photos">
  682. <div>
  683. <el-upload
  684. list-type="picture-card"
  685. :http-request="(file) => {return addImg(file, index)}"
  686. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  687. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  688. :file-list="domain.imgListUrl" :limit="9"
  689. :disabled="workForm.domains[index].state>=2?false:true">
  690. <i class="el-icon-plus"></i>
  691. </el-upload>
  692. </div>
  693. </div>
  694. </el-form-item>
  695. </div>
  696. <!--多个工作事项填报的情况 -->
  697. <div v-if="reportTimeType.multiWorktime==1">
  698. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  699. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  700. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  701. @change="selectProject(domain, index)"
  702. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  703. <!-- <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">
  704. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  705. <span style="float: right;">{{ item.projectName }}</span>
  706. </el-option> -->
  707. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  708. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  709. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  710. <span style="float: right;">{{ item.projectName }}</span>
  711. </el-option>
  712. </el-option-group>
  713. </el-select>
  714. <template v-if="user.timeType.mainProjectState != 1">
  715. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  716. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  717. <!--子项目 -->
  718. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  719. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  720. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  721. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  722. </el-select>
  723. </template>
  724. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  725. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  726. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  727. </el-link>
  728. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  729. <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>
  730. </div>
  731. <!-- <el-link type="primary" v-if="canEdit"
  732. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  733. </el-form-item>
  734. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  735. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  736. </el-form-item>
  737. <!--如果设置了工时成本预警的预算成本项-->
  738. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  739. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  740. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  741. </el-select>
  742. </el-form-item>
  743. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  744. <!-- 任务分组 -->
  745. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  746. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  747. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  748. </el-select>
  749. <!-- 项目的阶段 -->
  750. <span v-if="domain.stages != null && domain.stages.length> 0"
  751. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  752. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  753. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  754. @change="changeStages(domain, index)"
  755. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  756. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  757. </el-select>
  758. </el-form-item>
  759. <el-form-item :label="$t('other.projectAuditor')" >
  760. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  761. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  762. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  763. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  764. </el-option>
  765. </el-select>
  766. <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>
  767. </el-form-item>
  768. <!--工程专业版本模式下, 各个专业的进度填报 -->
  769. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  770. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  771. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  772. <el-input size="mini" style="width:60px;" v-model="item.progress"
  773. @keyup.native="onProgressChange"
  774. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  775. </span>
  776. </el-form-item>
  777. <!-- 相关维度 -->
  778. <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'">
  779. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  780. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  781. </el-option>
  782. </el-select>
  783. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  784. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  785. </el-option>
  786. </el-select>
  787. </el-form-item>
  788. <!-- 相关数值 -->
  789. <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">
  790. <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>
  791. </el-form-item>
  792. <!-- 自定义文本 -->
  793. <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">
  794. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  795. </el-form-item>
  796. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  797. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  798. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  799. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  800. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  801. </el-select>
  802. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  803. </el-form-item>
  804. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  805. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  806. <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>
  807. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  808. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  809. <span v-if="reportTimeType.type == 2">
  810. <!-- <span> -->
  811. <!--时间范围选择 -->
  812. <el-time-picker
  813. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  814. v-model="timeItem.startTime"
  815. :placeholder="$t('time.startTime')"
  816. style="width:120px;"
  817. format="HH:mm"
  818. value-format="HH:mm"
  819. :picker-options="{
  820. start: '00:00',
  821. end: '23:59',
  822. }"
  823. @change="iptChangs()">
  824. </el-time-picker> - <el-time-picker
  825. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  826. v-model="timeItem.endTime"
  827. :placeholder="$t('time.endTime')"
  828. style="width:120px;"
  829. format="HH:mm"
  830. value-format="HH:mm"
  831. :picker-options="{
  832. start: '00:00',
  833. end: '23:59',
  834. minTime: timeItem.startTime
  835. }"
  836. @change="iptChangs()">
  837. </el-time-picker>
  838. </span>
  839. </el-form-item>
  840. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  841. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  842. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  843. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  844. ></el-input>
  845. </el-form-item>
  846. </div>
  847. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  848. </div>
  849. <!--照片的显示 -->
  850. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  851. <el-image v-for="(pic, index) in domain.pics" :key="index"
  852. style="width: 100px; height: 100px; margin-right:10px;"
  853. :src="pic"
  854. :preview-src-list="domain.pics">
  855. </el-image>
  856. </p>
  857. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  858. </div>
  859. <span id="workFormsItemBottom"></span>
  860. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  861. </el-form>
  862. </div>
  863. <span slot="footer" class="dialog-footer">
  864. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  865. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  866. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  867. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  868. <el-button v-if="!isSubstitude && !isBatch" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  869. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  870. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  871. </span>
  872. </el-dialog>
  873. <!-- 按周填报 -->
  874. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  875. <!-- 按周填报-已填工时-点击 -->
  876. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  877. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  878. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  879. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  880. <el-table-column prop="state" :label="$t('state.states')">
  881. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  882. </el-table-column>
  883. <!-- <el-table-column label="操作">
  884. <template slot-scope="scope">
  885. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  886. </template>
  887. </el-table-column> -->
  888. </el-table>
  889. <span slot="footer" class="dialog-footer">
  890. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  891. </span>
  892. </el-dialog>
  893. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  894. <el-form-item style="height:30px;margin-top:-72px;">
  895. <!-- <el-date-picker v-model="weekDateRange" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initWeekFormData()" 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> -->
  896. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  897. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  898. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  899. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  900. <el-select v-model="selCon" size="small" multiple :placeholder="$t('defaultText.pleaseChoose')" @change="onSelProjectChange()" filterable style="margin-right:50px;float:right;width:50%;" collapse-tags>
  901. <el-option
  902. v-for="item in fillProjectList"
  903. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  904. :key="item.id"
  905. :label="item.projectName + '\u3000' + item.projectCode"
  906. :value="item.id">
  907. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  908. <span style="float: right">{{ item.projectName }}</span>
  909. </el-option>
  910. </el-select>
  911. <span style="float:right;margin-right:10px;">选择项目</span>
  912. </el-form-item>
  913. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  914. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  915. <template slot-scope="scope">
  916. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  917. </template>
  918. </el-table-column>
  919. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  920. <template slot-scope="scope">
  921. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  922. <p v-else></p>
  923. </template>
  924. </el-table-column> -->
  925. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  926. <template slot-scope="scope">
  927. <div v-if="scope.row.canFill == 1">
  928. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  929. <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<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  930. <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<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  931. <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]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  932. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  933. </div>
  934. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  935. <el-button v-if="scope.row[item.projectName] != null && 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]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+hworkReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  936. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  937. </div>
  938. </div>
  939. <div v-else >
  940. <span style="color:#999999;">不可超前填报</span>
  941. </div>
  942. </template>
  943. </el-table-column>
  944. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  945. <template slot-scope="scope">
  946. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  947. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  948. </template>
  949. </el-table-column>
  950. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  951. <template slot-scope="scope">
  952. <div class="zhiss">
  953. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  954. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  955. </div>
  956. </template>
  957. </el-table-column>
  958. </el-table>
  959. </el-form>
  960. <span slot="footer" class="dialog-footer" >
  961. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  962. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  963. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  964. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  965. </span>
  966. </el-dialog>
  967. <!-- 重庆物奇私人定制的按周填报 -->
  968. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  969. <div class="fillWeekDialogVisiCustom">
  970. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  971. </div>
  972. </el-dialog>
  973. <!-- 选择时间 -->
  974. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  975. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  976. <span slot="footer" class="dialog-footer">
  977. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  978. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  979. </span>
  980. </el-dialog>
  981. <!-- 按周填报弹窗 -->
  982. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  983. <div>
  984. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  985. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  986. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  987. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  988. </el-select>
  989. </div>
  990. <!--如果设置了工时成本预警的预算成本项-->
  991. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  992. <p>{{$t('lable.budgetSource')}}</p>
  993. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  994. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  995. </el-select>
  996. </div>
  997. <!-- 任务分组 -->
  998. <div class="zhoFel" v-if="user.company.packageProject == 1">
  999. <p>{{$t('lable.taskGrouping')}}</p>
  1000. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1001. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1002. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1003. </el-select>
  1004. </div>
  1005. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  1006. <p>{{$t('other.inputStage')}}</p>
  1007. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1008. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1009. </el-select>
  1010. </div>
  1011. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1012. <p>{{$t('other.reviewer')}}</p>
  1013. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1014. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1015. </el-select>
  1016. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1017. </div>
  1018. <template v-if="user.timeType.reportAuditType == 3">
  1019. <div class="zhoFel">
  1020. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1021. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1022. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1023. </el-select>
  1024. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1025. </div>
  1026. <div class="zhoFel">
  1027. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1028. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1029. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1030. </el-select>
  1031. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1032. </div>
  1033. <div class="zhoFel">
  1034. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1035. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1036. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1037. </el-select>
  1038. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1039. </div>
  1040. <div class="zhoFel">
  1041. <p>{{ $t('chao-song-ren') }}</p>
  1042. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1043. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1044. </el-select>
  1045. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1046. </div>
  1047. </template>
  1048. <!-- 自定义维度 -->
  1049. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1050. <p>{{user.timeType.customDegreeName}}</p>
  1051. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1052. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1053. </el-select>
  1054. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1055. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1056. </el-select>
  1057. </div>
  1058. <!-- 自定义数值 -->
  1059. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1060. <p>{{user.timeType.customDataName}}</p>
  1061. <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>
  1062. </div>
  1063. <!-- 自定义文本 -->
  1064. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1065. <p>{{user.timeType.customTextName}}</p>
  1066. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1067. </div>
  1068. <!-- 选择任务 -->
  1069. <div class="zhoFel" v-if="user.company.packageProject==1 && user.company.nonProjectSimple==0">
  1070. <p>任务 / 里程碑</p>
  1071. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1072. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1073. </el-select>
  1074. </div>
  1075. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1076. <p>{{$t('other.timeSelection')}}</p>
  1077. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" @change="$forceUpdate()" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  1078. </div>
  1079. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1080. <p>{{$t('other.chooseDuration')}}</p>
  1081. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1082. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1083. </el-select>
  1084. </div>
  1085. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1086. <p>{{$t('lable.percentageOfTime')}}</p>
  1087. <div style="width:400px;display: flex;align-items: center;">
  1088. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1089. <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>
  1090. </div>
  1091. </div>
  1092. <div class="zhoFel">
  1093. <p>{{$t('other.workMatters')}}</p>
  1094. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1095. </div>
  1096. </div>
  1097. <span slot="footer" class="dialog-footer">
  1098. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1099. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1100. </span>
  1101. </el-dialog>
  1102. <!--导出报表条件选择 -->
  1103. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1104. <el-form ref="form3" :model="exportParam" >
  1105. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1106. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1107. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1108. </el-select>
  1109. </el-form-item>
  1110. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1111. <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>
  1112. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1113. </el-form-item>
  1114. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1115. <el-date-picker
  1116. v-model="exportParam.dateRange" :editable="false"
  1117. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1118. :range-separator="$t('other.to')"
  1119. type="daterange"
  1120. :start-placeholder="$t('time.startDate')"
  1121. :end-placeholder="$t('time.endDate')"
  1122. ></el-date-picker>
  1123. </el-form-item>
  1124. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1125. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1126. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1127. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1128. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1129. </el-select>
  1130. </el-form-item>
  1131. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1132. <div class="exportReportRadio">
  1133. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1134. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1135. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1136. <i class="el-icon-question"></i>
  1137. </el-tooltip>
  1138. </div>
  1139. </el-form-item>
  1140. </el-form>
  1141. <div slot="footer" class="dialog-footer">
  1142. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1143. </div>
  1144. </el-dialog>
  1145. <!--导出报表条件选择 -->
  1146. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1147. <el-form ref="form3" :model="exportParam" >
  1148. <el-form-item prop="range" :label="$t('time.dateRange')">
  1149. <el-date-picker
  1150. v-model="exportParam.dateRange" :editable="false"
  1151. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1152. :clearable="true"
  1153. :range-separator="$t('other.to')"
  1154. type="daterange"
  1155. :start-placeholder="$t('time.startDate')"
  1156. :end-placeholder="$t('time.endDate')"
  1157. ></el-date-picker>
  1158. </el-form-item>
  1159. </el-form>
  1160. <div slot="footer" class="dialog-footer">
  1161. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1162. </div>
  1163. </el-dialog>
  1164. <!--人员列表 -->
  1165. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1166. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1167. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1168. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1169. <el-table-column type="selection"></el-table-column>
  1170. <el-table-column prop="label" :label="$t('lable.name')" >
  1171. <template slot-scope="scope">
  1172. <span>
  1173. <!-- {{(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}} -->
  1174. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1175. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1176. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1177. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1178. </span>
  1179. <span v-else>
  1180. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1181. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1182. </span>
  1183. </span>
  1184. </template>
  1185. </el-table-column>
  1186. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1187. <template slot-scope="scope">
  1188. <div>
  1189. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1190. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1191. </div>
  1192. </template>
  1193. </el-table-column>
  1194. </el-table>
  1195. </el-tab-pane>
  1196. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1197. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1198. <el-table-column prop="label" :label="$t('lable.name')" >
  1199. <template slot-scope="scope">
  1200. <!-- <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> -->
  1201. <!-- <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> -->
  1202. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1203. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1204. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1205. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1206. </span>
  1207. <span v-else>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1209. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1210. </span>
  1211. </template>
  1212. </el-table-column>
  1213. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1214. <template slot-scope="scope">
  1215. <div>
  1216. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1217. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1218. </div>
  1219. </template>
  1220. </el-table-column>
  1221. </el-table>
  1222. </el-tab-pane>
  1223. </el-tabs>
  1224. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1225. <el-table-column type="selection"></el-table-column>
  1226. <el-table-column prop="label" :label="$t('lable.name')" >
  1227. <template slot-scope="scope">
  1228. <div>
  1229. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1230. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1231. </div>
  1232. </template>
  1233. </el-table-column>
  1234. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1235. <template slot-scope="scope">
  1236. <div>
  1237. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1238. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1239. </div>
  1240. </template>
  1241. </el-table-column>
  1242. </el-table>
  1243. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1244. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1245. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1246. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1247. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1248. </div>
  1249. </el-dialog>
  1250. <!-- 按部门选择人员 -->
  1251. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1252. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1253. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1254. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1255. </el-input>
  1256. <div class="tree" style="height:400px">
  1257. <el-scrollbar style="height:100%">
  1258. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1259. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1260. highlight-current :filter-node-method="filterNode">
  1261. <span class="custom-tree-node" slot-scope="{ node }">
  1262. <span v-if="user.userNameNeedTranslate == '1'">
  1263. <span v-if="node.data.children">
  1264. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1265. </span>
  1266. <span v-else>
  1267. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1268. </span>
  1269. </span>
  1270. <span v-if="user.userNameNeedTranslate != '1'">
  1271. {{ node.label }}
  1272. </span>
  1273. <!-- {{ node.label }} -->
  1274. </span>
  1275. </el-tree>
  1276. </el-scrollbar>
  1277. </div>
  1278. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1279. <div slot="footer" class="dialog-footer">
  1280. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1281. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1282. </div>
  1283. </el-dialog>
  1284. <el-dialog
  1285. v-if="monthWorkTimeDialog"
  1286. :visible.sync="monthWorkTimeDialog"
  1287. :close-on-click-modal="false"
  1288. customClass="customWidth selectworktime"
  1289. width="1200px"
  1290. title=""
  1291. >
  1292. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1293. <el-tabs v-model="activeName" @tab-click="handleClick">
  1294. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1295. <div class="selectworktime_export" style="margin-top:10px;">
  1296. <div class="selectworktime_export_l">
  1297. <el-date-picker
  1298. class="selecteworktime_datapick"
  1299. v-model="WorktimeDatepickValue"
  1300. value-format="yyyy-MM-dd"
  1301. type="daterange"
  1302. align="right"
  1303. unlink-panels
  1304. :range-separator="$t('other.to')"
  1305. :start-placeholder="$t('time.startDate')"
  1306. :end-placeholder="$t('time.endDate')"
  1307. :default-time="['12:00:00', '12:00:00']"
  1308. size="small"
  1309. popper-class="selecteorktime_datapick_popper"
  1310. @change="showMonthWorkTime()"
  1311. >
  1312. </el-date-picker>
  1313. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1314. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1315. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1316. <!-- 222 -->
  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(0)" icon="el-icon-search"></el-button>
  1321. </el-input>
  1322. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1323. </div>
  1324. <el-link
  1325. type="primary"
  1326. style="float: right; vertical-align: middle;height:32px"
  1327. @click="exportMembWorkHours()"
  1328. >{{$t('export.exportData')}}</el-link
  1329. >
  1330. </div>
  1331. <el-table ref="hasworkTbl"
  1332. :data="monthWorkDataS"
  1333. v-el-table-infinite-scroll="listScroll"
  1334. border
  1335. :height="500"
  1336. highlight-current-row
  1337. style="width: 100%"
  1338. v-loading="tbload"
  1339. :lazy="true"
  1340. >
  1341. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1342. <template slot-scope="scope">
  1343. {{ scope.$index + 1 }}
  1344. </template>
  1345. </el-table-column>
  1346. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1347. <template slot-scope="scope">
  1348. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1349. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1350. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1351. <!-- {{scope.row.name}} -->
  1352. </span>
  1353. </template>
  1354. </el-table-column>
  1355. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1356. <template slot-scope="scope">
  1357. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1358. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1359. </template>
  1360. </el-table-column>
  1361. <el-table-column
  1362. min-width="105"
  1363. v-for="(item, index) in pickDateArray"
  1364. :key="index"
  1365. :label="item.label"
  1366. align="center"
  1367. >
  1368. <template slot-scope="scope">
  1369. <div
  1370. style="color: red"
  1371. v-if="
  1372. scope.row.worktimeList.filter(
  1373. (w) =>
  1374. w.createDate==item.date
  1375. ).length > 0 &&
  1376. scope.row.worktimeList.filter(
  1377. (w) =>w.createDate==item.date
  1378. )[0].workingTime < reportTimeType.allday
  1379. "
  1380. >
  1381. {{
  1382. scope.row.worktimeList.filter(
  1383. (w) =>w.createDate==item.date
  1384. )[0].workingTime.toFixed(1)
  1385. }}
  1386. </div>
  1387. <div
  1388. style="color: #20a0ff"
  1389. v-if="
  1390. scope.row.worktimeList.filter(
  1391. (w) =>w.createDate==item.date
  1392. ).length > 0 &&
  1393. scope.row.worktimeList.filter(
  1394. (w) =>w.createDate==item.date
  1395. )[0].workingTime > reportTimeType.allday
  1396. "
  1397. >
  1398. {{
  1399. scope.row.worktimeList.filter(
  1400. (w) =>w.createDate==item.date
  1401. )[0].workingTime.toFixed(1)
  1402. }}
  1403. </div>
  1404. <div
  1405. v-if="
  1406. scope.row.worktimeList.filter(
  1407. (w) =>w.createDate==item.date
  1408. ).length > 0 &&
  1409. scope.row.worktimeList.filter(
  1410. (w) =>w.createDate==item.date
  1411. )[0].workingTime == reportTimeType.allday
  1412. "
  1413. >
  1414. {{
  1415. scope.row.worktimeList.filter(
  1416. (w) =>w.createDate==item.date
  1417. )[0].workingTime
  1418. }}
  1419. </div>
  1420. <div
  1421. v-if="
  1422. scope.row.worktimeList.filter(
  1423. (w) =>w.createDate==item.date
  1424. ).length == 0
  1425. "
  1426. >
  1427. 0
  1428. </div>
  1429. <div
  1430. v-if="
  1431. scope.row.worktimeList.filter(
  1432. (w) =>w.createDate==item.date
  1433. ).length > 0 &&
  1434. typeof scope.row.worktimeList.filter(
  1435. (w) =>w.createDate==item.date
  1436. )[0].workingTime == 'string'
  1437. "
  1438. >
  1439. {{
  1440. scope.row.worktimeList.filter(
  1441. (w) =>w.createDate==item.date
  1442. )[0].workingTime
  1443. }}
  1444. </div>
  1445. </template>
  1446. </el-table-column>
  1447. </el-table>
  1448. <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>
  1449. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1450. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1451. <label style="font-size: 16px">员工每日已填报工时数</label>
  1452. <el-link
  1453. type="primary"
  1454. style="float: right; margin-right: 60px"
  1455. @click="exportMembWorkHours()"
  1456. >导出已填报数据</el-link
  1457. > -->
  1458. <!-- <el-button >导出</el-button> -->
  1459. <!-- </div> -->
  1460. </el-tab-pane>
  1461. <el-tab-pane label="未提交人员列表" name="second" >
  1462. <div class="selectworktime_export" style="margin-top:10px">
  1463. <div class="selectworktime_export_l">
  1464. <el-date-picker
  1465. class="selecteworktime_datapick"
  1466. v-model="WorktimeDatepickValue"
  1467. value-format="yyyy-MM-dd"
  1468. type="daterange"
  1469. align="right"
  1470. unlink-panels
  1471. :range-separator="$t('other.to')"
  1472. :start-placeholder="$t('time.startDate')"
  1473. :end-placeholder="$t('time.endDate')"
  1474. :default-time="['12:00:00', '12:00:00']"
  1475. size="small"
  1476. popper-class="selecteorktime_datapick_popper"
  1477. @change="showMonthNotWorkTime()"
  1478. >
  1479. </el-date-picker>
  1480. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1481. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1482. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1483. </div>
  1484. <div>
  1485. <div style="margin-top:10px;">
  1486. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1487. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1488. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1489. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1490. </el-input>
  1491. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1492. <el-link
  1493. type="primary"
  1494. style="float: right; vertical-align: middle;height:32px"
  1495. @click="exportMembNotWorkHours()"
  1496. >{{$t('export.exportData')}}</el-link
  1497. >
  1498. </div>
  1499. </div>
  1500. </div>
  1501. <el-table
  1502. ref="hasworkTbl2"
  1503. :data="monthNotWorkDateS"
  1504. v-el-table-infinite-scroll="notListScroll"
  1505. border
  1506. :height="500"
  1507. highlight-current-row
  1508. style="width: 100%"
  1509. v-loading="tbload"
  1510. lazy
  1511. >
  1512. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1513. <template slot-scope="scope">
  1514. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1515. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1516. </template>
  1517. </el-table-column>
  1518. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1519. <template slot-scope="scope">
  1520. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1521. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1522. </template>
  1523. </el-table-column>
  1524. <el-table-column
  1525. min-width="200"
  1526. :label="$t('weekDay.date')"
  1527. align="center"
  1528. prop="createDate"
  1529. >
  1530. </el-table-column>
  1531. <el-table-column
  1532. min-width="200"
  1533. :label="$t('state.states')"
  1534. align="center"
  1535. prop="status"
  1536. />
  1537. <el-table-column
  1538. min-width="200"
  1539. :label="$t('other.attendanceData')"
  1540. prop="cardTime"
  1541. align="center"
  1542. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1543. </el-table>
  1544. <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>
  1545. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1546. </el-tab-pane>
  1547. </el-tabs>
  1548. </el-dialog>
  1549. <!--驳回弹出框 -->
  1550. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1551. <div>
  1552. <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')" />
  1553. </div>
  1554. <div slot="footer" class="dialog-footer">
  1555. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1556. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1557. </div>
  1558. </el-dialog>
  1559. <!-- 通过弹出框 -->
  1560. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1561. <div>
  1562. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1563. </div>
  1564. <div slot="footer" class="dialog-footer">
  1565. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1566. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1567. </div>
  1568. </el-dialog>
  1569. <!--批量导入日报 -->
  1570. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1571. <p>1. {{$t('other.download')}}
  1572. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1573. </p>
  1574. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1575. <p style="display: flex;justify-content: center;">
  1576. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1577. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1578. </el-upload>
  1579. </p>
  1580. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1581. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1582. </div>
  1583. </el-dialog>
  1584. <!-- 工时导入记录弹窗 -->
  1585. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1586. <div style="height: 452px">
  1587. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1588. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1589. <el-table-column prop="userName" :label="$t('other.operator')">
  1590. <template slot-scope="scope">
  1591. <div>
  1592. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1593. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1594. </div>
  1595. </template>
  1596. </el-table-column>
  1597. <el-table-column prop="datel" :label="$t('other.document')">
  1598. <template slot-scope="scope">
  1599. <div>
  1600. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1601. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1602. </div>
  1603. </template>
  1604. </el-table-column>
  1605. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1606. <template slot-scope="scope">
  1607. <div>
  1608. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1609. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1610. </div>
  1611. </template>
  1612. </el-table-column>
  1613. </el-table>
  1614. <el-col :span="24" class="paginatis">
  1615. <el-pagination
  1616. @size-change="handleSizeChange"
  1617. @current-change="handleCurrentChange"
  1618. :page-sizes="[20 , 50 , 80 , 100]"
  1619. :page-size="20"
  1620. layout="total, sizes, prev, pager, next"
  1621. :total="toViewForm.total"
  1622. style="float:right;"
  1623. ></el-pagination>
  1624. </el-col>
  1625. </div>
  1626. </el-dialog>
  1627. <!--基于企业微信考勤数据的工时导入 -->
  1628. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1629. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1630. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1631. </el-step>
  1632. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1633. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1634. </el-steps>
  1635. <div v-if="active==0" style="padding:30px;height:360px;">
  1636. <div style="margin-top:50px;margin-left:280px;">
  1637. <el-date-picker
  1638. v-model="importWxParam.date" :editable="false"
  1639. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1640. :clearable="true"
  1641. :range-separator="$t('other.to')"
  1642. type="daterange"
  1643. :start-placeholder="$t('time.startDate')"
  1644. :end-placeholder="$t('time.endDate')"
  1645. @change="loadCheckInData"
  1646. ></el-date-picker>
  1647. </div>
  1648. </div>
  1649. <div v-if="active==1" style="padding:10px;">
  1650. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1651. style="width: 100%;margin-top:5px;" >
  1652. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1653. <template slot-scope="scope">
  1654. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1655. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1656. </template>
  1657. </el-table-column>
  1658. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1659. </el-table-column>
  1660. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1661. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1662. <template slot-scope="scope">
  1663. <div>
  1664. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1665. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1666. </div>
  1667. </template>
  1668. </el-table-column>
  1669. <el-table-column prop="departmentName" label="部门" >
  1670. <template slot-scope="scope">
  1671. <div>
  1672. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1673. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1674. </div>
  1675. </template>
  1676. </el-table-column>
  1677. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1678. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1679. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1680. <template slot-scope="scope">
  1681. {{scope.row.workHours.toFixed(1)}}h
  1682. </template>
  1683. </el-table-column>
  1684. </el-table>
  1685. </div>
  1686. <div v-if="active==2" >
  1687. <p style="display: flex;justify-content: center;height:390px;">
  1688. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1689. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1690. </el-upload>
  1691. </p>
  1692. </div>
  1693. <div slot="title">
  1694. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1695. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1696. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1697. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1698. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1699. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1700. </div>
  1701. <span slot="footer">
  1702. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1703. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1704. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1705. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1706. </span>
  1707. </el-dialog>
  1708. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1709. <p style="display: flex;justify-content: center;height:100px;">
  1710. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1711. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1712. </el-upload>
  1713. </p>
  1714. </el-dialog>
  1715. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1716. <div>
  1717. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1718. v-model="deleteReportParam.date" :editable="false"
  1719. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1720. :clearable="true"
  1721. :range-separator="$t('other.to')"
  1722. type="daterange"
  1723. :start-placeholder="$t('time.startDate')"
  1724. :end-placeholder="$t('time.endDate')"
  1725. ></el-date-picker>
  1726. </div>
  1727. <div style="margin-top:10px;">
  1728. <span>请选择部门:</span>
  1729. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1730. <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>
  1731. </div>
  1732. <div style="margin-top:10px;">
  1733. <span>请选择员工:</span>
  1734. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1735. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1736. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1737. <span v-else>{{item.name}}</span>
  1738. </el-option>
  1739. </el-select>
  1740. </div>
  1741. <span slot="footer">
  1742. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1743. </span>
  1744. </el-dialog>
  1745. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1746. <div>
  1747. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1748. v-model="deleteReportParam.date" :editable="false"
  1749. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1750. :clearable="true"
  1751. :range-separator="$t('other.to')"
  1752. type="daterange"
  1753. :start-placeholder="$t('time.startDate')"
  1754. :end-placeholder="$t('time.endDate')"
  1755. ></el-date-picker>
  1756. </div>
  1757. <div style="margin-top:15px;">
  1758. <span>选择部门:</span>
  1759. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1760. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1761. size="small" v-if="user.userNameNeedTranslate != 1"
  1762. ></el-cascader>
  1763. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1764. </div>
  1765. <span slot="footer">
  1766. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1767. </span>
  1768. </el-dialog>
  1769. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1770. <div>
  1771. <span>选择时间:</span><el-date-picker
  1772. v-model="modImportTime"
  1773. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1774. :clearable="true"
  1775. type="datetime"
  1776. ></el-date-picker>
  1777. <span>选择导入人员:</span><el-select
  1778. v-model="modImportUserId"
  1779. >
  1780. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1781. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1782. <span v-else>{{item.name}}</span>
  1783. </el-option>
  1784. </el-select>
  1785. </div>
  1786. <span slot="footer">
  1787. <el-button @click="confirmChangeModTime" >确认</el-button>
  1788. </span>
  1789. </el-dialog>
  1790. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1791. <div>
  1792. <span>请选择年月:</span>
  1793. <el-date-picker
  1794. v-model="ratioYmonth" :editable="false"
  1795. format="yyyyMM" value-format="yyyyMM"
  1796. type="month"
  1797. ></el-date-picker>
  1798. </div>
  1799. <span slot="footer">
  1800. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1801. </span>
  1802. </el-dialog>
  1803. <!--工时批量代填 -->
  1804. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1805. <div>
  1806. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1807. v-model="importWxParam.date" :editable="false"
  1808. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1809. :clearable="true"
  1810. :range-separator="$t('other.to')"
  1811. type="daterange"
  1812. :start-placeholder="$t('time.startDate')"
  1813. :end-placeholder="$t('time.endDate')"
  1814. @change="loadCheckInData"
  1815. ></el-date-picker>
  1816. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1817. </div>
  1818. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1819. :key="timeStamp"
  1820. style="width: 100%;margin-top:5px;" ref="tab">
  1821. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1822. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1823. <template slot-scope="scope">
  1824. <div>
  1825. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1826. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1827. </div>
  1828. </template>
  1829. </el-table-column>
  1830. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1831. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1832. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1833. <template slot-scope="scope">
  1834. {{scope.row.workHours.toFixed(1)}}h
  1835. </template>
  1836. </el-table-column>
  1837. <!--项目名称列表 -->
  1838. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1839. <template slot-scope="scope">
  1840. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1841. </template>
  1842. </el-table-column>
  1843. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1844. <template slot-scope="scope">
  1845. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1846. </template>
  1847. </el-table-column>
  1848. </el-table>
  1849. </el-dialog>
  1850. <!--基于企业微信考勤数据的工时导入 -->
  1851. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1852. <div style="padding-bottom:10px;">
  1853. <p>{{importResultMsg}}</p>
  1854. </div>
  1855. <!-- <span slot="footer" class="dialog-footer">
  1856. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1857. </span> -->
  1858. </el-dialog>
  1859. <!-- 审核流程展示 -->
  1860. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1861. <div style="padding:20px 40px 20px 0">
  1862. <el-timeline :reverse="false">
  1863. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1864. <!-- {{item.msg}} -->
  1865. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1866. <span v-if="user.userNameNeedTranslate == 1">
  1867. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1868. <span>{{item.msgCon.two}}</span>
  1869. </span>
  1870. </el-timeline-item>
  1871. </el-timeline>
  1872. </div>
  1873. </el-dialog>
  1874. </section>
  1875. </template>
  1876. <script>
  1877. // 左右滑动
  1878. import dragMixin from "@/common/js/tensile.js";
  1879. import util from "../../common/js/util";
  1880. // 自定义select组件
  1881. import selectCat from "@/components/select.vue"
  1882. // 引入自定义级联组件
  1883. import vueCascader from "@/components/cascader.vue"
  1884. // 重庆物奇定制组件
  1885. import WeeklyCustomization from "./weeklyCustomization.vue"
  1886. import { mapMutations } from 'vuex'
  1887. let _that = this
  1888. export default {
  1889. mixins: [dragMixin],
  1890. components: {
  1891. selectCat,
  1892. vueCascader,
  1893. WeeklyCustomization
  1894. },
  1895. data() {
  1896. return {
  1897. exportType: 0,
  1898. exportingData: false,
  1899. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1900. jobResponseList:[],
  1901. yisibeiCompId: 3092,
  1902. yuzhongCompId: 3385,
  1903. mingyiName : '成都明夷电子科技有限公司',
  1904. // mingyiName : '明夷',
  1905. modItemDataId: null,
  1906. modImportTime: null,
  1907. modImportUserId: null,
  1908. showModImportTimeDialog: false,
  1909. showBatchSimpleApproveReport: false,
  1910. startDeleting: false,
  1911. showBatchDeleteReport: false,
  1912. deleteReportParam: {date:null, userIds:[]},
  1913. isDenying: false,
  1914. targetWeekDate: null,//填写周报中的周日期
  1915. importCardTimeVisi: false,
  1916. startRatioExporting: false,
  1917. exportUserRatio: false,
  1918. ratioYmonth:null,
  1919. hasWrittenReport: false,
  1920. today:null,
  1921. syncTimeLoading: false,
  1922. seluserText: '',
  1923. translation: '1', // 1、文字, 2、部门, 3、人员
  1924. exportLoad: false,
  1925. getPickerOptions: {
  1926. disabledDate: (time) => {
  1927. var date = new Date();
  1928. var year = date.getFullYear();
  1929. var month = date.getMonth() + 1;
  1930. if (month >= 1 && month <= 9) {
  1931. month = "0" + month;
  1932. }
  1933. var currentdate = year.toString() + month.toString();
  1934. var timeyear = time.getFullYear();
  1935. var timemonth = time.getMonth() + 1;
  1936. if (timemonth >= 1 && timemonth <= 9) {
  1937. timemonth = "0" + timemonth;
  1938. }
  1939. var timedate = timeyear.toString() + timemonth.toString();
  1940. if(this.user.timeType.fillAhead == 0){
  1941. return currentdate < timedate;
  1942. }else{
  1943. return false
  1944. }
  1945. }
  1946. },
  1947. alalal: '8.0',
  1948. timeBasecostList:null,
  1949. tbload: false,
  1950. exportTimeDialog: false,
  1951. searchKeyword: '',
  1952. monthWorkDataS: [],
  1953. monthNotWorkDateS: [],
  1954. pickDateArray:[],
  1955. WorktimeDatepickValue: [],
  1956. activeName:"first",
  1957. isLeave: 0,
  1958. submitingReport: false,
  1959. importResultMsg:null,
  1960. showImportResult:false,
  1961. importingData: false,
  1962. isDraft: 0,
  1963. timeStamp: 0,
  1964. projectColumns:[],
  1965. checkinLoading:false,
  1966. importWxParam:{date:null,},
  1967. active:0,
  1968. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1969. importWxDialog:false,
  1970. importDialog:false,
  1971. denyForm:null,
  1972. denyReasonDialog:false,
  1973. monthWorkTimeDialog: false,
  1974. isSubstitude:false,
  1975. isFill:false,
  1976. unFillList:[],
  1977. fillList:[],
  1978. fillMembList:[],
  1979. fillMembList_leave: [],
  1980. membListVisible: false,
  1981. isBatch:0,//是否是批量填报
  1982. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1983. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1984. 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')],
  1985. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1986. fillStatusList: [],
  1987. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1988. exportDialog:false,
  1989. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1990. subProjectList:[],
  1991. canEdit: true,
  1992. originCanEdit: true,
  1993. timeRange:[0.0,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],
  1994. selectTime:null,
  1995. reportTimeType:{},
  1996. curDate:'',
  1997. isAllSelect: false,
  1998. approveDialogVisible:false,
  1999. deptId:null,
  2000. targetUid: null,
  2001. membCount:0,
  2002. selectState:"-1",
  2003. user: JSON.parse(sessionStorage.getItem("user")),
  2004. allUsersList: [],
  2005. showAddMore:false,
  2006. allDate: [],
  2007. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2008. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2009. choseDay: 0,
  2010. tableHeight: 0,
  2011. listLoading: false,
  2012. projectList: [], //项目列表
  2013. fillProjectList: [],
  2014. reportList: [], //日报列表
  2015. reportNames:[], //批量审批列表
  2016. selCon:[], //筛选条件
  2017. selProjectList:[], //筛选后项目列表
  2018. selConShow: true,
  2019. usersList: [], // 全部人员列表
  2020. usersListId: '', // 选中的人员id
  2021. dialogVisible: false, //项目弹窗
  2022. report: '',
  2023. workForm: {
  2024. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2025. domains: [{
  2026. id: null,
  2027. projectId: "",
  2028. workingTime: "",
  2029. timeType:0,
  2030. content: "",
  2031. state: 2,
  2032. multiWorktime:0,
  2033. worktimeList:[],
  2034. degreeId: null,
  2035. auditUserList: [],
  2036. }],
  2037. },
  2038. workRules: {
  2039. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2040. },
  2041. chooseParticipVisible: false,
  2042. logining: false,
  2043. isDisable: false,
  2044. timeType:[],
  2045. deptMembData: [
  2046. ],
  2047. //部门人员树状结构
  2048. data: [
  2049. {
  2050. id: -1,
  2051. label: this.$t('lable.allStaff'),
  2052. membCount:0
  2053. },
  2054. {
  2055. id: 0,
  2056. label: this.$t('lable.unassigned'),
  2057. }
  2058. ],
  2059. allData:{},
  2060. batchShowData:{},
  2061. option: [],
  2062. deptOptionList: [],
  2063. depData: {
  2064. id: -1,
  2065. label: this.$t('lable.allStaff'),
  2066. },
  2067. defaultProps: {
  2068. children: 'children',
  2069. label: 'label'
  2070. },
  2071. isNew: false,
  2072. selected: false,
  2073. valuet: new Date(),
  2074. domObj: null,
  2075. participator:[],
  2076. chosenMembCount:0,
  2077. jsDay: 0,
  2078. jsTime: 0,
  2079. falsss: false,
  2080. weidu: [],
  2081. weiduList: [],
  2082. yonghuUser: [],
  2083. dateAr: [],
  2084. batchSubFillDialog: false,
  2085. isSubstiS: false,
  2086. fillWeekDialogVisi: false,
  2087. fillWeekDialogVisiCustom: false,
  2088. zhoData: [],
  2089. weekDateRange: [],
  2090. btnZho: false,
  2091. weekDataLoading: false,
  2092. changdu: 6,
  2093. tianxieDialogVisible: false,
  2094. scopess: {},
  2095. zhoBao: {
  2096. time: '',
  2097. workingTime: '',
  2098. progress: '',
  2099. con: '',
  2100. subProjectId: '',
  2101. stage: '',
  2102. subProjectList: [],
  2103. stages: [],
  2104. },
  2105. zhoBaoIdx: '',
  2106. zhoBaoName: '',
  2107. zhis: {},
  2108. dealList: [],
  2109. toViewDialogVisible: false,
  2110. toViewList: [],
  2111. toViewloading: true,
  2112. toViewForm: {
  2113. pageIndex: '1',
  2114. pageSize: '20',
  2115. total: 0,
  2116. },
  2117. toViewloadings: false,
  2118. tabPositionss: 'top',
  2119. monthTotal: 0,
  2120. monthTotalPage: 0,
  2121. monthTotalLages: 20,
  2122. monthWorkData: [],
  2123. monthNotWorkDate: [],
  2124. monthWorkDataS1: [],
  2125. monthnotTotal: 0,
  2126. monthnotTotalPage: 0,
  2127. monthnotTotalLages: 20,
  2128. monthNotWorkDateS1: [],
  2129. deptMembDataText: '',
  2130. isFlag: false,
  2131. isMore: false,
  2132. stateKey: '0',
  2133. expandDate: [],
  2134. notifySelList:[],
  2135. departmentList: [],
  2136. approvalProcessDialog: false,
  2137. approvalProcessData: [],
  2138. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2139. 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')],
  2140. isWeekend: false,
  2141. canCancelInDialog: false,
  2142. approveinData: {},
  2143. approveinDialog: false,
  2144. reportCanDelete: false,
  2145. weeklyFilledTimeDialog: false,
  2146. weeklyFilledTimeList: [],
  2147. weeklyFilledTimeLoading: false,
  2148. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2149. weeklyFilledTimeCanDelete: false,
  2150. weeklyFilledTimeDate: null,
  2151. leaveAllNum: 0,
  2152. dataLoading: false,
  2153. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2154. vacationTime: {},
  2155. integrationProjectList: [],
  2156. totalReportHours: 0, // 合计的工时
  2157. workTimeForMinYi:0,
  2158. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2159. weekIndex: 1,
  2160. weekParentData: {},
  2161. deptIdForNoReport:[],
  2162. nameAearch: '', // 企业微信姓名搜索
  2163. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2164. deptMembDataLoading: false,
  2165. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2166. {
  2167. id: 4811,
  2168. // id: 10,
  2169. name: '陕西柘中建设工程有限公司'
  2170. }
  2171. ],
  2172. pushWorkTimeLogDig:false,
  2173. pushWorkTimeLogData:[],
  2174. };
  2175. },
  2176. watch: {
  2177. deptMembDataText(val) {
  2178. this.$refs.chooseMembTree.filter(val);
  2179. }
  2180. },
  2181. filters: {
  2182. // 过滤
  2183. amounts(value) {
  2184. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2185. return 0
  2186. }
  2187. var zhi = +value + 0
  2188. return zhi.toFixed(1)
  2189. },
  2190. // zhoData
  2191. zhoData(value, arr) {
  2192. var dateArray = value.split("-");
  2193. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2194. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2195. // console.log(arr[date.getDay()])
  2196. // return "周" + "日一二三四五六".charAt(date.getDay());
  2197. return arr[date.getDay()]
  2198. },
  2199. // 过滤数字
  2200. numbers(value) {
  2201. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2202. return 0
  2203. }
  2204. return value
  2205. },
  2206. },
  2207. computed: {},
  2208. mounted() {
  2209. var now = new Date();
  2210. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2211. this.today = t;
  2212. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2213. this.exportParam.dateRange = [startStr,t];
  2214. this.getAllDate(1);
  2215. this.getReportList();
  2216. this.getProjectList();
  2217. this.getFillProjectList();
  2218. this.getTimeType();
  2219. this.getDepartment();
  2220. this.scrollFunction()
  2221. this.userssHu();
  2222. if(this.user.timeType.reportAuditType == 3){
  2223. this.getAllUsersList()
  2224. }
  2225. if (this.user.company.packageProject == 1) {
  2226. this.getBasecostItemList();
  2227. }
  2228. if(this.user.timeType.lockWorktime){
  2229. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2230. }
  2231. //设置了下限
  2232. if (this.user.timeType.minReportTime) {
  2233. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2234. }
  2235. const that = this
  2236. if(this.user.userNameNeedTranslate == 1) {
  2237. that.dataLoading = that.$store.state.dataLoading
  2238. this.upDataLoading()
  2239. setTimeout(()=>{
  2240. that.dataLoading = that.$store.state.dataLoading
  2241. }, 1000)
  2242. }
  2243. if (this.user.companyId == this.yuzhongCompId) {
  2244. this.getJobResponList();
  2245. }
  2246. },
  2247. methods: {
  2248. ...mapMutations(['upDataLoading']),
  2249. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2250. isCustomization(userInfo, permissionArray) {
  2251. const { companyId } = userInfo
  2252. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2253. return isReportPictureRequired
  2254. },
  2255. //任务被选中
  2256. onTaskSelected(domainItem) {
  2257. //取服务
  2258. if (domainItem.taskId) {
  2259. var that = this;
  2260. var param = {taskId:domainItem.taskId};
  2261. if (this.isSubstitude) {
  2262. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2263. param.userId = this.workForm.userId[0];
  2264. }
  2265. }
  2266. this.http.post('/task/getMyTaskService',param, res => {
  2267. if (res.code == "ok") {
  2268. // domainItem.workContentList = res.data;
  2269. that.$set(domainItem, 'sapServiceId', null);
  2270. that.$set(domainItem, 'serviceList', res.data);
  2271. } else {
  2272. this.$message({
  2273. message: res.msg,
  2274. type: "error"
  2275. });
  2276. }
  2277. },error => {
  2278. this.$message({
  2279. message: error,
  2280. type: "error"
  2281. });
  2282. }
  2283. );
  2284. } else {
  2285. //清空服务
  2286. }
  2287. },
  2288. onBatchTimeChange() {
  2289. //反向计算每日工作时长
  2290. if (this.workForm.createDate) {
  2291. let sdate = new Date(this.workForm.createDate[0]);
  2292. let edate = new Date(this.workForm.createDate[1]);
  2293. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2294. console.log('days===', days)
  2295. if (days < 0) {
  2296. return;
  2297. }
  2298. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2299. //总时长发生改变,自动按比例计算
  2300. this.workForm.domains.forEach(d=>{
  2301. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2302. });
  2303. }
  2304. },
  2305. //更新工作内容列表
  2306. updateJobContent(domainItem) {
  2307. var that = this;
  2308. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2309. if (res.code == "ok") {
  2310. // domainItem.workContentList = res.data;
  2311. that.$set(domainItem, 'extraField3', null);
  2312. that.$set(domainItem, 'workContentList', res.data);
  2313. } else {
  2314. this.$message({
  2315. message: res.msg,
  2316. type: "error"
  2317. });
  2318. }
  2319. },error => {
  2320. this.$message({
  2321. message: error,
  2322. type: "error"
  2323. });
  2324. }
  2325. );
  2326. },
  2327. updateResponse(domainItem) {
  2328. var that = this;
  2329. var selectPid = domainItem.projectId;
  2330. domainItem.extraField2 = null;
  2331. domainItem.extraField3 = null;
  2332. if (selectPid && domainItem.extraField1) {
  2333. //是否非项目
  2334. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2335. console.log('==========','isPublic=='+isPublic);
  2336. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2337. console.log(filteredRespList);
  2338. domainItem.filteredRespList = filteredRespList;
  2339. }
  2340. },
  2341. getJobResponList() {
  2342. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2343. if (res.code == "ok") {
  2344. this.jobResponseList = res.data;
  2345. } else {
  2346. this.$message({
  2347. message: res.msg,
  2348. type: "error"
  2349. });
  2350. }
  2351. },error => {
  2352. this.$message({
  2353. message: error,
  2354. type: "error"
  2355. });
  2356. }
  2357. );
  2358. },
  2359. openModImportTime(row) {
  2360. this.showModImportTimeDialog = true;
  2361. this.modItemDataId = row.id;
  2362. },
  2363. delImportTime(row) {
  2364. let rowId = row.id;
  2365. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2366. confirmButtonText: this.$t('btn.determine'),
  2367. cancelButtonText: this.$t('btn.cancel'),
  2368. type: "warning"
  2369. })
  2370. .then(() => {
  2371. this.http.post('/report-import-log/delete',{
  2372. id: rowId
  2373. },res => {
  2374. if (res.code == "ok") {
  2375. this.$message({
  2376. message: '删除成功',
  2377. type: "success"
  2378. });
  2379. this.getToView();
  2380. } else {
  2381. this.$message({
  2382. message: res.msg,
  2383. type: "error"
  2384. });
  2385. }
  2386. },error => {
  2387. this.$message({
  2388. message: error,
  2389. type: "error"
  2390. });
  2391. }
  2392. );
  2393. }).catch(() => {this.startDeleting = false});
  2394. },
  2395. confirmChangeModTime() {
  2396. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2397. this.$message({
  2398. message: '请选择时间',
  2399. type: "error"
  2400. });
  2401. return;
  2402. }
  2403. this.http.post('/report-import-log/changeTime',{
  2404. modLogDateTime: this.modImportTime,
  2405. modImportUserId: this.modImportUserId,
  2406. id: this.modItemDataId
  2407. },res => {
  2408. if (res.code == "ok") {
  2409. this.$message({
  2410. message: '修改成功',
  2411. type: "success"
  2412. });
  2413. this.getToView();
  2414. this.showModImportTimeDialog = false;
  2415. } else {
  2416. this.$message({
  2417. message: res.msg,
  2418. type: "error"
  2419. });
  2420. }
  2421. },error => {
  2422. this.$message({
  2423. message: error,
  2424. type: "error"
  2425. });
  2426. }
  2427. );
  2428. },
  2429. confirmBatchApproveReport() {
  2430. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2431. this.$message({
  2432. message: '请选择日期范围',
  2433. type: "error"
  2434. });
  2435. return;
  2436. }
  2437. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2438. confirmButtonText: this.$t('btn.determine'),
  2439. cancelButtonText: this.$t('btn.cancel'),
  2440. type: "warning"
  2441. })
  2442. .then(() => {
  2443. this.startDeleting = true;
  2444. let obj = {
  2445. startDate: this.deleteReportParam.date[0],
  2446. endDate: this.deleteReportParam.date[1]
  2447. }
  2448. if(this.deleteReportParam.departmentId) {
  2449. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2450. } else {
  2451. obj.departmentId = null
  2452. }
  2453. this.http.post('/report/batchApproveByDate',obj,res => {
  2454. if (res.code == "ok") {
  2455. this.$message({
  2456. message: '审核通过',
  2457. type: "success"
  2458. });
  2459. this.getReportList();
  2460. this.getDepartment();
  2461. this.startDeleting = false;
  2462. } else {
  2463. this.$message({
  2464. message: res.msg,
  2465. type: "error"
  2466. });
  2467. }
  2468. },error => {
  2469. this.$message({
  2470. message: error,
  2471. type: "error"
  2472. });
  2473. }
  2474. );
  2475. }).catch(() => {this.startDeleting = false});
  2476. },
  2477. confirmBatchDelReport() {
  2478. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2479. this.$message({
  2480. message: '请选择部门或人员',
  2481. type: "error"
  2482. });
  2483. return;
  2484. }
  2485. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2486. this.$message({
  2487. message: '请选择日期范围',
  2488. type: "error"
  2489. });
  2490. return;
  2491. }
  2492. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2493. confirmButtonText: this.$t('btn.determine'),
  2494. cancelButtonText: this.$t('btn.cancel'),
  2495. type: "warning"
  2496. })
  2497. .then(() => {
  2498. this.startDeleting = true;
  2499. this.http.post('/report/batchDelete',{
  2500. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2501. startDate: this.deleteReportParam.date[0],
  2502. endDate: this.deleteReportParam.date[1],
  2503. deptId: this.deleteReportParam.deptId[0]
  2504. },res => {
  2505. if (res.code == "ok") {
  2506. this.$message({
  2507. message: this.$t('message.successfullyDeleted'),
  2508. type: "success"
  2509. });
  2510. this.getReportList();
  2511. this.getDepartment();
  2512. this.startDeleting = false;
  2513. } else {
  2514. this.$message({
  2515. message: res.msg,
  2516. type: "error"
  2517. });
  2518. }
  2519. },error => {
  2520. this.$message({
  2521. message: error,
  2522. type: "error"
  2523. });
  2524. }
  2525. );
  2526. }).catch(() => {this.startDeleting = false});
  2527. },
  2528. getRecentlyProject() {
  2529. this.http.post('/project/nearProject',{},res => {
  2530. if(res.code == 'ok'){
  2531. let topObj = {
  2532. label: '最近选择项目',
  2533. peojectList: res.data
  2534. }
  2535. let botomObj = {
  2536. label: '全部项目',
  2537. peojectList: this.fillProjectList
  2538. }
  2539. //最近项目如果在fillProjectList中不存在,需要移除
  2540. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2541. this.integrationProjectList = [topObj, botomObj]
  2542. }else {
  2543. this.$message({
  2544. message: res.msg,
  2545. type: 'error'
  2546. })
  2547. }
  2548. },err => {
  2549. this.$message({
  2550. message: err,
  2551. type: 'error'
  2552. })
  2553. })
  2554. },
  2555. handlePictureCardPreview(file, index) {
  2556. console.log(file, index)
  2557. let arr = []
  2558. let imgArr = this.workForm.domains[index].imgListUrl
  2559. for(var i in imgArr) {
  2560. arr.push(imgArr[i].url)
  2561. }
  2562. console.log(arr, '图片数据')
  2563. const $viewer = this.$viewerApi({
  2564. images: arr
  2565. });
  2566. },
  2567. // 图片上传
  2568. addImg(e, index) {
  2569. console.log(e, '数据')
  2570. let formData = new FormData()
  2571. formData.append('multipartFile', e.file)
  2572. this.http.uploadFile('/common/uploadFile', formData,
  2573. res => {
  2574. if (res.code == "ok") {
  2575. this.$message({
  2576. message: this.$t('uploadedsuccessfully'),
  2577. type: "success"
  2578. });
  2579. if(!this.workForm.domains[index].imgList) {
  2580. this.workForm.domains[index].imgList = []
  2581. this.workForm.domains[index].imgListUrl = []
  2582. }
  2583. this.workForm.domains[index].imgList.push(res.data)
  2584. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2585. } else {
  2586. this.$message({message: res.msg,type: "error"});
  2587. }
  2588. console.log(this.workForm.domains[index])
  2589. },
  2590. error => {this.$message({message: error,type: "error"});
  2591. });
  2592. },
  2593. // 删除图片
  2594. delImg(file,fileList, index) {
  2595. console.log(file, fileList)
  2596. let idx = 0
  2597. for(let i in fileList) {
  2598. if(fileList[i].uid == file.uid) {
  2599. idx = i
  2600. }
  2601. }
  2602. this.workForm.domains[index].imgList.splice(idx, 1)
  2603. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2604. console.log(this.workForm.domains[index])
  2605. },
  2606. test(){
  2607. console.log('test',this.workForm.domains);
  2608. },
  2609. getHour(s1, s2) {
  2610. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2611. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2612. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2613. var ms = s2.getTime() - s1.getTime();
  2614. if (ms < 0) return 0;
  2615. let ma = ms / 1000 / 60 / 60
  2616. return ma; //小时
  2617. },
  2618. refreshWXCardTime(workdate) {
  2619. if (!workdate) return;
  2620. this.syncTimeLoading = true;
  2621. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2622. date: workdate,
  2623. },res => {
  2624. this.syncTimeLoading = false;
  2625. if(res.code == 'ok'){
  2626. this.workForm.time = res.data.time;
  2627. }else {
  2628. this.$message({
  2629. message: res.msg,
  2630. type: 'error'
  2631. })
  2632. }
  2633. },err => {
  2634. this.syncTimeLoading = false;
  2635. this.$message({
  2636. message: err,
  2637. type: 'error'
  2638. })
  2639. })
  2640. },
  2641. refreshAttendance(workdate) {
  2642. if (!workdate) return;
  2643. this.syncTimeLoading = true;
  2644. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2645. startDate: workdate[0],
  2646. endDate: workdate[1]
  2647. },res => {
  2648. this.syncTimeLoading = false;
  2649. if(res.code == 'ok'){
  2650. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2651. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2652. this.totalReportHours = this.workTimeForMinYi;
  2653. }else {
  2654. this.$message({
  2655. message: res.msg,
  2656. type: 'error'
  2657. })
  2658. }
  2659. },err => {
  2660. this.syncTimeLoading = false;
  2661. this.$message({
  2662. message: err,
  2663. type: 'error'
  2664. })
  2665. })
  2666. },
  2667. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2668. this.weeklyFilledTimeDialog = true
  2669. this.weeklyFilledTimeLoading = true
  2670. this.weeklyFilledTimeDate = parameterDate
  2671. this.http.post('/report/getReportList',{
  2672. date: parameterDate,
  2673. userId: this.user.id
  2674. },res => {
  2675. this.weeklyFilledTimeLoading = false
  2676. if(res.code == 'ok'){
  2677. this.weeklyFilledTimeList = res.data[0].data
  2678. let candelete = true
  2679. for(let i in this.weeklyFilledTimeList){
  2680. if(this.weeklyFilledTimeList[i].state < 2){
  2681. candelete = false
  2682. }
  2683. }
  2684. this.weeklyFilledTimeCanDelete = candelete
  2685. }else {
  2686. this.$message({
  2687. message: res.msg,
  2688. type: 'error'
  2689. })
  2690. }
  2691. },err => {
  2692. this.weeklyFilledTimeLoading = false
  2693. this.$message({
  2694. message: err,
  2695. type: 'error'
  2696. })
  2697. })
  2698. },
  2699. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2700. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2701. confirmButtonText: this.$t('btn.determine'),
  2702. cancelButtonText: this.$t('btn.cancel'),
  2703. type: "warning"
  2704. })
  2705. .then(() => {
  2706. this.http.post('/report/delete',{
  2707. userId: this.user.id,
  2708. date: this.weeklyFilledTimeDate
  2709. },res => {
  2710. if (res.code == "ok") {
  2711. this.$message({
  2712. message: this.$t('message.successfullyDeleted'),
  2713. type: "success"
  2714. });
  2715. this.getWeeklyWorkTime()
  2716. this.getReportList();
  2717. this.getDepartment();
  2718. this.weeklyFilledTimeDialog = false;
  2719. } else {
  2720. this.$message({
  2721. message: res.msg,
  2722. type: "error"
  2723. });
  2724. }
  2725. },error => {
  2726. this.$message({
  2727. message: error,
  2728. type: "error"
  2729. });
  2730. }
  2731. );
  2732. }).catch(() => {});
  2733. },
  2734. getApprovalProcess(item){
  2735. // console.log('this.date',this.choseDate);
  2736. this.http.post('/report-log/get',{
  2737. creatorId: item.id,
  2738. createDate: sessionStorage.msg
  2739. },res => {
  2740. if(res.code == 'ok'){
  2741. this.approvalProcessDialog = true
  2742. if(this.user.userNameNeedTranslate == 1) {
  2743. for(var i in res.data) {
  2744. let obj = {
  2745. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2746. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2747. }
  2748. res.data[i].msgCon = obj
  2749. }
  2750. }
  2751. this.approvalProcessData = res.data
  2752. console.log(this.approvalProcessData, '数据卡看')
  2753. }else{
  2754. this.$message({
  2755. message: res.msg,
  2756. type: 'error'
  2757. })
  2758. }
  2759. },err => {
  2760. this.$message({
  2761. message: err,
  2762. type: 'error'
  2763. })
  2764. })
  2765. },
  2766. filterNode(value, data) {
  2767. if (!value) return true;
  2768. return data.label.indexOf(value) !== -1;
  2769. },
  2770. triggerCalculateOT(index) {
  2771. var str = this.workForm.domains[index].overtimeHours + ''
  2772. if(str.indexOf('.') != '-1') {
  2773. var s = str.split('.')[0]
  2774. var st = str.split('.')[1]
  2775. var sts = st.split('')
  2776. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2777. }
  2778. },
  2779. searchScreen(e){
  2780. if(e){
  2781. this.monthNotWorkDateS1 = []
  2782. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2783. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2784. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2785. }
  2786. }
  2787. if (this.monthNotWorkDateS1.length > 50) {
  2788. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2789. }else{
  2790. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2791. }
  2792. // if (this.monthNotWorkDateS1.length > 0) {
  2793. // setTimeout(() => {
  2794. // this.tableListenernot()
  2795. // }, 1000);
  2796. // }
  2797. }else{
  2798. this.monthWorkDataS1 = []
  2799. for (let i = 0; i < this.monthWorkData.length; i++) {
  2800. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2801. this.monthWorkDataS1.push(this.monthWorkData[i])
  2802. }
  2803. }
  2804. if (this.monthWorkDataS1.length > 50) {
  2805. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2806. }else{
  2807. this.monthWorkDataS = this.monthWorkDataS1
  2808. }
  2809. // if (this.monthWorkDataS1.length > 0) {
  2810. // setTimeout(() => {
  2811. // this.tableListener()
  2812. // }, 1000);
  2813. // }
  2814. }
  2815. },
  2816. addUpload(data) {
  2817. // var zhi = data.fileName.split('.')[0]
  2818. // var sss = zhi + '.xlsx'
  2819. // return
  2820. var filePath = '/upload/' + data.serverName;
  2821. const a = document.createElement('a'); // 创建a标签
  2822. a.setAttribute('download', data.fileName);// download属性
  2823. a.setAttribute('href', filePath);// href链接
  2824. a.click(); //自执行点击事件
  2825. a.remove();
  2826. },
  2827. restrictNumber(targetId) {
  2828. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2829. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2830. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2831. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2832. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2833. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2834. inpu.value = parseFloat(inpu.value);
  2835. }
  2836. },
  2837. //获取项目下的任务分组
  2838. getTaskGroups(domain, index) {
  2839. domain.groupId=null;
  2840. this.http.post('/task-group/listMyJoinGroup',{
  2841. projectId: domain.projectId,
  2842. isSubstitude: this.isSubstitude ? 1 : 0
  2843. },
  2844. res => {
  2845. if (res.code == "ok") {
  2846. this.workForm.domains[index].taskGroups = res.data;
  2847. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2848. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2849. // this.getGroupStages(domain, index);
  2850. // }
  2851. this.$forceUpdate();
  2852. }
  2853. },
  2854. error => {
  2855. this.$message({
  2856. message: error,
  2857. type: "error"
  2858. });
  2859. }
  2860. );
  2861. },
  2862. //下载填报工时占比报表
  2863. downloadProjectRatio() {
  2864. this.exportUserRatio = true;
  2865. // let now = new Date();
  2866. // let month = now.getMonth();//默认看上个月的
  2867. // let monthStr = month<10? ('0'+month): month;
  2868. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2869. const today = new Date();
  2870. const year = today.getFullYear();
  2871. const month = today.getMonth() + 1;
  2872. let lastMonthYear, lastMonth;
  2873. if (month === 1) {
  2874. lastMonthYear = year - 1;
  2875. lastMonth = 12;
  2876. } else {
  2877. lastMonthYear = year;
  2878. lastMonth = month - 1;
  2879. }
  2880. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2881. console.log('赋值 ==>', this.ratioYmonth)
  2882. },
  2883. confirmDownloadRatio() {
  2884. this.startRatioExporting = true;
  2885. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2886. ymonth: this.ratioYmonth
  2887. },
  2888. res => {
  2889. if (res.code == "ok") {
  2890. this.startRatioExporting = false;
  2891. var filePath = res.data;
  2892. const a = document.createElement('a'); // 创建a标签
  2893. var data = filePath.split("/");
  2894. a.setAttribute('download', data[data.length-1]);// download属性
  2895. a.setAttribute('href', filePath);// href链接
  2896. a.click(); //自执行点击事件
  2897. a.remove();
  2898. } else {
  2899. this.startRatioExporting = false;
  2900. this.$message({
  2901. message: res.msg,
  2902. type: "error"
  2903. });
  2904. }
  2905. },
  2906. error => {
  2907. this.checkinLoading = false;
  2908. this.$message({
  2909. message: error,
  2910. type: "error"
  2911. });
  2912. }
  2913. );
  2914. },
  2915. //下载带企业微信考勤数据的工时统计模板
  2916. downloadCheckInExcel() {
  2917. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2918. startDate: this.importWxParam.date[0],
  2919. endDate: this.importWxParam.date[1],
  2920. },
  2921. res => {
  2922. if (res.code == "ok") {
  2923. var filePath = res.data;
  2924. const a = document.createElement('a'); // 创建a标签
  2925. var data = filePath.split("/");
  2926. a.setAttribute('download', data[data.length-1]);// download属性
  2927. a.setAttribute('href', filePath);// href链接
  2928. a.click(); //自执行点击事件
  2929. a.remove();
  2930. } else {
  2931. this.$message({
  2932. message: res.msg,
  2933. type: "error"
  2934. });
  2935. }
  2936. },
  2937. error => {
  2938. this.checkinLoading = false;
  2939. this.$message({
  2940. message: error,
  2941. type: "error"
  2942. });
  2943. }
  2944. );
  2945. },
  2946. pre() {
  2947. if (this.active == 0) return;
  2948. this.active--;
  2949. },
  2950. next() {
  2951. this.active++;
  2952. },
  2953. triggerTotalTime(index) {
  2954. var item = this.checkinList[index];
  2955. var total = 0.0;
  2956. for (var i=0;i<this.projectColumns.length; i++) {
  2957. var key = this.projectColumns[i];
  2958. if (item[key] != null && item[key] != '') {
  2959. total += parseFloat(item[key]);
  2960. }
  2961. }
  2962. item.totalFillTime = total;
  2963. },
  2964. //提交批量代填的数据
  2965. submitBatchSubFillData() {
  2966. var data = JSON.stringify(this.checkinList);
  2967. this.http.post('/user-corpwx-time/submitProjectTime',{
  2968. json: data,
  2969. projectColumns: JSON.stringify(this.projectColumns)
  2970. },
  2971. res => {
  2972. if (res.code == "ok") {
  2973. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2974. this.importWxDialog = false;
  2975. }
  2976. },
  2977. error => {
  2978. this.checkinLoading = false;
  2979. this.$message({
  2980. message: error,
  2981. type: "error"
  2982. });
  2983. }
  2984. );
  2985. },
  2986. loadCheckInData() {
  2987. if (this.importWxParam.date == null) {
  2988. this.checkinList = [];
  2989. return;
  2990. }
  2991. this.checkinLoading = true;
  2992. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2993. startDate: this.importWxParam.date[0],
  2994. endDate: this.importWxParam.date[1],
  2995. },
  2996. res => {
  2997. if (res.code == "ok") {
  2998. this.checkinLoading = false;
  2999. this.checkinList = res.data.list;
  3000. this.projectColumns = res.data.projects;
  3001. // 自定义表格会导致表格错乱,需重新计算表格
  3002. this.$nextTick(()=>{
  3003. this.$refs.tab.doLayout()
  3004. })
  3005. }
  3006. },
  3007. error => {
  3008. this.checkinLoading = false;
  3009. this.$message({
  3010. message: error,
  3011. type: "error"
  3012. });
  3013. }
  3014. );
  3015. },
  3016. importCardTime(item) {
  3017. //首先判断文件类型
  3018. let str = item.file.name.split(".");
  3019. let format = str[str.length - 1];
  3020. if (format != "xls" && format != "xlsx") {
  3021. this.$message({
  3022. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3023. type: "error"
  3024. });
  3025. } else {
  3026. this.importingData = true;
  3027. let formData = new FormData();
  3028. formData.append("multipartFile", item.file);
  3029. formData.append("companyId", this.user.companyId);
  3030. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3031. res => {
  3032. this.$refs.uploadCardTime.clearFiles();
  3033. this.importingData = false;
  3034. if (res.code == "ok") {
  3035. //换成弹出框,以免有人等了半天回来啥也没看到
  3036. this.$message({
  3037. message: '导入考勤时长成功',
  3038. type: "success"
  3039. });
  3040. } else {
  3041. this.$message({
  3042. message: res.msg,
  3043. type: "error"
  3044. });
  3045. }
  3046. },
  3047. error => {
  3048. this.$refs.upload.clearFiles();
  3049. this.listLoading = false;
  3050. this.$message({
  3051. message: error,
  3052. type: "error"
  3053. });
  3054. });
  3055. }
  3056. },
  3057. batchImportWxData(item) {
  3058. //首先判断文件类型
  3059. let str = item.file.name.split(".");
  3060. let format = str[str.length - 1];
  3061. if (format != "xls" && format != "xlsx") {
  3062. this.$message({
  3063. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3064. type: "error"
  3065. });
  3066. } else {
  3067. this.importingData = true;
  3068. let formData = new FormData();
  3069. formData.append("file", item.file);
  3070. formData.append("companyId", this.user.companyId);
  3071. formData.append("withCheckIn", 1);
  3072. this.http.uploadFile('/report/importData', formData,
  3073. res => {
  3074. this.$refs.upload.clearFiles();
  3075. this.showImportResult = true;
  3076. this.importingData = false;
  3077. if (res.code == "ok") {
  3078. //换成弹出框,以免有人等了半天回来啥也没看到
  3079. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3080. this.getReportList();
  3081. this.importWxDialog = false;
  3082. } else {
  3083. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3084. }
  3085. },
  3086. error => {
  3087. this.$refs.upload.clearFiles();
  3088. this.listLoading = false;
  3089. this.$message({
  3090. message: error,
  3091. type: "error"
  3092. });
  3093. });
  3094. }
  3095. },
  3096. batchImportData(item) {
  3097. //首先判断文件类型
  3098. let str = item.file.name.split(".");
  3099. let format = str[str.length - 1];
  3100. if (format != "xls" && format != "xlsx") {
  3101. this.$message({
  3102. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3103. type: "error"
  3104. });
  3105. } else {
  3106. this.importingData = true;
  3107. let formData = new FormData();
  3108. formData.append("file", item.file);
  3109. formData.append("companyId", this.user.companyId);
  3110. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3111. this.http.uploadFile(url, formData,
  3112. res => {
  3113. this.$refs.upload.clearFiles();
  3114. this.importingData = false;
  3115. this.showImportResult = true;
  3116. if (res.code == "ok") {
  3117. //换成弹出框,以免有人等了半天回来啥也没看到
  3118. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3119. this.getReportList();
  3120. this.importWXDialog = false;
  3121. } else {
  3122. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3123. }
  3124. },
  3125. error => {
  3126. this.$refs.upload.clearFiles();
  3127. this.importingData = false;
  3128. this.$message({
  3129. message: error,
  3130. type: "error"
  3131. });
  3132. });
  3133. }
  3134. },
  3135. userssHu() {
  3136. this.http.post('/time-type/getCompanyTimeSetting',{
  3137. companyId: this.user.companyId
  3138. },
  3139. res => {
  3140. if (res.code == "ok") {
  3141. this.yonghuUser = res.data
  3142. }
  3143. },
  3144. error => {
  3145. this.$message({
  3146. message: error,
  3147. type: "error"
  3148. });
  3149. }
  3150. );
  3151. },
  3152. iptBlur(i) {
  3153. if(this.isBatch == 0) {
  3154. return
  3155. }
  3156. this.http.post('/report/getWorkDays',{
  3157. startDate: this.workForm.createDate[0],
  3158. endDate: this.workForm.createDate[1]
  3159. },
  3160. res => {
  3161. if (res.code == "ok") {
  3162. this.jsDay = res.data
  3163. this.chuji(i)
  3164. } else {
  3165. this.$message({
  3166. message: res.msg,
  3167. type: "error"
  3168. });
  3169. }
  3170. },
  3171. error => {
  3172. this.$message({
  3173. message: error,
  3174. type: "error"
  3175. });
  3176. }
  3177. );
  3178. //明夷硬编码获取
  3179. if (this.user.company.companyName == this.mingyiName) {
  3180. this.getWorkTimeForMinYi();
  3181. }
  3182. },
  3183. getWorkTimeForMinYi(){
  3184. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3185. startDate: this.workForm.createDate[0],
  3186. endDate: this.workForm.createDate[1]
  3187. },
  3188. res => {
  3189. if (res.code == "ok") {
  3190. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3191. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3192. this.totalReportHours = this.workTimeForMinYi;
  3193. } else {
  3194. this.$message({
  3195. message: res.msg,
  3196. type: "error"
  3197. });
  3198. this.workForm.createDate = [];
  3199. }
  3200. },
  3201. error => {
  3202. this.$message({
  3203. message: error,
  3204. type: "error"
  3205. });
  3206. }
  3207. );
  3208. },
  3209. chuji(i) {
  3210. if(i == 0) {
  3211. this.seleChn(1)
  3212. } else if(i == 1) {
  3213. this.seleChn(0)
  3214. } else if(i == 2) {
  3215. if(this.workForm.domains[0].multiWorktime > 0) {
  3216. this.iptChangs()
  3217. } else {
  3218. this.iptChang()
  3219. }
  3220. } else if(i == 3) {
  3221. this.seleChn(0)
  3222. }
  3223. },
  3224. seleChn(e,domain) {
  3225. if(e == 1) {
  3226. for(var i in this.workForm.domains) {
  3227. if(this.workForm.domains[i].timeType == 0) {
  3228. this.workForm.domains[i].workingTime = 8
  3229. } else {
  3230. this.workForm.domains[i].workingTime = 4
  3231. }
  3232. }
  3233. }
  3234. var quanbu = 0
  3235. var spl = this.workForm.domains
  3236. var zhi = ''
  3237. for(var i in spl) {
  3238. var sp = +spl[i].workingTime + 0
  3239. zhi = this.jsDay * sp
  3240. quanbu = +quanbu + zhi
  3241. }
  3242. this.jsTime = quanbu
  3243. this.totalReportHours = quanbu
  3244. let worktime = this.jsTime
  3245. // 自动计算加班时长
  3246. if(this.isBatch != 0){
  3247. worktime = this.jsTime / this.jsDay
  3248. }
  3249. if(this.user.timeType.fillOvertime && domain){
  3250. let isover = false
  3251. let alltime = 0
  3252. let allover = 0 //此处alltime同上面的worktime
  3253. for(let d in spl){
  3254. if(spl[d].isOvertime){
  3255. isover = true
  3256. allover += spl[d].overtimeHours*1
  3257. }
  3258. alltime += spl[d].workingTime*1
  3259. }
  3260. if(domain.overtimeHours){
  3261. allover = allover - domain.overtimeHours
  3262. }
  3263. if(worktime*1 > this.user.timeType.allday){
  3264. if(isover){
  3265. if(alltime > (allover + this.user.timeType.allday)){
  3266. this.$set(domain,'isOvertime',true)
  3267. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3268. }else{
  3269. this.$set(domain,'isOvertime',false)
  3270. this.$set(domain,'overtimeHours',null)
  3271. if(alltime < (allover + this.user.timeType.allday)){
  3272. let overtime = allover + this.user.timeType.allday - alltime
  3273. for(let pi in spl){
  3274. if(spl[pi].overtimeHours){
  3275. if((overtime - spl[pi].overtimeHours*1) > 0){
  3276. overtime = overtime - spl[pi].overtimeHours*1
  3277. this.$set(spl[pi],'isOvertime',false)
  3278. this.$set(spl[pi],'overtimeHours',null)
  3279. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3280. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3281. break
  3282. }else{
  3283. this.$set(spl[pi],'isOvertime',false)
  3284. this.$set(spl[pi],'overtimeHours',null)
  3285. break
  3286. }
  3287. }
  3288. }
  3289. }
  3290. }
  3291. }else{
  3292. this.$set(domain,'isOvertime',true)
  3293. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3294. }
  3295. }else{
  3296. for(let di in spl){
  3297. this.$set(spl[di],'isOvertime',false)
  3298. this.$set(spl[di],'overtimeHours',null)
  3299. }
  3300. }
  3301. }
  3302. },
  3303. iptChang() {
  3304. var sl = this.workForm.domains
  3305. let timeArr = []
  3306. for(var i in sl) {
  3307. if(sl[i].startTime && sl[i].endTime) {
  3308. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3309. }
  3310. }
  3311. this.getTimeHours(timeArr)
  3312. // for(let j in arrNum) {
  3313. // this.timeJsonStr += arrNum[j]
  3314. // if(flg) {
  3315. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3316. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3317. // }
  3318. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3319. // flg = true
  3320. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3321. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3322. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3323. // }
  3324. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3325. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3326. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3327. // }
  3328. // }
  3329. },
  3330. iptChangs() {
  3331. var sl = this.workForm.domains
  3332. let timeArr = []
  3333. for(var i in sl) {
  3334. for(var j in sl[i].worktimeList){
  3335. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3336. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3337. }
  3338. }
  3339. }
  3340. this.getTimeHours(timeArr)
  3341. },
  3342. // 调用接口或去数据
  3343. getTimeHours(arr) {
  3344. this.http.post('/report/getHoursByTimeRange',{
  3345. timeJsonStr: JSON.stringify(arr)
  3346. },res => {
  3347. if(res.code === 'ok') {
  3348. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3349. } else {
  3350. this.$message({
  3351. message: res.msg,
  3352. type: 'error'
  3353. })
  3354. }
  3355. },err => {
  3356. this.$message({
  3357. message: err,
  3358. type: 'error'
  3359. })
  3360. })
  3361. },
  3362. // 按周填报调用接口计算时间
  3363. async getWeekHoursByTimeRange(timeRange) {
  3364. const url = '/report/getHoursByTimeRange';
  3365. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3366. var that = this;
  3367. return new Promise((resolve, reject) => {
  3368. this.http.post(url, data, function(res) {
  3369. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3370. }, function(err) {
  3371. reject(err);
  3372. });
  3373. });
  3374. },
  3375. removeTimeItem(item, index) {
  3376. item.worktimeList.splice(index, 1);
  3377. this.iptChangs()
  3378. },
  3379. //添加工时
  3380. addNewWorktime(index, item) {
  3381. if(item.worktimeList == null ) {
  3382. item.worktimeList = []
  3383. }
  3384. item.worktimeList.push({});
  3385. },
  3386. //复制项目
  3387. copyProject(index) {
  3388. var leftProgress = 10;
  3389. if (this.reportTimeType.type == 3) {
  3390. //计算已经待分配工时比例
  3391. let array = this.workForm.domains;
  3392. let totalProgress = 0;
  3393. for (var i=0;i<array.length; i++) {
  3394. totalProgress += array[i].progress;
  3395. }
  3396. if (totalProgress < 100) {
  3397. leftProgress = 100 - totalProgress;
  3398. }
  3399. }
  3400. var newIndex = index+1;
  3401. var itemDomain = {
  3402. projectId: this.workForm.domains[index].projectId,
  3403. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3404. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3405. ),
  3406. content: "",
  3407. progress:leftProgress,
  3408. state:2,//2-表示待提交
  3409. };
  3410. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3411. if (this.reportTimeType.type == 0) {
  3412. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3413. var length = this.workForm.domains.length;
  3414. if (length == 2) {
  3415. this.showAddMore = false;
  3416. }
  3417. }
  3418. this.selectProject(itemDomain, newIndex);
  3419. },
  3420. pushWorkTime(){
  3421. let url=''
  3422. if(this.user.timeType.syncSap == 1){
  3423. url='/report/pushProjectReportToSap'
  3424. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3425. var pushDate = this.date + day;
  3426. this.$confirm('确认推送'+pushDate+'的工时?', '提示', {
  3427. confirmButtonText: '确定',
  3428. cancelButtonText: '取消',
  3429. type: 'info'
  3430. }).then(() => {
  3431. const loading = this.$loading({
  3432. lock: true,
  3433. text: '正在推送中,请耐心等待。',
  3434. spinner: 'el-icon-loading',
  3435. background: 'rgba(0, 0, 0, 0.7)'
  3436. });
  3437. this.http.post(url,{
  3438. pushDate: pushDate
  3439. },res => {
  3440. loading.close();
  3441. if(res.code == 'ok'){
  3442. this.$message({
  3443. type: 'success',
  3444. message: res.data
  3445. });
  3446. }else{
  3447. this.$message({
  3448. type: 'error',
  3449. message: res.msg
  3450. })
  3451. }
  3452. },err => {
  3453. loading.close();
  3454. this.$message({
  3455. type: 'error',
  3456. message: err
  3457. })
  3458. })
  3459. }).catch(() => {
  3460. });
  3461. }else{
  3462. url='/report/pushReportDataToThird'
  3463. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3464. confirmButtonText: '确定',
  3465. cancelButtonText: '取消',
  3466. type: 'info'
  3467. }).then(() => {
  3468. const loading = this.$loading({
  3469. lock: true,
  3470. text: '正在推送中,请耐心等待。',
  3471. spinner: 'el-icon-loading',
  3472. background: 'rgba(0, 0, 0, 0.7)'
  3473. });
  3474. this.http.post(url,{
  3475. yearMonth: this.date
  3476. },res => {
  3477. loading.close();
  3478. if(res.code == 'ok'){
  3479. this.$message({
  3480. type: 'success',
  3481. message: '推送成功!'
  3482. });
  3483. }else{
  3484. this.$message({
  3485. type: 'error',
  3486. message: res.msg
  3487. })
  3488. }
  3489. },err => {
  3490. loading.close();
  3491. this.$message({
  3492. type: 'error',
  3493. message: err
  3494. })
  3495. })
  3496. }).catch(() => {
  3497. });
  3498. }
  3499. },
  3500. showWorkTime(){
  3501. this.monthWorkTimeDialog = true;
  3502. this.searchKeyword = ''
  3503. this.WorktimeDatepickValue = this.istoMonth()
  3504. if(this.WorktimeDatepickValue.length == 0){
  3505. let newdate = new Date();
  3506. let nowdate = newdate.toLocaleDateString();
  3507. let getauto = this.getAutoWeekDate(nowdate)
  3508. let nowwd = [getauto[0],getauto[6]]
  3509. this.WorktimeDatepickValue = nowwd
  3510. }
  3511. this.showMonthWorkTime()
  3512. },
  3513. handleClick(t,e){
  3514. if (t.name == "first") {
  3515. this.showMonthWorkTime()
  3516. }else{
  3517. this.showMonthNotWorkTime()
  3518. }
  3519. },
  3520. //导出员工每日填报工时数
  3521. exportMembWorkHours() {
  3522. this.http.post(
  3523. "/report/exportUserDailyWorkTime",
  3524. {
  3525. // month: this.date,
  3526. startDate: this.WorktimeDatepickValue[0],
  3527. endDate: this.WorktimeDatepickValue[1],
  3528. },
  3529. (res) => {
  3530. if (res.code == "ok") {
  3531. let url = res.data;
  3532. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3533. }
  3534. },
  3535. (error) => {
  3536. this.$message({
  3537. message: error,
  3538. type: "error",
  3539. });
  3540. }
  3541. );
  3542. },
  3543. exportMembNotWorkHours() {
  3544. this.http.post(
  3545. "/report/exportNoReportUserList",
  3546. {
  3547. // month: this.date,
  3548. startDate: this.WorktimeDatepickValue[0],
  3549. endDate: this.WorktimeDatepickValue[1],
  3550. },
  3551. (res) => {
  3552. if (res.code == "ok") {
  3553. let url = res.data;
  3554. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3555. }
  3556. },
  3557. (error) => {
  3558. this.$message({
  3559. message: error,
  3560. type: "error",
  3561. });
  3562. }
  3563. );
  3564. },
  3565. downloadByA(name, url) {
  3566. const a = document.createElement("a"); // 创建a标签
  3567. a.setAttribute("download", name); // download属性
  3568. a.setAttribute("href", url); // href链接
  3569. a.click(); // 自执行点击事件
  3570. a.remove();
  3571. },
  3572. // 是否本月判断
  3573. istoMonth(){
  3574. let todate = new Date()
  3575. let tomonth = todate.getMonth() + 1
  3576. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3577. if(this.date == adate){
  3578. return []
  3579. }else{
  3580. let sedate = new Date(this.date)
  3581. let semonth = sedate.getMonth() + 1
  3582. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3583. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3584. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3585. return [sedates1, sedates2]
  3586. }
  3587. },
  3588. showMonthWorkTime() {
  3589. this.monthTotalPage = 0,
  3590. this.tbload = true
  3591. this.http.post(
  3592. "/report/getUserDailyWorkTime",
  3593. // "/report/getNoReportUserList",
  3594. {
  3595. // month: this.date,
  3596. startDate: this.WorktimeDatepickValue[0],
  3597. endDate: this.WorktimeDatepickValue[1],
  3598. },
  3599. (res) => {
  3600. if (res.code == "ok") {
  3601. this.tbload = false;
  3602. this.pickDateArray = res.data.days;
  3603. // console.log('dataarray',res.data.days);
  3604. this.monthWorkData = res.data.list;
  3605. // this.monthWorkDataS = this.monthWorkData
  3606. // this.monthWorkDataS1 = res.data.list
  3607. this.monthTotal = res.data.list.length
  3608. if (this.monthWorkData.length > 50) {
  3609. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3610. }else{
  3611. this.monthWorkDataS = this.monthWorkData
  3612. }
  3613. this.searchScreen(0)
  3614. // this.monthWorkDataS = infoList
  3615. // 判断
  3616. // if (this.monthWorkDataS1.length > 0) {
  3617. // setTimeout(() => {
  3618. // this.tableListener()
  3619. // }, 1000);
  3620. // }
  3621. this.$nextTick(function(){
  3622. this.$refs.hasworkTbl.doLayout();
  3623. });
  3624. // this.$forceUpdate()
  3625. }
  3626. },
  3627. (error) => {
  3628. this.tbload = false
  3629. this.$message({
  3630. message: error,
  3631. type: "error",
  3632. });
  3633. }
  3634. );
  3635. },
  3636. // tableListener(){
  3637. // let that = this;
  3638. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3639. // // 添加scroll监听事件
  3640. // dom.addEventListener("scroll", function () {
  3641. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3642. // if (scrollDistance < 2) {
  3643. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3644. // that.monthTotalPage++; //当前页数自增
  3645. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3646. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3647. // var infoList = arrList.splice(
  3648. // that.monthTotalPage * that.monthTotalLages,
  3649. // that.monthTotalLages
  3650. // );
  3651. // // 数据添加
  3652. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3653. // }
  3654. // }
  3655. // })
  3656. // },
  3657. showMonthNotWorkTime() {
  3658. this.monthTotalPage = 0,
  3659. this.tbload = true,
  3660. this.http.post(
  3661. "/report/getNoReportUserList",
  3662. {
  3663. startDate: this.WorktimeDatepickValue[0],
  3664. endDate: this.WorktimeDatepickValue[1],
  3665. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3666. },
  3667. (res) => {
  3668. if (res.code == "ok") {
  3669. this.tbload = false
  3670. this.monthNotWorkDate = res.data;
  3671. // this.monthNotWorkDateS1 = res.data
  3672. this.monthnotTotal = res.data.length
  3673. // 2222111
  3674. if (this.monthNotWorkDate.length > 50) {
  3675. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3676. } else {
  3677. this.monthNotWorkDateS = this.monthNotWorkDate
  3678. }
  3679. this.searchScreen(1)
  3680. // 判断
  3681. // if (this.monthnotworkDateS1.length > 0) {
  3682. // setTimeout(() => {
  3683. // this.tableListenernot()
  3684. // }, 1000);
  3685. // }
  3686. this.$nextTick(function(){
  3687. this.$refs.hasworkTbl2.doLayout();
  3688. });
  3689. }
  3690. },
  3691. (error) => {
  3692. this.tbload = false
  3693. this.$message({
  3694. message: error,
  3695. type: "error",
  3696. });
  3697. }
  3698. );
  3699. },
  3700. // tableListenernot(){
  3701. // let that = this;
  3702. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3703. // dom.addEventListener("scroll", function () {
  3704. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3705. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3706. // if (scrollDistance2 < 2) {
  3707. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3708. // that.monthnotTotalPage++; //当前页数自增
  3709. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3710. // var infoList = arrList.splice(
  3711. // that.monthnotTotalPage * that.monthnotTotalLages,
  3712. // that.monthnotTotalLages
  3713. // );
  3714. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3715. // }
  3716. // }
  3717. // })
  3718. // },
  3719. listScroll(){
  3720. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3721. this.isMore = true
  3722. setTimeout(()=>{
  3723. this.isMore = false
  3724. },1000)
  3725. }else {
  3726. this.isFlag = true
  3727. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3728. this.monthWorkDataS = datalist
  3729. setTimeout(()=>{
  3730. this.isFlag = false
  3731. },300)
  3732. }
  3733. },
  3734. notListScroll(){
  3735. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3736. this.isMore = true
  3737. setTimeout(()=>{
  3738. this.isMore = false
  3739. },1000)
  3740. }else {
  3741. this.isFlag = true
  3742. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3743. this.monthNotWorkDateS = datalist
  3744. // console.log('length',this.monthNotWorkDateS.length)
  3745. setTimeout(()=>{
  3746. this.isFlag = false
  3747. },300)
  3748. }
  3749. },
  3750. // 获取默认这zhou日期参数 222
  3751. getLastWeek(e){
  3752. let newdate = new Date()
  3753. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3754. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3755. if(e){
  3756. this.WorktimeDatepickValue = lastwd
  3757. this.showMonthWorkTime()
  3758. }else{
  3759. this.WorktimeDatepickValue = lastwd
  3760. this.showMonthNotWorkTime()
  3761. }
  3762. },
  3763. getThisWeek(e){
  3764. let newdate = new Date();
  3765. let nowdate = newdate.toLocaleDateString();
  3766. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3767. if(e){
  3768. this.WorktimeDatepickValue = nowwd
  3769. this.showMonthWorkTime()
  3770. }else{
  3771. this.WorktimeDatepickValue = nowwd
  3772. this.showMonthNotWorkTime()
  3773. }
  3774. },
  3775. getDoubleLastWeek(e){
  3776. let newdate = new Date()
  3777. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3778. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3779. if(e){
  3780. this.WorktimeDatepickValue = nextwd
  3781. this.showMonthWorkTime()
  3782. }else{
  3783. this.WorktimeDatepickValue = nextwd
  3784. this.showMonthNotWorkTime()
  3785. }
  3786. },
  3787. alreadyAllDate(stime,etime){
  3788. let diffdate = new Array();
  3789. let i=0;
  3790. while(stime<=etime){
  3791. let dateArray = stime.split("-");
  3792. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3793. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3794. let stimewk = this.weekDay[date.getDay()]
  3795. 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')
  3796. 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])
  3797. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3798. let stime_ts = new Date(stime).getTime();
  3799. let next_date = stime_ts + (24*60*60*1000);
  3800. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3801. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3802. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3803. stime = next_dates_y+next_dates_m+next_dates_d;
  3804. i++;
  3805. }
  3806. return diffdate
  3807. },
  3808. getAutoWeekDate(e) {
  3809. let dateString = e;
  3810. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3811. if (dateString.match(dateStringReg)) {
  3812. let presentDate = new Date(dateString),
  3813. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3814. return Array.from(new Array(7), function (val, index) {
  3815. let formatDate = new Date(
  3816. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3817. );
  3818. return (
  3819. formatDate.getFullYear() +
  3820. "-" +
  3821. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3822. "-" +
  3823. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3824. );
  3825. });
  3826. } else {
  3827. throw new Error(
  3828. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3829. );
  3830. }
  3831. },
  3832. onProgressChange() {
  3833. this.$forceUpdate();
  3834. },
  3835. showChooseMembTree() {
  3836. this.chosenMembCount = this.participator.length;
  3837. this.chooseParticipVisible = true;
  3838. },
  3839. onTreeItemChange() {
  3840. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3841. var list = chosenList.filter(item=>item.isUser == 1);
  3842. this.chosenMembCount = list.length;
  3843. },
  3844. findUserInTree() {
  3845. if (this.filterName == '') {
  3846. this.deptMembData = this.allMembData;
  3847. } else {
  3848. var list = this.findRecursively(this.filterName, this.allMembData);
  3849. this.deptMembData = list;
  3850. }
  3851. },
  3852. findRecursively(username, list) {
  3853. var filterList = [];
  3854. for (var i=0;i<list.length; i++) {
  3855. if (list[i].isUser == 1) {
  3856. if (list[i].label.indexOf(username) >= 0) {
  3857. //匹配上了
  3858. filterList.push(list[i]);
  3859. }
  3860. } else if (list[i].children != null && list[i].children.length > 0) {
  3861. var subList = this.findRecursively(username, list[i].children);
  3862. if (subList.length > 0) {
  3863. subList.forEach(s=>filterList.push(s));
  3864. }
  3865. }
  3866. }
  3867. return filterList;
  3868. },
  3869. //确定选择参与人
  3870. chooseParticip() {
  3871. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3872. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3873. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3874. if (this.user.company.packageProject == 1) {
  3875. if (this.chosenMembList.length > 1) {
  3876. this.$message({
  3877. message: '每次仅支持代填一个人',
  3878. type: "error",
  3879. });
  3880. return;
  3881. }
  3882. }
  3883. this.chooseParticipVisible = false;
  3884. this.workForm.userNames = '';
  3885. this.workForm.userId = [];
  3886. this.participator = [];
  3887. for (var i=0;i<this.chosenMembList.length; i++) {
  3888. this.workForm.userId.push(this.chosenMembList[i].id);
  3889. this.workForm.userNames += this.chosenMembList[i].label+',';
  3890. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3891. this.participator.push(item);
  3892. }
  3893. if (this.workForm.userNames.length > 0) {
  3894. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3895. }
  3896. if(this.user.userNameNeedTranslate == 1) {
  3897. if(this.workForm.userNames) {
  3898. this.workForm.userNames = this.workForm.userNames.split(',')
  3899. }
  3900. }
  3901. },
  3902. notifySel(sel){
  3903. // console.log(sel);
  3904. this.notifySelList = sel
  3905. },
  3906. //微信通知人员填写
  3907. Notify(code) {
  3908. if (this.notifySelList.length == 0) return;
  3909. var ids = '';
  3910. this.notifySelList.forEach(f=>{
  3911. ids += f.id+',';
  3912. })
  3913. this.http.post('/user/pushFillReport',{
  3914. ids: ids, date: this.curDate,
  3915. code: code
  3916. },
  3917. res => {
  3918. if (res.code == "ok") {
  3919. this.$message({
  3920. message: this.$t('message.sentSuccessfully'),
  3921. type: "success"
  3922. });
  3923. }
  3924. },
  3925. error => {
  3926. this.$message({
  3927. message: error,
  3928. type: "error"
  3929. });
  3930. }
  3931. );
  3932. },
  3933. //导出人员列表
  3934. exportMemb() {
  3935. if (this.fillMembList.length == 0) return;
  3936. var ids = '';
  3937. this.fillMembList.forEach(f=>{
  3938. ids += f.id+',';
  3939. })
  3940. this.http.post('/user/exportMembList',{
  3941. ids: ids,isFill: this.isFill, date: this.curDate
  3942. },
  3943. res => {
  3944. if (res.code == "ok") {
  3945. var aTag = document.createElement('a');
  3946. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3947. aTag.href = res.data;
  3948. aTag.click();
  3949. }
  3950. },
  3951. error => {
  3952. this.$message({
  3953. message: error,
  3954. type: "error"
  3955. });
  3956. }
  3957. );
  3958. },
  3959. showMembList(fill) {
  3960. this.membListVisible = true;
  3961. if (fill == 0) {
  3962. this.fillMembList = this.unFillList;
  3963. this.isFill = false;
  3964. let leaveList = []
  3965. let unleaveList = []
  3966. for(let i in this.fillMembList){
  3967. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3968. leaveList.push(this.fillMembList[i])
  3969. }else{
  3970. unleaveList.push(this.fillMembList[i])
  3971. }
  3972. }
  3973. this.fillMembList = unleaveList
  3974. this.fillMembList_leave = leaveList
  3975. } else if(fill == 1){
  3976. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3977. this.isFill = true;
  3978. }else{
  3979. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3980. this.isFill = true;
  3981. }
  3982. },
  3983. //获取自己填写的日报状态
  3984. getReportFillStatus() {
  3985. this.http.post('/report/getReportFillStatus',{
  3986. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3987. },
  3988. res => {
  3989. if (res.code == "ok") {
  3990. this.fillStatusList = res.data;
  3991. this.allDate.forEach(d=>{
  3992. var fillInfo = null;
  3993. d.state = null;
  3994. this.fillStatusList.forEach(s=>{
  3995. // console.log(d)
  3996. var d1 = s.createDate.split('-')[2];
  3997. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  3998. // console.log(d2, '我被执行了')
  3999. if (d1.indexOf('0') == 0) {
  4000. d1 = d1.substring(1,d1.length);
  4001. }
  4002. if (d1 == d2) {
  4003. d.state = s.state;
  4004. }
  4005. })
  4006. })
  4007. this.$forceUpdate();
  4008. }
  4009. },
  4010. error => {
  4011. this.$message({
  4012. message: error,
  4013. type: "error"
  4014. });
  4015. }
  4016. );
  4017. },
  4018. scrollFunction () {
  4019. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4020. if (this.domObj.attachEvent) { // IE
  4021. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4022. } else if (this.domObj.addEventListener) {
  4023. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4024. }
  4025. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4026. },
  4027. mouseScroll(event) { // google 浏览器下
  4028. let detail = event.wheelDelta || event.detail
  4029. let moveForwardStep = -1
  4030. let moveBackStep = 1
  4031. let step = 0
  4032. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4033. event.preventDefault() // 阻止浏览器默认事件
  4034. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4035. },
  4036. // //左右滚动
  4037. // wheel(e){
  4038. // var a = document.getElementById("dateScroll");
  4039. // var scroll_width = 80; //滚动一下的距离
  4040. // var e = e || window.event, v;
  4041. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4042. // if(v>3||-v>3) v=-v;
  4043. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4044. // e.preventDefault(); //阻止浏览器的默认滚动
  4045. // },
  4046. showExportDialog() {
  4047. this.exportType = 0
  4048. this.exportDialog = true;
  4049. },
  4050. showExportTimeDialog() {
  4051. this.exportTimeDialog = true;
  4052. },
  4053. changeAllTime() {
  4054. //总时长发生改变,自动按比例计算
  4055. this.workForm.domains.forEach(d=>{
  4056. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4057. });
  4058. //计算jsTime
  4059. if (this.workForm.createDate) {
  4060. let sdate = new Date(this.workForm.createDate[0]);
  4061. let edate = new Date(this.workForm.createDate[1]);
  4062. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4063. console.log('days===', days)
  4064. if (days < 0) {
  4065. days = 0;
  4066. }
  4067. this.jsTime = this.reportTimeType.allday * days;
  4068. }
  4069. },
  4070. // 是否加班的单机事件
  4071. check() {
  4072. this.selected = !this.selected
  4073. this.isNew = this.selected
  4074. },
  4075. updateSubProject() {
  4076. this.$forceUpdate();
  4077. },
  4078. selectDegreeId(domain, index) {
  4079. this.http.post('/report/defaultDegree',{
  4080. projectId: domain.projectId
  4081. },
  4082. res => {
  4083. if (res.code == "ok") {
  4084. if(res.data) {
  4085. this.workForm.domains[index].degreeId = res.data.id + ''
  4086. this.$forceUpdate();
  4087. }
  4088. }
  4089. },
  4090. error => {
  4091. this.$message({
  4092. message: error,
  4093. type: "error"
  4094. });
  4095. }
  4096. );
  4097. },
  4098. //项目选中了, 加载子项目
  4099. selectProject(domain, index) {
  4100. if(!domain.projectId){
  4101. return;
  4102. }
  4103. // 默认选中上次填写的自定义维度
  4104. if(this.yonghuUser.customDegreeActive == 1) {
  4105. this.selectDegreeId(domain, index)
  4106. }
  4107. // console.log('projectId===',domain.projectId);
  4108. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4109. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4110. this.http.post('/sub-project/list',{
  4111. projectId: domain.projectId,
  4112. isReport: true
  4113. },
  4114. res => {
  4115. //清空之前选中的子项目
  4116. // this.workForm.domains[index].subProjectId = 0;
  4117. if (res.code == "ok") {
  4118. this.workForm.domains[index].subProjectList = res.data;
  4119. this.workForm.domains[index].subProjectId = null;
  4120. this.$forceUpdate();
  4121. }
  4122. },
  4123. error => {
  4124. this.$message({
  4125. message: error,
  4126. type: "error"
  4127. });
  4128. }
  4129. );
  4130. //项目相关的近期任务
  4131. if (this.user.company.packageProject == 1) {
  4132. this.getRecentTaskList(domain, index);
  4133. //获取项目相关专业
  4134. if (this.user.company.packageEngineering == 1) {
  4135. this.getProjectProfessions(domain, index);
  4136. }
  4137. //获取项目下的任务分组
  4138. this.getTaskGroups(domain, index);
  4139. }
  4140. // 获取项目相关的维度
  4141. // domain.degreeId = null
  4142. this.$set(domain,'degreeId',null)
  4143. this.$set(domain,'multiDegrIdArray',null)
  4144. this.dimension(domain, index);
  4145. //获取项目审核人
  4146. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4147. this.getProjectAuditorList(domain, index);
  4148. } else {
  4149. //按分组的负责人来审核
  4150. domain.projectAuditorId = null;
  4151. domain.projectAuditorName = null;
  4152. domain.auditUserList = null;
  4153. }
  4154. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4155. if (this.reportTimeType.type == 3) {
  4156. //新增项目时,自动计算
  4157. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4158. domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
  4159. }
  4160. //加载昱众的工作职责
  4161. if (this.user.companyId == this.yuzhongCompId) {
  4162. this.updateResponse(domain);
  4163. }
  4164. },
  4165. getRecentTaskList(domain, index) {
  4166. //刷新任务时,清空服务
  4167. this.$set(domain, 'sapServiceId', null);
  4168. this.$set(domain, 'taskId', null);
  4169. var param = {
  4170. projectId: domain.projectId,
  4171. isSubstitude:this.isSubstitude?1:0,
  4172. };
  4173. if (domain.groupId) {
  4174. param.groupId = domain.groupId;
  4175. }
  4176. if (domain.stage) {
  4177. param.stage = domain.stage;
  4178. }
  4179. //专业版代填,获取代填员工的任务
  4180. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4181. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4182. this.$message({
  4183. message: '请选择代填的员工',
  4184. type: "error"
  4185. });
  4186. return;
  4187. } else {
  4188. param.userId = this.workForm.userId[0];
  4189. }
  4190. }
  4191. this.http.post('/task/getRecentTask',param,
  4192. res => {
  4193. if (res.code == "ok") {
  4194. this.workForm.domains[index].allTaskList = res.data;
  4195. this.workForm.domains[index].taskList = res.data;
  4196. this.$forceUpdate();
  4197. }
  4198. },
  4199. error => {
  4200. this.$message({
  4201. message: error,
  4202. type: "error"
  4203. });
  4204. }
  4205. );
  4206. },
  4207. //获取项目审核人
  4208. getProjectAuditorList(domainItem, index) {
  4209. if(domainItem.projectId == '') {
  4210. return
  4211. }
  4212. domainItem.projectAuditorId = null;
  4213. domainItem.projectAuditorName = null;
  4214. this.http.post('/project-auditor/getList',{
  4215. projectId: domainItem.projectId,
  4216. },
  4217. res => {
  4218. if (res.code == "ok") {
  4219. domainItem.auditUserList = res.data;
  4220. if (res.data.length==0) {
  4221. this.$message({
  4222. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4223. type: "error"
  4224. });
  4225. } else if (res.data.length==1) {
  4226. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4227. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4228. }
  4229. this.$forceUpdate();
  4230. }
  4231. },
  4232. error => {
  4233. this.$message({
  4234. message: error,
  4235. type: "error"
  4236. });
  4237. }
  4238. );
  4239. },
  4240. // 获取维度数据
  4241. dimension(domain, index) {
  4242. if(domain.projectId == '') {
  4243. return
  4244. }
  4245. this.http.post('/project/getDegreeList',{
  4246. projectId: domain.projectId,
  4247. },
  4248. res => {
  4249. if (res.code == "ok") {
  4250. // console.log("维度数据",res.data);
  4251. this.workForm.domains[index].wuduList = res.data
  4252. // this.workForm = this.workForm
  4253. this.$forceUpdate()
  4254. }
  4255. },
  4256. error => {
  4257. this.$message({
  4258. message: error,
  4259. type: "error"
  4260. });
  4261. }
  4262. );
  4263. },
  4264. //切换任务阶段
  4265. changeStages(domain, index) {
  4266. if (domain.stage == null || domain.stage == '') {
  4267. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4268. } else {
  4269. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4270. }
  4271. this.getRecentTaskList(domain, index);
  4272. this.$forceUpdate();
  4273. },
  4274. getGroupStages(domain, index, keepStage) {
  4275. // console.log(domain);
  4276. if(!domain.groupId){
  4277. domain.projectAuditorId = ''
  4278. domain.stages = []
  4279. if(this.user.timeType.reportAuditType >= 1){
  4280. domain.auditUserList = []
  4281. }
  4282. this.$forceUpdate();
  4283. return
  4284. }
  4285. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4286. res => {
  4287. if (res.code == "ok") {
  4288. if (!keepStage) {
  4289. domain.stage = '';
  4290. }
  4291. domain.stages = res.data;
  4292. this.getRecentTaskList(domain, index);
  4293. this.$forceUpdate();
  4294. }
  4295. },
  4296. error => {
  4297. this.$message({
  4298. message: error,
  4299. type: "error"
  4300. });
  4301. });
  4302. //检查当前的项目是否需要获取分组的负责人
  4303. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4304. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4305. res => {
  4306. if (res.code == "ok") {
  4307. domain.getProjectAuditorList = res.data;
  4308. domain.auditUserList = res.data;
  4309. if (res.data.length==1) {
  4310. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4311. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4312. } else if (res.data.length==0) {
  4313. domain.projectAuditorId = null;
  4314. domain.projectAuditorName = null;
  4315. }
  4316. this.$forceUpdate();
  4317. }
  4318. },
  4319. error => {
  4320. this.$message({
  4321. message: error,
  4322. type: "error"
  4323. });
  4324. });
  4325. }
  4326. },
  4327. getProjectProfessions(domain, index) {
  4328. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4329. res => {
  4330. if (res.code == "ok") {
  4331. this.workForm.domains[index].professionProgress = res.data;
  4332. this.$forceUpdate();
  4333. }
  4334. },
  4335. error => {
  4336. this.$message({
  4337. message: error,
  4338. type: "error"
  4339. });
  4340. });
  4341. },
  4342. //删除自己的日报
  4343. deleteReport() {
  4344. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4345. confirmButtonText: this.$t('btn.determine'),
  4346. cancelButtonText: this.$t('btn.cancel'),
  4347. type: "warning"
  4348. })
  4349. .then(() => {
  4350. this.listLoading = true;
  4351. this.http.post('/report/delete',{
  4352. userId: this.user.id,
  4353. date: this.workForm.createDate
  4354. },
  4355. res => {
  4356. this.listLoading = false;
  4357. if (res.code == "ok") {
  4358. this.$message({
  4359. message: this.$t('message.successfullyDeleted'),
  4360. type: "success"
  4361. });
  4362. this.getReportList();
  4363. this.getDepartment();
  4364. this.dialogVisible = false;
  4365. } else {
  4366. this.$message({
  4367. message: res.msg,
  4368. type: "error"
  4369. });
  4370. }
  4371. },
  4372. error => {
  4373. this.listLoading = false;
  4374. this.$message({
  4375. message: error,
  4376. type: "error"
  4377. });
  4378. }
  4379. );
  4380. })
  4381. .catch(() => {});
  4382. },
  4383. // 管理员删除日报
  4384. guanli(item) {
  4385. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4386. let param = {date: this.date + day, userId: item.id};
  4387. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4388. confirmButtonText: this.$t('btn.determine'),
  4389. cancelButtonText: this.$t('btn.cancel'),
  4390. type: "warning"
  4391. })
  4392. .then(() => {
  4393. this.listLoading = true;
  4394. this.http.post('/report/delete',param,
  4395. res => {
  4396. this.listLoading = false;
  4397. if (res.code == "ok") {
  4398. this.$message({
  4399. message: this.$t('message.successfullyDeleted'),
  4400. type: "success"
  4401. });
  4402. this.getReportList();
  4403. this.getDepartment();
  4404. this.dialogVisible = false;
  4405. } else {
  4406. this.$message({
  4407. message: res.msg,
  4408. type: "error"
  4409. });
  4410. }
  4411. },
  4412. error => {
  4413. this.listLoading = false;
  4414. this.$message({
  4415. message: error,
  4416. type: "error"
  4417. });
  4418. }
  4419. );
  4420. })
  4421. .catch(() => {});
  4422. },
  4423. selectAll() {
  4424. if (this.isAllSelect) {
  4425. var keys = [];
  4426. this.reportNames.forEach(b=>{
  4427. keys.push(b.id);
  4428. })
  4429. this.$refs.approveTree.setCheckedKeys(keys);
  4430. } else {
  4431. this.$refs.approveTree.setCheckedKeys([]);
  4432. }
  4433. },
  4434. removeEmptyNode(list) {
  4435. for (var i=0;i<list.length;i++) {
  4436. var cnt = 0;
  4437. if (list[i].membCount == 0) {
  4438. list.splice(i, 1);
  4439. i--;
  4440. } else if (list[i].children != null) {
  4441. this.removeEmptyNode(list[i].children);
  4442. }
  4443. }
  4444. },
  4445. calculateMembCount(list) {
  4446. for (var i in list) {
  4447. var cnt = 0;
  4448. if (list[i].children != null) {
  4449. this.calculateMembCount(list[i].children);
  4450. for (var m in list[i].children) {
  4451. cnt += list[i].children[m].membCount;
  4452. }
  4453. }
  4454. if (list[i].isUser == 1) {
  4455. cnt++;
  4456. this.membCount++;
  4457. }
  4458. list[i].membCount = cnt;
  4459. }
  4460. },
  4461. stateChange() {
  4462. // console.log(this.allData,'alldate');
  4463. this.membCount = 0;
  4464. if (this.selectState == -1) {
  4465. //全部状态
  4466. this.data = this.allData;
  4467. } else {
  4468. //未填报
  4469. this.seluserText = ''
  4470. var newData = JSON.parse(JSON.stringify(this.allData));
  4471. this.filterState(this.selectState, newData);
  4472. this.data = newData;
  4473. }
  4474. this.calculateMembCount(this.data);
  4475. this.data[0].membCount = this.membCount;//总人数
  4476. },
  4477. //按状态过滤部门人员
  4478. filterState(state, list) {
  4479. for (var i =0;i<list.length; i++) {
  4480. var obj = list[i];
  4481. if (obj.isUser == 1) {
  4482. var match = false;
  4483. if (state == -2) {
  4484. if (obj.state == null) {
  4485. match = true;
  4486. }
  4487. } else {
  4488. if (obj.state == state) {
  4489. match = true;
  4490. }
  4491. }
  4492. if (!match) {
  4493. list.splice(i, 1);
  4494. i--;
  4495. } else {
  4496. }
  4497. } else {
  4498. if (obj.children != null) {
  4499. this.filterState(state, obj.children);
  4500. }
  4501. }
  4502. }
  4503. },
  4504. //a按名称过滤部门人员
  4505. async seluserforText(){
  4506. const { userNameNeedTranslate } = this.user
  4507. this.membCount = 0;
  4508. var newData = JSON.parse(JSON.stringify(this.allData));
  4509. let textList = [this.seluserText]
  4510. if(userNameNeedTranslate == 1) {
  4511. this.dataLoading = true
  4512. let res = await this.postData('/user/getEmployeeList', {
  4513. keyword: this.seluserText,
  4514. cursor: '',
  4515. departmentId: -1,
  4516. pageIndex: 1,
  4517. pageSize: 1000
  4518. })
  4519. textList = res.data.records.map(item => item.name)
  4520. this.dataLoading = false
  4521. }
  4522. // return
  4523. console.log(textList, '<=== textList')
  4524. this.seluserforTextin(this.seluserText, newData, textList)
  4525. console.log(newData, 'Data')
  4526. this.data = newData;
  4527. this.calculateMembCount(this.data);
  4528. this.data[0].membCount = this.membCount;//总人数
  4529. },
  4530. seluserforTextin(text, list, textList = []){
  4531. for (var i =0;i<list.length; i++) {
  4532. var obj = list[i];
  4533. if (obj.isUser == 1) {
  4534. var match = false;
  4535. // if (obj.label.indexOf(text) != -1) {
  4536. // match = true
  4537. // }
  4538. if(textList.some(item => item.includes(obj.label))) {
  4539. match = true
  4540. }
  4541. if (!match) {
  4542. list.splice(i, 1);
  4543. i--;
  4544. } else {
  4545. }
  4546. } else {
  4547. if (obj.children != null) {
  4548. this.seluserforTextin(text, obj.children, textList);
  4549. }
  4550. }
  4551. }
  4552. },
  4553. // 当节点发生变化时
  4554. nodeChangeExpand(data) {
  4555. // 保存当前展开的节点
  4556. let flag = false
  4557. this.nodeModelData.some(item => {
  4558. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4559. flag = true
  4560. return true
  4561. }
  4562. })
  4563. if (!flag) { // 不存在则存到数组里
  4564. this.nodeModelData.push(data.id)
  4565. }
  4566. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4567. },
  4568. nodeChangeCollapse(data) {
  4569. console.log(this.nodeModelData)
  4570. this.nodeModelData.some((item, i) => {
  4571. if (item === data.id) {
  4572. this.nodeModelData.length = i
  4573. }
  4574. })
  4575. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4576. },
  4577. // 部门列表点击
  4578. handleNodeClick(data) {
  4579. // this.dealList = data
  4580. this.theValues(data.id, this.allData)
  4581. // this.depData = data;
  4582. var list = [];
  4583. if (data.id == -1) {
  4584. this.deptId = null;
  4585. this.targetUid = null;
  4586. list = this.data;
  4587. } else if (data.isUser == 1) {
  4588. this.deptId = null;
  4589. this.targetUid = data.id;
  4590. } else {
  4591. this.deptId = data.id;
  4592. this.targetUid = null;
  4593. list.push(data);
  4594. }
  4595. this.getReportList();
  4596. if (list.length > 0) {
  4597. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4598. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4599. }
  4600. },
  4601. exportPushLog(){
  4602. this.http.post('/sap-sync-log/export',{},
  4603. res => {
  4604. if (res.code == "ok") {
  4605. var filePath = res.data;
  4606. var fName = '推送日志.xlsx'
  4607. const a = document.createElement('a'); // 创建a标签
  4608. a.setAttribute('download', fName);// download属性
  4609. a.setAttribute('href', filePath);// href链接
  4610. a.click(); //自执行点击事件
  4611. a.remove();
  4612. } else {
  4613. this.$message({
  4614. message: res.msg,
  4615. type: "error"
  4616. });
  4617. }
  4618. },
  4619. error => {
  4620. this.$message({
  4621. message: error,
  4622. type: "error"
  4623. });
  4624. });
  4625. },
  4626. theValues(id, item) {
  4627. for(var i in item) {
  4628. if(item[i].id == id) {
  4629. this.depData = item[i]
  4630. if(id == '-1') {
  4631. this.translation = '1'
  4632. } else {
  4633. if(item[i].children) {
  4634. this.translation = '2'
  4635. } else {
  4636. this.translation = '3'
  4637. }
  4638. }
  4639. return
  4640. } else {
  4641. if(item[i].children) {
  4642. this.theValues(id, item[i].children)
  4643. }
  4644. }
  4645. }
  4646. },
  4647. //获取可以选择的代填的人员列表
  4648. getSubstitudeUserDeptList() {
  4649. if (this.deptMembData.length == 0) {
  4650. this.http.post("/department/listMyMembs", {},
  4651. res => {
  4652. if (res.code == "ok") {
  4653. let noAllData = JSON.parse(JSON.stringify(res.data));
  4654. if (noAllData.length > 0) {
  4655. // if (noAllData[0].label == '全部人员') {
  4656. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4657. noAllData.splice(0,1);
  4658. }
  4659. }
  4660. this.setUserToDept(noAllData);
  4661. this.deptMembData = noAllData;
  4662. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4663. console.log(this.deptMembData, '代填人员数据')
  4664. } else {
  4665. this.$message({
  4666. message: res.msg,
  4667. type: "error"
  4668. });
  4669. }
  4670. },
  4671. error => {
  4672. this.$message({
  4673. message: error,
  4674. type: "error"
  4675. });
  4676. });
  4677. }
  4678. },
  4679. // 获取部门列表
  4680. getDepartmentForApprove() {
  4681. this.http.post( this.port.manage.depList, {},
  4682. res => {
  4683. if (res.code == "ok") {
  4684. var list1 = JSON.parse(JSON.stringify(res.data));
  4685. this.deptOptionList = this.changeArr(list1);
  4686. console.log(this.deptOptionList, '部门')
  4687. } else {
  4688. this.$message({
  4689. message: res.msg,
  4690. type: "error"
  4691. });
  4692. }
  4693. },
  4694. error => {
  4695. this.$message({
  4696. message: error,
  4697. type: "error"
  4698. });
  4699. });
  4700. },
  4701. // 获取部门列表
  4702. getDepartment() {
  4703. //如果没有权限,就不需要获取
  4704. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4705. return;
  4706. }
  4707. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4708. var param = {date:this.date + day};
  4709. this.http.post("/report/getMembList", param,
  4710. res => {
  4711. if (res.code == "ok") {
  4712. if(res.data.length == 0){
  4713. return
  4714. }
  4715. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4716. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4717. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4718. // if (this.user.role > 0) {
  4719. // }
  4720. list.splice(0,0,{
  4721. id: -1,
  4722. label: this.$t('lable.allStaff'),
  4723. })
  4724. this.membCount = 0;
  4725. //设置员工到部门下面
  4726. this.setUserToDept(list);
  4727. this.data = list;
  4728. // console.log('data',this.data);
  4729. this.expandDate = [this.data[1].id]
  4730. this.allData = list;
  4731. // if (noAllData.length > 0) {
  4732. // if (noAllData[0].label == '全部人员') {
  4733. // noAllData.splice(0,1);
  4734. // }
  4735. // }
  4736. // this.setUserToDept(noAllData);
  4737. // this.deptMembData = noAllData;
  4738. this.option = this.changeArr(list1);
  4739. list[0].membCount = this.membCount;
  4740. if (this.depData.id == -1) {
  4741. this.depData.membCount = this.membCount;
  4742. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4743. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4744. } else {
  4745. if (this.depData.isUser == null) {
  4746. var dep = this.findTargetDept(this.data, this.depData.id);
  4747. var membDeptList = [];
  4748. membDeptList.push(dep);
  4749. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4750. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4751. }
  4752. }
  4753. if (this.depData.isUser == null) {
  4754. if (this.isFill) {
  4755. this.fillMembList = this.fillList;
  4756. } else {
  4757. this.fillMembList = this.unFillList;
  4758. }
  4759. }
  4760. this.leaveAllNum = 0
  4761. for(let i in this.unFillList){
  4762. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4763. this.leaveAllNum += 1
  4764. }
  4765. }
  4766. this.stateChange()
  4767. } else {
  4768. this.$message({
  4769. message: res.msg,
  4770. type: "error"
  4771. });
  4772. }
  4773. },
  4774. error => {
  4775. this.$message({
  4776. message: error,
  4777. type: "error"
  4778. });
  4779. });
  4780. this.getReportFillStatus();
  4781. },
  4782. findTargetDept(list, deptId) {
  4783. var t = null;
  4784. for (var i=0;i<list.length; i++) {
  4785. if (list[i].isUser == null && list[i].id == deptId) {
  4786. t = list[i];
  4787. break;
  4788. }
  4789. }
  4790. if (t == null) {
  4791. for (var i=0;i<list.length; i++) {
  4792. if (list[i].children != null && list[i].children.length > 0) {
  4793. t = this.findTargetDept(list[i].children, deptId);
  4794. if (t != null) {
  4795. break;
  4796. }
  4797. }
  4798. }
  4799. }
  4800. return t;
  4801. },
  4802. getUserMembListFromDeptList(list, isFill) {
  4803. var membList = [];
  4804. for (var i in list) {
  4805. var deptName = list[i].label;
  4806. if (list[i].userList != null) {
  4807. list[i].userList.forEach(element => {
  4808. if (isFill == 0) {
  4809. //获取未填的
  4810. if (element.state == null) {
  4811. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4812. membList.push(obj);
  4813. }
  4814. } else {
  4815. if (element.state != null) {
  4816. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4817. membList.push(obj);
  4818. }
  4819. }
  4820. });
  4821. }
  4822. if (list[i].children != null) {
  4823. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4824. }
  4825. }
  4826. return membList;
  4827. },
  4828. setUserToDept(list) {
  4829. for (var i in list) {
  4830. var cnt = 0;
  4831. if (list[i].children != null) {
  4832. this.setUserToDept(list[i].children);
  4833. for (var m in list[i].children) {
  4834. cnt += list[i].children[m].membCount;
  4835. }
  4836. }
  4837. if (list[i].userList != null) {
  4838. if (list[i].children == null) {
  4839. list[i].children = [];
  4840. }
  4841. list[i].userList.forEach(element => {
  4842. var obj = {
  4843. id: element.id,
  4844. label:element.name,
  4845. state:element.state,
  4846. parentId:element.departmentId,
  4847. isUser:1,
  4848. workingTime: element.workingTime,
  4849. leaveDays: element.leaveDays,
  4850. leaveTimes: element.leaveTimes
  4851. };
  4852. list[i].children.push(obj);
  4853. this.membCount++;
  4854. cnt++;
  4855. });
  4856. }
  4857. list[i].membCount = cnt;
  4858. }
  4859. },
  4860. // 修改数组
  4861. changeArr(arr) {
  4862. for (var i = 0; i < arr.length; i++) {
  4863. if(arr[i].id != -1 && arr[i].id != 0) {
  4864. if (arr[i].children != null && arr[i].children.length>0) {
  4865. arr[i].children = this.changeArr(arr[i].children);
  4866. }
  4867. arr[i].id && (arr[i].value = arr[i].id);
  4868. delete arr[i].id;
  4869. }
  4870. }
  4871. for(var i in arr) {
  4872. if(arr[i].id == -1 || arr[i].id == 0) {
  4873. arr.splice(i,1)
  4874. }
  4875. }
  4876. return arr;
  4877. },
  4878. //时间段范围设置改动,监听
  4879. onTimeTypeChange(timeType) {
  4880. this.seleChn(1)
  4881. this.showAddMore = true;
  4882. for(var i in this.workForm.domains) {
  4883. if (this.workForm.domains[i].timeType == 0) {
  4884. this.showAddMore = false;
  4885. break;
  4886. }
  4887. }
  4888. if (this.showAddMore) {
  4889. //检测数量
  4890. if (this.workForm.domains.length == 2) {
  4891. this.showAddMore = false;
  4892. } else {
  4893. this.showAddMore = true;
  4894. }
  4895. }
  4896. },
  4897. getTimeType() {
  4898. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4899. res => {
  4900. if (res.code == "ok") {
  4901. var t = res.data;
  4902. this.reportTimeType = t;
  4903. if (this.reportTimeType.type > 0) {
  4904. this.showAddMore = true;
  4905. }
  4906. //转化时间格式
  4907. if (t.allday != null) {
  4908. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4909. }
  4910. if (t.am != null) {
  4911. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4912. }
  4913. if (t.pm != null) {
  4914. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4915. }
  4916. let arr = []
  4917. for(var i in res.data.excludeTimeList) {
  4918. let obj = {
  4919. s: res.data.excludeTimeList[i].startTime,
  4920. e: res.data.excludeTimeList[i].endTime,
  4921. }
  4922. arr.push(obj)
  4923. }
  4924. this.vacationTime = arr
  4925. } else {
  4926. this.$message({
  4927. message: res.msg,
  4928. type: "error"
  4929. });
  4930. }
  4931. },
  4932. error => {
  4933. this.listLoading = false;
  4934. this.$message({
  4935. message: error,
  4936. type: "error"
  4937. });
  4938. });
  4939. },
  4940. // 改变月份 -------
  4941. changeMonthOut() {
  4942. this.getAllDate();
  4943. this.getReportList();
  4944. this.getDepartment();
  4945. },
  4946. // 选择日期
  4947. choseDate(i, item) {
  4948. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4949. return
  4950. }
  4951. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4952. this.choseDay = i;
  4953. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4954. sessionStorage.msg = this.date + day,
  4955. this.getReportList();
  4956. this.getDepartment();
  4957. this.curDate = item.date;
  4958. },
  4959. canClick(i, item){
  4960. let nowDate = new Date()
  4961. let nowDateYear = nowDate.getFullYear()
  4962. let itemYear = parseInt(this.date.split('-')[0])
  4963. let nowDateMonth = nowDate.getMonth() + 1
  4964. let itemMonth = parseInt(this.date.split('-')[1])
  4965. let nowDateDay = nowDate.getDate()
  4966. let itemDay = parseInt(item.showDate.split('.')[1])
  4967. if(nowDateYear < itemYear){
  4968. return false
  4969. }else if(nowDateYear == itemYear){
  4970. if(nowDateMonth < itemMonth){
  4971. return false
  4972. }else if(nowDateMonth == itemMonth){
  4973. if(nowDateDay < itemDay){
  4974. return false
  4975. }
  4976. }
  4977. }
  4978. },
  4979. // 获取日期列表
  4980. getAllDate(e) {
  4981. var dayArry = [];
  4982. var day = this.getCountDays();
  4983. let curMonthDay = null;
  4984. for (var k = 1; k <= day; k++) {
  4985. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4986. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4987. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4988. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4989. if(sessionStorage.msg) {
  4990. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4991. this.choseDay = k - 1;
  4992. curMonthDay = str;
  4993. }
  4994. } else {
  4995. if (new Date().getDate() == k) {
  4996. this.choseDay = k - 1;
  4997. }
  4998. }
  4999. } else {
  5000. this.choseDay = 0;
  5001. }
  5002. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5003. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5004. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5005. }
  5006. this.allDate = dayArry;
  5007. //不能超过最大日期
  5008. if (this.choseDay > day-1) {
  5009. this.choseDay = day-1;
  5010. }
  5011. if(sessionStorage.from != 1){
  5012. let nowmonth = new Date().getMonth() + 1
  5013. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5014. let nowdate = new Date().getDate()
  5015. if(nowd == this.date){
  5016. if(e && sessionStorage.msg){
  5017. }else{
  5018. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5019. }
  5020. let nowday = new Date(sessionStorage.msg).getDate()
  5021. this.choseDay = nowday - 1
  5022. let monthdate = new Date(sessionStorage.msg)
  5023. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5024. }else{
  5025. if(e && sessionStorage.msg){
  5026. }else{
  5027. sessionStorage.msg = this.date + '-01'
  5028. }
  5029. let monthdate = new Date(sessionStorage.msg)
  5030. this.choseDay = monthdate.getDate() - 1
  5031. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5032. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5033. }
  5034. }else{
  5035. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5036. }
  5037. //从消息点击跳转过来的,直接加载指定日期
  5038. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5039. this.curDate = sessionStorage.msg;
  5040. sessionStorage.from = 0;
  5041. } else {
  5042. // if (curMonthDay != null) {
  5043. // // this.curDate = curMonthDay;
  5044. // let d = new Date(sessionStorage.msg)
  5045. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5046. // } else {
  5047. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5048. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5049. // }
  5050. }
  5051. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5052. // if(!sessionStorage.msg){
  5053. // let msgday = this.choseDay + 1
  5054. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5055. // }
  5056. this.getReportFillStatus();
  5057. },
  5058. getCountDays() {
  5059. var newstr = this.date.replace(/-/g, "/");
  5060. var curDate = new Date(newstr+'/01');
  5061. var curMonth = curDate.getMonth();
  5062. curDate.setMonth(curMonth + 1);
  5063. curDate.setDate(0);
  5064. return curDate.getDate();
  5065. },
  5066. //获取日报列表
  5067. getReportList() {
  5068. this.listLoading = true;
  5069. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5070. let param = {date: this.date + day};
  5071. if (this.deptId) {
  5072. param.deptId = this.deptId;
  5073. }
  5074. if (this.targetUid) {
  5075. param.userId = this.targetUid;
  5076. }
  5077. this.http.post( this.port.report.list, param,
  5078. res => {
  5079. this.listLoading = false;
  5080. if (res.code == "ok") {
  5081. this.reportList = res.data;
  5082. if(document.querySelector("#day"+this.choseDay)){
  5083. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5084. }
  5085. } else {
  5086. this.$message({
  5087. message: res.msg,
  5088. type: "error"
  5089. });
  5090. }
  5091. },
  5092. error => {
  5093. this.listLoading = false;
  5094. this.$message({
  5095. message: error,
  5096. type: "error"
  5097. });
  5098. });
  5099. },
  5100. // 处理数据
  5101. // dealWith() {
  5102. // var tianxie = 0
  5103. // var weixtianxie = 0
  5104. // if(this.selectState == -1) {
  5105. // } else {
  5106. // var arr = []
  5107. // for (var i in this.reportList) {
  5108. // arr.push(this.reportList[i].id)
  5109. // }
  5110. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  5111. // }
  5112. // },
  5113. // getDealWith(item, tx, wtx, arr) {
  5114. // for(var i in item) {
  5115. // if(item[i].children) {
  5116. // this.getDealWith(item[i].children, tx, wtx, arr)
  5117. // } else {
  5118. // if(arr.indexOf(item[i].id) != '-1') {
  5119. // tx = +tx + 1
  5120. // }
  5121. // }
  5122. // }
  5123. // },
  5124. //导出员工工时统计
  5125. exportUserTime() {
  5126. this.listLoading = true;
  5127. var param = {};
  5128. if (this.exportParam.dateRange != null) {
  5129. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5130. }
  5131. this.http.post('/department/exportDeptStatistic', param,
  5132. res => {
  5133. this.listLoading = false;
  5134. if (res.code == "ok") {
  5135. location.href = res.data;
  5136. this.exportTimeDialog = false;
  5137. } else {
  5138. this.$message({
  5139. message: res.msg,
  5140. type: "error"
  5141. });
  5142. }
  5143. },
  5144. error => {
  5145. this.listLoading = false;
  5146. this.$message({
  5147. message: error,
  5148. type: "error"
  5149. });
  5150. });
  5151. },
  5152. //导出日报
  5153. exportReport() {
  5154. this.exportingData = true;
  5155. var param = {};
  5156. if (this.exportParam.dateRange != null) {
  5157. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5158. }
  5159. if (this.exportParam.projectId != null) {
  5160. param.projectId = this.exportParam.projectId;
  5161. }
  5162. if (this.exportParam.departmentId != null) {
  5163. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5164. }
  5165. param.stateKey = this.stateKey
  5166. // param.departmentId = this.user.departmentId
  5167. console.log(param, '《=== 导出传的参数')
  5168. this.http.post( this.port.report.export, param,
  5169. res => {
  5170. this.exportingData = false;
  5171. if (res.code == "ok") {
  5172. location.href = res.data;
  5173. this.exportDialog = false;
  5174. } else {
  5175. this.$message({
  5176. message: res.msg,
  5177. type: "error"
  5178. });
  5179. }
  5180. },
  5181. error => {
  5182. this.exportingData = false;
  5183. this.$message({
  5184. message: error,
  5185. type: "error"
  5186. });
  5187. });
  5188. },
  5189. //获取项目列表
  5190. getProjectList() {
  5191. this.listLoading = true;
  5192. this.http.post( this.port.project.list, {},
  5193. res => {
  5194. this.listLoading = false;
  5195. if (res.code == "ok") {
  5196. for(var i in res.data) {
  5197. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5198. res.data[i].projectCode = ''
  5199. }
  5200. }
  5201. this.projectList = res.data;
  5202. console.log("项目列表",this.projectList);
  5203. } else {
  5204. this.$message({
  5205. message: res.msg,
  5206. type: "error"
  5207. });
  5208. }
  5209. },
  5210. error => {
  5211. this.listLoading = false;
  5212. this.$message({
  5213. message: error,
  5214. type: "error"
  5215. });
  5216. });
  5217. },
  5218. // 获取填报日报的项目下拉列表
  5219. getFillProjectList() {
  5220. this.http.post( this.port.project.list, {
  5221. forReport: 1
  5222. },res => {
  5223. if (res.code == "ok") {
  5224. for(var i in res.data) {
  5225. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5226. res.data[i].projectCode = ''
  5227. }
  5228. }
  5229. this.fillProjectList = res.data;
  5230. this.getRecentlyProject()
  5231. } else {
  5232. this.$message({
  5233. message: res.msg,
  5234. type: "error"
  5235. });
  5236. }
  5237. },
  5238. error => {
  5239. this.$message({
  5240. message: error,
  5241. type: "error"
  5242. });
  5243. });
  5244. },
  5245. getBasecostItemList() {
  5246. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5247. companyId: this.user.companyId
  5248. },
  5249. res => {
  5250. if (res.code == "ok") {
  5251. this.timeBasecostList = res.data;
  5252. }
  5253. });
  5254. },
  5255. getAIReport(createDate) {
  5256. this.http.post('/report/getAIReport', {},
  5257. res => {
  5258. if (res.code == "ok") {
  5259. var quanbu = 0
  5260. this.jsDay = 1
  5261. var zhi = ''
  5262. var slp = res.data
  5263. for(var i in slp) {
  5264. var sp = +slp[i].workingTime + 0
  5265. zhi = this.jsDay * sp
  5266. quanbu = +quanbu + zhi
  5267. }
  5268. this.jsTime = quanbu
  5269. var aiReportData = res.data;
  5270. this.canCancelInDialog = false
  5271. if(aiReportData.length != 0) {
  5272. var arr = [];
  5273. for(var i in aiReportData) {
  5274. arr.push({
  5275. id: null,
  5276. projectId: aiReportData[i].projectId,
  5277. workingTime: aiReportData[i].workingTime,
  5278. content: '',
  5279. progress:100,
  5280. state: 2,
  5281. timeType: aiReportData[i].timeType,
  5282. subProjectList: aiReportData[i].subProjectList,
  5283. taskList: aiReportData[i].taskList,
  5284. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5285. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5286. taskId: aiReportData[i].taskId,
  5287. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5288. startTime: aiReportData[i].startTime,
  5289. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5290. endTime: aiReportData[i].endTime,
  5291. isOvertime: 0,
  5292. progress:aiReportData[i].progress,
  5293. professionProgress: aiReportData[i].professionProgressList,
  5294. stages:aiReportData[i].stages,
  5295. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5296. pics: null,
  5297. multiWorktime: aiReportData[i].multiWorktime,
  5298. worktimeList: [{}],
  5299. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5300. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5301. wuduList: aiReportData[i].degreeList,
  5302. taskGroups:aiReportData[i].taskGroups,
  5303. customData: aiReportData[i].customData,//自定义的数值
  5304. auditUserList: aiReportData[i].auditUserList,
  5305. projectAuditorId: aiReportData[i].projectAuditorId,
  5306. projectAuditorName: aiReportData[i].projectAuditorName,
  5307. overtimeHours: aiReportData[i].overtimeHours,
  5308. customText: aiReportData[i].customText,
  5309. basecostId: aiReportData[i].basecostId,
  5310. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5311. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5312. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5313. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5314. canEdit: true
  5315. })
  5316. }
  5317. this.workForm.domains = arr;
  5318. } else {
  5319. }
  5320. this.canEdit = true;
  5321. this.originCanEdit = true;
  5322. this.seleChn()
  5323. } else {
  5324. this.$message({
  5325. message: res.msg,
  5326. type: "error"
  5327. });
  5328. }
  5329. },
  5330. error => {
  5331. this.$message({
  5332. message: error,
  5333. type: "error"
  5334. });
  5335. });
  5336. },
  5337. // 获取个人某天的日报 111111
  5338. getReport() {
  5339. this.http.post( this.port.report.getPort, {
  5340. date: this.workForm.createDate
  5341. },
  5342. res => {
  5343. if (res.code == "ok") {
  5344. var quanbu = 0
  5345. this.jsDay = 1
  5346. var zhi = ''
  5347. var slp = res.data.report
  5348. for(var i in slp) {
  5349. var sp = +slp[i].workingTime + 0
  5350. zhi = this.jsDay * sp
  5351. quanbu = +quanbu + zhi
  5352. }
  5353. this.jsTime = quanbu
  5354. var list = res.data;
  5355. this.report = list;
  5356. this.reportTimeType = this.report.timeType;
  5357. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5358. this.isWeekend = !this.report.isWorkDay;
  5359. this.canCancelInDialog = false;
  5360. this.hasWrittenReport = list.report.length != 0;
  5361. if(list.report.length != 0) {
  5362. var arr = [];
  5363. this.canEdit = false;
  5364. let candelete = true
  5365. for(var i in list.report) {
  5366. var flg = null
  5367. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5368. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5369. var filteredRespList = null
  5370. if (targetP.length > 0) {
  5371. var isPublic = targetP[0].isPublic;
  5372. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5373. }
  5374. arr.push({
  5375. id: list.report[i].id,
  5376. projectId: list.report[i].projectId,
  5377. workingTime: list.report[i].workingTime,
  5378. content: list.report[i].content,
  5379. state: list.report[i].state,
  5380. timeType: list.report[i].timeType,
  5381. subProjectList: list.report[i].subProjectList,
  5382. taskList: list.report[i].taskList,
  5383. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5384. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5385. taskId: list.report[i].taskId,
  5386. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5387. startTime: list.report[i].startTime,
  5388. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5389. endTime: list.report[i].endTime,
  5390. isOvertime: flg,
  5391. progress:list.report[i].progress,
  5392. professionProgress: list.report[i].professionProgressList,
  5393. stages:list.report[i].stages,
  5394. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5395. pics: list.report[i].pics,
  5396. multiWorktime: list.report[i].multiWorktime,
  5397. worktimeList: list.report[i].worktimeList,
  5398. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5399. multiDegrIdArray: list.report[i].multiDegrIdList,
  5400. wuduList: list.report[i].degreeList,
  5401. taskGroups:list.report[i].taskGroups,
  5402. customData: list.report[i].customData,//自定义的数值
  5403. auditUserList: list.report[i].auditUserList,
  5404. projectAuditorId: list.report[i].projectAuditorId,
  5405. projectAuditorName: list.report[i].projectAuditorName,
  5406. overtimeHours: list.report[i].overtimeHours,
  5407. customText: list.report[i].customText,
  5408. basecostId: list.report[i].basecostId,
  5409. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5410. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5411. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5412. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5413. canEdit: list.report[i].state >= 2 ? true : false,
  5414. extraField1: list.report[i].extraField1,
  5415. extraField2: list.report[i].extraField2,
  5416. extraField3: list.report[i].extraField3,
  5417. workContentList: list.report[i].workContentList,
  5418. filteredRespList: filteredRespList,
  5419. serviceList: list.report[i].serviceList,
  5420. sapServiceId: list.report[i].sapServiceId,
  5421. })
  5422. if (list.report[i].state >= 2) {
  5423. this.canEdit = true;
  5424. }
  5425. if(list.report[i].state < 2){
  5426. candelete = false
  5427. }
  5428. if (list.report[i].state == 0){
  5429. this.canCancelInDialog = true
  5430. }
  5431. // 加判断
  5432. if(this.user.timeType.choseFromAlbum == 1) {
  5433. let arrList = []
  5434. for(var k in list.report[i].pics) {
  5435. let obj = {
  5436. name: k,
  5437. url: list.report[i].pics[k]
  5438. }
  5439. arrList.push(obj)
  5440. }
  5441. arr[i].imgListUrl = arrList
  5442. arr[i].imgList = list.report[i].pics
  5443. }
  5444. }
  5445. this.reportCanDelete = candelete
  5446. this.workForm = {
  5447. createDate: this.workForm.createDate,
  5448. domains: arr,
  5449. userNames:null,
  5450. userId:null,
  5451. time: list.time
  5452. }
  5453. console.log('workForm', this.workForm)
  5454. } else {
  5455. this.workForm = {
  5456. createDate: this.workForm.createDate,
  5457. domains: [{
  5458. id: null,
  5459. projectId: "",
  5460. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5461. content: "",
  5462. progress:100,
  5463. state: 2,
  5464. timeType:0,
  5465. multiWorktime: this.reportTimeType.multiWorktime,
  5466. worktimeList:[{}],
  5467. canEdit: true,
  5468. auditorFirst: '',
  5469. auditorSec: '',
  5470. auditorThird: '',
  5471. ccUserid: ''
  5472. }],
  5473. userId:null,
  5474. userNames:null,
  5475. time: this.report.time
  5476. }
  5477. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5478. this.$set(this.workForm.domains[0],'isOvertime',true)
  5479. if(this.reportTimeType.type != 2){
  5480. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5481. }
  5482. }
  5483. if(this.user.timeType.type == 1) {
  5484. var shuzhi = this.user.timeType.allday + ''
  5485. // console.log('执行一次', shuzhi.indexOf('.'))
  5486. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5487. }
  5488. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5489. //默认给第一个,必填字段
  5490. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5491. }
  5492. this.canEdit = true;
  5493. }
  5494. this.originCanEdit = this.canEdit;
  5495. this.seleChn()
  5496. } else {
  5497. this.$message({
  5498. message: res.msg,
  5499. type: "error"
  5500. });
  5501. }
  5502. },
  5503. error => {
  5504. this.$message({
  5505. message: error,
  5506. type: "error"
  5507. });
  5508. });
  5509. },
  5510. guanbi() {
  5511. this.falsss = false,
  5512. this.workTimeForMinYi=0
  5513. },
  5514. // 打开日报填写
  5515. fillInReport(i, isBatch) {
  5516. this.isWeekend = false
  5517. this.reportCanDelete = false
  5518. // console.log(this.user.timeType.type, '选择时长')
  5519. if(i != 1) {
  5520. this.falsss = false
  5521. } else {
  5522. this.falsss = true
  5523. }
  5524. if (this.isSubstitude) {
  5525. this.getSubstitudeUserDeptList();
  5526. }
  5527. if(i == -1 || this.isSubstitude) {
  5528. this.isDisable = false;
  5529. } else {
  5530. this.isDisable = true;
  5531. }
  5532. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5533. this.isBatch = isBatch;
  5534. if (this.isBatch == 0 && !this.isSubstitude) {
  5535. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5536. let weekday = new Date(this.workForm.createDate).getDay()
  5537. if(this.user.companyId == 817){
  5538. if(weekday == 0){
  5539. this.isWeekend = true
  5540. }
  5541. }else{
  5542. if(weekday == 0 || weekday == 6){
  5543. this.isWeekend = true
  5544. }
  5545. }
  5546. this.getReport(i);
  5547. } else {
  5548. // console.log('执行到了这里')
  5549. this.jsTime = 0
  5550. this.jsDay = 0
  5551. this.workForm = {
  5552. createDate: null,//批量填报没有日期
  5553. domains: [{
  5554. id: null,
  5555. projectId: "",
  5556. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5557. content: "",
  5558. progress:100,
  5559. state: 2,
  5560. timeType:0,
  5561. multiWorktime: this.reportTimeType.multiWorktime,
  5562. worktimeList:[{}],
  5563. canEdit: true,
  5564. }],
  5565. }
  5566. if(this.user.timeType.type == 1) {
  5567. var shuzhi = this.user.timeType.allday + ''
  5568. // console.log('执行二次')
  5569. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5570. }
  5571. // console.log(this.workForm)
  5572. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5573. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5574. }
  5575. this.canEdit = true;
  5576. }
  5577. this.dialogVisible = true;
  5578. },
  5579. //按周填报的弹窗口中编辑单项目相关数据
  5580. setWeekFormReportItem(reportId, i, names, row,sss) {
  5581. console.log(sss)
  5582. this.http.post('/report/getReportById', {
  5583. reportId: reportId
  5584. },
  5585. res => {
  5586. if (res.code == "ok") {
  5587. var data = res.data.report;
  5588. sss.subProjectId = data.subProjectId
  5589. sss.subProjectList = data.subProjectList;
  5590. sss.stage = data.stage
  5591. sss.subProjectList = data.subProjectList
  5592. sss.stages = data.stages
  5593. sss.taskGroups = data.taskGroups;
  5594. sss.auditUserList = data.auditUserList;
  5595. sss.degreeId = data.degreeId;
  5596. sss.customData = data.customData;
  5597. sss.wuduList = data.degreeList;
  5598. this.zhoBaoIdx = i
  5599. this.zhoBaoName = names
  5600. this.zhoBao = sss
  5601. this.zhis = row
  5602. if (sss.groupId) {
  5603. //最后一个参数表示是否保留stage的值,不要重置为空
  5604. this.getGroupStages(this.zhoBao, 0, true)
  5605. }
  5606. this.$forceUpdate();
  5607. }
  5608. });
  5609. },
  5610. // 按周填报里内容的填写
  5611. tianxies(item, i, names, row) {
  5612. if (item.state == 0) {
  5613. this.$message({
  5614. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5615. type: "error"
  5616. });
  5617. return;
  5618. }
  5619. if (item.state == 1) {
  5620. this.$message({
  5621. message: '已通过状态不可修改',
  5622. type: "error"
  5623. });
  5624. return;
  5625. }
  5626. if(this.user.timeType.notAllowedNoAttendance == 1){
  5627. if(this.zhoData[i].corpTime){
  5628. if(this.zhoData[i].corpTime.workHours == 0){
  5629. this.$message({
  5630. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5631. type: 'error'
  5632. })
  5633. return
  5634. }
  5635. }else{
  5636. this.$message({
  5637. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5638. type: 'error'
  5639. })
  5640. return
  5641. }
  5642. }
  5643. var idd = ''
  5644. var obj = {}
  5645. for(var l in this.projectList) {
  5646. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5647. }
  5648. obj.projectId = idd
  5649. this.tianxieDialogVisible = true
  5650. this.scopess = item
  5651. console.log(item, '《==== 当前的对象')
  5652. var sss = {}
  5653. if (item.id != null) {
  5654. sss.id = item.id;
  5655. sss.state = item.state;
  5656. } else {
  5657. sss.id = -1;
  5658. sss.state = 3;
  5659. }
  5660. sss.projectId = idd;
  5661. sss.progress = item.progress
  5662. sss.time = item.time
  5663. sss.content = item.content;
  5664. console.log('333', sss.content)
  5665. if (sss.time == '' && this.reportTimeType.type == 2) {
  5666. //取已填时间范围中最大的一个作为开始时间
  5667. var startTime = '09:00';
  5668. var fillStartTime = '00:00';
  5669. for (var t in this.selProjectList) {
  5670. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5671. if (fillItem.time) {
  5672. if (fillItem.time[1] > fillStartTime) {
  5673. fillStartTime = fillItem.time[1];
  5674. }
  5675. }
  5676. }
  5677. if (fillStartTime == '00:00') {
  5678. fillStartTime = '09:00';
  5679. }
  5680. var fillEndMax = '18:00';
  5681. if (fillStartTime >= '18:00') {
  5682. fillEndMax = '23:59';
  5683. }
  5684. sss.time = [fillStartTime, fillEndMax];
  5685. }
  5686. sss.groupId = item.groupId
  5687. sss.stage = item.stage;
  5688. sss.workingTime = item.workingTime
  5689. sss.projectAuditorId = item.projectAuditorId;
  5690. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5691. //默认选中第一个
  5692. sss.basecostId = this.timeBasecostList[0].id;
  5693. }
  5694. var hasEdited = this.zhoData[i][names].hasEdited;
  5695. if (hasEdited) {
  5696. sss = { ...item }
  5697. //编辑过了
  5698. sss.subProjectId = item.subProjectId
  5699. sss.stage = item.stage
  5700. sss.subProjectList = item.subProjectList
  5701. sss.stages = item.stages
  5702. sss.taskGroups = item.taskGroups;
  5703. console.log(sss.taskGroups, '33333');
  5704. sss.auditUserList = obj.auditUserList;
  5705. sss.degreeId = item.degreeId;
  5706. sss.customData = item.customData;
  5707. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5708. //只有一个审核人,自动设置上去
  5709. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5710. }
  5711. sss.wuduList = item.wuduList;
  5712. this.zhoBaoIdx = i
  5713. this.zhoBaoName = names
  5714. this.zhoBao = sss
  5715. this.zhis = row
  5716. if (sss.groupId) {
  5717. //最后一个参数表示是否保留stage的值,不要重置为空
  5718. this.getGroupStages(this.zhoBao, 0, true)
  5719. }
  5720. this.$forceUpdate();
  5721. this.getWeeklyTaskList(sss)
  5722. console.log('最后的周报 ===>', this.zhoBao)
  5723. } else {
  5724. //第一次打开,获取数据
  5725. if (sss.id == -1) {
  5726. //新填报的
  5727. this.selectProject(obj, 0);
  5728. var that = this
  5729. setTimeout(() =>{
  5730. sss.subProjectId = that.workForm.domains[0].subProjectId
  5731. sss.subProjectList = item.subProjectList;
  5732. sss.stage = that.workForm.domains[0].stage
  5733. sss.subProjectList = that.workForm.domains[0].subProjectList
  5734. sss.stages = that.workForm.domains[0].stages
  5735. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5736. sss.auditUserList = obj.auditUserList;
  5737. sss.degreeId = item.degreeId;
  5738. sss.customData = item.customData;
  5739. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5740. //只有一个审核人,自动设置上去
  5741. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5742. }
  5743. sss.wuduList = row[0].wuduList
  5744. that.zhoBaoIdx = i
  5745. that.zhoBaoName = names
  5746. that.zhoBao = sss
  5747. that.zhis = row
  5748. if (sss.groupId) {
  5749. //最后一个参数表示是否保留stage的值,不要重置为空
  5750. this.getGroupStages(that.zhoBao, 0, false)
  5751. }
  5752. that.$forceUpdate();
  5753. this.getWeeklyTaskList(sss)
  5754. },600);
  5755. } else {
  5756. //编辑填报过的;数据库已经存在的
  5757. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5758. }
  5759. }
  5760. },
  5761. // 按周填报里内容的填写点击确定
  5762. setWeekProItemData() {
  5763. //专业版模式下,任务分组和阶段必填
  5764. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5765. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5766. this.$message({
  5767. message: '任务分组和阶段必填,请检查',
  5768. type: "error"
  5769. });
  5770. return;
  5771. }
  5772. }
  5773. //检查子项目是否必填
  5774. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5775. this.$message({
  5776. message: '子项目必填,请检查',
  5777. type: "error"
  5778. });
  5779. return;
  5780. }
  5781. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5782. this.$message({
  5783. message: this.$t('message.Pleaseselectareviewer'),
  5784. type: "error"
  5785. });
  5786. return
  5787. }
  5788. if(this.user.timeType.reportAuditType == 3){
  5789. let auditTips = ''
  5790. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5791. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5792. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5793. if(auditTips){
  5794. auditTips = auditTips.substring(0,auditTips.length - 1)
  5795. this.$message({
  5796. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5797. type: 'error'
  5798. })
  5799. return
  5800. }
  5801. }
  5802. let errtips = ''
  5803. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  5804. errtips += this.user.timeType.customDegreeName + '、'
  5805. }
  5806. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5807. errtips += this.user.timeType.customDataName + '、'
  5808. }
  5809. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5810. errtips += this.user.timeType.customTextName + '、'
  5811. }
  5812. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5813. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5814. }
  5815. if(errtips){
  5816. errtips = errtips.substring(0,errtips.length - 1)
  5817. this.$message({
  5818. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5819. type: 'error'
  5820. })
  5821. return
  5822. }
  5823. this.tianxieDialogVisible = false
  5824. var zhong = this.zhoData
  5825. this.zhoBao.hasEdited = true;
  5826. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5827. this.zhoData = zhong
  5828. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5829. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5830. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5831. },
  5832. // 获取本周
  5833. getCurrentWeek() {
  5834. //今天
  5835. this.targetWeekDate = new Date();
  5836. this.initWeekFormData();
  5837. // this.jiazai()
  5838. },
  5839. // 获取上周
  5840. handleGetPrevWeek() {
  5841. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5842. this.initWeekFormData();
  5843. // this.jiazai()
  5844. },
  5845. // 获取下周
  5846. handleGetNextvWeek() {
  5847. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5848. this.initWeekFormData()
  5849. },
  5850. // 加载动画
  5851. jiazai() {
  5852. this.weekDataLoading = true
  5853. var that = this
  5854. setTimeout(() =>{
  5855. that.weekDataLoading = false
  5856. },1000);
  5857. },
  5858. // 转时间格式
  5859. dealdate(date) {
  5860. const dt = new Date(date)
  5861. const y = dt.getFullYear()
  5862. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5863. const d = (dt.getDate() + '').padStart(2, '0')
  5864. return `${y}-${m}-${d}`
  5865. },
  5866. // 按周填报
  5867. fillInReportss() {
  5868. window.addEventListener('scroll', this.handleScroll, true)
  5869. // this.jiazai()
  5870. this.fillWeekDialogVisi = true
  5871. this.getCurrentWeek();
  5872. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5873. //重新获取工时预警类型的预算项
  5874. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5875. companyId: this.user.companyId
  5876. },
  5877. res => {
  5878. if (res.code == "ok") {
  5879. this.timeBasecostList = res.data;
  5880. }
  5881. });
  5882. }
  5883. },
  5884. fillInReportCustom() {
  5885. this.weekIndex++
  5886. this.weekParentData = {
  5887. isSubstitude: this.isSubstitude
  5888. }
  5889. this.fillWeekDialogVisiCustom = true
  5890. },
  5891. // 按周填报的项目筛选
  5892. selListFun(){
  5893. this.selProjectList = []
  5894. if(this.selCon.length){
  5895. for (let i = 0; i < this.selCon.length; i++) {
  5896. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5897. }
  5898. this.selConShow = false ;
  5899. for (let i in this.zhoData) {
  5900. var obj = this.zhoData[i];
  5901. for(var j in this.selProjectList) {
  5902. var xinzhi = this.selProjectList[j].projectName
  5903. obj[xinzhi] = {}
  5904. obj[xinzhi].time = ''
  5905. obj[xinzhi].content = ''
  5906. obj[xinzhi].progress = 0
  5907. obj[xinzhi].workingTime = 0
  5908. }
  5909. }
  5910. this.initWeekFormData();
  5911. }else{
  5912. this.$message({
  5913. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5914. type:'error'
  5915. })
  5916. }
  5917. },
  5918. setWeekCardTimeData(list) {
  5919. for(let i in list){
  5920. let datei = '';
  5921. if (this.user.timeType.showDdCardtime == 1) {
  5922. datei = list[i].workDate;
  5923. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5924. datei = list[i].createDate;
  5925. } else if (this.user.timeType.syncFanwei == 1) {
  5926. datei = list[i].workDate;
  5927. }
  5928. for(let m in this.zhoData) {
  5929. if(datei == this.zhoData[m].zhoDataTime){
  5930. let item = {
  5931. startTime: list[i].startTime,
  5932. endTime: list[i].endTime,
  5933. workHours: list[i].workHours
  5934. }
  5935. this.$set(this.zhoData[m],'corpTime',item)
  5936. }
  5937. }
  5938. }
  5939. },
  5940. getWeeklyCardTime(){ //按周填报获取考勤信息
  5941. let dateStr = []
  5942. for(let i in this.zhoData){
  5943. dateStr.push(this.zhoData[i].zhoDataTime)
  5944. }
  5945. this.http.post('/report/getWeeklyCardTime',{
  5946. dateStr: JSON.stringify(dateStr)
  5947. },res => {
  5948. if(res.code == 'ok'){
  5949. for(let i in res.data){
  5950. let datei = '';
  5951. if (this.user.timeType.showDdCardtime == 1) {
  5952. datei = res.data[i].workDate.split('-');
  5953. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5954. datei = res.data[i].createDate.split('-');
  5955. }
  5956. for(let m in this.zhoData){
  5957. let datem = new Date(this.zhoData[m].zhoDataTime)
  5958. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5959. let item = {
  5960. startTime: res.data[i].startTime,
  5961. endTime: res.data[i].endTime,
  5962. workHours: res.data[i].workHours
  5963. }
  5964. this.$set(this.zhoData[m],'corpTime',item)
  5965. }
  5966. }
  5967. }
  5968. }else{
  5969. this.$message({
  5970. message: res.msg,
  5971. type: 'error'
  5972. })
  5973. }
  5974. },err => {
  5975. this.$message({
  5976. message: err,
  5977. type: 'error'
  5978. })
  5979. })
  5980. },
  5981. selListqx(){
  5982. this.fillWeekDialogVisi = false
  5983. this.selProjectList = []
  5984. this.selCon = []
  5985. },
  5986. handleScroll() {
  5987. this.changdu = this.projectList.length + 1
  5988. },
  5989. // 自动选择时间点的事件
  5990. // async zhoTimes(item, i) {
  5991. // var iss = i
  5992. // if(item.time == null) {
  5993. // return
  5994. // } else {
  5995. // const zhi = this.zhoData[iss];
  5996. // let he = 0;
  5997. // const timeArr = Object.values(zhi)
  5998. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  5999. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6000. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6001. // console.log(data, 'data');
  6002. // zhi.he = `${he}h`;
  6003. // }
  6004. // },
  6005. async zhoTimes(item, index) {
  6006. const zho = this.zhoData[index];
  6007. if (!item.time) {
  6008. return;
  6009. }
  6010. const timeArr = Object.values(zho)
  6011. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6012. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6013. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6014. zho.he = `${totalHours[0]}h`;
  6015. },
  6016. // 判断两个时间段是否重叠
  6017. timeOverlap(idx, dateAr) {
  6018. let zhi = 0
  6019. for (let k in dateAr) {
  6020. if (idx !== k) {
  6021. if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
  6022. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6023. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6024. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6025. }
  6026. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6027. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6028. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6029. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6030. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6031. } else {
  6032. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6033. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6034. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6035. }
  6036. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6037. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6038. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6039. }
  6040. }
  6041. }
  6042. }
  6043. }
  6044. return zhi
  6045. },
  6046. // 计算时间
  6047. getHourMinutes(str, end) {
  6048. var he = 0
  6049. var date2 = '2021/12/12 ' + end +':00'
  6050. var date1 = '2021/12/12 ' + str +':00'
  6051. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6052. var leave1=date3%(24*3600*1000)
  6053. var hours=Math.floor(leave1/(3600*1000))
  6054. var leave2=leave1%(3600*1000)
  6055. var minutes=Math.floor(leave2/(60*1000))
  6056. var shi = hours+'.'+ minutes
  6057. return he += +shi
  6058. },
  6059. // 自动选择事件长度的事件
  6060. zhoXuan(item, i) {
  6061. var iss = i
  6062. if(item.time == null) {
  6063. return
  6064. } else {
  6065. var zhi = this.zhoData[iss]
  6066. var he = 0
  6067. for(var i in zhi) {
  6068. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6069. he += +zhi[i].workingTime
  6070. }
  6071. }
  6072. zhi.he = he + 'h'
  6073. }
  6074. },
  6075. getPushWorkLogData(){
  6076. this.http.post('/sap-sync-log/list', {},
  6077. res => {
  6078. if (res.code == "ok") {
  6079. this.pushWorkTimeLogData = res.data;
  6080. } else {
  6081. this.$message({
  6082. message: res.msg,
  6083. type: "error"
  6084. });
  6085. }
  6086. },
  6087. error => {
  6088. this.$message({
  6089. message: error,
  6090. type: "error"
  6091. });
  6092. });
  6093. },
  6094. // 获取全部人员
  6095. getUsers() {
  6096. this.http.post('/user/getSimpleActiveUserList', {},
  6097. res => {
  6098. if (res.code == "ok") {
  6099. this.usersList = res.data;
  6100. } else {
  6101. this.$message({
  6102. message: res.msg,
  6103. type: "error"
  6104. });
  6105. }
  6106. },
  6107. error => {
  6108. this.$message({
  6109. message: error,
  6110. type: "error"
  6111. });
  6112. });
  6113. },
  6114. // 按时间比例
  6115. addBli(item, i) {
  6116. var iss = i
  6117. if(item.time == null) {
  6118. return
  6119. } else {
  6120. var zhi = this.zhoData[iss]
  6121. var he = 0
  6122. for(var i in zhi) {
  6123. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6124. he += +zhi[i].workingTime
  6125. }
  6126. }
  6127. zhi.he = he.toFixed(1) + 'h'
  6128. }
  6129. },
  6130. //按周填报选择的项目发生变化,需要设置列
  6131. onSelProjectChange() {
  6132. for (let i = 0; i < this.selCon.length; i++) {
  6133. var exists = false;
  6134. for (let j = 0; j < this.selProjectList.length; j++) {
  6135. if (this.selProjectList[j].id == this.selCon[i]) {
  6136. exists = true;
  6137. break;
  6138. }
  6139. }
  6140. if (!exists) {
  6141. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6142. this.selProjectList.push(newProject);
  6143. //添加新项目
  6144. for (var w in this.zhoData) {
  6145. var dayItem = this.zhoData[w];
  6146. var pName = newProject.projectName;
  6147. dayItem[pName] = {};
  6148. dayItem[pName].time = ''
  6149. dayItem[pName].content = ''
  6150. dayItem[pName].progress = 0
  6151. dayItem[pName].workingTime = 0
  6152. }
  6153. }
  6154. }
  6155. //去掉
  6156. for (let j = 0; j < this.selProjectList.length; j++) {
  6157. var exists = false;
  6158. for (let i = 0; i < this.selCon.length; i++) {
  6159. if (this.selProjectList[j].id == this.selCon[i]) {
  6160. exists = true;
  6161. break;
  6162. }
  6163. }
  6164. if (!exists) {
  6165. this.selProjectList.splice(j, 1);
  6166. j--;
  6167. }
  6168. }
  6169. this.loadFilledWeekReportItem();
  6170. //刷新表格
  6171. // this.$refs.weekTable.doLayout();
  6172. },
  6173. //根据选中的项目来刷新填写表格
  6174. loadFilledWeekReportItem() {
  6175. for (var w in this.zhoData) {
  6176. var dayItem = this.zhoData[w];
  6177. for (var i = 0; i < this.selProjectList.length; i++) {
  6178. var curColumnProject = this.selProjectList[i];
  6179. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6180. for (var t in dayItem.reportList) {
  6181. //有日报的项目,不能取消选择
  6182. for (var p in this.fillProjectList) {
  6183. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6184. }
  6185. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6186. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6187. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6188. if (this.reportTimeType.type == 2) {
  6189. //时间段模式
  6190. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6191. }
  6192. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6193. break;
  6194. }
  6195. }
  6196. // dayItem[curColumnProject.projectName] = matchReportItem;
  6197. }
  6198. }
  6199. this.$nextTick(()=>{
  6200. this.$refs.weekTable.doLayout();
  6201. });
  6202. },
  6203. initWeekFormData() {
  6204. this.weekDataLoading = true;
  6205. for (var p in this.fillProjectList) {
  6206. this.fillProjectList[p].canCancel = 1;
  6207. }
  6208. this.http.post('/report/getWeeklyReportData',{
  6209. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6210. },res => {
  6211. this.weekDataLoading = false;
  6212. if(res.code == 'ok'){
  6213. let projectList = res.data.projectList;
  6214. if (projectList.length > 0) {
  6215. //有选择过项目进行填报,直接选中
  6216. this.selProjectList = projectList;
  6217. this.selCon = [];
  6218. for (let i = 0; i < projectList.length; i++) {
  6219. this.selCon.push(projectList[i].id);
  6220. }
  6221. }
  6222. //设置日期
  6223. this.weekDateRange = res.data.dateList;
  6224. this.zhoData = [];
  6225. var arrst = []
  6226. for(var i in this.weekDateRange) {
  6227. var obj = {}
  6228. obj.zhoDataTime = this.weekDateRange[i].date
  6229. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6230. obj.he = this.weekDateRange[i].filledTime;
  6231. obj.canFill = this.weekDateRange[i].canFill;
  6232. // obj.filledTime = this.weekDateRange[i].filledTime;
  6233. obj.reportList = this.weekDateRange[i].reportList;
  6234. //初始化,防止渲染报错
  6235. for (var j = 0; j < this.selProjectList.length; j++) {
  6236. var pName = this.selProjectList[j].projectName
  6237. obj[pName] = {}
  6238. obj[pName].time = ''
  6239. obj[pName].content = ''
  6240. obj[pName].progress = 0
  6241. obj[pName].workingTime = 0
  6242. }
  6243. arrst.push(obj)
  6244. }
  6245. this.zhoData = arrst
  6246. this.setWeekCardTimeData(res.data.cardTimeList);
  6247. this.loadFilledWeekReportItem();
  6248. }else{
  6249. this.$message({
  6250. message: res.msg,
  6251. type: 'error'
  6252. })
  6253. }
  6254. },err => {
  6255. this.$message({
  6256. message: err,
  6257. type: 'error'
  6258. })
  6259. })
  6260. },
  6261. zhoZhi(res, i) {
  6262. var zhi = 0
  6263. for(var i in res) {
  6264. if(i != 'zhoDataTime' && i != 'he') {
  6265. zhi += +res[i]
  6266. }
  6267. }
  6268. res.he = zhi
  6269. },
  6270. zhoBtn(i) {
  6271. // this.zhoData.split(i, 1)
  6272. var arr = this.zhoData
  6273. arr.splice(i, 1)
  6274. },
  6275. zhoAddlast(){
  6276. this.selConShow = true
  6277. },
  6278. closeAddWeeklyReport(){
  6279. this.fillWeekDialogVisi = false
  6280. this.selConShow = true
  6281. this.selProjectList = []
  6282. this.selCon = []
  6283. },
  6284. // 提交按周填报
  6285. submitWeekReport(isDraft) {
  6286. var zhi = this.zhoData
  6287. var ll = 0
  6288. if(this.reportTimeType.type == 2) {
  6289. for(var i in zhi) {
  6290. this.dateAr = []
  6291. var alp = []
  6292. var zhis = zhi[i]
  6293. console.log(zhis)
  6294. for(var j in zhis) {
  6295. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6296. let objs = {}
  6297. objs.s = zhis[j].time[0]
  6298. objs.e = zhis[j].time[1]
  6299. objs.p = j
  6300. alp.push(objs)
  6301. }
  6302. }
  6303. console.log(alp)
  6304. this.dateAr = alp
  6305. if (this.reportTimeType.timeCanOverlap == 0) {
  6306. let str = this.$t('message.Filledtimeperiodsoverlap')
  6307. if(this.dateAr.length > 0) {
  6308. const trus = this.fns();
  6309. const overlapDataTime = this.getOverlapData(alp);
  6310. if (overlapDataTime.length > 0) {
  6311. const arrList = overlapDataTime.map((item) => item.p);
  6312. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6313. }
  6314. ll += 1
  6315. if(!trus) {
  6316. this.$message({
  6317. message: str,
  6318. type: 'error'
  6319. })
  6320. return false
  6321. }
  6322. }
  6323. } else {
  6324. if(this.dateAr.length > 0) {
  6325. ll +=1 ;
  6326. }
  6327. }
  6328. }
  6329. if(ll == 0) {
  6330. this.$message({
  6331. message: this.$t('message.Pleasefillinthetime'),
  6332. type: 'error'
  6333. })
  6334. return false
  6335. }
  6336. } else if(this.reportTimeType.type == 1){
  6337. for(var i in zhi) {
  6338. var zhis = zhi[i]
  6339. for(var j in zhis) {
  6340. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6341. ll += 1
  6342. }
  6343. }
  6344. }
  6345. if(ll == 0) {
  6346. this.$message({
  6347. message: this.$t('message.Pleaseselectatime'),
  6348. type: 'error'
  6349. })
  6350. return false
  6351. }
  6352. let overcorp = ''
  6353. for(let n in zhi){
  6354. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6355. overcorp += zhi[n].zhoDataTime + ','
  6356. }
  6357. }
  6358. if(overcorp != ''){
  6359. overcorp = overcorp.substring(0,overcorp.length - 1)
  6360. this.$message({
  6361. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6362. type: 'error'
  6363. })
  6364. return
  6365. }
  6366. }
  6367. var submits = []
  6368. let formData = new FormData();
  6369. formData.append("draft", isDraft);
  6370. if(this.reportTimeType.multiWorktime == 1){
  6371. for (var i in this.zhoData) {
  6372. var zhoD = this.zhoData[i]
  6373. var flgs = false
  6374. for(var j in zhoD) {
  6375. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6376. flgs = true
  6377. // formData.append("degreeId", "-1");
  6378. formData.append("id", '-1');
  6379. for(var s in this.projectList) {
  6380. if(j == this.projectList[s].projectName) {
  6381. formData.append("projectId", this.projectList[s].id);
  6382. }
  6383. }
  6384. if(this.user.timeType.reportAuditType == 3){
  6385. let audItem = {}
  6386. if(this.user.timeType.auditLevel > 0){
  6387. audItem.auditorFirst = zhoD[j].auditorFirst
  6388. }
  6389. if(this.user.timeType.auditLevel > 1){
  6390. audItem.auditorSec = zhoD[j].auditorSec
  6391. }
  6392. if(this.user.timeType.auditLevel > 2){
  6393. audItem.auditorThird = zhoD[j].auditorThird
  6394. }
  6395. if(zhoD[j].ccUserid){
  6396. audItem.ccUserid = zhoD[j].ccUserid
  6397. }
  6398. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6399. }
  6400. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6401. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6402. formData.append("reportTimeType", this.reportTimeType.type);
  6403. formData.append("endTime", '');
  6404. formData.append("startTime", '');
  6405. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6406. var lix = []
  6407. var objjs = {}
  6408. objjs.startTime = zhoD[j].time[0]
  6409. objjs.endTime = zhoD[j].time[1]
  6410. if (zhoD[j].content == null || zhoD[j].content == '') {
  6411. zhoD[j].content == '-'
  6412. }
  6413. objjs.content = zhoD[j].content
  6414. lix.push(objjs)
  6415. var zhiZhi = JSON.stringify(lix)
  6416. zhiZhi = zhiZhi.replace(/,/g,"@");
  6417. formData.append("content", zhiZhi)
  6418. formData.append("isOvertime", 0)
  6419. formData.append("professionProgress", "[]")
  6420. if (zhoD[j].groupId) {
  6421. formData.append("groupId",zhoD[j].groupId)
  6422. } else {
  6423. //解决后台groupId数组越界的问题
  6424. formData.append("groupId",0)
  6425. }
  6426. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6427. formData.append("createDate",zhoD.zhoDataTime)
  6428. if (zhoD[j].projectAuditorId) {
  6429. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6430. }
  6431. if(zhoD[j].basecostId) {
  6432. formData.append("basecostId", zhoD[j].basecostId);
  6433. } else {
  6434. formData.append("basecostId", 0);
  6435. }
  6436. if(this.user.timeType.customDegreeActive){
  6437. if (this.user.timeType.customDegreeMultiple) {
  6438. if (zhoD[j].multiDegrIdArray) {
  6439. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6440. } else {
  6441. formData.append('multiDegrId','[]')
  6442. }
  6443. } else {
  6444. if (zhoD[j].degreeId) {
  6445. formData.append('degreeId',zhoD[j].degreeId)
  6446. } else {
  6447. formData.append('degreeId','-1')
  6448. }
  6449. }
  6450. }else{
  6451. formData.append("degreeId", "-1");
  6452. }
  6453. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6454. formData.append('customData',zhoD[j].customData)
  6455. }else if(this.user.timeType.customDataActive){
  6456. formData.append('customData',0)
  6457. }
  6458. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6459. formData.append('customText',zhoD[j].customText)
  6460. }else if(this.user.timeType.customTextActive){
  6461. formData.append('customText','-')
  6462. }
  6463. }
  6464. }
  6465. }
  6466. } else {
  6467. for (var i in this.zhoData) {
  6468. var zhoD = this.zhoData[i]
  6469. var flgs = false
  6470. if(this.reportTimeType.type == 2) {
  6471. for(var k in this.selProjectList) {
  6472. var pItem = this.selProjectList[k];
  6473. var pName = pItem.projectName;
  6474. var j = pName;
  6475. console.log('j==周报中的项目='+j);
  6476. if(zhoD[j].time && zhoD[j].time != 'null') {
  6477. flgs = true
  6478. // formData.append("degreeId", "-1");
  6479. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6480. for(var s in this.projectList) {
  6481. if(j == this.projectList[s].projectName) {
  6482. formData.append("projectId", this.projectList[s].id);
  6483. }
  6484. }
  6485. if(this.user.timeType.reportAuditType == 3){
  6486. let audItem = {}
  6487. if(this.user.timeType.auditLevel > 0){
  6488. audItem.auditorFirst = zhoD[j].auditorFirst
  6489. }
  6490. if(this.user.timeType.auditLevel > 1){
  6491. audItem.auditorSec = zhoD[j].auditorSec
  6492. }
  6493. if(this.user.timeType.auditLevel > 2){
  6494. audItem.auditorThird = zhoD[j].auditorThird
  6495. }
  6496. if(zhoD[j].ccUserid){
  6497. audItem.ccUserid = zhoD[j].ccUserid
  6498. }
  6499. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6500. }
  6501. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6502. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6503. formData.append("reportTimeType", this.reportTimeType.type);
  6504. formData.append("endTime", zhoD[j].time[1]);
  6505. formData.append("startTime", zhoD[j].time[0]);
  6506. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6507. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6508. formData.append("isOvertime", 0)
  6509. formData.append("professionProgress", "[]")
  6510. if (zhoD[j].groupId) {
  6511. formData.append("groupId",zhoD[j].groupId)
  6512. } else {
  6513. //解决后台groupId数组越界的问题
  6514. formData.append("groupId",0)
  6515. }
  6516. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6517. formData.append("createDate",zhoD.zhoDataTime)
  6518. if (zhoD[j].projectAuditorId) {
  6519. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6520. }
  6521. if(zhoD[j].basecostId) {
  6522. formData.append("basecostId", zhoD[j].basecostId);
  6523. } else {
  6524. formData.append("basecostId", 0);
  6525. }
  6526. if(this.user.timeType.customDegreeActive){
  6527. if (this.user.timeType.customDegreeMultiple) {
  6528. if (zhoD[j].multiDegrIdArray) {
  6529. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6530. } else {
  6531. formData.append("multiDegrId", "[]");
  6532. }
  6533. } else {
  6534. if (zhoD[j].degreeId) {
  6535. formData.append('degreeId',zhoD[j].degreeId)
  6536. } else {
  6537. formData.append("degreeId", "-1");
  6538. }
  6539. }
  6540. }else{
  6541. formData.append("degreeId", "-1");
  6542. }
  6543. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6544. formData.append('customData',zhoD[j].customData)
  6545. }else if(this.user.timeType.customDataActive){
  6546. formData.append('customData',0)
  6547. }
  6548. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6549. formData.append('customText',zhoD[j].customText)
  6550. }else if(this.user.timeType.customTextActive){
  6551. formData.append('customText','-')
  6552. }
  6553. }
  6554. }
  6555. } else {
  6556. for(var k in this.selProjectList) {
  6557. var pItem = this.selProjectList[k];
  6558. var pName = pItem.projectName;
  6559. var j = pName;
  6560. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6561. flgs = true
  6562. // formData.append("degreeId", "-1");
  6563. console.log('进入了workFpppp==='+j);
  6564. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6565. for(var s in this.projectList) {
  6566. if(j == this.projectList[s].projectName) {
  6567. formData.append("projectId", this.projectList[s].id);
  6568. }
  6569. }
  6570. if(this.user.timeType.reportAuditType == 3){
  6571. let audItem = {}
  6572. if(this.user.timeType.auditLevel > 0){
  6573. audItem.auditorFirst = zhoD[j].auditorFirst
  6574. }
  6575. if(this.user.timeType.auditLevel > 1){
  6576. audItem.auditorSec = zhoD[j].auditorSec
  6577. }
  6578. if(this.user.timeType.auditLevel > 2){
  6579. audItem.auditorThird = zhoD[j].auditorThird
  6580. }
  6581. if(zhoD[j].ccUserid){
  6582. audItem.ccUserid = zhoD[j].ccUserid
  6583. }
  6584. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6585. }
  6586. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6587. // formData.append("subProjectId", zhoD[j].subProjectId);
  6588. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6589. formData.append("reportTimeType", this.reportTimeType.type);
  6590. if(this.reportTimeType.type == 1) {
  6591. formData.append("workingTime", zhoD[j].workingTime);
  6592. } else if(this.reportTimeType.type == 2) {
  6593. formData.append("endTime", zhoD[j].time[1]);
  6594. formData.append("startTime", zhoD[j].time[0]);
  6595. } else if(this.reportTimeType.type == 3) {
  6596. formData.append("progress", zhoD[j].progress);
  6597. formData.append("workingTime", zhoD[j].workingTime);
  6598. }
  6599. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6600. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6601. formData.append("isOvertime", 0)
  6602. formData.append("professionProgress", "[]")
  6603. if (zhoD[j].groupId) {
  6604. formData.append("groupId",zhoD[j].groupId)
  6605. } else {
  6606. //解决后台groupId数组越界的问题
  6607. formData.append("groupId",0)
  6608. }
  6609. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6610. formData.append("createDate",zhoD.zhoDataTime)
  6611. if (zhoD[j].projectAuditorId) {
  6612. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6613. }
  6614. if(zhoD[j].basecostId) {
  6615. formData.append("basecostId", zhoD[j].basecostId);
  6616. } else {
  6617. formData.append("basecostId", 0);
  6618. }
  6619. if(this.user.timeType.customDegreeActive){
  6620. if (this.user.timeType.customDegreeMultiple) {
  6621. if (zhoD[j].multiDegrIdArray) {
  6622. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6623. } else {
  6624. formData.append("multiDegrId", "[]");
  6625. }
  6626. } else {
  6627. if (zhoD[j].degreeId) {
  6628. formData.append('degreeId',zhoD[j].degreeId)
  6629. } else {
  6630. formData.append("degreeId", "-1");
  6631. }
  6632. }
  6633. }else{
  6634. formData.append("degreeId", "-1");
  6635. }
  6636. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6637. formData.append('customData',zhoD[j].customData)
  6638. }else if(this.user.timeType.customDataActive){
  6639. formData.append('customData',0)
  6640. }
  6641. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6642. formData.append('customText',zhoD[j].customText)
  6643. }else if(this.user.timeType.customTextActive){
  6644. formData.append('customText','-')
  6645. }
  6646. }
  6647. }
  6648. }
  6649. }
  6650. }
  6651. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6652. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6653. if(!next) {
  6654. this.$message({
  6655. message: `【${error.join('、')}】请填写任务分组`,
  6656. type: 'error'
  6657. })
  6658. return
  6659. }
  6660. // 自定义维度
  6661. this.submitingReport = true;
  6662. this.http.uploadFile( this.port.report.editPort, formData,
  6663. res => {
  6664. // this.listLoading = false;
  6665. this.submitingReport = false;
  6666. if (res.code == "ok") {
  6667. this.$message({
  6668. message: this.$t('message.fillinsuccessfully'),
  6669. type: "success"
  6670. });
  6671. this.fillWeekDialogVisi = false
  6672. this.selConShow = true
  6673. this.zhoData = []
  6674. this.weekDateRange = ''
  6675. this.getReportList();
  6676. this.getDepartment();
  6677. // 关闭弹窗 并 清空
  6678. this.selProjectList = []
  6679. this.selCon = []
  6680. this.getRecentlyProject()
  6681. } else {
  6682. this.$message({
  6683. message: res.msg,
  6684. type: "error"
  6685. });
  6686. }
  6687. },
  6688. error => {
  6689. this.submitingReport = false;
  6690. this.$message({
  6691. message: error,
  6692. type: "error"
  6693. });
  6694. });
  6695. },
  6696. handleGroupAuditorData(data) {
  6697. const { reportAuditType } = this.user.timeType
  6698. if(reportAuditType != 1 && reportAuditType != 2) {
  6699. return {next: true}
  6700. }
  6701. let arrList = [];
  6702. Object.entries(data).forEach(([key, obj]) => {
  6703. Object.entries(obj).forEach(([projectName, projectData]) => {
  6704. if (projectData.workingTime && !projectData.groupId) {
  6705. arrList.push({
  6706. projectName,
  6707. date: obj.zhoDataTime,
  6708. dateText: obj.zhoDataTimeTxt
  6709. });
  6710. }
  6711. });
  6712. });
  6713. if(arrList.length > 0) {
  6714. return {
  6715. next: false,
  6716. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6717. }
  6718. } else {
  6719. return {
  6720. next: true,
  6721. error: [],
  6722. }
  6723. }
  6724. },
  6725. ChangeHourMinutestr (str) {
  6726. if (str !== "0" && str !== "" && str !== null) {
  6727. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6728. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6729. } else {
  6730. return "";
  6731. }
  6732. },
  6733. // 得到两个日期中间的日期
  6734. getdiffdate(stime,etime){
  6735. //初始化日期列表,数组
  6736. var diffdate = new Array();
  6737. var i=0;
  6738. //开始日期小于等于结束日期,并循环
  6739. while(stime<=etime){
  6740. diffdate[i] = stime;
  6741. //获取开始日期时间戳
  6742. var stime_ts = new Date(stime).getTime();
  6743. //增加一天时间戳后的日期
  6744. var next_date = stime_ts + (24*60*60*1000);
  6745. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6746. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6747. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6748. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6749. stime = next_dates_y+next_dates_m+next_dates_d;
  6750. //增加数组key
  6751. i++;
  6752. }
  6753. return diffdate;
  6754. },
  6755. // 添加模块
  6756. addDomain(i) {
  6757. var leftProgress = 10;
  6758. if (this.reportTimeType.type == 3) {
  6759. //计算已经待分配工时比例
  6760. let array = this.workForm.domains;
  6761. let totalProgress = 0;
  6762. for (var i=0;i<array.length; i++) {
  6763. totalProgress += array[i].progress;
  6764. }
  6765. if (totalProgress < 100) {
  6766. leftProgress = 100 - totalProgress;
  6767. }
  6768. }
  6769. var addItem = {
  6770. projectId: "",
  6771. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6772. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6773. ),
  6774. content: "",
  6775. progress:leftProgress,
  6776. state:2,//2-表示待提交
  6777. multiWorktime: this.reportTimeType.multiWorktime,
  6778. worktimeList:[{}],
  6779. canEdit: true,
  6780. auditorFirst: '',
  6781. auditorSec: '',
  6782. auditorThird: '',
  6783. ccUserid: ''
  6784. // degreeId: '',
  6785. };
  6786. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6787. this.$set(addItem,'isOvertime',true)
  6788. if(this.reportTimeType.type == 3){
  6789. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6790. }
  6791. }
  6792. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6793. //默认给第一个,必填字段
  6794. addItem.basecostId = this.timeBasecostList[0].id;
  6795. }
  6796. this.workForm.domains.push(addItem);
  6797. document.getElementById('workFormsItemBottom').scrollIntoView()
  6798. this.canEdit = true
  6799. if (this.reportTimeType.type == 0) {
  6800. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6801. var length = this.workForm.domains.length;
  6802. if (length == 2) {
  6803. this.showAddMore = false;
  6804. }
  6805. }
  6806. this.chuji()
  6807. this.seleChn()
  6808. },
  6809. // 移除模块
  6810. delDomain(i) {
  6811. this.workForm.domains.splice(i,1)
  6812. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6813. if (!this.originCanEdit) {
  6814. let iscan = false
  6815. for(let i in this.workForm.domains){
  6816. if(this.workForm.domains[i].canEdit){
  6817. iscan = true
  6818. }
  6819. }
  6820. this.canEdit = iscan
  6821. }
  6822. //检测当前剩下的一个,时间类型是否是全天
  6823. if (this.reportTimeType.type == 0) {
  6824. if (this.workForm.domains[0].timeType == 0) {
  6825. this.showAddMore = false;
  6826. } else {
  6827. this.showAddMore = true;
  6828. }
  6829. }
  6830. if(this.user.timeType.multiWorktime == 1) {
  6831. this.iptChangs()
  6832. } else {
  6833. this.seleChn(0)
  6834. }
  6835. },
  6836. // 改变月份
  6837. changeMonth() {
  6838. this.isWeekend = false
  6839. let date = new Date()
  6840. let nowmon = date.getMonth() + 1
  6841. let nowday = date.getDate()
  6842. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6843. if (this.isBatch == 0) {
  6844. if(this.user.timeType.fillAhead == 0){
  6845. let date_a = new Date(this.workForm.createDate)
  6846. if(date_a.getTime() > date.getTime()){
  6847. this.workForm.createDate = nowdate
  6848. }
  6849. }
  6850. //只有按天填报才能获取当天的日报
  6851. if(!this.isSubstitude){
  6852. let weekday = new Date(this.workForm.createDate).getDay()
  6853. if(this.user.companyId == 817){
  6854. if(weekday == 0){
  6855. this.isWeekend = true
  6856. }
  6857. }else{
  6858. if(weekday == 0 || weekday == 6){
  6859. this.isWeekend = true
  6860. }
  6861. }
  6862. this.getReport()
  6863. }
  6864. }else {
  6865. if(this.user.timeType.fillAhead == 0){
  6866. let date_a = new Date(this.workForm.createDate[1])
  6867. if(date_a.getTime() > date.getTime()){
  6868. this.workForm.createDate[1] = nowdate
  6869. let sdate = new Date(this.workForm.createDate[0])
  6870. let edate = new Date(this.workForm.createDate[1])
  6871. if(sdate > edate){
  6872. this.workForm.createDate[0] = this.workForm.createDate[1]
  6873. }
  6874. }
  6875. }
  6876. }
  6877. },
  6878. // 判断时间段
  6879. fns() {
  6880. for (let k in this.dateAr) {
  6881. if (!this.judege(k)) {
  6882. return false
  6883. }
  6884. }
  6885. return true
  6886. },
  6887. judege(idx){
  6888. for (let k in this.dateAr) {
  6889. if (idx !== k) {
  6890. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6891. return false
  6892. }
  6893. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6894. return false
  6895. }
  6896. }
  6897. }
  6898. return true
  6899. },
  6900. getOverlapData(data) {
  6901. let overlapData = [];
  6902. for (let i = 0; i < data.length; i++) {
  6903. for (let j = i + 1; j < data.length; j++) {
  6904. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6905. overlapData.push(data[i], data[j]);
  6906. }
  6907. }
  6908. }
  6909. return overlapData;
  6910. },
  6911. // 保存日报111111
  6912. submitReport(isDraft) {
  6913. this.isDraft = isDraft;
  6914. this.$refs.workForm.validate(valid => {
  6915. if (valid) {
  6916. if(this.totalReportHours < this.user.timeType.allday){
  6917. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6918. confirmButtonText: '确定',
  6919. cancelButtonText: '取消',
  6920. type: 'warning'
  6921. }).then(() => {
  6922. this.submitReportSon()
  6923. }).catch(() => {
  6924. });
  6925. }else{
  6926. this.submitReportSon()
  6927. }
  6928. }
  6929. });
  6930. },
  6931. submitReportSon() {
  6932. this.dateAr = []
  6933. //检查重叠
  6934. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6935. let alp = []
  6936. if(this.user.timeType.multiWorktime != 1) {
  6937. for(var p in this.workForm.domains) {
  6938. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6939. let objs = {}
  6940. objs.s = this.workForm.domains[p].startTime
  6941. objs.e = this.workForm.domains[p].endTime
  6942. alp.push(objs)
  6943. }
  6944. }
  6945. this.dateAr = alp
  6946. if(this.dateAr.length > 0) {
  6947. let trus = this.fns()
  6948. if(!trus) {
  6949. this.$message({
  6950. message: this.$t('message.Filledtimeperiodsoverlap'),
  6951. type: "error"
  6952. });
  6953. return
  6954. }
  6955. }
  6956. } else {
  6957. for(var p in this.workForm.domains) {
  6958. var slll = this.workForm.domains[p]
  6959. for(var o in slll.worktimeList) {
  6960. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6961. let objs = {}
  6962. objs.s = slll.worktimeList[o].startTime
  6963. objs.e = slll.worktimeList[o].endTime
  6964. alp.push(objs)
  6965. }
  6966. }
  6967. }
  6968. this.dateAr = alp
  6969. if(this.dateAr.length > 0) {
  6970. let trus = this.fns()
  6971. if(!trus) {
  6972. this.$message({
  6973. message: this.$t('message.Filledtimeperiodsoverlap'),
  6974. type: "error"
  6975. });
  6976. return
  6977. }
  6978. }
  6979. }
  6980. }
  6981. //检查子项目
  6982. if (this.user.timeType.subProMustFill == 1) {
  6983. for(var p in this.workForm.domains) {
  6984. var oneProItem = this.workForm.domains[p]
  6985. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6986. //没有选择子项目
  6987. this.$message({
  6988. message: '子项目必填,请检查',
  6989. type: "error"
  6990. });
  6991. return
  6992. }
  6993. }
  6994. }
  6995. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  6996. if (this.user.companyId == this.yuzhongCompId) {
  6997. for(var p in this.workForm.domains) {
  6998. var oneProItem = this.workForm.domains[p]
  6999. if (!oneProItem.extraField1) {
  7000. this.$message({
  7001. message: '角色必填,请检查',
  7002. type: "error"
  7003. });
  7004. return
  7005. }
  7006. if (!oneProItem.extraField2) {
  7007. this.$message({
  7008. message: '工作职责必填,请检查',
  7009. type: "error"
  7010. });
  7011. return
  7012. }
  7013. if (!oneProItem.extraField3) {
  7014. this.$message({
  7015. message: '工作内容必填,请检查',
  7016. type: "error"
  7017. });
  7018. return
  7019. }
  7020. }
  7021. }
  7022. // return
  7023. //代填的情况,检查人员是否已经选择
  7024. if (this.isSubstitude) {
  7025. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7026. this.$message({
  7027. message: this.$t('message.pleaseselectthepersontofillin'),
  7028. type: "error"
  7029. });
  7030. return;
  7031. }
  7032. }
  7033. //检查时间,全天和上下午不能同时存在
  7034. if (this.reportTimeType.type == 0) {
  7035. var alldayNum = 0;
  7036. var amNum = 0;
  7037. var pmNum = 0;
  7038. for(var i in this.workForm.domains) {
  7039. if (this.workForm.domains[i].timeType == 0) {
  7040. alldayNum ++;
  7041. } else if (this.workForm.domains[i].timeType == 1) {
  7042. amNum++;
  7043. } else if (this.workForm.domains[i].timeType == 2) {
  7044. pmNum++;
  7045. }
  7046. }
  7047. if (alldayNum > 1) {
  7048. this.$message({
  7049. // message: "工作时间-全天,只能选择一次",
  7050. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7051. type: "error"
  7052. });
  7053. return;
  7054. }
  7055. if (amNum > 1) {
  7056. this.$message({
  7057. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7058. type: "error"
  7059. });
  7060. return;
  7061. }
  7062. if (pmNum > 1) {
  7063. this.$message({
  7064. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7065. type: "error"
  7066. });
  7067. return;
  7068. }
  7069. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7070. this.$message({
  7071. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7072. type: "error"
  7073. });
  7074. return;
  7075. }
  7076. } else if (this.reportTimeType.type == 3) {
  7077. //总百分比不能超过100%
  7078. let total = 0;
  7079. this.workForm.domains.forEach(w=>{total += w.progress});
  7080. if (total > 100) {
  7081. this.$message({
  7082. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7083. type: "error"
  7084. });
  7085. return;
  7086. } else if (total < 100) {
  7087. this.$message({
  7088. message: this.$t('message.cannotbesubmitted'),
  7089. type: "error"
  7090. });
  7091. return;
  7092. }
  7093. }
  7094. this.listLoading = true;
  7095. let formData = new FormData();
  7096. formData.append("draft", this.isDraft);
  7097. var totalTime = 0;
  7098. for (var t=0;t<this.workForm.domains.length; t++) {
  7099. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7100. }
  7101. //批量填报不校验考勤时长,交给后台校验
  7102. if (!this.isBatch) {
  7103. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7104. if (this.workForm.time){
  7105. if (this.workForm.time.workHours == 0){
  7106. this.$message({
  7107. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7108. type: 'error'
  7109. })
  7110. return
  7111. }
  7112. }else{
  7113. this.$message({
  7114. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7115. type: 'error'
  7116. })
  7117. return
  7118. }
  7119. }
  7120. }
  7121. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7122. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7123. this.$message({
  7124. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7125. type: "error"
  7126. });
  7127. return;
  7128. }
  7129. }
  7130. for(var i in this.workForm.domains) {
  7131. if(this.user.timeType.reportAuditType == 3){
  7132. let audItem = {}
  7133. let auditRule = ''
  7134. if(this.workForm.domains[i].id){
  7135. audItem.reportId = this.workForm.domains[i].id
  7136. }
  7137. if(this.user.timeType.auditLevel > 0){
  7138. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7139. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7140. }
  7141. if(this.user.timeType.auditLevel > 1){
  7142. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7143. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7144. }
  7145. if(this.user.timeType.auditLevel > 2){
  7146. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7147. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7148. }
  7149. if(this.workForm.domains[i].ccUserid){
  7150. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7151. }
  7152. if(auditRule){
  7153. auditRule = auditRule.substring(0,auditRule.length - 1)
  7154. this.$message({
  7155. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7156. type: 'error'
  7157. })
  7158. return
  7159. }
  7160. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7161. }
  7162. if (this.user.timeType.customDegreeActive) {
  7163. if (this.user.timeType.customDegreeMultiple) {
  7164. //多选
  7165. if (this.workForm.domains[i].multiDegrIdArray) {
  7166. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7167. degreeArray = degreeArray.replace(/,/g,"@");
  7168. formData.append("multiDegrId", degreeArray);
  7169. } else {
  7170. formData.append("multiDegrId", '[]');
  7171. }
  7172. } else {
  7173. //单选
  7174. if (this.workForm.domains[i].degreeId) {
  7175. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7176. } else {
  7177. formData.append("degreeId", -1);
  7178. }
  7179. }
  7180. } else {
  7181. formData.append("degreeId", -1);
  7182. }
  7183. if(this.workForm.domains[i].customData) {
  7184. // var sss = this.workForm.domains[i].degreeId.toString()
  7185. formData.append("customData", this.workForm.domains[i].customData);
  7186. } else {
  7187. formData.append("customData", 0);
  7188. }
  7189. if(this.workForm.domains[i].customText) {
  7190. formData.append("customText", this.workForm.domains[i].customText);
  7191. } else {
  7192. formData.append("customText", '-');
  7193. }
  7194. if (this.workForm.domains[i].id) {
  7195. formData.append("id", this.workForm.domains[i].id);
  7196. } else {
  7197. formData.append("id", -1);
  7198. }
  7199. formData.append("projectId", this.workForm.domains[i].projectId);
  7200. if (this.workForm.domains[i].subProjectId) {
  7201. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7202. } else {
  7203. formData.append("subProjectId", 0);
  7204. }
  7205. if (this.workForm.domains[i].groupId) {
  7206. formData.append("groupId", this.workForm.domains[i].groupId);
  7207. } else {
  7208. formData.append("groupId", 0);
  7209. }
  7210. if (this.workForm.domains[i].taskId) {
  7211. formData.append("taskId", this.workForm.domains[i].taskId);
  7212. } else {
  7213. formData.append("taskId", 0);
  7214. }
  7215. if (this.workForm.domains[i].taskFinish == true) {
  7216. formData.append("taskFinish", 1);
  7217. } else {
  7218. formData.append("taskFinish", 0);
  7219. }
  7220. formData.append("reportTimeType", this.reportTimeType.type);
  7221. if (this.reportTimeType.type == 0) {
  7222. formData.append("timeType", this.workForm.domains[i].timeType);
  7223. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7224. formData.append("workingTime", workingTime);
  7225. } else if (this.reportTimeType.type == 1){
  7226. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7227. } else if (this.reportTimeType.type == 2) {
  7228. formData.append("endTime", this.workForm.domains[i].endTime);
  7229. formData.append("startTime", this.workForm.domains[i].startTime);
  7230. } else if (this.reportTimeType.type == 3) {
  7231. //按比例分配
  7232. formData.append("progress", this.workForm.domains[i].progress);
  7233. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7234. }
  7235. if(this.user.timeType.choseFromAlbum == 1 ) {
  7236. console.log(this.workForm.domains[i].imgList)
  7237. if(this.workForm.domains[i].imgList) {
  7238. let imgListFor = this.workForm.domains[i].imgList
  7239. for(var b in imgListFor) {
  7240. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7241. }
  7242. console.log(imgListFor)
  7243. let m = JSON.stringify(imgListFor);
  7244. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7245. formData.append("picStr", m);
  7246. } else {
  7247. formData.append("picStr", '[]');
  7248. }
  7249. }
  7250. //处理多个时间事项
  7251. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7252. if (this.reportTimeType.multiWorktime == 1) {
  7253. //检查时间是否有重叠
  7254. var workList = this.workForm.domains[i].worktimeList;
  7255. for (var j=0;j<workList.length; j++) {
  7256. var curItem = workList[j];
  7257. //检查开始时间是否大于结束时间
  7258. if (curItem.startTime >= curItem.endTime) {
  7259. this.$message({
  7260. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7261. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7262. type: "error"
  7263. });
  7264. return;
  7265. }
  7266. //时间不可重叠
  7267. if (this.reportTimeType.timeCanOverlap == 0) {
  7268. for (var p = j+1;p<workList.length; p++) {
  7269. var jItem = workList[p];
  7270. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7271. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7272. this.$message({
  7273. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7274. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7275. type: "error"
  7276. });
  7277. return;
  7278. }
  7279. }
  7280. }
  7281. }
  7282. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7283. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7284. formData.append("content", m);
  7285. } else {
  7286. if (this.workForm.domains[i].content) {
  7287. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7288. m = m.replace(/,/g,",");
  7289. console.log(m, '需要传值的数据')
  7290. // formData.append("content", this.workForm.domains[i].content);
  7291. formData.append("content", m);
  7292. } else {
  7293. formData.append("content", '-');
  7294. }
  7295. }
  7296. if (this.isBatch == 0) {
  7297. formData.append("createDate", this.workForm.createDate);
  7298. } else {
  7299. //批量填报,时间范围
  7300. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7301. }
  7302. if(this.workForm.domains[i].isOvertime) {
  7303. formData.append("isOvertime", 1);
  7304. } else {
  7305. formData.append("isOvertime", 0);
  7306. }
  7307. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7308. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7309. } else {
  7310. formData.append("overtimeHours", 0);
  7311. }
  7312. if(this.workForm.domains[i].basecostId) {
  7313. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7314. } else {
  7315. formData.append("basecostId", 0);
  7316. }
  7317. if (this.workForm.userId != null) {
  7318. var targetUids = '';
  7319. this.workForm.userId.forEach(u=>{
  7320. targetUids += u + '@';
  7321. });
  7322. if (targetUids.length > 0) {
  7323. targetUids = targetUids.substring(0, targetUids.length -1);
  7324. formData.append("targetUids", targetUids);
  7325. }
  7326. }
  7327. //项目专业进度
  7328. if (this.workForm.domains[i].professionProgress) {
  7329. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7330. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7331. formData.append("professionProgress", m);
  7332. } else {
  7333. formData.append("professionProgress", "[]");
  7334. }
  7335. if (this.workForm.domains[i].stage) {
  7336. formData.append("stage", this.workForm.domains[i].stage);
  7337. } else {
  7338. formData.append("stage", "-");
  7339. }
  7340. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7341. if (this.workForm.domains[i].projectAuditorId) {
  7342. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7343. } else {
  7344. // console.log('执行到了这里')
  7345. // console.log(this.user.timeType.reportAuditType)
  7346. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7347. this.$message({
  7348. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7349. type: "error"
  7350. });
  7351. return;
  7352. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7353. //分组负责人先审核, 确定是选择了任务分组
  7354. if (this.workForm.domains[i].taskGroups.length == 0) {
  7355. this.$message({
  7356. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7357. type: "error"
  7358. });
  7359. } else if (!this.workForm.domains[i].groupId) {
  7360. // console.log(this.workForm.domains[i]);
  7361. this.$message({
  7362. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7363. type: "error"
  7364. });
  7365. } else {
  7366. this.$message({
  7367. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7368. type: "error"
  7369. });
  7370. }
  7371. return;
  7372. }
  7373. }
  7374. if (this.user.companyId == this.yuzhongCompId) {
  7375. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7376. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7377. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7378. }
  7379. //依斯贝的服务Id
  7380. if (this.user.companyId == this.yisibeiCompId) {
  7381. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7382. }
  7383. }
  7384. this.submitingReport = true;
  7385. this.http.uploadFile( this.port.report.editPort, formData,
  7386. res => {
  7387. this.listLoading = false;
  7388. this.submitingReport = false;
  7389. if (res.code == "ok") {
  7390. if(res.msg!=null){
  7391. this.$message({
  7392. dangerouslyUseHTMLString: true,
  7393. message: res.msg,
  7394. type: "warning",
  7395. showClose: true,
  7396. duration: 0
  7397. });
  7398. }else{
  7399. this.$message({
  7400. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7401. type: "success"
  7402. });
  7403. }
  7404. this.dialogVisible = false;
  7405. this.jsDay = 0
  7406. this.jsTime = 0
  7407. this.getReportList();
  7408. this.getDepartment();
  7409. this.getRecentlyProject()
  7410. } else {
  7411. this.$message({
  7412. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7413. type: "error"
  7414. });
  7415. }
  7416. },
  7417. error => {
  7418. this.listLoading = false;
  7419. this.submitingReport = false;
  7420. this.$message({
  7421. message: error,
  7422. type: "error"
  7423. });
  7424. });
  7425. },
  7426. // 判断是展示那个工时导入
  7427. imports() {
  7428. if(this.user.timeType.syncCorpwxTime == 0) {
  7429. this.importDialog = true
  7430. } else {
  7431. this.importWxDialog = true
  7432. }
  7433. },
  7434. // 跳转
  7435. junpToDeskTop(id) {
  7436. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7437. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7438. },
  7439. // 通过日报
  7440. approve(id, item) {
  7441. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7442. this.approveinData = {
  7443. id: id,
  7444. date: this.date +day,
  7445. reportIds: item.id
  7446. }
  7447. if(this.user.timeType.needEvaluate == 1){
  7448. this.$set(this.approveinData,'evaluate','')
  7449. this.approveinDialog = true
  7450. }else{
  7451. this.logining = true;
  7452. this.approveinfun()
  7453. }
  7454. },
  7455. approveinfun(){
  7456. this.http.post( this.port.report.approve, this.approveinData,
  7457. res => {
  7458. this.logining = false;
  7459. if (res.code == "ok") {
  7460. this.approveinDialog = false
  7461. this.$message({
  7462. message: this.$t('message.Reviewsucceeded'),
  7463. type: "success"
  7464. });
  7465. this.getReportList();
  7466. this.getDepartment();
  7467. } else {
  7468. this.$message({
  7469. message: res.msg,
  7470. type: "error"
  7471. });
  7472. }
  7473. },
  7474. error => {
  7475. this.logining = false;
  7476. this.$message({
  7477. message: error,
  7478. type: "error"
  7479. });
  7480. });
  7481. },
  7482. //撤回日报
  7483. cancel(item,e) {
  7484. // console.log('can can need',item);
  7485. this.logining = true;
  7486. var ids = '';
  7487. var data = e ? item : item.data;
  7488. data.forEach(element => {
  7489. if(element.id){
  7490. ids +=(element.id+',');
  7491. }
  7492. });
  7493. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7494. res => {
  7495. this.logining = false;
  7496. if (res.code == "ok") {
  7497. this.$message({
  7498. message:this.$t('message.Withdrawalsucceeded'),
  7499. type: "success"
  7500. });
  7501. this.getReportList();
  7502. if(e){this.getReport()}
  7503. this.getDepartment();
  7504. } else {
  7505. this.$message({
  7506. message: res.msg,
  7507. type: "error"
  7508. });
  7509. }
  7510. },
  7511. error => {
  7512. this.logining = false;
  7513. this.$message({
  7514. message: error,
  7515. type: "error"
  7516. });
  7517. });
  7518. },
  7519. showDenyDialog(id,i, item) {
  7520. this.denyReasonDialog = true;
  7521. this.isDenying = false;
  7522. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7523. var ids = item.id;
  7524. // var data = item.data;
  7525. // data.forEach(element => {
  7526. // ids +=(element.id+',');
  7527. // });
  7528. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7529. },
  7530. // 未通过日报
  7531. deny() {
  7532. this.logining = true;
  7533. this.isDenying = true;
  7534. this.http.post( this.port.report.deny, this.denyForm,
  7535. res => {
  7536. this.logining = false;
  7537. this.isDenying = false;
  7538. if (res.code == "ok") {
  7539. this.$message({
  7540. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7541. type: "success"
  7542. });
  7543. this.getReportList();
  7544. this.getDepartment();
  7545. this.denyReasonDialog = false;
  7546. } else {
  7547. this.$message({
  7548. message: res.msg,
  7549. type: "error"
  7550. });
  7551. }
  7552. },
  7553. error => {
  7554. this.logining = false;
  7555. this.$message({
  7556. message: error,
  7557. type: "error"
  7558. });
  7559. });
  7560. },
  7561. // 查看工时记录弹窗
  7562. toView() {
  7563. this.toViewDialogVisible = true
  7564. this.toViewloading = true
  7565. this.getToView()
  7566. },
  7567. getToView() {
  7568. this.http.post( '/report-import-log/getList', this.toViewForm,
  7569. res => {
  7570. this.toViewloading = false;
  7571. if (res.code == "ok") {
  7572. // console.log(res.data, '数据数据')
  7573. this.toViewList = res.data.records
  7574. this.toViewForm.total = res.data.total
  7575. } else {
  7576. this.toViewloading = false;
  7577. this.$message({
  7578. message: res.msg,
  7579. type: "error"
  7580. });
  7581. }
  7582. })
  7583. },
  7584. // 触发 selectCat 组件更改他的值
  7585. selectCatCli(obj) {
  7586. // console.log(obj, '看看')
  7587. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7588. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7589. },
  7590. vueCasader(obj) {
  7591. // console.log(obj, '看看值')
  7592. if(obj.distinction == 1 && obj.item) {
  7593. let arr = []
  7594. arr.push(obj.item.id)
  7595. this.exportParam.departmentId = arr
  7596. }
  7597. },
  7598. //分页
  7599. handleCurrentChange(val) {
  7600. this.toViewForm.pageIndex = val;
  7601. this.getToView();
  7602. },
  7603. handleSizeChange(val) {
  7604. this.toViewForm.pageSize = val;
  7605. this.getToView();
  7606. },
  7607. getAllUsersList(){
  7608. this.http.post('/user/getSimpleActiveUserList',{
  7609. },res => {
  7610. if(res.code == 'ok'){
  7611. this.allUsersList = res.data
  7612. }else{
  7613. this.$message({
  7614. message: res.msg,
  7615. type: 'error'
  7616. })
  7617. }
  7618. },err => {
  7619. this.$message({
  7620. message: err,
  7621. type: 'error'
  7622. })
  7623. })
  7624. },
  7625. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7626. fillWeekCustomClne() {
  7627. this.fillWeekDialogVisiCustom = false
  7628. },
  7629. fillWeekCustomSubmit() {
  7630. this.getReportList();
  7631. this.getDepartment();
  7632. this.getRecentlyProject()
  7633. },
  7634. // 待填日报姓名搜索
  7635. nameAearchSeek(flg) {
  7636. if(!this.nameAearch) {
  7637. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7638. return
  7639. }
  7640. if(flg) {
  7641. this.enterpriseWechatgetUser()
  7642. }
  7643. },
  7644. handleThreeData(userList) {
  7645. console.log(userList, '人员数据')
  7646. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7647. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7648. },
  7649. // 过滤树节点
  7650. filterTreeNodes(treeData, filterKeywords) {
  7651. return treeData.filter((node) => {
  7652. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7653. if (node.children && node.children.length > 0) {
  7654. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7655. }
  7656. return true;
  7657. }
  7658. if (node.children && node.children.length > 0) {
  7659. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7660. return node.children.length > 0;
  7661. }
  7662. return false;
  7663. });
  7664. },
  7665. // 企业微信获取人员
  7666. enterpriseWechatgetUser() {
  7667. this.deptMembDataLoading = true
  7668. this.http.post('/user/getEmployeeList',{
  7669. departmentId: -1,
  7670. pageIndex: 1,
  7671. pageSize: 100,
  7672. keyword: this.nameAearch,
  7673. status: '',
  7674. roleId: '',
  7675. cursor: '',
  7676. onlyDirect: '',
  7677. matchingType: ''
  7678. },res => {
  7679. if(res.code == 'ok'){
  7680. this.deptMembDataLoading = false
  7681. const userListName = res.data.records.map(item => item.name)
  7682. this.handleThreeData(userListName)
  7683. }else{
  7684. this.deptMembDataLoading = false
  7685. this.$message({
  7686. message: res.msg,
  7687. type: 'error'
  7688. })
  7689. }
  7690. },err => {
  7691. this.deptMembDataLoading = false
  7692. this.$message({
  7693. message: err,
  7694. type: 'error'
  7695. })
  7696. })
  7697. },
  7698. // 按周填报获取相关任务
  7699. async getWeeklyTaskList(item) {
  7700. console.log(item, '<=== 数据')
  7701. const { projectId, groupId, stage, taskId } = item
  7702. console.log(projectId, groupId, stage)
  7703. let parms = { projectId, isSubstitude: 0 }
  7704. groupId ? parms.groupId = groupId : ''
  7705. stage ? parms.stage = stage : ''
  7706. const { data } = await this.postData('/task/getRecentTask', parms)
  7707. this.zhoBao.taskId = taskId
  7708. this.$set(this.zhoBao, 'taskList', data)
  7709. console.log(this.zhoBao)
  7710. },
  7711. // 封装 post 请求
  7712. postData(url, params) {
  7713. return new Promise((resolve, reject) => {
  7714. this.http.post(url, { ...params },
  7715. res => {
  7716. resolve(res)
  7717. },
  7718. error => {
  7719. this.$message({
  7720. message: error,
  7721. type: "error"
  7722. });
  7723. reject(error)
  7724. })
  7725. })
  7726. },
  7727. // 自定义事件
  7728. selectCal(obj) {
  7729. console.log(obj, '传数据来源')
  7730. if(obj.distinction == '1') {
  7731. this.zhoBao.projectAuditorId = obj.id
  7732. } else if(obj.distinction == '2') {
  7733. this.zhoBao.auditorFirst = obj.id
  7734. } else if(obj.distinction == '3') {
  7735. this.zhoBao.auditorSec = obj.id
  7736. } else if(obj.distinction == '4') {
  7737. this.zhoBao.auditorThird = obj.id
  7738. } else if(obj.distinction == '5') {
  7739. this.zhoBao.ccUserid = obj.id
  7740. } else if(obj.distinction == '12') {
  7741. this.usersListId = obj.id
  7742. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7743. this.searchKeyword = obj.name
  7744. } else {
  7745. this.searchKeyword = ''
  7746. }
  7747. this.searchScreen(0)
  7748. } else if(obj.distinction == '13') {
  7749. this.usersListId = obj.id
  7750. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7751. this.searchKeyword = obj.name
  7752. } else {
  7753. this.searchKeyword = ''
  7754. }
  7755. this.searchScreen(1)
  7756. }
  7757. }
  7758. },
  7759. created() {
  7760. this.getUsers()
  7761. let height = window.innerHeight;
  7762. this.tableHeight = height - 178;
  7763. const that = this;
  7764. window.onresize = function temp() {
  7765. that.tableHeight = window.innerHeight - 178;
  7766. };
  7767. this.toViewForm.companyId = this.user.companyId
  7768. this.initDrag([{
  7769. type: "LR",
  7770. domClass: {
  7771. // 中间分割线的名字
  7772. resize: "line-line",
  7773. // 左侧盒子的名字
  7774. left: "box-left",
  7775. // 右侧盒子的名字
  7776. right: "box-right",
  7777. // 父级的名字
  7778. box: "box-father",
  7779. },
  7780. otherInfo: {
  7781. // 限制左边栏最低宽度
  7782. leftWidth: 120,
  7783. },
  7784. },
  7785. {
  7786. type: "LR",
  7787. domClass: {
  7788. // 中间分割线的名字
  7789. resize: "line-second",
  7790. // 左侧盒子的名字
  7791. left: "left-laowang",
  7792. // 右侧盒子的名字
  7793. right: "box-second-father",
  7794. // 父级的名字
  7795. box: "grand",
  7796. },
  7797. otherInfo: {
  7798. // 限制左边栏最低宽度
  7799. leftWidth: 120,
  7800. },
  7801. },
  7802. ]);
  7803. }
  7804. };
  7805. </script>
  7806. <style lang="scss" scoped>
  7807. .fillWeekDialogVisiCustom {
  7808. width: 100%;
  7809. height: 70vh;
  7810. }
  7811. .fillWeekCustom {
  7812. .el-dialog__body {
  7813. padding: 20px 20px !important;
  7814. }
  7815. }
  7816. .photos {
  7817. position: relative;
  7818. display: flex;
  7819. flex-wrap: wrap;
  7820. }
  7821. .photos_img {
  7822. width: 120px;
  7823. height: 120px;
  7824. margin-right: 20px;
  7825. margin-bottom: 20px;
  7826. cursor: pointer;
  7827. img {
  7828. width: 100%;
  7829. height: 100%;
  7830. }
  7831. }
  7832. .paginatis {
  7833. padding: 10px 10px;
  7834. background: #f2f2f2;
  7835. }
  7836. .waiting {
  7837. color:orange;
  7838. }
  7839. .filledReportStyle {
  7840. color:#32CD32;
  7841. }
  7842. .RejectStyle {
  7843. color:red;
  7844. }
  7845. .waitSubmitStyle{
  7846. color: #409eff;
  7847. }
  7848. .chooseDate {
  7849. .waiting {
  7850. color: #20a0ff;
  7851. }
  7852. .filledReportStyle {
  7853. color:#20a0ff;
  7854. }
  7855. .RejectStyle {
  7856. color: #20a0ff;
  7857. }
  7858. .waitSubmitStyle{
  7859. color: #20a0ff;
  7860. }
  7861. }
  7862. .allDaily {
  7863. width:100%;
  7864. }
  7865. .report_title {
  7866. padding:10px 0;
  7867. color:#666;
  7868. }
  7869. .clearfix {
  7870. overflow-x: auto;
  7871. white-space: nowrap;
  7872. padding: 15px 0 10px 0;
  7873. // overflow-y: hidden;
  7874. .date_item {
  7875. padding: 0 3px;
  7876. cursor: pointer;
  7877. position: relative;
  7878. }
  7879. .chooseDate {
  7880. position: absolute;
  7881. bottom: -3px;
  7882. width: 37px;
  7883. height: 2px;
  7884. left: 14px;
  7885. background: #20a0ff;
  7886. }
  7887. }
  7888. .one_daily {
  7889. i {
  7890. color: #9ed0ff;
  7891. margin-right: 5px;
  7892. }
  7893. .one_daily_body {
  7894. padding: 10px 0px;
  7895. p {
  7896. margin: 0;
  7897. line-height: 30px;
  7898. }
  7899. }
  7900. ul {
  7901. padding: 0;
  7902. }
  7903. }
  7904. .checkbtn {
  7905. float: right;
  7906. margin-top: -10px;
  7907. }
  7908. .selConStyle{
  7909. margin-top:9rem;
  7910. margin-bottom:11rem;
  7911. .selConStyle_title{
  7912. height: 3rem;
  7913. text-align: center;
  7914. font-size: 17px;
  7915. }
  7916. .el-select{
  7917. margin: 0 15%;
  7918. width: 70%;
  7919. }
  7920. }
  7921. </style>
  7922. <style lang="scss">
  7923. /*去除upload组件过渡效果*/
  7924. .photos .el-upload-list__item {
  7925. transition: none !important;
  7926. }
  7927. .daily {
  7928. .el-card__body {
  7929. height: 80%;
  7930. overflow-y: auto;
  7931. }
  7932. .el-card__header {
  7933. padding: 0 20px;
  7934. }
  7935. }
  7936. .membListClass{
  7937. .el-dialog__body{
  7938. padding-top: 10px;
  7939. }
  7940. }
  7941. // .editReportDialog .el-dialog__footer{
  7942. // position: sticky;
  7943. // bottom: 0;
  7944. // background: #fff;
  7945. // height: 70px;
  7946. // z-index: 1010;
  7947. // }
  7948. .editReportDialog{
  7949. min-width: 800px;
  7950. }
  7951. .touruxiangmu{
  7952. max-width: 1000px;
  7953. }
  7954. </style>
  7955. <style scoped>
  7956. /* 项目标签的样式 */
  7957. .el-tag + .el-tag {
  7958. margin-left: 10px;
  7959. }
  7960. .button-new-tag {
  7961. margin-left: 10px;
  7962. height: 32px;
  7963. line-height: 30px;
  7964. padding-top: 0;
  7965. padding-bottom: 0;
  7966. }
  7967. .input-new-tag {
  7968. width: 90px;
  7969. margin-left: 10px;
  7970. vertical-align: bottom;
  7971. }
  7972. .selectworktime .el-table__fixed-body-wrapper{
  7973. top: 48px !important;
  7974. }
  7975. .selectworktime_export .selectworktime_export_l{
  7976. width: 650px;
  7977. float: left;
  7978. height: 42px;
  7979. }
  7980. .approvalProcessBox{
  7981. margin-left: 30px;
  7982. font-size: 14px;
  7983. line-height: 16px;
  7984. cursor: pointer;
  7985. }
  7986. .approvalProcessBox i {
  7987. margin-right: 0;
  7988. height: 16px;
  7989. width: 16px;
  7990. display: inline-block;
  7991. transform: scale(1.2);
  7992. position: relative;
  7993. top: 0.5px;
  7994. color: #409eff;
  7995. }
  7996. .approvalProcessBox .approvalProcessClick{
  7997. cursor: pointer;
  7998. color: #409eff;
  7999. font-size: 14px;
  8000. }
  8001. .approvalProcessBox:hover .approvalProcessClick{
  8002. color: #3485fb;
  8003. }
  8004. </style>
  8005. <style lang="scss" scoped>
  8006. // 加班样式
  8007. .overtime {
  8008. display: inline-block;
  8009. margin-left: 20px;
  8010. input {
  8011. display: inline-block;
  8012. margin-top: 5px;
  8013. }
  8014. }
  8015. .plus {
  8016. display: inline-block;
  8017. }
  8018. // .tages {
  8019. // float: right;
  8020. // }
  8021. .overtime {
  8022. display: inline-block;
  8023. margin-left: 30px;
  8024. }
  8025. .bloks {
  8026. display: inline-block;
  8027. width: 380px;
  8028. }
  8029. .zhiss {
  8030. display: flex;
  8031. justify-content: space-around;
  8032. align-items: center;
  8033. }
  8034. .zhoFel {
  8035. display: flex;
  8036. justify-content: space-between;
  8037. align-items: center;
  8038. }
  8039. // 左右滑动样式
  8040. .line {
  8041. width: 30px;
  8042. /* height: 500px; */
  8043. background: #f2f2f2;
  8044. cursor: w-resize;
  8045. }
  8046. .box-father {
  8047. border: 8px solid #000;
  8048. }
  8049. .line-second {
  8050. width: 10px;
  8051. /* background: red; */
  8052. }
  8053. .flex {
  8054. display: flex;
  8055. width: 100%;
  8056. }
  8057. .box-left {
  8058. flex: 0 0 400px;
  8059. /* height: 600px; */
  8060. /* background: blue; */
  8061. }
  8062. .box-right {
  8063. /* height: 600px; */
  8064. /* background: green; */
  8065. flex: 1;
  8066. }
  8067. .box-postion {
  8068. width: 200px;
  8069. /* height: 400px; */
  8070. background: #ccc;
  8071. }
  8072. .custom-tree-node {
  8073. flex: 1;
  8074. display: flex;
  8075. align-items: center;
  8076. justify-content: space-between;
  8077. font-size: 14px;
  8078. padding-right: 8px;
  8079. }
  8080. .daitianrbao {
  8081. width: 100%;
  8082. box-sizing: border-box;
  8083. height: 40px;
  8084. border-radius: 4px;
  8085. border: 1px solid #DCDFE6;
  8086. overflow: hidden;
  8087. text-overflow: ellipsis;
  8088. display: flex;
  8089. // align-items: center;
  8090. }
  8091. .daitianrbao .spnn {
  8092. display: inline-block;
  8093. box-sizing: border-box;
  8094. padding: 0 15px;
  8095. overflow: hidden;
  8096. text-overflow: ellipsis;
  8097. }
  8098. .daitianrbao .hover {
  8099. color: #DCDFE6 !important;
  8100. }
  8101. </style>