daily.vue 393 KB

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