daily.vue 484 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186
  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;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <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'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <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">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <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')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <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')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. 未填
  126. <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')}}
  127. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  136. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  137. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  138. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  139. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  140. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  141. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  142. <!--部门负责人给个导出工时的功能 -->
  143. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  144. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  146. <el-link type="primary" v-if="user.roleName == '超级管理员' && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">日报审核修改</el-link>
  147. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  148. </span>
  149. </div>
  150. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  151. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  152. <i class="fa fa-circle"></i>
  153. <!-- {{item1.name}} -->
  154. <span v-if="user.userNameNeedTranslate == '1'">
  155. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  156. </span>
  157. <span v-if="user.userNameNeedTranslate != '1'">
  158. {{item1.name}}
  159. </span>
  160. <span style="margin-left:30px;">
  161. <span style="margin-right:20px;">
  162. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  163. <!-- 工作总时长: -->
  164. {{$t('other.totalWorkingHours')}}
  165. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  166. <span >{{item1.reportTime | amounts}}</span>h
  167. </span>
  168. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  169. <i class="iconfont firerock-iconliucheng1"></i>
  170. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  171. <!-- 审批流程 -->
  172. {{$t('other.approvalProcess')}}
  173. </span>
  174. </span>
  175. </span>
  176. <div class="checkbtn" style="padding-right:20px;">
  177. <!--编辑和删除日报-->
  178. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  179. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  180. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  181. </div>
  182. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  183. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  184. </div>
  185. <div class="one_daily_body">
  186. <el-timeline>
  187. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  188. <el-card shadow="never">
  189. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  190. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  191. <span v-if="user.company.packageEngineering == 0">
  192. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  193. <span v-if="user.timeType.reportAuditType == 7" >
  194. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  195. <span v-if="item2.deptAuditorName">、</span>
  196. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  197. </span>
  198. <span v-else>
  199. <span v-if="item2.isDeptAudit==0">
  200. <span v-if="item2.projectAuditState==0">
  201. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  202. <span v-if="item2.projectAuditorName != null">(
  203. <!-- {{item2.projectAuditorName}} -->
  204. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  205. )</span>
  206. <!-- 审核 --> {{$t('other.audit')}}
  207. </span>
  208. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  209. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  210. <span v-if="item2.projectAuditorName != null">(
  211. <!-- {{item2.projectAuditorName}} -->
  212. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  213. )</span>
  214. <!-- 审核通过 --> {{$t('state.approved')}}
  215. </span>
  216. </span>
  217. <span v-else-if="item2.isDeptAudit==1">
  218. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  219. ({{$t('other.await')}}
  220. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  221. {{$t('other.audit')}})
  222. </span>
  223. </span>
  224. ]</span>
  225. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  226. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  227. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  228. </span>
  229. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  230. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  231. </span>
  232. <!-- <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> -->
  233. <span v-if="user.company.packageEngineering == 1">
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  238. (
  239. <!-- <span v-if="user.userNameNeedTranslate != 1">
  240. {{item2.projectAuditorName}}
  241. </span>
  242. <span v-if="user.userNameNeedTranslate == 1">
  243. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  244. </span> -->
  245. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  246. )
  247. </span>{{$t('other.audit')}} ]</span>
  248. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  249. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  251. </span>
  252. <!--每个项目上单独审核 -->
  253. <span style="float:right;">
  254. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  255. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  256. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  257. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  258. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  259. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  260. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  261. <!--自己可以撤回待审核状态的报告 -->
  262. <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>
  263. </span>
  264. </p>
  265. <p v-if="user.companyId == yuzhongCompId">
  266. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  267. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  268. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  269. <!--任务分组和阶段 -->
  270. <p v-if="item2.groupId != 0">
  271. {{$t('other.taskGroup')}}:{{item2.groupName}}
  272. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  273. </p>
  274. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  275. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  276. <!-- 自定义日报文本 -->
  277. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  278. <p v-if="user.company.packageEngineering == 1">
  279. {{$t('other.professionalProgress')}}:
  280. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  281. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  282. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhetongguo"></i>
  286. </el-tooltip>
  287. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  288. <i class="iconfont firerock-iconshenhebohui"></i>
  289. </el-tooltip>
  290. </span>
  291. </p>
  292. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  293. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  294. </p>
  295. <div v-if="item2.multiWorktime==0">
  296. <p style="display: inline-block;">{{$t('time.duration')}}:
  297. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  298. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  299. {{item2.time.toFixed(1)}}h
  300. <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>
  301. </p>
  302. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  303. </div>
  304. <div v-if="item2.multiWorktime==1" >
  305. <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>
  306. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  307. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  308. <p style="display: inline-block;">{{$t('time.duration')}}:
  309. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  310. {{timeItem.time.toFixed(1)}}h
  311. </p>
  312. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  313. </div>
  314. </div>
  315. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  316. <!--照片的显示 -->
  317. <p v-if="item2.pics != null && item2.pics.length > 0">
  318. <el-image v-for="(pic, index) in item2.pics" :key="index"
  319. style="width: 100px; height: 100px; margin-right:10px;"
  320. :src="pic"
  321. :preview-src-list="item2.pics">
  322. </el-image>
  323. </p>
  324. </el-card>
  325. </el-timeline-item>
  326. </el-timeline>
  327. </div>
  328. </div>
  329. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  330. <!-- 简陋的无报告提示 -->
  331. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </el-card>
  338. </div>
  339. <!-- 工时推送日志弹窗 -->
  340. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  341. <template>
  342. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  343. </template>
  344. <template>
  345. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  346. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  347. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  348. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  349. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  350. <el-table-column prop="result" label="推送结果" width="250">
  351. <template slot-scope="scope">
  352. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  353. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  357. </el-table>
  358. </template>
  359. <span slot="footer" class="dialog-footer">
  360. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  361. </span>
  362. </el-dialog>
  363. <!-- 填写日报的dialog -->
  364. <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">
  365. <div style="height: 65vh;overflow: auto;">
  366. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  367. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  368. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  369. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  370. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  371. <span class="spnn" v-if="workForm.userNames">
  372. <span v-for="(item, index) in workForm.userNames" :key="index">
  373. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  374. <span v-if="index < workForm.userNames.length - 1">,</span>
  375. </span>
  376. </span>
  377. <span class="spnn hover" v-else>
  378. {{$t('defaultText.pleaseSelectAsubstitute')}}
  379. </span>
  380. </div>
  381. </el-form-item>
  382. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  383. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  384. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  385. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  386. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  387. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  389. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  390. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  391. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  392. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  393. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  394. <!-- AI智能填报 -->
  395. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  396. </el-form-item>
  397. <!--考勤时长显示-->
  398. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  399. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  400. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  401. </span>
  402. <!--批量填报和批量代填不显示考勤记录-->
  403. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  404. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  405. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  406. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  407. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  408. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  409. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  410. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  411. @click="refreshAttendance(workForm.createDate)"></el-button>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  414. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  415. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  416. </el-form-item>
  417. <!-- 000000 -->
  418. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  419. <div v-if="reportTimeType.multiWorktime==0">
  420. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  421. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  422. <el-select v-model="domain.timeType" style="width:200px;"
  423. v-if="reportTimeType.type == 0"
  424. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. @change="onTimeTypeChange(domain.timeType)">
  427. <el-option
  428. v-for="item in timeType"
  429. :key="item.value"
  430. :label="item.label"
  431. :value="item.value">
  432. </el-option>
  433. </el-select>
  434. <!-- 数字时长选择 -->
  435. <el-select v-model="domain.workingTime" style="width:200px;"
  436. v-if="reportTimeType.type == 1"
  437. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  438. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  439. @change="seleChn(0,domain)">
  440. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  441. </el-select>
  442. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  443. <span v-if="reportTimeType.type == 2">
  444. <!--时间范围选择 -->
  445. <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.startTime"
  448. :placeholder="$t('time.startTime')"
  449. style="width:120px;"
  450. format="HH:mm"
  451. value-format="HH:mm"
  452. :picker-options="{
  453. start: '08:00',
  454. end: '23:30'
  455. }"
  456. @change="iptChang()">
  457. </el-time-picker> - <el-time-picker
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  459. v-model="domain.endTime"
  460. :placeholder="$t('time.endTime')"
  461. style="width:120px;"
  462. format="HH:mm"
  463. value-format="HH:mm"
  464. :picker-options="{
  465. start: '08:00',
  466. end: '23:30',
  467. minTime: domain.startTime
  468. }"
  469. @change="iptChang()">
  470. </el-time-picker>
  471. </span>
  472. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  473. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  474. <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>
  475. </div>
  476. </el-form-item>
  477. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  478. :prop="'domains.' + index + '.reportTargetDeptId'"
  479. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  480. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  481. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  482. <span style="float: left">
  483. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  484. </span>
  485. </el-option>
  486. </el-select>
  487. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  488. </el-form-item>
  489. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  490. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  491. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  492. @change="selectProject(domain, index)"
  493. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  494. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  495. <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">
  496. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  497. <span style="float: right;">{{ item.projectName }}</span>
  498. </el-option>
  499. </el-option-group>
  500. </el-select>
  501. <!--昱众不显示子项目-->
  502. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  503. <span style="margin-left:45px;">
  504. {{$t('lable.subproject')}}</span>
  505. <!--子项目 -->
  506. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  507. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  508. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  509. </el-select>
  510. </template>
  511. <template v-if="user.companyId == yuzhongCompId">
  512. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  513. <!--角色选择 -->
  514. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  515. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  516. <el-option
  517. v-for="item in roleList"
  518. :key="item.value"
  519. :label="item.label"
  520. :value="item.value">
  521. </el-option>
  522. </el-select>
  523. </template>
  524. <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%;"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  526. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  527. </el-link>
  528. <!-- <el-link type="primary" v-if="canEdit"
  529. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  530. </el-form-item>
  531. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  532. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  533. </el-form-item>
  534. <!--如果设置了工时成本预警的预算成本项-->
  535. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  536. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  537. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  538. </el-select>
  539. </el-form-item>
  540. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  541. <template slot="label">
  542. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  543. <span >{{$t('lable.taskGrouping')}}</span>
  544. </template>
  545. <!-- 任务分组 -->
  546. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  547. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  548. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  549. </el-select>
  550. <template v-if="user.companyId == yuzhongCompId">
  551. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  552. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  553. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  554. <el-option
  555. v-for="item in domain.filteredRespList"
  556. :key="item.id"
  557. :label="item.jobRespon"
  558. :value="item.id">
  559. </el-option>
  560. </el-select>
  561. </template>
  562. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  563. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  564. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  565. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  566. @change="changeStages(domain, index)"
  567. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  568. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  569. </el-select>
  570. </template>
  571. </el-form-item>
  572. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  573. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  574. <template slot="label">
  575. <span style="color:#FF0000;">*</span>
  576. <span >{{$t('other.projectAuditor')}}</span>
  577. </template>
  578. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  579. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  580. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  581. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  582. </el-option>
  583. </el-select>
  584. <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>
  585. </el-form-item>
  586. </div>
  587. <el-form-item v-if="user.companyId == yuzhongCompId">
  588. <template slot="label">
  589. <span style="color:#FF0000;">*</span>
  590. <span >工作内容</span>
  591. </template>
  592. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  593. :disabled="(workForm.domains[index].state>=2?false:true)" >
  594. <el-option
  595. v-for="item in domain.workContentList"
  596. :key="item.id"
  597. :label="item.workContext"
  598. :value="item.id">
  599. </el-option>
  600. </el-select>
  601. </el-form-item>
  602. <!-- 111111 -->
  603. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  604. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  605. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  606. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  607. <span v-else>{{item.name}}</span>
  608. </el-option>
  609. </el-select>
  610. <template v-if="user.timeType.auditLevel > 1">
  611. <i class="el-icon-right"></i>
  612. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  613. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  614. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  615. <span v-else>{{item.name}}</span>
  616. </el-option>
  617. </el-select>
  618. </template>
  619. <template v-if="user.timeType.auditLevel > 2">
  620. <i class="el-icon-right"></i>
  621. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  622. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  623. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  624. <span v-else>{{item.name}}</span>
  625. </el-option>
  626. </el-select>
  627. </template>
  628. </el-form-item>
  629. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  630. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  631. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  632. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  633. <span v-else>{{item.name}}</span>
  634. </el-option>
  635. </el-select>
  636. </el-form-item>
  637. <!-- 相关维度/自定义维度 -->
  638. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :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'">
  639. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  640. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  641. </el-option>
  642. </el-select>
  643. </el-form-item>
  644. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :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 + '.multiDegrIdArray'">
  645. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  646. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  647. </el-option>
  648. </el-select>
  649. </el-form-item>
  650. <!-- 相关数值 -->
  651. <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">
  652. <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>
  653. </el-form-item>
  654. <!-- 自定义文本 -->
  655. <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">
  656. <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>
  657. </el-form-item>
  658. <!--按比例填报-->
  659. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  660. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  661. <div style="width:400px;">
  662. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  663. <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>
  664. </div>
  665. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  666. <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>
  667. </div>
  668. </el-form-item>
  669. <!--工程专业版本模式下, 各个专业的进度填报 -->
  670. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  671. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  672. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  673. <el-input size="mini" style="width:60px;" v-model="item.progress"
  674. @keyup.native="onProgressChange"
  675. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  676. </span>
  677. </el-form-item>
  678. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  679. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  680. <template slot="label" v-if="user.timeType.taskRequired == 1">
  681. <span style="color:#FF0000;">*</span>
  682. <span >任务</span>
  683. </template>
  684. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  685. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  686. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  687. </el-select>
  688. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  689. </el-form-item>
  690. <!--针对依斯贝的SAP服务-->
  691. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  692. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  693. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  694. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  695. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  696. </el-select>
  697. </el-form-item>
  698. <!--工作事项-->
  699. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  700. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  701. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  702. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  703. </el-form-item>
  704. <!-- 拍照上传 -->
  705. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  706. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  707. <div class="photos">
  708. <div>
  709. <el-upload
  710. list-type="picture-card"
  711. :http-request="(file) => {return addImg(file, index)}"
  712. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  713. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  714. :file-list="domain.imgListUrl" :limit="9"
  715. :disabled="workForm.domains[index].state>=2?false:true">
  716. <i class="el-icon-plus"></i>
  717. </el-upload>
  718. </div>
  719. </div>
  720. </el-form-item>
  721. </div>
  722. <!--多个工作事项填报的情况 -->
  723. <div v-if="reportTimeType.multiWorktime==1">
  724. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  725. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  726. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  727. @change="selectProject(domain, index)"
  728. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  729. <!-- <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">
  730. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  731. <span style="float: right;">{{ item.projectName }}</span>
  732. </el-option> -->
  733. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  734. <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">
  735. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  736. <span style="float: right;">{{ item.projectName }}</span>
  737. </el-option>
  738. </el-option-group>
  739. </el-select>
  740. <template v-if="user.timeType.mainProjectState != 1">
  741. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  742. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  743. <!--子项目 -->
  744. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  745. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  746. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  747. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  748. </el-select>
  749. </template>
  750. <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;"
  751. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  752. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  753. </el-link>
  754. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  755. <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>
  756. </div>
  757. <!-- <el-link type="primary" v-if="canEdit"
  758. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  759. </el-form-item>
  760. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  761. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  762. </el-form-item>
  763. <!--如果设置了工时成本预警的预算成本项-->
  764. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  765. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  766. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  767. </el-select>
  768. </el-form-item>
  769. <el-form-item v-if="user.company.packageProject == 1">
  770. <template slot="label">
  771. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  772. <span >{{$t('lable.taskGrouping')}}</span>
  773. </template>
  774. <!-- 任务分组 -->
  775. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  776. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  777. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  778. </el-select>
  779. <!-- 项目的阶段 -->
  780. <span v-if="domain.stages != null && domain.stages.length> 0"
  781. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  782. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  783. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  784. @change="changeStages(domain, index)"
  785. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  786. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  787. </el-select>
  788. </el-form-item>
  789. <el-form-item :label="$t('other.projectAuditor')" >
  790. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  791. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  792. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  793. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  794. </el-option>
  795. </el-select>
  796. <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>
  797. </el-form-item>
  798. <!--工程专业版本模式下, 各个专业的进度填报 -->
  799. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  800. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  801. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  802. <el-input size="mini" style="width:60px;" v-model="item.progress"
  803. @keyup.native="onProgressChange"
  804. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  805. </span>
  806. </el-form-item>
  807. <!-- 相关维度 -->
  808. <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'">
  809. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  810. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  811. </el-option>
  812. </el-select>
  813. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  814. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  815. </el-option>
  816. </el-select>
  817. </el-form-item>
  818. <!-- 相关数值 -->
  819. <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">
  820. <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>
  821. </el-form-item>
  822. <!-- 自定义文本 -->
  823. <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">
  824. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  825. </el-form-item>
  826. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  827. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  828. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  830. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  831. </el-select>
  832. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  833. </el-form-item>
  834. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  835. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  836. <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>
  837. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  838. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  839. <span v-if="reportTimeType.type == 2">
  840. <!-- <span> -->
  841. <!--时间范围选择 -->
  842. <el-time-picker
  843. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  844. v-model="timeItem.startTime"
  845. :placeholder="$t('time.startTime')"
  846. style="width:120px;"
  847. format="HH:mm"
  848. value-format="HH:mm"
  849. :picker-options="{
  850. start: '00:00',
  851. end: '23:59',
  852. }"
  853. @change="iptChangs()">
  854. </el-time-picker> - <el-time-picker
  855. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  856. v-model="timeItem.endTime"
  857. :placeholder="$t('time.endTime')"
  858. style="width:120px;"
  859. format="HH:mm"
  860. value-format="HH:mm"
  861. :picker-options="{
  862. start: '00:00',
  863. end: '23:59',
  864. minTime: timeItem.startTime
  865. }"
  866. @change="iptChangs()">
  867. </el-time-picker>
  868. </span>
  869. </el-form-item>
  870. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  871. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  872. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  873. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  874. ></el-input>
  875. </el-form-item>
  876. </div>
  877. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  878. </div>
  879. <!--照片的显示 -->
  880. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  881. <el-image v-for="(pic, index) in domain.pics" :key="index"
  882. style="width: 100px; height: 100px; margin-right:10px;"
  883. :src="pic"
  884. :preview-src-list="domain.pics">
  885. </el-image>
  886. </p>
  887. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  888. </div>
  889. <span id="workFormsItemBottom"></span>
  890. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  891. </el-form>
  892. </div>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  895. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  896. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  897. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  898. <el-button v-if="!isSubstitude && !isBatch" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  899. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  900. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  901. </span>
  902. </el-dialog>
  903. <!-- 按周填报 -->
  904. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  905. <!-- 按周填报-已填工时-点击 -->
  906. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  907. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  908. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  909. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  910. <el-table-column prop="state" :label="$t('state.states')">
  911. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  912. </el-table-column>
  913. </el-table>
  914. <span slot="footer" class="dialog-footer">
  915. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  916. </span>
  917. </el-dialog>
  918. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  919. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  920. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  921. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  922. <span class="spnn" v-if="workForm.userNames">
  923. <span v-for="(item, index) in workForm.userNames" :key="index">
  924. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  925. <span v-if="index < workForm.userNames.length - 1">,</span>
  926. </span>
  927. </span>
  928. <span class="spnn hover" v-else>
  929. {{$t('defaultText.pleaseSelectAsubstitute')}}
  930. </span>
  931. </div>
  932. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">下一步</el-button>
  933. </div>
  934. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  935. <el-form-item style="height:30px;margin-top:-72px;">
  936. <!-- <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> -->
  937. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  938. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  939. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  940. <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>
  941. <el-option
  942. v-for="item in fillProjectList"
  943. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  944. :key="item.id"
  945. :label="item.projectName + '\u3000' + item.projectCode"
  946. :value="item.id">
  947. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  948. <span style="float: right">{{ item.projectName }}</span>
  949. </el-option>
  950. </el-select>
  951. <span style="float:right;margin-right:10px;">选择项目</span>
  952. </el-form-item>
  953. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  954. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  955. <template slot-scope="scope">
  956. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  957. </template>
  958. </el-table-column>
  959. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  960. <template slot-scope="scope">
  961. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  962. <p v-else></p>
  963. </template>
  964. </el-table-column> -->
  965. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  966. <template slot-scope="scope">
  967. <div v-if="scope.row.canFill == 1">
  968. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  969. <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>
  970. <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>
  971. <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>
  972. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  973. </div>
  974. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  975. <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>
  976. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  977. </div>
  978. </div>
  979. <div v-else >
  980. <span style="color:#999999;">不可超前填报</span>
  981. </div>
  982. </template>
  983. </el-table-column>
  984. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  985. <template slot-scope="scope">
  986. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  987. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  988. </template>
  989. </el-table-column>
  990. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  991. <template slot-scope="scope">
  992. <div class="zhiss">
  993. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  994. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  995. </div>
  996. </template>
  997. </el-table-column>
  998. </el-table>
  999. </el-form>
  1000. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1001. <span v-if="isSubstitude" style="float:left;color:orange;">*正在为【{{workForm.userNames}}】代填</span>
  1002. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1003. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1004. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1005. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1006. <!--针对景昱,先检查工时是否存在异常-->
  1007. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1008. </span>
  1009. </el-dialog>
  1010. <!-- 重庆物奇私人定制的按周填报 -->
  1011. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1012. <div class="fillWeekDialogVisiCustom">
  1013. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1014. </div>
  1015. </el-dialog>
  1016. <!-- 选择时间 -->
  1017. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1018. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1019. <span slot="footer" class="dialog-footer">
  1020. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1021. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1022. </span>
  1023. </el-dialog>
  1024. <!-- 按周填报弹窗 -->
  1025. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1026. <div>
  1027. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1028. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1029. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1030. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1031. </el-select>
  1032. </div>
  1033. <!--如果设置了工时成本预警的预算成本项-->
  1034. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1035. <p>{{$t('lable.budgetSource')}}</p>
  1036. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1037. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1038. </el-select>
  1039. </div>
  1040. <!-- 任务分组 -->
  1041. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1042. <p>{{$t('lable.taskGrouping')}}</p>
  1043. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1044. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1045. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1046. </el-select>
  1047. </div>
  1048. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1049. <p>{{$t('other.inputStage')}}</p>
  1050. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1051. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1052. </el-select>
  1053. </div>
  1054. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1055. <p>{{$t('other.reviewer')}}</p>
  1056. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1057. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1058. </el-select>
  1059. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1060. </div>
  1061. <template v-if="user.timeType.reportAuditType == 3">
  1062. <div class="zhoFel">
  1063. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1064. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1065. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1066. </el-select>
  1067. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1068. </div>
  1069. <div class="zhoFel">
  1070. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1071. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1072. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1073. </el-select>
  1074. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1075. </div>
  1076. <div class="zhoFel">
  1077. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1078. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1079. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1080. </el-select>
  1081. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1082. </div>
  1083. <div class="zhoFel">
  1084. <p>{{ $t('chao-song-ren') }}</p>
  1085. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1086. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1087. </el-select>
  1088. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1089. </div>
  1090. </template>
  1091. <!-- 自定义维度 -->
  1092. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1093. <p>{{user.timeType.customDegreeName}}</p>
  1094. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1095. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1096. </el-select>
  1097. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1098. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1099. </el-select>
  1100. </div>
  1101. <!-- 自定义数值 -->
  1102. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1103. <p>{{user.timeType.customDataName}}</p>
  1104. <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>
  1105. </div>
  1106. <!-- 自定义文本 -->
  1107. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1108. <p>{{user.timeType.customTextName}}</p>
  1109. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1110. </div>
  1111. <!-- 选择任务 -->
  1112. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1113. <p>任务 / 里程碑</p>
  1114. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1115. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1116. </el-select>
  1117. </div>
  1118. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1119. <p>{{$t('other.timeSelection')}}</p>
  1120. <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>
  1121. </div>
  1122. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1123. <p>{{$t('other.chooseDuration')}}</p>
  1124. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1125. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1126. </el-select>
  1127. </div>
  1128. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1129. <p>{{$t('lable.percentageOfTime')}}</p>
  1130. <div style="width:400px;display: flex;align-items: center;">
  1131. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1132. <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>
  1133. </div>
  1134. </div>
  1135. <div class="zhoFel">
  1136. <p>{{$t('other.workMatters')}}</p>
  1137. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1138. </div>
  1139. </div>
  1140. <span slot="footer" class="dialog-footer">
  1141. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1142. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1143. </span>
  1144. </el-dialog>
  1145. <!--导出报表条件选择 -->
  1146. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1147. <el-form ref="form3" :model="exportParam" >
  1148. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1149. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1150. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1151. </el-select>
  1152. </el-form-item>
  1153. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1154. <!-- <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>
  1155. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader> -->
  1156. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1157. </el-form-item>
  1158. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1159. <el-date-picker
  1160. v-model="exportParam.dateRange" :editable="false"
  1161. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1162. :range-separator="$t('other.to')"
  1163. type="daterange"
  1164. :start-placeholder="$t('time.startDate')"
  1165. :end-placeholder="$t('time.endDate')"
  1166. ></el-date-picker>
  1167. </el-form-item>
  1168. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1169. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1170. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1171. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1172. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1173. </el-select>
  1174. </el-form-item>
  1175. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1176. <div class="exportReportRadio">
  1177. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1178. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1179. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1180. <i class="el-icon-question"></i>
  1181. </el-tooltip>
  1182. </div>
  1183. </el-form-item>
  1184. </el-form>
  1185. <div slot="footer" class="dialog-footer">
  1186. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1187. </div>
  1188. </el-dialog>
  1189. <!--导出报表条件选择 -->
  1190. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1191. <el-form ref="form3" :model="exportParam" >
  1192. <el-form-item prop="range" :label="$t('time.dateRange')">
  1193. <el-date-picker
  1194. v-model="exportParam.dateRange" :editable="false"
  1195. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1196. :clearable="true"
  1197. :range-separator="$t('other.to')"
  1198. type="daterange"
  1199. :start-placeholder="$t('time.startDate')"
  1200. :end-placeholder="$t('time.endDate')"
  1201. ></el-date-picker>
  1202. </el-form-item>
  1203. </el-form>
  1204. <div slot="footer" class="dialog-footer">
  1205. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1206. </div>
  1207. </el-dialog>
  1208. <!--人员列表 -->
  1209. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1210. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1211. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1212. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1213. <el-table-column type="selection"></el-table-column>
  1214. <el-table-column prop="label" :label="$t('lable.name')" >
  1215. <template slot-scope="scope">
  1216. <span>
  1217. <!-- {{(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}} -->
  1218. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1219. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1221. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1222. </span>
  1223. <span v-else>
  1224. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1225. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1226. </span>
  1227. </span>
  1228. </template>
  1229. </el-table-column>
  1230. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. </el-table>
  1239. </el-tab-pane>
  1240. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1241. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1242. <el-table-column prop="label" :label="$t('lable.name')" >
  1243. <template slot-scope="scope">
  1244. <!-- <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> -->
  1245. <!-- <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> -->
  1246. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1247. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1248. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1249. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1250. </span>
  1251. <span v-else>
  1252. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1253. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1254. </span>
  1255. </template>
  1256. </el-table-column>
  1257. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1258. <template slot-scope="scope">
  1259. <div>
  1260. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1261. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1262. </div>
  1263. </template>
  1264. </el-table-column>
  1265. </el-table>
  1266. </el-tab-pane>
  1267. </el-tabs>
  1268. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1269. <el-table-column type="selection"></el-table-column>
  1270. <el-table-column prop="label" :label="$t('lable.name')" >
  1271. <template slot-scope="scope">
  1272. <div>
  1273. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1275. </div>
  1276. </template>
  1277. </el-table-column>
  1278. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1279. <template slot-scope="scope">
  1280. <div>
  1281. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1282. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1283. </div>
  1284. </template>
  1285. </el-table-column>
  1286. </el-table>
  1287. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1288. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1289. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1290. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1291. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1292. </div>
  1293. </el-dialog>
  1294. <!-- 日报审核修改 -->
  1295. <el-dialog
  1296. title="日报审核修改"
  1297. :visible.sync="reportLogCheckDialog"
  1298. width="30%"
  1299. :before-close="handleClose">
  1300. <el-form ref="form3" :model="exportReportLogParam" >
  1301. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1302. <el-date-picker
  1303. v-model="exportReportLogParam.dateRange" :editable="false"
  1304. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1305. :range-separator="$t('other.to')"
  1306. type="daterange"
  1307. :start-placeholder="$t('time.startDate')"
  1308. :end-placeholder="$t('time.endDate')"
  1309. ></el-date-picker>
  1310. </el-form-item>
  1311. </el-form>
  1312. <el-link type="primary" @click="exportReportLog">导出日报审核记录数据</el-link>
  1313. <br>
  1314. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1315. <el-link type="primary" @click="importReportLog">导入日报审核记录修改数据</el-link></el-upload>
  1316. <span slot="footer" class="dialog-footer">
  1317. <el-button type="primary" @click="reportLogCheckDialog = false">关闭</el-button>
  1318. </span>
  1319. </el-dialog>
  1320. <!-- 按部门选择人员 -->
  1321. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1322. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1323. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1324. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1325. </el-input>
  1326. <div class="tree" style="height:400px">
  1327. <el-scrollbar style="height:100%">
  1328. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1329. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1330. highlight-current :filter-node-method="filterNode">
  1331. <span class="custom-tree-node" slot-scope="{ node }">
  1332. <span v-if="user.userNameNeedTranslate == '1'">
  1333. <span v-if="node.data.children">
  1334. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1335. </span>
  1336. <span v-else>
  1337. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1338. </span>
  1339. </span>
  1340. <span v-if="user.userNameNeedTranslate != '1'">
  1341. {{ node.label }}
  1342. </span>
  1343. <!-- {{ node.label }} -->
  1344. </span>
  1345. </el-tree>
  1346. </el-scrollbar>
  1347. </div>
  1348. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1349. <div slot="footer" class="dialog-footer">
  1350. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1351. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1352. </div>
  1353. </el-dialog>
  1354. <el-dialog
  1355. v-if="monthWorkTimeDialog"
  1356. :visible.sync="monthWorkTimeDialog"
  1357. :close-on-click-modal="false"
  1358. customClass="customWidth selectworktime"
  1359. width="92%"
  1360. top="60px"
  1361. >
  1362. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1363. <el-tabs v-model="activeName" @tab-click="handleClick">
  1364. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1365. <div class="selectworktime_export" style="margin-top:10px;">
  1366. <div class="selectworktime_export_l">
  1367. <el-date-picker
  1368. class="selecteworktime_datapick"
  1369. v-model="WorktimeDatepickValue"
  1370. value-format="yyyy-MM-dd"
  1371. type="daterange"
  1372. align="right"
  1373. unlink-panels
  1374. :range-separator="$t('other.to')"
  1375. :start-placeholder="$t('time.startDate')"
  1376. :end-placeholder="$t('time.endDate')"
  1377. :default-time="['12:00:00', '12:00:00']"
  1378. size="small"
  1379. popper-class="selecteorktime_datapick_popper"
  1380. @change="showMonthWorkTime()"
  1381. >
  1382. </el-date-picker>
  1383. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1384. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1385. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1386. <!-- 222 -->
  1387. </div>
  1388. <div>
  1389. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1390. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1391. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1392. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1393. </el-input>
  1394. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1395. </div>
  1396. <div style="float: left; height:32px; padding-top:10px;">
  1397. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">待审核</span>
  1398. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">已通过</span>
  1399. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">已驳回/漏填</span>
  1400. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">未提交</span>
  1401. </div>
  1402. <div style="float: right; vertical-align: middle;height:32px">
  1403. <el-link
  1404. type="primary"
  1405. @click="exportMembWorkHours()"
  1406. >{{$t('export.exportData')}}</el-link
  1407. >
  1408. </div>
  1409. </div>
  1410. <el-table ref="hasworkTbl"
  1411. :data="monthWorkDataS"
  1412. v-el-table-infinite-scroll="listScroll"
  1413. border
  1414. :height="'70vh'"
  1415. highlight-current-row
  1416. style="width: 100%"
  1417. v-loading="tbload"
  1418. :lazy="true"
  1419. :cell-style="hasworkTblCellStyle"
  1420. >
  1421. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1422. <template slot-scope="scope">
  1423. {{ scope.$index + 1 }}
  1424. </template>
  1425. </el-table-column>
  1426. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1427. <template slot-scope="scope">
  1428. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1429. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1430. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1431. <!-- {{scope.row.name}} -->
  1432. </span>
  1433. </template>
  1434. </el-table-column>
  1435. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1436. <template slot-scope="scope">
  1437. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1438. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1439. </template>
  1440. </el-table-column>
  1441. <el-table-column
  1442. min-width="60"
  1443. v-for="(item, index) in pickDateArray"
  1444. :key="index"
  1445. :label="item"
  1446. align="center"
  1447. >
  1448. <template slot="header" slot-scope="scope">
  1449. <div>{{ scope.column.label.dateStr }}</div>
  1450. <div>{{ scope.column.label.weekStr }}</div>
  1451. </template>
  1452. <template slot-scope="scope">
  1453. <div
  1454. v-if="
  1455. scope.row.worktimeList.filter(
  1456. (w) =>
  1457. w.createDate==item.date
  1458. ).length > 0 &&
  1459. scope.row.worktimeList.filter(
  1460. (w) =>w.createDate==item.date
  1461. )[0].workingTime < reportTimeType.allday
  1462. "
  1463. >
  1464. {{
  1465. scope.row.worktimeList.filter(
  1466. (w) =>w.createDate==item.date
  1467. )[0].workingTime.toFixed(1)
  1468. }}
  1469. </div>
  1470. <div
  1471. v-if="
  1472. scope.row.worktimeList.filter(
  1473. (w) =>w.createDate==item.date
  1474. ).length > 0 &&
  1475. scope.row.worktimeList.filter(
  1476. (w) =>w.createDate==item.date
  1477. )[0].workingTime > reportTimeType.allday
  1478. "
  1479. >
  1480. {{
  1481. scope.row.worktimeList.filter(
  1482. (w) =>w.createDate==item.date
  1483. )[0].workingTime.toFixed(1)
  1484. }}
  1485. </div>
  1486. <div
  1487. v-if="
  1488. scope.row.worktimeList.filter(
  1489. (w) =>w.createDate==item.date
  1490. ).length > 0 &&
  1491. scope.row.worktimeList.filter(
  1492. (w) =>w.createDate==item.date
  1493. )[0].workingTime == reportTimeType.allday
  1494. "
  1495. >
  1496. {{
  1497. scope.row.worktimeList.filter(
  1498. (w) =>w.createDate==item.date
  1499. )[0].workingTime
  1500. }}
  1501. </div>
  1502. <div
  1503. v-if="
  1504. scope.row.worktimeList.filter(
  1505. (w) =>w.createDate==item.date
  1506. ).length == 0
  1507. "
  1508. >
  1509. 0
  1510. </div>
  1511. <div
  1512. v-if="
  1513. scope.row.worktimeList.filter(
  1514. (w) =>w.createDate==item.date
  1515. ).length > 0 &&
  1516. typeof scope.row.worktimeList.filter(
  1517. (w) =>w.createDate==item.date
  1518. )[0].workingTime == 'string'
  1519. "
  1520. >
  1521. {{
  1522. scope.row.worktimeList.filter(
  1523. (w) =>w.createDate==item.date
  1524. )[0].workingTime
  1525. }}
  1526. </div>
  1527. </template>
  1528. </el-table-column>
  1529. </el-table>
  1530. <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>
  1531. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1532. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1533. <label style="font-size: 16px">员工每日已填报工时数</label>
  1534. <el-link
  1535. type="primary"
  1536. style="float: right; margin-right: 60px"
  1537. @click="exportMembWorkHours()"
  1538. >导出已填报数据</el-link
  1539. > -->
  1540. <!-- <el-button >导出</el-button> -->
  1541. <!-- </div> -->
  1542. </el-tab-pane>
  1543. <el-tab-pane label="未提交人员列表" name="second" >
  1544. <div class="selectworktime_export" style="margin-top:10px">
  1545. <div class="selectworktime_export_l">
  1546. <el-date-picker
  1547. class="selecteworktime_datapick"
  1548. v-model="WorktimeDatepickValue"
  1549. value-format="yyyy-MM-dd"
  1550. type="daterange"
  1551. align="right"
  1552. unlink-panels
  1553. :range-separator="$t('other.to')"
  1554. :start-placeholder="$t('time.startDate')"
  1555. :end-placeholder="$t('time.endDate')"
  1556. :default-time="['12:00:00', '12:00:00']"
  1557. size="small"
  1558. popper-class="selecteorktime_datapick_popper"
  1559. @change="showMonthNotWorkTime()"
  1560. >
  1561. </el-date-picker>
  1562. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1563. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1564. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1565. </div>
  1566. <div>
  1567. <div style="margin-top:10px;">
  1568. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1569. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1570. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1571. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1572. </el-input>
  1573. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1574. <el-link
  1575. type="primary"
  1576. style="float: right; vertical-align: middle;height:32px"
  1577. @click="exportMembNotWorkHours()"
  1578. >{{$t('export.exportData')}}</el-link
  1579. >
  1580. </div>
  1581. </div>
  1582. </div>
  1583. <el-table
  1584. ref="hasworkTbl2"
  1585. :data="monthNotWorkDateS"
  1586. v-el-table-infinite-scroll="notListScroll"
  1587. border
  1588. :height="'70vh'"
  1589. highlight-current-row
  1590. style="width: 100%"
  1591. v-loading="tbload"
  1592. lazy
  1593. >
  1594. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1595. <template slot-scope="scope">
  1596. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1597. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1598. </template>
  1599. </el-table-column>
  1600. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1601. <template slot-scope="scope">
  1602. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1603. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1604. </template>
  1605. </el-table-column>
  1606. <el-table-column
  1607. min-width="200"
  1608. :label="$t('weekDay.date')"
  1609. align="center"
  1610. prop="createDate"
  1611. >
  1612. </el-table-column>
  1613. <el-table-column
  1614. min-width="200"
  1615. :label="$t('state.states')"
  1616. align="center"
  1617. prop="status"
  1618. />
  1619. <el-table-column
  1620. min-width="200"
  1621. :label="$t('other.attendanceData')"
  1622. prop="cardTime"
  1623. align="center"
  1624. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1625. </el-table>
  1626. <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>
  1627. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1628. </el-tab-pane>
  1629. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1630. <div class="selectworktime_export" style="margin-top:10px;">
  1631. <div class="selectworktime_export_l">
  1632. <el-date-picker
  1633. class="selecteworktime_datapick"
  1634. v-model="WorktimeDatepickValue"
  1635. value-format="yyyy-MM-dd"
  1636. type="daterange"
  1637. align="right"
  1638. unlink-panels
  1639. :range-separator="$t('other.to')"
  1640. :start-placeholder="$t('time.startDate')"
  1641. :end-placeholder="$t('time.endDate')"
  1642. :default-time="['12:00:00', '12:00:00']"
  1643. size="small"
  1644. popper-class="selecteorktime_datapick_popper"
  1645. @change="showMonthWorkTimeReminder()"
  1646. >
  1647. </el-date-picker>
  1648. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1649. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1650. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1651. </div>
  1652. <div>
  1653. <div style="margin-top:10px;">
  1654. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1655. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1656. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1657. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1658. </el-input>
  1659. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1660. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1661. </div>
  1662. </div>
  1663. <div style="float: right; vertical-align: middle;height:32px">
  1664. <el-link
  1665. type="primary"
  1666. @click="changeReminder()"
  1667. >{{'变更提醒'}}</el-link
  1668. >
  1669. <el-link
  1670. type="primary"
  1671. @click="exportMembWorkHoursReminder()"
  1672. >{{$t('export.exportData')}}</el-link
  1673. >
  1674. </div>
  1675. </div>
  1676. <el-table ref="hasworkTbl"
  1677. :data="monthWorkDataS"
  1678. v-el-table-infinite-scroll="listScroll"
  1679. border
  1680. :height="'70vh'"
  1681. highlight-current-row
  1682. style="width: 100%"
  1683. v-loading="tbload"
  1684. :lazy="true"
  1685. >
  1686. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1687. <template slot-scope="scope">
  1688. {{ scope.row.createDate}}
  1689. </template>
  1690. </el-table-column>
  1691. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1692. <template slot-scope="scope">
  1693. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1694. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1695. <!-- {{scope.row.name}} -->
  1696. </template>
  1697. </el-table-column>
  1698. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1699. <template slot-scope="scope">
  1700. {{scope.row.invokeValue}}
  1701. </template>
  1702. </el-table-column>
  1703. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1704. <template slot-scope="scope">
  1705. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1706. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1707. </template>
  1708. </el-table-column>
  1709. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1710. <template slot-scope="scope">
  1711. {{ scope.row.workingTime}}
  1712. </template>
  1713. </el-table-column>
  1714. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1715. <template slot-scope="scope">
  1716. {{ scope.row.cardTime}}
  1717. </template>
  1718. </el-table-column>
  1719. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1720. <template slot-scope="scope">
  1721. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1722. </template>
  1723. </el-table-column>
  1724. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1725. <template slot-scope="scope">
  1726. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1727. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1728. </template>
  1729. </el-table-column>
  1730. </el-table>
  1731. <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>
  1732. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1733. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1734. <label style="font-size: 16px">员工每日已填报工时数</label>
  1735. <el-link
  1736. type="primary"
  1737. style="float: right; margin-right: 60px"
  1738. @click="exportMembWorkHours()"
  1739. >导出已填报数据</el-link
  1740. > -->
  1741. <!-- <el-button >导出</el-button> -->
  1742. <!-- </div> -->
  1743. </el-tab-pane>
  1744. </el-tabs>
  1745. </el-dialog>
  1746. <!--驳回弹出框 -->
  1747. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1748. <div>
  1749. <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')" />
  1750. </div>
  1751. <div slot="footer" class="dialog-footer">
  1752. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1753. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1754. </div>
  1755. </el-dialog>
  1756. <!-- 通过弹出框 -->
  1757. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1758. <div>
  1759. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1760. </div>
  1761. <div slot="footer" class="dialog-footer">
  1762. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1763. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1764. </div>
  1765. </el-dialog>
  1766. <!--批量导入日报 -->
  1767. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1768. <p>1. {{$t('other.download')}}
  1769. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1770. </p>
  1771. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1772. <p style="display: flex;justify-content: center;">
  1773. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1774. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1775. </el-upload>
  1776. </p>
  1777. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1778. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1779. </div>
  1780. </el-dialog>
  1781. <!-- 工时导入记录弹窗 -->
  1782. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1783. <div style="height: 452px">
  1784. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1785. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1786. <el-table-column prop="userName" :label="$t('other.operator')">
  1787. <template slot-scope="scope">
  1788. <div>
  1789. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1790. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1791. </div>
  1792. </template>
  1793. </el-table-column>
  1794. <el-table-column prop="datel" :label="$t('other.document')">
  1795. <template slot-scope="scope">
  1796. <div>
  1797. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1798. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1799. </div>
  1800. </template>
  1801. </el-table-column>
  1802. <el-table-column label="操作" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1803. <template slot-scope="scope">
  1804. <div>
  1805. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1806. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1807. </div>
  1808. </template>
  1809. </el-table-column>
  1810. </el-table>
  1811. <el-col :span="24" class="paginatis">
  1812. <el-pagination
  1813. @size-change="handleSizeChange"
  1814. @current-change="handleCurrentChange"
  1815. :page-sizes="[20 , 50 , 80 , 100]"
  1816. :page-size="20"
  1817. layout="total, sizes, prev, pager, next"
  1818. :total="toViewForm.total"
  1819. style="float:right;"
  1820. ></el-pagination>
  1821. </el-col>
  1822. </div>
  1823. </el-dialog>
  1824. <!--基于企业微信考勤数据的工时导入 -->
  1825. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1826. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1827. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1828. </el-step>
  1829. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1830. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1831. </el-steps>
  1832. <div v-if="active==0" style="padding:30px;height:360px;">
  1833. <div style="margin-top:50px;margin-left:280px;">
  1834. <el-date-picker
  1835. v-model="importWxParam.date" :editable="false"
  1836. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1837. :clearable="true"
  1838. :range-separator="$t('other.to')"
  1839. type="daterange"
  1840. :start-placeholder="$t('time.startDate')"
  1841. :end-placeholder="$t('time.endDate')"
  1842. @change="loadCheckInData"
  1843. ></el-date-picker>
  1844. </div>
  1845. </div>
  1846. <div v-if="active==1" style="padding:10px;">
  1847. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1848. style="width: 100%;margin-top:5px;" >
  1849. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1850. <template slot-scope="scope">
  1851. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1852. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1853. </template>
  1854. </el-table-column>
  1855. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1856. </el-table-column>
  1857. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1858. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1859. <template slot-scope="scope">
  1860. <div>
  1861. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1862. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1863. </div>
  1864. </template>
  1865. </el-table-column>
  1866. <el-table-column prop="departmentName" label="部门" >
  1867. <template slot-scope="scope">
  1868. <div>
  1869. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1870. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1871. </div>
  1872. </template>
  1873. </el-table-column>
  1874. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1875. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1876. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1877. <template slot-scope="scope">
  1878. {{scope.row.workHours.toFixed(1)}}h
  1879. </template>
  1880. </el-table-column>
  1881. </el-table>
  1882. </div>
  1883. <div v-if="active==2" >
  1884. <p style="display: flex;justify-content: center;height:390px;">
  1885. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1886. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1887. </el-upload>
  1888. </p>
  1889. </div>
  1890. <div slot="title">
  1891. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1892. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1893. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1894. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1895. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1896. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1897. </div>
  1898. <span slot="footer">
  1899. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1900. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1901. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1902. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1903. </span>
  1904. </el-dialog>
  1905. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1906. <p style="display: flex;justify-content: center;height:100px;">
  1907. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1908. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1909. </el-upload>
  1910. </p>
  1911. </el-dialog>
  1912. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1913. <div>
  1914. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1915. v-model="deleteReportParam.date" :editable="false"
  1916. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1917. :clearable="true"
  1918. :range-separator="$t('other.to')"
  1919. type="daterange"
  1920. :start-placeholder="$t('time.startDate')"
  1921. :end-placeholder="$t('time.endDate')"
  1922. ></el-date-picker>
  1923. </div>
  1924. <div style="margin-top:10px;">
  1925. <span>请选择部门:</span>
  1926. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1927. <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>
  1928. </div>
  1929. <div style="margin-top:10px;">
  1930. <span>请选择员工:</span>
  1931. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1932. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1933. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1934. <span v-else>{{item.name}}</span>
  1935. </el-option>
  1936. </el-select>
  1937. </div>
  1938. <span slot="footer">
  1939. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1940. </span>
  1941. </el-dialog>
  1942. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1943. <div>
  1944. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1945. v-model="deleteReportParam.date" :editable="false"
  1946. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1947. :clearable="true"
  1948. :range-separator="$t('other.to')"
  1949. type="daterange"
  1950. :start-placeholder="$t('time.startDate')"
  1951. :end-placeholder="$t('time.endDate')"
  1952. ></el-date-picker>
  1953. </div>
  1954. <div style="margin-top:15px;">
  1955. <span>选择部门:</span>
  1956. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1957. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1958. size="small" v-if="user.userNameNeedTranslate != 1"
  1959. ></el-cascader>
  1960. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1961. </div>
  1962. <span slot="footer">
  1963. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1964. </span>
  1965. </el-dialog>
  1966. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1967. <div>
  1968. <span>选择时间:</span><el-date-picker
  1969. v-model="modImportTime"
  1970. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1971. :clearable="true"
  1972. type="datetime"
  1973. ></el-date-picker>
  1974. <span>选择导入人员:</span><el-select
  1975. v-model="modImportUserId"
  1976. >
  1977. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1978. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1979. <span v-else>{{item.name}}</span>
  1980. </el-option>
  1981. </el-select>
  1982. </div>
  1983. <span slot="footer">
  1984. <el-button @click="confirmChangeModTime" >确认</el-button>
  1985. </span>
  1986. </el-dialog>
  1987. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1988. <div>
  1989. <span>请选择年月:</span>
  1990. <el-date-picker
  1991. v-model="ratioYmonth" :editable="false"
  1992. format="yyyyMM" value-format="yyyyMM"
  1993. type="month"
  1994. ></el-date-picker>
  1995. </div>
  1996. <span slot="footer">
  1997. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1998. </span>
  1999. </el-dialog>
  2000. <!--工时批量代填 -->
  2001. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2002. <div>
  2003. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2004. v-model="importWxParam.date" :editable="false"
  2005. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2006. :clearable="true"
  2007. :range-separator="$t('other.to')"
  2008. type="daterange"
  2009. :start-placeholder="$t('time.startDate')"
  2010. :end-placeholder="$t('time.endDate')"
  2011. @change="loadCheckInData"
  2012. ></el-date-picker>
  2013. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2014. </div>
  2015. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2016. :key="timeStamp"
  2017. style="width: 100%;margin-top:5px;" ref="tab">
  2018. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2019. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2020. <template slot-scope="scope">
  2021. <div>
  2022. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2023. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2024. </div>
  2025. </template>
  2026. </el-table-column>
  2027. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2028. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2029. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2030. <template slot-scope="scope">
  2031. {{scope.row.workHours.toFixed(1)}}h
  2032. </template>
  2033. </el-table-column>
  2034. <!--项目名称列表 -->
  2035. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2036. <template slot-scope="scope">
  2037. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2038. </template>
  2039. </el-table-column>
  2040. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2041. <template slot-scope="scope">
  2042. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2043. </template>
  2044. </el-table-column>
  2045. </el-table>
  2046. </el-dialog>
  2047. <!--基于企业微信考勤数据的工时导入 -->
  2048. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2049. <div style="padding-bottom:10px;">
  2050. <p>{{importResultMsg}}</p>
  2051. </div>
  2052. <!-- <span slot="footer" class="dialog-footer">
  2053. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2054. </span> -->
  2055. </el-dialog>
  2056. <!-- 审核流程展示 -->
  2057. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2058. <div style="padding:20px 40px 20px 0">
  2059. <el-timeline :reverse="false">
  2060. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2061. <!-- {{item.msg}} -->
  2062. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2063. <span v-if="user.userNameNeedTranslate == 1">
  2064. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2065. <span>{{item.msgCon.two}}</span>
  2066. </span>
  2067. </el-timeline-item>
  2068. </el-timeline>
  2069. </div>
  2070. </el-dialog>
  2071. </section>
  2072. </template>
  2073. <script>
  2074. // 左右滑动
  2075. import dragMixin from "@/common/js/tensile.js";
  2076. import util from "../../common/js/util";
  2077. // 自定义select组件
  2078. import selectCat from "@/components/select.vue"
  2079. // 引入自定义级联组件
  2080. import vueCascader from "@/components/cascader.vue"
  2081. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2082. // 重庆物奇定制组件
  2083. import WeeklyCustomization from "./weeklyCustomization.vue"
  2084. import { mapMutations } from 'vuex'
  2085. let _that = this
  2086. export default {
  2087. mixins: [dragMixin],
  2088. components: {
  2089. selectCat,
  2090. vueCascader,
  2091. WeeklyCustomization,
  2092. vueMultipleDept
  2093. },
  2094. data() {
  2095. return {
  2096. substitudeStep: 1,
  2097. showHidden: false,
  2098. pageIndex: 0,
  2099. hasMore: true,
  2100. exportType: 0,
  2101. exportingData: false,
  2102. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2103. jobResponseList:[],
  2104. yisibeiCompId: 3092,
  2105. yuzhongCompId: 3385,
  2106. mingyiName : '成都明夷电子科技有限公司',
  2107. // mingyiName : '明夷',
  2108. modItemDataId: null,
  2109. modImportTime: null,
  2110. modImportUserId: null,
  2111. showModImportTimeDialog: false,
  2112. showBatchSimpleApproveReport: false,
  2113. startDeleting: false,
  2114. showBatchDeleteReport: false,
  2115. deleteReportParam: {date:null, userIds:[]},
  2116. isDenying: false,
  2117. targetWeekDate: null,//填写周报中的周日期
  2118. importCardTimeVisi: false,
  2119. startRatioExporting: false,
  2120. exportUserRatio: false,
  2121. ratioYmonth:null,
  2122. hasWrittenReport: false,
  2123. today:null,
  2124. syncTimeLoading: false,
  2125. seluserText: '',
  2126. translation: '1', // 1、文字, 2、部门, 3、人员
  2127. exportLoad: false,
  2128. getPickerOptions: {
  2129. disabledDate: (time) => {
  2130. var date = new Date();
  2131. var year = date.getFullYear();
  2132. var month = date.getMonth() + 1;
  2133. if (month >= 1 && month <= 9) {
  2134. month = "0" + month;
  2135. }
  2136. var currentdate = year.toString() + month.toString();
  2137. var timeyear = time.getFullYear();
  2138. var timemonth = time.getMonth() + 1;
  2139. if (timemonth >= 1 && timemonth <= 9) {
  2140. timemonth = "0" + timemonth;
  2141. }
  2142. var timedate = timeyear.toString() + timemonth.toString();
  2143. if(this.user.timeType.fillAhead == 0){
  2144. return currentdate < timedate;
  2145. }else{
  2146. return false
  2147. }
  2148. }
  2149. },
  2150. alalal: '8.0',
  2151. timeBasecostList:null,
  2152. tbload: false,
  2153. exportTimeDialog: false,
  2154. searchKeyword: '',
  2155. monthWorkDataS: [],
  2156. monthNotWorkDateS: [],
  2157. pickDateArray:[],
  2158. WorktimeDatepickValue: [],
  2159. activeName:"first",
  2160. isLeave: 0,
  2161. submitingReport: false,
  2162. importResultMsg:null,
  2163. showImportResult:false,
  2164. importingData: false,
  2165. isDraft: 0,
  2166. timeStamp: 0,
  2167. projectColumns:[],
  2168. checkinLoading:false,
  2169. importWxParam:{date:null,},
  2170. active:0,
  2171. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2172. importWxDialog:false,
  2173. importDialog:false,
  2174. denyForm:null,
  2175. denyReasonDialog:false,
  2176. monthWorkTimeDialog: false,
  2177. isSubstitude:false,
  2178. isFill:false,
  2179. unFillList:[],
  2180. fillList:[],
  2181. fillMembList:[],
  2182. fillMembList_leave: [],
  2183. membListVisible: false,
  2184. isBatch:0,//是否是批量填报
  2185. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2186. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2187. 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')],
  2188. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2189. fillStatusList: [],
  2190. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2191. exportReportLogParam:{dateRange:[]},
  2192. exportDialog:false,
  2193. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2194. subProjectList:[],
  2195. canEdit: true,
  2196. originCanEdit: true,
  2197. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2198. selectTime:null,
  2199. reportTimeType:{},
  2200. curDate:'',
  2201. isAllSelect: false,
  2202. approveDialogVisible:false,
  2203. deptId:null,
  2204. targetUid: null,
  2205. membCount:0,
  2206. selectState:"-1",
  2207. user: JSON.parse(sessionStorage.getItem("user")),
  2208. allUsersList: [],
  2209. showAddMore:false,
  2210. allDate: [],
  2211. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2212. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2213. choseDay: 0,
  2214. tableHeight: 0,
  2215. listLoading: false,
  2216. projectList: [], //项目列表
  2217. fillProjectList: [],
  2218. reportList: [], //日报列表
  2219. reportNames:[], //批量审批列表
  2220. selCon:[], //筛选条件
  2221. selProjectList:[], //筛选后项目列表
  2222. selConShow: true,
  2223. usersList: [], // 全部人员列表
  2224. usersListId: '', // 选中的人员id
  2225. dialogVisible: false, //项目弹窗
  2226. report: '',
  2227. workForm: {
  2228. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2229. domains: [{
  2230. id: null,
  2231. projectId: "",
  2232. workingTime: "",
  2233. timeType:0,
  2234. content: "",
  2235. state: 2,
  2236. multiWorktime:0,
  2237. worktimeList:[],
  2238. degreeId: null,
  2239. auditUserList: [],
  2240. }],
  2241. showRefresh: false,
  2242. },
  2243. workRules: {
  2244. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2245. },
  2246. chooseParticipVisible: false,
  2247. logining: false,
  2248. isDisable: false,
  2249. timeType:[],
  2250. deptMembData: [
  2251. ],
  2252. //部门人员树状结构
  2253. data: [
  2254. {
  2255. id: -1,
  2256. label: this.$t('lable.allStaff'),
  2257. membCount:0
  2258. },
  2259. {
  2260. id: 0,
  2261. label: this.$t('lable.unassigned'),
  2262. }
  2263. ],
  2264. allData:{},
  2265. batchShowData:{},
  2266. option: [],
  2267. deptOptionList: [],
  2268. depData: {
  2269. id: -1,
  2270. label: this.$t('lable.allStaff'),
  2271. },
  2272. defaultProps: {
  2273. children: 'children',
  2274. label: 'label'
  2275. },
  2276. isNew: false,
  2277. selected: false,
  2278. valuet: new Date(),
  2279. domObj: null,
  2280. participator:[],
  2281. chosenMembCount:0,
  2282. jsDay: 0,
  2283. jsTime: 0,
  2284. falsss: false,
  2285. weidu: [],
  2286. weiduList: [],
  2287. yonghuUser: [],
  2288. dateAr: [],
  2289. batchSubFillDialog: false,
  2290. isSubstiS: false,
  2291. fillWeekDialogVisi: false,
  2292. fillWeekDialogVisiCustom: false,
  2293. zhoData: [],
  2294. weekDateRange: [],
  2295. btnZho: false,
  2296. weekDataLoading: false,
  2297. changdu: 6,
  2298. tianxieDialogVisible: false,
  2299. scopess: {},
  2300. zhoBao: {
  2301. time: '',
  2302. workingTime: '',
  2303. progress: '',
  2304. con: '',
  2305. subProjectId: '',
  2306. stage: '',
  2307. subProjectList: [],
  2308. stages: [],
  2309. },
  2310. zhoBaoIdx: '',
  2311. zhoBaoName: '',
  2312. zhis: {},
  2313. dealList: [],
  2314. toViewDialogVisible: false,
  2315. toViewList: [],
  2316. toViewloading: true,
  2317. toViewForm: {
  2318. pageIndex: '1',
  2319. pageSize: '20',
  2320. total: 0,
  2321. },
  2322. toViewloadings: false,
  2323. tabPositionss: 'top',
  2324. monthTotal: 0,
  2325. monthTotalPage: 0,
  2326. monthTotalLages: 20,
  2327. monthWorkData: [],
  2328. monthNotWorkDate: [],
  2329. monthWorkDataS1: [],
  2330. monthnotTotal: 0,
  2331. monthnotTotalPage: 0,
  2332. monthnotTotalLages: 20,
  2333. monthNotWorkDateS1: [],
  2334. deptMembDataText: '',
  2335. isFlag: false,
  2336. isMore: false,
  2337. stateKey: '0',
  2338. expandDate: [],
  2339. notifySelList:[],
  2340. departmentList: [],
  2341. trandepartmentList:[],
  2342. approvalProcessDialog: false,
  2343. approvalProcessData: [],
  2344. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2345. 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')],
  2346. isWeekend: false,
  2347. canCancelInDialog: false,
  2348. approveinData: {},
  2349. approveinDialog: false,
  2350. reportCanDelete: false,
  2351. weeklyFilledTimeDialog: false,
  2352. weeklyFilledTimeList: [],
  2353. weeklyFilledTimeLoading: false,
  2354. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2355. weeklyFilledTimeCanDelete: false,
  2356. weeklyFilledTimeDate: null,
  2357. leaveAllNum: 0,
  2358. dataLoading: false,
  2359. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2360. vacationTime: {},
  2361. integrationProjectList: [],
  2362. totalReportHours: 0, // 合计的工时
  2363. workTimeForMinYi:0,
  2364. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2365. weekIndex: 1,
  2366. weekParentData: {},
  2367. deptIdForNoReport:[],
  2368. deptIdForReminder:[],
  2369. nameAearch: '', // 企业微信姓名搜索
  2370. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2371. deptMembDataLoading: false,
  2372. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2373. {
  2374. id: 4811,
  2375. // id: 10,
  2376. name: '陕西柘中建设工程有限公司'
  2377. }
  2378. ],
  2379. pushWorkTimeLogDig:false,
  2380. pushWorkTimeLogData:[],
  2381. userReportDeptList: [],
  2382. isReminder:true,
  2383. reportLogCheckDialog:false,
  2384. deptIdForHasReport:[],
  2385. };
  2386. },
  2387. watch: {
  2388. deptMembDataText(val) {
  2389. this.$refs.chooseMembTree.filter(val);
  2390. }
  2391. },
  2392. filters: {
  2393. // 过滤
  2394. amounts(value) {
  2395. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2396. return 0
  2397. }
  2398. var zhi = +value + 0
  2399. return zhi.toFixed(1)
  2400. },
  2401. // zhoData
  2402. zhoData(value, arr) {
  2403. var dateArray = value.split("-");
  2404. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2405. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2406. // console.log(arr[date.getDay()])
  2407. // return "周" + "日一二三四五六".charAt(date.getDay());
  2408. return arr[date.getDay()]
  2409. },
  2410. // 过滤数字
  2411. numbers(value) {
  2412. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2413. return 0
  2414. }
  2415. return value
  2416. },
  2417. },
  2418. computed: {},
  2419. mounted() {
  2420. var now = new Date();
  2421. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2422. this.today = t;
  2423. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2424. this.exportParam.dateRange = [startStr,t];
  2425. this.exportReportLogParam.dateRange = [startStr,t];
  2426. this.getAllDate(1);
  2427. this.getReportList();
  2428. this.getProjectList();
  2429. this.getFillProjectList();
  2430. this.getTimeType();
  2431. this.getDepartment();
  2432. this.scrollFunction()
  2433. this.userssHu();
  2434. this.getFirstAndLastDay()
  2435. if(this.user.timeType.reportAuditType == 3){
  2436. this.getAllUsersList()
  2437. }
  2438. if (this.user.company.packageProject == 1) {
  2439. this.getBasecostItemList();
  2440. }
  2441. if(this.user.timeType.userWithMultiDept == 1) {
  2442. this.getDeptMembData();
  2443. }
  2444. if(this.user.timeType.lockWorktime){
  2445. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2446. }
  2447. //设置了下限
  2448. if (this.user.timeType.minReportTime) {
  2449. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2450. }
  2451. const that = this
  2452. if(this.user.userNameNeedTranslate == 1) {
  2453. that.dataLoading = that.$store.state.dataLoading
  2454. this.upDataLoading()
  2455. setTimeout(()=>{
  2456. that.dataLoading = that.$store.state.dataLoading
  2457. }, 1000)
  2458. }
  2459. if (this.user.companyId == this.yuzhongCompId) {
  2460. this.getJobResponList();
  2461. }
  2462. },
  2463. methods: {
  2464. ...mapMutations(['upDataLoading']),
  2465. // 已填工时情况表设置背景色
  2466. hasworkTblCellStyle({ columnIndex, row, column }) {
  2467. if(columnIndex > 2) {
  2468. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2469. const worktimeList = row.worktimeList || []
  2470. const times = this.reportTimeType.allday
  2471. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2472. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2473. const missReport = filterData[0] && filterData[0].missReport;
  2474. const state = filterData[0] && filterData[0].state
  2475. if (missReport) {
  2476. return "backgroundColor: red"
  2477. } else {
  2478. if (state == 0 || state == -1) {
  2479. return "backgroundColor: orange"
  2480. } else if (state == 1) {
  2481. //审核通过
  2482. return "backgroundColor: #32CD32"
  2483. } else if (state == 2) {
  2484. return "backgroundColor: red"
  2485. } else {
  2486. return "backgroundColor: #E0E0E0"
  2487. }
  2488. }
  2489. }
  2490. },
  2491. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2492. isCustomization(userInfo, permissionArray) {
  2493. const { companyId } = userInfo
  2494. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2495. return isReportPictureRequired
  2496. },
  2497. showHiddenFunction() {
  2498. this.showHidden = true;
  2499. },
  2500. // 获取如何信息选的可填写部门
  2501. getDeptMembData() {
  2502. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2503. if (res.code == "ok") {
  2504. let lists = res.data.userReportDeptList || []
  2505. const optimizedList = lists.map(item => ({
  2506. ...item,
  2507. label: item.departmentName,
  2508. value: item.departmentId,
  2509. }));
  2510. this.$set(this, 'userReportDeptList', optimizedList || []);
  2511. } else {
  2512. this.$message({
  2513. message: res.msg,
  2514. type: "error"
  2515. });
  2516. }
  2517. },error => { });
  2518. },
  2519. //任务被选中
  2520. onTaskSelected(domainItem) {
  2521. //取服务
  2522. if (domainItem.taskId) {
  2523. var that = this;
  2524. var param = {taskId:domainItem.taskId};
  2525. if (this.isSubstitude) {
  2526. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2527. param.userId = this.workForm.userId[0];
  2528. }
  2529. }
  2530. this.http.post('/task/getMyTaskService',param, res => {
  2531. if (res.code == "ok") {
  2532. // domainItem.workContentList = res.data;
  2533. that.$set(domainItem, 'sapServiceId', null);
  2534. that.$set(domainItem, 'serviceList', res.data);
  2535. } else {
  2536. this.$message({
  2537. message: res.msg,
  2538. type: "error"
  2539. });
  2540. }
  2541. },error => {
  2542. this.$message({
  2543. message: error,
  2544. type: "error"
  2545. });
  2546. }
  2547. );
  2548. } else {
  2549. //清空服务
  2550. }
  2551. },
  2552. onBatchTimeChange() {
  2553. //反向计算每日工作时长
  2554. if (this.workForm.createDate) {
  2555. let sdate = new Date(this.workForm.createDate[0]);
  2556. let edate = new Date(this.workForm.createDate[1]);
  2557. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2558. console.log('days===', days)
  2559. if (days < 0) {
  2560. return;
  2561. }
  2562. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2563. //总时长发生改变,自动按比例计算
  2564. this.workForm.domains.forEach(d=>{
  2565. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2566. });
  2567. }
  2568. },
  2569. //更新工作内容列表
  2570. updateJobContent(domainItem) {
  2571. var that = this;
  2572. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2573. if (res.code == "ok") {
  2574. // domainItem.workContentList = res.data;
  2575. that.$set(domainItem, 'extraField3', null);
  2576. that.$set(domainItem, 'workContentList', res.data);
  2577. } else {
  2578. this.$message({
  2579. message: res.msg,
  2580. type: "error"
  2581. });
  2582. }
  2583. },error => {
  2584. this.$message({
  2585. message: error,
  2586. type: "error"
  2587. });
  2588. }
  2589. );
  2590. },
  2591. updateResponse(domainItem) {
  2592. var that = this;
  2593. var selectPid = domainItem.projectId;
  2594. domainItem.extraField2 = null;
  2595. domainItem.extraField3 = null;
  2596. if (selectPid && domainItem.extraField1) {
  2597. //是否非项目
  2598. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2599. console.log('==========','isPublic=='+isPublic);
  2600. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2601. console.log(filteredRespList);
  2602. domainItem.filteredRespList = filteredRespList;
  2603. }
  2604. },
  2605. getJobResponList() {
  2606. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2607. if (res.code == "ok") {
  2608. this.jobResponseList = res.data;
  2609. } else {
  2610. this.$message({
  2611. message: res.msg,
  2612. type: "error"
  2613. });
  2614. }
  2615. },error => {
  2616. this.$message({
  2617. message: error,
  2618. type: "error"
  2619. });
  2620. }
  2621. );
  2622. },
  2623. openModImportTime(row) {
  2624. this.showModImportTimeDialog = true;
  2625. this.modItemDataId = row.id;
  2626. },
  2627. delImportTime(row) {
  2628. let rowId = row.id;
  2629. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2630. confirmButtonText: this.$t('btn.determine'),
  2631. cancelButtonText: this.$t('btn.cancel'),
  2632. type: "warning"
  2633. })
  2634. .then(() => {
  2635. this.http.post('/report-import-log/delete',{
  2636. id: rowId
  2637. },res => {
  2638. if (res.code == "ok") {
  2639. this.$message({
  2640. message: '删除成功',
  2641. type: "success"
  2642. });
  2643. this.getToView();
  2644. } else {
  2645. this.$message({
  2646. message: res.msg,
  2647. type: "error"
  2648. });
  2649. }
  2650. },error => {
  2651. this.$message({
  2652. message: error,
  2653. type: "error"
  2654. });
  2655. }
  2656. );
  2657. }).catch(() => {this.startDeleting = false});
  2658. },
  2659. confirmChangeModTime() {
  2660. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2661. this.$message({
  2662. message: '请选择时间',
  2663. type: "error"
  2664. });
  2665. return;
  2666. }
  2667. this.http.post('/report-import-log/changeTime',{
  2668. modLogDateTime: this.modImportTime,
  2669. modImportUserId: this.modImportUserId,
  2670. id: this.modItemDataId
  2671. },res => {
  2672. if (res.code == "ok") {
  2673. this.$message({
  2674. message: '修改成功',
  2675. type: "success"
  2676. });
  2677. this.getToView();
  2678. this.showModImportTimeDialog = false;
  2679. } else {
  2680. this.$message({
  2681. message: res.msg,
  2682. type: "error"
  2683. });
  2684. }
  2685. },error => {
  2686. this.$message({
  2687. message: error,
  2688. type: "error"
  2689. });
  2690. }
  2691. );
  2692. },
  2693. confirmBatchApproveReport() {
  2694. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2695. this.$message({
  2696. message: '请选择日期范围',
  2697. type: "error"
  2698. });
  2699. return;
  2700. }
  2701. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2702. confirmButtonText: this.$t('btn.determine'),
  2703. cancelButtonText: this.$t('btn.cancel'),
  2704. type: "warning"
  2705. })
  2706. .then(() => {
  2707. this.startDeleting = true;
  2708. let obj = {
  2709. startDate: this.deleteReportParam.date[0],
  2710. endDate: this.deleteReportParam.date[1]
  2711. }
  2712. if(this.deleteReportParam.departmentId) {
  2713. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2714. } else {
  2715. obj.departmentId = null
  2716. }
  2717. this.http.post('/report/batchApproveByDate',obj,res => {
  2718. if (res.code == "ok") {
  2719. this.$message({
  2720. message: '审核通过',
  2721. type: "success"
  2722. });
  2723. this.getReportList();
  2724. this.getDepartment();
  2725. this.startDeleting = false;
  2726. } else {
  2727. this.$message({
  2728. message: res.msg,
  2729. type: "error"
  2730. });
  2731. }
  2732. },error => {
  2733. this.$message({
  2734. message: error,
  2735. type: "error"
  2736. });
  2737. }
  2738. );
  2739. }).catch(() => {this.startDeleting = false});
  2740. },
  2741. confirmBatchDelReport() {
  2742. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2743. this.$message({
  2744. message: '请选择部门或人员',
  2745. type: "error"
  2746. });
  2747. return;
  2748. }
  2749. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2750. this.$message({
  2751. message: '请选择日期范围',
  2752. type: "error"
  2753. });
  2754. return;
  2755. }
  2756. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2757. confirmButtonText: this.$t('btn.determine'),
  2758. cancelButtonText: this.$t('btn.cancel'),
  2759. type: "warning"
  2760. })
  2761. .then(() => {
  2762. this.startDeleting = true;
  2763. this.http.post('/report/batchDelete',{
  2764. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2765. startDate: this.deleteReportParam.date[0],
  2766. endDate: this.deleteReportParam.date[1],
  2767. deptId: this.deleteReportParam.deptId[0]
  2768. },res => {
  2769. if (res.code == "ok") {
  2770. this.$message({
  2771. message: this.$t('message.successfullyDeleted'),
  2772. type: "success"
  2773. });
  2774. this.getReportList();
  2775. this.getDepartment();
  2776. this.startDeleting = false;
  2777. } else {
  2778. this.$message({
  2779. message: res.msg,
  2780. type: "error"
  2781. });
  2782. }
  2783. },error => {
  2784. this.$message({
  2785. message: error,
  2786. type: "error"
  2787. });
  2788. }
  2789. );
  2790. }).catch(() => {this.startDeleting = false});
  2791. },
  2792. getRecentlyProject() {
  2793. this.http.post('/project/nearProject',{},res => {
  2794. if(res.code == 'ok'){
  2795. let topObj = {
  2796. label: '最近选择项目',
  2797. peojectList: res.data
  2798. }
  2799. let botomObj = {
  2800. label: '全部项目',
  2801. peojectList: this.fillProjectList
  2802. }
  2803. //最近项目如果在fillProjectList中不存在,需要移除
  2804. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2805. this.integrationProjectList = [topObj, botomObj]
  2806. }else {
  2807. this.$message({
  2808. message: res.msg,
  2809. type: 'error'
  2810. })
  2811. }
  2812. },err => {
  2813. this.$message({
  2814. message: err,
  2815. type: 'error'
  2816. })
  2817. })
  2818. },
  2819. handlePictureCardPreview(file, index) {
  2820. console.log(file, index)
  2821. let arr = []
  2822. let imgArr = this.workForm.domains[index].imgListUrl
  2823. for(var i in imgArr) {
  2824. arr.push(imgArr[i].url)
  2825. }
  2826. console.log(arr, '图片数据')
  2827. const $viewer = this.$viewerApi({
  2828. images: arr
  2829. });
  2830. },
  2831. // 图片上传
  2832. addImg(e, index) {
  2833. console.log(e, '数据')
  2834. let formData = new FormData()
  2835. formData.append('multipartFile', e.file)
  2836. this.http.uploadFile('/common/uploadFile', formData,
  2837. res => {
  2838. if (res.code == "ok") {
  2839. this.$message({
  2840. message: this.$t('uploadedsuccessfully'),
  2841. type: "success"
  2842. });
  2843. if(!this.workForm.domains[index].imgList) {
  2844. this.workForm.domains[index].imgList = []
  2845. this.workForm.domains[index].imgListUrl = []
  2846. }
  2847. this.workForm.domains[index].imgList.push(res.data)
  2848. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2849. } else {
  2850. this.$message({message: res.msg,type: "error"});
  2851. }
  2852. console.log(this.workForm.domains[index])
  2853. },
  2854. error => {this.$message({message: error,type: "error"});
  2855. });
  2856. },
  2857. // 删除图片
  2858. delImg(file,fileList, index) {
  2859. console.log(file, fileList)
  2860. let idx = 0
  2861. for(let i in fileList) {
  2862. if(fileList[i].uid == file.uid) {
  2863. idx = i
  2864. }
  2865. }
  2866. this.workForm.domains[index].imgList.splice(idx, 1)
  2867. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2868. console.log(this.workForm.domains[index])
  2869. },
  2870. test(){
  2871. console.log('test',this.workForm.domains);
  2872. },
  2873. getHour(s1, s2) {
  2874. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2875. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2876. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2877. var ms = s2.getTime() - s1.getTime();
  2878. if (ms < 0) return 0;
  2879. let ma = ms / 1000 / 60 / 60
  2880. return ma; //小时
  2881. },
  2882. refreshWXCardTime(workdate) {
  2883. if (!workdate) return;
  2884. this.syncTimeLoading = true;
  2885. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2886. date: workdate,
  2887. },res => {
  2888. this.syncTimeLoading = false;
  2889. if(res.code == 'ok'){
  2890. this.workForm.time = res.data.time;
  2891. }else {
  2892. this.$message({
  2893. message: res.msg,
  2894. type: 'error'
  2895. })
  2896. }
  2897. },err => {
  2898. this.syncTimeLoading = false;
  2899. this.$message({
  2900. message: err,
  2901. type: 'error'
  2902. })
  2903. })
  2904. },
  2905. refreshAttendance(workdate) {
  2906. if (!workdate) return;
  2907. this.syncTimeLoading = true;
  2908. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2909. startDate: workdate[0],
  2910. endDate: workdate[1]
  2911. },res => {
  2912. this.syncTimeLoading = false;
  2913. if(res.code == 'ok'){
  2914. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2915. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2916. this.totalReportHours = this.workTimeForMinYi;
  2917. }else {
  2918. this.$message({
  2919. message: res.msg,
  2920. type: 'error'
  2921. })
  2922. }
  2923. },err => {
  2924. this.syncTimeLoading = false;
  2925. this.$message({
  2926. message: err,
  2927. type: 'error'
  2928. })
  2929. })
  2930. },
  2931. refreshBeiSengAttendance(workdate) {
  2932. if (!workdate) return;
  2933. this.syncTimeLoading = true;
  2934. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2935. createDate: workdate
  2936. },res => {
  2937. this.syncTimeLoading = false;
  2938. if(res.code == 'ok'){
  2939. this.workForm.time = res.data;
  2940. }else {
  2941. this.$message({
  2942. message: res.msg,
  2943. type: 'error'
  2944. })
  2945. }
  2946. },err => {
  2947. this.syncTimeLoading = false;
  2948. this.$message({
  2949. message: err,
  2950. type: 'error'
  2951. })
  2952. })
  2953. },
  2954. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2955. this.weeklyFilledTimeDialog = true
  2956. this.weeklyFilledTimeLoading = true
  2957. this.weeklyFilledTimeDate = parameterDate
  2958. this.http.post('/report/getReportList',{
  2959. date: parameterDate,
  2960. userId: this.user.id
  2961. },res => {
  2962. this.weeklyFilledTimeLoading = false
  2963. if(res.code == 'ok'){
  2964. this.weeklyFilledTimeList = res.data[0].data
  2965. let candelete = true
  2966. for(let i in this.weeklyFilledTimeList){
  2967. if(this.weeklyFilledTimeList[i].state < 2){
  2968. candelete = false
  2969. }
  2970. }
  2971. this.weeklyFilledTimeCanDelete = candelete
  2972. }else {
  2973. this.$message({
  2974. message: res.msg,
  2975. type: 'error'
  2976. })
  2977. }
  2978. },err => {
  2979. this.weeklyFilledTimeLoading = false
  2980. this.$message({
  2981. message: err,
  2982. type: 'error'
  2983. })
  2984. })
  2985. },
  2986. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2987. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2988. confirmButtonText: this.$t('btn.determine'),
  2989. cancelButtonText: this.$t('btn.cancel'),
  2990. type: "warning"
  2991. })
  2992. .then(() => {
  2993. this.http.post('/report/delete',{
  2994. userId: this.user.id,
  2995. date: this.weeklyFilledTimeDate
  2996. },res => {
  2997. if (res.code == "ok") {
  2998. this.$message({
  2999. message: this.$t('message.successfullyDeleted'),
  3000. type: "success"
  3001. });
  3002. this.getWeeklyWorkTime()
  3003. this.getReportList();
  3004. this.getDepartment();
  3005. this.weeklyFilledTimeDialog = false;
  3006. } else {
  3007. this.$message({
  3008. message: res.msg,
  3009. type: "error"
  3010. });
  3011. }
  3012. },error => {
  3013. this.$message({
  3014. message: error,
  3015. type: "error"
  3016. });
  3017. }
  3018. );
  3019. }).catch(() => {});
  3020. },
  3021. getApprovalProcess(item){
  3022. // console.log('this.date',this.choseDate);
  3023. this.http.post('/report-log/get',{
  3024. creatorId: item.id,
  3025. createDate: sessionStorage.msg
  3026. },res => {
  3027. if(res.code == 'ok'){
  3028. this.approvalProcessDialog = true
  3029. if(this.user.userNameNeedTranslate == 1) {
  3030. for(var i in res.data) {
  3031. let obj = {
  3032. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3033. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3034. }
  3035. res.data[i].msgCon = obj
  3036. }
  3037. }
  3038. this.approvalProcessData = res.data
  3039. console.log(this.approvalProcessData, '数据卡看')
  3040. }else{
  3041. this.$message({
  3042. message: res.msg,
  3043. type: 'error'
  3044. })
  3045. }
  3046. },err => {
  3047. this.$message({
  3048. message: err,
  3049. type: 'error'
  3050. })
  3051. })
  3052. },
  3053. filterNode(value, data) {
  3054. if (!value) return true;
  3055. return data.label.indexOf(value) !== -1;
  3056. },
  3057. triggerCalculateOT(index) {
  3058. var str = this.workForm.domains[index].overtimeHours + ''
  3059. if(str.indexOf('.') != '-1') {
  3060. var s = str.split('.')[0]
  3061. var st = str.split('.')[1]
  3062. var sts = st.split('')
  3063. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3064. }
  3065. },
  3066. searchScreen(e){
  3067. if(e){
  3068. this.monthNotWorkDateS1 = []
  3069. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3070. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3071. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3072. }
  3073. }
  3074. if (this.monthNotWorkDateS1.length > 50) {
  3075. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3076. }else{
  3077. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3078. }
  3079. // if (this.monthNotWorkDateS1.length > 0) {
  3080. // setTimeout(() => {
  3081. // this.tableListenernot()
  3082. // }, 1000);
  3083. // }
  3084. }else{
  3085. this.monthWorkDataS1 = []
  3086. for (let i = 0; i < this.monthWorkData.length; i++) {
  3087. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3088. this.monthWorkDataS1.push(this.monthWorkData[i])
  3089. }
  3090. }
  3091. if (this.monthWorkDataS1.length > 50) {
  3092. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3093. }else{
  3094. this.monthWorkDataS = this.monthWorkDataS1
  3095. }
  3096. // if (this.monthWorkDataS1.length > 0) {
  3097. // setTimeout(() => {
  3098. // this.tableListener()
  3099. // }, 1000);
  3100. // }
  3101. }
  3102. },
  3103. addUpload(data) {
  3104. // var zhi = data.fileName.split('.')[0]
  3105. // var sss = zhi + '.xlsx'
  3106. // return
  3107. var filePath = '/upload/' + data.serverName;
  3108. const a = document.createElement('a'); // 创建a标签
  3109. a.setAttribute('download', data.fileName);// download属性
  3110. a.setAttribute('href', filePath);// href链接
  3111. a.click(); //自执行点击事件
  3112. a.remove();
  3113. },
  3114. restrictNumber(targetId) {
  3115. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3116. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3117. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3118. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3119. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3120. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3121. inpu.value = parseFloat(inpu.value);
  3122. }
  3123. },
  3124. //获取项目下的任务分组
  3125. getTaskGroups(domain, index) {
  3126. domain.groupId=null;
  3127. this.http.post('/task-group/listMyJoinGroup',{
  3128. projectId: domain.projectId,
  3129. isSubstitude: this.isSubstitude ? 1 : 0
  3130. },
  3131. res => {
  3132. if (res.code == "ok") {
  3133. this.workForm.domains[index].taskGroups = res.data;
  3134. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3135. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3136. // this.getGroupStages(domain, index);
  3137. // }
  3138. this.$forceUpdate();
  3139. }
  3140. },
  3141. error => {
  3142. this.$message({
  3143. message: error,
  3144. type: "error"
  3145. });
  3146. }
  3147. );
  3148. },
  3149. //下载填报工时占比报表
  3150. downloadProjectRatio() {
  3151. this.exportUserRatio = true;
  3152. // let now = new Date();
  3153. // let month = now.getMonth();//默认看上个月的
  3154. // let monthStr = month<10? ('0'+month): month;
  3155. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3156. const today = new Date();
  3157. const year = today.getFullYear();
  3158. const month = today.getMonth() + 1;
  3159. let lastMonthYear, lastMonth;
  3160. if (month === 1) {
  3161. lastMonthYear = year - 1;
  3162. lastMonth = 12;
  3163. } else {
  3164. lastMonthYear = year;
  3165. lastMonth = month - 1;
  3166. }
  3167. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3168. console.log('赋值 ==>', this.ratioYmonth)
  3169. },
  3170. confirmDownloadRatio() {
  3171. this.startRatioExporting = true;
  3172. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3173. ymonth: this.ratioYmonth
  3174. },
  3175. res => {
  3176. if (res.code == "ok") {
  3177. this.startRatioExporting = false;
  3178. var filePath = res.data;
  3179. const a = document.createElement('a'); // 创建a标签
  3180. var data = filePath.split("/");
  3181. a.setAttribute('download', data[data.length-1]);// download属性
  3182. a.setAttribute('href', filePath);// href链接
  3183. a.click(); //自执行点击事件
  3184. a.remove();
  3185. } else {
  3186. this.startRatioExporting = false;
  3187. this.$message({
  3188. message: res.msg,
  3189. type: "error"
  3190. });
  3191. }
  3192. },
  3193. error => {
  3194. this.checkinLoading = false;
  3195. this.$message({
  3196. message: error,
  3197. type: "error"
  3198. });
  3199. }
  3200. );
  3201. },
  3202. //下载带企业微信考勤数据的工时统计模板
  3203. downloadCheckInExcel() {
  3204. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3205. startDate: this.importWxParam.date[0],
  3206. endDate: this.importWxParam.date[1],
  3207. },
  3208. res => {
  3209. if (res.code == "ok") {
  3210. var filePath = res.data;
  3211. const a = document.createElement('a'); // 创建a标签
  3212. var data = filePath.split("/");
  3213. a.setAttribute('download', data[data.length-1]);// download属性
  3214. a.setAttribute('href', filePath);// href链接
  3215. a.click(); //自执行点击事件
  3216. a.remove();
  3217. } else {
  3218. this.$message({
  3219. message: res.msg,
  3220. type: "error"
  3221. });
  3222. }
  3223. },
  3224. error => {
  3225. this.checkinLoading = false;
  3226. this.$message({
  3227. message: error,
  3228. type: "error"
  3229. });
  3230. }
  3231. );
  3232. },
  3233. pre() {
  3234. if (this.active == 0) return;
  3235. this.active--;
  3236. },
  3237. next() {
  3238. this.active++;
  3239. },
  3240. triggerTotalTime(index) {
  3241. var item = this.checkinList[index];
  3242. var total = 0.0;
  3243. for (var i=0;i<this.projectColumns.length; i++) {
  3244. var key = this.projectColumns[i];
  3245. if (item[key] != null && item[key] != '') {
  3246. total += parseFloat(item[key]);
  3247. }
  3248. }
  3249. item.totalFillTime = total;
  3250. },
  3251. //提交批量代填的数据
  3252. submitBatchSubFillData() {
  3253. var data = JSON.stringify(this.checkinList);
  3254. this.http.post('/user-corpwx-time/submitProjectTime',{
  3255. json: data,
  3256. projectColumns: JSON.stringify(this.projectColumns)
  3257. },
  3258. res => {
  3259. if (res.code == "ok") {
  3260. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3261. this.importWxDialog = false;
  3262. }
  3263. },
  3264. error => {
  3265. this.checkinLoading = false;
  3266. this.$message({
  3267. message: error,
  3268. type: "error"
  3269. });
  3270. }
  3271. );
  3272. },
  3273. loadCheckInData() {
  3274. if (this.importWxParam.date == null) {
  3275. this.checkinList = [];
  3276. return;
  3277. }
  3278. this.checkinLoading = true;
  3279. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3280. startDate: this.importWxParam.date[0],
  3281. endDate: this.importWxParam.date[1],
  3282. },
  3283. res => {
  3284. if (res.code == "ok") {
  3285. this.checkinLoading = false;
  3286. this.checkinList = res.data.list;
  3287. this.projectColumns = res.data.projects;
  3288. // 自定义表格会导致表格错乱,需重新计算表格
  3289. this.$nextTick(()=>{
  3290. this.$refs.tab.doLayout()
  3291. })
  3292. }
  3293. },
  3294. error => {
  3295. this.checkinLoading = false;
  3296. this.$message({
  3297. message: error,
  3298. type: "error"
  3299. });
  3300. }
  3301. );
  3302. },
  3303. importCardTime(item) {
  3304. //首先判断文件类型
  3305. let str = item.file.name.split(".");
  3306. let format = str[str.length - 1];
  3307. if (format != "xls" && format != "xlsx") {
  3308. this.$message({
  3309. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3310. type: "error"
  3311. });
  3312. } else {
  3313. this.importingData = true;
  3314. let formData = new FormData();
  3315. formData.append("multipartFile", item.file);
  3316. formData.append("companyId", this.user.companyId);
  3317. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3318. res => {
  3319. this.$refs.uploadCardTime.clearFiles();
  3320. this.importingData = false;
  3321. if (res.code == "ok") {
  3322. //换成弹出框,以免有人等了半天回来啥也没看到
  3323. this.$message({
  3324. message: '导入考勤时长成功',
  3325. type: "success"
  3326. });
  3327. } else {
  3328. this.$message({
  3329. message: res.msg,
  3330. type: "error"
  3331. });
  3332. }
  3333. },
  3334. error => {
  3335. this.$refs.upload.clearFiles();
  3336. this.listLoading = false;
  3337. this.$message({
  3338. message: error,
  3339. type: "error"
  3340. });
  3341. });
  3342. }
  3343. },
  3344. batchImportWxData(item) {
  3345. //首先判断文件类型
  3346. let str = item.file.name.split(".");
  3347. let format = str[str.length - 1];
  3348. if (format != "xls" && format != "xlsx") {
  3349. this.$message({
  3350. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3351. type: "error"
  3352. });
  3353. } else {
  3354. this.importingData = true;
  3355. let formData = new FormData();
  3356. formData.append("file", item.file);
  3357. formData.append("companyId", this.user.companyId);
  3358. formData.append("withCheckIn", 1);
  3359. this.http.uploadFile('/report/importData', formData,
  3360. res => {
  3361. this.$refs.upload.clearFiles();
  3362. this.showImportResult = true;
  3363. this.importingData = false;
  3364. if (res.code == "ok") {
  3365. //换成弹出框,以免有人等了半天回来啥也没看到
  3366. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3367. this.getReportList();
  3368. this.importWxDialog = false;
  3369. } else {
  3370. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3371. }
  3372. },
  3373. error => {
  3374. this.$refs.upload.clearFiles();
  3375. this.listLoading = false;
  3376. this.$message({
  3377. message: error,
  3378. type: "error"
  3379. });
  3380. });
  3381. }
  3382. },
  3383. batchImportData(item) {
  3384. //首先判断文件类型
  3385. let str = item.file.name.split(".");
  3386. let format = str[str.length - 1];
  3387. if (format != "xls" && format != "xlsx") {
  3388. this.$message({
  3389. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3390. type: "error"
  3391. });
  3392. } else {
  3393. this.importingData = true;
  3394. let formData = new FormData();
  3395. formData.append("file", item.file);
  3396. formData.append("companyId", this.user.companyId);
  3397. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3398. this.http.uploadFile(url, formData,
  3399. res => {
  3400. this.$refs.upload.clearFiles();
  3401. this.importingData = false;
  3402. this.showImportResult = true;
  3403. if (res.code == "ok") {
  3404. //换成弹出框,以免有人等了半天回来啥也没看到
  3405. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3406. this.getReportList();
  3407. this.importWXDialog = false;
  3408. } else {
  3409. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3410. }
  3411. },
  3412. error => {
  3413. this.$refs.upload.clearFiles();
  3414. this.importingData = false;
  3415. this.$message({
  3416. message: error,
  3417. type: "error"
  3418. });
  3419. });
  3420. }
  3421. },
  3422. userssHu() {
  3423. this.http.post('/time-type/getCompanyTimeSetting',{
  3424. companyId: this.user.companyId
  3425. },
  3426. res => {
  3427. if (res.code == "ok") {
  3428. this.yonghuUser = res.data
  3429. }
  3430. },
  3431. error => {
  3432. this.$message({
  3433. message: error,
  3434. type: "error"
  3435. });
  3436. }
  3437. );
  3438. },
  3439. iptBlur(i) {
  3440. if(this.isBatch == 0) {
  3441. return
  3442. }
  3443. var reqParam = {
  3444. startDate: this.workForm.createDate[0],
  3445. endDate: this.workForm.createDate[1]
  3446. };
  3447. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3448. reqParam.userId = this.workForm.userId[0];
  3449. }
  3450. this.http.post('/report/getWorkDays',reqParam,
  3451. res => {
  3452. if (res.code == "ok") {
  3453. this.jsDay = res.data
  3454. this.chuji(i)
  3455. } else {
  3456. this.$message({
  3457. message: res.msg,
  3458. type: "error"
  3459. });
  3460. }
  3461. },
  3462. error => {
  3463. this.$message({
  3464. message: error,
  3465. type: "error"
  3466. });
  3467. }
  3468. );
  3469. //明夷硬编码获取
  3470. if (this.user.company.companyName == this.mingyiName) {
  3471. this.getWorkTimeForMinYi();
  3472. }
  3473. },
  3474. getWorkTimeForMinYi(){
  3475. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3476. startDate: this.workForm.createDate[0],
  3477. endDate: this.workForm.createDate[1]
  3478. },
  3479. res => {
  3480. if (res.code == "ok") {
  3481. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3482. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3483. this.totalReportHours = this.workTimeForMinYi;
  3484. } else {
  3485. this.$message({
  3486. message: res.msg,
  3487. type: "error"
  3488. });
  3489. this.workForm.createDate = [];
  3490. }
  3491. },
  3492. error => {
  3493. this.$message({
  3494. message: error,
  3495. type: "error"
  3496. });
  3497. }
  3498. );
  3499. },
  3500. chuji(i) {
  3501. if(i == 0) {
  3502. this.seleChn(1)
  3503. } else if(i == 1) {
  3504. this.seleChn(0)
  3505. } else if(i == 2) {
  3506. if(this.workForm.domains[0].multiWorktime > 0) {
  3507. this.iptChangs()
  3508. } else {
  3509. this.iptChang()
  3510. }
  3511. } else if(i == 3) {
  3512. this.seleChn(0)
  3513. }
  3514. },
  3515. seleChn(e,domain) {
  3516. if(e == 1) {
  3517. for(var i in this.workForm.domains) {
  3518. if(this.workForm.domains[i].timeType == 0) {
  3519. this.workForm.domains[i].workingTime = 8
  3520. } else {
  3521. this.workForm.domains[i].workingTime = 4
  3522. }
  3523. }
  3524. }
  3525. var quanbu = 0
  3526. var spl = this.workForm.domains
  3527. var zhi = ''
  3528. for(var i in spl) {
  3529. var sp = +spl[i].workingTime + 0
  3530. zhi = this.jsDay * sp
  3531. quanbu = +quanbu + zhi
  3532. }
  3533. this.jsTime = quanbu
  3534. this.totalReportHours = quanbu
  3535. let worktime = this.jsTime
  3536. // 自动计算加班时长
  3537. if(this.isBatch != 0){
  3538. worktime = this.jsTime / this.jsDay
  3539. }
  3540. if(this.user.timeType.fillOvertime && domain){
  3541. let isover = false
  3542. let alltime = 0
  3543. let allover = 0 //此处alltime同上面的worktime
  3544. for(let d in spl){
  3545. if(spl[d].isOvertime){
  3546. isover = true
  3547. allover += spl[d].overtimeHours*1
  3548. }
  3549. alltime += spl[d].workingTime*1
  3550. }
  3551. if(domain.overtimeHours){
  3552. allover = allover - domain.overtimeHours
  3553. }
  3554. if(worktime*1 > this.user.timeType.allday){
  3555. if(isover){
  3556. if(alltime > (allover + this.user.timeType.allday)){
  3557. this.$set(domain,'isOvertime',true)
  3558. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3559. }else{
  3560. this.$set(domain,'isOvertime',false)
  3561. this.$set(domain,'overtimeHours',null)
  3562. if(alltime < (allover + this.user.timeType.allday)){
  3563. let overtime = allover + this.user.timeType.allday - alltime
  3564. for(let pi in spl){
  3565. if(spl[pi].overtimeHours){
  3566. if((overtime - spl[pi].overtimeHours*1) > 0){
  3567. overtime = overtime - spl[pi].overtimeHours*1
  3568. this.$set(spl[pi],'isOvertime',false)
  3569. this.$set(spl[pi],'overtimeHours',null)
  3570. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3571. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3572. break
  3573. }else{
  3574. this.$set(spl[pi],'isOvertime',false)
  3575. this.$set(spl[pi],'overtimeHours',null)
  3576. break
  3577. }
  3578. }
  3579. }
  3580. }
  3581. }
  3582. }else{
  3583. this.$set(domain,'isOvertime',true)
  3584. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3585. }
  3586. }else{
  3587. for(let di in spl){
  3588. this.$set(spl[di],'isOvertime',false)
  3589. this.$set(spl[di],'overtimeHours',null)
  3590. }
  3591. }
  3592. }
  3593. },
  3594. iptChang() {
  3595. var sl = this.workForm.domains
  3596. let timeArr = []
  3597. for(var i in sl) {
  3598. if(sl[i].startTime && sl[i].endTime) {
  3599. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3600. }
  3601. }
  3602. this.getTimeHours(timeArr)
  3603. // for(let j in arrNum) {
  3604. // this.timeJsonStr += arrNum[j]
  3605. // if(flg) {
  3606. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3607. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3608. // }
  3609. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3610. // flg = true
  3611. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3612. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3613. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3614. // }
  3615. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3616. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3617. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3618. // }
  3619. // }
  3620. },
  3621. iptChangs() {
  3622. var sl = this.workForm.domains
  3623. let timeArr = []
  3624. for(var i in sl) {
  3625. for(var j in sl[i].worktimeList){
  3626. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3627. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3628. }
  3629. }
  3630. }
  3631. this.getTimeHours(timeArr)
  3632. },
  3633. // 调用接口或去数据
  3634. getTimeHours(arr) {
  3635. this.http.post('/report/getHoursByTimeRange',{
  3636. timeJsonStr: JSON.stringify(arr)
  3637. },res => {
  3638. if(res.code === 'ok') {
  3639. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3640. } else {
  3641. this.$message({
  3642. message: res.msg,
  3643. type: 'error'
  3644. })
  3645. }
  3646. },err => {
  3647. this.$message({
  3648. message: err,
  3649. type: 'error'
  3650. })
  3651. })
  3652. },
  3653. // 按周填报调用接口计算时间
  3654. async getWeekHoursByTimeRange(timeRange) {
  3655. const url = '/report/getHoursByTimeRange';
  3656. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3657. var that = this;
  3658. return new Promise((resolve, reject) => {
  3659. this.http.post(url, data, function(res) {
  3660. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3661. }, function(err) {
  3662. reject(err);
  3663. });
  3664. });
  3665. },
  3666. removeTimeItem(item, index) {
  3667. item.worktimeList.splice(index, 1);
  3668. this.iptChangs()
  3669. },
  3670. //添加工时
  3671. addNewWorktime(index, item) {
  3672. if(item.worktimeList == null ) {
  3673. item.worktimeList = []
  3674. }
  3675. item.worktimeList.push({});
  3676. },
  3677. //复制项目
  3678. copyProject(index) {
  3679. var leftProgress = 10;
  3680. if (this.reportTimeType.type == 3) {
  3681. //计算已经待分配工时比例
  3682. let array = this.workForm.domains;
  3683. let totalProgress = 0;
  3684. for (var i=0;i<array.length; i++) {
  3685. totalProgress += array[i].progress;
  3686. }
  3687. if (totalProgress < 100) {
  3688. leftProgress = 100 - totalProgress;
  3689. }
  3690. }
  3691. var newIndex = index+1;
  3692. var itemDomain = {
  3693. projectId: this.workForm.domains[index].projectId,
  3694. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3695. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3696. ),
  3697. content: "",
  3698. progress:leftProgress,
  3699. state:2,//2-表示待提交
  3700. };
  3701. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3702. if (this.reportTimeType.type == 0) {
  3703. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3704. var length = this.workForm.domains.length;
  3705. if (length == 2) {
  3706. this.showAddMore = false;
  3707. }
  3708. }
  3709. this.selectProject(itemDomain, newIndex);
  3710. },
  3711. pushWorkTime(reportId){
  3712. let url=''
  3713. if(this.user.timeType.syncSap == 1){
  3714. url='/report/pushProjectReportToSap'
  3715. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3716. var pushDate = this.date + day;
  3717. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3718. confirmButtonText: '确定',
  3719. cancelButtonText: '取消',
  3720. type: 'info'
  3721. }).then(() => {
  3722. const loading = this.$loading({
  3723. lock: true,
  3724. text: '正在推送中,请耐心等待。',
  3725. spinner: 'el-icon-loading',
  3726. background: 'rgba(0, 0, 0, 0.7)'
  3727. });
  3728. this.http.post(url,{
  3729. pushDate: pushDate,
  3730. reportId: reportId
  3731. },res => {
  3732. loading.close();
  3733. if(res.code == 'ok'){
  3734. this.$message({
  3735. type: 'success',
  3736. message: res.data
  3737. });
  3738. }else{
  3739. this.$message({
  3740. type: 'error',
  3741. message: res.msg
  3742. })
  3743. }
  3744. },err => {
  3745. loading.close();
  3746. this.$message({
  3747. type: 'error',
  3748. message: err
  3749. })
  3750. })
  3751. }).catch(() => {
  3752. });
  3753. }else{
  3754. url='/report/pushReportDataToThird'
  3755. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3756. confirmButtonText: '确定',
  3757. cancelButtonText: '取消',
  3758. type: 'info'
  3759. }).then(() => {
  3760. const loading = this.$loading({
  3761. lock: true,
  3762. text: '正在推送中,请耐心等待。',
  3763. spinner: 'el-icon-loading',
  3764. background: 'rgba(0, 0, 0, 0.7)'
  3765. });
  3766. this.http.post(url,{
  3767. yearMonth: this.date
  3768. },res => {
  3769. loading.close();
  3770. if(res.code == 'ok'){
  3771. this.$message({
  3772. type: 'success',
  3773. message: '推送成功!'
  3774. });
  3775. }else{
  3776. this.$message({
  3777. type: 'error',
  3778. message: res.msg
  3779. })
  3780. }
  3781. },err => {
  3782. loading.close();
  3783. this.$message({
  3784. type: 'error',
  3785. message: err
  3786. })
  3787. })
  3788. }).catch(() => {
  3789. });
  3790. }
  3791. },
  3792. showWorkTime(){
  3793. this.monthWorkTimeDialog = true;
  3794. this.searchKeyword = ''
  3795. this.WorktimeDatepickValue = this.istoMonth()
  3796. if(this.WorktimeDatepickValue.length == 0){
  3797. let newdate = new Date();
  3798. let nowdate = newdate.toLocaleDateString();
  3799. let getauto = this.getAutoWeekDate(nowdate)
  3800. let nowwd = [getauto[0],getauto[6]]
  3801. this.WorktimeDatepickValue = nowwd
  3802. }
  3803. this.showMonthWorkTime()
  3804. },
  3805. handleClick(t,e){
  3806. if (t.name == "second") {
  3807. this.showMonthNotWorkTime()
  3808. }else if(t.name == "first"){
  3809. this.showMonthWorkTime()
  3810. }else if(t.name == "third"){
  3811. this.showMonthWorkTimeReminder()
  3812. }
  3813. },
  3814. //导出员工每日填报工时数
  3815. exportMembWorkHours() {
  3816. this.http.post(
  3817. "/report/exportUserDailyWorkTime",
  3818. {
  3819. // month: this.date,
  3820. startDate: this.WorktimeDatepickValue[0],
  3821. endDate: this.WorktimeDatepickValue[1],
  3822. },
  3823. (res) => {
  3824. if (res.code == "ok") {
  3825. let url = res.data;
  3826. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3827. }
  3828. },
  3829. (error) => {
  3830. this.$message({
  3831. message: error,
  3832. type: "error",
  3833. });
  3834. }
  3835. );
  3836. },
  3837. exportMembWorkHoursReminder() {
  3838. this.http.post(
  3839. "/report/exportUserDailyWorkTimeReminder",
  3840. {
  3841. // month: this.date,
  3842. startDate: this.WorktimeDatepickValue[0],
  3843. endDate: this.WorktimeDatepickValue[1],
  3844. },
  3845. (res) => {
  3846. if (res.code == "ok") {
  3847. let url = res.data;
  3848. this.downloadByA('工时异常表.xlsx', url);
  3849. }
  3850. },
  3851. (error) => {
  3852. this.$message({
  3853. message: error,
  3854. type: "error",
  3855. });
  3856. }
  3857. );
  3858. },
  3859. exportMembNotWorkHours() {
  3860. this.http.post(
  3861. "/report/exportNoReportUserList",
  3862. {
  3863. // month: this.date,
  3864. startDate: this.WorktimeDatepickValue[0],
  3865. endDate: this.WorktimeDatepickValue[1],
  3866. },
  3867. (res) => {
  3868. if (res.code == "ok") {
  3869. let url = res.data;
  3870. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3871. }
  3872. },
  3873. (error) => {
  3874. this.$message({
  3875. message: error,
  3876. type: "error",
  3877. });
  3878. }
  3879. );
  3880. },
  3881. downloadByA(name, url) {
  3882. const a = document.createElement("a"); // 创建a标签
  3883. a.setAttribute("download", name); // download属性
  3884. a.setAttribute("href", url); // href链接
  3885. a.click(); // 自执行点击事件
  3886. a.remove();
  3887. },
  3888. // 是否本月判断
  3889. istoMonth(){
  3890. let todate = new Date()
  3891. let tomonth = todate.getMonth() + 1
  3892. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3893. if(this.date == adate){
  3894. return []
  3895. }else{
  3896. let sedate = new Date(this.date)
  3897. let semonth = sedate.getMonth() + 1
  3898. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3899. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3900. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3901. return [sedates1, sedates2]
  3902. }
  3903. },
  3904. showMonthWorkTime() {
  3905. this.monthTotalPage = 0,
  3906. this.tbload = true
  3907. let parameter={
  3908. startDate: this.WorktimeDatepickValue[0],
  3909. endDate: this.WorktimeDatepickValue[1],
  3910. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3911. }
  3912. this.http.post(
  3913. "/report/getUserDailyWorkTime",
  3914. // "/report/getNoReportUserList",
  3915. parameter,
  3916. (res) => {
  3917. if (res.code == "ok") {
  3918. this.tbload = false;
  3919. this.pickDateArray = res.data.days.map(item => {
  3920. return {
  3921. ...item,
  3922. dateStr: item.label.split('/')[0],
  3923. weekStr: item.label.split('/')[1]
  3924. }
  3925. });
  3926. // console.log('dataarray',res.data.days);
  3927. this.monthWorkData = res.data.list;
  3928. // this.monthWorkDataS = this.monthWorkData
  3929. // this.monthWorkDataS1 = res.data.list
  3930. this.monthTotal = res.data.list.length
  3931. if (this.monthWorkData.length > 50) {
  3932. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3933. }else{
  3934. this.monthWorkDataS = this.monthWorkData
  3935. }
  3936. this.searchScreen(0)
  3937. // this.monthWorkDataS = infoList
  3938. // 判断
  3939. // if (this.monthWorkDataS1.length > 0) {
  3940. // setTimeout(() => {
  3941. // this.tableListener()
  3942. // }, 1000);
  3943. // }
  3944. this.$nextTick(function(){
  3945. this.$refs.hasworkTbl.doLayout();
  3946. });
  3947. // this.$forceUpdate()
  3948. }
  3949. },
  3950. (error) => {
  3951. this.tbload = false
  3952. this.$message({
  3953. message: error,
  3954. type: "error",
  3955. });
  3956. }
  3957. );
  3958. },
  3959. showMonthWorkTimeReminder() {
  3960. this.monthTotalPage = 0,
  3961. this.tbload = true
  3962. let parameter={}
  3963. parameter={
  3964. startDate: this.WorktimeDatepickValue[0],
  3965. endDate: this.WorktimeDatepickValue[1],
  3966. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3967. viewValue:this.isReminder?1:0
  3968. }
  3969. this.http.post(
  3970. "/report/getUserDailyWorkTimeReminder",
  3971. parameter,
  3972. (res) => {
  3973. if (res.code == "ok") {
  3974. this.tbload = false;
  3975. this.monthWorkData = res.data.list;
  3976. this.monthTotal = res.data.list.length
  3977. if (this.monthWorkData.length > 50) {
  3978. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3979. }else{
  3980. this.monthWorkDataS = this.monthWorkData
  3981. }
  3982. this.searchScreen(0)
  3983. this.$nextTick(function(){
  3984. this.$refs.hasworkTbl.doLayout();
  3985. });
  3986. }
  3987. },
  3988. (error) => {
  3989. this.tbload = false
  3990. this.$message({
  3991. message: error,
  3992. type: "error",
  3993. });
  3994. }
  3995. );
  3996. },
  3997. // tableListener(){
  3998. // let that = this;
  3999. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4000. // // 添加scroll监听事件
  4001. // dom.addEventListener("scroll", function () {
  4002. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4003. // if (scrollDistance < 2) {
  4004. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4005. // that.monthTotalPage++; //当前页数自增
  4006. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4007. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4008. // var infoList = arrList.splice(
  4009. // that.monthTotalPage * that.monthTotalLages,
  4010. // that.monthTotalLages
  4011. // );
  4012. // // 数据添加
  4013. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4014. // }
  4015. // }
  4016. // })
  4017. // },
  4018. showMonthNotWorkTime() {
  4019. this.monthTotalPage = 0,
  4020. this.tbload = true,
  4021. this.http.post(
  4022. "/report/getNoReportUserList",
  4023. {
  4024. startDate: this.WorktimeDatepickValue[0],
  4025. endDate: this.WorktimeDatepickValue[1],
  4026. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4027. },
  4028. (res) => {
  4029. if (res.code == "ok") {
  4030. this.tbload = false
  4031. this.monthNotWorkDate = res.data;
  4032. // this.monthNotWorkDateS1 = res.data
  4033. this.monthnotTotal = res.data.length
  4034. // 2222111
  4035. if (this.monthNotWorkDate.length > 50) {
  4036. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4037. } else {
  4038. this.monthNotWorkDateS = this.monthNotWorkDate
  4039. }
  4040. this.searchScreen(1)
  4041. // 判断
  4042. // if (this.monthnotworkDateS1.length > 0) {
  4043. // setTimeout(() => {
  4044. // this.tableListenernot()
  4045. // }, 1000);
  4046. // }
  4047. this.$nextTick(function(){
  4048. this.$refs.hasworkTbl2.doLayout();
  4049. });
  4050. }
  4051. },
  4052. (error) => {
  4053. this.tbload = false
  4054. this.$message({
  4055. message: error,
  4056. type: "error",
  4057. });
  4058. }
  4059. );
  4060. },
  4061. // tableListenernot(){
  4062. // let that = this;
  4063. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4064. // dom.addEventListener("scroll", function () {
  4065. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4066. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4067. // if (scrollDistance2 < 2) {
  4068. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4069. // that.monthnotTotalPage++; //当前页数自增
  4070. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4071. // var infoList = arrList.splice(
  4072. // that.monthnotTotalPage * that.monthnotTotalLages,
  4073. // that.monthnotTotalLages
  4074. // );
  4075. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4076. // }
  4077. // }
  4078. // })
  4079. // },
  4080. listScroll(){
  4081. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4082. this.isMore = true
  4083. setTimeout(()=>{
  4084. this.isMore = false
  4085. },1000)
  4086. }else {
  4087. this.isFlag = true
  4088. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4089. this.monthWorkDataS = datalist
  4090. setTimeout(()=>{
  4091. this.isFlag = false
  4092. },300)
  4093. }
  4094. },
  4095. notListScroll(){
  4096. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4097. this.isMore = true
  4098. setTimeout(()=>{
  4099. this.isMore = false
  4100. },1000)
  4101. }else {
  4102. this.isFlag = true
  4103. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4104. this.monthNotWorkDateS = datalist
  4105. // console.log('length',this.monthNotWorkDateS.length)
  4106. setTimeout(()=>{
  4107. this.isFlag = false
  4108. },300)
  4109. }
  4110. },
  4111. getFirstAndLastDay() {
  4112. // 将选定的月份转换为Date对象
  4113. var monthDate = new Date();
  4114. var year = monthDate.getFullYear();
  4115. var month = monthDate.getMonth();
  4116. // 计算起始日和结束日
  4117. var startDay = new Date(year, month, 1);
  4118. var endDay = new Date(year, month + 1, 0);
  4119. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4120. this.WorktimeDatepickValueForMonth=lastmd
  4121. },
  4122. formatDate(date) {
  4123. var year = date.getFullYear();
  4124. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4125. var day = ("0" + date.getDate()).slice(-2);
  4126. return year + "-" + month + "-" + day;
  4127. },
  4128. // 获取默认这zhou日期参数 222
  4129. getLastWeek(e){
  4130. let newdate = new Date()
  4131. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4132. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4133. if(e==1){
  4134. this.WorktimeDatepickValue = lastwd
  4135. this.showMonthWorkTime()
  4136. }else if(e==2){
  4137. this.WorktimeDatepickValue = lastwd
  4138. this.showMonthWorkTimeReminder()
  4139. }else{
  4140. this.WorktimeDatepickValue = lastwd
  4141. this.showMonthNotWorkTime()
  4142. }
  4143. },
  4144. getThisWeek(e){
  4145. let newdate = new Date();
  4146. let nowdate = newdate.toLocaleDateString();
  4147. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4148. if(e==1){
  4149. this.WorktimeDatepickValue = nowwd
  4150. this.showMonthWorkTime()
  4151. }else if(e==2){
  4152. this.WorktimeDatepickValue = nowwd
  4153. this.showMonthWorkTimeReminder()
  4154. }else{
  4155. this.WorktimeDatepickValue = nowwd
  4156. this.showMonthNotWorkTime()
  4157. }
  4158. },
  4159. getDoubleLastWeek(e){
  4160. let newdate = new Date()
  4161. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4162. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4163. if(e==1){
  4164. this.WorktimeDatepickValue = nextwd
  4165. this.showMonthWorkTime()
  4166. }else if(e==2){
  4167. this.WorktimeDatepickValue = nextwd
  4168. this.showMonthWorkTimeReminder()
  4169. }else{
  4170. this.WorktimeDatepickValue = nextwd
  4171. this.showMonthNotWorkTime()
  4172. }
  4173. },
  4174. alreadyAllDate(stime,etime){
  4175. let diffdate = new Array();
  4176. let i=0;
  4177. while(stime<=etime){
  4178. let dateArray = stime.split("-");
  4179. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4180. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4181. let stimewk = this.weekDay[date.getDay()]
  4182. 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')
  4183. 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])
  4184. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4185. let stime_ts = new Date(stime).getTime();
  4186. let next_date = stime_ts + (24*60*60*1000);
  4187. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4188. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4189. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4190. stime = next_dates_y+next_dates_m+next_dates_d;
  4191. i++;
  4192. }
  4193. return diffdate
  4194. },
  4195. getAutoWeekDate(e) {
  4196. let dateString = e;
  4197. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4198. if (dateString.match(dateStringReg)) {
  4199. let presentDate = new Date(dateString),
  4200. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4201. return Array.from(new Array(7), function (val, index) {
  4202. let formatDate = new Date(
  4203. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4204. );
  4205. return (
  4206. formatDate.getFullYear() +
  4207. "-" +
  4208. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4209. "-" +
  4210. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4211. );
  4212. });
  4213. } else {
  4214. throw new Error(
  4215. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4216. );
  4217. }
  4218. },
  4219. onProgressChange() {
  4220. this.$forceUpdate();
  4221. },
  4222. showChooseMembTree() {
  4223. this.chosenMembCount = this.participator.length;
  4224. this.chooseParticipVisible = true;
  4225. },
  4226. onTreeItemChange() {
  4227. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4228. var list = chosenList.filter(item=>item.isUser == 1);
  4229. this.chosenMembCount = list.length;
  4230. },
  4231. findUserInTree() {
  4232. if (this.filterName == '') {
  4233. this.deptMembData = this.allMembData;
  4234. } else {
  4235. var list = this.findRecursively(this.filterName, this.allMembData);
  4236. this.deptMembData = list;
  4237. }
  4238. },
  4239. findRecursively(username, list) {
  4240. var filterList = [];
  4241. for (var i=0;i<list.length; i++) {
  4242. if (list[i].isUser == 1) {
  4243. if (list[i].label.indexOf(username) >= 0) {
  4244. //匹配上了
  4245. filterList.push(list[i]);
  4246. }
  4247. } else if (list[i].children != null && list[i].children.length > 0) {
  4248. var subList = this.findRecursively(username, list[i].children);
  4249. if (subList.length > 0) {
  4250. subList.forEach(s=>filterList.push(s));
  4251. }
  4252. }
  4253. }
  4254. return filterList;
  4255. },
  4256. //确定选择参与人
  4257. chooseParticip() {
  4258. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4259. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4260. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4261. if (this.user.company.packageProject == 1) {
  4262. if (this.chosenMembList.length > 1) {
  4263. this.$message({
  4264. message: '每次仅支持代填一个人',
  4265. type: "error",
  4266. });
  4267. return;
  4268. }
  4269. }
  4270. this.chooseParticipVisible = false;
  4271. this.workForm.userNames = '';
  4272. this.workForm.userId = [];
  4273. this.participator = [];
  4274. for (var i=0;i<this.chosenMembList.length; i++) {
  4275. this.workForm.userId.push(this.chosenMembList[i].id);
  4276. this.workForm.userNames += this.chosenMembList[i].label+',';
  4277. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4278. this.participator.push(item);
  4279. }
  4280. if (this.workForm.userNames.length > 0) {
  4281. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4282. }
  4283. if(this.user.userNameNeedTranslate == 1) {
  4284. if(this.workForm.userNames) {
  4285. this.workForm.userNames = this.workForm.userNames.split(',')
  4286. }
  4287. }
  4288. },
  4289. notifySel(sel){
  4290. // console.log(sel);
  4291. this.notifySelList = sel
  4292. },
  4293. //微信通知人员填写
  4294. Notify(code) {
  4295. if (this.notifySelList.length == 0) return;
  4296. var ids = '';
  4297. this.notifySelList.forEach(f=>{
  4298. ids += f.id+',';
  4299. })
  4300. this.http.post('/user/pushFillReport',{
  4301. ids: ids, date: this.curDate,
  4302. code: code
  4303. },
  4304. res => {
  4305. if (res.code == "ok") {
  4306. this.$message({
  4307. message: this.$t('message.sentSuccessfully'),
  4308. type: "success"
  4309. });
  4310. }
  4311. },
  4312. error => {
  4313. this.$message({
  4314. message: error,
  4315. type: "error"
  4316. });
  4317. }
  4318. );
  4319. },
  4320. //导出人员列表
  4321. exportMemb() {
  4322. if (this.fillMembList.length == 0) return;
  4323. var ids = '';
  4324. this.fillMembList.forEach(f=>{
  4325. ids += f.id+',';
  4326. })
  4327. this.http.post('/user/exportMembList',{
  4328. ids: ids,isFill: this.isFill, date: this.curDate
  4329. },
  4330. res => {
  4331. if (res.code == "ok") {
  4332. var aTag = document.createElement('a');
  4333. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4334. aTag.href = res.data;
  4335. aTag.click();
  4336. }
  4337. },
  4338. error => {
  4339. this.$message({
  4340. message: error,
  4341. type: "error"
  4342. });
  4343. }
  4344. );
  4345. },
  4346. showMembList(fill) {
  4347. this.membListVisible = true;
  4348. if (fill == 0) {
  4349. this.fillMembList = this.unFillList;
  4350. this.isFill = false;
  4351. let leaveList = []
  4352. let unleaveList = []
  4353. for(let i in this.fillMembList){
  4354. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4355. leaveList.push(this.fillMembList[i])
  4356. }else{
  4357. unleaveList.push(this.fillMembList[i])
  4358. }
  4359. }
  4360. this.fillMembList = unleaveList
  4361. this.fillMembList_leave = leaveList
  4362. } else if(fill == 1){
  4363. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4364. this.isFill = true;
  4365. }else{
  4366. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4367. this.isFill = true;
  4368. }
  4369. },
  4370. //获取自己填写的日报状态
  4371. getReportFillStatus() {
  4372. this.http.post('/report/getReportFillStatus',{
  4373. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4374. },
  4375. res => {
  4376. if (res.code == "ok") {
  4377. this.fillStatusList = res.data;
  4378. this.allDate.forEach(d=>{
  4379. var fillInfo = null;
  4380. d.state = null;
  4381. this.fillStatusList.forEach(s=>{
  4382. var d1 = s.createDate.split('-')[2];
  4383. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4384. if (d1.indexOf('0') == 0) {
  4385. d1 = d1.substring(1,d1.length);
  4386. }
  4387. if (d1 == d2) {
  4388. d.state = s.state;
  4389. d.missReport = s.missReport;//是否漏填
  4390. d.exceedCardTime = s.exceedCardTime
  4391. }
  4392. })
  4393. })
  4394. this.$forceUpdate();
  4395. }
  4396. },
  4397. error => {
  4398. this.$message({
  4399. message: error,
  4400. type: "error"
  4401. });
  4402. }
  4403. );
  4404. },
  4405. scrollFunction () {
  4406. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4407. if (this.domObj.attachEvent) { // IE
  4408. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4409. } else if (this.domObj.addEventListener) {
  4410. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4411. }
  4412. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4413. },
  4414. mouseScroll(event) { // google 浏览器下
  4415. let detail = event.wheelDelta || event.detail
  4416. let moveForwardStep = -1
  4417. let moveBackStep = 1
  4418. let step = 0
  4419. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4420. event.preventDefault() // 阻止浏览器默认事件
  4421. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4422. },
  4423. // //左右滚动
  4424. // wheel(e){
  4425. // var a = document.getElementById("dateScroll");
  4426. // var scroll_width = 80; //滚动一下的距离
  4427. // var e = e || window.event, v;
  4428. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4429. // if(v>3||-v>3) v=-v;
  4430. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4431. // e.preventDefault(); //阻止浏览器的默认滚动
  4432. // },
  4433. showExportDialog() {
  4434. this.exportType = 0
  4435. this.exportDialog = true;
  4436. },
  4437. showExportTimeDialog() {
  4438. this.exportTimeDialog = true;
  4439. },
  4440. changeAllTime() {
  4441. //总时长发生改变,自动按比例计算
  4442. this.workForm.domains.forEach(d=>{
  4443. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4444. });
  4445. //计算jsTime
  4446. if (this.workForm.createDate) {
  4447. let sdate = new Date(this.workForm.createDate[0]);
  4448. let edate = new Date(this.workForm.createDate[1]);
  4449. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4450. console.log('days===', days)
  4451. if (days < 0) {
  4452. days = 0;
  4453. }
  4454. this.jsTime = this.reportTimeType.allday * days;
  4455. }
  4456. },
  4457. // 是否加班的单机事件
  4458. check() {
  4459. this.selected = !this.selected
  4460. this.isNew = this.selected
  4461. },
  4462. updateSubProject() {
  4463. this.$forceUpdate();
  4464. },
  4465. selectDegreeId(domain, index) {
  4466. this.http.post('/report/defaultDegree',{
  4467. projectId: domain.projectId
  4468. },
  4469. res => {
  4470. if (res.code == "ok") {
  4471. if(res.data) {
  4472. this.workForm.domains[index].degreeId = res.data.id + ''
  4473. this.$forceUpdate();
  4474. }
  4475. }
  4476. },
  4477. error => {
  4478. this.$message({
  4479. message: error,
  4480. type: "error"
  4481. });
  4482. }
  4483. );
  4484. },
  4485. //项目选中了, 加载子项目
  4486. selectProject(domain, index) {
  4487. if(!domain.projectId){
  4488. return;
  4489. }
  4490. // 默认选中上次填写的自定义维度
  4491. if(this.yonghuUser.customDegreeActive == 1) {
  4492. this.selectDegreeId(domain, index)
  4493. }
  4494. // console.log('projectId===',domain.projectId);
  4495. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4496. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4497. this.http.post('/sub-project/list',{
  4498. projectId: domain.projectId,
  4499. isReport: true
  4500. },
  4501. res => {
  4502. //清空之前选中的子项目
  4503. // this.workForm.domains[index].subProjectId = 0;
  4504. if (res.code == "ok") {
  4505. this.workForm.domains[index].subProjectList = res.data;
  4506. this.workForm.domains[index].subProjectId = null;
  4507. this.$forceUpdate();
  4508. }
  4509. },
  4510. error => {
  4511. this.$message({
  4512. message: error,
  4513. type: "error"
  4514. });
  4515. }
  4516. );
  4517. //项目相关的近期任务
  4518. if (this.user.company.packageProject == 1) {
  4519. this.getRecentTaskList(domain, index);
  4520. //获取项目相关专业
  4521. if (this.user.company.packageEngineering == 1) {
  4522. this.getProjectProfessions(domain, index);
  4523. }
  4524. //获取项目下的任务分组
  4525. this.getTaskGroups(domain, index);
  4526. }
  4527. // 获取项目相关的维度
  4528. // domain.degreeId = null
  4529. this.$set(domain,'degreeId',null)
  4530. this.$set(domain,'multiDegrIdArray',null)
  4531. this.dimension(domain, index);
  4532. //获取项目审核人
  4533. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4534. this.getProjectAuditorList(domain, index);
  4535. } else {
  4536. //按分组的负责人来审核
  4537. domain.projectAuditorId = null;
  4538. domain.projectAuditorName = null;
  4539. domain.auditUserList = null;
  4540. }
  4541. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4542. if (this.reportTimeType.type == 3) {
  4543. //新增项目时,自动计算
  4544. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4545. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4546. }
  4547. //加载昱众的工作职责
  4548. if (this.user.companyId == this.yuzhongCompId) {
  4549. this.updateResponse(domain);
  4550. }
  4551. },
  4552. getRecentTaskList(domain, index) {
  4553. //刷新任务时,清空服务
  4554. this.$set(domain, 'sapServiceId', null);
  4555. this.$set(domain, 'taskId', null);
  4556. var param = {
  4557. projectId: domain.projectId,
  4558. isSubstitude:this.isSubstitude?1:0,
  4559. };
  4560. if (domain.groupId) {
  4561. param.groupId = domain.groupId;
  4562. }
  4563. if (domain.stage) {
  4564. param.stage = domain.stage;
  4565. }
  4566. //专业版代填,获取代填员工的任务
  4567. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4568. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4569. this.$message({
  4570. message: '请选择代填的员工',
  4571. type: "error"
  4572. });
  4573. return;
  4574. } else {
  4575. param.userId = this.workForm.userId[0];
  4576. }
  4577. }
  4578. this.http.post('/task/getRecentTask',param,
  4579. res => {
  4580. if (res.code == "ok") {
  4581. this.workForm.domains[index].allTaskList = res.data;
  4582. this.workForm.domains[index].taskList = res.data;
  4583. this.$forceUpdate();
  4584. }
  4585. },
  4586. error => {
  4587. this.$message({
  4588. message: error,
  4589. type: "error"
  4590. });
  4591. }
  4592. );
  4593. },
  4594. //获取项目审核人
  4595. getProjectAuditorList(domainItem, index) {
  4596. if(domainItem.projectId == '') {
  4597. return
  4598. }
  4599. domainItem.projectAuditorId = null;
  4600. domainItem.projectAuditorName = null;
  4601. this.http.post('/project-auditor/getList',{
  4602. projectId: domainItem.projectId,
  4603. },
  4604. res => {
  4605. if (res.code == "ok") {
  4606. domainItem.auditUserList = res.data;
  4607. if (res.data.length==0) {
  4608. this.$message({
  4609. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4610. type: "error"
  4611. });
  4612. } else if (res.data.length==1) {
  4613. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4614. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4615. }
  4616. this.$forceUpdate();
  4617. }
  4618. },
  4619. error => {
  4620. this.$message({
  4621. message: error,
  4622. type: "error"
  4623. });
  4624. }
  4625. );
  4626. },
  4627. // 获取维度数据
  4628. dimension(domain, index) {
  4629. if(domain.projectId == '') {
  4630. return
  4631. }
  4632. this.http.post('/project/getDegreeList',{
  4633. projectId: domain.projectId,
  4634. },
  4635. res => {
  4636. if (res.code == "ok") {
  4637. // console.log("维度数据",res.data);
  4638. this.workForm.domains[index].wuduList = res.data
  4639. // this.workForm = this.workForm
  4640. this.$forceUpdate()
  4641. }
  4642. },
  4643. error => {
  4644. this.$message({
  4645. message: error,
  4646. type: "error"
  4647. });
  4648. }
  4649. );
  4650. },
  4651. //切换任务阶段
  4652. changeStages(domain, index) {
  4653. if (domain.stage == null || domain.stage == '') {
  4654. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4655. } else {
  4656. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4657. }
  4658. this.getRecentTaskList(domain, index);
  4659. this.$forceUpdate();
  4660. },
  4661. getGroupStages(domain, index, keepStage) {
  4662. // console.log(domain);
  4663. if(!domain.groupId){
  4664. domain.projectAuditorId = ''
  4665. domain.stages = []
  4666. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4667. domain.taskId = ''
  4668. domain.sapServiceId = ''
  4669. }
  4670. if(this.user.timeType.reportAuditType >= 1){
  4671. domain.auditUserList = []
  4672. }
  4673. this.$forceUpdate();
  4674. return
  4675. }
  4676. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4677. res => {
  4678. if (res.code == "ok") {
  4679. if (!keepStage) {
  4680. domain.stage = '';
  4681. }
  4682. domain.stages = res.data;
  4683. this.getRecentTaskList(domain, index);
  4684. this.$forceUpdate();
  4685. }
  4686. },
  4687. error => {
  4688. this.$message({
  4689. message: error,
  4690. type: "error"
  4691. });
  4692. });
  4693. //检查当前的项目是否需要获取分组的负责人
  4694. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4695. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4696. res => {
  4697. if (res.code == "ok") {
  4698. domain.getProjectAuditorList = res.data;
  4699. domain.auditUserList = res.data;
  4700. if (res.data.length==1) {
  4701. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4702. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4703. } else if (res.data.length==0) {
  4704. domain.projectAuditorId = null;
  4705. domain.projectAuditorName = null;
  4706. }
  4707. this.$forceUpdate();
  4708. }
  4709. },
  4710. error => {
  4711. this.$message({
  4712. message: error,
  4713. type: "error"
  4714. });
  4715. });
  4716. }
  4717. },
  4718. getProjectProfessions(domain, index) {
  4719. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4720. res => {
  4721. if (res.code == "ok") {
  4722. this.workForm.domains[index].professionProgress = res.data;
  4723. this.$forceUpdate();
  4724. }
  4725. },
  4726. error => {
  4727. this.$message({
  4728. message: error,
  4729. type: "error"
  4730. });
  4731. });
  4732. },
  4733. //删除自己的日报
  4734. deleteReport() {
  4735. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4736. confirmButtonText: this.$t('btn.determine'),
  4737. cancelButtonText: this.$t('btn.cancel'),
  4738. type: "warning"
  4739. })
  4740. .then(() => {
  4741. this.listLoading = true;
  4742. this.http.post('/report/delete',{
  4743. userId: this.user.id,
  4744. date: this.workForm.createDate
  4745. },
  4746. res => {
  4747. this.listLoading = false;
  4748. if (res.code == "ok") {
  4749. this.$message({
  4750. message: this.$t('message.successfullyDeleted'),
  4751. type: "success"
  4752. });
  4753. this.getReportList();
  4754. this.getDepartment();
  4755. this.dialogVisible = false;
  4756. } else {
  4757. this.$message({
  4758. message: res.msg,
  4759. type: "error"
  4760. });
  4761. }
  4762. },
  4763. error => {
  4764. this.listLoading = false;
  4765. this.$message({
  4766. message: error,
  4767. type: "error"
  4768. });
  4769. }
  4770. );
  4771. })
  4772. .catch(() => {});
  4773. },
  4774. // 管理员删除日报
  4775. guanli(item) {
  4776. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4777. let param = {date: this.date + day, userId: item.id};
  4778. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4779. confirmButtonText: this.$t('btn.determine'),
  4780. cancelButtonText: this.$t('btn.cancel'),
  4781. type: "warning"
  4782. })
  4783. .then(() => {
  4784. this.listLoading = true;
  4785. this.http.post('/report/delete',param,
  4786. res => {
  4787. this.listLoading = false;
  4788. if (res.code == "ok") {
  4789. this.$message({
  4790. message: this.$t('message.successfullyDeleted'),
  4791. type: "success"
  4792. });
  4793. this.getReportList();
  4794. this.getDepartment();
  4795. this.dialogVisible = false;
  4796. } else {
  4797. this.$message({
  4798. message: res.msg,
  4799. type: "error"
  4800. });
  4801. }
  4802. },
  4803. error => {
  4804. this.listLoading = false;
  4805. this.$message({
  4806. message: error,
  4807. type: "error"
  4808. });
  4809. }
  4810. );
  4811. })
  4812. .catch(() => {});
  4813. },
  4814. selectAll() {
  4815. if (this.isAllSelect) {
  4816. var keys = [];
  4817. this.reportNames.forEach(b=>{
  4818. keys.push(b.id);
  4819. })
  4820. this.$refs.approveTree.setCheckedKeys(keys);
  4821. } else {
  4822. this.$refs.approveTree.setCheckedKeys([]);
  4823. }
  4824. },
  4825. removeEmptyNode(list) {
  4826. for (var i=0;i<list.length;i++) {
  4827. var cnt = 0;
  4828. if (list[i].membCount == 0) {
  4829. list.splice(i, 1);
  4830. i--;
  4831. } else if (list[i].children != null) {
  4832. this.removeEmptyNode(list[i].children);
  4833. }
  4834. }
  4835. },
  4836. calculateMembCount(list) {
  4837. for (var i in list) {
  4838. var cnt = 0;
  4839. if (list[i].children != null) {
  4840. this.calculateMembCount(list[i].children);
  4841. for (var m in list[i].children) {
  4842. cnt += list[i].children[m].membCount;
  4843. }
  4844. }
  4845. if (list[i].isUser == 1) {
  4846. cnt++;
  4847. this.membCount++;
  4848. }
  4849. list[i].membCount = cnt;
  4850. }
  4851. },
  4852. stateChange() {
  4853. // console.log(this.allData,'alldate');
  4854. this.membCount = 0;
  4855. if (this.selectState == -1) {
  4856. //全部状态
  4857. this.data = this.allData;
  4858. } else {
  4859. //未填报
  4860. this.seluserText = ''
  4861. var newData = JSON.parse(JSON.stringify(this.allData));
  4862. this.filterState(this.selectState, newData);
  4863. this.data = newData;
  4864. }
  4865. this.calculateMembCount(this.data);
  4866. this.data[0].membCount = this.membCount;//总人数
  4867. },
  4868. //按状态过滤部门人员
  4869. filterState(state, list) {
  4870. for (var i =0;i<list.length; i++) {
  4871. var obj = list[i];
  4872. if (obj.isUser == 1) {
  4873. var match = false;
  4874. if (state == -2) {
  4875. if (obj.state == null) {
  4876. match = true;
  4877. }
  4878. } else {
  4879. if (obj.state == state) {
  4880. match = true;
  4881. }
  4882. }
  4883. if (!match) {
  4884. list.splice(i, 1);
  4885. i--;
  4886. } else {
  4887. }
  4888. } else {
  4889. if (obj.children != null) {
  4890. this.filterState(state, obj.children);
  4891. }
  4892. }
  4893. }
  4894. },
  4895. //a按名称过滤部门人员
  4896. async seluserforText(){
  4897. const { userNameNeedTranslate } = this.user
  4898. this.membCount = 0;
  4899. var newData = JSON.parse(JSON.stringify(this.allData));
  4900. let textList = [this.seluserText]
  4901. if(userNameNeedTranslate == 1) {
  4902. this.dataLoading = true
  4903. let res = await this.postData('/user/getEmployeeList', {
  4904. keyword: this.seluserText,
  4905. cursor: '',
  4906. departmentId: -1,
  4907. pageIndex: 1,
  4908. pageSize: 1000
  4909. })
  4910. textList = res.data.records.map(item => item.name)
  4911. this.dataLoading = false
  4912. }
  4913. // return
  4914. console.log(textList, '<=== textList')
  4915. this.seluserforTextin(this.seluserText, newData, textList)
  4916. console.log(newData, 'Data')
  4917. this.data = newData;
  4918. this.calculateMembCount(this.data);
  4919. this.data[0].membCount = this.membCount;//总人数
  4920. },
  4921. seluserforTextin(text, list, textList = []){
  4922. for (var i =0;i<list.length; i++) {
  4923. var obj = list[i];
  4924. if (obj.isUser == 1) {
  4925. var match = false;
  4926. // if (obj.label.indexOf(text) != -1) {
  4927. // match = true
  4928. // }
  4929. if(textList.some(item => item.includes(obj.label))) {
  4930. match = true
  4931. }
  4932. if (!match) {
  4933. list.splice(i, 1);
  4934. i--;
  4935. } else {
  4936. }
  4937. } else {
  4938. if (obj.children != null) {
  4939. this.seluserforTextin(text, obj.children, textList);
  4940. }
  4941. }
  4942. }
  4943. },
  4944. // 当节点发生变化时
  4945. nodeChangeExpand(data) {
  4946. // 保存当前展开的节点
  4947. let flag = false
  4948. this.nodeModelData.some(item => {
  4949. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4950. flag = true
  4951. return true
  4952. }
  4953. })
  4954. if (!flag) { // 不存在则存到数组里
  4955. this.nodeModelData.push(data.id)
  4956. }
  4957. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4958. },
  4959. nodeChangeCollapse(data) {
  4960. console.log(this.nodeModelData)
  4961. this.nodeModelData.some((item, i) => {
  4962. if (item === data.id) {
  4963. this.nodeModelData.length = i
  4964. }
  4965. })
  4966. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4967. },
  4968. // 部门列表点击
  4969. handleNodeClick(data) {
  4970. // this.dealList = data
  4971. this.theValues(data.id, this.allData)
  4972. // this.depData = data;
  4973. var list = [];
  4974. if (data.id == -1) {
  4975. this.deptId = null;
  4976. this.targetUid = null;
  4977. list = this.data;
  4978. } else if (data.isUser == 1) {
  4979. this.deptId = null;
  4980. this.targetUid = data.id;
  4981. } else {
  4982. this.deptId = data.id;
  4983. this.targetUid = null;
  4984. list.push(data);
  4985. }
  4986. this.getReportList();
  4987. if (list.length > 0) {
  4988. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4989. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4990. }
  4991. },
  4992. exportPushLog(){
  4993. this.http.post('/sap-sync-log/export',{},
  4994. res => {
  4995. if (res.code == "ok") {
  4996. var filePath = res.data;
  4997. var fName = '推送日志.xlsx'
  4998. const a = document.createElement('a'); // 创建a标签
  4999. a.setAttribute('download', fName);// download属性
  5000. a.setAttribute('href', filePath);// href链接
  5001. a.click(); //自执行点击事件
  5002. a.remove();
  5003. } else {
  5004. this.$message({
  5005. message: res.msg,
  5006. type: "error"
  5007. });
  5008. }
  5009. },
  5010. error => {
  5011. this.$message({
  5012. message: error,
  5013. type: "error"
  5014. });
  5015. });
  5016. },
  5017. theValues(id, item) {
  5018. for(var i in item) {
  5019. if(item[i].id == id) {
  5020. this.depData = item[i]
  5021. if(id == '-1') {
  5022. this.translation = '1'
  5023. } else {
  5024. if(item[i].children) {
  5025. this.translation = '2'
  5026. } else {
  5027. this.translation = '3'
  5028. }
  5029. }
  5030. return
  5031. } else {
  5032. if(item[i].children) {
  5033. this.theValues(id, item[i].children)
  5034. }
  5035. }
  5036. }
  5037. },
  5038. //获取可以选择的代填的人员列表
  5039. getSubstitudeUserDeptList() {
  5040. if (this.deptMembData.length == 0) {
  5041. this.http.post("/department/listMyMembs", {},
  5042. res => {
  5043. if (res.code == "ok") {
  5044. let noAllData = JSON.parse(JSON.stringify(res.data));
  5045. if (noAllData.length > 0) {
  5046. // if (noAllData[0].label == '全部人员') {
  5047. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5048. noAllData.splice(0,1);
  5049. }
  5050. }
  5051. this.setUserToDept(noAllData);
  5052. this.deptMembData = noAllData;
  5053. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5054. console.log(this.deptMembData, '代填人员数据')
  5055. } else {
  5056. this.$message({
  5057. message: res.msg,
  5058. type: "error"
  5059. });
  5060. }
  5061. },
  5062. error => {
  5063. this.$message({
  5064. message: error,
  5065. type: "error"
  5066. });
  5067. });
  5068. }
  5069. },
  5070. // 获取部门列表
  5071. getDepartmentForApprove() {
  5072. this.http.post( this.port.manage.depList, {},
  5073. res => {
  5074. if (res.code == "ok") {
  5075. var list1 = JSON.parse(JSON.stringify(res.data));
  5076. this.deptOptionList = this.changeArr(list1);
  5077. console.log(this.deptOptionList, '部门')
  5078. } else {
  5079. this.$message({
  5080. message: res.msg,
  5081. type: "error"
  5082. });
  5083. }
  5084. },
  5085. error => {
  5086. this.$message({
  5087. message: error,
  5088. type: "error"
  5089. });
  5090. });
  5091. },
  5092. // 获取部门列表
  5093. getDepartment() {
  5094. //如果没有权限,就不需要获取
  5095. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5096. return;
  5097. }
  5098. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5099. var param = {date:this.date + day};
  5100. this.http.post("/report/getMembList", param,
  5101. res => {
  5102. if (res.code == "ok") {
  5103. if(res.data.length == 0){
  5104. return
  5105. }
  5106. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5107. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5108. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5109. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5110. // if (this.user.role > 0) {
  5111. // }
  5112. list.splice(0,0,{
  5113. id: -1,
  5114. label: this.$t('lable.allStaff'),
  5115. })
  5116. this.membCount = 0;
  5117. //设置员工到部门下面
  5118. this.setUserToDept(list);
  5119. this.data = list;
  5120. // console.log('data',this.data);
  5121. this.expandDate = [this.data[1].id]
  5122. this.allData = list;
  5123. // if (noAllData.length > 0) {
  5124. // if (noAllData[0].label == '全部人员') {
  5125. // noAllData.splice(0,1);
  5126. // }
  5127. // }
  5128. // this.setUserToDept(noAllData);
  5129. // this.deptMembData = noAllData;
  5130. this.option = this.changeArr(list1);
  5131. list[0].membCount = this.membCount;
  5132. if (this.depData.id == -1) {
  5133. this.depData.membCount = this.membCount;
  5134. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5135. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5136. } else {
  5137. if (this.depData.isUser == null) {
  5138. var dep = this.findTargetDept(this.data, this.depData.id);
  5139. var membDeptList = [];
  5140. membDeptList.push(dep);
  5141. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5142. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5143. }
  5144. }
  5145. if (this.depData.isUser == null) {
  5146. if (this.isFill) {
  5147. this.fillMembList = this.fillList;
  5148. } else {
  5149. this.fillMembList = this.unFillList;
  5150. }
  5151. }
  5152. this.leaveAllNum = 0
  5153. for(let i in this.unFillList){
  5154. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5155. this.leaveAllNum += 1
  5156. }
  5157. }
  5158. this.stateChange()
  5159. } else {
  5160. this.$message({
  5161. message: res.msg,
  5162. type: "error"
  5163. });
  5164. }
  5165. },
  5166. error => {
  5167. this.$message({
  5168. message: error,
  5169. type: "error"
  5170. });
  5171. });
  5172. this.getReportFillStatus();
  5173. },
  5174. findTargetDept(list, deptId) {
  5175. var t = null;
  5176. for (var i=0;i<list.length; i++) {
  5177. if (list[i].isUser == null && list[i].id == deptId) {
  5178. t = list[i];
  5179. break;
  5180. }
  5181. }
  5182. if (t == null) {
  5183. for (var i=0;i<list.length; i++) {
  5184. if (list[i].children != null && list[i].children.length > 0) {
  5185. t = this.findTargetDept(list[i].children, deptId);
  5186. if (t != null) {
  5187. break;
  5188. }
  5189. }
  5190. }
  5191. }
  5192. return t;
  5193. },
  5194. getUserMembListFromDeptList(list, isFill) {
  5195. var membList = [];
  5196. for (var i in list) {
  5197. var deptName = list[i].label;
  5198. if (list[i].userList != null) {
  5199. list[i].userList.forEach(element => {
  5200. if (isFill == 0) {
  5201. //获取未填的
  5202. if (element.state == null) {
  5203. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5204. membList.push(obj);
  5205. }
  5206. } else {
  5207. if (element.state != null) {
  5208. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5209. membList.push(obj);
  5210. }
  5211. }
  5212. });
  5213. }
  5214. if (list[i].children != null) {
  5215. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5216. }
  5217. }
  5218. return membList;
  5219. },
  5220. setUserToDept(list) {
  5221. for (var i in list) {
  5222. var cnt = 0;
  5223. if (list[i].children != null) {
  5224. this.setUserToDept(list[i].children);
  5225. for (var m in list[i].children) {
  5226. cnt += list[i].children[m].membCount;
  5227. }
  5228. }
  5229. if (list[i].userList != null) {
  5230. if (list[i].children == null) {
  5231. list[i].children = [];
  5232. }
  5233. list[i].userList.forEach(element => {
  5234. var obj = {
  5235. id: element.id,
  5236. label:element.name,
  5237. state:element.state,
  5238. parentId:element.departmentId,
  5239. isUser:1,
  5240. workingTime: element.workingTime,
  5241. leaveDays: element.leaveDays,
  5242. leaveTimes: element.leaveTimes
  5243. };
  5244. list[i].children.push(obj);
  5245. this.membCount++;
  5246. cnt++;
  5247. });
  5248. }
  5249. list[i].membCount = cnt;
  5250. }
  5251. },
  5252. // 修改数组
  5253. changeArr(arr) {
  5254. for (var i = 0; i < arr.length; i++) {
  5255. if(arr[i].id != -1 && arr[i].id != 0) {
  5256. if (arr[i].children != null && arr[i].children.length>0) {
  5257. arr[i].children = this.changeArr(arr[i].children);
  5258. }
  5259. arr[i].id && (arr[i].value = arr[i].id);
  5260. delete arr[i].id;
  5261. }
  5262. }
  5263. for(var i in arr) {
  5264. if(arr[i].id == -1 || arr[i].id == 0) {
  5265. arr.splice(i,1)
  5266. }
  5267. }
  5268. return arr;
  5269. },
  5270. //时间段范围设置改动,监听
  5271. onTimeTypeChange(timeType) {
  5272. this.seleChn(1)
  5273. this.showAddMore = true;
  5274. for(var i in this.workForm.domains) {
  5275. if (this.workForm.domains[i].timeType == 0) {
  5276. this.showAddMore = false;
  5277. break;
  5278. }
  5279. }
  5280. if (this.showAddMore) {
  5281. //检测数量
  5282. if (this.workForm.domains.length == 2) {
  5283. this.showAddMore = false;
  5284. } else {
  5285. this.showAddMore = true;
  5286. }
  5287. }
  5288. },
  5289. getTimeType() {
  5290. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5291. res => {
  5292. if (res.code == "ok") {
  5293. var t = res.data;
  5294. this.reportTimeType = t;
  5295. if (this.reportTimeType.type > 0) {
  5296. this.showAddMore = true;
  5297. }
  5298. //转化时间格式
  5299. if (t.allday != null) {
  5300. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5301. }
  5302. if (t.am != null) {
  5303. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5304. }
  5305. if (t.pm != null) {
  5306. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5307. }
  5308. let arr = []
  5309. for(var i in res.data.excludeTimeList) {
  5310. let obj = {
  5311. s: res.data.excludeTimeList[i].startTime,
  5312. e: res.data.excludeTimeList[i].endTime,
  5313. }
  5314. arr.push(obj)
  5315. }
  5316. this.vacationTime = arr
  5317. } else {
  5318. this.$message({
  5319. message: res.msg,
  5320. type: "error"
  5321. });
  5322. }
  5323. },
  5324. error => {
  5325. this.listLoading = false;
  5326. this.$message({
  5327. message: error,
  5328. type: "error"
  5329. });
  5330. });
  5331. },
  5332. // 改变月份 -------
  5333. changeMonthOut() {
  5334. this.getAllDate();
  5335. this.getReportList();
  5336. this.getDepartment();
  5337. },
  5338. // 选择日期
  5339. choseDate(i, item) {
  5340. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5341. return
  5342. }
  5343. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5344. this.choseDay = i;
  5345. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5346. sessionStorage.msg = this.date + day,
  5347. this.getReportList();
  5348. this.getDepartment();
  5349. this.curDate = item.date;
  5350. },
  5351. canClick(i, item){
  5352. let nowDate = new Date()
  5353. let nowDateYear = nowDate.getFullYear()
  5354. let itemYear = parseInt(this.date.split('-')[0])
  5355. let nowDateMonth = nowDate.getMonth() + 1
  5356. let itemMonth = parseInt(this.date.split('-')[1])
  5357. let nowDateDay = nowDate.getDate()
  5358. let itemDay = parseInt(item.showDate.split('.')[1])
  5359. if(nowDateYear < itemYear){
  5360. return false
  5361. }else if(nowDateYear == itemYear){
  5362. if(nowDateMonth < itemMonth){
  5363. return false
  5364. }else if(nowDateMonth == itemMonth){
  5365. if(nowDateDay < itemDay){
  5366. return false
  5367. }
  5368. }
  5369. }
  5370. },
  5371. // 获取日期列表
  5372. getAllDate(e) {
  5373. var dayArry = [];
  5374. var day = this.getCountDays();
  5375. let curMonthDay = null;
  5376. for (var k = 1; k <= day; k++) {
  5377. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5378. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5379. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5380. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5381. if(sessionStorage.msg) {
  5382. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5383. this.choseDay = k - 1;
  5384. curMonthDay = str;
  5385. }
  5386. } else {
  5387. if (new Date().getDate() == k) {
  5388. this.choseDay = k - 1;
  5389. }
  5390. }
  5391. } else {
  5392. this.choseDay = 0;
  5393. }
  5394. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5395. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5396. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5397. }
  5398. this.allDate = dayArry;
  5399. //不能超过最大日期
  5400. if (this.choseDay > day-1) {
  5401. this.choseDay = day-1;
  5402. }
  5403. if(sessionStorage.from != 1){
  5404. let nowmonth = new Date().getMonth() + 1
  5405. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5406. let nowdate = new Date().getDate()
  5407. if(nowd == this.date){
  5408. if(e && sessionStorage.msg){
  5409. }else{
  5410. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5411. }
  5412. let nowday = new Date(sessionStorage.msg).getDate()
  5413. this.choseDay = nowday - 1
  5414. let monthdate = new Date(sessionStorage.msg)
  5415. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5416. }else{
  5417. if(e && sessionStorage.msg){
  5418. }else{
  5419. sessionStorage.msg = this.date + '-01'
  5420. }
  5421. let monthdate = new Date(sessionStorage.msg)
  5422. this.choseDay = monthdate.getDate() - 1
  5423. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5424. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5425. }
  5426. }else{
  5427. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5428. }
  5429. //从消息点击跳转过来的,直接加载指定日期
  5430. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5431. this.curDate = sessionStorage.msg;
  5432. sessionStorage.from = 0;
  5433. } else {
  5434. // if (curMonthDay != null) {
  5435. // // this.curDate = curMonthDay;
  5436. // let d = new Date(sessionStorage.msg)
  5437. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5438. // } else {
  5439. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5440. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5441. // }
  5442. }
  5443. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5444. // if(!sessionStorage.msg){
  5445. // let msgday = this.choseDay + 1
  5446. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5447. // }
  5448. this.getReportFillStatus();
  5449. },
  5450. getCountDays() {
  5451. var newstr = this.date.replace(/-/g, "/");
  5452. var curDate = new Date(newstr+'/01');
  5453. var curMonth = curDate.getMonth();
  5454. curDate.setMonth(curMonth + 1);
  5455. curDate.setDate(0);
  5456. return curDate.getDate();
  5457. },
  5458. reqMore() {
  5459. if (this.hasMore) {
  5460. this.pageIndex++;
  5461. this.requestHttpReports();
  5462. }
  5463. },
  5464. //加载日报数据
  5465. requestHttpReports() {
  5466. //请求数据
  5467. this.listLoading = true;
  5468. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5469. let param = {date: this.date + day};
  5470. if (this.deptId) {
  5471. param.deptId = this.deptId;
  5472. }
  5473. if (this.targetUid) {
  5474. param.userId = this.targetUid;
  5475. }
  5476. //传页码
  5477. if (this.hasMore) {
  5478. param.pageIndex = this.pageIndex;
  5479. }
  5480. this.http.post( this.port.report.list, param,
  5481. res => {
  5482. this.listLoading = false;
  5483. if (res.code == "ok") {
  5484. //扩增
  5485. if (res.data.data.length > 0) {
  5486. this.reportList = this.reportList.concat(res.data.data);
  5487. } else if (this.pageIndex > 1){
  5488. this.$message({
  5489. message: '没有更多数据了',
  5490. type: "info"
  5491. });
  5492. }
  5493. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5494. if(document.querySelector("#day"+this.choseDay)){
  5495. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5496. }
  5497. } else {
  5498. this.$message({
  5499. message: res.msg,
  5500. type: "error"
  5501. });
  5502. }
  5503. },
  5504. error => {
  5505. this.listLoading = false;
  5506. this.$message({
  5507. message: error,
  5508. type: "error"
  5509. });
  5510. });
  5511. },
  5512. //获取日报列表
  5513. getReportList() {
  5514. //初始化,重置数据
  5515. this.pageIndex = 0;
  5516. this.hasMore = true;
  5517. this.reportList = [];
  5518. this.requestHttpReports();
  5519. },
  5520. //刷新日报状态,用于审核后更新
  5521. refreshReportData(reportId) {
  5522. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5523. res => {
  5524. if (res.code == "ok") {
  5525. for (var m=0;m<this.reportList.length; m++) {
  5526. var d = this.reportList[m].data;
  5527. var find = d.filter(r=>r.id == reportId);
  5528. if (find.length > 0) {
  5529. find[0].state = res.data.state;
  5530. if (find[0].state == 2) {//被驳回,要可以编辑
  5531. this.reportList[m].state = 2;
  5532. }
  5533. find[0].isDeptAudit = res.data.isDeptAudit;
  5534. find[0].departmentAuditState = res.data.departmentAuditState;
  5535. find[0].projectAuditorName = res.data.projectAuditorName;
  5536. find[0].projectAuditorId = res.data.projectAuditorId;
  5537. find[0].projectAuditState = res.data.projectAuditState;
  5538. find[0].rejectUserid = res.data.rejectUserid;
  5539. find[0].rejectUsername = res.data.rejectUsername;
  5540. find[0].rejectReason = res.data.rejectReason;
  5541. this.$forceUpdate();
  5542. break;
  5543. }
  5544. }
  5545. } else {
  5546. this.$message({
  5547. message: res.msg,
  5548. type: "error"
  5549. });
  5550. }
  5551. },
  5552. error => {
  5553. this.listLoading = false;
  5554. this.$message({
  5555. message: error,
  5556. type: "error"
  5557. });
  5558. });
  5559. },
  5560. //导出员工工时统计
  5561. exportUserTime() {
  5562. this.listLoading = true;
  5563. var param = {};
  5564. if (this.exportParam.dateRange != null) {
  5565. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5566. }
  5567. this.http.post('/department/exportDeptStatistic', param,
  5568. res => {
  5569. this.listLoading = false;
  5570. if (res.code == "ok") {
  5571. location.href = res.data;
  5572. this.exportTimeDialog = false;
  5573. } else {
  5574. this.$message({
  5575. message: res.msg,
  5576. type: "error"
  5577. });
  5578. }
  5579. },
  5580. error => {
  5581. this.listLoading = false;
  5582. this.$message({
  5583. message: error,
  5584. type: "error"
  5585. });
  5586. });
  5587. },
  5588. //导出日报
  5589. exportReport() {
  5590. this.exportingData = true;
  5591. var param = {};
  5592. if (this.exportParam.dateRange != null) {
  5593. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5594. }
  5595. if (this.exportParam.projectId != null) {
  5596. param.projectId = this.exportParam.projectId;
  5597. }
  5598. if (this.exportParam.departmentId != null) {
  5599. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5600. param.departmentIds = this.exportParam.departmentId.join(',')
  5601. }
  5602. param.stateKey = this.stateKey
  5603. // param.departmentId = this.user.departmentId
  5604. console.log(param, '《=== 导出传的参数');
  5605. console.log('开始调用exportReport接口');
  5606. this.http.post(this.port.report.export, param,
  5607. res => {
  5608. this.exportingData = false;
  5609. if (res.code == "ok") {
  5610. var filePath = res.data;
  5611. const a = document.createElement('a'); // 创建a标签
  5612. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5613. a.setAttribute('href', filePath);// href链接
  5614. a.click(); //自执行点击事件
  5615. a.remove();
  5616. this.exportDialog = false;
  5617. } else {
  5618. this.$message({
  5619. message: res.msg,
  5620. type: "error"
  5621. });
  5622. }
  5623. },
  5624. error => {
  5625. this.exportingData = false;
  5626. this.$message({
  5627. message: error,
  5628. type: "error"
  5629. });
  5630. });
  5631. },
  5632. //导出日报审核记录
  5633. exportReportLog() {
  5634. this.exportingData = true;
  5635. var param = {};
  5636. if (this.exportReportLogParam.dateRange != null) {
  5637. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5638. }
  5639. this.http.post('/report-log/exportReportLog', param,
  5640. res => {
  5641. this.exportingData = false;
  5642. if (res.code == "ok") {
  5643. var filePath = res.data;
  5644. const a = document.createElement('a'); // 创建a标签
  5645. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5646. a.setAttribute('href', filePath);// href链接
  5647. a.click(); //自执行点击事件
  5648. a.remove();
  5649. this.exportDialog = false;
  5650. } else {
  5651. this.$message({
  5652. message: res.msg,
  5653. type: "error"
  5654. });
  5655. }
  5656. },
  5657. error => {
  5658. this.exportingData = false;
  5659. this.$message({
  5660. message: error,
  5661. type: "error"
  5662. });
  5663. });
  5664. },
  5665. importReportLog(item){
  5666. //首先判断文件类型
  5667. let str = item.file.name.split(".");
  5668. let format = str[str.length - 1];
  5669. if (format != "xls" && format != "xlsx") {
  5670. this.$message({
  5671. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5672. type: "error"
  5673. });
  5674. } else {
  5675. const loading = this.$loading({
  5676. lock: true,
  5677. text: '正在导入修改中,请耐心等待。',
  5678. spinner: 'el-icon-loading',
  5679. background: 'rgba(0, 0, 0, 0.7)'
  5680. });
  5681. let formData = new FormData();
  5682. formData.append("multipartFile", item.file);
  5683. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5684. res => {
  5685. this.$refs.upload.clearFiles();
  5686. loading.close();
  5687. if (res.code == "ok") {
  5688. this.$message({
  5689. message: res.msg,
  5690. type: "success"
  5691. });
  5692. } else {
  5693. this.$message({
  5694. message: res.msg,
  5695. type: "error"
  5696. });
  5697. }
  5698. },
  5699. error => {
  5700. this.$refs.upload.clearFiles();
  5701. loading.close();
  5702. this.$message({
  5703. message: error,
  5704. type: "error"
  5705. });
  5706. });
  5707. }
  5708. },
  5709. //获取项目列表
  5710. getProjectList() {
  5711. this.listLoading = true;
  5712. this.http.post( this.port.project.list, {},
  5713. res => {
  5714. this.listLoading = false;
  5715. if (res.code == "ok") {
  5716. for(var i in res.data) {
  5717. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5718. res.data[i].projectCode = ''
  5719. }
  5720. }
  5721. this.projectList = res.data;
  5722. console.log("项目列表",this.projectList);
  5723. } else {
  5724. this.$message({
  5725. message: res.msg,
  5726. type: "error"
  5727. });
  5728. }
  5729. },
  5730. error => {
  5731. this.listLoading = false;
  5732. this.$message({
  5733. message: error,
  5734. type: "error"
  5735. });
  5736. });
  5737. },
  5738. // 获取填报日报的项目下拉列表
  5739. getFillProjectList() {
  5740. this.http.post( this.port.project.list, {
  5741. forReport: 1
  5742. },res => {
  5743. if (res.code == "ok") {
  5744. for(var i in res.data) {
  5745. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5746. res.data[i].projectCode = ''
  5747. }
  5748. }
  5749. this.fillProjectList = res.data;
  5750. this.getRecentlyProject()
  5751. } else {
  5752. this.$message({
  5753. message: res.msg,
  5754. type: "error"
  5755. });
  5756. }
  5757. },
  5758. error => {
  5759. this.$message({
  5760. message: error,
  5761. type: "error"
  5762. });
  5763. });
  5764. },
  5765. getBasecostItemList() {
  5766. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5767. companyId: this.user.companyId
  5768. },
  5769. res => {
  5770. if (res.code == "ok") {
  5771. this.timeBasecostList = res.data;
  5772. }
  5773. });
  5774. },
  5775. getAIReport(createDate) {
  5776. this.http.post('/report/getAIReport', {},
  5777. res => {
  5778. if (res.code == "ok") {
  5779. var quanbu = 0
  5780. this.jsDay = 1
  5781. var zhi = ''
  5782. var slp = res.data
  5783. for(var i in slp) {
  5784. var sp = +slp[i].workingTime + 0
  5785. zhi = this.jsDay * sp
  5786. quanbu = +quanbu + zhi
  5787. }
  5788. this.jsTime = quanbu
  5789. var aiReportData = res.data;
  5790. this.canCancelInDialog = false
  5791. if(aiReportData.length != 0) {
  5792. var arr = [];
  5793. for(var i in aiReportData) {
  5794. arr.push({
  5795. id: null,
  5796. projectId: aiReportData[i].projectId,
  5797. workingTime: aiReportData[i].workingTime,
  5798. content: '',
  5799. progress:100,
  5800. state: 2,
  5801. timeType: aiReportData[i].timeType,
  5802. subProjectList: aiReportData[i].subProjectList,
  5803. taskList: aiReportData[i].taskList,
  5804. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5805. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5806. taskId: aiReportData[i].taskId,
  5807. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5808. startTime: aiReportData[i].startTime,
  5809. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5810. endTime: aiReportData[i].endTime,
  5811. isOvertime: 0,
  5812. progress:aiReportData[i].progress,
  5813. professionProgress: aiReportData[i].professionProgressList,
  5814. stages:aiReportData[i].stages,
  5815. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5816. pics: null,
  5817. multiWorktime: aiReportData[i].multiWorktime,
  5818. worktimeList: [{}],
  5819. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5820. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5821. wuduList: aiReportData[i].degreeList,
  5822. taskGroups:aiReportData[i].taskGroups,
  5823. customData: aiReportData[i].customData,//自定义的数值
  5824. auditUserList: aiReportData[i].auditUserList,
  5825. projectAuditorId: aiReportData[i].projectAuditorId,
  5826. projectAuditorName: aiReportData[i].projectAuditorName,
  5827. overtimeHours: aiReportData[i].overtimeHours,
  5828. customText: aiReportData[i].customText,
  5829. basecostId: aiReportData[i].basecostId,
  5830. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5831. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5832. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5833. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5834. canEdit: true
  5835. })
  5836. }
  5837. this.workForm.domains = arr;
  5838. } else {
  5839. }
  5840. this.canEdit = true;
  5841. this.originCanEdit = true;
  5842. this.seleChn()
  5843. } else {
  5844. this.$message({
  5845. message: res.msg,
  5846. type: "error"
  5847. });
  5848. }
  5849. },
  5850. error => {
  5851. this.$message({
  5852. message: error,
  5853. type: "error"
  5854. });
  5855. });
  5856. },
  5857. // 获取个人某天的日报 111111
  5858. getReport() {
  5859. this.http.post( this.port.report.getPort, {
  5860. date: this.workForm.createDate
  5861. },
  5862. res => {
  5863. if (res.code == "ok") {
  5864. var quanbu = 0
  5865. this.jsDay = 1
  5866. var zhi = ''
  5867. var slp = res.data.report
  5868. for(var i in slp) {
  5869. var sp = +slp[i].workingTime + 0
  5870. zhi = this.jsDay * sp
  5871. quanbu = +quanbu + zhi
  5872. }
  5873. this.jsTime = quanbu
  5874. var list = res.data;
  5875. this.report = list;
  5876. this.reportTimeType = this.report.timeType;
  5877. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5878. this.isWeekend = !this.report.isWorkDay;
  5879. this.canCancelInDialog = false;
  5880. this.hasWrittenReport = list.report.length != 0;
  5881. if(list.report.length != 0) {
  5882. var arr = [];
  5883. this.canEdit = false;
  5884. let candelete = true
  5885. for(var i in list.report) {
  5886. var flg = null
  5887. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5888. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5889. var filteredRespList = null
  5890. if (targetP.length > 0) {
  5891. var isPublic = targetP[0].isPublic;
  5892. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5893. }
  5894. arr.push({
  5895. id: list.report[i].id,
  5896. projectId: list.report[i].projectId,
  5897. workingTime: list.report[i].workingTime,
  5898. content: list.report[i].content,
  5899. state: list.report[i].state,
  5900. timeType: list.report[i].timeType,
  5901. subProjectList: list.report[i].subProjectList,
  5902. taskList: list.report[i].taskList,
  5903. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5904. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5905. taskId: list.report[i].taskId,
  5906. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5907. startTime: list.report[i].startTime,
  5908. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5909. endTime: list.report[i].endTime,
  5910. isOvertime: flg,
  5911. progress:list.report[i].progress,
  5912. professionProgress: list.report[i].professionProgressList,
  5913. stages:list.report[i].stages,
  5914. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5915. pics: list.report[i].pics,
  5916. multiWorktime: list.report[i].multiWorktime,
  5917. worktimeList: list.report[i].worktimeList,
  5918. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5919. multiDegrIdArray: list.report[i].multiDegrIdList,
  5920. wuduList: list.report[i].degreeList,
  5921. taskGroups:list.report[i].taskGroups,
  5922. customData: list.report[i].customData,//自定义的数值
  5923. auditUserList: list.report[i].auditUserList,
  5924. projectAuditorId: list.report[i].projectAuditorId,
  5925. projectAuditorName: list.report[i].projectAuditorName,
  5926. overtimeHours: list.report[i].overtimeHours,
  5927. customText: list.report[i].customText,
  5928. basecostId: list.report[i].basecostId,
  5929. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5930. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5931. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5932. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5933. canEdit: list.report[i].state >= 2 ? true : false,
  5934. extraField1: list.report[i].extraField1,
  5935. extraField2: list.report[i].extraField2,
  5936. extraField3: list.report[i].extraField3,
  5937. workContentList: list.report[i].workContentList,
  5938. filteredRespList: filteredRespList,
  5939. serviceList: list.report[i].serviceList,
  5940. sapServiceId: list.report[i].sapServiceId,
  5941. reportTargetDeptId: list.report[i].deptId
  5942. })
  5943. if (list.report[i].state >= 2) {
  5944. this.canEdit = true;
  5945. }
  5946. if(list.report[i].state < 2){
  5947. candelete = false
  5948. }
  5949. if (list.report[i].state == 0){
  5950. this.canCancelInDialog = true
  5951. }
  5952. // 加判断
  5953. if(this.user.timeType.choseFromAlbum == 1) {
  5954. let arrList = []
  5955. for(var k in list.report[i].pics) {
  5956. let obj = {
  5957. name: k,
  5958. url: list.report[i].pics[k]
  5959. }
  5960. arrList.push(obj)
  5961. }
  5962. arr[i].imgListUrl = arrList
  5963. arr[i].imgList = list.report[i].pics
  5964. }
  5965. }
  5966. this.reportCanDelete = candelete
  5967. this.workForm = {
  5968. createDate: this.workForm.createDate,
  5969. domains: arr,
  5970. userNames:null,
  5971. userId:null,
  5972. time: list.time,
  5973. showRefresh: list.showRefresh
  5974. }
  5975. console.log('workForm', this.workForm)
  5976. } else {
  5977. this.workForm = {
  5978. createDate: this.workForm.createDate,
  5979. domains: [{
  5980. id: null,
  5981. projectId: "",
  5982. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5983. content: "",
  5984. progress:100,
  5985. state: 2,
  5986. timeType:0,
  5987. multiWorktime: this.reportTimeType.multiWorktime,
  5988. worktimeList:[{}],
  5989. canEdit: true,
  5990. auditorFirst: '',
  5991. auditorSec: '',
  5992. auditorThird: '',
  5993. ccUserid: ''
  5994. }],
  5995. userId:null,
  5996. userNames:null,
  5997. time: this.report.time,
  5998. showRefresh: list.showRefresh
  5999. }
  6000. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6001. this.$set(this.workForm.domains[0],'isOvertime',true)
  6002. if(this.reportTimeType.type != 2){
  6003. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6004. }
  6005. }
  6006. if(this.user.timeType.type == 1) {
  6007. var shuzhi = this.user.timeType.allday + ''
  6008. // console.log('执行一次', shuzhi.indexOf('.'))
  6009. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6010. }
  6011. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6012. //默认给第一个,必填字段
  6013. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6014. }
  6015. this.canEdit = true;
  6016. }
  6017. this.originCanEdit = this.canEdit;
  6018. this.seleChn()
  6019. } else {
  6020. this.$message({
  6021. message: res.msg,
  6022. type: "error"
  6023. });
  6024. }
  6025. },
  6026. error => {
  6027. this.$message({
  6028. message: error,
  6029. type: "error"
  6030. });
  6031. });
  6032. },
  6033. guanbi() {
  6034. this.falsss = false,
  6035. this.workTimeForMinYi=0
  6036. },
  6037. // 打开日报填写
  6038. fillInReport(i, isBatch) {
  6039. this.isWeekend = false
  6040. this.reportCanDelete = false
  6041. // console.log(this.user.timeType.type, '选择时长')
  6042. if(i != 1) {
  6043. this.falsss = false
  6044. } else {
  6045. this.falsss = true
  6046. }
  6047. if (this.isSubstitude) {
  6048. this.getSubstitudeUserDeptList();
  6049. }
  6050. if(i == -1 || this.isSubstitude) {
  6051. this.isDisable = false;
  6052. } else {
  6053. this.isDisable = true;
  6054. }
  6055. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6056. this.isBatch = isBatch;
  6057. if (this.isBatch == 0 && !this.isSubstitude) {
  6058. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6059. let weekday = new Date(this.workForm.createDate).getDay()
  6060. if(this.user.companyId == 817){
  6061. if(weekday == 0){
  6062. this.isWeekend = true
  6063. }
  6064. }else{
  6065. if(weekday == 0 || weekday == 6){
  6066. this.isWeekend = true
  6067. }
  6068. }
  6069. this.getReport(i);
  6070. } else {
  6071. // console.log('执行到了这里')
  6072. this.jsTime = 0
  6073. this.jsDay = 0
  6074. this.workForm = {
  6075. createDate: null,//批量填报没有日期
  6076. domains: [{
  6077. id: null,
  6078. projectId: "",
  6079. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6080. content: "",
  6081. progress:100,
  6082. state: 2,
  6083. timeType:0,
  6084. multiWorktime: this.reportTimeType.multiWorktime,
  6085. worktimeList:[{}],
  6086. canEdit: true,
  6087. }],
  6088. }
  6089. if(this.user.timeType.type == 1) {
  6090. var shuzhi = this.user.timeType.allday + ''
  6091. // console.log('执行二次')
  6092. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6093. }
  6094. // console.log(this.workForm)
  6095. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6096. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6097. }
  6098. this.canEdit = true;
  6099. }
  6100. this.dialogVisible = true;
  6101. },
  6102. //按周填报的弹窗口中编辑单项目相关数据
  6103. setWeekFormReportItem(reportId, i, names, row,sss) {
  6104. console.log(sss)
  6105. this.http.post('/report/getReportById', {
  6106. reportId: reportId
  6107. },
  6108. res => {
  6109. if (res.code == "ok") {
  6110. var data = res.data.report;
  6111. sss.subProjectId = data.subProjectId
  6112. sss.subProjectList = data.subProjectList;
  6113. sss.stage = data.stage
  6114. sss.subProjectList = data.subProjectList
  6115. sss.stages = data.stages
  6116. sss.taskGroups = data.taskGroups;
  6117. sss.auditUserList = data.auditUserList;
  6118. sss.degreeId = data.degreeId;
  6119. sss.customData = data.customData;
  6120. sss.wuduList = data.degreeList;
  6121. this.zhoBaoIdx = i
  6122. this.zhoBaoName = names
  6123. this.zhoBao = sss
  6124. this.zhis = row
  6125. if (sss.groupId) {
  6126. //最后一个参数表示是否保留stage的值,不要重置为空
  6127. this.getGroupStages(this.zhoBao, 0, true)
  6128. }
  6129. this.$forceUpdate();
  6130. }
  6131. });
  6132. },
  6133. // 按周填报里内容的填写
  6134. showWeekItemEdit(item, i, projectId,names, row) {
  6135. if (item.state == 0) {
  6136. this.$message({
  6137. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  6138. type: "error"
  6139. });
  6140. return;
  6141. }
  6142. if (item.state == 1) {
  6143. this.$message({
  6144. message: '已通过状态不可修改',
  6145. type: "error"
  6146. });
  6147. return;
  6148. }
  6149. if(this.user.timeType.notAllowedNoAttendance == 1){
  6150. if(this.zhoData[i].corpTime){
  6151. if(this.zhoData[i].corpTime.workHours == 0){
  6152. this.$message({
  6153. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6154. type: 'error'
  6155. })
  6156. return
  6157. }
  6158. }else{
  6159. this.$message({
  6160. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6161. type: 'error'
  6162. })
  6163. return
  6164. }
  6165. }
  6166. var obj = {}
  6167. obj.projectId = projectId
  6168. this.tianxieDialogVisible = true
  6169. this.scopess = item
  6170. var sss = {}
  6171. if (item.id != null) {
  6172. sss.id = item.id;
  6173. sss.state = item.state;
  6174. } else {
  6175. sss.id = -1;
  6176. sss.state = 3;
  6177. }
  6178. sss.projectId = projectId;
  6179. sss.progress = item.progress
  6180. sss.time = item.time
  6181. sss.content = item.content;
  6182. console.log('333', sss.content)
  6183. if (sss.time == '' && this.reportTimeType.type == 2) {
  6184. //取已填时间范围中最大的一个作为开始时间
  6185. var startTime = '09:00';
  6186. var fillStartTime = '00:00';
  6187. for (var t in this.selProjectList) {
  6188. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6189. if (fillItem.time) {
  6190. if (fillItem.time[1] > fillStartTime) {
  6191. fillStartTime = fillItem.time[1];
  6192. }
  6193. }
  6194. }
  6195. if (fillStartTime == '00:00') {
  6196. fillStartTime = '09:00';
  6197. }
  6198. var fillEndMax = '18:00';
  6199. if (fillStartTime >= '18:00') {
  6200. fillEndMax = '23:59';
  6201. }
  6202. sss.time = [fillStartTime, fillEndMax];
  6203. }
  6204. sss.groupId = item.groupId
  6205. sss.stage = item.stage;
  6206. sss.workingTime = item.workingTime
  6207. sss.projectAuditorId = item.projectAuditorId;
  6208. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6209. //默认选中第一个
  6210. sss.basecostId = this.timeBasecostList[0].id;
  6211. }
  6212. var hasEdited = this.zhoData[i][names].hasEdited;
  6213. if (hasEdited) {
  6214. sss = { ...item }
  6215. //编辑过了
  6216. sss.subProjectId = item.subProjectId
  6217. sss.stage = item.stage
  6218. sss.subProjectList = item.subProjectList
  6219. sss.stages = item.stages
  6220. sss.taskGroups = item.taskGroups;
  6221. console.log(sss.taskGroups, '33333');
  6222. sss.auditUserList = obj.auditUserList;
  6223. sss.degreeId = item.degreeId;
  6224. sss.customData = item.customData;
  6225. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6226. //只有一个审核人,自动设置上去
  6227. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6228. }
  6229. sss.wuduList = item.wuduList;
  6230. this.zhoBaoIdx = i
  6231. this.zhoBaoName = names
  6232. this.zhoBao = sss
  6233. this.zhis = row
  6234. if (sss.groupId) {
  6235. //最后一个参数表示是否保留stage的值,不要重置为空
  6236. this.getGroupStages(this.zhoBao, 0, true)
  6237. }
  6238. this.$forceUpdate();
  6239. this.getWeeklyTaskList(sss)
  6240. console.log('最后的周报 ===>', this.zhoBao)
  6241. } else {
  6242. //第一次打开,获取数据
  6243. if (sss.id == -1) {
  6244. //新填报的
  6245. this.selectProject(obj, 0);
  6246. var that = this
  6247. setTimeout(() =>{
  6248. sss.subProjectId = that.workForm.domains[0].subProjectId
  6249. sss.subProjectList = item.subProjectList;
  6250. sss.stage = that.workForm.domains[0].stage
  6251. sss.subProjectList = that.workForm.domains[0].subProjectList
  6252. sss.stages = that.workForm.domains[0].stages
  6253. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6254. sss.auditUserList = obj.auditUserList;
  6255. sss.degreeId = item.degreeId;
  6256. sss.customData = item.customData;
  6257. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6258. //只有一个审核人,自动设置上去
  6259. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6260. }
  6261. sss.wuduList = row[0].wuduList
  6262. that.zhoBaoIdx = i
  6263. that.zhoBaoName = names
  6264. that.zhoBao = sss
  6265. that.zhis = row
  6266. if (sss.groupId) {
  6267. //最后一个参数表示是否保留stage的值,不要重置为空
  6268. this.getGroupStages(that.zhoBao, 0, false)
  6269. }
  6270. that.$forceUpdate();
  6271. this.getWeeklyTaskList(sss)
  6272. },600);
  6273. } else {
  6274. //编辑填报过的;数据库已经存在的
  6275. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6276. }
  6277. }
  6278. },
  6279. // 按周填报里内容的填写点击确定
  6280. setWeekProItemData() {
  6281. //专业版模式下,任务分组和阶段必填
  6282. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6283. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6284. this.$message({
  6285. message: '任务分组和阶段必填,请检查',
  6286. type: "error"
  6287. });
  6288. return;
  6289. }
  6290. }
  6291. // 检查任务分组
  6292. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6293. this.$message({
  6294. message: '任务分组必填,请检查',
  6295. type: "error"
  6296. });
  6297. return
  6298. }
  6299. //检查子项目是否必填
  6300. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6301. this.$message({
  6302. message: '子项目必填,请检查',
  6303. type: "error"
  6304. });
  6305. return;
  6306. }
  6307. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6308. this.$message({
  6309. message: this.$t('message.Pleaseselectareviewer'),
  6310. type: "error"
  6311. });
  6312. return
  6313. }
  6314. if(this.user.timeType.reportAuditType == 3){
  6315. let auditTips = ''
  6316. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6317. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6318. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6319. if(auditTips){
  6320. auditTips = auditTips.substring(0,auditTips.length - 1)
  6321. this.$message({
  6322. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6323. type: 'error'
  6324. })
  6325. return
  6326. }
  6327. }
  6328. let errtips = ''
  6329. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6330. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6331. errtips += this.user.timeType.customDegreeName + '、'
  6332. }
  6333. }
  6334. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6335. errtips += this.user.timeType.customDataName + '、'
  6336. }
  6337. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6338. errtips += this.user.timeType.customTextName + '、'
  6339. }
  6340. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6341. errtips += this.$t('other.workMatters') +'、'
  6342. }
  6343. if(errtips){
  6344. errtips = errtips.substring(0,errtips.length - 1)
  6345. this.$message({
  6346. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6347. type: 'error'
  6348. })
  6349. return
  6350. }
  6351. this.tianxieDialogVisible = false
  6352. var zhong = this.zhoData
  6353. this.zhoBao.hasEdited = true;
  6354. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6355. this.zhoData = zhong
  6356. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6357. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6358. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6359. },
  6360. // 获取本周
  6361. getCurrentWeek() {
  6362. //今天
  6363. this.targetWeekDate = new Date();
  6364. this.initWeekFormData();
  6365. // this.jiazai()
  6366. },
  6367. // 获取上周
  6368. handleGetPrevWeek() {
  6369. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6370. this.initWeekFormData();
  6371. // this.jiazai()
  6372. },
  6373. // 获取下周
  6374. handleGetNextvWeek() {
  6375. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6376. this.initWeekFormData()
  6377. },
  6378. // 加载动画
  6379. jiazai() {
  6380. this.weekDataLoading = true
  6381. var that = this
  6382. setTimeout(() =>{
  6383. that.weekDataLoading = false
  6384. },1000);
  6385. },
  6386. // 转时间格式
  6387. dealdate(date) {
  6388. const dt = new Date(date)
  6389. const y = dt.getFullYear()
  6390. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6391. const d = (dt.getDate() + '').padStart(2, '0')
  6392. return `${y}-${m}-${d}`
  6393. },
  6394. // 按周填报
  6395. fillInReportss() {
  6396. window.addEventListener('scroll', this.handleScroll, true)
  6397. // this.jiazai()
  6398. this.fillWeekDialogVisi = true;
  6399. if (this.isSubstitude) {
  6400. this.substitudeStep = 1;
  6401. this.getSubstitudeUserDeptList();
  6402. } else {
  6403. this.getCurrentWeek();
  6404. }
  6405. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6406. //重新获取工时预警类型的预算项
  6407. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6408. companyId: this.user.companyId
  6409. },
  6410. res => {
  6411. if (res.code == "ok") {
  6412. this.timeBasecostList = res.data;
  6413. }
  6414. });
  6415. }
  6416. },
  6417. fillInReportCustom() {
  6418. this.weekIndex++
  6419. this.weekParentData = {
  6420. isSubstitude: this.isSubstitude
  6421. }
  6422. this.fillWeekDialogVisiCustom = true
  6423. },
  6424. // 按周填报的项目筛选
  6425. selListFun(){
  6426. this.selProjectList = []
  6427. if(this.selCon.length){
  6428. for (let i = 0; i < this.selCon.length; i++) {
  6429. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6430. }
  6431. this.selConShow = false ;
  6432. for (let i in this.zhoData) {
  6433. var obj = this.zhoData[i];
  6434. for(var j in this.selProjectList) {
  6435. var xinzhi = this.selProjectList[j].projectName
  6436. obj[xinzhi] = {}
  6437. obj[xinzhi].time = ''
  6438. obj[xinzhi].content = ''
  6439. obj[xinzhi].progress = 0
  6440. obj[xinzhi].workingTime = 0
  6441. }
  6442. }
  6443. this.initWeekFormData();
  6444. }else{
  6445. this.$message({
  6446. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6447. type:'error'
  6448. })
  6449. }
  6450. },
  6451. setWeekCardTimeData(list) {
  6452. for(let i in list){
  6453. let datei = '';
  6454. if (this.user.timeType.showDdCardtime == 1) {
  6455. datei = list[i].workDate;
  6456. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6457. datei = list[i].createDate;
  6458. } else if (this.user.timeType.syncFanwei == 1) {
  6459. datei = list[i].workDate;
  6460. }
  6461. for(let m in this.zhoData) {
  6462. if(datei == this.zhoData[m].zhoDataTime){
  6463. let item = {
  6464. startTime: list[i].startTime,
  6465. endTime: list[i].endTime,
  6466. workHours: list[i].workHours
  6467. }
  6468. this.$set(this.zhoData[m],'corpTime',item)
  6469. }
  6470. }
  6471. }
  6472. },
  6473. getWeeklyCardTime(){ //按周填报获取考勤信息
  6474. let dateStr = []
  6475. for(let i in this.zhoData){
  6476. dateStr.push(this.zhoData[i].zhoDataTime)
  6477. }
  6478. this.http.post('/report/getWeeklyCardTime',{
  6479. dateStr: JSON.stringify(dateStr)
  6480. },res => {
  6481. if(res.code == 'ok'){
  6482. for(let i in res.data){
  6483. let datei = '';
  6484. if (this.user.timeType.showDdCardtime == 1) {
  6485. datei = res.data[i].workDate.split('-');
  6486. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6487. datei = res.data[i].createDate.split('-');
  6488. }
  6489. for(let m in this.zhoData){
  6490. let datem = new Date(this.zhoData[m].zhoDataTime)
  6491. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6492. let item = {
  6493. startTime: res.data[i].startTime,
  6494. endTime: res.data[i].endTime,
  6495. workHours: res.data[i].workHours
  6496. }
  6497. this.$set(this.zhoData[m],'corpTime',item)
  6498. }
  6499. }
  6500. }
  6501. }else{
  6502. this.$message({
  6503. message: res.msg,
  6504. type: 'error'
  6505. })
  6506. }
  6507. },err => {
  6508. this.$message({
  6509. message: err,
  6510. type: 'error'
  6511. })
  6512. })
  6513. },
  6514. selListqx(){
  6515. this.fillWeekDialogVisi = false
  6516. this.selProjectList = []
  6517. this.selCon = []
  6518. },
  6519. handleScroll() {
  6520. this.changdu = this.projectList.length + 1
  6521. },
  6522. // 自动选择时间点的事件
  6523. // async zhoTimes(item, i) {
  6524. // var iss = i
  6525. // if(item.time == null) {
  6526. // return
  6527. // } else {
  6528. // const zhi = this.zhoData[iss];
  6529. // let he = 0;
  6530. // const timeArr = Object.values(zhi)
  6531. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6532. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6533. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6534. // console.log(data, 'data');
  6535. // zhi.he = `${he}h`;
  6536. // }
  6537. // },
  6538. async zhoTimes(item, index) {
  6539. const zho = this.zhoData[index];
  6540. if (!item.time) {
  6541. return;
  6542. }
  6543. const timeArr = Object.values(zho)
  6544. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6545. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6546. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6547. zho.he = `${totalHours[0]}h`;
  6548. },
  6549. // 判断两个时间段是否重叠
  6550. timeOverlap(idx, dateAr) {
  6551. let zhi = 0
  6552. for (let k in dateAr) {
  6553. if (idx !== k) {
  6554. 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))) {
  6555. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6556. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6557. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6558. }
  6559. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6560. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6561. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6562. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6563. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6564. } else {
  6565. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6566. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6567. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6568. }
  6569. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6570. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6571. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6572. }
  6573. }
  6574. }
  6575. }
  6576. }
  6577. return zhi
  6578. },
  6579. // 计算时间
  6580. getHourMinutes(str, end) {
  6581. var he = 0
  6582. var date2 = '2021/12/12 ' + end +':00'
  6583. var date1 = '2021/12/12 ' + str +':00'
  6584. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6585. var leave1=date3%(24*3600*1000)
  6586. var hours=Math.floor(leave1/(3600*1000))
  6587. var leave2=leave1%(3600*1000)
  6588. var minutes=Math.floor(leave2/(60*1000))
  6589. var shi = hours+'.'+ minutes
  6590. return he += +shi
  6591. },
  6592. // 自动选择事件长度的事件
  6593. zhoXuan(item, i) {
  6594. var iss = i
  6595. if(item.time == null) {
  6596. return
  6597. } else {
  6598. var zhi = this.zhoData[iss]
  6599. var he = 0
  6600. for(var i in zhi) {
  6601. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6602. he += +zhi[i].workingTime
  6603. }
  6604. }
  6605. zhi.he = he + 'h'
  6606. }
  6607. },
  6608. getPushWorkLogData(){
  6609. this.http.post('/sap-sync-log/list', {},
  6610. res => {
  6611. if (res.code == "ok") {
  6612. this.pushWorkTimeLogData = res.data;
  6613. } else {
  6614. this.$message({
  6615. message: res.msg,
  6616. type: "error"
  6617. });
  6618. }
  6619. },
  6620. error => {
  6621. this.$message({
  6622. message: error,
  6623. type: "error"
  6624. });
  6625. });
  6626. },
  6627. // 获取全部人员
  6628. getUsers() {
  6629. this.http.post('/user/getSimpleActiveUserList', {},
  6630. res => {
  6631. if (res.code == "ok") {
  6632. this.usersList = res.data;
  6633. } else {
  6634. this.$message({
  6635. message: res.msg,
  6636. type: "error"
  6637. });
  6638. }
  6639. },
  6640. error => {
  6641. this.$message({
  6642. message: error,
  6643. type: "error"
  6644. });
  6645. });
  6646. },
  6647. // 按时间比例
  6648. addBli(item, i) {
  6649. var iss = i
  6650. if(item.time == null) {
  6651. return
  6652. } else {
  6653. var zhi = this.zhoData[iss]
  6654. var he = 0
  6655. for(var i in zhi) {
  6656. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6657. he += +zhi[i].workingTime
  6658. }
  6659. }
  6660. zhi.he = he.toFixed(1) + 'h'
  6661. }
  6662. },
  6663. //按周填报选择的项目发生变化,需要设置列
  6664. onSelProjectChange() {
  6665. for (let i = 0; i < this.selCon.length; i++) {
  6666. var exists = false;
  6667. for (let j = 0; j < this.selProjectList.length; j++) {
  6668. if (this.selProjectList[j].id == this.selCon[i]) {
  6669. exists = true;
  6670. break;
  6671. }
  6672. }
  6673. if (!exists) {
  6674. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6675. this.selProjectList.push(newProject);
  6676. //添加新项目
  6677. for (var w in this.zhoData) {
  6678. var dayItem = this.zhoData[w];
  6679. var pName = newProject.projectName;
  6680. dayItem[pName] = {};
  6681. dayItem[pName].time = ''
  6682. dayItem[pName].content = ''
  6683. dayItem[pName].progress = 0
  6684. dayItem[pName].workingTime = 0
  6685. }
  6686. }
  6687. }
  6688. //去掉
  6689. for (let j = 0; j < this.selProjectList.length; j++) {
  6690. var exists = false;
  6691. for (let i = 0; i < this.selCon.length; i++) {
  6692. if (this.selProjectList[j].id == this.selCon[i]) {
  6693. exists = true;
  6694. break;
  6695. }
  6696. }
  6697. if (!exists) {
  6698. this.selProjectList.splice(j, 1);
  6699. j--;
  6700. }
  6701. }
  6702. this.loadFilledWeekReportItem();
  6703. //刷新表格
  6704. // this.$refs.weekTable.doLayout();
  6705. },
  6706. //根据选中的项目来刷新填写表格
  6707. loadFilledWeekReportItem() {
  6708. for (var w in this.zhoData) {
  6709. var dayItem = this.zhoData[w];
  6710. for (var i = 0; i < this.selProjectList.length; i++) {
  6711. var curColumnProject = this.selProjectList[i];
  6712. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6713. for (var t in dayItem.reportList) {
  6714. //有日报的项目,不能取消选择
  6715. for (var p in this.fillProjectList) {
  6716. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6717. }
  6718. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6719. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6720. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6721. if (this.reportTimeType.type == 2) {
  6722. //时间段模式
  6723. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6724. }
  6725. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6726. break;
  6727. }
  6728. }
  6729. // dayItem[curColumnProject.projectName] = matchReportItem;
  6730. }
  6731. }
  6732. this.$nextTick(()=>{
  6733. this.$refs.weekTable.doLayout();
  6734. });
  6735. },
  6736. initWeekFormData() {
  6737. this.weekDataLoading = true;
  6738. for (var p in this.fillProjectList) {
  6739. this.fillProjectList[p].canCancel = 1;
  6740. }
  6741. var param = {
  6742. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6743. };
  6744. if (this.isSubstitude) {
  6745. //传代填人的userId
  6746. param.targetUserId = this.workForm.userId[0];
  6747. }
  6748. this.http.post('/report/getWeeklyReportData',param,res => {
  6749. this.weekDataLoading = false;
  6750. if(res.code == 'ok'){
  6751. let projectList = res.data.projectList;
  6752. if (projectList.length > 0) {
  6753. //有选择过项目进行填报,直接选中
  6754. this.selProjectList = projectList;
  6755. this.selCon = [];
  6756. for (let i = 0; i < projectList.length; i++) {
  6757. this.selCon.push(projectList[i].id);
  6758. }
  6759. }
  6760. //设置日期
  6761. this.weekDateRange = res.data.dateList;
  6762. this.zhoData = [];
  6763. var arrst = []
  6764. for(var i in this.weekDateRange) {
  6765. var obj = {}
  6766. obj.zhoDataTime = this.weekDateRange[i].date
  6767. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6768. obj.he = this.weekDateRange[i].filledTime;
  6769. obj.canFill = this.weekDateRange[i].canFill;
  6770. // obj.filledTime = this.weekDateRange[i].filledTime;
  6771. obj.reportList = this.weekDateRange[i].reportList;
  6772. //初始化,防止渲染报错
  6773. for (var j = 0; j < this.selProjectList.length; j++) {
  6774. var pName = this.selProjectList[j].projectName
  6775. obj[pName] = {}
  6776. obj[pName].time = ''
  6777. obj[pName].content = ''
  6778. obj[pName].progress = 0
  6779. obj[pName].workingTime = 0
  6780. }
  6781. arrst.push(obj)
  6782. }
  6783. this.zhoData = arrst
  6784. this.setWeekCardTimeData(res.data.cardTimeList);
  6785. this.loadFilledWeekReportItem();
  6786. }else{
  6787. this.$message({
  6788. message: res.msg,
  6789. type: 'error'
  6790. })
  6791. }
  6792. },err => {
  6793. this.$message({
  6794. message: err,
  6795. type: 'error'
  6796. })
  6797. })
  6798. },
  6799. zhoZhi(res, i) {
  6800. var zhi = 0
  6801. for(var i in res) {
  6802. if(i != 'zhoDataTime' && i != 'he') {
  6803. zhi += +res[i]
  6804. }
  6805. }
  6806. res.he = zhi
  6807. },
  6808. zhoBtn(i) {
  6809. // this.zhoData.split(i, 1)
  6810. var arr = this.zhoData
  6811. arr.splice(i, 1)
  6812. },
  6813. zhoAddlast(){
  6814. this.selConShow = true
  6815. },
  6816. closeAddWeeklyReport(){
  6817. this.fillWeekDialogVisi = false
  6818. this.selConShow = true
  6819. this.selProjectList = []
  6820. this.selCon = []
  6821. },
  6822. checkDateWorkTime() {
  6823. //针对苏州景昱,单独的检查逻辑
  6824. if (this.user.companyId == 5978) {
  6825. //调接口,先检查工时是否存在异常
  6826. var zhi = this.zhoData;
  6827. var array = [];
  6828. for(let n in zhi){
  6829. if(zhi[n].he){
  6830. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6831. array.push(workData)
  6832. }
  6833. }
  6834. this.submitingReport = true;
  6835. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6836. res => {
  6837. this.submitingReport = false;
  6838. if (res.code == "ok") {
  6839. this.submitWeekReport(0)
  6840. } else {
  6841. this.$confirm(res.msg, '提示', {
  6842. confirmButtonText: '忽略并提交',
  6843. cancelButtonText: '取消',
  6844. type: 'error'
  6845. }).then(() => {
  6846. this.submitWeekReport(0)
  6847. }).catch(() => {
  6848. });
  6849. }
  6850. },
  6851. error => {
  6852. this.$message({
  6853. message: error,
  6854. type: "error"
  6855. });
  6856. });
  6857. }
  6858. },
  6859. // 提交按周填报
  6860. submitWeekReport(isDraft) {
  6861. var zhi = this.zhoData
  6862. var ll = 0
  6863. if(this.reportTimeType.type == 2) {
  6864. for(var i in zhi) {
  6865. this.dateAr = []
  6866. var alp = []
  6867. var zhis = zhi[i]
  6868. console.log(zhis)
  6869. for(var j in zhis) {
  6870. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6871. let objs = {}
  6872. objs.s = zhis[j].time[0]
  6873. objs.e = zhis[j].time[1]
  6874. objs.p = j
  6875. alp.push(objs)
  6876. }
  6877. }
  6878. console.log(alp)
  6879. this.dateAr = alp
  6880. if (this.reportTimeType.timeCanOverlap == 0) {
  6881. let str = this.$t('message.Filledtimeperiodsoverlap')
  6882. if(this.dateAr.length > 0) {
  6883. const trus = this.fns();
  6884. const overlapDataTime = this.getOverlapData(alp);
  6885. if (overlapDataTime.length > 0) {
  6886. const arrList = overlapDataTime.map((item) => item.p);
  6887. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6888. }
  6889. ll += 1
  6890. if(!trus) {
  6891. this.$message({
  6892. message: str,
  6893. type: 'error'
  6894. })
  6895. return false
  6896. }
  6897. }
  6898. } else {
  6899. if(this.dateAr.length > 0) {
  6900. ll +=1 ;
  6901. }
  6902. }
  6903. }
  6904. if(ll == 0) {
  6905. this.$message({
  6906. message: this.$t('message.Pleasefillinthetime'),
  6907. type: 'error'
  6908. })
  6909. return false
  6910. }
  6911. } else if(this.reportTimeType.type == 1){
  6912. for(var i in zhi) {
  6913. var zhis = zhi[i]
  6914. for(var j in zhis) {
  6915. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6916. ll += 1
  6917. }
  6918. }
  6919. }
  6920. if(ll == 0) {
  6921. this.$message({
  6922. message: this.$t('message.Pleaseselectatime'),
  6923. type: 'error'
  6924. })
  6925. return false
  6926. }
  6927. let overcorp = ''
  6928. for(let n in zhi){
  6929. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6930. overcorp += zhi[n].zhoDataTime + ','
  6931. }
  6932. }
  6933. if(this.user.companyId != 5978 && overcorp != ''){
  6934. overcorp = overcorp.substring(0,overcorp.length - 1)
  6935. this.$message({
  6936. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6937. type: 'error'
  6938. })
  6939. return
  6940. }
  6941. }
  6942. var submits = []
  6943. let formData = new FormData();
  6944. formData.append("draft", isDraft);
  6945. if(this.reportTimeType.multiWorktime == 1){
  6946. for (var i in this.zhoData) {
  6947. var zhoD = this.zhoData[i]
  6948. var flgs = false
  6949. for(var j in zhoD) {
  6950. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6951. flgs = true
  6952. // formData.append("degreeId", "-1");
  6953. formData.append("id", '-1');
  6954. if (this.isSubstitude) {
  6955. formData.append('targetUids',this.workForm.userId[0]);
  6956. }
  6957. for(var s in this.projectList) {
  6958. if(j == this.projectList[s].projectName) {
  6959. formData.append("projectId", this.projectList[s].id);
  6960. }
  6961. }
  6962. if(this.user.timeType.reportAuditType == 3){
  6963. let audItem = {}
  6964. if(this.user.timeType.auditLevel > 0){
  6965. audItem.auditorFirst = zhoD[j].auditorFirst
  6966. }
  6967. if(this.user.timeType.auditLevel > 1){
  6968. audItem.auditorSec = zhoD[j].auditorSec
  6969. }
  6970. if(this.user.timeType.auditLevel > 2){
  6971. audItem.auditorThird = zhoD[j].auditorThird
  6972. }
  6973. if(zhoD[j].ccUserid){
  6974. audItem.ccUserid = zhoD[j].ccUserid
  6975. }
  6976. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6977. }
  6978. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6979. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6980. formData.append("reportTimeType", this.reportTimeType.type);
  6981. formData.append("endTime", '');
  6982. formData.append("startTime", '');
  6983. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6984. var lix = []
  6985. var objjs = {}
  6986. objjs.startTime = zhoD[j].time[0]
  6987. objjs.endTime = zhoD[j].time[1]
  6988. if (zhoD[j].content == null || zhoD[j].content == '') {
  6989. zhoD[j].content == '-'
  6990. }
  6991. objjs.content = zhoD[j].content
  6992. lix.push(objjs)
  6993. var zhiZhi = JSON.stringify(lix)
  6994. zhiZhi = zhiZhi.replace(/,/g,"@");
  6995. formData.append("content", zhiZhi)
  6996. formData.append("isOvertime", 0)
  6997. formData.append("professionProgress", "[]")
  6998. if (zhoD[j].groupId) {
  6999. formData.append("groupId",zhoD[j].groupId)
  7000. } else {
  7001. //解决后台groupId数组越界的问题
  7002. formData.append("groupId",0)
  7003. }
  7004. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7005. formData.append("createDate",zhoD.zhoDataTime)
  7006. if (zhoD[j].projectAuditorId) {
  7007. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7008. }
  7009. if(zhoD[j].basecostId) {
  7010. formData.append("basecostId", zhoD[j].basecostId);
  7011. } else {
  7012. formData.append("basecostId", 0);
  7013. }
  7014. if(this.user.timeType.customDegreeActive){
  7015. if (this.user.timeType.customDegreeMultiple) {
  7016. if (zhoD[j].multiDegrIdArray) {
  7017. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7018. } else {
  7019. formData.append('multiDegrId','[]')
  7020. }
  7021. } else {
  7022. if (zhoD[j].degreeId) {
  7023. formData.append('degreeId',zhoD[j].degreeId)
  7024. } else {
  7025. formData.append('degreeId','-1')
  7026. }
  7027. }
  7028. }else{
  7029. formData.append("degreeId", "-1");
  7030. }
  7031. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7032. formData.append('customData',zhoD[j].customData)
  7033. }else if(this.user.timeType.customDataActive){
  7034. formData.append('customData',0)
  7035. }
  7036. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7037. formData.append('customText',zhoD[j].customText)
  7038. }else if(this.user.timeType.customTextActive){
  7039. formData.append('customText','-')
  7040. }
  7041. }
  7042. }
  7043. }
  7044. } else {
  7045. for (var i in this.zhoData) {
  7046. var zhoD = this.zhoData[i]
  7047. var flgs = false
  7048. if(this.reportTimeType.type == 2) {
  7049. for(var k in this.selProjectList) {
  7050. var pItem = this.selProjectList[k];
  7051. var pName = pItem.projectName;
  7052. var j = pName;
  7053. console.log('j==周报中的项目='+j);
  7054. if(zhoD[j].time && zhoD[j].time != 'null') {
  7055. flgs = true
  7056. // formData.append("degreeId", "-1");
  7057. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7058. if (this.isSubstitude) {
  7059. formData.append('targetUids',this.workForm.userId[0]);
  7060. }
  7061. for(var s in this.projectList) {
  7062. if(j == this.projectList[s].projectName) {
  7063. formData.append("projectId", this.projectList[s].id);
  7064. }
  7065. }
  7066. if(this.user.timeType.reportAuditType == 3){
  7067. let audItem = {}
  7068. if(this.user.timeType.auditLevel > 0){
  7069. audItem.auditorFirst = zhoD[j].auditorFirst
  7070. }
  7071. if(this.user.timeType.auditLevel > 1){
  7072. audItem.auditorSec = zhoD[j].auditorSec
  7073. }
  7074. if(this.user.timeType.auditLevel > 2){
  7075. audItem.auditorThird = zhoD[j].auditorThird
  7076. }
  7077. if(zhoD[j].ccUserid){
  7078. audItem.ccUserid = zhoD[j].ccUserid
  7079. }
  7080. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7081. }
  7082. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7083. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7084. formData.append("reportTimeType", this.reportTimeType.type);
  7085. formData.append("endTime", zhoD[j].time[1]);
  7086. formData.append("startTime", zhoD[j].time[0]);
  7087. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7088. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7089. formData.append("isOvertime", 0)
  7090. formData.append("professionProgress", "[]")
  7091. if (zhoD[j].groupId) {
  7092. formData.append("groupId",zhoD[j].groupId)
  7093. } else {
  7094. //解决后台groupId数组越界的问题
  7095. formData.append("groupId",0)
  7096. }
  7097. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7098. formData.append("createDate",zhoD.zhoDataTime)
  7099. if (zhoD[j].projectAuditorId) {
  7100. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7101. }
  7102. if(zhoD[j].basecostId) {
  7103. formData.append("basecostId", zhoD[j].basecostId);
  7104. } else {
  7105. formData.append("basecostId", 0);
  7106. }
  7107. if(this.user.timeType.customDegreeActive){
  7108. if (this.user.timeType.customDegreeMultiple) {
  7109. if (zhoD[j].multiDegrIdArray) {
  7110. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7111. } else {
  7112. formData.append("multiDegrId", "[]");
  7113. }
  7114. } else {
  7115. if (zhoD[j].degreeId) {
  7116. formData.append('degreeId',zhoD[j].degreeId)
  7117. } else {
  7118. formData.append("degreeId", "-1");
  7119. }
  7120. }
  7121. }else{
  7122. formData.append("degreeId", "-1");
  7123. }
  7124. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7125. formData.append('customData',zhoD[j].customData)
  7126. }else if(this.user.timeType.customDataActive){
  7127. formData.append('customData',0)
  7128. }
  7129. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7130. formData.append('customText',zhoD[j].customText)
  7131. }else if(this.user.timeType.customTextActive){
  7132. formData.append('customText','-')
  7133. }
  7134. }
  7135. }
  7136. } else {
  7137. for(var k in this.selProjectList) {
  7138. var pItem = this.selProjectList[k];
  7139. var pName = pItem.projectName;
  7140. var j = pName;
  7141. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7142. flgs = true
  7143. // formData.append("degreeId", "-1");
  7144. console.log('进入了workFpppp==='+j);
  7145. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7146. if (this.isSubstitude) {
  7147. formData.append('targetUids',this.workForm.userId[0]);
  7148. }
  7149. for(var s in this.projectList) {
  7150. if(j == this.projectList[s].projectName) {
  7151. formData.append("projectId", this.projectList[s].id);
  7152. }
  7153. }
  7154. if(this.user.timeType.reportAuditType == 3){
  7155. let audItem = {}
  7156. if(this.user.timeType.auditLevel > 0){
  7157. audItem.auditorFirst = zhoD[j].auditorFirst
  7158. }
  7159. if(this.user.timeType.auditLevel > 1){
  7160. audItem.auditorSec = zhoD[j].auditorSec
  7161. }
  7162. if(this.user.timeType.auditLevel > 2){
  7163. audItem.auditorThird = zhoD[j].auditorThird
  7164. }
  7165. if(zhoD[j].ccUserid){
  7166. audItem.ccUserid = zhoD[j].ccUserid
  7167. }
  7168. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7169. }
  7170. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7171. // formData.append("subProjectId", zhoD[j].subProjectId);
  7172. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7173. formData.append("reportTimeType", this.reportTimeType.type);
  7174. if(this.reportTimeType.type == 1) {
  7175. formData.append("workingTime", zhoD[j].workingTime);
  7176. } else if(this.reportTimeType.type == 2) {
  7177. formData.append("endTime", zhoD[j].time[1]);
  7178. formData.append("startTime", zhoD[j].time[0]);
  7179. } else if(this.reportTimeType.type == 3) {
  7180. formData.append("progress", zhoD[j].progress);
  7181. formData.append("workingTime", zhoD[j].workingTime);
  7182. }
  7183. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7184. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7185. formData.append("isOvertime", 0)
  7186. formData.append("professionProgress", "[]")
  7187. if (zhoD[j].groupId) {
  7188. formData.append("groupId",zhoD[j].groupId)
  7189. } else {
  7190. //解决后台groupId数组越界的问题
  7191. formData.append("groupId",0)
  7192. }
  7193. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7194. formData.append("createDate",zhoD.zhoDataTime)
  7195. if (zhoD[j].projectAuditorId) {
  7196. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7197. }
  7198. if(zhoD[j].basecostId) {
  7199. formData.append("basecostId", zhoD[j].basecostId);
  7200. } else {
  7201. formData.append("basecostId", 0);
  7202. }
  7203. if(this.user.timeType.customDegreeActive){
  7204. if (this.user.timeType.customDegreeMultiple) {
  7205. if (zhoD[j].multiDegrIdArray) {
  7206. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7207. } else {
  7208. formData.append("multiDegrId", "[]");
  7209. }
  7210. } else {
  7211. if (zhoD[j].degreeId) {
  7212. formData.append('degreeId',zhoD[j].degreeId)
  7213. } else {
  7214. formData.append("degreeId", "-1");
  7215. }
  7216. }
  7217. }else{
  7218. formData.append("degreeId", "-1");
  7219. }
  7220. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7221. formData.append('customData',zhoD[j].customData)
  7222. }else if(this.user.timeType.customDataActive){
  7223. formData.append('customData',0)
  7224. }
  7225. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7226. formData.append('customText',zhoD[j].customText)
  7227. }else if(this.user.timeType.customTextActive){
  7228. formData.append('customText','-')
  7229. }
  7230. }
  7231. }
  7232. }
  7233. }
  7234. }
  7235. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7236. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7237. if(!next) {
  7238. this.$message({
  7239. message: `【${error.join('、')}】请填写任务分组`,
  7240. type: 'error'
  7241. })
  7242. return
  7243. }
  7244. // 自定义维度
  7245. this.submitingReport = true;
  7246. this.http.uploadFile( this.port.report.editPort, formData,
  7247. res => {
  7248. // this.listLoading = false;
  7249. this.submitingReport = false;
  7250. if (res.code == "ok") {
  7251. this.$message({
  7252. message: this.$t('message.fillinsuccessfully'),
  7253. type: "success"
  7254. });
  7255. this.fillWeekDialogVisi = false
  7256. this.selConShow = true
  7257. this.zhoData = []
  7258. this.weekDateRange = ''
  7259. this.getReportList();
  7260. this.getDepartment();
  7261. // 关闭弹窗 并 清空
  7262. this.selProjectList = []
  7263. this.selCon = []
  7264. this.getRecentlyProject()
  7265. } else {
  7266. this.$message({
  7267. message: res.msg,
  7268. type: "error"
  7269. });
  7270. }
  7271. },
  7272. error => {
  7273. this.submitingReport = false;
  7274. this.$message({
  7275. message: error,
  7276. type: "error"
  7277. });
  7278. });
  7279. },
  7280. handleGroupAuditorData(data) {
  7281. const { reportAuditType } = this.user.timeType
  7282. if(reportAuditType != 1 && reportAuditType != 2) {
  7283. return {next: true}
  7284. }
  7285. let arrList = [];
  7286. Object.entries(data).forEach(([key, obj]) => {
  7287. Object.entries(obj).forEach(([projectName, projectData]) => {
  7288. if (projectData.workingTime && !projectData.groupId) {
  7289. arrList.push({
  7290. projectName,
  7291. date: obj.zhoDataTime,
  7292. dateText: obj.zhoDataTimeTxt
  7293. });
  7294. }
  7295. });
  7296. });
  7297. if(arrList.length > 0) {
  7298. return {
  7299. next: false,
  7300. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7301. }
  7302. } else {
  7303. return {
  7304. next: true,
  7305. error: [],
  7306. }
  7307. }
  7308. },
  7309. ChangeHourMinutestr (str) {
  7310. if (str !== "0" && str !== "" && str !== null) {
  7311. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7312. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7313. } else {
  7314. return "";
  7315. }
  7316. },
  7317. // 得到两个日期中间的日期
  7318. getdiffdate(stime,etime){
  7319. //初始化日期列表,数组
  7320. var diffdate = new Array();
  7321. var i=0;
  7322. //开始日期小于等于结束日期,并循环
  7323. while(stime<=etime){
  7324. diffdate[i] = stime;
  7325. //获取开始日期时间戳
  7326. var stime_ts = new Date(stime).getTime();
  7327. //增加一天时间戳后的日期
  7328. var next_date = stime_ts + (24*60*60*1000);
  7329. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7330. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7331. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7332. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7333. stime = next_dates_y+next_dates_m+next_dates_d;
  7334. //增加数组key
  7335. i++;
  7336. }
  7337. return diffdate;
  7338. },
  7339. // 添加模块
  7340. addDomain(i) {
  7341. var leftProgress = 10;
  7342. if (this.reportTimeType.type == 3) {
  7343. //计算已经待分配工时比例
  7344. let array = this.workForm.domains;
  7345. let totalProgress = 0;
  7346. for (var i=0;i<array.length; i++) {
  7347. totalProgress += array[i].progress;
  7348. }
  7349. if (totalProgress < 100) {
  7350. leftProgress = 100 - totalProgress;
  7351. }
  7352. }
  7353. var addItem = {
  7354. projectId: "",
  7355. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7356. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7357. ),
  7358. content: "",
  7359. progress:leftProgress,
  7360. state:2,//2-表示待提交
  7361. multiWorktime: this.reportTimeType.multiWorktime,
  7362. worktimeList:[{}],
  7363. canEdit: true,
  7364. auditorFirst: '',
  7365. auditorSec: '',
  7366. auditorThird: '',
  7367. ccUserid: ''
  7368. // degreeId: '',
  7369. };
  7370. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7371. this.$set(addItem,'isOvertime',true)
  7372. if(this.reportTimeType.type == 3){
  7373. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7374. }
  7375. }
  7376. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7377. //默认给第一个,必填字段
  7378. addItem.basecostId = this.timeBasecostList[0].id;
  7379. }
  7380. this.workForm.domains.push(addItem);
  7381. document.getElementById('workFormsItemBottom').scrollIntoView()
  7382. this.canEdit = true
  7383. if (this.reportTimeType.type == 0) {
  7384. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7385. var length = this.workForm.domains.length;
  7386. if (length == 2) {
  7387. this.showAddMore = false;
  7388. }
  7389. }
  7390. this.chuji()
  7391. this.seleChn()
  7392. },
  7393. // 移除模块
  7394. delDomain(i) {
  7395. this.workForm.domains.splice(i,1)
  7396. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7397. if (!this.originCanEdit) {
  7398. let iscan = false
  7399. for(let i in this.workForm.domains){
  7400. if(this.workForm.domains[i].canEdit){
  7401. iscan = true
  7402. }
  7403. }
  7404. this.canEdit = iscan
  7405. }
  7406. //检测当前剩下的一个,时间类型是否是全天
  7407. if (this.reportTimeType.type == 0) {
  7408. if (this.workForm.domains[0].timeType == 0) {
  7409. this.showAddMore = false;
  7410. } else {
  7411. this.showAddMore = true;
  7412. }
  7413. }
  7414. if(this.user.timeType.multiWorktime == 1) {
  7415. this.iptChangs()
  7416. } else {
  7417. this.seleChn(0)
  7418. }
  7419. },
  7420. // 改变月份
  7421. changeMonth() {
  7422. this.isWeekend = false
  7423. let date = new Date()
  7424. let nowmon = date.getMonth() + 1
  7425. let nowday = date.getDate()
  7426. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7427. if (this.isBatch == 0) {
  7428. if(this.user.timeType.fillAhead == 0){
  7429. let date_a = new Date(this.workForm.createDate)
  7430. if(date_a.getTime() > date.getTime()){
  7431. this.workForm.createDate = nowdate
  7432. }
  7433. }
  7434. //只有按天填报才能获取当天的日报
  7435. if(!this.isSubstitude){
  7436. let weekday = new Date(this.workForm.createDate).getDay()
  7437. if(this.user.companyId == 817){
  7438. if(weekday == 0){
  7439. this.isWeekend = true
  7440. }
  7441. }else{
  7442. if(weekday == 0 || weekday == 6){
  7443. this.isWeekend = true
  7444. }
  7445. }
  7446. this.getReport()
  7447. }
  7448. }else {
  7449. if(this.user.timeType.fillAhead == 0){
  7450. let date_a = new Date(this.workForm.createDate[1])
  7451. if(date_a.getTime() > date.getTime()){
  7452. this.workForm.createDate[1] = nowdate
  7453. let sdate = new Date(this.workForm.createDate[0])
  7454. let edate = new Date(this.workForm.createDate[1])
  7455. if(sdate > edate){
  7456. this.workForm.createDate[0] = this.workForm.createDate[1]
  7457. }
  7458. }
  7459. }
  7460. }
  7461. },
  7462. // 判断时间段
  7463. fns() {
  7464. for (let k in this.dateAr) {
  7465. if (!this.judege(k)) {
  7466. return false
  7467. }
  7468. }
  7469. return true
  7470. },
  7471. judege(idx){
  7472. for (let k in this.dateAr) {
  7473. if (idx !== k) {
  7474. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7475. return false
  7476. }
  7477. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7478. return false
  7479. }
  7480. }
  7481. }
  7482. return true
  7483. },
  7484. getOverlapData(data) {
  7485. let overlapData = [];
  7486. for (let i = 0; i < data.length; i++) {
  7487. for (let j = i + 1; j < data.length; j++) {
  7488. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7489. overlapData.push(data[i], data[j]);
  7490. }
  7491. }
  7492. }
  7493. return overlapData;
  7494. },
  7495. // 保存日报111111
  7496. submitReport(isDraft) {
  7497. this.isDraft = isDraft;
  7498. this.$refs.workForm.validate(valid => {
  7499. if (valid) {
  7500. if (!isDraft) {
  7501. //针对苏州景昱,单独的检查逻辑
  7502. if (this.user.companyId == 5978) {
  7503. //调接口,先检查工时是否存在异常
  7504. var totalTime = 0;
  7505. for (var t=0;t<this.workForm.domains.length; t++) {
  7506. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7507. }
  7508. var array = [];
  7509. if (this.isBatch) {
  7510. var startDate = new Date(this.workForm.createDate[0]);
  7511. var endDate = new Date(this.workForm.createDate[1]);
  7512. if (startDate > endDate) {
  7513. this.$message({
  7514. message: '开始日期不能大于结束日期',
  7515. type: "error"
  7516. });
  7517. return
  7518. } else {
  7519. while(true){
  7520. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7521. array.push(workData);
  7522. startDate.setDate(startDate.getDate() + 1);
  7523. if (startDate > endDate) {
  7524. break;
  7525. }
  7526. }
  7527. }
  7528. } else {
  7529. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7530. array.push(workData)
  7531. }
  7532. this.submitingReport = true;
  7533. var passUserId = this.user.id;
  7534. if (this.isSubstitude) {
  7535. passUserId = this.targetUids;
  7536. }
  7537. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7538. res => {
  7539. this.submitingReport = false;
  7540. if (res.code == "ok") {
  7541. this.submitReportSon()
  7542. } else {
  7543. this.$confirm(res.msg, '提示', {
  7544. confirmButtonText: '忽略并提交',
  7545. cancelButtonText: '取消',
  7546. type: 'error'
  7547. }).then(() => {
  7548. this.submitReportSon()
  7549. }).catch(() => {
  7550. });
  7551. }
  7552. },
  7553. error => {
  7554. this.$message({
  7555. message: error,
  7556. type: "error"
  7557. });
  7558. });
  7559. } else {
  7560. if(this.totalReportHours < this.user.timeType.allday){
  7561. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7562. confirmButtonText: '确定',
  7563. cancelButtonText: '取消',
  7564. type: 'warning'
  7565. }).then(() => {
  7566. this.submitReportSon()
  7567. }).catch(() => {
  7568. });
  7569. }else{
  7570. this.submitReportSon()
  7571. }
  7572. }
  7573. } else {
  7574. //暂存,不需要检查工时是否超过考勤
  7575. this.submitReportSon()
  7576. }
  7577. }
  7578. });
  7579. },
  7580. submitReportSon() {
  7581. this.dateAr = []
  7582. //检查重叠
  7583. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7584. let alp = []
  7585. if(this.user.timeType.multiWorktime != 1) {
  7586. for(var p in this.workForm.domains) {
  7587. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7588. let objs = {}
  7589. objs.s = this.workForm.domains[p].startTime
  7590. objs.e = this.workForm.domains[p].endTime
  7591. alp.push(objs)
  7592. }
  7593. }
  7594. this.dateAr = alp
  7595. if(this.dateAr.length > 0) {
  7596. let trus = this.fns()
  7597. if(!trus) {
  7598. this.$message({
  7599. message: this.$t('message.Filledtimeperiodsoverlap'),
  7600. type: "error"
  7601. });
  7602. return
  7603. }
  7604. }
  7605. } else {
  7606. for(var p in this.workForm.domains) {
  7607. var slll = this.workForm.domains[p]
  7608. for(var o in slll.worktimeList) {
  7609. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7610. let objs = {}
  7611. objs.s = slll.worktimeList[o].startTime
  7612. objs.e = slll.worktimeList[o].endTime
  7613. alp.push(objs)
  7614. }
  7615. }
  7616. }
  7617. this.dateAr = alp
  7618. if(this.dateAr.length > 0) {
  7619. let trus = this.fns()
  7620. if(!trus) {
  7621. this.$message({
  7622. message: this.$t('message.Filledtimeperiodsoverlap'),
  7623. type: "error"
  7624. });
  7625. return
  7626. }
  7627. }
  7628. }
  7629. }
  7630. //检查子项目
  7631. if (this.user.timeType.subProMustFill == 1) {
  7632. for(var p in this.workForm.domains) {
  7633. var oneProItem = this.workForm.domains[p]
  7634. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7635. //没有选择子项目
  7636. this.$message({
  7637. message: '子项目必填,请检查',
  7638. type: "error"
  7639. });
  7640. return
  7641. }
  7642. }
  7643. }
  7644. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7645. if (this.user.companyId == this.yuzhongCompId) {
  7646. for(var p in this.workForm.domains) {
  7647. var oneProItem = this.workForm.domains[p]
  7648. if (!oneProItem.extraField1) {
  7649. this.$message({
  7650. message: '角色必填,请检查',
  7651. type: "error"
  7652. });
  7653. return
  7654. }
  7655. if (!oneProItem.extraField2) {
  7656. this.$message({
  7657. message: '工作职责必填,请检查',
  7658. type: "error"
  7659. });
  7660. return
  7661. }
  7662. if (!oneProItem.extraField3) {
  7663. this.$message({
  7664. message: '工作内容必填,请检查',
  7665. type: "error"
  7666. });
  7667. return
  7668. }
  7669. }
  7670. }
  7671. // return
  7672. //代填的情况,检查人员是否已经选择
  7673. if (this.isSubstitude) {
  7674. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7675. this.$message({
  7676. message: this.$t('message.pleaseselectthepersontofillin'),
  7677. type: "error"
  7678. });
  7679. return;
  7680. }
  7681. }
  7682. //检查时间,全天和上下午不能同时存在
  7683. if (this.reportTimeType.type == 0) {
  7684. var alldayNum = 0;
  7685. var amNum = 0;
  7686. var pmNum = 0;
  7687. for(var i in this.workForm.domains) {
  7688. if (this.workForm.domains[i].timeType == 0) {
  7689. alldayNum ++;
  7690. } else if (this.workForm.domains[i].timeType == 1) {
  7691. amNum++;
  7692. } else if (this.workForm.domains[i].timeType == 2) {
  7693. pmNum++;
  7694. }
  7695. }
  7696. if (alldayNum > 1) {
  7697. this.$message({
  7698. // message: "工作时间-全天,只能选择一次",
  7699. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7700. type: "error"
  7701. });
  7702. return;
  7703. }
  7704. if (amNum > 1) {
  7705. this.$message({
  7706. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7707. type: "error"
  7708. });
  7709. return;
  7710. }
  7711. if (pmNum > 1) {
  7712. this.$message({
  7713. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7714. type: "error"
  7715. });
  7716. return;
  7717. }
  7718. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7719. this.$message({
  7720. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7721. type: "error"
  7722. });
  7723. return;
  7724. }
  7725. } else if (this.reportTimeType.type == 3) {
  7726. //总百分比不能超过100%
  7727. let total = 0;
  7728. this.workForm.domains.forEach(w=>{total += w.progress});
  7729. if (total > 100) {
  7730. this.$message({
  7731. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7732. type: "error"
  7733. });
  7734. return;
  7735. } else if (total < 100) {
  7736. this.$message({
  7737. message: this.$t('message.cannotbesubmitted'),
  7738. type: "error"
  7739. });
  7740. return;
  7741. }
  7742. }
  7743. this.listLoading = true;
  7744. let formData = new FormData();
  7745. formData.append("draft", this.isDraft);
  7746. var totalTime = 0;
  7747. for (var t=0;t<this.workForm.domains.length; t++) {
  7748. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7749. }
  7750. //批量填报不校验考勤时长,交给后台校验
  7751. if (!this.isBatch) {
  7752. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7753. if (this.workForm.time){
  7754. if (this.workForm.time.workHours == 0){
  7755. this.$message({
  7756. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7757. type: 'error'
  7758. })
  7759. return
  7760. }
  7761. }else{
  7762. this.$message({
  7763. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7764. type: 'error'
  7765. })
  7766. return
  7767. }
  7768. }
  7769. }
  7770. //针对凡己和景昱,此处不校验考勤时长
  7771. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7772. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7773. this.$message({
  7774. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7775. type: "error"
  7776. });
  7777. return;
  7778. }
  7779. }
  7780. for(var i in this.workForm.domains) {
  7781. // 检查任务/里程碑是否为必填
  7782. let taskRequired = this.user.timeType.taskRequired
  7783. if(taskRequired == 1) {
  7784. if(!this.workForm.domains[i].taskId) {
  7785. this.$message({
  7786. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7787. type: "error"
  7788. });
  7789. return
  7790. }
  7791. }
  7792. if(this.user.timeType.reportAuditType == 3){
  7793. let audItem = {}
  7794. let auditRule = ''
  7795. if(this.workForm.domains[i].id){
  7796. audItem.reportId = this.workForm.domains[i].id
  7797. }
  7798. if(this.user.timeType.auditLevel > 0){
  7799. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7800. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7801. }
  7802. if(this.user.timeType.auditLevel > 1){
  7803. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7804. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7805. }
  7806. if(this.user.timeType.auditLevel > 2){
  7807. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7808. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7809. }
  7810. if(this.workForm.domains[i].ccUserid){
  7811. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7812. }
  7813. if(auditRule){
  7814. auditRule = auditRule.substring(0,auditRule.length - 1)
  7815. this.$message({
  7816. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7817. type: 'error'
  7818. })
  7819. return
  7820. }
  7821. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7822. }
  7823. if (this.user.timeType.customDegreeActive) {
  7824. if (this.user.timeType.customDegreeMultiple) {
  7825. //多选
  7826. if (this.workForm.domains[i].multiDegrIdArray) {
  7827. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7828. degreeArray = degreeArray.replace(/,/g,"@");
  7829. formData.append("multiDegrId", degreeArray);
  7830. } else {
  7831. formData.append("multiDegrId", '[]');
  7832. }
  7833. } else {
  7834. //单选
  7835. if (this.workForm.domains[i].degreeId) {
  7836. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7837. } else {
  7838. formData.append("degreeId", -1);
  7839. }
  7840. }
  7841. } else {
  7842. formData.append("degreeId", -1);
  7843. }
  7844. if(this.workForm.domains[i].customData) {
  7845. // var sss = this.workForm.domains[i].degreeId.toString()
  7846. formData.append("customData", this.workForm.domains[i].customData);
  7847. } else {
  7848. formData.append("customData", 0);
  7849. }
  7850. if(this.workForm.domains[i].customText) {
  7851. formData.append("customText", this.workForm.domains[i].customText);
  7852. } else {
  7853. formData.append("customText", '-');
  7854. }
  7855. if (this.workForm.domains[i].id) {
  7856. formData.append("id", this.workForm.domains[i].id);
  7857. } else {
  7858. formData.append("id", -1);
  7859. }
  7860. formData.append("projectId", this.workForm.domains[i].projectId);
  7861. if (this.workForm.domains[i].subProjectId) {
  7862. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7863. } else {
  7864. formData.append("subProjectId", 0);
  7865. }
  7866. if (this.workForm.domains[i].groupId) {
  7867. formData.append("groupId", this.workForm.domains[i].groupId);
  7868. } else {
  7869. formData.append("groupId", 0);
  7870. }
  7871. if (this.workForm.domains[i].taskId) {
  7872. formData.append("taskId", this.workForm.domains[i].taskId);
  7873. } else {
  7874. formData.append("taskId", 0);
  7875. }
  7876. if (this.workForm.domains[i].taskFinish == true) {
  7877. formData.append("taskFinish", 1);
  7878. } else {
  7879. formData.append("taskFinish", 0);
  7880. }
  7881. formData.append("reportTimeType", this.reportTimeType.type);
  7882. if (this.reportTimeType.type == 0) {
  7883. formData.append("timeType", this.workForm.domains[i].timeType);
  7884. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7885. formData.append("workingTime", workingTime);
  7886. } else if (this.reportTimeType.type == 1){
  7887. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7888. } else if (this.reportTimeType.type == 2) {
  7889. formData.append("endTime", this.workForm.domains[i].endTime);
  7890. formData.append("startTime", this.workForm.domains[i].startTime);
  7891. } else if (this.reportTimeType.type == 3) {
  7892. //按比例分配
  7893. formData.append("progress", this.workForm.domains[i].progress);
  7894. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7895. }
  7896. if(this.user.timeType.choseFromAlbum == 1 ) {
  7897. console.log(this.workForm.domains[i].imgList)
  7898. if(this.workForm.domains[i].imgList) {
  7899. let imgListFor = this.workForm.domains[i].imgList
  7900. for(var b in imgListFor) {
  7901. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7902. }
  7903. console.log(imgListFor)
  7904. let m = JSON.stringify(imgListFor);
  7905. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7906. formData.append("picStr", m);
  7907. } else {
  7908. formData.append("picStr", '[]');
  7909. }
  7910. }
  7911. //处理多个时间事项
  7912. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7913. if (this.reportTimeType.multiWorktime == 1) {
  7914. //检查时间是否有重叠
  7915. var workList = this.workForm.domains[i].worktimeList;
  7916. for (var j=0;j<workList.length; j++) {
  7917. var curItem = workList[j];
  7918. //检查开始时间是否大于结束时间
  7919. if (curItem.startTime >= curItem.endTime) {
  7920. this.$message({
  7921. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7922. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7923. type: "error"
  7924. });
  7925. return;
  7926. }
  7927. //时间不可重叠
  7928. if (this.reportTimeType.timeCanOverlap == 0) {
  7929. for (var p = j+1;p<workList.length; p++) {
  7930. var jItem = workList[p];
  7931. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7932. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7933. this.$message({
  7934. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7935. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7936. type: "error"
  7937. });
  7938. return;
  7939. }
  7940. }
  7941. }
  7942. }
  7943. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7944. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7945. formData.append("content", m);
  7946. } else {
  7947. if (this.workForm.domains[i].content) {
  7948. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7949. m = m.replace(/,/g,",");
  7950. console.log(m, '需要传值的数据')
  7951. // formData.append("content", this.workForm.domains[i].content);
  7952. formData.append("content", m);
  7953. } else {
  7954. formData.append("content", '-');
  7955. }
  7956. }
  7957. if (this.isBatch == 0) {
  7958. formData.append("createDate", this.workForm.createDate);
  7959. } else {
  7960. //批量填报,时间范围
  7961. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7962. }
  7963. if(this.workForm.domains[i].isOvertime) {
  7964. formData.append("isOvertime", 1);
  7965. } else {
  7966. formData.append("isOvertime", 0);
  7967. }
  7968. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7969. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7970. } else {
  7971. formData.append("overtimeHours", 0);
  7972. }
  7973. if(this.workForm.domains[i].basecostId) {
  7974. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7975. } else {
  7976. formData.append("basecostId", 0);
  7977. }
  7978. if (this.workForm.userId != null) {
  7979. var targetUids = '';
  7980. this.workForm.userId.forEach(u=>{
  7981. targetUids += u + '@';
  7982. });
  7983. if (targetUids.length > 0) {
  7984. targetUids = targetUids.substring(0, targetUids.length -1);
  7985. formData.append("targetUids", targetUids);
  7986. }
  7987. }
  7988. //项目专业进度
  7989. if (this.workForm.domains[i].professionProgress) {
  7990. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7991. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7992. formData.append("professionProgress", m);
  7993. } else {
  7994. formData.append("professionProgress", "[]");
  7995. }
  7996. if (this.workForm.domains[i].stage) {
  7997. formData.append("stage", this.workForm.domains[i].stage);
  7998. } else {
  7999. formData.append("stage", "-");
  8000. }
  8001. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  8002. if (this.workForm.domains[i].projectAuditorId) {
  8003. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8004. } else {
  8005. // console.log('执行到了这里')
  8006. // console.log(this.user.timeType.reportAuditType)
  8007. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8008. this.$message({
  8009. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8010. type: "error"
  8011. });
  8012. return;
  8013. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  8014. //分组负责人先审核, 确定是选择了任务分组
  8015. if (this.workForm.domains[i].taskGroups.length == 0) {
  8016. this.$message({
  8017. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8018. type: "error"
  8019. });
  8020. } else if (!this.workForm.domains[i].groupId) {
  8021. // console.log(this.workForm.domains[i]);
  8022. this.$message({
  8023. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8024. type: "error"
  8025. });
  8026. } else {
  8027. this.$message({
  8028. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  8029. type: "error"
  8030. });
  8031. }
  8032. return;
  8033. }
  8034. }
  8035. if (this.user.companyId == this.yuzhongCompId) {
  8036. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8037. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8038. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8039. }
  8040. //依斯贝的服务Id
  8041. if (this.user.companyId == this.yisibeiCompId) {
  8042. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8043. }
  8044. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8045. this.$message({
  8046. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  8047. type: "error"
  8048. });
  8049. return
  8050. }
  8051. if(this.user.timeType.userWithMultiDept == 1) {
  8052. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8053. }
  8054. }
  8055. this.submitingReport = true;
  8056. this.http.uploadFile( this.port.report.editPort, formData,
  8057. res => {
  8058. this.listLoading = false;
  8059. this.submitingReport = false;
  8060. if (res.code == "ok") {
  8061. if(res.msg!=null){
  8062. this.$message({
  8063. dangerouslyUseHTMLString: true,
  8064. message: res.msg,
  8065. type: "warning",
  8066. showClose: true,
  8067. duration: 0
  8068. });
  8069. }else{
  8070. this.$message({
  8071. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8072. type: "success"
  8073. });
  8074. }
  8075. this.dialogVisible = false;
  8076. this.jsDay = 0
  8077. this.jsTime = 0
  8078. this.getReportList();
  8079. this.getDepartment();
  8080. this.getRecentlyProject()
  8081. } else {
  8082. this.$message({
  8083. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8084. type: "error"
  8085. });
  8086. }
  8087. },
  8088. error => {
  8089. this.listLoading = false;
  8090. this.submitingReport = false;
  8091. this.$message({
  8092. message: error,
  8093. type: "error"
  8094. });
  8095. });
  8096. },
  8097. // 判断是展示那个工时导入
  8098. imports() {
  8099. if(this.user.timeType.syncCorpwxTime == 0) {
  8100. this.importDialog = true
  8101. } else {
  8102. this.importWxDialog = true
  8103. }
  8104. },
  8105. // 跳转
  8106. junpToDeskTop(id) {
  8107. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8108. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8109. },
  8110. // 通过日报
  8111. approve(id, item) {
  8112. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8113. this.approveinData = {
  8114. id: id,
  8115. date: this.date +day,
  8116. reportIds: item.id
  8117. }
  8118. if(this.user.timeType.needEvaluate == 1){
  8119. this.$set(this.approveinData,'evaluate','')
  8120. this.approveinDialog = true
  8121. }else{
  8122. this.logining = true;
  8123. this.approveinfun()
  8124. }
  8125. },
  8126. approveinfun(){
  8127. this.http.post( this.port.report.approve, this.approveinData,
  8128. res => {
  8129. this.logining = false;
  8130. if (res.code == "ok") {
  8131. this.approveinDialog = false
  8132. this.$message({
  8133. message: this.$t('message.Reviewsucceeded'),
  8134. type: "success"
  8135. });
  8136. this.refreshReportData(this.approveinData.reportIds);
  8137. this.getDepartment();
  8138. } else {
  8139. this.$message({
  8140. message: res.msg,
  8141. type: "error"
  8142. });
  8143. }
  8144. },
  8145. error => {
  8146. this.logining = false;
  8147. this.$message({
  8148. message: error,
  8149. type: "error"
  8150. });
  8151. });
  8152. },
  8153. //撤回日报
  8154. cancel(item,e) {
  8155. // console.log('can can need',item);
  8156. this.logining = true;
  8157. var ids = '';
  8158. var data = e ? item : item.data;
  8159. data.forEach(element => {
  8160. if(element.id){
  8161. ids +=(element.id+',');
  8162. }
  8163. });
  8164. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8165. res => {
  8166. this.logining = false;
  8167. if (res.code == "ok") {
  8168. this.$message({
  8169. message:this.$t('message.Withdrawalsucceeded'),
  8170. type: "success"
  8171. });
  8172. this.getReportList();
  8173. if(e){this.getReport()}
  8174. this.getDepartment();
  8175. } else {
  8176. this.$message({
  8177. message: res.msg,
  8178. type: "error"
  8179. });
  8180. }
  8181. },
  8182. error => {
  8183. this.logining = false;
  8184. this.$message({
  8185. message: error,
  8186. type: "error"
  8187. });
  8188. });
  8189. },
  8190. showDenyDialog(id,i, item) {
  8191. this.denyReasonDialog = true;
  8192. this.isDenying = false;
  8193. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8194. var ids = item.id;
  8195. // var data = item.data;
  8196. // data.forEach(element => {
  8197. // ids +=(element.id+',');
  8198. // });
  8199. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8200. },
  8201. // 未通过日报
  8202. deny() {
  8203. this.logining = true;
  8204. this.isDenying = true;
  8205. this.http.post( this.port.report.deny, this.denyForm,
  8206. res => {
  8207. this.logining = false;
  8208. this.isDenying = false;
  8209. if (res.code == "ok") {
  8210. this.$message({
  8211. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8212. type: "success"
  8213. });
  8214. this.refreshReportData(this.denyForm.reportIds);
  8215. this.getDepartment();
  8216. this.denyReasonDialog = false;
  8217. } else {
  8218. this.$message({
  8219. message: res.msg,
  8220. type: "error"
  8221. });
  8222. }
  8223. },
  8224. error => {
  8225. this.logining = false;
  8226. this.$message({
  8227. message: error,
  8228. type: "error"
  8229. });
  8230. });
  8231. },
  8232. // 查看工时记录弹窗
  8233. toView() {
  8234. this.toViewDialogVisible = true
  8235. this.toViewloading = true
  8236. this.getToView()
  8237. },
  8238. getToView() {
  8239. this.http.post( '/report-import-log/getList', this.toViewForm,
  8240. res => {
  8241. this.toViewloading = false;
  8242. if (res.code == "ok") {
  8243. // console.log(res.data, '数据数据')
  8244. this.toViewList = res.data.records
  8245. this.toViewForm.total = res.data.total
  8246. } else {
  8247. this.toViewloading = false;
  8248. this.$message({
  8249. message: res.msg,
  8250. type: "error"
  8251. });
  8252. }
  8253. })
  8254. },
  8255. // 触发 selectCat 组件更改他的值
  8256. selectCatCli(obj) {
  8257. // console.log(obj, '看看')
  8258. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8259. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8260. },
  8261. vueCasader(obj) {
  8262. console.log(obj, '看看值', this.departmentList)
  8263. if(obj.distinction == 1 && obj.item) {
  8264. let arr = []
  8265. arr.push(obj.item.value)
  8266. this.exportParam.departmentId = arr
  8267. }
  8268. if(obj.distinction == '10' && obj) {
  8269. const { id, other } = obj
  8270. this.workForm.domains[other].reportTargetDeptId = id
  8271. }
  8272. if(obj.distinction == '14' && obj) {
  8273. let arr = []
  8274. arr.push(obj.id)
  8275. this.deptIdForHasReport = arr
  8276. this.showMonthWorkTime()
  8277. }
  8278. if(obj.distinction == '15' && obj) {
  8279. let arr = []
  8280. arr.push(obj.id)
  8281. this.deptIdForNoReport = arr
  8282. this.showMonthNotWorkTime()
  8283. }
  8284. if(obj.distinction == '16' && obj) {
  8285. let arr = []
  8286. arr.push(obj.id)
  8287. this.deptIdForReminder = arr
  8288. this.showMonthWorkTimeReminder()
  8289. }
  8290. },
  8291. //分页
  8292. handleCurrentChange(val) {
  8293. this.toViewForm.pageIndex = val;
  8294. this.getToView();
  8295. },
  8296. handleSizeChange(val) {
  8297. this.toViewForm.pageSize = val;
  8298. this.getToView();
  8299. },
  8300. getAllUsersList(){
  8301. this.http.post('/user/getSimpleActiveUserList',{
  8302. },res => {
  8303. if(res.code == 'ok'){
  8304. this.allUsersList = res.data
  8305. }else{
  8306. this.$message({
  8307. message: res.msg,
  8308. type: 'error'
  8309. })
  8310. }
  8311. },err => {
  8312. this.$message({
  8313. message: err,
  8314. type: 'error'
  8315. })
  8316. })
  8317. },
  8318. //景昱变更提醒
  8319. changeReminder(item){
  8320. console.log("============",item)
  8321. let parameter={
  8322. startDate: this.WorktimeDatepickValue[0],
  8323. endDate: this.WorktimeDatepickValue[1],
  8324. }
  8325. if(item){
  8326. parameter.createDate=item.createDate,
  8327. parameter.userId=item.userId
  8328. }
  8329. this.http.post('/report/changeReminder',parameter,res => {
  8330. if(res.code == 'ok'){
  8331. this.$message({
  8332. message: res.msg,
  8333. type: 'success'
  8334. })
  8335. }else{
  8336. this.$message({
  8337. message: res.msg,
  8338. type: 'error'
  8339. })
  8340. }
  8341. },err => {
  8342. this.$message({
  8343. message: err,
  8344. type: 'error'
  8345. })
  8346. })
  8347. },
  8348. //景昱取消异常
  8349. cancelReminder(item){
  8350. let parameter={}
  8351. if(item){
  8352. parameter.createDate=item.createDate,
  8353. parameter.userId=item.userId
  8354. }
  8355. this.http.post('/report/cancelReminder',parameter,res => {
  8356. if(res.code == 'ok'){
  8357. this.$message({
  8358. message: res.msg,
  8359. type: 'success'
  8360. })
  8361. }else{
  8362. this.$message({
  8363. message: res.msg,
  8364. type: 'error'
  8365. })
  8366. }
  8367. },err => {
  8368. this.$message({
  8369. message: err,
  8370. type: 'error'
  8371. })
  8372. })
  8373. this.showMonthWorkTimeReminder()
  8374. },
  8375. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8376. fillWeekCustomClne() {
  8377. this.fillWeekDialogVisiCustom = false
  8378. },
  8379. fillWeekCustomSubmit() {
  8380. this.getReportList();
  8381. this.getDepartment();
  8382. this.getRecentlyProject()
  8383. },
  8384. // 待填日报姓名搜索
  8385. nameAearchSeek(flg) {
  8386. if(!this.nameAearch) {
  8387. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8388. return
  8389. }
  8390. if(flg) {
  8391. this.enterpriseWechatgetUser()
  8392. }
  8393. },
  8394. handleThreeData(userList) {
  8395. console.log(userList, '人员数据')
  8396. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8397. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8398. },
  8399. // 过滤树节点
  8400. filterTreeNodes(treeData, filterKeywords) {
  8401. return treeData.filter((node) => {
  8402. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8403. if (node.children && node.children.length > 0) {
  8404. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8405. }
  8406. return true;
  8407. }
  8408. if (node.children && node.children.length > 0) {
  8409. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8410. return node.children.length > 0;
  8411. }
  8412. return false;
  8413. });
  8414. },
  8415. // 企业微信获取人员
  8416. enterpriseWechatgetUser() {
  8417. this.deptMembDataLoading = true
  8418. this.http.post('/user/getEmployeeList',{
  8419. departmentId: -1,
  8420. pageIndex: 1,
  8421. pageSize: 100,
  8422. keyword: this.nameAearch,
  8423. status: '',
  8424. roleId: '',
  8425. cursor: '',
  8426. onlyDirect: '',
  8427. matchingType: ''
  8428. },res => {
  8429. if(res.code == 'ok'){
  8430. this.deptMembDataLoading = false
  8431. const userListName = res.data.records.map(item => item.name)
  8432. this.handleThreeData(userListName)
  8433. }else{
  8434. this.deptMembDataLoading = false
  8435. this.$message({
  8436. message: res.msg,
  8437. type: 'error'
  8438. })
  8439. }
  8440. },err => {
  8441. this.deptMembDataLoading = false
  8442. this.$message({
  8443. message: err,
  8444. type: 'error'
  8445. })
  8446. })
  8447. },
  8448. // 按周填报获取相关任务
  8449. async getWeeklyTaskList(item) {
  8450. console.log(item, '<=== 数据')
  8451. const { projectId, groupId, stage, taskId } = item
  8452. console.log(projectId, groupId, stage)
  8453. let parms = { projectId, isSubstitude: 0 }
  8454. groupId ? parms.groupId = groupId : ''
  8455. stage ? parms.stage = stage : ''
  8456. const { data } = await this.postData('/task/getRecentTask', parms)
  8457. this.zhoBao.taskId = taskId
  8458. this.$set(this.zhoBao, 'taskList', data)
  8459. console.log(this.zhoBao)
  8460. },
  8461. // 封装 post 请求
  8462. postData(url, params) {
  8463. return new Promise((resolve, reject) => {
  8464. this.http.post(url, { ...params },
  8465. res => {
  8466. resolve(res)
  8467. },
  8468. error => {
  8469. this.$message({
  8470. message: error,
  8471. type: "error"
  8472. });
  8473. reject(error)
  8474. })
  8475. })
  8476. },
  8477. // 自定义事件
  8478. selectCal(obj) {
  8479. console.log(obj, '传数据来源')
  8480. if(obj.distinction == '1') {
  8481. this.zhoBao.projectAuditorId = obj.id
  8482. } else if(obj.distinction == '2') {
  8483. this.zhoBao.auditorFirst = obj.id
  8484. } else if(obj.distinction == '3') {
  8485. this.zhoBao.auditorSec = obj.id
  8486. } else if(obj.distinction == '4') {
  8487. this.zhoBao.auditorThird = obj.id
  8488. } else if(obj.distinction == '5') {
  8489. this.zhoBao.ccUserid = obj.id
  8490. } else if(obj.distinction == '12') {
  8491. this.usersListId = obj.id
  8492. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8493. this.searchKeyword = obj.name
  8494. } else {
  8495. this.searchKeyword = ''
  8496. }
  8497. this.searchScreen(0)
  8498. } else if(obj.distinction == '13') {
  8499. this.usersListId = obj.id
  8500. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8501. this.searchKeyword = obj.name
  8502. } else {
  8503. this.searchKeyword = ''
  8504. }
  8505. this.searchScreen(1)
  8506. }
  8507. }
  8508. },
  8509. created() {
  8510. this.getUsers()
  8511. let height = window.innerHeight;
  8512. this.tableHeight = height - 178;
  8513. const that = this;
  8514. window.onresize = function temp() {
  8515. that.tableHeight = window.innerHeight - 178;
  8516. };
  8517. this.toViewForm.companyId = this.user.companyId
  8518. this.initDrag([{
  8519. type: "LR",
  8520. domClass: {
  8521. // 中间分割线的名字
  8522. resize: "line-line",
  8523. // 左侧盒子的名字
  8524. left: "box-left",
  8525. // 右侧盒子的名字
  8526. right: "box-right",
  8527. // 父级的名字
  8528. box: "box-father",
  8529. },
  8530. otherInfo: {
  8531. // 限制左边栏最低宽度
  8532. leftWidth: 120,
  8533. },
  8534. },
  8535. {
  8536. type: "LR",
  8537. domClass: {
  8538. // 中间分割线的名字
  8539. resize: "line-second",
  8540. // 左侧盒子的名字
  8541. left: "left-laowang",
  8542. // 右侧盒子的名字
  8543. right: "box-second-father",
  8544. // 父级的名字
  8545. box: "grand",
  8546. },
  8547. otherInfo: {
  8548. // 限制左边栏最低宽度
  8549. leftWidth: 120,
  8550. },
  8551. },
  8552. ]);
  8553. }
  8554. };
  8555. </script>
  8556. <style lang="scss" scoped>
  8557. .fillWeekDialogVisiCustom {
  8558. width: 100%;
  8559. height: 70vh;
  8560. }
  8561. .fillWeekCustom {
  8562. .el-dialog__body {
  8563. padding: 20px 20px !important;
  8564. }
  8565. }
  8566. .photos {
  8567. position: relative;
  8568. display: flex;
  8569. flex-wrap: wrap;
  8570. }
  8571. .photos_img {
  8572. width: 120px;
  8573. height: 120px;
  8574. margin-right: 20px;
  8575. margin-bottom: 20px;
  8576. cursor: pointer;
  8577. img {
  8578. width: 100%;
  8579. height: 100%;
  8580. }
  8581. }
  8582. .paginatis {
  8583. padding: 10px 10px;
  8584. background: #f2f2f2;
  8585. }
  8586. .waiting {
  8587. color:orange;
  8588. }
  8589. .filledReportStyle {
  8590. color:#32CD32;
  8591. }
  8592. .RejectStyle {
  8593. color:red;
  8594. }
  8595. .waitSubmitStyle{
  8596. color: #409eff;
  8597. }
  8598. .chooseDate {
  8599. .waiting {
  8600. color: #20a0ff;
  8601. }
  8602. .filledReportStyle {
  8603. color:#20a0ff;
  8604. }
  8605. .RejectStyle {
  8606. color: #20a0ff;
  8607. }
  8608. .waitSubmitStyle{
  8609. color: #20a0ff;
  8610. }
  8611. }
  8612. .allDaily {
  8613. width:100%;
  8614. }
  8615. .report_title {
  8616. padding:10px 0;
  8617. color:#666;
  8618. }
  8619. .clearfix {
  8620. overflow-x: auto;
  8621. white-space: nowrap;
  8622. padding: 15px 0 10px 0;
  8623. // overflow-y: hidden;
  8624. .date_item {
  8625. padding: 0 3px;
  8626. cursor: pointer;
  8627. position: relative;
  8628. }
  8629. .chooseDate {
  8630. position: absolute;
  8631. bottom: -3px;
  8632. width: 37px;
  8633. height: 2px;
  8634. left: 14px;
  8635. background: #20a0ff;
  8636. }
  8637. }
  8638. .one_daily {
  8639. i {
  8640. color: #9ed0ff;
  8641. margin-right: 5px;
  8642. }
  8643. .one_daily_body {
  8644. padding: 10px 0px;
  8645. p {
  8646. margin: 0;
  8647. line-height: 30px;
  8648. }
  8649. }
  8650. ul {
  8651. padding: 0;
  8652. }
  8653. }
  8654. .checkbtn {
  8655. float: right;
  8656. margin-top: -10px;
  8657. }
  8658. .selConStyle{
  8659. margin-top:9rem;
  8660. margin-bottom:11rem;
  8661. .selConStyle_title{
  8662. height: 3rem;
  8663. text-align: center;
  8664. font-size: 17px;
  8665. }
  8666. .el-select{
  8667. margin: 0 15%;
  8668. width: 70%;
  8669. }
  8670. }
  8671. </style>
  8672. <style lang="scss">
  8673. /*去除upload组件过渡效果*/
  8674. .photos .el-upload-list__item {
  8675. transition: none !important;
  8676. }
  8677. .daily {
  8678. .el-card__body {
  8679. height: 80%;
  8680. overflow-y: auto;
  8681. }
  8682. .el-card__header {
  8683. padding: 0 20px;
  8684. }
  8685. }
  8686. .membListClass{
  8687. .el-dialog__body{
  8688. padding-top: 10px;
  8689. }
  8690. }
  8691. // .editReportDialog .el-dialog__footer{
  8692. // position: sticky;
  8693. // bottom: 0;
  8694. // background: #fff;
  8695. // height: 70px;
  8696. // z-index: 1010;
  8697. // }
  8698. .editReportDialog{
  8699. min-width: 800px;
  8700. }
  8701. .touruxiangmu{
  8702. max-width: 1000px;
  8703. }
  8704. </style>
  8705. <style scoped>
  8706. /* 项目标签的样式 */
  8707. .el-tag + .el-tag {
  8708. margin-left: 10px;
  8709. }
  8710. .button-new-tag {
  8711. margin-left: 10px;
  8712. height: 32px;
  8713. line-height: 30px;
  8714. padding-top: 0;
  8715. padding-bottom: 0;
  8716. }
  8717. .input-new-tag {
  8718. width: 90px;
  8719. margin-left: 10px;
  8720. vertical-align: bottom;
  8721. }
  8722. .selectworktime .el-table__fixed-body-wrapper{
  8723. top: 48px !important;
  8724. }
  8725. .selectworktime_export .selectworktime_export_l{
  8726. width: 650px;
  8727. float: left;
  8728. height: 42px;
  8729. }
  8730. .approvalProcessBox{
  8731. margin-left: 30px;
  8732. font-size: 14px;
  8733. line-height: 16px;
  8734. cursor: pointer;
  8735. }
  8736. .approvalProcessBox i {
  8737. margin-right: 0;
  8738. height: 16px;
  8739. width: 16px;
  8740. display: inline-block;
  8741. transform: scale(1.2);
  8742. position: relative;
  8743. top: 0.5px;
  8744. color: #409eff;
  8745. }
  8746. .approvalProcessBox .approvalProcessClick{
  8747. cursor: pointer;
  8748. color: #409eff;
  8749. font-size: 14px;
  8750. }
  8751. .approvalProcessBox:hover .approvalProcessClick{
  8752. color: #3485fb;
  8753. }
  8754. </style>
  8755. <style lang="scss" scoped>
  8756. .bionicClass {
  8757. -webkit-appearance: none;
  8758. background-color: #FFF;
  8759. background-image: none;
  8760. border-radius: 4px;
  8761. border: 1px solid #DCDFE6;
  8762. box-sizing: border-box;
  8763. color: #606266;
  8764. display: inline-block;
  8765. height: 40px;
  8766. line-height: 40px;
  8767. outline: 0;
  8768. padding: 0 15px;
  8769. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8770. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8771. width: 350px;
  8772. cursor: pointer;
  8773. .bionicClassText {
  8774. color: #C0C4CC;
  8775. }
  8776. }
  8777. // 加班样式
  8778. .overtime {
  8779. display: inline-block;
  8780. margin-left: 20px;
  8781. input {
  8782. display: inline-block;
  8783. margin-top: 5px;
  8784. }
  8785. }
  8786. .plus {
  8787. display: inline-block;
  8788. }
  8789. // .tages {
  8790. // float: right;
  8791. // }
  8792. .overtime {
  8793. display: inline-block;
  8794. margin-left: 30px;
  8795. }
  8796. .bloks {
  8797. display: inline-block;
  8798. width: 380px;
  8799. }
  8800. .zhiss {
  8801. display: flex;
  8802. justify-content: space-around;
  8803. align-items: center;
  8804. }
  8805. .zhoFel {
  8806. display: flex;
  8807. justify-content: space-between;
  8808. align-items: center;
  8809. }
  8810. // 左右滑动样式
  8811. .line {
  8812. width: 30px;
  8813. /* height: 500px; */
  8814. background: #f2f2f2;
  8815. cursor: w-resize;
  8816. }
  8817. .box-father {
  8818. border: 8px solid #000;
  8819. }
  8820. .line-second {
  8821. width: 10px;
  8822. /* background: red; */
  8823. }
  8824. .flex {
  8825. display: flex;
  8826. width: 100%;
  8827. }
  8828. .box-left {
  8829. flex: 0 0 400px;
  8830. /* height: 600px; */
  8831. /* background: blue; */
  8832. }
  8833. .box-right {
  8834. /* height: 600px; */
  8835. /* background: green; */
  8836. flex: 1;
  8837. }
  8838. .box-postion {
  8839. width: 200px;
  8840. /* height: 400px; */
  8841. background: #ccc;
  8842. }
  8843. .custom-tree-node {
  8844. flex: 1;
  8845. display: flex;
  8846. align-items: center;
  8847. justify-content: space-between;
  8848. font-size: 14px;
  8849. padding-right: 8px;
  8850. }
  8851. .daitianrbao {
  8852. width: 100%;
  8853. box-sizing: border-box;
  8854. height: 40px;
  8855. border-radius: 4px;
  8856. border: 1px solid #DCDFE6;
  8857. overflow: hidden;
  8858. text-overflow: ellipsis;
  8859. display: flex;
  8860. // align-items: center;
  8861. }
  8862. .daitianrbao .spnn {
  8863. display: inline-block;
  8864. box-sizing: border-box;
  8865. padding: 0 15px;
  8866. overflow: hidden;
  8867. text-overflow: ellipsis;
  8868. }
  8869. .daitianrbao .hover {
  8870. color: #DCDFE6 !important;
  8871. }
  8872. </style>