daily.vue 480 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. <!--针对景昱-->
  22. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  23. <i class="el-icon-warning" style="color:red;"></i>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </span>
  28. </div>
  29. </div>
  30. <div style="display:flex;">
  31. <div class="grand flex">
  32. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  34. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  35. </div> -->
  36. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  37. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  38. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  39. </el-input>
  40. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  41. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  42. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  43. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  44. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  45. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  46. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  47. </el-select>
  48. </div>
  49. <div>
  50. <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">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  53. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  54. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  55. </span>
  56. <div style="position: absolute;right: 15px;">
  57. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  58. <!-- 未填报 -->
  59. {{$t('state.DidNotFillIn')}}
  60. </span>
  61. <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'">
  62. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  63. {{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)')}}
  64. </span>
  65. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  66. <!-- 待审核 -->
  67. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  70. <!-- 已通过 -->
  71. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  74. <!-- 未通过 -->
  75. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  78. <!-- 待提交 -->
  79. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. </div>
  82. </span>
  83. </el-tree>
  84. </div>
  85. </div>
  86. </div>
  87. <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">
  88. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  89. -
  90. -
  91. -
  92. </div>
  93. </div>
  94. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  95. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  96. <div class="allDaily" style="float:left;flex-grow:1">
  97. <!--系统管理员和部门负责人 -->
  98. <div class="report_title" style="display:flex;justify-content: space-between;">
  99. <span>
  100. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  101. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  102. <!-- {{depData != null ?depData.label:""}} -->
  103. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  104. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  105. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  106. </span>
  107. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  108. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  109. </span>
  110. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="targetUid == null">
  112. <!-- - 已提交 -->
  113. -{{$t('state.hasBeenSubmitted')}}
  114. <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')}},
  115. <!-- 待提交 -->
  116. {{$t('state.waitingsubmit')}}
  117. <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')}},
  118. <!-- 漏填 -->
  119. <!-- {{$t('state.missFillReport')}} -->
  120. 未填
  121. <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')}}
  122. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  123. </span>
  124. </span>
  125. </span>
  126. <span style="float:right;">
  127. <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>
  128. <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>
  129. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  130. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  131. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  132. <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>
  133. <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>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  138. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  139. <el-link type="primary" v-if="user.roleName == '超级管理员' && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">日报审核修改</el-link>
  140. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  141. </span>
  142. </div>
  143. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  144. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  145. <i class="fa fa-circle"></i>
  146. <!-- {{item1.name}} -->
  147. <span v-if="user.userNameNeedTranslate == '1'">
  148. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  149. </span>
  150. <span v-if="user.userNameNeedTranslate != '1'">
  151. {{item1.name}}
  152. </span>
  153. <span style="margin-left:30px;">
  154. <span style="margin-right:20px;">
  155. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  156. <!-- 工作总时长: -->
  157. {{$t('other.totalWorkingHours')}}
  158. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  159. <span >{{item1.reportTime | amounts}}</span>h
  160. </span>
  161. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  162. <i class="iconfont firerock-iconliucheng1"></i>
  163. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  164. <!-- 审批流程 -->
  165. {{$t('other.approvalProcess')}}
  166. </span>
  167. </span>
  168. </span>
  169. <div class="checkbtn" style="padding-right:20px;">
  170. <!--编辑和删除日报-->
  171. <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>
  172. <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>
  173. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  174. </div>
  175. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  176. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  177. </div>
  178. <div class="one_daily_body">
  179. <el-timeline>
  180. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  181. <el-card shadow="never">
  182. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  183. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  184. <span v-if="user.company.packageEngineering == 0">
  185. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  186. <span v-if="user.timeType.reportAuditType == 7" >
  187. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  188. <span v-if="item2.deptAuditorName">、</span>
  189. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  190. </span>
  191. <span v-else>
  192. <span v-if="item2.isDeptAudit==0">
  193. <span v-if="item2.projectAuditState==0">
  194. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  195. <span v-if="item2.projectAuditorName != null">(
  196. <!-- {{item2.projectAuditorName}} -->
  197. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  206. )</span>
  207. <!-- 审核通过 --> {{$t('state.approved')}}
  208. </span>
  209. </span>
  210. <span v-else-if="item2.isDeptAudit==1">
  211. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  212. ({{$t('other.await')}}
  213. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  214. {{$t('other.audit')}})
  215. </span>
  216. </span>
  217. ]</span>
  218. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  219. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  220. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  221. </span>
  222. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  223. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  224. </span>
  225. <!-- <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> -->
  226. <span v-if="user.company.packageEngineering == 1">
  227. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  229. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  230. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  231. (
  232. <!-- <span v-if="user.userNameNeedTranslate != 1">
  233. {{item2.projectAuditorName}}
  234. </span>
  235. <span v-if="user.userNameNeedTranslate == 1">
  236. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  237. </span> -->
  238. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  239. )
  240. </span>{{$t('other.audit')}} ]</span>
  241. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  242. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  243. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  244. </span>
  245. <!--每个项目上单独审核 -->
  246. <span style="float:right;">
  247. <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>
  248. <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"
  249. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  250. <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"
  251. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  252. <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"
  253. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  254. <!--自己可以撤回待审核状态的报告 -->
  255. <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>
  256. </span>
  257. </p>
  258. <p v-if="user.companyId == yuzhongCompId">
  259. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  260. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  261. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  262. <!--任务分组和阶段 -->
  263. <p v-if="item2.groupId != 0">
  264. {{$t('other.taskGroup')}}:{{item2.groupName}}
  265. <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>
  266. </p>
  267. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  268. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  269. <!-- 自定义日报文本 -->
  270. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  271. <p v-if="user.company.packageEngineering == 1">
  272. {{$t('other.professionalProgress')}}:
  273. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  274. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  275. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  276. </el-tooltip>
  277. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  278. <i class="iconfont firerock-iconshenhetongguo"></i>
  279. </el-tooltip>
  280. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  281. <i class="iconfont firerock-iconshenhebohui"></i>
  282. </el-tooltip>
  283. </span>
  284. </p>
  285. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  286. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  287. </p>
  288. <div v-if="item2.multiWorktime==0">
  289. <p style="display: inline-block;">{{$t('time.duration')}}:
  290. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  291. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  292. {{item2.time.toFixed(1)}}h
  293. <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>
  294. </p>
  295. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  296. </div>
  297. <div v-if="item2.multiWorktime==1" >
  298. <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>
  299. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  300. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  301. <p style="display: inline-block;">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  303. {{timeItem.time.toFixed(1)}}h
  304. </p>
  305. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  306. </div>
  307. </div>
  308. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  309. <!--照片的显示 -->
  310. <p v-if="item2.pics != null && item2.pics.length > 0">
  311. <el-image v-for="(pic, index) in item2.pics" :key="index"
  312. style="width: 100px; height: 100px; margin-right:10px;"
  313. :src="pic"
  314. :preview-src-list="item2.pics">
  315. </el-image>
  316. </p>
  317. </el-card>
  318. </el-timeline-item>
  319. </el-timeline>
  320. </div>
  321. </div>
  322. <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>
  323. <!-- 简陋的无报告提示 -->
  324. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. </div>
  330. </el-card>
  331. </div>
  332. <!-- 工时推送日志弹窗 -->
  333. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  334. <template>
  335. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  336. </template>
  337. <template>
  338. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  339. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  340. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  341. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  342. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  343. <el-table-column prop="result" label="推送结果" width="250">
  344. <template slot-scope="scope">
  345. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  346. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  347. </template>
  348. </el-table-column>
  349. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  350. </el-table>
  351. </template>
  352. <span slot="footer" class="dialog-footer">
  353. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  354. </span>
  355. </el-dialog>
  356. <!-- 填写日报的dialog -->
  357. <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">
  358. <div style="height: 65vh;overflow: auto;">
  359. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  360. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  361. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  362. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  363. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  364. <span class="spnn" v-if="workForm.userNames">
  365. <span v-for="(item, index) in workForm.userNames" :key="index">
  366. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  367. <span v-if="index < workForm.userNames.length - 1">,</span>
  368. </span>
  369. </span>
  370. <span class="spnn hover" v-else>
  371. {{$t('defaultText.pleaseSelectAsubstitute')}}
  372. </span>
  373. </div>
  374. </el-form-item>
  375. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  376. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  377. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  378. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  379. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  380. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  381. <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>
  382. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  383. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  384. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  385. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  386. <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>
  387. <!-- AI智能填报 -->
  388. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  389. </el-form-item>
  390. <!--考勤时长显示-->
  391. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  392. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  393. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  394. </span>
  395. <!--批量填报和批量代填不显示考勤记录-->
  396. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  397. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  398. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  399. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  400. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  401. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  402. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  403. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  404. @click="refreshAttendance(workForm.createDate)"></el-button>
  405. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  406. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  407. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  408. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  409. </el-form-item>
  410. <!-- 000000 -->
  411. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  412. <div v-if="reportTimeType.multiWorktime==0">
  413. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  414. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  415. <el-select v-model="domain.timeType" style="width:200px;"
  416. v-if="reportTimeType.type == 0"
  417. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  418. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  419. @change="onTimeTypeChange(domain.timeType)">
  420. <el-option
  421. v-for="item in timeType"
  422. :key="item.value"
  423. :label="item.label"
  424. :value="item.value">
  425. </el-option>
  426. </el-select>
  427. <!-- 数字时长选择 -->
  428. <el-select v-model="domain.workingTime" style="width:200px;"
  429. v-if="reportTimeType.type == 1"
  430. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  431. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  432. @change="seleChn(0,domain)">
  433. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  434. </el-select>
  435. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  436. <span v-if="reportTimeType.type == 2">
  437. <!--时间范围选择 -->
  438. <el-time-picker
  439. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  440. v-model="domain.startTime"
  441. :placeholder="$t('time.startTime')"
  442. style="width:120px;"
  443. format="HH:mm"
  444. value-format="HH:mm"
  445. :picker-options="{
  446. start: '08:00',
  447. end: '23:30'
  448. }"
  449. @change="iptChang()">
  450. </el-time-picker> - <el-time-picker
  451. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  452. v-model="domain.endTime"
  453. :placeholder="$t('time.endTime')"
  454. style="width:120px;"
  455. format="HH:mm"
  456. value-format="HH:mm"
  457. :picker-options="{
  458. start: '08:00',
  459. end: '23:30',
  460. minTime: domain.startTime
  461. }"
  462. @change="iptChang()">
  463. </el-time-picker>
  464. </span>
  465. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  466. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  467. <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>
  468. </div>
  469. </el-form-item>
  470. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  471. :prop="'domains.' + index + '.reportTargetDeptId'"
  472. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  473. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  474. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  475. <span style="float: left">
  476. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  477. </span>
  478. </el-option>
  479. </el-select>
  480. <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>
  481. </el-form-item>
  482. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  483. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  484. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  485. @change="selectProject(domain, index)"
  486. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  487. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  488. <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">
  489. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  490. <span style="float: right;">{{ item.projectName }}</span>
  491. </el-option>
  492. </el-option-group>
  493. </el-select>
  494. <!--昱众不显示子项目-->
  495. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  496. <span style="margin-left:45px;">
  497. {{$t('lable.subproject')}}</span>
  498. <!--子项目 -->
  499. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  500. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  501. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  502. </el-select>
  503. </template>
  504. <template v-if="user.companyId == yuzhongCompId">
  505. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  506. <!--角色选择 -->
  507. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  508. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  509. <el-option
  510. v-for="item in roleList"
  511. :key="item.value"
  512. :label="item.label"
  513. :value="item.value">
  514. </el-option>
  515. </el-select>
  516. </template>
  517. <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%;"
  518. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  519. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  520. </el-link>
  521. <!-- <el-link type="primary" v-if="canEdit"
  522. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  523. </el-form-item>
  524. <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">
  525. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  526. </el-form-item>
  527. <!--如果设置了工时成本预警的预算成本项-->
  528. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  529. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  530. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  531. </el-select>
  532. </el-form-item>
  533. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  534. <template slot="label">
  535. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  536. <span >{{$t('lable.taskGrouping')}}</span>
  537. </template>
  538. <!-- 任务分组 -->
  539. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  541. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  542. </el-select>
  543. <template v-if="user.companyId == yuzhongCompId">
  544. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  545. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  546. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  547. <el-option
  548. v-for="item in domain.filteredRespList"
  549. :key="item.id"
  550. :label="item.jobRespon"
  551. :value="item.id">
  552. </el-option>
  553. </el-select>
  554. </template>
  555. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  556. <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>
  557. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  558. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  559. @change="changeStages(domain, index)"
  560. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  561. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  562. </el-select>
  563. </template>
  564. </el-form-item>
  565. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  566. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  567. <template slot="label">
  568. <span style="color:#FF0000;">*</span>
  569. <span >{{$t('other.projectAuditor')}}</span>
  570. </template>
  571. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  572. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  573. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  574. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  575. </el-option>
  576. </el-select>
  577. <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>
  578. </el-form-item>
  579. </div>
  580. <el-form-item v-if="user.companyId == yuzhongCompId">
  581. <template slot="label">
  582. <span style="color:#FF0000;">*</span>
  583. <span >工作内容</span>
  584. </template>
  585. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  586. :disabled="(workForm.domains[index].state>=2?false:true)" >
  587. <el-option
  588. v-for="item in domain.workContentList"
  589. :key="item.id"
  590. :label="item.workContext"
  591. :value="item.id">
  592. </el-option>
  593. </el-select>
  594. </el-form-item>
  595. <!-- 111111 -->
  596. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  597. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  598. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  599. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  600. <span v-else>{{item.name}}</span>
  601. </el-option>
  602. </el-select>
  603. <template v-if="user.timeType.auditLevel > 1">
  604. <i class="el-icon-right"></i>
  605. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  606. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  607. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  608. <span v-else>{{item.name}}</span>
  609. </el-option>
  610. </el-select>
  611. </template>
  612. <template v-if="user.timeType.auditLevel > 2">
  613. <i class="el-icon-right"></i>
  614. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  615. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  616. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  617. <span v-else>{{item.name}}</span>
  618. </el-option>
  619. </el-select>
  620. </template>
  621. </el-form-item>
  622. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  623. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  624. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  625. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  626. <span v-else>{{item.name}}</span>
  627. </el-option>
  628. </el-select>
  629. </el-form-item>
  630. <!-- 相关维度/自定义维度 -->
  631. <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'">
  632. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  633. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  634. </el-option>
  635. </el-select>
  636. </el-form-item>
  637. <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'">
  638. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  639. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  640. </el-option>
  641. </el-select>
  642. </el-form-item>
  643. <!-- 相关数值 -->
  644. <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">
  645. <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>
  646. </el-form-item>
  647. <!-- 自定义文本 -->
  648. <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">
  649. <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>
  650. </el-form-item>
  651. <!--按比例填报-->
  652. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  653. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  654. <div style="width:400px;">
  655. <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>
  656. <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>
  657. </div>
  658. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  659. <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>
  660. </div>
  661. </el-form-item>
  662. <!--工程专业版本模式下, 各个专业的进度填报 -->
  663. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  664. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  665. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  666. <el-input size="mini" style="width:60px;" v-model="item.progress"
  667. @keyup.native="onProgressChange"
  668. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  669. </span>
  670. </el-form-item>
  671. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  672. <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))" >
  673. <template slot="label" v-if="user.timeType.taskRequired == 1">
  674. <span style="color:#FF0000;">*</span>
  675. <span >任务</span>
  676. </template>
  677. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  678. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  679. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  680. </el-select>
  681. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  682. </el-form-item>
  683. <!--针对依斯贝的SAP服务-->
  684. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  685. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  686. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  687. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  688. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  689. </el-select>
  690. </el-form-item>
  691. <!--工作事项-->
  692. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  693. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  694. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  695. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  696. </el-form-item>
  697. <!-- 拍照上传 -->
  698. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  699. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  700. <div class="photos">
  701. <div>
  702. <el-upload
  703. list-type="picture-card"
  704. :http-request="(file) => {return addImg(file, index)}"
  705. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  706. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  707. :file-list="domain.imgListUrl" :limit="9"
  708. :disabled="workForm.domains[index].state>=2?false:true">
  709. <i class="el-icon-plus"></i>
  710. </el-upload>
  711. </div>
  712. </div>
  713. </el-form-item>
  714. </div>
  715. <!--多个工作事项填报的情况 -->
  716. <div v-if="reportTimeType.multiWorktime==1">
  717. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  718. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  719. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  720. @change="selectProject(domain, index)"
  721. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  722. <!-- <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">
  723. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  724. <span style="float: right;">{{ item.projectName }}</span>
  725. </el-option> -->
  726. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  727. <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">
  728. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  729. <span style="float: right;">{{ item.projectName }}</span>
  730. </el-option>
  731. </el-option-group>
  732. </el-select>
  733. <template v-if="user.timeType.mainProjectState != 1">
  734. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  735. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  736. <!--子项目 -->
  737. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  738. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  740. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  741. </el-select>
  742. </template>
  743. <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;"
  744. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  745. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  746. </el-link>
  747. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  748. <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>
  749. </div>
  750. <!-- <el-link type="primary" v-if="canEdit"
  751. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  752. </el-form-item>
  753. <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">
  754. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  755. </el-form-item>
  756. <!--如果设置了工时成本预警的预算成本项-->
  757. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  758. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  759. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  760. </el-select>
  761. </el-form-item>
  762. <el-form-item v-if="user.company.packageProject == 1">
  763. <template slot="label">
  764. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  765. <span >{{$t('lable.taskGrouping')}}</span>
  766. </template>
  767. <!-- 任务分组 -->
  768. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  769. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  770. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  771. </el-select>
  772. <!-- 项目的阶段 -->
  773. <span v-if="domain.stages != null && domain.stages.length> 0"
  774. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  775. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  776. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  777. @change="changeStages(domain, index)"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  779. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  780. </el-select>
  781. </el-form-item>
  782. <el-form-item :label="$t('other.projectAuditor')" >
  783. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  784. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  785. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  786. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  787. </el-option>
  788. </el-select>
  789. <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>
  790. </el-form-item>
  791. <!--工程专业版本模式下, 各个专业的进度填报 -->
  792. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  793. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  794. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  795. <el-input size="mini" style="width:60px;" v-model="item.progress"
  796. @keyup.native="onProgressChange"
  797. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  798. </span>
  799. </el-form-item>
  800. <!-- 相关维度 -->
  801. <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'">
  802. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  803. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  804. </el-option>
  805. </el-select>
  806. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  807. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  808. </el-option>
  809. </el-select>
  810. </el-form-item>
  811. <!-- 相关数值 -->
  812. <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">
  813. <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>
  814. </el-form-item>
  815. <!-- 自定义文本 -->
  816. <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">
  817. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  818. </el-form-item>
  819. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  820. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  821. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  822. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  823. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  824. </el-select>
  825. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  826. </el-form-item>
  827. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  828. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  829. <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>
  830. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  831. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  832. <span v-if="reportTimeType.type == 2">
  833. <!-- <span> -->
  834. <!--时间范围选择 -->
  835. <el-time-picker
  836. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  837. v-model="timeItem.startTime"
  838. :placeholder="$t('time.startTime')"
  839. style="width:120px;"
  840. format="HH:mm"
  841. value-format="HH:mm"
  842. :picker-options="{
  843. start: '00:00',
  844. end: '23:59',
  845. }"
  846. @change="iptChangs()">
  847. </el-time-picker> - <el-time-picker
  848. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  849. v-model="timeItem.endTime"
  850. :placeholder="$t('time.endTime')"
  851. style="width:120px;"
  852. format="HH:mm"
  853. value-format="HH:mm"
  854. :picker-options="{
  855. start: '00:00',
  856. end: '23:59',
  857. minTime: timeItem.startTime
  858. }"
  859. @change="iptChangs()">
  860. </el-time-picker>
  861. </span>
  862. </el-form-item>
  863. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  864. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  865. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  866. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  867. ></el-input>
  868. </el-form-item>
  869. </div>
  870. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  871. </div>
  872. <!--照片的显示 -->
  873. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  874. <el-image v-for="(pic, index) in domain.pics" :key="index"
  875. style="width: 100px; height: 100px; margin-right:10px;"
  876. :src="pic"
  877. :preview-src-list="domain.pics">
  878. </el-image>
  879. </p>
  880. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  881. </div>
  882. <span id="workFormsItemBottom"></span>
  883. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  884. </el-form>
  885. </div>
  886. <span slot="footer" class="dialog-footer">
  887. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  888. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  889. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  890. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  891. <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>
  892. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  893. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  894. </span>
  895. </el-dialog>
  896. <!-- 按周填报 -->
  897. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  898. <!-- 按周填报-已填工时-点击 -->
  899. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  900. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  901. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  902. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  903. <el-table-column prop="state" :label="$t('state.states')">
  904. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  905. </el-table-column>
  906. <!-- <el-table-column label="操作">
  907. <template slot-scope="scope">
  908. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  909. </template>
  910. </el-table-column> -->
  911. </el-table>
  912. <span slot="footer" class="dialog-footer">
  913. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  914. </span>
  915. </el-dialog>
  916. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  917. <el-form-item style="height:30px;margin-top:-72px;">
  918. <!-- <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> -->
  919. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  920. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  921. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  922. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  923. <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>
  924. <el-option
  925. v-for="item in fillProjectList"
  926. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  927. :key="item.id"
  928. :label="item.projectName + '\u3000' + item.projectCode"
  929. :value="item.id">
  930. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  931. <span style="float: right">{{ item.projectName }}</span>
  932. </el-option>
  933. </el-select>
  934. <span style="float:right;margin-right:10px;">选择项目</span>
  935. </el-form-item>
  936. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  937. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  938. <template slot-scope="scope">
  939. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  940. </template>
  941. </el-table-column>
  942. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  943. <template slot-scope="scope">
  944. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  945. <p v-else></p>
  946. </template>
  947. </el-table-column> -->
  948. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  949. <template slot-scope="scope">
  950. <div v-if="scope.row.canFill == 1">
  951. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  952. <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>
  953. <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>
  954. <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>
  955. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  956. </div>
  957. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  958. <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>
  959. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  960. </div>
  961. </div>
  962. <div v-else >
  963. <span style="color:#999999;">不可超前填报</span>
  964. </div>
  965. </template>
  966. </el-table-column>
  967. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  968. <template slot-scope="scope">
  969. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  970. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  971. </template>
  972. </el-table-column>
  973. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  974. <template slot-scope="scope">
  975. <div class="zhiss">
  976. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  977. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  978. </div>
  979. </template>
  980. </el-table-column>
  981. </el-table>
  982. </el-form>
  983. <span slot="footer" class="dialog-footer" >
  984. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  985. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  986. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  987. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  988. <!--针对景昱,先检查工时是否存在异常-->
  989. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  990. </span>
  991. </el-dialog>
  992. <!-- 重庆物奇私人定制的按周填报 -->
  993. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  994. <div class="fillWeekDialogVisiCustom">
  995. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  996. </div>
  997. </el-dialog>
  998. <!-- 选择时间 -->
  999. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1000. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1001. <span slot="footer" class="dialog-footer">
  1002. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1003. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1004. </span>
  1005. </el-dialog>
  1006. <!-- 按周填报弹窗 -->
  1007. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1008. <div>
  1009. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1010. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1011. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1012. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <!--如果设置了工时成本预警的预算成本项-->
  1016. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1017. <p>{{$t('lable.budgetSource')}}</p>
  1018. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1019. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1020. </el-select>
  1021. </div>
  1022. <!-- 任务分组 -->
  1023. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1024. <p>{{$t('lable.taskGrouping')}}</p>
  1025. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1026. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1027. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1028. </el-select>
  1029. </div>
  1030. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1031. <p>{{$t('other.inputStage')}}</p>
  1032. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1033. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1034. </el-select>
  1035. </div>
  1036. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1037. <p>{{$t('other.reviewer')}}</p>
  1038. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1039. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1040. </el-select>
  1041. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1042. </div>
  1043. <template v-if="user.timeType.reportAuditType == 3">
  1044. <div class="zhoFel">
  1045. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1046. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. <div class="zhoFel">
  1052. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1053. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1054. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1055. </el-select>
  1056. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1057. </div>
  1058. <div class="zhoFel">
  1059. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1060. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1061. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. <div class="zhoFel">
  1066. <p>{{ $t('chao-song-ren') }}</p>
  1067. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1068. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1069. </el-select>
  1070. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1071. </div>
  1072. </template>
  1073. <!-- 自定义维度 -->
  1074. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1075. <p>{{user.timeType.customDegreeName}}</p>
  1076. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1077. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1078. </el-select>
  1079. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1080. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1081. </el-select>
  1082. </div>
  1083. <!-- 自定义数值 -->
  1084. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1085. <p>{{user.timeType.customDataName}}</p>
  1086. <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>
  1087. </div>
  1088. <!-- 自定义文本 -->
  1089. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1090. <p>{{user.timeType.customTextName}}</p>
  1091. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1092. </div>
  1093. <!-- 选择任务 -->
  1094. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1095. <p>任务 / 里程碑</p>
  1096. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1097. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1098. </el-select>
  1099. </div>
  1100. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1101. <p>{{$t('other.timeSelection')}}</p>
  1102. <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>
  1103. </div>
  1104. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1105. <p>{{$t('other.chooseDuration')}}</p>
  1106. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1107. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1108. </el-select>
  1109. </div>
  1110. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1111. <p>{{$t('lable.percentageOfTime')}}</p>
  1112. <div style="width:400px;display: flex;align-items: center;">
  1113. <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>
  1114. <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>
  1115. </div>
  1116. </div>
  1117. <div class="zhoFel">
  1118. <p>{{$t('other.workMatters')}}</p>
  1119. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1120. </div>
  1121. </div>
  1122. <span slot="footer" class="dialog-footer">
  1123. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1124. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1125. </span>
  1126. </el-dialog>
  1127. <!--导出报表条件选择 -->
  1128. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1129. <el-form ref="form3" :model="exportParam" >
  1130. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1131. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1132. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1136. <!-- <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>
  1137. <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> -->
  1138. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1139. </el-form-item>
  1140. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1141. <el-date-picker
  1142. v-model="exportParam.dateRange" :editable="false"
  1143. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1144. :range-separator="$t('other.to')"
  1145. type="daterange"
  1146. :start-placeholder="$t('time.startDate')"
  1147. :end-placeholder="$t('time.endDate')"
  1148. ></el-date-picker>
  1149. </el-form-item>
  1150. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1151. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1152. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1153. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1154. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1155. </el-select>
  1156. </el-form-item>
  1157. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1158. <div class="exportReportRadio">
  1159. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1160. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1161. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1162. <i class="el-icon-question"></i>
  1163. </el-tooltip>
  1164. </div>
  1165. </el-form-item>
  1166. </el-form>
  1167. <div slot="footer" class="dialog-footer">
  1168. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1169. </div>
  1170. </el-dialog>
  1171. <!--导出报表条件选择 -->
  1172. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1173. <el-form ref="form3" :model="exportParam" >
  1174. <el-form-item prop="range" :label="$t('time.dateRange')">
  1175. <el-date-picker
  1176. v-model="exportParam.dateRange" :editable="false"
  1177. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1178. :clearable="true"
  1179. :range-separator="$t('other.to')"
  1180. type="daterange"
  1181. :start-placeholder="$t('time.startDate')"
  1182. :end-placeholder="$t('time.endDate')"
  1183. ></el-date-picker>
  1184. </el-form-item>
  1185. </el-form>
  1186. <div slot="footer" class="dialog-footer">
  1187. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1188. </div>
  1189. </el-dialog>
  1190. <!--人员列表 -->
  1191. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1192. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1193. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1194. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1195. <el-table-column type="selection"></el-table-column>
  1196. <el-table-column prop="label" :label="$t('lable.name')" >
  1197. <template slot-scope="scope">
  1198. <span>
  1199. <!-- {{(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}} -->
  1200. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1201. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1202. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1203. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1204. </span>
  1205. <span v-else>
  1206. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1208. </span>
  1209. </span>
  1210. </template>
  1211. </el-table-column>
  1212. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1213. <template slot-scope="scope">
  1214. <div>
  1215. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1216. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1217. </div>
  1218. </template>
  1219. </el-table-column>
  1220. </el-table>
  1221. </el-tab-pane>
  1222. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1223. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1224. <el-table-column prop="label" :label="$t('lable.name')" >
  1225. <template slot-scope="scope">
  1226. <!-- <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> -->
  1227. <!-- <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> -->
  1228. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1229. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1230. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1231. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1232. </span>
  1233. <span v-else>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1236. </span>
  1237. </template>
  1238. </el-table-column>
  1239. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1240. <template slot-scope="scope">
  1241. <div>
  1242. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1243. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1244. </div>
  1245. </template>
  1246. </el-table-column>
  1247. </el-table>
  1248. </el-tab-pane>
  1249. </el-tabs>
  1250. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1251. <el-table-column type="selection"></el-table-column>
  1252. <el-table-column prop="label" :label="$t('lable.name')" >
  1253. <template slot-scope="scope">
  1254. <div>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1257. </div>
  1258. </template>
  1259. </el-table-column>
  1260. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1261. <template slot-scope="scope">
  1262. <div>
  1263. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1264. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1265. </div>
  1266. </template>
  1267. </el-table-column>
  1268. </el-table>
  1269. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1270. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1271. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1272. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1273. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1274. </div>
  1275. </el-dialog>
  1276. <!-- 日报审核修改 -->
  1277. <el-dialog
  1278. title="日报审核修改"
  1279. :visible.sync="reportLogCheckDialog"
  1280. width="30%"
  1281. :before-close="handleClose">
  1282. <el-form ref="form3" :model="exportReportLogParam" >
  1283. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1284. <el-date-picker
  1285. v-model="exportReportLogParam.dateRange" :editable="false"
  1286. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1287. :range-separator="$t('other.to')"
  1288. type="daterange"
  1289. :start-placeholder="$t('time.startDate')"
  1290. :end-placeholder="$t('time.endDate')"
  1291. ></el-date-picker>
  1292. </el-form-item>
  1293. </el-form>
  1294. <el-link type="primary" @click="exportReportLog">导出日报审核记录数据</el-link>
  1295. <br>
  1296. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1297. <el-link type="primary" @click="importReportLog">导入日报审核记录修改数据</el-link></el-upload>
  1298. <span slot="footer" class="dialog-footer">
  1299. <el-button type="primary" @click="reportLogCheckDialog = false">关闭</el-button>
  1300. </span>
  1301. </el-dialog>
  1302. <!-- 按部门选择人员 -->
  1303. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1304. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1305. <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)">
  1306. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1307. </el-input>
  1308. <div class="tree" style="height:400px">
  1309. <el-scrollbar style="height:100%">
  1310. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1311. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1312. highlight-current :filter-node-method="filterNode">
  1313. <span class="custom-tree-node" slot-scope="{ node }">
  1314. <span v-if="user.userNameNeedTranslate == '1'">
  1315. <span v-if="node.data.children">
  1316. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1317. </span>
  1318. <span v-else>
  1319. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1320. </span>
  1321. </span>
  1322. <span v-if="user.userNameNeedTranslate != '1'">
  1323. {{ node.label }}
  1324. </span>
  1325. <!-- {{ node.label }} -->
  1326. </span>
  1327. </el-tree>
  1328. </el-scrollbar>
  1329. </div>
  1330. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1331. <div slot="footer" class="dialog-footer">
  1332. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1333. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1334. </div>
  1335. </el-dialog>
  1336. <el-dialog
  1337. v-if="monthWorkTimeDialog"
  1338. :visible.sync="monthWorkTimeDialog"
  1339. :close-on-click-modal="false"
  1340. customClass="customWidth selectworktime"
  1341. width="92%"
  1342. top="60px"
  1343. >
  1344. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1345. <el-tabs v-model="activeName" @tab-click="handleClick">
  1346. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1347. <div class="selectworktime_export" style="margin-top:10px;">
  1348. <div class="selectworktime_export_l">
  1349. <el-date-picker
  1350. class="selecteworktime_datapick"
  1351. v-model="WorktimeDatepickValue"
  1352. value-format="yyyy-MM-dd"
  1353. type="daterange"
  1354. align="right"
  1355. unlink-panels
  1356. :range-separator="$t('other.to')"
  1357. :start-placeholder="$t('time.startDate')"
  1358. :end-placeholder="$t('time.endDate')"
  1359. :default-time="['12:00:00', '12:00:00']"
  1360. size="small"
  1361. popper-class="selecteorktime_datapick_popper"
  1362. @change="showMonthWorkTime()"
  1363. >
  1364. </el-date-picker>
  1365. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1366. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1367. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1368. <!-- 222 -->
  1369. </div>
  1370. <div>
  1371. <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">
  1372. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1373. </el-input>
  1374. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1375. <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>
  1376. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthWorkTime()"></vueCascader>
  1377. </div>
  1378. <div style="float: left; height:32px; padding-top:10px;">
  1379. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">待审核</span>
  1380. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">已通过</span>
  1381. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">已驳回</span>
  1382. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">未提交</span>
  1383. </div>
  1384. <div style="float: right; vertical-align: middle;height:32px">
  1385. <el-link
  1386. type="primary"
  1387. @click="exportMembWorkHours()"
  1388. >{{$t('export.exportData')}}</el-link
  1389. >
  1390. </div>
  1391. </div>
  1392. <el-table ref="hasworkTbl"
  1393. :data="monthWorkDataS"
  1394. v-el-table-infinite-scroll="listScroll"
  1395. border
  1396. :height="'70vh'"
  1397. highlight-current-row
  1398. style="width: 100%"
  1399. v-loading="tbload"
  1400. :lazy="true"
  1401. :cell-style="hasworkTblCellStyle"
  1402. >
  1403. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1404. <template slot-scope="scope">
  1405. {{ scope.$index + 1 }}
  1406. </template>
  1407. </el-table-column>
  1408. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1409. <template slot-scope="scope">
  1410. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1411. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1412. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1413. <!-- {{scope.row.name}} -->
  1414. </span>
  1415. </template>
  1416. </el-table-column>
  1417. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1418. <template slot-scope="scope">
  1419. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1420. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1421. </template>
  1422. </el-table-column>
  1423. <el-table-column
  1424. min-width="60"
  1425. v-for="(item, index) in pickDateArray"
  1426. :key="index"
  1427. :label="item"
  1428. align="center"
  1429. >
  1430. <template slot="header" slot-scope="scope">
  1431. <div>{{ scope.column.label.dateStr }}</div>
  1432. <div>{{ scope.column.label.weekStr }}</div>
  1433. </template>
  1434. <template slot-scope="scope">
  1435. <div
  1436. v-if="
  1437. scope.row.worktimeList.filter(
  1438. (w) =>
  1439. w.createDate==item.date
  1440. ).length > 0 &&
  1441. scope.row.worktimeList.filter(
  1442. (w) =>w.createDate==item.date
  1443. )[0].workingTime < reportTimeType.allday
  1444. "
  1445. >
  1446. {{
  1447. scope.row.worktimeList.filter(
  1448. (w) =>w.createDate==item.date
  1449. )[0].workingTime.toFixed(1)
  1450. }}
  1451. </div>
  1452. <div
  1453. v-if="
  1454. scope.row.worktimeList.filter(
  1455. (w) =>w.createDate==item.date
  1456. ).length > 0 &&
  1457. scope.row.worktimeList.filter(
  1458. (w) =>w.createDate==item.date
  1459. )[0].workingTime > reportTimeType.allday
  1460. "
  1461. >
  1462. {{
  1463. scope.row.worktimeList.filter(
  1464. (w) =>w.createDate==item.date
  1465. )[0].workingTime.toFixed(1)
  1466. }}
  1467. </div>
  1468. <div
  1469. v-if="
  1470. scope.row.worktimeList.filter(
  1471. (w) =>w.createDate==item.date
  1472. ).length > 0 &&
  1473. scope.row.worktimeList.filter(
  1474. (w) =>w.createDate==item.date
  1475. )[0].workingTime == reportTimeType.allday
  1476. "
  1477. >
  1478. {{
  1479. scope.row.worktimeList.filter(
  1480. (w) =>w.createDate==item.date
  1481. )[0].workingTime
  1482. }}
  1483. </div>
  1484. <div
  1485. v-if="
  1486. scope.row.worktimeList.filter(
  1487. (w) =>w.createDate==item.date
  1488. ).length == 0
  1489. "
  1490. >
  1491. 0
  1492. </div>
  1493. <div
  1494. v-if="
  1495. scope.row.worktimeList.filter(
  1496. (w) =>w.createDate==item.date
  1497. ).length > 0 &&
  1498. typeof scope.row.worktimeList.filter(
  1499. (w) =>w.createDate==item.date
  1500. )[0].workingTime == 'string'
  1501. "
  1502. >
  1503. {{
  1504. scope.row.worktimeList.filter(
  1505. (w) =>w.createDate==item.date
  1506. )[0].workingTime
  1507. }}
  1508. </div>
  1509. </template>
  1510. </el-table-column>
  1511. </el-table>
  1512. <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>
  1513. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1514. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1515. <label style="font-size: 16px">员工每日已填报工时数</label>
  1516. <el-link
  1517. type="primary"
  1518. style="float: right; margin-right: 60px"
  1519. @click="exportMembWorkHours()"
  1520. >导出已填报数据</el-link
  1521. > -->
  1522. <!-- <el-button >导出</el-button> -->
  1523. <!-- </div> -->
  1524. </el-tab-pane>
  1525. <el-tab-pane label="未提交人员列表" name="second" >
  1526. <div class="selectworktime_export" style="margin-top:10px">
  1527. <div class="selectworktime_export_l">
  1528. <el-date-picker
  1529. class="selecteworktime_datapick"
  1530. v-model="WorktimeDatepickValue"
  1531. value-format="yyyy-MM-dd"
  1532. type="daterange"
  1533. align="right"
  1534. unlink-panels
  1535. :range-separator="$t('other.to')"
  1536. :start-placeholder="$t('time.startDate')"
  1537. :end-placeholder="$t('time.endDate')"
  1538. :default-time="['12:00:00', '12:00:00']"
  1539. size="small"
  1540. popper-class="selecteorktime_datapick_popper"
  1541. @change="showMonthNotWorkTime()"
  1542. >
  1543. </el-date-picker>
  1544. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1545. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1546. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1547. </div>
  1548. <div>
  1549. <div style="margin-top:10px;">
  1550. <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>
  1551. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1552. <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">
  1553. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1554. </el-input>
  1555. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1556. <el-link
  1557. type="primary"
  1558. style="float: right; vertical-align: middle;height:32px"
  1559. @click="exportMembNotWorkHours()"
  1560. >{{$t('export.exportData')}}</el-link
  1561. >
  1562. </div>
  1563. </div>
  1564. </div>
  1565. <el-table
  1566. ref="hasworkTbl2"
  1567. :data="monthNotWorkDateS"
  1568. v-el-table-infinite-scroll="notListScroll"
  1569. border
  1570. :height="'70vh'"
  1571. highlight-current-row
  1572. style="width: 100%"
  1573. v-loading="tbload"
  1574. lazy
  1575. >
  1576. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1577. <template slot-scope="scope">
  1578. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1579. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1580. </template>
  1581. </el-table-column>
  1582. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1583. <template slot-scope="scope">
  1584. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1585. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1586. </template>
  1587. </el-table-column>
  1588. <el-table-column
  1589. min-width="200"
  1590. :label="$t('weekDay.date')"
  1591. align="center"
  1592. prop="createDate"
  1593. >
  1594. </el-table-column>
  1595. <el-table-column
  1596. min-width="200"
  1597. :label="$t('state.states')"
  1598. align="center"
  1599. prop="status"
  1600. />
  1601. <el-table-column
  1602. min-width="200"
  1603. :label="$t('other.attendanceData')"
  1604. prop="cardTime"
  1605. align="center"
  1606. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1607. </el-table>
  1608. <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>
  1609. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1610. </el-tab-pane>
  1611. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1612. <div class="selectworktime_export" style="margin-top:10px;">
  1613. <div class="selectworktime_export_l">
  1614. <el-date-picker
  1615. class="selecteworktime_datapick"
  1616. v-model="WorktimeDatepickValue"
  1617. value-format="yyyy-MM-dd"
  1618. type="daterange"
  1619. align="right"
  1620. unlink-panels
  1621. :range-separator="$t('other.to')"
  1622. :start-placeholder="$t('time.startDate')"
  1623. :end-placeholder="$t('time.endDate')"
  1624. :default-time="['12:00:00', '12:00:00']"
  1625. size="small"
  1626. popper-class="selecteorktime_datapick_popper"
  1627. @change="showMonthWorkTimeReminder()"
  1628. >
  1629. </el-date-picker>
  1630. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1631. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1632. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1633. </div>
  1634. <div>
  1635. <div style="margin-top:10px;">
  1636. <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">
  1637. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1638. </el-input>
  1639. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1640. <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>
  1641. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthWorkTimeReminder()"></vueCascader>
  1642. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1643. </div>
  1644. </div>
  1645. <div style="float: right; vertical-align: middle;height:32px">
  1646. <el-link
  1647. type="primary"
  1648. @click="changeReminder()"
  1649. >{{'变更提醒'}}</el-link
  1650. >
  1651. <el-link
  1652. type="primary"
  1653. @click="exportMembWorkHoursReminder()"
  1654. >{{$t('export.exportData')}}</el-link
  1655. >
  1656. </div>
  1657. </div>
  1658. <el-table ref="hasworkTbl"
  1659. :data="monthWorkDataS"
  1660. v-el-table-infinite-scroll="listScroll"
  1661. border
  1662. :height="'70vh'"
  1663. highlight-current-row
  1664. style="width: 100%"
  1665. v-loading="tbload"
  1666. :lazy="true"
  1667. >
  1668. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1669. <template slot-scope="scope">
  1670. {{ scope.row.createDate}}
  1671. </template>
  1672. </el-table-column>
  1673. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1674. <template slot-scope="scope">
  1675. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1676. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1677. <!-- {{scope.row.name}} -->
  1678. </template>
  1679. </el-table-column>
  1680. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1681. <template slot-scope="scope">
  1682. {{scope.row.invokeValue}}
  1683. </template>
  1684. </el-table-column>
  1685. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1686. <template slot-scope="scope">
  1687. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1688. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1689. </template>
  1690. </el-table-column>
  1691. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1692. <template slot-scope="scope">
  1693. {{ scope.row.workingTime}}
  1694. </template>
  1695. </el-table-column>
  1696. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1697. <template slot-scope="scope">
  1698. {{ scope.row.cardTime}}
  1699. </template>
  1700. </el-table-column>
  1701. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1702. <template slot-scope="scope">
  1703. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1704. </template>
  1705. </el-table-column>
  1706. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1707. <template slot-scope="scope">
  1708. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1709. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1710. </template>
  1711. </el-table-column>
  1712. </el-table>
  1713. <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>
  1714. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1715. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1716. <label style="font-size: 16px">员工每日已填报工时数</label>
  1717. <el-link
  1718. type="primary"
  1719. style="float: right; margin-right: 60px"
  1720. @click="exportMembWorkHours()"
  1721. >导出已填报数据</el-link
  1722. > -->
  1723. <!-- <el-button >导出</el-button> -->
  1724. <!-- </div> -->
  1725. </el-tab-pane>
  1726. </el-tabs>
  1727. </el-dialog>
  1728. <!--驳回弹出框 -->
  1729. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1730. <div>
  1731. <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')" />
  1732. </div>
  1733. <div slot="footer" class="dialog-footer">
  1734. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1735. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1736. </div>
  1737. </el-dialog>
  1738. <!-- 通过弹出框 -->
  1739. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1740. <div>
  1741. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1742. </div>
  1743. <div slot="footer" class="dialog-footer">
  1744. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1745. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1746. </div>
  1747. </el-dialog>
  1748. <!--批量导入日报 -->
  1749. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1750. <p>1. {{$t('other.download')}}
  1751. <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>
  1752. </p>
  1753. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1754. <p style="display: flex;justify-content: center;">
  1755. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1756. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1757. </el-upload>
  1758. </p>
  1759. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1760. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1761. </div>
  1762. </el-dialog>
  1763. <!-- 工时导入记录弹窗 -->
  1764. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1765. <div style="height: 452px">
  1766. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1767. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1768. <el-table-column prop="userName" :label="$t('other.operator')">
  1769. <template slot-scope="scope">
  1770. <div>
  1771. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1772. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1773. </div>
  1774. </template>
  1775. </el-table-column>
  1776. <el-table-column prop="datel" :label="$t('other.document')">
  1777. <template slot-scope="scope">
  1778. <div>
  1779. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1780. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1781. </div>
  1782. </template>
  1783. </el-table-column>
  1784. <el-table-column label="操作" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1785. <template slot-scope="scope">
  1786. <div>
  1787. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1788. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1789. </div>
  1790. </template>
  1791. </el-table-column>
  1792. </el-table>
  1793. <el-col :span="24" class="paginatis">
  1794. <el-pagination
  1795. @size-change="handleSizeChange"
  1796. @current-change="handleCurrentChange"
  1797. :page-sizes="[20 , 50 , 80 , 100]"
  1798. :page-size="20"
  1799. layout="total, sizes, prev, pager, next"
  1800. :total="toViewForm.total"
  1801. style="float:right;"
  1802. ></el-pagination>
  1803. </el-col>
  1804. </div>
  1805. </el-dialog>
  1806. <!--基于企业微信考勤数据的工时导入 -->
  1807. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1808. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1809. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1810. </el-step>
  1811. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1812. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1813. </el-steps>
  1814. <div v-if="active==0" style="padding:30px;height:360px;">
  1815. <div style="margin-top:50px;margin-left:280px;">
  1816. <el-date-picker
  1817. v-model="importWxParam.date" :editable="false"
  1818. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1819. :clearable="true"
  1820. :range-separator="$t('other.to')"
  1821. type="daterange"
  1822. :start-placeholder="$t('time.startDate')"
  1823. :end-placeholder="$t('time.endDate')"
  1824. @change="loadCheckInData"
  1825. ></el-date-picker>
  1826. </div>
  1827. </div>
  1828. <div v-if="active==1" style="padding:10px;">
  1829. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1830. style="width: 100%;margin-top:5px;" >
  1831. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1832. <template slot-scope="scope">
  1833. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1834. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1835. </template>
  1836. </el-table-column>
  1837. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1838. </el-table-column>
  1839. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1840. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1841. <template slot-scope="scope">
  1842. <div>
  1843. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1844. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1845. </div>
  1846. </template>
  1847. </el-table-column>
  1848. <el-table-column prop="departmentName" label="部门" >
  1849. <template slot-scope="scope">
  1850. <div>
  1851. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1852. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1853. </div>
  1854. </template>
  1855. </el-table-column>
  1856. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1857. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1858. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1859. <template slot-scope="scope">
  1860. {{scope.row.workHours.toFixed(1)}}h
  1861. </template>
  1862. </el-table-column>
  1863. </el-table>
  1864. </div>
  1865. <div v-if="active==2" >
  1866. <p style="display: flex;justify-content: center;height:390px;">
  1867. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1868. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1869. </el-upload>
  1870. </p>
  1871. </div>
  1872. <div slot="title">
  1873. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1874. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1875. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1876. <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>
  1877. <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>
  1878. <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>
  1879. </div>
  1880. <span slot="footer">
  1881. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1882. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1883. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1884. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1885. </span>
  1886. </el-dialog>
  1887. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1888. <p style="display: flex;justify-content: center;height:100px;">
  1889. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1890. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1891. </el-upload>
  1892. </p>
  1893. </el-dialog>
  1894. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1895. <div>
  1896. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1897. v-model="deleteReportParam.date" :editable="false"
  1898. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1899. :clearable="true"
  1900. :range-separator="$t('other.to')"
  1901. type="daterange"
  1902. :start-placeholder="$t('time.startDate')"
  1903. :end-placeholder="$t('time.endDate')"
  1904. ></el-date-picker>
  1905. </div>
  1906. <div style="margin-top:10px;">
  1907. <span>请选择部门:</span>
  1908. <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>
  1909. <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>
  1910. </div>
  1911. <div style="margin-top:10px;">
  1912. <span>请选择员工:</span>
  1913. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1914. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1915. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1916. <span v-else>{{item.name}}</span>
  1917. </el-option>
  1918. </el-select>
  1919. </div>
  1920. <span slot="footer">
  1921. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1922. </span>
  1923. </el-dialog>
  1924. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1925. <div>
  1926. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1927. v-model="deleteReportParam.date" :editable="false"
  1928. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1929. :clearable="true"
  1930. :range-separator="$t('other.to')"
  1931. type="daterange"
  1932. :start-placeholder="$t('time.startDate')"
  1933. :end-placeholder="$t('time.endDate')"
  1934. ></el-date-picker>
  1935. </div>
  1936. <div style="margin-top:15px;">
  1937. <span>选择部门:</span>
  1938. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1939. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1940. size="small" v-if="user.userNameNeedTranslate != 1"
  1941. ></el-cascader>
  1942. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1943. </div>
  1944. <span slot="footer">
  1945. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1946. </span>
  1947. </el-dialog>
  1948. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1949. <div>
  1950. <span>选择时间:</span><el-date-picker
  1951. v-model="modImportTime"
  1952. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1953. :clearable="true"
  1954. type="datetime"
  1955. ></el-date-picker>
  1956. <span>选择导入人员:</span><el-select
  1957. v-model="modImportUserId"
  1958. >
  1959. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1960. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1961. <span v-else>{{item.name}}</span>
  1962. </el-option>
  1963. </el-select>
  1964. </div>
  1965. <span slot="footer">
  1966. <el-button @click="confirmChangeModTime" >确认</el-button>
  1967. </span>
  1968. </el-dialog>
  1969. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1970. <div>
  1971. <span>请选择年月:</span>
  1972. <el-date-picker
  1973. v-model="ratioYmonth" :editable="false"
  1974. format="yyyyMM" value-format="yyyyMM"
  1975. type="month"
  1976. ></el-date-picker>
  1977. </div>
  1978. <span slot="footer">
  1979. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1980. </span>
  1981. </el-dialog>
  1982. <!--工时批量代填 -->
  1983. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1984. <div>
  1985. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1986. v-model="importWxParam.date" :editable="false"
  1987. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1988. :clearable="true"
  1989. :range-separator="$t('other.to')"
  1990. type="daterange"
  1991. :start-placeholder="$t('time.startDate')"
  1992. :end-placeholder="$t('time.endDate')"
  1993. @change="loadCheckInData"
  1994. ></el-date-picker>
  1995. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1996. </div>
  1997. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1998. :key="timeStamp"
  1999. style="width: 100%;margin-top:5px;" ref="tab">
  2000. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2001. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2002. <template slot-scope="scope">
  2003. <div>
  2004. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2005. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2006. </div>
  2007. </template>
  2008. </el-table-column>
  2009. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2010. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2011. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2012. <template slot-scope="scope">
  2013. {{scope.row.workHours.toFixed(1)}}h
  2014. </template>
  2015. </el-table-column>
  2016. <!--项目名称列表 -->
  2017. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2018. <template slot-scope="scope">
  2019. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2020. </template>
  2021. </el-table-column>
  2022. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2023. <template slot-scope="scope">
  2024. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2025. </template>
  2026. </el-table-column>
  2027. </el-table>
  2028. </el-dialog>
  2029. <!--基于企业微信考勤数据的工时导入 -->
  2030. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2031. <div style="padding-bottom:10px;">
  2032. <p>{{importResultMsg}}</p>
  2033. </div>
  2034. <!-- <span slot="footer" class="dialog-footer">
  2035. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2036. </span> -->
  2037. </el-dialog>
  2038. <!-- 审核流程展示 -->
  2039. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2040. <div style="padding:20px 40px 20px 0">
  2041. <el-timeline :reverse="false">
  2042. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2043. <!-- {{item.msg}} -->
  2044. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2045. <span v-if="user.userNameNeedTranslate == 1">
  2046. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2047. <span>{{item.msgCon.two}}</span>
  2048. </span>
  2049. </el-timeline-item>
  2050. </el-timeline>
  2051. </div>
  2052. </el-dialog>
  2053. </section>
  2054. </template>
  2055. <script>
  2056. // 左右滑动
  2057. import dragMixin from "@/common/js/tensile.js";
  2058. import util from "../../common/js/util";
  2059. // 自定义select组件
  2060. import selectCat from "@/components/select.vue"
  2061. // 引入自定义级联组件
  2062. import vueCascader from "@/components/cascader.vue"
  2063. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2064. // 重庆物奇定制组件
  2065. import WeeklyCustomization from "./weeklyCustomization.vue"
  2066. import { mapMutations } from 'vuex'
  2067. let _that = this
  2068. export default {
  2069. mixins: [dragMixin],
  2070. components: {
  2071. selectCat,
  2072. vueCascader,
  2073. WeeklyCustomization,
  2074. vueMultipleDept
  2075. },
  2076. data() {
  2077. return {
  2078. showHidden: false,
  2079. pageIndex: 0,
  2080. hasMore: true,
  2081. exportType: 0,
  2082. exportingData: false,
  2083. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2084. jobResponseList:[],
  2085. yisibeiCompId: 3092,
  2086. yuzhongCompId: 3385,
  2087. mingyiName : '成都明夷电子科技有限公司',
  2088. // mingyiName : '明夷',
  2089. modItemDataId: null,
  2090. modImportTime: null,
  2091. modImportUserId: null,
  2092. showModImportTimeDialog: false,
  2093. showBatchSimpleApproveReport: false,
  2094. startDeleting: false,
  2095. showBatchDeleteReport: false,
  2096. deleteReportParam: {date:null, userIds:[]},
  2097. isDenying: false,
  2098. targetWeekDate: null,//填写周报中的周日期
  2099. importCardTimeVisi: false,
  2100. startRatioExporting: false,
  2101. exportUserRatio: false,
  2102. ratioYmonth:null,
  2103. hasWrittenReport: false,
  2104. today:null,
  2105. syncTimeLoading: false,
  2106. seluserText: '',
  2107. translation: '1', // 1、文字, 2、部门, 3、人员
  2108. exportLoad: false,
  2109. getPickerOptions: {
  2110. disabledDate: (time) => {
  2111. var date = new Date();
  2112. var year = date.getFullYear();
  2113. var month = date.getMonth() + 1;
  2114. if (month >= 1 && month <= 9) {
  2115. month = "0" + month;
  2116. }
  2117. var currentdate = year.toString() + month.toString();
  2118. var timeyear = time.getFullYear();
  2119. var timemonth = time.getMonth() + 1;
  2120. if (timemonth >= 1 && timemonth <= 9) {
  2121. timemonth = "0" + timemonth;
  2122. }
  2123. var timedate = timeyear.toString() + timemonth.toString();
  2124. if(this.user.timeType.fillAhead == 0){
  2125. return currentdate < timedate;
  2126. }else{
  2127. return false
  2128. }
  2129. }
  2130. },
  2131. alalal: '8.0',
  2132. timeBasecostList:null,
  2133. tbload: false,
  2134. exportTimeDialog: false,
  2135. searchKeyword: '',
  2136. monthWorkDataS: [],
  2137. monthNotWorkDateS: [],
  2138. pickDateArray:[],
  2139. WorktimeDatepickValue: [],
  2140. activeName:"first",
  2141. isLeave: 0,
  2142. submitingReport: false,
  2143. importResultMsg:null,
  2144. showImportResult:false,
  2145. importingData: false,
  2146. isDraft: 0,
  2147. timeStamp: 0,
  2148. projectColumns:[],
  2149. checkinLoading:false,
  2150. importWxParam:{date:null,},
  2151. active:0,
  2152. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2153. importWxDialog:false,
  2154. importDialog:false,
  2155. denyForm:null,
  2156. denyReasonDialog:false,
  2157. monthWorkTimeDialog: false,
  2158. isSubstitude:false,
  2159. isFill:false,
  2160. unFillList:[],
  2161. fillList:[],
  2162. fillMembList:[],
  2163. fillMembList_leave: [],
  2164. membListVisible: false,
  2165. isBatch:0,//是否是批量填报
  2166. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2167. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2168. 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')],
  2169. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2170. fillStatusList: [],
  2171. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2172. exportReportLogParam:{dateRange:[]},
  2173. exportDialog:false,
  2174. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2175. subProjectList:[],
  2176. canEdit: true,
  2177. originCanEdit: true,
  2178. 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],
  2179. selectTime:null,
  2180. reportTimeType:{},
  2181. curDate:'',
  2182. isAllSelect: false,
  2183. approveDialogVisible:false,
  2184. deptId:null,
  2185. targetUid: null,
  2186. membCount:0,
  2187. selectState:"-1",
  2188. user: JSON.parse(sessionStorage.getItem("user")),
  2189. allUsersList: [],
  2190. showAddMore:false,
  2191. allDate: [],
  2192. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2193. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2194. choseDay: 0,
  2195. tableHeight: 0,
  2196. listLoading: false,
  2197. projectList: [], //项目列表
  2198. fillProjectList: [],
  2199. reportList: [], //日报列表
  2200. reportNames:[], //批量审批列表
  2201. selCon:[], //筛选条件
  2202. selProjectList:[], //筛选后项目列表
  2203. selConShow: true,
  2204. usersList: [], // 全部人员列表
  2205. usersListId: '', // 选中的人员id
  2206. dialogVisible: false, //项目弹窗
  2207. report: '',
  2208. workForm: {
  2209. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2210. domains: [{
  2211. id: null,
  2212. projectId: "",
  2213. workingTime: "",
  2214. timeType:0,
  2215. content: "",
  2216. state: 2,
  2217. multiWorktime:0,
  2218. worktimeList:[],
  2219. degreeId: null,
  2220. auditUserList: [],
  2221. }],
  2222. showRefresh: false,
  2223. },
  2224. workRules: {
  2225. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2226. },
  2227. chooseParticipVisible: false,
  2228. logining: false,
  2229. isDisable: false,
  2230. timeType:[],
  2231. deptMembData: [
  2232. ],
  2233. //部门人员树状结构
  2234. data: [
  2235. {
  2236. id: -1,
  2237. label: this.$t('lable.allStaff'),
  2238. membCount:0
  2239. },
  2240. {
  2241. id: 0,
  2242. label: this.$t('lable.unassigned'),
  2243. }
  2244. ],
  2245. allData:{},
  2246. batchShowData:{},
  2247. option: [],
  2248. deptOptionList: [],
  2249. depData: {
  2250. id: -1,
  2251. label: this.$t('lable.allStaff'),
  2252. },
  2253. defaultProps: {
  2254. children: 'children',
  2255. label: 'label'
  2256. },
  2257. isNew: false,
  2258. selected: false,
  2259. valuet: new Date(),
  2260. domObj: null,
  2261. participator:[],
  2262. chosenMembCount:0,
  2263. jsDay: 0,
  2264. jsTime: 0,
  2265. falsss: false,
  2266. weidu: [],
  2267. weiduList: [],
  2268. yonghuUser: [],
  2269. dateAr: [],
  2270. batchSubFillDialog: false,
  2271. isSubstiS: false,
  2272. fillWeekDialogVisi: false,
  2273. fillWeekDialogVisiCustom: false,
  2274. zhoData: [],
  2275. weekDateRange: [],
  2276. btnZho: false,
  2277. weekDataLoading: false,
  2278. changdu: 6,
  2279. tianxieDialogVisible: false,
  2280. scopess: {},
  2281. zhoBao: {
  2282. time: '',
  2283. workingTime: '',
  2284. progress: '',
  2285. con: '',
  2286. subProjectId: '',
  2287. stage: '',
  2288. subProjectList: [],
  2289. stages: [],
  2290. },
  2291. zhoBaoIdx: '',
  2292. zhoBaoName: '',
  2293. zhis: {},
  2294. dealList: [],
  2295. toViewDialogVisible: false,
  2296. toViewList: [],
  2297. toViewloading: true,
  2298. toViewForm: {
  2299. pageIndex: '1',
  2300. pageSize: '20',
  2301. total: 0,
  2302. },
  2303. toViewloadings: false,
  2304. tabPositionss: 'top',
  2305. monthTotal: 0,
  2306. monthTotalPage: 0,
  2307. monthTotalLages: 20,
  2308. monthWorkData: [],
  2309. monthNotWorkDate: [],
  2310. monthWorkDataS1: [],
  2311. monthnotTotal: 0,
  2312. monthnotTotalPage: 0,
  2313. monthnotTotalLages: 20,
  2314. monthNotWorkDateS1: [],
  2315. deptMembDataText: '',
  2316. isFlag: false,
  2317. isMore: false,
  2318. stateKey: '0',
  2319. expandDate: [],
  2320. notifySelList:[],
  2321. departmentList: [],
  2322. approvalProcessDialog: false,
  2323. approvalProcessData: [],
  2324. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2325. 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')],
  2326. isWeekend: false,
  2327. canCancelInDialog: false,
  2328. approveinData: {},
  2329. approveinDialog: false,
  2330. reportCanDelete: false,
  2331. weeklyFilledTimeDialog: false,
  2332. weeklyFilledTimeList: [],
  2333. weeklyFilledTimeLoading: false,
  2334. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2335. weeklyFilledTimeCanDelete: false,
  2336. weeklyFilledTimeDate: null,
  2337. leaveAllNum: 0,
  2338. dataLoading: false,
  2339. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2340. vacationTime: {},
  2341. integrationProjectList: [],
  2342. totalReportHours: 0, // 合计的工时
  2343. workTimeForMinYi:0,
  2344. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2345. weekIndex: 1,
  2346. weekParentData: {},
  2347. deptIdForNoReport:[],
  2348. deptIdForReminder:[],
  2349. nameAearch: '', // 企业微信姓名搜索
  2350. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2351. deptMembDataLoading: false,
  2352. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2353. {
  2354. id: 4811,
  2355. // id: 10,
  2356. name: '陕西柘中建设工程有限公司'
  2357. }
  2358. ],
  2359. pushWorkTimeLogDig:false,
  2360. pushWorkTimeLogData:[],
  2361. userReportDeptList: [],
  2362. isReminder:true,
  2363. reportLogCheckDialog:false,
  2364. deptIdForHasReport:[],
  2365. };
  2366. },
  2367. watch: {
  2368. deptMembDataText(val) {
  2369. this.$refs.chooseMembTree.filter(val);
  2370. }
  2371. },
  2372. filters: {
  2373. // 过滤
  2374. amounts(value) {
  2375. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2376. return 0
  2377. }
  2378. var zhi = +value + 0
  2379. return zhi.toFixed(1)
  2380. },
  2381. // zhoData
  2382. zhoData(value, arr) {
  2383. var dateArray = value.split("-");
  2384. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2385. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2386. // console.log(arr[date.getDay()])
  2387. // return "周" + "日一二三四五六".charAt(date.getDay());
  2388. return arr[date.getDay()]
  2389. },
  2390. // 过滤数字
  2391. numbers(value) {
  2392. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2393. return 0
  2394. }
  2395. return value
  2396. },
  2397. },
  2398. computed: {},
  2399. mounted() {
  2400. var now = new Date();
  2401. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2402. this.today = t;
  2403. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2404. this.exportParam.dateRange = [startStr,t];
  2405. this.exportReportLogParam.dateRange = [startStr,t];
  2406. this.getAllDate(1);
  2407. this.getReportList();
  2408. this.getProjectList();
  2409. this.getFillProjectList();
  2410. this.getTimeType();
  2411. this.getDepartment();
  2412. this.scrollFunction()
  2413. this.userssHu();
  2414. this.getFirstAndLastDay()
  2415. if(this.user.timeType.reportAuditType == 3){
  2416. this.getAllUsersList()
  2417. }
  2418. if (this.user.company.packageProject == 1) {
  2419. this.getBasecostItemList();
  2420. }
  2421. if(this.user.timeType.userWithMultiDept == 1) {
  2422. this.getDeptMembData();
  2423. }
  2424. if(this.user.timeType.lockWorktime){
  2425. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2426. }
  2427. //设置了下限
  2428. if (this.user.timeType.minReportTime) {
  2429. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2430. }
  2431. const that = this
  2432. if(this.user.userNameNeedTranslate == 1) {
  2433. that.dataLoading = that.$store.state.dataLoading
  2434. this.upDataLoading()
  2435. setTimeout(()=>{
  2436. that.dataLoading = that.$store.state.dataLoading
  2437. }, 1000)
  2438. }
  2439. if (this.user.companyId == this.yuzhongCompId) {
  2440. this.getJobResponList();
  2441. }
  2442. },
  2443. methods: {
  2444. ...mapMutations(['upDataLoading']),
  2445. // 已填工时情况表设置背景色
  2446. hasworkTblCellStyle({ columnIndex, row, column }) {
  2447. if(columnIndex > 2) {
  2448. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2449. const worktimeList = row.worktimeList || []
  2450. const times = this.reportTimeType.allday
  2451. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2452. const isWorkDate = filterData[0] && filterData[0].workingTime
  2453. const state = filterData[0] && filterData[0].state
  2454. if (state == 0 || state == -1) {
  2455. return "backgroundColor: orange"
  2456. } else if (state == 1) {
  2457. //审核通过
  2458. return "backgroundColor: #32CD32"
  2459. } else if (state == 2) {
  2460. return "backgroundColor: red"
  2461. } else {
  2462. return "backgroundColor: #E0E0E0"
  2463. // if(isWorkDate < times) {
  2464. // return "backgroundColor: #FC3D49"
  2465. // }
  2466. // if(isWorkDate > times) {
  2467. // return "backgroundColor: #20a0ff"
  2468. // }
  2469. }
  2470. }
  2471. },
  2472. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2473. isCustomization(userInfo, permissionArray) {
  2474. const { companyId } = userInfo
  2475. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2476. return isReportPictureRequired
  2477. },
  2478. showHiddenFunction() {
  2479. this.showHidden = true;
  2480. },
  2481. // 获取如何信息选的可填写部门
  2482. getDeptMembData() {
  2483. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2484. if (res.code == "ok") {
  2485. let lists = res.data.userReportDeptList || []
  2486. const optimizedList = lists.map(item => ({
  2487. ...item,
  2488. label: item.departmentName,
  2489. value: item.departmentId,
  2490. }));
  2491. this.$set(this, 'userReportDeptList', optimizedList || []);
  2492. } else {
  2493. this.$message({
  2494. message: res.msg,
  2495. type: "error"
  2496. });
  2497. }
  2498. },error => { });
  2499. },
  2500. //任务被选中
  2501. onTaskSelected(domainItem) {
  2502. //取服务
  2503. if (domainItem.taskId) {
  2504. var that = this;
  2505. var param = {taskId:domainItem.taskId};
  2506. if (this.isSubstitude) {
  2507. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2508. param.userId = this.workForm.userId[0];
  2509. }
  2510. }
  2511. this.http.post('/task/getMyTaskService',param, res => {
  2512. if (res.code == "ok") {
  2513. // domainItem.workContentList = res.data;
  2514. that.$set(domainItem, 'sapServiceId', null);
  2515. that.$set(domainItem, 'serviceList', res.data);
  2516. } else {
  2517. this.$message({
  2518. message: res.msg,
  2519. type: "error"
  2520. });
  2521. }
  2522. },error => {
  2523. this.$message({
  2524. message: error,
  2525. type: "error"
  2526. });
  2527. }
  2528. );
  2529. } else {
  2530. //清空服务
  2531. }
  2532. },
  2533. onBatchTimeChange() {
  2534. //反向计算每日工作时长
  2535. if (this.workForm.createDate) {
  2536. let sdate = new Date(this.workForm.createDate[0]);
  2537. let edate = new Date(this.workForm.createDate[1]);
  2538. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2539. console.log('days===', days)
  2540. if (days < 0) {
  2541. return;
  2542. }
  2543. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2544. //总时长发生改变,自动按比例计算
  2545. this.workForm.domains.forEach(d=>{
  2546. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2547. });
  2548. }
  2549. },
  2550. //更新工作内容列表
  2551. updateJobContent(domainItem) {
  2552. var that = this;
  2553. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2554. if (res.code == "ok") {
  2555. // domainItem.workContentList = res.data;
  2556. that.$set(domainItem, 'extraField3', null);
  2557. that.$set(domainItem, 'workContentList', res.data);
  2558. } else {
  2559. this.$message({
  2560. message: res.msg,
  2561. type: "error"
  2562. });
  2563. }
  2564. },error => {
  2565. this.$message({
  2566. message: error,
  2567. type: "error"
  2568. });
  2569. }
  2570. );
  2571. },
  2572. updateResponse(domainItem) {
  2573. var that = this;
  2574. var selectPid = domainItem.projectId;
  2575. domainItem.extraField2 = null;
  2576. domainItem.extraField3 = null;
  2577. if (selectPid && domainItem.extraField1) {
  2578. //是否非项目
  2579. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2580. console.log('==========','isPublic=='+isPublic);
  2581. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2582. console.log(filteredRespList);
  2583. domainItem.filteredRespList = filteredRespList;
  2584. }
  2585. },
  2586. getJobResponList() {
  2587. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2588. if (res.code == "ok") {
  2589. this.jobResponseList = res.data;
  2590. } else {
  2591. this.$message({
  2592. message: res.msg,
  2593. type: "error"
  2594. });
  2595. }
  2596. },error => {
  2597. this.$message({
  2598. message: error,
  2599. type: "error"
  2600. });
  2601. }
  2602. );
  2603. },
  2604. openModImportTime(row) {
  2605. this.showModImportTimeDialog = true;
  2606. this.modItemDataId = row.id;
  2607. },
  2608. delImportTime(row) {
  2609. let rowId = row.id;
  2610. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2611. confirmButtonText: this.$t('btn.determine'),
  2612. cancelButtonText: this.$t('btn.cancel'),
  2613. type: "warning"
  2614. })
  2615. .then(() => {
  2616. this.http.post('/report-import-log/delete',{
  2617. id: rowId
  2618. },res => {
  2619. if (res.code == "ok") {
  2620. this.$message({
  2621. message: '删除成功',
  2622. type: "success"
  2623. });
  2624. this.getToView();
  2625. } else {
  2626. this.$message({
  2627. message: res.msg,
  2628. type: "error"
  2629. });
  2630. }
  2631. },error => {
  2632. this.$message({
  2633. message: error,
  2634. type: "error"
  2635. });
  2636. }
  2637. );
  2638. }).catch(() => {this.startDeleting = false});
  2639. },
  2640. confirmChangeModTime() {
  2641. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2642. this.$message({
  2643. message: '请选择时间',
  2644. type: "error"
  2645. });
  2646. return;
  2647. }
  2648. this.http.post('/report-import-log/changeTime',{
  2649. modLogDateTime: this.modImportTime,
  2650. modImportUserId: this.modImportUserId,
  2651. id: this.modItemDataId
  2652. },res => {
  2653. if (res.code == "ok") {
  2654. this.$message({
  2655. message: '修改成功',
  2656. type: "success"
  2657. });
  2658. this.getToView();
  2659. this.showModImportTimeDialog = false;
  2660. } else {
  2661. this.$message({
  2662. message: res.msg,
  2663. type: "error"
  2664. });
  2665. }
  2666. },error => {
  2667. this.$message({
  2668. message: error,
  2669. type: "error"
  2670. });
  2671. }
  2672. );
  2673. },
  2674. confirmBatchApproveReport() {
  2675. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2676. this.$message({
  2677. message: '请选择日期范围',
  2678. type: "error"
  2679. });
  2680. return;
  2681. }
  2682. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2683. confirmButtonText: this.$t('btn.determine'),
  2684. cancelButtonText: this.$t('btn.cancel'),
  2685. type: "warning"
  2686. })
  2687. .then(() => {
  2688. this.startDeleting = true;
  2689. let obj = {
  2690. startDate: this.deleteReportParam.date[0],
  2691. endDate: this.deleteReportParam.date[1]
  2692. }
  2693. if(this.deleteReportParam.departmentId) {
  2694. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2695. } else {
  2696. obj.departmentId = null
  2697. }
  2698. this.http.post('/report/batchApproveByDate',obj,res => {
  2699. if (res.code == "ok") {
  2700. this.$message({
  2701. message: '审核通过',
  2702. type: "success"
  2703. });
  2704. this.getReportList();
  2705. this.getDepartment();
  2706. this.startDeleting = false;
  2707. } else {
  2708. this.$message({
  2709. message: res.msg,
  2710. type: "error"
  2711. });
  2712. }
  2713. },error => {
  2714. this.$message({
  2715. message: error,
  2716. type: "error"
  2717. });
  2718. }
  2719. );
  2720. }).catch(() => {this.startDeleting = false});
  2721. },
  2722. confirmBatchDelReport() {
  2723. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2724. this.$message({
  2725. message: '请选择部门或人员',
  2726. type: "error"
  2727. });
  2728. return;
  2729. }
  2730. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2731. this.$message({
  2732. message: '请选择日期范围',
  2733. type: "error"
  2734. });
  2735. return;
  2736. }
  2737. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2738. confirmButtonText: this.$t('btn.determine'),
  2739. cancelButtonText: this.$t('btn.cancel'),
  2740. type: "warning"
  2741. })
  2742. .then(() => {
  2743. this.startDeleting = true;
  2744. this.http.post('/report/batchDelete',{
  2745. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2746. startDate: this.deleteReportParam.date[0],
  2747. endDate: this.deleteReportParam.date[1],
  2748. deptId: this.deleteReportParam.deptId[0]
  2749. },res => {
  2750. if (res.code == "ok") {
  2751. this.$message({
  2752. message: this.$t('message.successfullyDeleted'),
  2753. type: "success"
  2754. });
  2755. this.getReportList();
  2756. this.getDepartment();
  2757. this.startDeleting = false;
  2758. } else {
  2759. this.$message({
  2760. message: res.msg,
  2761. type: "error"
  2762. });
  2763. }
  2764. },error => {
  2765. this.$message({
  2766. message: error,
  2767. type: "error"
  2768. });
  2769. }
  2770. );
  2771. }).catch(() => {this.startDeleting = false});
  2772. },
  2773. getRecentlyProject() {
  2774. this.http.post('/project/nearProject',{},res => {
  2775. if(res.code == 'ok'){
  2776. let topObj = {
  2777. label: '最近选择项目',
  2778. peojectList: res.data
  2779. }
  2780. let botomObj = {
  2781. label: '全部项目',
  2782. peojectList: this.fillProjectList
  2783. }
  2784. //最近项目如果在fillProjectList中不存在,需要移除
  2785. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2786. this.integrationProjectList = [topObj, botomObj]
  2787. }else {
  2788. this.$message({
  2789. message: res.msg,
  2790. type: 'error'
  2791. })
  2792. }
  2793. },err => {
  2794. this.$message({
  2795. message: err,
  2796. type: 'error'
  2797. })
  2798. })
  2799. },
  2800. handlePictureCardPreview(file, index) {
  2801. console.log(file, index)
  2802. let arr = []
  2803. let imgArr = this.workForm.domains[index].imgListUrl
  2804. for(var i in imgArr) {
  2805. arr.push(imgArr[i].url)
  2806. }
  2807. console.log(arr, '图片数据')
  2808. const $viewer = this.$viewerApi({
  2809. images: arr
  2810. });
  2811. },
  2812. // 图片上传
  2813. addImg(e, index) {
  2814. console.log(e, '数据')
  2815. let formData = new FormData()
  2816. formData.append('multipartFile', e.file)
  2817. this.http.uploadFile('/common/uploadFile', formData,
  2818. res => {
  2819. if (res.code == "ok") {
  2820. this.$message({
  2821. message: this.$t('uploadedsuccessfully'),
  2822. type: "success"
  2823. });
  2824. if(!this.workForm.domains[index].imgList) {
  2825. this.workForm.domains[index].imgList = []
  2826. this.workForm.domains[index].imgListUrl = []
  2827. }
  2828. this.workForm.domains[index].imgList.push(res.data)
  2829. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2830. } else {
  2831. this.$message({message: res.msg,type: "error"});
  2832. }
  2833. console.log(this.workForm.domains[index])
  2834. },
  2835. error => {this.$message({message: error,type: "error"});
  2836. });
  2837. },
  2838. // 删除图片
  2839. delImg(file,fileList, index) {
  2840. console.log(file, fileList)
  2841. let idx = 0
  2842. for(let i in fileList) {
  2843. if(fileList[i].uid == file.uid) {
  2844. idx = i
  2845. }
  2846. }
  2847. this.workForm.domains[index].imgList.splice(idx, 1)
  2848. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2849. console.log(this.workForm.domains[index])
  2850. },
  2851. test(){
  2852. console.log('test',this.workForm.domains);
  2853. },
  2854. getHour(s1, s2) {
  2855. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2856. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2857. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2858. var ms = s2.getTime() - s1.getTime();
  2859. if (ms < 0) return 0;
  2860. let ma = ms / 1000 / 60 / 60
  2861. return ma; //小时
  2862. },
  2863. refreshWXCardTime(workdate) {
  2864. if (!workdate) return;
  2865. this.syncTimeLoading = true;
  2866. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2867. date: workdate,
  2868. },res => {
  2869. this.syncTimeLoading = false;
  2870. if(res.code == 'ok'){
  2871. this.workForm.time = res.data.time;
  2872. }else {
  2873. this.$message({
  2874. message: res.msg,
  2875. type: 'error'
  2876. })
  2877. }
  2878. },err => {
  2879. this.syncTimeLoading = false;
  2880. this.$message({
  2881. message: err,
  2882. type: 'error'
  2883. })
  2884. })
  2885. },
  2886. refreshAttendance(workdate) {
  2887. if (!workdate) return;
  2888. this.syncTimeLoading = true;
  2889. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2890. startDate: workdate[0],
  2891. endDate: workdate[1]
  2892. },res => {
  2893. this.syncTimeLoading = false;
  2894. if(res.code == 'ok'){
  2895. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2896. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2897. this.totalReportHours = this.workTimeForMinYi;
  2898. }else {
  2899. this.$message({
  2900. message: res.msg,
  2901. type: 'error'
  2902. })
  2903. }
  2904. },err => {
  2905. this.syncTimeLoading = false;
  2906. this.$message({
  2907. message: err,
  2908. type: 'error'
  2909. })
  2910. })
  2911. },
  2912. refreshBeiSengAttendance(workdate) {
  2913. if (!workdate) return;
  2914. this.syncTimeLoading = true;
  2915. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2916. createDate: workdate
  2917. },res => {
  2918. this.syncTimeLoading = false;
  2919. if(res.code == 'ok'){
  2920. this.workForm.time = res.data;
  2921. }else {
  2922. this.$message({
  2923. message: res.msg,
  2924. type: 'error'
  2925. })
  2926. }
  2927. },err => {
  2928. this.syncTimeLoading = false;
  2929. this.$message({
  2930. message: err,
  2931. type: 'error'
  2932. })
  2933. })
  2934. },
  2935. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2936. this.weeklyFilledTimeDialog = true
  2937. this.weeklyFilledTimeLoading = true
  2938. this.weeklyFilledTimeDate = parameterDate
  2939. this.http.post('/report/getReportList',{
  2940. date: parameterDate,
  2941. userId: this.user.id
  2942. },res => {
  2943. this.weeklyFilledTimeLoading = false
  2944. if(res.code == 'ok'){
  2945. this.weeklyFilledTimeList = res.data[0].data
  2946. let candelete = true
  2947. for(let i in this.weeklyFilledTimeList){
  2948. if(this.weeklyFilledTimeList[i].state < 2){
  2949. candelete = false
  2950. }
  2951. }
  2952. this.weeklyFilledTimeCanDelete = candelete
  2953. }else {
  2954. this.$message({
  2955. message: res.msg,
  2956. type: 'error'
  2957. })
  2958. }
  2959. },err => {
  2960. this.weeklyFilledTimeLoading = false
  2961. this.$message({
  2962. message: err,
  2963. type: 'error'
  2964. })
  2965. })
  2966. },
  2967. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2968. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2969. confirmButtonText: this.$t('btn.determine'),
  2970. cancelButtonText: this.$t('btn.cancel'),
  2971. type: "warning"
  2972. })
  2973. .then(() => {
  2974. this.http.post('/report/delete',{
  2975. userId: this.user.id,
  2976. date: this.weeklyFilledTimeDate
  2977. },res => {
  2978. if (res.code == "ok") {
  2979. this.$message({
  2980. message: this.$t('message.successfullyDeleted'),
  2981. type: "success"
  2982. });
  2983. this.getWeeklyWorkTime()
  2984. this.getReportList();
  2985. this.getDepartment();
  2986. this.weeklyFilledTimeDialog = false;
  2987. } else {
  2988. this.$message({
  2989. message: res.msg,
  2990. type: "error"
  2991. });
  2992. }
  2993. },error => {
  2994. this.$message({
  2995. message: error,
  2996. type: "error"
  2997. });
  2998. }
  2999. );
  3000. }).catch(() => {});
  3001. },
  3002. getApprovalProcess(item){
  3003. // console.log('this.date',this.choseDate);
  3004. this.http.post('/report-log/get',{
  3005. creatorId: item.id,
  3006. createDate: sessionStorage.msg
  3007. },res => {
  3008. if(res.code == 'ok'){
  3009. this.approvalProcessDialog = true
  3010. if(this.user.userNameNeedTranslate == 1) {
  3011. for(var i in res.data) {
  3012. let obj = {
  3013. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3014. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3015. }
  3016. res.data[i].msgCon = obj
  3017. }
  3018. }
  3019. this.approvalProcessData = res.data
  3020. console.log(this.approvalProcessData, '数据卡看')
  3021. }else{
  3022. this.$message({
  3023. message: res.msg,
  3024. type: 'error'
  3025. })
  3026. }
  3027. },err => {
  3028. this.$message({
  3029. message: err,
  3030. type: 'error'
  3031. })
  3032. })
  3033. },
  3034. filterNode(value, data) {
  3035. if (!value) return true;
  3036. return data.label.indexOf(value) !== -1;
  3037. },
  3038. triggerCalculateOT(index) {
  3039. var str = this.workForm.domains[index].overtimeHours + ''
  3040. if(str.indexOf('.') != '-1') {
  3041. var s = str.split('.')[0]
  3042. var st = str.split('.')[1]
  3043. var sts = st.split('')
  3044. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3045. }
  3046. },
  3047. searchScreen(e){
  3048. if(e){
  3049. this.monthNotWorkDateS1 = []
  3050. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3051. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3052. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3053. }
  3054. }
  3055. if (this.monthNotWorkDateS1.length > 50) {
  3056. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3057. }else{
  3058. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3059. }
  3060. // if (this.monthNotWorkDateS1.length > 0) {
  3061. // setTimeout(() => {
  3062. // this.tableListenernot()
  3063. // }, 1000);
  3064. // }
  3065. }else{
  3066. this.monthWorkDataS1 = []
  3067. for (let i = 0; i < this.monthWorkData.length; i++) {
  3068. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3069. this.monthWorkDataS1.push(this.monthWorkData[i])
  3070. }
  3071. }
  3072. if (this.monthWorkDataS1.length > 50) {
  3073. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3074. }else{
  3075. this.monthWorkDataS = this.monthWorkDataS1
  3076. }
  3077. // if (this.monthWorkDataS1.length > 0) {
  3078. // setTimeout(() => {
  3079. // this.tableListener()
  3080. // }, 1000);
  3081. // }
  3082. }
  3083. },
  3084. addUpload(data) {
  3085. // var zhi = data.fileName.split('.')[0]
  3086. // var sss = zhi + '.xlsx'
  3087. // return
  3088. var filePath = '/upload/' + data.serverName;
  3089. const a = document.createElement('a'); // 创建a标签
  3090. a.setAttribute('download', data.fileName);// download属性
  3091. a.setAttribute('href', filePath);// href链接
  3092. a.click(); //自执行点击事件
  3093. a.remove();
  3094. },
  3095. restrictNumber(targetId) {
  3096. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3097. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3098. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3099. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3100. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3101. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3102. inpu.value = parseFloat(inpu.value);
  3103. }
  3104. },
  3105. //获取项目下的任务分组
  3106. getTaskGroups(domain, index) {
  3107. domain.groupId=null;
  3108. this.http.post('/task-group/listMyJoinGroup',{
  3109. projectId: domain.projectId,
  3110. isSubstitude: this.isSubstitude ? 1 : 0
  3111. },
  3112. res => {
  3113. if (res.code == "ok") {
  3114. this.workForm.domains[index].taskGroups = res.data;
  3115. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3116. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3117. // this.getGroupStages(domain, index);
  3118. // }
  3119. this.$forceUpdate();
  3120. }
  3121. },
  3122. error => {
  3123. this.$message({
  3124. message: error,
  3125. type: "error"
  3126. });
  3127. }
  3128. );
  3129. },
  3130. //下载填报工时占比报表
  3131. downloadProjectRatio() {
  3132. this.exportUserRatio = true;
  3133. // let now = new Date();
  3134. // let month = now.getMonth();//默认看上个月的
  3135. // let monthStr = month<10? ('0'+month): month;
  3136. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3137. const today = new Date();
  3138. const year = today.getFullYear();
  3139. const month = today.getMonth() + 1;
  3140. let lastMonthYear, lastMonth;
  3141. if (month === 1) {
  3142. lastMonthYear = year - 1;
  3143. lastMonth = 12;
  3144. } else {
  3145. lastMonthYear = year;
  3146. lastMonth = month - 1;
  3147. }
  3148. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3149. console.log('赋值 ==>', this.ratioYmonth)
  3150. },
  3151. confirmDownloadRatio() {
  3152. this.startRatioExporting = true;
  3153. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3154. ymonth: this.ratioYmonth
  3155. },
  3156. res => {
  3157. if (res.code == "ok") {
  3158. this.startRatioExporting = false;
  3159. var filePath = res.data;
  3160. const a = document.createElement('a'); // 创建a标签
  3161. var data = filePath.split("/");
  3162. a.setAttribute('download', data[data.length-1]);// download属性
  3163. a.setAttribute('href', filePath);// href链接
  3164. a.click(); //自执行点击事件
  3165. a.remove();
  3166. } else {
  3167. this.startRatioExporting = false;
  3168. this.$message({
  3169. message: res.msg,
  3170. type: "error"
  3171. });
  3172. }
  3173. },
  3174. error => {
  3175. this.checkinLoading = false;
  3176. this.$message({
  3177. message: error,
  3178. type: "error"
  3179. });
  3180. }
  3181. );
  3182. },
  3183. //下载带企业微信考勤数据的工时统计模板
  3184. downloadCheckInExcel() {
  3185. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3186. startDate: this.importWxParam.date[0],
  3187. endDate: this.importWxParam.date[1],
  3188. },
  3189. res => {
  3190. if (res.code == "ok") {
  3191. var filePath = res.data;
  3192. const a = document.createElement('a'); // 创建a标签
  3193. var data = filePath.split("/");
  3194. a.setAttribute('download', data[data.length-1]);// download属性
  3195. a.setAttribute('href', filePath);// href链接
  3196. a.click(); //自执行点击事件
  3197. a.remove();
  3198. } else {
  3199. this.$message({
  3200. message: res.msg,
  3201. type: "error"
  3202. });
  3203. }
  3204. },
  3205. error => {
  3206. this.checkinLoading = false;
  3207. this.$message({
  3208. message: error,
  3209. type: "error"
  3210. });
  3211. }
  3212. );
  3213. },
  3214. pre() {
  3215. if (this.active == 0) return;
  3216. this.active--;
  3217. },
  3218. next() {
  3219. this.active++;
  3220. },
  3221. triggerTotalTime(index) {
  3222. var item = this.checkinList[index];
  3223. var total = 0.0;
  3224. for (var i=0;i<this.projectColumns.length; i++) {
  3225. var key = this.projectColumns[i];
  3226. if (item[key] != null && item[key] != '') {
  3227. total += parseFloat(item[key]);
  3228. }
  3229. }
  3230. item.totalFillTime = total;
  3231. },
  3232. //提交批量代填的数据
  3233. submitBatchSubFillData() {
  3234. var data = JSON.stringify(this.checkinList);
  3235. this.http.post('/user-corpwx-time/submitProjectTime',{
  3236. json: data,
  3237. projectColumns: JSON.stringify(this.projectColumns)
  3238. },
  3239. res => {
  3240. if (res.code == "ok") {
  3241. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3242. this.importWxDialog = false;
  3243. }
  3244. },
  3245. error => {
  3246. this.checkinLoading = false;
  3247. this.$message({
  3248. message: error,
  3249. type: "error"
  3250. });
  3251. }
  3252. );
  3253. },
  3254. loadCheckInData() {
  3255. if (this.importWxParam.date == null) {
  3256. this.checkinList = [];
  3257. return;
  3258. }
  3259. this.checkinLoading = true;
  3260. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3261. startDate: this.importWxParam.date[0],
  3262. endDate: this.importWxParam.date[1],
  3263. },
  3264. res => {
  3265. if (res.code == "ok") {
  3266. this.checkinLoading = false;
  3267. this.checkinList = res.data.list;
  3268. this.projectColumns = res.data.projects;
  3269. // 自定义表格会导致表格错乱,需重新计算表格
  3270. this.$nextTick(()=>{
  3271. this.$refs.tab.doLayout()
  3272. })
  3273. }
  3274. },
  3275. error => {
  3276. this.checkinLoading = false;
  3277. this.$message({
  3278. message: error,
  3279. type: "error"
  3280. });
  3281. }
  3282. );
  3283. },
  3284. importCardTime(item) {
  3285. //首先判断文件类型
  3286. let str = item.file.name.split(".");
  3287. let format = str[str.length - 1];
  3288. if (format != "xls" && format != "xlsx") {
  3289. this.$message({
  3290. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3291. type: "error"
  3292. });
  3293. } else {
  3294. this.importingData = true;
  3295. let formData = new FormData();
  3296. formData.append("multipartFile", item.file);
  3297. formData.append("companyId", this.user.companyId);
  3298. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3299. res => {
  3300. this.$refs.uploadCardTime.clearFiles();
  3301. this.importingData = false;
  3302. if (res.code == "ok") {
  3303. //换成弹出框,以免有人等了半天回来啥也没看到
  3304. this.$message({
  3305. message: '导入考勤时长成功',
  3306. type: "success"
  3307. });
  3308. } else {
  3309. this.$message({
  3310. message: res.msg,
  3311. type: "error"
  3312. });
  3313. }
  3314. },
  3315. error => {
  3316. this.$refs.upload.clearFiles();
  3317. this.listLoading = false;
  3318. this.$message({
  3319. message: error,
  3320. type: "error"
  3321. });
  3322. });
  3323. }
  3324. },
  3325. batchImportWxData(item) {
  3326. //首先判断文件类型
  3327. let str = item.file.name.split(".");
  3328. let format = str[str.length - 1];
  3329. if (format != "xls" && format != "xlsx") {
  3330. this.$message({
  3331. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3332. type: "error"
  3333. });
  3334. } else {
  3335. this.importingData = true;
  3336. let formData = new FormData();
  3337. formData.append("file", item.file);
  3338. formData.append("companyId", this.user.companyId);
  3339. formData.append("withCheckIn", 1);
  3340. this.http.uploadFile('/report/importData', formData,
  3341. res => {
  3342. this.$refs.upload.clearFiles();
  3343. this.showImportResult = true;
  3344. this.importingData = false;
  3345. if (res.code == "ok") {
  3346. //换成弹出框,以免有人等了半天回来啥也没看到
  3347. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3348. this.getReportList();
  3349. this.importWxDialog = false;
  3350. } else {
  3351. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3352. }
  3353. },
  3354. error => {
  3355. this.$refs.upload.clearFiles();
  3356. this.listLoading = false;
  3357. this.$message({
  3358. message: error,
  3359. type: "error"
  3360. });
  3361. });
  3362. }
  3363. },
  3364. batchImportData(item) {
  3365. //首先判断文件类型
  3366. let str = item.file.name.split(".");
  3367. let format = str[str.length - 1];
  3368. if (format != "xls" && format != "xlsx") {
  3369. this.$message({
  3370. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3371. type: "error"
  3372. });
  3373. } else {
  3374. this.importingData = true;
  3375. let formData = new FormData();
  3376. formData.append("file", item.file);
  3377. formData.append("companyId", this.user.companyId);
  3378. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3379. this.http.uploadFile(url, formData,
  3380. res => {
  3381. this.$refs.upload.clearFiles();
  3382. this.importingData = false;
  3383. this.showImportResult = true;
  3384. if (res.code == "ok") {
  3385. //换成弹出框,以免有人等了半天回来啥也没看到
  3386. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3387. this.getReportList();
  3388. this.importWXDialog = false;
  3389. } else {
  3390. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3391. }
  3392. },
  3393. error => {
  3394. this.$refs.upload.clearFiles();
  3395. this.importingData = false;
  3396. this.$message({
  3397. message: error,
  3398. type: "error"
  3399. });
  3400. });
  3401. }
  3402. },
  3403. userssHu() {
  3404. this.http.post('/time-type/getCompanyTimeSetting',{
  3405. companyId: this.user.companyId
  3406. },
  3407. res => {
  3408. if (res.code == "ok") {
  3409. this.yonghuUser = res.data
  3410. }
  3411. },
  3412. error => {
  3413. this.$message({
  3414. message: error,
  3415. type: "error"
  3416. });
  3417. }
  3418. );
  3419. },
  3420. iptBlur(i) {
  3421. if(this.isBatch == 0) {
  3422. return
  3423. }
  3424. var reqParam = {
  3425. startDate: this.workForm.createDate[0],
  3426. endDate: this.workForm.createDate[1]
  3427. };
  3428. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3429. reqParam.userId = this.workForm.userId[0];
  3430. }
  3431. this.http.post('/report/getWorkDays',reqParam,
  3432. res => {
  3433. if (res.code == "ok") {
  3434. this.jsDay = res.data
  3435. this.chuji(i)
  3436. } else {
  3437. this.$message({
  3438. message: res.msg,
  3439. type: "error"
  3440. });
  3441. }
  3442. },
  3443. error => {
  3444. this.$message({
  3445. message: error,
  3446. type: "error"
  3447. });
  3448. }
  3449. );
  3450. //明夷硬编码获取
  3451. if (this.user.company.companyName == this.mingyiName) {
  3452. this.getWorkTimeForMinYi();
  3453. }
  3454. },
  3455. getWorkTimeForMinYi(){
  3456. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3457. startDate: this.workForm.createDate[0],
  3458. endDate: this.workForm.createDate[1]
  3459. },
  3460. res => {
  3461. if (res.code == "ok") {
  3462. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3463. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3464. this.totalReportHours = this.workTimeForMinYi;
  3465. } else {
  3466. this.$message({
  3467. message: res.msg,
  3468. type: "error"
  3469. });
  3470. this.workForm.createDate = [];
  3471. }
  3472. },
  3473. error => {
  3474. this.$message({
  3475. message: error,
  3476. type: "error"
  3477. });
  3478. }
  3479. );
  3480. },
  3481. chuji(i) {
  3482. if(i == 0) {
  3483. this.seleChn(1)
  3484. } else if(i == 1) {
  3485. this.seleChn(0)
  3486. } else if(i == 2) {
  3487. if(this.workForm.domains[0].multiWorktime > 0) {
  3488. this.iptChangs()
  3489. } else {
  3490. this.iptChang()
  3491. }
  3492. } else if(i == 3) {
  3493. this.seleChn(0)
  3494. }
  3495. },
  3496. seleChn(e,domain) {
  3497. if(e == 1) {
  3498. for(var i in this.workForm.domains) {
  3499. if(this.workForm.domains[i].timeType == 0) {
  3500. this.workForm.domains[i].workingTime = 8
  3501. } else {
  3502. this.workForm.domains[i].workingTime = 4
  3503. }
  3504. }
  3505. }
  3506. var quanbu = 0
  3507. var spl = this.workForm.domains
  3508. var zhi = ''
  3509. for(var i in spl) {
  3510. var sp = +spl[i].workingTime + 0
  3511. zhi = this.jsDay * sp
  3512. quanbu = +quanbu + zhi
  3513. }
  3514. this.jsTime = quanbu
  3515. this.totalReportHours = quanbu
  3516. let worktime = this.jsTime
  3517. // 自动计算加班时长
  3518. if(this.isBatch != 0){
  3519. worktime = this.jsTime / this.jsDay
  3520. }
  3521. if(this.user.timeType.fillOvertime && domain){
  3522. let isover = false
  3523. let alltime = 0
  3524. let allover = 0 //此处alltime同上面的worktime
  3525. for(let d in spl){
  3526. if(spl[d].isOvertime){
  3527. isover = true
  3528. allover += spl[d].overtimeHours*1
  3529. }
  3530. alltime += spl[d].workingTime*1
  3531. }
  3532. if(domain.overtimeHours){
  3533. allover = allover - domain.overtimeHours
  3534. }
  3535. if(worktime*1 > this.user.timeType.allday){
  3536. if(isover){
  3537. if(alltime > (allover + this.user.timeType.allday)){
  3538. this.$set(domain,'isOvertime',true)
  3539. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3540. }else{
  3541. this.$set(domain,'isOvertime',false)
  3542. this.$set(domain,'overtimeHours',null)
  3543. if(alltime < (allover + this.user.timeType.allday)){
  3544. let overtime = allover + this.user.timeType.allday - alltime
  3545. for(let pi in spl){
  3546. if(spl[pi].overtimeHours){
  3547. if((overtime - spl[pi].overtimeHours*1) > 0){
  3548. overtime = overtime - spl[pi].overtimeHours*1
  3549. this.$set(spl[pi],'isOvertime',false)
  3550. this.$set(spl[pi],'overtimeHours',null)
  3551. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3552. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3553. break
  3554. }else{
  3555. this.$set(spl[pi],'isOvertime',false)
  3556. this.$set(spl[pi],'overtimeHours',null)
  3557. break
  3558. }
  3559. }
  3560. }
  3561. }
  3562. }
  3563. }else{
  3564. this.$set(domain,'isOvertime',true)
  3565. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3566. }
  3567. }else{
  3568. for(let di in spl){
  3569. this.$set(spl[di],'isOvertime',false)
  3570. this.$set(spl[di],'overtimeHours',null)
  3571. }
  3572. }
  3573. }
  3574. },
  3575. iptChang() {
  3576. var sl = this.workForm.domains
  3577. let timeArr = []
  3578. for(var i in sl) {
  3579. if(sl[i].startTime && sl[i].endTime) {
  3580. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3581. }
  3582. }
  3583. this.getTimeHours(timeArr)
  3584. // for(let j in arrNum) {
  3585. // this.timeJsonStr += arrNum[j]
  3586. // if(flg) {
  3587. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3588. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3589. // }
  3590. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3591. // flg = true
  3592. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3593. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3594. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3595. // }
  3596. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3597. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3598. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3599. // }
  3600. // }
  3601. },
  3602. iptChangs() {
  3603. var sl = this.workForm.domains
  3604. let timeArr = []
  3605. for(var i in sl) {
  3606. for(var j in sl[i].worktimeList){
  3607. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3608. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3609. }
  3610. }
  3611. }
  3612. this.getTimeHours(timeArr)
  3613. },
  3614. // 调用接口或去数据
  3615. getTimeHours(arr) {
  3616. this.http.post('/report/getHoursByTimeRange',{
  3617. timeJsonStr: JSON.stringify(arr)
  3618. },res => {
  3619. if(res.code === 'ok') {
  3620. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3621. } else {
  3622. this.$message({
  3623. message: res.msg,
  3624. type: 'error'
  3625. })
  3626. }
  3627. },err => {
  3628. this.$message({
  3629. message: err,
  3630. type: 'error'
  3631. })
  3632. })
  3633. },
  3634. // 按周填报调用接口计算时间
  3635. async getWeekHoursByTimeRange(timeRange) {
  3636. const url = '/report/getHoursByTimeRange';
  3637. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3638. var that = this;
  3639. return new Promise((resolve, reject) => {
  3640. this.http.post(url, data, function(res) {
  3641. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3642. }, function(err) {
  3643. reject(err);
  3644. });
  3645. });
  3646. },
  3647. removeTimeItem(item, index) {
  3648. item.worktimeList.splice(index, 1);
  3649. this.iptChangs()
  3650. },
  3651. //添加工时
  3652. addNewWorktime(index, item) {
  3653. if(item.worktimeList == null ) {
  3654. item.worktimeList = []
  3655. }
  3656. item.worktimeList.push({});
  3657. },
  3658. //复制项目
  3659. copyProject(index) {
  3660. var leftProgress = 10;
  3661. if (this.reportTimeType.type == 3) {
  3662. //计算已经待分配工时比例
  3663. let array = this.workForm.domains;
  3664. let totalProgress = 0;
  3665. for (var i=0;i<array.length; i++) {
  3666. totalProgress += array[i].progress;
  3667. }
  3668. if (totalProgress < 100) {
  3669. leftProgress = 100 - totalProgress;
  3670. }
  3671. }
  3672. var newIndex = index+1;
  3673. var itemDomain = {
  3674. projectId: this.workForm.domains[index].projectId,
  3675. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3676. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3677. ),
  3678. content: "",
  3679. progress:leftProgress,
  3680. state:2,//2-表示待提交
  3681. };
  3682. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3683. if (this.reportTimeType.type == 0) {
  3684. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3685. var length = this.workForm.domains.length;
  3686. if (length == 2) {
  3687. this.showAddMore = false;
  3688. }
  3689. }
  3690. this.selectProject(itemDomain, newIndex);
  3691. },
  3692. pushWorkTime(reportId){
  3693. let url=''
  3694. if(this.user.timeType.syncSap == 1){
  3695. url='/report/pushProjectReportToSap'
  3696. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3697. var pushDate = this.date + day;
  3698. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3699. confirmButtonText: '确定',
  3700. cancelButtonText: '取消',
  3701. type: 'info'
  3702. }).then(() => {
  3703. const loading = this.$loading({
  3704. lock: true,
  3705. text: '正在推送中,请耐心等待。',
  3706. spinner: 'el-icon-loading',
  3707. background: 'rgba(0, 0, 0, 0.7)'
  3708. });
  3709. this.http.post(url,{
  3710. pushDate: pushDate,
  3711. reportId: reportId
  3712. },res => {
  3713. loading.close();
  3714. if(res.code == 'ok'){
  3715. this.$message({
  3716. type: 'success',
  3717. message: res.data
  3718. });
  3719. }else{
  3720. this.$message({
  3721. type: 'error',
  3722. message: res.msg
  3723. })
  3724. }
  3725. },err => {
  3726. loading.close();
  3727. this.$message({
  3728. type: 'error',
  3729. message: err
  3730. })
  3731. })
  3732. }).catch(() => {
  3733. });
  3734. }else{
  3735. url='/report/pushReportDataToThird'
  3736. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3737. confirmButtonText: '确定',
  3738. cancelButtonText: '取消',
  3739. type: 'info'
  3740. }).then(() => {
  3741. const loading = this.$loading({
  3742. lock: true,
  3743. text: '正在推送中,请耐心等待。',
  3744. spinner: 'el-icon-loading',
  3745. background: 'rgba(0, 0, 0, 0.7)'
  3746. });
  3747. this.http.post(url,{
  3748. yearMonth: this.date
  3749. },res => {
  3750. loading.close();
  3751. if(res.code == 'ok'){
  3752. this.$message({
  3753. type: 'success',
  3754. message: '推送成功!'
  3755. });
  3756. }else{
  3757. this.$message({
  3758. type: 'error',
  3759. message: res.msg
  3760. })
  3761. }
  3762. },err => {
  3763. loading.close();
  3764. this.$message({
  3765. type: 'error',
  3766. message: err
  3767. })
  3768. })
  3769. }).catch(() => {
  3770. });
  3771. }
  3772. },
  3773. showWorkTime(){
  3774. this.monthWorkTimeDialog = true;
  3775. this.searchKeyword = ''
  3776. this.WorktimeDatepickValue = this.istoMonth()
  3777. if(this.WorktimeDatepickValue.length == 0){
  3778. let newdate = new Date();
  3779. let nowdate = newdate.toLocaleDateString();
  3780. let getauto = this.getAutoWeekDate(nowdate)
  3781. let nowwd = [getauto[0],getauto[6]]
  3782. this.WorktimeDatepickValue = nowwd
  3783. }
  3784. this.showMonthWorkTime()
  3785. },
  3786. handleClick(t,e){
  3787. if (t.name == "second") {
  3788. this.showMonthNotWorkTime()
  3789. }else if(t.name == "first"){
  3790. this.showMonthWorkTime()
  3791. }else if(t.name == "third"){
  3792. this.showMonthWorkTimeReminder()
  3793. }
  3794. },
  3795. //导出员工每日填报工时数
  3796. exportMembWorkHours() {
  3797. this.http.post(
  3798. "/report/exportUserDailyWorkTime",
  3799. {
  3800. // month: this.date,
  3801. startDate: this.WorktimeDatepickValue[0],
  3802. endDate: this.WorktimeDatepickValue[1],
  3803. },
  3804. (res) => {
  3805. if (res.code == "ok") {
  3806. let url = res.data;
  3807. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3808. }
  3809. },
  3810. (error) => {
  3811. this.$message({
  3812. message: error,
  3813. type: "error",
  3814. });
  3815. }
  3816. );
  3817. },
  3818. exportMembWorkHoursReminder() {
  3819. this.http.post(
  3820. "/report/exportUserDailyWorkTimeReminder",
  3821. {
  3822. // month: this.date,
  3823. startDate: this.WorktimeDatepickValue[0],
  3824. endDate: this.WorktimeDatepickValue[1],
  3825. },
  3826. (res) => {
  3827. if (res.code == "ok") {
  3828. let url = res.data;
  3829. this.downloadByA('工时异常表.xlsx', url);
  3830. }
  3831. },
  3832. (error) => {
  3833. this.$message({
  3834. message: error,
  3835. type: "error",
  3836. });
  3837. }
  3838. );
  3839. },
  3840. exportMembNotWorkHours() {
  3841. this.http.post(
  3842. "/report/exportNoReportUserList",
  3843. {
  3844. // month: this.date,
  3845. startDate: this.WorktimeDatepickValue[0],
  3846. endDate: this.WorktimeDatepickValue[1],
  3847. },
  3848. (res) => {
  3849. if (res.code == "ok") {
  3850. let url = res.data;
  3851. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3852. }
  3853. },
  3854. (error) => {
  3855. this.$message({
  3856. message: error,
  3857. type: "error",
  3858. });
  3859. }
  3860. );
  3861. },
  3862. downloadByA(name, url) {
  3863. const a = document.createElement("a"); // 创建a标签
  3864. a.setAttribute("download", name); // download属性
  3865. a.setAttribute("href", url); // href链接
  3866. a.click(); // 自执行点击事件
  3867. a.remove();
  3868. },
  3869. // 是否本月判断
  3870. istoMonth(){
  3871. let todate = new Date()
  3872. let tomonth = todate.getMonth() + 1
  3873. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3874. if(this.date == adate){
  3875. return []
  3876. }else{
  3877. let sedate = new Date(this.date)
  3878. let semonth = sedate.getMonth() + 1
  3879. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3880. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3881. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3882. return [sedates1, sedates2]
  3883. }
  3884. },
  3885. showMonthWorkTime() {
  3886. this.monthTotalPage = 0,
  3887. this.tbload = true
  3888. let parameter={
  3889. startDate: this.WorktimeDatepickValue[0],
  3890. endDate: this.WorktimeDatepickValue[1],
  3891. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3892. }
  3893. this.http.post(
  3894. "/report/getUserDailyWorkTime",
  3895. // "/report/getNoReportUserList",
  3896. parameter,
  3897. (res) => {
  3898. if (res.code == "ok") {
  3899. this.tbload = false;
  3900. this.pickDateArray = res.data.days.map(item => {
  3901. return {
  3902. ...item,
  3903. dateStr: item.label.split('/')[0],
  3904. weekStr: item.label.split('/')[1]
  3905. }
  3906. });
  3907. // console.log('dataarray',res.data.days);
  3908. this.monthWorkData = res.data.list;
  3909. // this.monthWorkDataS = this.monthWorkData
  3910. // this.monthWorkDataS1 = res.data.list
  3911. this.monthTotal = res.data.list.length
  3912. if (this.monthWorkData.length > 50) {
  3913. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3914. }else{
  3915. this.monthWorkDataS = this.monthWorkData
  3916. }
  3917. this.searchScreen(0)
  3918. // this.monthWorkDataS = infoList
  3919. // 判断
  3920. // if (this.monthWorkDataS1.length > 0) {
  3921. // setTimeout(() => {
  3922. // this.tableListener()
  3923. // }, 1000);
  3924. // }
  3925. this.$nextTick(function(){
  3926. this.$refs.hasworkTbl.doLayout();
  3927. });
  3928. // this.$forceUpdate()
  3929. }
  3930. },
  3931. (error) => {
  3932. this.tbload = false
  3933. this.$message({
  3934. message: error,
  3935. type: "error",
  3936. });
  3937. }
  3938. );
  3939. },
  3940. showMonthWorkTimeReminder() {
  3941. this.monthTotalPage = 0,
  3942. this.tbload = true
  3943. let parameter={}
  3944. parameter={
  3945. startDate: this.WorktimeDatepickValue[0],
  3946. endDate: this.WorktimeDatepickValue[1],
  3947. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3948. viewValue:this.isReminder?1:0
  3949. }
  3950. this.http.post(
  3951. "/report/getUserDailyWorkTimeReminder",
  3952. parameter,
  3953. (res) => {
  3954. if (res.code == "ok") {
  3955. this.tbload = false;
  3956. this.monthWorkData = res.data.list;
  3957. this.monthTotal = res.data.list.length
  3958. if (this.monthWorkData.length > 50) {
  3959. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3960. }else{
  3961. this.monthWorkDataS = this.monthWorkData
  3962. }
  3963. this.searchScreen(0)
  3964. this.$nextTick(function(){
  3965. this.$refs.hasworkTbl.doLayout();
  3966. });
  3967. }
  3968. },
  3969. (error) => {
  3970. this.tbload = false
  3971. this.$message({
  3972. message: error,
  3973. type: "error",
  3974. });
  3975. }
  3976. );
  3977. },
  3978. // tableListener(){
  3979. // let that = this;
  3980. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3981. // // 添加scroll监听事件
  3982. // dom.addEventListener("scroll", function () {
  3983. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3984. // if (scrollDistance < 2) {
  3985. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3986. // that.monthTotalPage++; //当前页数自增
  3987. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3988. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3989. // var infoList = arrList.splice(
  3990. // that.monthTotalPage * that.monthTotalLages,
  3991. // that.monthTotalLages
  3992. // );
  3993. // // 数据添加
  3994. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3995. // }
  3996. // }
  3997. // })
  3998. // },
  3999. showMonthNotWorkTime() {
  4000. this.monthTotalPage = 0,
  4001. this.tbload = true,
  4002. this.http.post(
  4003. "/report/getNoReportUserList",
  4004. {
  4005. startDate: this.WorktimeDatepickValue[0],
  4006. endDate: this.WorktimeDatepickValue[1],
  4007. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4008. },
  4009. (res) => {
  4010. if (res.code == "ok") {
  4011. this.tbload = false
  4012. this.monthNotWorkDate = res.data;
  4013. // this.monthNotWorkDateS1 = res.data
  4014. this.monthnotTotal = res.data.length
  4015. // 2222111
  4016. if (this.monthNotWorkDate.length > 50) {
  4017. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4018. } else {
  4019. this.monthNotWorkDateS = this.monthNotWorkDate
  4020. }
  4021. this.searchScreen(1)
  4022. // 判断
  4023. // if (this.monthnotworkDateS1.length > 0) {
  4024. // setTimeout(() => {
  4025. // this.tableListenernot()
  4026. // }, 1000);
  4027. // }
  4028. this.$nextTick(function(){
  4029. this.$refs.hasworkTbl2.doLayout();
  4030. });
  4031. }
  4032. },
  4033. (error) => {
  4034. this.tbload = false
  4035. this.$message({
  4036. message: error,
  4037. type: "error",
  4038. });
  4039. }
  4040. );
  4041. },
  4042. // tableListenernot(){
  4043. // let that = this;
  4044. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4045. // dom.addEventListener("scroll", function () {
  4046. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4047. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4048. // if (scrollDistance2 < 2) {
  4049. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4050. // that.monthnotTotalPage++; //当前页数自增
  4051. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4052. // var infoList = arrList.splice(
  4053. // that.monthnotTotalPage * that.monthnotTotalLages,
  4054. // that.monthnotTotalLages
  4055. // );
  4056. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4057. // }
  4058. // }
  4059. // })
  4060. // },
  4061. listScroll(){
  4062. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4063. this.isMore = true
  4064. setTimeout(()=>{
  4065. this.isMore = false
  4066. },1000)
  4067. }else {
  4068. this.isFlag = true
  4069. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4070. this.monthWorkDataS = datalist
  4071. setTimeout(()=>{
  4072. this.isFlag = false
  4073. },300)
  4074. }
  4075. },
  4076. notListScroll(){
  4077. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4078. this.isMore = true
  4079. setTimeout(()=>{
  4080. this.isMore = false
  4081. },1000)
  4082. }else {
  4083. this.isFlag = true
  4084. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4085. this.monthNotWorkDateS = datalist
  4086. // console.log('length',this.monthNotWorkDateS.length)
  4087. setTimeout(()=>{
  4088. this.isFlag = false
  4089. },300)
  4090. }
  4091. },
  4092. getFirstAndLastDay() {
  4093. // 将选定的月份转换为Date对象
  4094. var monthDate = new Date();
  4095. var year = monthDate.getFullYear();
  4096. var month = monthDate.getMonth();
  4097. // 计算起始日和结束日
  4098. var startDay = new Date(year, month, 1);
  4099. var endDay = new Date(year, month + 1, 0);
  4100. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4101. this.WorktimeDatepickValueForMonth=lastmd
  4102. },
  4103. formatDate(date) {
  4104. var year = date.getFullYear();
  4105. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4106. var day = ("0" + date.getDate()).slice(-2);
  4107. return year + "-" + month + "-" + day;
  4108. },
  4109. // 获取默认这zhou日期参数 222
  4110. getLastWeek(e){
  4111. let newdate = new Date()
  4112. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4113. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4114. if(e==1){
  4115. this.WorktimeDatepickValue = lastwd
  4116. this.showMonthWorkTime()
  4117. }else if(e==2){
  4118. this.WorktimeDatepickValue = lastwd
  4119. this.showMonthWorkTimeReminder()
  4120. }else{
  4121. this.WorktimeDatepickValue = lastwd
  4122. this.showMonthNotWorkTime()
  4123. }
  4124. },
  4125. getThisWeek(e){
  4126. let newdate = new Date();
  4127. let nowdate = newdate.toLocaleDateString();
  4128. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4129. if(e==1){
  4130. this.WorktimeDatepickValue = nowwd
  4131. this.showMonthWorkTime()
  4132. }else if(e==2){
  4133. this.WorktimeDatepickValue = nowwd
  4134. this.showMonthWorkTimeReminder()
  4135. }else{
  4136. this.WorktimeDatepickValue = nowwd
  4137. this.showMonthNotWorkTime()
  4138. }
  4139. },
  4140. getDoubleLastWeek(e){
  4141. let newdate = new Date()
  4142. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4143. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4144. if(e==1){
  4145. this.WorktimeDatepickValue = nextwd
  4146. this.showMonthWorkTime()
  4147. }else if(e==2){
  4148. this.WorktimeDatepickValue = nextwd
  4149. this.showMonthWorkTimeReminder()
  4150. }else{
  4151. this.WorktimeDatepickValue = nextwd
  4152. this.showMonthNotWorkTime()
  4153. }
  4154. },
  4155. alreadyAllDate(stime,etime){
  4156. let diffdate = new Array();
  4157. let i=0;
  4158. while(stime<=etime){
  4159. let dateArray = stime.split("-");
  4160. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4161. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4162. let stimewk = this.weekDay[date.getDay()]
  4163. 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')
  4164. 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])
  4165. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4166. let stime_ts = new Date(stime).getTime();
  4167. let next_date = stime_ts + (24*60*60*1000);
  4168. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4169. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4170. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4171. stime = next_dates_y+next_dates_m+next_dates_d;
  4172. i++;
  4173. }
  4174. return diffdate
  4175. },
  4176. getAutoWeekDate(e) {
  4177. let dateString = e;
  4178. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4179. if (dateString.match(dateStringReg)) {
  4180. let presentDate = new Date(dateString),
  4181. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4182. return Array.from(new Array(7), function (val, index) {
  4183. let formatDate = new Date(
  4184. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4185. );
  4186. return (
  4187. formatDate.getFullYear() +
  4188. "-" +
  4189. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4190. "-" +
  4191. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4192. );
  4193. });
  4194. } else {
  4195. throw new Error(
  4196. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4197. );
  4198. }
  4199. },
  4200. onProgressChange() {
  4201. this.$forceUpdate();
  4202. },
  4203. showChooseMembTree() {
  4204. this.chosenMembCount = this.participator.length;
  4205. this.chooseParticipVisible = true;
  4206. },
  4207. onTreeItemChange() {
  4208. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4209. var list = chosenList.filter(item=>item.isUser == 1);
  4210. this.chosenMembCount = list.length;
  4211. },
  4212. findUserInTree() {
  4213. if (this.filterName == '') {
  4214. this.deptMembData = this.allMembData;
  4215. } else {
  4216. var list = this.findRecursively(this.filterName, this.allMembData);
  4217. this.deptMembData = list;
  4218. }
  4219. },
  4220. findRecursively(username, list) {
  4221. var filterList = [];
  4222. for (var i=0;i<list.length; i++) {
  4223. if (list[i].isUser == 1) {
  4224. if (list[i].label.indexOf(username) >= 0) {
  4225. //匹配上了
  4226. filterList.push(list[i]);
  4227. }
  4228. } else if (list[i].children != null && list[i].children.length > 0) {
  4229. var subList = this.findRecursively(username, list[i].children);
  4230. if (subList.length > 0) {
  4231. subList.forEach(s=>filterList.push(s));
  4232. }
  4233. }
  4234. }
  4235. return filterList;
  4236. },
  4237. //确定选择参与人
  4238. chooseParticip() {
  4239. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4240. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4241. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4242. if (this.user.company.packageProject == 1) {
  4243. if (this.chosenMembList.length > 1) {
  4244. this.$message({
  4245. message: '每次仅支持代填一个人',
  4246. type: "error",
  4247. });
  4248. return;
  4249. }
  4250. }
  4251. this.chooseParticipVisible = false;
  4252. this.workForm.userNames = '';
  4253. this.workForm.userId = [];
  4254. this.participator = [];
  4255. for (var i=0;i<this.chosenMembList.length; i++) {
  4256. this.workForm.userId.push(this.chosenMembList[i].id);
  4257. this.workForm.userNames += this.chosenMembList[i].label+',';
  4258. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4259. this.participator.push(item);
  4260. }
  4261. if (this.workForm.userNames.length > 0) {
  4262. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4263. }
  4264. if(this.user.userNameNeedTranslate == 1) {
  4265. if(this.workForm.userNames) {
  4266. this.workForm.userNames = this.workForm.userNames.split(',')
  4267. }
  4268. }
  4269. },
  4270. notifySel(sel){
  4271. // console.log(sel);
  4272. this.notifySelList = sel
  4273. },
  4274. //微信通知人员填写
  4275. Notify(code) {
  4276. if (this.notifySelList.length == 0) return;
  4277. var ids = '';
  4278. this.notifySelList.forEach(f=>{
  4279. ids += f.id+',';
  4280. })
  4281. this.http.post('/user/pushFillReport',{
  4282. ids: ids, date: this.curDate,
  4283. code: code
  4284. },
  4285. res => {
  4286. if (res.code == "ok") {
  4287. this.$message({
  4288. message: this.$t('message.sentSuccessfully'),
  4289. type: "success"
  4290. });
  4291. }
  4292. },
  4293. error => {
  4294. this.$message({
  4295. message: error,
  4296. type: "error"
  4297. });
  4298. }
  4299. );
  4300. },
  4301. //导出人员列表
  4302. exportMemb() {
  4303. if (this.fillMembList.length == 0) return;
  4304. var ids = '';
  4305. this.fillMembList.forEach(f=>{
  4306. ids += f.id+',';
  4307. })
  4308. this.http.post('/user/exportMembList',{
  4309. ids: ids,isFill: this.isFill, date: this.curDate
  4310. },
  4311. res => {
  4312. if (res.code == "ok") {
  4313. var aTag = document.createElement('a');
  4314. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4315. aTag.href = res.data;
  4316. aTag.click();
  4317. }
  4318. },
  4319. error => {
  4320. this.$message({
  4321. message: error,
  4322. type: "error"
  4323. });
  4324. }
  4325. );
  4326. },
  4327. showMembList(fill) {
  4328. this.membListVisible = true;
  4329. if (fill == 0) {
  4330. this.fillMembList = this.unFillList;
  4331. this.isFill = false;
  4332. let leaveList = []
  4333. let unleaveList = []
  4334. for(let i in this.fillMembList){
  4335. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4336. leaveList.push(this.fillMembList[i])
  4337. }else{
  4338. unleaveList.push(this.fillMembList[i])
  4339. }
  4340. }
  4341. this.fillMembList = unleaveList
  4342. this.fillMembList_leave = leaveList
  4343. } else if(fill == 1){
  4344. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4345. this.isFill = true;
  4346. }else{
  4347. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4348. this.isFill = true;
  4349. }
  4350. },
  4351. //获取自己填写的日报状态
  4352. getReportFillStatus() {
  4353. this.http.post('/report/getReportFillStatus',{
  4354. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4355. },
  4356. res => {
  4357. if (res.code == "ok") {
  4358. this.fillStatusList = res.data;
  4359. this.allDate.forEach(d=>{
  4360. var fillInfo = null;
  4361. d.state = null;
  4362. this.fillStatusList.forEach(s=>{
  4363. var d1 = s.createDate.split('-')[2];
  4364. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4365. if (d1.indexOf('0') == 0) {
  4366. d1 = d1.substring(1,d1.length);
  4367. }
  4368. if (d1 == d2) {
  4369. d.state = s.state;
  4370. d.exceedCardTime = s.exceedCardTime
  4371. }
  4372. })
  4373. })
  4374. this.$forceUpdate();
  4375. }
  4376. },
  4377. error => {
  4378. this.$message({
  4379. message: error,
  4380. type: "error"
  4381. });
  4382. }
  4383. );
  4384. },
  4385. scrollFunction () {
  4386. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4387. if (this.domObj.attachEvent) { // IE
  4388. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4389. } else if (this.domObj.addEventListener) {
  4390. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4391. }
  4392. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4393. },
  4394. mouseScroll(event) { // google 浏览器下
  4395. let detail = event.wheelDelta || event.detail
  4396. let moveForwardStep = -1
  4397. let moveBackStep = 1
  4398. let step = 0
  4399. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4400. event.preventDefault() // 阻止浏览器默认事件
  4401. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4402. },
  4403. // //左右滚动
  4404. // wheel(e){
  4405. // var a = document.getElementById("dateScroll");
  4406. // var scroll_width = 80; //滚动一下的距离
  4407. // var e = e || window.event, v;
  4408. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4409. // if(v>3||-v>3) v=-v;
  4410. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4411. // e.preventDefault(); //阻止浏览器的默认滚动
  4412. // },
  4413. showExportDialog() {
  4414. this.exportType = 0
  4415. this.exportDialog = true;
  4416. },
  4417. showExportTimeDialog() {
  4418. this.exportTimeDialog = true;
  4419. },
  4420. changeAllTime() {
  4421. //总时长发生改变,自动按比例计算
  4422. this.workForm.domains.forEach(d=>{
  4423. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4424. });
  4425. //计算jsTime
  4426. if (this.workForm.createDate) {
  4427. let sdate = new Date(this.workForm.createDate[0]);
  4428. let edate = new Date(this.workForm.createDate[1]);
  4429. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4430. console.log('days===', days)
  4431. if (days < 0) {
  4432. days = 0;
  4433. }
  4434. this.jsTime = this.reportTimeType.allday * days;
  4435. }
  4436. },
  4437. // 是否加班的单机事件
  4438. check() {
  4439. this.selected = !this.selected
  4440. this.isNew = this.selected
  4441. },
  4442. updateSubProject() {
  4443. this.$forceUpdate();
  4444. },
  4445. selectDegreeId(domain, index) {
  4446. this.http.post('/report/defaultDegree',{
  4447. projectId: domain.projectId
  4448. },
  4449. res => {
  4450. if (res.code == "ok") {
  4451. if(res.data) {
  4452. this.workForm.domains[index].degreeId = res.data.id + ''
  4453. this.$forceUpdate();
  4454. }
  4455. }
  4456. },
  4457. error => {
  4458. this.$message({
  4459. message: error,
  4460. type: "error"
  4461. });
  4462. }
  4463. );
  4464. },
  4465. //项目选中了, 加载子项目
  4466. selectProject(domain, index) {
  4467. if(!domain.projectId){
  4468. return;
  4469. }
  4470. // 默认选中上次填写的自定义维度
  4471. if(this.yonghuUser.customDegreeActive == 1) {
  4472. this.selectDegreeId(domain, index)
  4473. }
  4474. // console.log('projectId===',domain.projectId);
  4475. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4476. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4477. this.http.post('/sub-project/list',{
  4478. projectId: domain.projectId,
  4479. isReport: true
  4480. },
  4481. res => {
  4482. //清空之前选中的子项目
  4483. // this.workForm.domains[index].subProjectId = 0;
  4484. if (res.code == "ok") {
  4485. this.workForm.domains[index].subProjectList = res.data;
  4486. this.workForm.domains[index].subProjectId = null;
  4487. this.$forceUpdate();
  4488. }
  4489. },
  4490. error => {
  4491. this.$message({
  4492. message: error,
  4493. type: "error"
  4494. });
  4495. }
  4496. );
  4497. //项目相关的近期任务
  4498. if (this.user.company.packageProject == 1) {
  4499. this.getRecentTaskList(domain, index);
  4500. //获取项目相关专业
  4501. if (this.user.company.packageEngineering == 1) {
  4502. this.getProjectProfessions(domain, index);
  4503. }
  4504. //获取项目下的任务分组
  4505. this.getTaskGroups(domain, index);
  4506. }
  4507. // 获取项目相关的维度
  4508. // domain.degreeId = null
  4509. this.$set(domain,'degreeId',null)
  4510. this.$set(domain,'multiDegrIdArray',null)
  4511. this.dimension(domain, index);
  4512. //获取项目审核人
  4513. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4514. this.getProjectAuditorList(domain, index);
  4515. } else {
  4516. //按分组的负责人来审核
  4517. domain.projectAuditorId = null;
  4518. domain.projectAuditorName = null;
  4519. domain.auditUserList = null;
  4520. }
  4521. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4522. if (this.reportTimeType.type == 3) {
  4523. //新增项目时,自动计算
  4524. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4525. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4526. }
  4527. //加载昱众的工作职责
  4528. if (this.user.companyId == this.yuzhongCompId) {
  4529. this.updateResponse(domain);
  4530. }
  4531. },
  4532. getRecentTaskList(domain, index) {
  4533. //刷新任务时,清空服务
  4534. this.$set(domain, 'sapServiceId', null);
  4535. this.$set(domain, 'taskId', null);
  4536. var param = {
  4537. projectId: domain.projectId,
  4538. isSubstitude:this.isSubstitude?1:0,
  4539. };
  4540. if (domain.groupId) {
  4541. param.groupId = domain.groupId;
  4542. }
  4543. if (domain.stage) {
  4544. param.stage = domain.stage;
  4545. }
  4546. //专业版代填,获取代填员工的任务
  4547. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4548. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4549. this.$message({
  4550. message: '请选择代填的员工',
  4551. type: "error"
  4552. });
  4553. return;
  4554. } else {
  4555. param.userId = this.workForm.userId[0];
  4556. }
  4557. }
  4558. this.http.post('/task/getRecentTask',param,
  4559. res => {
  4560. if (res.code == "ok") {
  4561. this.workForm.domains[index].allTaskList = res.data;
  4562. this.workForm.domains[index].taskList = res.data;
  4563. this.$forceUpdate();
  4564. }
  4565. },
  4566. error => {
  4567. this.$message({
  4568. message: error,
  4569. type: "error"
  4570. });
  4571. }
  4572. );
  4573. },
  4574. //获取项目审核人
  4575. getProjectAuditorList(domainItem, index) {
  4576. if(domainItem.projectId == '') {
  4577. return
  4578. }
  4579. domainItem.projectAuditorId = null;
  4580. domainItem.projectAuditorName = null;
  4581. this.http.post('/project-auditor/getList',{
  4582. projectId: domainItem.projectId,
  4583. },
  4584. res => {
  4585. if (res.code == "ok") {
  4586. domainItem.auditUserList = res.data;
  4587. if (res.data.length==0) {
  4588. this.$message({
  4589. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4590. type: "error"
  4591. });
  4592. } else if (res.data.length==1) {
  4593. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4594. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4595. }
  4596. this.$forceUpdate();
  4597. }
  4598. },
  4599. error => {
  4600. this.$message({
  4601. message: error,
  4602. type: "error"
  4603. });
  4604. }
  4605. );
  4606. },
  4607. // 获取维度数据
  4608. dimension(domain, index) {
  4609. if(domain.projectId == '') {
  4610. return
  4611. }
  4612. this.http.post('/project/getDegreeList',{
  4613. projectId: domain.projectId,
  4614. },
  4615. res => {
  4616. if (res.code == "ok") {
  4617. // console.log("维度数据",res.data);
  4618. this.workForm.domains[index].wuduList = res.data
  4619. // this.workForm = this.workForm
  4620. this.$forceUpdate()
  4621. }
  4622. },
  4623. error => {
  4624. this.$message({
  4625. message: error,
  4626. type: "error"
  4627. });
  4628. }
  4629. );
  4630. },
  4631. //切换任务阶段
  4632. changeStages(domain, index) {
  4633. if (domain.stage == null || domain.stage == '') {
  4634. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4635. } else {
  4636. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4637. }
  4638. this.getRecentTaskList(domain, index);
  4639. this.$forceUpdate();
  4640. },
  4641. getGroupStages(domain, index, keepStage) {
  4642. // console.log(domain);
  4643. if(!domain.groupId){
  4644. domain.projectAuditorId = ''
  4645. domain.stages = []
  4646. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4647. domain.taskId = ''
  4648. domain.sapServiceId = ''
  4649. }
  4650. if(this.user.timeType.reportAuditType >= 1){
  4651. domain.auditUserList = []
  4652. }
  4653. this.$forceUpdate();
  4654. return
  4655. }
  4656. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4657. res => {
  4658. if (res.code == "ok") {
  4659. if (!keepStage) {
  4660. domain.stage = '';
  4661. }
  4662. domain.stages = res.data;
  4663. this.getRecentTaskList(domain, index);
  4664. this.$forceUpdate();
  4665. }
  4666. },
  4667. error => {
  4668. this.$message({
  4669. message: error,
  4670. type: "error"
  4671. });
  4672. });
  4673. //检查当前的项目是否需要获取分组的负责人
  4674. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4675. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4676. res => {
  4677. if (res.code == "ok") {
  4678. domain.getProjectAuditorList = res.data;
  4679. domain.auditUserList = res.data;
  4680. if (res.data.length==1) {
  4681. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4682. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4683. } else if (res.data.length==0) {
  4684. domain.projectAuditorId = null;
  4685. domain.projectAuditorName = null;
  4686. }
  4687. this.$forceUpdate();
  4688. }
  4689. },
  4690. error => {
  4691. this.$message({
  4692. message: error,
  4693. type: "error"
  4694. });
  4695. });
  4696. }
  4697. },
  4698. getProjectProfessions(domain, index) {
  4699. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4700. res => {
  4701. if (res.code == "ok") {
  4702. this.workForm.domains[index].professionProgress = res.data;
  4703. this.$forceUpdate();
  4704. }
  4705. },
  4706. error => {
  4707. this.$message({
  4708. message: error,
  4709. type: "error"
  4710. });
  4711. });
  4712. },
  4713. //删除自己的日报
  4714. deleteReport() {
  4715. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4716. confirmButtonText: this.$t('btn.determine'),
  4717. cancelButtonText: this.$t('btn.cancel'),
  4718. type: "warning"
  4719. })
  4720. .then(() => {
  4721. this.listLoading = true;
  4722. this.http.post('/report/delete',{
  4723. userId: this.user.id,
  4724. date: this.workForm.createDate
  4725. },
  4726. res => {
  4727. this.listLoading = false;
  4728. if (res.code == "ok") {
  4729. this.$message({
  4730. message: this.$t('message.successfullyDeleted'),
  4731. type: "success"
  4732. });
  4733. this.getReportList();
  4734. this.getDepartment();
  4735. this.dialogVisible = false;
  4736. } else {
  4737. this.$message({
  4738. message: res.msg,
  4739. type: "error"
  4740. });
  4741. }
  4742. },
  4743. error => {
  4744. this.listLoading = false;
  4745. this.$message({
  4746. message: error,
  4747. type: "error"
  4748. });
  4749. }
  4750. );
  4751. })
  4752. .catch(() => {});
  4753. },
  4754. // 管理员删除日报
  4755. guanli(item) {
  4756. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4757. let param = {date: this.date + day, userId: item.id};
  4758. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4759. confirmButtonText: this.$t('btn.determine'),
  4760. cancelButtonText: this.$t('btn.cancel'),
  4761. type: "warning"
  4762. })
  4763. .then(() => {
  4764. this.listLoading = true;
  4765. this.http.post('/report/delete',param,
  4766. res => {
  4767. this.listLoading = false;
  4768. if (res.code == "ok") {
  4769. this.$message({
  4770. message: this.$t('message.successfullyDeleted'),
  4771. type: "success"
  4772. });
  4773. this.getReportList();
  4774. this.getDepartment();
  4775. this.dialogVisible = false;
  4776. } else {
  4777. this.$message({
  4778. message: res.msg,
  4779. type: "error"
  4780. });
  4781. }
  4782. },
  4783. error => {
  4784. this.listLoading = false;
  4785. this.$message({
  4786. message: error,
  4787. type: "error"
  4788. });
  4789. }
  4790. );
  4791. })
  4792. .catch(() => {});
  4793. },
  4794. selectAll() {
  4795. if (this.isAllSelect) {
  4796. var keys = [];
  4797. this.reportNames.forEach(b=>{
  4798. keys.push(b.id);
  4799. })
  4800. this.$refs.approveTree.setCheckedKeys(keys);
  4801. } else {
  4802. this.$refs.approveTree.setCheckedKeys([]);
  4803. }
  4804. },
  4805. removeEmptyNode(list) {
  4806. for (var i=0;i<list.length;i++) {
  4807. var cnt = 0;
  4808. if (list[i].membCount == 0) {
  4809. list.splice(i, 1);
  4810. i--;
  4811. } else if (list[i].children != null) {
  4812. this.removeEmptyNode(list[i].children);
  4813. }
  4814. }
  4815. },
  4816. calculateMembCount(list) {
  4817. for (var i in list) {
  4818. var cnt = 0;
  4819. if (list[i].children != null) {
  4820. this.calculateMembCount(list[i].children);
  4821. for (var m in list[i].children) {
  4822. cnt += list[i].children[m].membCount;
  4823. }
  4824. }
  4825. if (list[i].isUser == 1) {
  4826. cnt++;
  4827. this.membCount++;
  4828. }
  4829. list[i].membCount = cnt;
  4830. }
  4831. },
  4832. stateChange() {
  4833. // console.log(this.allData,'alldate');
  4834. this.membCount = 0;
  4835. if (this.selectState == -1) {
  4836. //全部状态
  4837. this.data = this.allData;
  4838. } else {
  4839. //未填报
  4840. this.seluserText = ''
  4841. var newData = JSON.parse(JSON.stringify(this.allData));
  4842. this.filterState(this.selectState, newData);
  4843. this.data = newData;
  4844. }
  4845. this.calculateMembCount(this.data);
  4846. this.data[0].membCount = this.membCount;//总人数
  4847. },
  4848. //按状态过滤部门人员
  4849. filterState(state, list) {
  4850. for (var i =0;i<list.length; i++) {
  4851. var obj = list[i];
  4852. if (obj.isUser == 1) {
  4853. var match = false;
  4854. if (state == -2) {
  4855. if (obj.state == null) {
  4856. match = true;
  4857. }
  4858. } else {
  4859. if (obj.state == state) {
  4860. match = true;
  4861. }
  4862. }
  4863. if (!match) {
  4864. list.splice(i, 1);
  4865. i--;
  4866. } else {
  4867. }
  4868. } else {
  4869. if (obj.children != null) {
  4870. this.filterState(state, obj.children);
  4871. }
  4872. }
  4873. }
  4874. },
  4875. //a按名称过滤部门人员
  4876. async seluserforText(){
  4877. const { userNameNeedTranslate } = this.user
  4878. this.membCount = 0;
  4879. var newData = JSON.parse(JSON.stringify(this.allData));
  4880. let textList = [this.seluserText]
  4881. if(userNameNeedTranslate == 1) {
  4882. this.dataLoading = true
  4883. let res = await this.postData('/user/getEmployeeList', {
  4884. keyword: this.seluserText,
  4885. cursor: '',
  4886. departmentId: -1,
  4887. pageIndex: 1,
  4888. pageSize: 1000
  4889. })
  4890. textList = res.data.records.map(item => item.name)
  4891. this.dataLoading = false
  4892. }
  4893. // return
  4894. console.log(textList, '<=== textList')
  4895. this.seluserforTextin(this.seluserText, newData, textList)
  4896. console.log(newData, 'Data')
  4897. this.data = newData;
  4898. this.calculateMembCount(this.data);
  4899. this.data[0].membCount = this.membCount;//总人数
  4900. },
  4901. seluserforTextin(text, list, textList = []){
  4902. for (var i =0;i<list.length; i++) {
  4903. var obj = list[i];
  4904. if (obj.isUser == 1) {
  4905. var match = false;
  4906. // if (obj.label.indexOf(text) != -1) {
  4907. // match = true
  4908. // }
  4909. if(textList.some(item => item.includes(obj.label))) {
  4910. match = true
  4911. }
  4912. if (!match) {
  4913. list.splice(i, 1);
  4914. i--;
  4915. } else {
  4916. }
  4917. } else {
  4918. if (obj.children != null) {
  4919. this.seluserforTextin(text, obj.children, textList);
  4920. }
  4921. }
  4922. }
  4923. },
  4924. // 当节点发生变化时
  4925. nodeChangeExpand(data) {
  4926. // 保存当前展开的节点
  4927. let flag = false
  4928. this.nodeModelData.some(item => {
  4929. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4930. flag = true
  4931. return true
  4932. }
  4933. })
  4934. if (!flag) { // 不存在则存到数组里
  4935. this.nodeModelData.push(data.id)
  4936. }
  4937. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4938. },
  4939. nodeChangeCollapse(data) {
  4940. console.log(this.nodeModelData)
  4941. this.nodeModelData.some((item, i) => {
  4942. if (item === data.id) {
  4943. this.nodeModelData.length = i
  4944. }
  4945. })
  4946. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4947. },
  4948. // 部门列表点击
  4949. handleNodeClick(data) {
  4950. // this.dealList = data
  4951. this.theValues(data.id, this.allData)
  4952. // this.depData = data;
  4953. var list = [];
  4954. if (data.id == -1) {
  4955. this.deptId = null;
  4956. this.targetUid = null;
  4957. list = this.data;
  4958. } else if (data.isUser == 1) {
  4959. this.deptId = null;
  4960. this.targetUid = data.id;
  4961. } else {
  4962. this.deptId = data.id;
  4963. this.targetUid = null;
  4964. list.push(data);
  4965. }
  4966. this.getReportList();
  4967. if (list.length > 0) {
  4968. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4969. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4970. }
  4971. },
  4972. exportPushLog(){
  4973. this.http.post('/sap-sync-log/export',{},
  4974. res => {
  4975. if (res.code == "ok") {
  4976. var filePath = res.data;
  4977. var fName = '推送日志.xlsx'
  4978. const a = document.createElement('a'); // 创建a标签
  4979. a.setAttribute('download', fName);// download属性
  4980. a.setAttribute('href', filePath);// href链接
  4981. a.click(); //自执行点击事件
  4982. a.remove();
  4983. } else {
  4984. this.$message({
  4985. message: res.msg,
  4986. type: "error"
  4987. });
  4988. }
  4989. },
  4990. error => {
  4991. this.$message({
  4992. message: error,
  4993. type: "error"
  4994. });
  4995. });
  4996. },
  4997. theValues(id, item) {
  4998. for(var i in item) {
  4999. if(item[i].id == id) {
  5000. this.depData = item[i]
  5001. if(id == '-1') {
  5002. this.translation = '1'
  5003. } else {
  5004. if(item[i].children) {
  5005. this.translation = '2'
  5006. } else {
  5007. this.translation = '3'
  5008. }
  5009. }
  5010. return
  5011. } else {
  5012. if(item[i].children) {
  5013. this.theValues(id, item[i].children)
  5014. }
  5015. }
  5016. }
  5017. },
  5018. //获取可以选择的代填的人员列表
  5019. getSubstitudeUserDeptList() {
  5020. if (this.deptMembData.length == 0) {
  5021. this.http.post("/department/listMyMembs", {},
  5022. res => {
  5023. if (res.code == "ok") {
  5024. let noAllData = JSON.parse(JSON.stringify(res.data));
  5025. if (noAllData.length > 0) {
  5026. // if (noAllData[0].label == '全部人员') {
  5027. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5028. noAllData.splice(0,1);
  5029. }
  5030. }
  5031. this.setUserToDept(noAllData);
  5032. this.deptMembData = noAllData;
  5033. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5034. console.log(this.deptMembData, '代填人员数据')
  5035. } else {
  5036. this.$message({
  5037. message: res.msg,
  5038. type: "error"
  5039. });
  5040. }
  5041. },
  5042. error => {
  5043. this.$message({
  5044. message: error,
  5045. type: "error"
  5046. });
  5047. });
  5048. }
  5049. },
  5050. // 获取部门列表
  5051. getDepartmentForApprove() {
  5052. this.http.post( this.port.manage.depList, {},
  5053. res => {
  5054. if (res.code == "ok") {
  5055. var list1 = JSON.parse(JSON.stringify(res.data));
  5056. this.deptOptionList = this.changeArr(list1);
  5057. console.log(this.deptOptionList, '部门')
  5058. } else {
  5059. this.$message({
  5060. message: res.msg,
  5061. type: "error"
  5062. });
  5063. }
  5064. },
  5065. error => {
  5066. this.$message({
  5067. message: error,
  5068. type: "error"
  5069. });
  5070. });
  5071. },
  5072. // 获取部门列表
  5073. getDepartment() {
  5074. //如果没有权限,就不需要获取
  5075. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5076. return;
  5077. }
  5078. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5079. var param = {date:this.date + day};
  5080. this.http.post("/report/getMembList", param,
  5081. res => {
  5082. if (res.code == "ok") {
  5083. if(res.data.length == 0){
  5084. return
  5085. }
  5086. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5087. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5088. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5089. // if (this.user.role > 0) {
  5090. // }
  5091. list.splice(0,0,{
  5092. id: -1,
  5093. label: this.$t('lable.allStaff'),
  5094. })
  5095. this.membCount = 0;
  5096. //设置员工到部门下面
  5097. this.setUserToDept(list);
  5098. this.data = list;
  5099. // console.log('data',this.data);
  5100. this.expandDate = [this.data[1].id]
  5101. this.allData = list;
  5102. // if (noAllData.length > 0) {
  5103. // if (noAllData[0].label == '全部人员') {
  5104. // noAllData.splice(0,1);
  5105. // }
  5106. // }
  5107. // this.setUserToDept(noAllData);
  5108. // this.deptMembData = noAllData;
  5109. this.option = this.changeArr(list1);
  5110. list[0].membCount = this.membCount;
  5111. if (this.depData.id == -1) {
  5112. this.depData.membCount = this.membCount;
  5113. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5114. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5115. } else {
  5116. if (this.depData.isUser == null) {
  5117. var dep = this.findTargetDept(this.data, this.depData.id);
  5118. var membDeptList = [];
  5119. membDeptList.push(dep);
  5120. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5121. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5122. }
  5123. }
  5124. if (this.depData.isUser == null) {
  5125. if (this.isFill) {
  5126. this.fillMembList = this.fillList;
  5127. } else {
  5128. this.fillMembList = this.unFillList;
  5129. }
  5130. }
  5131. this.leaveAllNum = 0
  5132. for(let i in this.unFillList){
  5133. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5134. this.leaveAllNum += 1
  5135. }
  5136. }
  5137. this.stateChange()
  5138. } else {
  5139. this.$message({
  5140. message: res.msg,
  5141. type: "error"
  5142. });
  5143. }
  5144. },
  5145. error => {
  5146. this.$message({
  5147. message: error,
  5148. type: "error"
  5149. });
  5150. });
  5151. this.getReportFillStatus();
  5152. },
  5153. findTargetDept(list, deptId) {
  5154. var t = null;
  5155. for (var i=0;i<list.length; i++) {
  5156. if (list[i].isUser == null && list[i].id == deptId) {
  5157. t = list[i];
  5158. break;
  5159. }
  5160. }
  5161. if (t == null) {
  5162. for (var i=0;i<list.length; i++) {
  5163. if (list[i].children != null && list[i].children.length > 0) {
  5164. t = this.findTargetDept(list[i].children, deptId);
  5165. if (t != null) {
  5166. break;
  5167. }
  5168. }
  5169. }
  5170. }
  5171. return t;
  5172. },
  5173. getUserMembListFromDeptList(list, isFill) {
  5174. var membList = [];
  5175. for (var i in list) {
  5176. var deptName = list[i].label;
  5177. if (list[i].userList != null) {
  5178. list[i].userList.forEach(element => {
  5179. if (isFill == 0) {
  5180. //获取未填的
  5181. if (element.state == null) {
  5182. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5183. membList.push(obj);
  5184. }
  5185. } else {
  5186. if (element.state != null) {
  5187. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5188. membList.push(obj);
  5189. }
  5190. }
  5191. });
  5192. }
  5193. if (list[i].children != null) {
  5194. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5195. }
  5196. }
  5197. return membList;
  5198. },
  5199. setUserToDept(list) {
  5200. for (var i in list) {
  5201. var cnt = 0;
  5202. if (list[i].children != null) {
  5203. this.setUserToDept(list[i].children);
  5204. for (var m in list[i].children) {
  5205. cnt += list[i].children[m].membCount;
  5206. }
  5207. }
  5208. if (list[i].userList != null) {
  5209. if (list[i].children == null) {
  5210. list[i].children = [];
  5211. }
  5212. list[i].userList.forEach(element => {
  5213. var obj = {
  5214. id: element.id,
  5215. label:element.name,
  5216. state:element.state,
  5217. parentId:element.departmentId,
  5218. isUser:1,
  5219. workingTime: element.workingTime,
  5220. leaveDays: element.leaveDays,
  5221. leaveTimes: element.leaveTimes
  5222. };
  5223. list[i].children.push(obj);
  5224. this.membCount++;
  5225. cnt++;
  5226. });
  5227. }
  5228. list[i].membCount = cnt;
  5229. }
  5230. },
  5231. // 修改数组
  5232. changeArr(arr) {
  5233. for (var i = 0; i < arr.length; i++) {
  5234. if(arr[i].id != -1 && arr[i].id != 0) {
  5235. if (arr[i].children != null && arr[i].children.length>0) {
  5236. arr[i].children = this.changeArr(arr[i].children);
  5237. }
  5238. arr[i].id && (arr[i].value = arr[i].id);
  5239. delete arr[i].id;
  5240. }
  5241. }
  5242. for(var i in arr) {
  5243. if(arr[i].id == -1 || arr[i].id == 0) {
  5244. arr.splice(i,1)
  5245. }
  5246. }
  5247. return arr;
  5248. },
  5249. //时间段范围设置改动,监听
  5250. onTimeTypeChange(timeType) {
  5251. this.seleChn(1)
  5252. this.showAddMore = true;
  5253. for(var i in this.workForm.domains) {
  5254. if (this.workForm.domains[i].timeType == 0) {
  5255. this.showAddMore = false;
  5256. break;
  5257. }
  5258. }
  5259. if (this.showAddMore) {
  5260. //检测数量
  5261. if (this.workForm.domains.length == 2) {
  5262. this.showAddMore = false;
  5263. } else {
  5264. this.showAddMore = true;
  5265. }
  5266. }
  5267. },
  5268. getTimeType() {
  5269. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5270. res => {
  5271. if (res.code == "ok") {
  5272. var t = res.data;
  5273. this.reportTimeType = t;
  5274. if (this.reportTimeType.type > 0) {
  5275. this.showAddMore = true;
  5276. }
  5277. //转化时间格式
  5278. if (t.allday != null) {
  5279. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5280. }
  5281. if (t.am != null) {
  5282. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5283. }
  5284. if (t.pm != null) {
  5285. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5286. }
  5287. let arr = []
  5288. for(var i in res.data.excludeTimeList) {
  5289. let obj = {
  5290. s: res.data.excludeTimeList[i].startTime,
  5291. e: res.data.excludeTimeList[i].endTime,
  5292. }
  5293. arr.push(obj)
  5294. }
  5295. this.vacationTime = arr
  5296. } else {
  5297. this.$message({
  5298. message: res.msg,
  5299. type: "error"
  5300. });
  5301. }
  5302. },
  5303. error => {
  5304. this.listLoading = false;
  5305. this.$message({
  5306. message: error,
  5307. type: "error"
  5308. });
  5309. });
  5310. },
  5311. // 改变月份 -------
  5312. changeMonthOut() {
  5313. this.getAllDate();
  5314. this.getReportList();
  5315. this.getDepartment();
  5316. },
  5317. // 选择日期
  5318. choseDate(i, item) {
  5319. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5320. return
  5321. }
  5322. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5323. this.choseDay = i;
  5324. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5325. sessionStorage.msg = this.date + day,
  5326. this.getReportList();
  5327. this.getDepartment();
  5328. this.curDate = item.date;
  5329. },
  5330. canClick(i, item){
  5331. let nowDate = new Date()
  5332. let nowDateYear = nowDate.getFullYear()
  5333. let itemYear = parseInt(this.date.split('-')[0])
  5334. let nowDateMonth = nowDate.getMonth() + 1
  5335. let itemMonth = parseInt(this.date.split('-')[1])
  5336. let nowDateDay = nowDate.getDate()
  5337. let itemDay = parseInt(item.showDate.split('.')[1])
  5338. if(nowDateYear < itemYear){
  5339. return false
  5340. }else if(nowDateYear == itemYear){
  5341. if(nowDateMonth < itemMonth){
  5342. return false
  5343. }else if(nowDateMonth == itemMonth){
  5344. if(nowDateDay < itemDay){
  5345. return false
  5346. }
  5347. }
  5348. }
  5349. },
  5350. // 获取日期列表
  5351. getAllDate(e) {
  5352. var dayArry = [];
  5353. var day = this.getCountDays();
  5354. let curMonthDay = null;
  5355. for (var k = 1; k <= day; k++) {
  5356. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5357. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5358. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5359. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5360. if(sessionStorage.msg) {
  5361. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5362. this.choseDay = k - 1;
  5363. curMonthDay = str;
  5364. }
  5365. } else {
  5366. if (new Date().getDate() == k) {
  5367. this.choseDay = k - 1;
  5368. }
  5369. }
  5370. } else {
  5371. this.choseDay = 0;
  5372. }
  5373. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5374. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5375. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5376. }
  5377. this.allDate = dayArry;
  5378. //不能超过最大日期
  5379. if (this.choseDay > day-1) {
  5380. this.choseDay = day-1;
  5381. }
  5382. if(sessionStorage.from != 1){
  5383. let nowmonth = new Date().getMonth() + 1
  5384. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5385. let nowdate = new Date().getDate()
  5386. if(nowd == this.date){
  5387. if(e && sessionStorage.msg){
  5388. }else{
  5389. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5390. }
  5391. let nowday = new Date(sessionStorage.msg).getDate()
  5392. this.choseDay = nowday - 1
  5393. let monthdate = new Date(sessionStorage.msg)
  5394. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5395. }else{
  5396. if(e && sessionStorage.msg){
  5397. }else{
  5398. sessionStorage.msg = this.date + '-01'
  5399. }
  5400. let monthdate = new Date(sessionStorage.msg)
  5401. this.choseDay = monthdate.getDate() - 1
  5402. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5403. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5404. }
  5405. }else{
  5406. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5407. }
  5408. //从消息点击跳转过来的,直接加载指定日期
  5409. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5410. this.curDate = sessionStorage.msg;
  5411. sessionStorage.from = 0;
  5412. } else {
  5413. // if (curMonthDay != null) {
  5414. // // this.curDate = curMonthDay;
  5415. // let d = new Date(sessionStorage.msg)
  5416. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5417. // } else {
  5418. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5419. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5420. // }
  5421. }
  5422. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5423. // if(!sessionStorage.msg){
  5424. // let msgday = this.choseDay + 1
  5425. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5426. // }
  5427. this.getReportFillStatus();
  5428. },
  5429. getCountDays() {
  5430. var newstr = this.date.replace(/-/g, "/");
  5431. var curDate = new Date(newstr+'/01');
  5432. var curMonth = curDate.getMonth();
  5433. curDate.setMonth(curMonth + 1);
  5434. curDate.setDate(0);
  5435. return curDate.getDate();
  5436. },
  5437. reqMore() {
  5438. if (this.hasMore) {
  5439. this.pageIndex++;
  5440. this.requestHttpReports();
  5441. }
  5442. },
  5443. //加载日报数据
  5444. requestHttpReports() {
  5445. //请求数据
  5446. this.listLoading = true;
  5447. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5448. let param = {date: this.date + day};
  5449. if (this.deptId) {
  5450. param.deptId = this.deptId;
  5451. }
  5452. if (this.targetUid) {
  5453. param.userId = this.targetUid;
  5454. }
  5455. //传页码
  5456. if (this.hasMore) {
  5457. param.pageIndex = this.pageIndex;
  5458. }
  5459. this.http.post( this.port.report.list, param,
  5460. res => {
  5461. this.listLoading = false;
  5462. if (res.code == "ok") {
  5463. //扩增
  5464. this.reportList = this.reportList.concat(res.data.data);
  5465. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5466. if(document.querySelector("#day"+this.choseDay)){
  5467. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5468. }
  5469. } else {
  5470. this.$message({
  5471. message: res.msg,
  5472. type: "error"
  5473. });
  5474. }
  5475. },
  5476. error => {
  5477. this.listLoading = false;
  5478. this.$message({
  5479. message: error,
  5480. type: "error"
  5481. });
  5482. });
  5483. },
  5484. //获取日报列表
  5485. getReportList() {
  5486. //初始化,重置数据
  5487. this.pageIndex = 0;
  5488. this.hasMore = true;
  5489. this.reportList = [];
  5490. this.requestHttpReports();
  5491. },
  5492. //刷新日报状态,用于审核后更新
  5493. refreshReportData(reportId) {
  5494. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5495. res => {
  5496. if (res.code == "ok") {
  5497. for (var m=0;m<this.reportList.length; m++) {
  5498. var d = this.reportList[m].data;
  5499. var find = d.filter(r=>r.id == reportId);
  5500. if (find.length > 0) {
  5501. find[0].state = res.data.state;
  5502. if (find[0].state == 2) {//被驳回,要可以编辑
  5503. this.reportList[m].state = 2;
  5504. }
  5505. find[0].isDeptAudit = res.data.isDeptAudit;
  5506. find[0].departmentAuditState = res.data.departmentAuditState;
  5507. find[0].projectAuditorName = res.data.projectAuditorName;
  5508. find[0].projectAuditorId = res.data.projectAuditorId;
  5509. find[0].projectAuditState = res.data.projectAuditState;
  5510. find[0].rejectUserid = res.data.rejectUserid;
  5511. find[0].rejectUsername = res.data.rejectUsername;
  5512. find[0].rejectReason = res.data.rejectReason;
  5513. this.$forceUpdate();
  5514. break;
  5515. }
  5516. }
  5517. } else {
  5518. this.$message({
  5519. message: res.msg,
  5520. type: "error"
  5521. });
  5522. }
  5523. },
  5524. error => {
  5525. this.listLoading = false;
  5526. this.$message({
  5527. message: error,
  5528. type: "error"
  5529. });
  5530. });
  5531. },
  5532. //导出员工工时统计
  5533. exportUserTime() {
  5534. this.listLoading = true;
  5535. var param = {};
  5536. if (this.exportParam.dateRange != null) {
  5537. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5538. }
  5539. this.http.post('/department/exportDeptStatistic', param,
  5540. res => {
  5541. this.listLoading = false;
  5542. if (res.code == "ok") {
  5543. location.href = res.data;
  5544. this.exportTimeDialog = false;
  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. exportReport() {
  5562. this.exportingData = true;
  5563. var param = {};
  5564. if (this.exportParam.dateRange != null) {
  5565. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5566. }
  5567. if (this.exportParam.projectId != null) {
  5568. param.projectId = this.exportParam.projectId;
  5569. }
  5570. if (this.exportParam.departmentId != null) {
  5571. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5572. param.departmentIds = this.exportParam.departmentId.join(',')
  5573. }
  5574. param.stateKey = this.stateKey
  5575. // param.departmentId = this.user.departmentId
  5576. console.log(param, '《=== 导出传的参数');
  5577. console.log('开始调用exportReport接口');
  5578. this.http.post(this.port.report.export, param,
  5579. res => {
  5580. this.exportingData = false;
  5581. if (res.code == "ok") {
  5582. var filePath = res.data;
  5583. const a = document.createElement('a'); // 创建a标签
  5584. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5585. a.setAttribute('href', filePath);// href链接
  5586. a.click(); //自执行点击事件
  5587. a.remove();
  5588. this.exportDialog = false;
  5589. } else {
  5590. this.$message({
  5591. message: res.msg,
  5592. type: "error"
  5593. });
  5594. }
  5595. },
  5596. error => {
  5597. this.exportingData = false;
  5598. this.$message({
  5599. message: error,
  5600. type: "error"
  5601. });
  5602. });
  5603. },
  5604. //导出日报审核记录
  5605. exportReportLog() {
  5606. this.exportingData = true;
  5607. var param = {};
  5608. if (this.exportReportLogParam.dateRange != null) {
  5609. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5610. }
  5611. this.http.post('/report-log/exportReportLog', param,
  5612. res => {
  5613. this.exportingData = false;
  5614. if (res.code == "ok") {
  5615. var filePath = res.data;
  5616. const a = document.createElement('a'); // 创建a标签
  5617. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5618. a.setAttribute('href', filePath);// href链接
  5619. a.click(); //自执行点击事件
  5620. a.remove();
  5621. this.exportDialog = false;
  5622. } else {
  5623. this.$message({
  5624. message: res.msg,
  5625. type: "error"
  5626. });
  5627. }
  5628. },
  5629. error => {
  5630. this.exportingData = false;
  5631. this.$message({
  5632. message: error,
  5633. type: "error"
  5634. });
  5635. });
  5636. },
  5637. importReportLog(item){
  5638. //首先判断文件类型
  5639. let str = item.file.name.split(".");
  5640. let format = str[str.length - 1];
  5641. if (format != "xls" && format != "xlsx") {
  5642. this.$message({
  5643. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5644. type: "error"
  5645. });
  5646. } else {
  5647. let formData = new FormData();
  5648. formData.append("multipartFile", item.file);
  5649. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5650. res => {
  5651. this.$refs.upload.clearFiles();
  5652. if (res.code == "ok") {
  5653. this.$message({
  5654. message: res.msg,
  5655. type: "success"
  5656. });
  5657. } else {
  5658. this.$message({
  5659. message: res.msg,
  5660. type: "error"
  5661. });
  5662. }
  5663. },
  5664. error => {
  5665. this.$refs.upload.clearFiles();
  5666. this.$message({
  5667. message: error,
  5668. type: "error"
  5669. });
  5670. });
  5671. }
  5672. },
  5673. //获取项目列表
  5674. getProjectList() {
  5675. this.listLoading = true;
  5676. this.http.post( this.port.project.list, {},
  5677. res => {
  5678. this.listLoading = false;
  5679. if (res.code == "ok") {
  5680. for(var i in res.data) {
  5681. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5682. res.data[i].projectCode = ''
  5683. }
  5684. }
  5685. this.projectList = res.data;
  5686. console.log("项目列表",this.projectList);
  5687. } else {
  5688. this.$message({
  5689. message: res.msg,
  5690. type: "error"
  5691. });
  5692. }
  5693. },
  5694. error => {
  5695. this.listLoading = false;
  5696. this.$message({
  5697. message: error,
  5698. type: "error"
  5699. });
  5700. });
  5701. },
  5702. // 获取填报日报的项目下拉列表
  5703. getFillProjectList() {
  5704. this.http.post( this.port.project.list, {
  5705. forReport: 1
  5706. },res => {
  5707. if (res.code == "ok") {
  5708. for(var i in res.data) {
  5709. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5710. res.data[i].projectCode = ''
  5711. }
  5712. }
  5713. this.fillProjectList = res.data;
  5714. this.getRecentlyProject()
  5715. } else {
  5716. this.$message({
  5717. message: res.msg,
  5718. type: "error"
  5719. });
  5720. }
  5721. },
  5722. error => {
  5723. this.$message({
  5724. message: error,
  5725. type: "error"
  5726. });
  5727. });
  5728. },
  5729. getBasecostItemList() {
  5730. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5731. companyId: this.user.companyId
  5732. },
  5733. res => {
  5734. if (res.code == "ok") {
  5735. this.timeBasecostList = res.data;
  5736. }
  5737. });
  5738. },
  5739. getAIReport(createDate) {
  5740. this.http.post('/report/getAIReport', {},
  5741. res => {
  5742. if (res.code == "ok") {
  5743. var quanbu = 0
  5744. this.jsDay = 1
  5745. var zhi = ''
  5746. var slp = res.data
  5747. for(var i in slp) {
  5748. var sp = +slp[i].workingTime + 0
  5749. zhi = this.jsDay * sp
  5750. quanbu = +quanbu + zhi
  5751. }
  5752. this.jsTime = quanbu
  5753. var aiReportData = res.data;
  5754. this.canCancelInDialog = false
  5755. if(aiReportData.length != 0) {
  5756. var arr = [];
  5757. for(var i in aiReportData) {
  5758. arr.push({
  5759. id: null,
  5760. projectId: aiReportData[i].projectId,
  5761. workingTime: aiReportData[i].workingTime,
  5762. content: '',
  5763. progress:100,
  5764. state: 2,
  5765. timeType: aiReportData[i].timeType,
  5766. subProjectList: aiReportData[i].subProjectList,
  5767. taskList: aiReportData[i].taskList,
  5768. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5769. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5770. taskId: aiReportData[i].taskId,
  5771. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5772. startTime: aiReportData[i].startTime,
  5773. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5774. endTime: aiReportData[i].endTime,
  5775. isOvertime: 0,
  5776. progress:aiReportData[i].progress,
  5777. professionProgress: aiReportData[i].professionProgressList,
  5778. stages:aiReportData[i].stages,
  5779. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5780. pics: null,
  5781. multiWorktime: aiReportData[i].multiWorktime,
  5782. worktimeList: [{}],
  5783. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5784. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5785. wuduList: aiReportData[i].degreeList,
  5786. taskGroups:aiReportData[i].taskGroups,
  5787. customData: aiReportData[i].customData,//自定义的数值
  5788. auditUserList: aiReportData[i].auditUserList,
  5789. projectAuditorId: aiReportData[i].projectAuditorId,
  5790. projectAuditorName: aiReportData[i].projectAuditorName,
  5791. overtimeHours: aiReportData[i].overtimeHours,
  5792. customText: aiReportData[i].customText,
  5793. basecostId: aiReportData[i].basecostId,
  5794. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5795. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5796. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5797. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5798. canEdit: true
  5799. })
  5800. }
  5801. this.workForm.domains = arr;
  5802. } else {
  5803. }
  5804. this.canEdit = true;
  5805. this.originCanEdit = true;
  5806. this.seleChn()
  5807. } else {
  5808. this.$message({
  5809. message: res.msg,
  5810. type: "error"
  5811. });
  5812. }
  5813. },
  5814. error => {
  5815. this.$message({
  5816. message: error,
  5817. type: "error"
  5818. });
  5819. });
  5820. },
  5821. // 获取个人某天的日报 111111
  5822. getReport() {
  5823. this.http.post( this.port.report.getPort, {
  5824. date: this.workForm.createDate
  5825. },
  5826. res => {
  5827. if (res.code == "ok") {
  5828. var quanbu = 0
  5829. this.jsDay = 1
  5830. var zhi = ''
  5831. var slp = res.data.report
  5832. for(var i in slp) {
  5833. var sp = +slp[i].workingTime + 0
  5834. zhi = this.jsDay * sp
  5835. quanbu = +quanbu + zhi
  5836. }
  5837. this.jsTime = quanbu
  5838. var list = res.data;
  5839. this.report = list;
  5840. this.reportTimeType = this.report.timeType;
  5841. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5842. this.isWeekend = !this.report.isWorkDay;
  5843. this.canCancelInDialog = false;
  5844. this.hasWrittenReport = list.report.length != 0;
  5845. if(list.report.length != 0) {
  5846. var arr = [];
  5847. this.canEdit = false;
  5848. let candelete = true
  5849. for(var i in list.report) {
  5850. var flg = null
  5851. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5852. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5853. var filteredRespList = null
  5854. if (targetP.length > 0) {
  5855. var isPublic = targetP[0].isPublic;
  5856. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5857. }
  5858. arr.push({
  5859. id: list.report[i].id,
  5860. projectId: list.report[i].projectId,
  5861. workingTime: list.report[i].workingTime,
  5862. content: list.report[i].content,
  5863. state: list.report[i].state,
  5864. timeType: list.report[i].timeType,
  5865. subProjectList: list.report[i].subProjectList,
  5866. taskList: list.report[i].taskList,
  5867. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5868. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5869. taskId: list.report[i].taskId,
  5870. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5871. startTime: list.report[i].startTime,
  5872. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5873. endTime: list.report[i].endTime,
  5874. isOvertime: flg,
  5875. progress:list.report[i].progress,
  5876. professionProgress: list.report[i].professionProgressList,
  5877. stages:list.report[i].stages,
  5878. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5879. pics: list.report[i].pics,
  5880. multiWorktime: list.report[i].multiWorktime,
  5881. worktimeList: list.report[i].worktimeList,
  5882. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5883. multiDegrIdArray: list.report[i].multiDegrIdList,
  5884. wuduList: list.report[i].degreeList,
  5885. taskGroups:list.report[i].taskGroups,
  5886. customData: list.report[i].customData,//自定义的数值
  5887. auditUserList: list.report[i].auditUserList,
  5888. projectAuditorId: list.report[i].projectAuditorId,
  5889. projectAuditorName: list.report[i].projectAuditorName,
  5890. overtimeHours: list.report[i].overtimeHours,
  5891. customText: list.report[i].customText,
  5892. basecostId: list.report[i].basecostId,
  5893. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5894. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5895. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5896. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5897. canEdit: list.report[i].state >= 2 ? true : false,
  5898. extraField1: list.report[i].extraField1,
  5899. extraField2: list.report[i].extraField2,
  5900. extraField3: list.report[i].extraField3,
  5901. workContentList: list.report[i].workContentList,
  5902. filteredRespList: filteredRespList,
  5903. serviceList: list.report[i].serviceList,
  5904. sapServiceId: list.report[i].sapServiceId,
  5905. reportTargetDeptId: list.report[i].deptId
  5906. })
  5907. if (list.report[i].state >= 2) {
  5908. this.canEdit = true;
  5909. }
  5910. if(list.report[i].state < 2){
  5911. candelete = false
  5912. }
  5913. if (list.report[i].state == 0){
  5914. this.canCancelInDialog = true
  5915. }
  5916. // 加判断
  5917. if(this.user.timeType.choseFromAlbum == 1) {
  5918. let arrList = []
  5919. for(var k in list.report[i].pics) {
  5920. let obj = {
  5921. name: k,
  5922. url: list.report[i].pics[k]
  5923. }
  5924. arrList.push(obj)
  5925. }
  5926. arr[i].imgListUrl = arrList
  5927. arr[i].imgList = list.report[i].pics
  5928. }
  5929. }
  5930. this.reportCanDelete = candelete
  5931. this.workForm = {
  5932. createDate: this.workForm.createDate,
  5933. domains: arr,
  5934. userNames:null,
  5935. userId:null,
  5936. time: list.time,
  5937. showRefresh: list.showRefresh
  5938. }
  5939. console.log('workForm', this.workForm)
  5940. } else {
  5941. this.workForm = {
  5942. createDate: this.workForm.createDate,
  5943. domains: [{
  5944. id: null,
  5945. projectId: "",
  5946. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5947. content: "",
  5948. progress:100,
  5949. state: 2,
  5950. timeType:0,
  5951. multiWorktime: this.reportTimeType.multiWorktime,
  5952. worktimeList:[{}],
  5953. canEdit: true,
  5954. auditorFirst: '',
  5955. auditorSec: '',
  5956. auditorThird: '',
  5957. ccUserid: ''
  5958. }],
  5959. userId:null,
  5960. userNames:null,
  5961. time: this.report.time,
  5962. showRefresh: list.showRefresh
  5963. }
  5964. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5965. this.$set(this.workForm.domains[0],'isOvertime',true)
  5966. if(this.reportTimeType.type != 2){
  5967. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5968. }
  5969. }
  5970. if(this.user.timeType.type == 1) {
  5971. var shuzhi = this.user.timeType.allday + ''
  5972. // console.log('执行一次', shuzhi.indexOf('.'))
  5973. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5974. }
  5975. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5976. //默认给第一个,必填字段
  5977. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5978. }
  5979. this.canEdit = true;
  5980. }
  5981. this.originCanEdit = this.canEdit;
  5982. this.seleChn()
  5983. } else {
  5984. this.$message({
  5985. message: res.msg,
  5986. type: "error"
  5987. });
  5988. }
  5989. },
  5990. error => {
  5991. this.$message({
  5992. message: error,
  5993. type: "error"
  5994. });
  5995. });
  5996. },
  5997. guanbi() {
  5998. this.falsss = false,
  5999. this.workTimeForMinYi=0
  6000. },
  6001. // 打开日报填写
  6002. fillInReport(i, isBatch) {
  6003. this.isWeekend = false
  6004. this.reportCanDelete = false
  6005. // console.log(this.user.timeType.type, '选择时长')
  6006. if(i != 1) {
  6007. this.falsss = false
  6008. } else {
  6009. this.falsss = true
  6010. }
  6011. if (this.isSubstitude) {
  6012. this.getSubstitudeUserDeptList();
  6013. }
  6014. if(i == -1 || this.isSubstitude) {
  6015. this.isDisable = false;
  6016. } else {
  6017. this.isDisable = true;
  6018. }
  6019. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6020. this.isBatch = isBatch;
  6021. if (this.isBatch == 0 && !this.isSubstitude) {
  6022. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6023. let weekday = new Date(this.workForm.createDate).getDay()
  6024. if(this.user.companyId == 817){
  6025. if(weekday == 0){
  6026. this.isWeekend = true
  6027. }
  6028. }else{
  6029. if(weekday == 0 || weekday == 6){
  6030. this.isWeekend = true
  6031. }
  6032. }
  6033. this.getReport(i);
  6034. } else {
  6035. // console.log('执行到了这里')
  6036. this.jsTime = 0
  6037. this.jsDay = 0
  6038. this.workForm = {
  6039. createDate: null,//批量填报没有日期
  6040. domains: [{
  6041. id: null,
  6042. projectId: "",
  6043. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6044. content: "",
  6045. progress:100,
  6046. state: 2,
  6047. timeType:0,
  6048. multiWorktime: this.reportTimeType.multiWorktime,
  6049. worktimeList:[{}],
  6050. canEdit: true,
  6051. }],
  6052. }
  6053. if(this.user.timeType.type == 1) {
  6054. var shuzhi = this.user.timeType.allday + ''
  6055. // console.log('执行二次')
  6056. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6057. }
  6058. // console.log(this.workForm)
  6059. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6060. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6061. }
  6062. this.canEdit = true;
  6063. }
  6064. this.dialogVisible = true;
  6065. },
  6066. //按周填报的弹窗口中编辑单项目相关数据
  6067. setWeekFormReportItem(reportId, i, names, row,sss) {
  6068. console.log(sss)
  6069. this.http.post('/report/getReportById', {
  6070. reportId: reportId
  6071. },
  6072. res => {
  6073. if (res.code == "ok") {
  6074. var data = res.data.report;
  6075. sss.subProjectId = data.subProjectId
  6076. sss.subProjectList = data.subProjectList;
  6077. sss.stage = data.stage
  6078. sss.subProjectList = data.subProjectList
  6079. sss.stages = data.stages
  6080. sss.taskGroups = data.taskGroups;
  6081. sss.auditUserList = data.auditUserList;
  6082. sss.degreeId = data.degreeId;
  6083. sss.customData = data.customData;
  6084. sss.wuduList = data.degreeList;
  6085. this.zhoBaoIdx = i
  6086. this.zhoBaoName = names
  6087. this.zhoBao = sss
  6088. this.zhis = row
  6089. if (sss.groupId) {
  6090. //最后一个参数表示是否保留stage的值,不要重置为空
  6091. this.getGroupStages(this.zhoBao, 0, true)
  6092. }
  6093. this.$forceUpdate();
  6094. }
  6095. });
  6096. },
  6097. // 按周填报里内容的填写
  6098. showWeekItemEdit(item, i, projectId,names, row) {
  6099. if (item.state == 0) {
  6100. this.$message({
  6101. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  6102. type: "error"
  6103. });
  6104. return;
  6105. }
  6106. if (item.state == 1) {
  6107. this.$message({
  6108. message: '已通过状态不可修改',
  6109. type: "error"
  6110. });
  6111. return;
  6112. }
  6113. if(this.user.timeType.notAllowedNoAttendance == 1){
  6114. if(this.zhoData[i].corpTime){
  6115. if(this.zhoData[i].corpTime.workHours == 0){
  6116. this.$message({
  6117. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6118. type: 'error'
  6119. })
  6120. return
  6121. }
  6122. }else{
  6123. this.$message({
  6124. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6125. type: 'error'
  6126. })
  6127. return
  6128. }
  6129. }
  6130. var obj = {}
  6131. obj.projectId = projectId
  6132. this.tianxieDialogVisible = true
  6133. this.scopess = item
  6134. var sss = {}
  6135. if (item.id != null) {
  6136. sss.id = item.id;
  6137. sss.state = item.state;
  6138. } else {
  6139. sss.id = -1;
  6140. sss.state = 3;
  6141. }
  6142. sss.projectId = projectId;
  6143. sss.progress = item.progress
  6144. sss.time = item.time
  6145. sss.content = item.content;
  6146. console.log('333', sss.content)
  6147. if (sss.time == '' && this.reportTimeType.type == 2) {
  6148. //取已填时间范围中最大的一个作为开始时间
  6149. var startTime = '09:00';
  6150. var fillStartTime = '00:00';
  6151. for (var t in this.selProjectList) {
  6152. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6153. if (fillItem.time) {
  6154. if (fillItem.time[1] > fillStartTime) {
  6155. fillStartTime = fillItem.time[1];
  6156. }
  6157. }
  6158. }
  6159. if (fillStartTime == '00:00') {
  6160. fillStartTime = '09:00';
  6161. }
  6162. var fillEndMax = '18:00';
  6163. if (fillStartTime >= '18:00') {
  6164. fillEndMax = '23:59';
  6165. }
  6166. sss.time = [fillStartTime, fillEndMax];
  6167. }
  6168. sss.groupId = item.groupId
  6169. sss.stage = item.stage;
  6170. sss.workingTime = item.workingTime
  6171. sss.projectAuditorId = item.projectAuditorId;
  6172. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6173. //默认选中第一个
  6174. sss.basecostId = this.timeBasecostList[0].id;
  6175. }
  6176. var hasEdited = this.zhoData[i][names].hasEdited;
  6177. if (hasEdited) {
  6178. sss = { ...item }
  6179. //编辑过了
  6180. sss.subProjectId = item.subProjectId
  6181. sss.stage = item.stage
  6182. sss.subProjectList = item.subProjectList
  6183. sss.stages = item.stages
  6184. sss.taskGroups = item.taskGroups;
  6185. console.log(sss.taskGroups, '33333');
  6186. sss.auditUserList = obj.auditUserList;
  6187. sss.degreeId = item.degreeId;
  6188. sss.customData = item.customData;
  6189. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6190. //只有一个审核人,自动设置上去
  6191. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6192. }
  6193. sss.wuduList = item.wuduList;
  6194. this.zhoBaoIdx = i
  6195. this.zhoBaoName = names
  6196. this.zhoBao = sss
  6197. this.zhis = row
  6198. if (sss.groupId) {
  6199. //最后一个参数表示是否保留stage的值,不要重置为空
  6200. this.getGroupStages(this.zhoBao, 0, true)
  6201. }
  6202. this.$forceUpdate();
  6203. this.getWeeklyTaskList(sss)
  6204. console.log('最后的周报 ===>', this.zhoBao)
  6205. } else {
  6206. //第一次打开,获取数据
  6207. if (sss.id == -1) {
  6208. //新填报的
  6209. this.selectProject(obj, 0);
  6210. var that = this
  6211. setTimeout(() =>{
  6212. sss.subProjectId = that.workForm.domains[0].subProjectId
  6213. sss.subProjectList = item.subProjectList;
  6214. sss.stage = that.workForm.domains[0].stage
  6215. sss.subProjectList = that.workForm.domains[0].subProjectList
  6216. sss.stages = that.workForm.domains[0].stages
  6217. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6218. sss.auditUserList = obj.auditUserList;
  6219. sss.degreeId = item.degreeId;
  6220. sss.customData = item.customData;
  6221. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6222. //只有一个审核人,自动设置上去
  6223. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6224. }
  6225. sss.wuduList = row[0].wuduList
  6226. that.zhoBaoIdx = i
  6227. that.zhoBaoName = names
  6228. that.zhoBao = sss
  6229. that.zhis = row
  6230. if (sss.groupId) {
  6231. //最后一个参数表示是否保留stage的值,不要重置为空
  6232. this.getGroupStages(that.zhoBao, 0, false)
  6233. }
  6234. that.$forceUpdate();
  6235. this.getWeeklyTaskList(sss)
  6236. },600);
  6237. } else {
  6238. //编辑填报过的;数据库已经存在的
  6239. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6240. }
  6241. }
  6242. },
  6243. // 按周填报里内容的填写点击确定
  6244. setWeekProItemData() {
  6245. //专业版模式下,任务分组和阶段必填
  6246. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6247. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6248. this.$message({
  6249. message: '任务分组和阶段必填,请检查',
  6250. type: "error"
  6251. });
  6252. return;
  6253. }
  6254. }
  6255. // 检查任务分组
  6256. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6257. this.$message({
  6258. message: '任务分组必填,请检查',
  6259. type: "error"
  6260. });
  6261. return
  6262. }
  6263. //检查子项目是否必填
  6264. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6265. this.$message({
  6266. message: '子项目必填,请检查',
  6267. type: "error"
  6268. });
  6269. return;
  6270. }
  6271. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6272. this.$message({
  6273. message: this.$t('message.Pleaseselectareviewer'),
  6274. type: "error"
  6275. });
  6276. return
  6277. }
  6278. if(this.user.timeType.reportAuditType == 3){
  6279. let auditTips = ''
  6280. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6281. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6282. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6283. if(auditTips){
  6284. auditTips = auditTips.substring(0,auditTips.length - 1)
  6285. this.$message({
  6286. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6287. type: 'error'
  6288. })
  6289. return
  6290. }
  6291. }
  6292. let errtips = ''
  6293. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6294. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6295. errtips += this.user.timeType.customDegreeName + '、'
  6296. }
  6297. }
  6298. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6299. errtips += this.user.timeType.customDataName + '、'
  6300. }
  6301. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6302. errtips += this.user.timeType.customTextName + '、'
  6303. }
  6304. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6305. errtips += this.$t('other.workMatters') +'、'
  6306. }
  6307. if(errtips){
  6308. errtips = errtips.substring(0,errtips.length - 1)
  6309. this.$message({
  6310. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6311. type: 'error'
  6312. })
  6313. return
  6314. }
  6315. this.tianxieDialogVisible = false
  6316. var zhong = this.zhoData
  6317. this.zhoBao.hasEdited = true;
  6318. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6319. this.zhoData = zhong
  6320. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6321. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6322. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6323. },
  6324. // 获取本周
  6325. getCurrentWeek() {
  6326. //今天
  6327. this.targetWeekDate = new Date();
  6328. this.initWeekFormData();
  6329. // this.jiazai()
  6330. },
  6331. // 获取上周
  6332. handleGetPrevWeek() {
  6333. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6334. this.initWeekFormData();
  6335. // this.jiazai()
  6336. },
  6337. // 获取下周
  6338. handleGetNextvWeek() {
  6339. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6340. this.initWeekFormData()
  6341. },
  6342. // 加载动画
  6343. jiazai() {
  6344. this.weekDataLoading = true
  6345. var that = this
  6346. setTimeout(() =>{
  6347. that.weekDataLoading = false
  6348. },1000);
  6349. },
  6350. // 转时间格式
  6351. dealdate(date) {
  6352. const dt = new Date(date)
  6353. const y = dt.getFullYear()
  6354. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6355. const d = (dt.getDate() + '').padStart(2, '0')
  6356. return `${y}-${m}-${d}`
  6357. },
  6358. // 按周填报
  6359. fillInReportss() {
  6360. window.addEventListener('scroll', this.handleScroll, true)
  6361. // this.jiazai()
  6362. this.fillWeekDialogVisi = true
  6363. this.getCurrentWeek();
  6364. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6365. //重新获取工时预警类型的预算项
  6366. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6367. companyId: this.user.companyId
  6368. },
  6369. res => {
  6370. if (res.code == "ok") {
  6371. this.timeBasecostList = res.data;
  6372. }
  6373. });
  6374. }
  6375. },
  6376. fillInReportCustom() {
  6377. this.weekIndex++
  6378. this.weekParentData = {
  6379. isSubstitude: this.isSubstitude
  6380. }
  6381. this.fillWeekDialogVisiCustom = true
  6382. },
  6383. // 按周填报的项目筛选
  6384. selListFun(){
  6385. this.selProjectList = []
  6386. if(this.selCon.length){
  6387. for (let i = 0; i < this.selCon.length; i++) {
  6388. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6389. }
  6390. this.selConShow = false ;
  6391. for (let i in this.zhoData) {
  6392. var obj = this.zhoData[i];
  6393. for(var j in this.selProjectList) {
  6394. var xinzhi = this.selProjectList[j].projectName
  6395. obj[xinzhi] = {}
  6396. obj[xinzhi].time = ''
  6397. obj[xinzhi].content = ''
  6398. obj[xinzhi].progress = 0
  6399. obj[xinzhi].workingTime = 0
  6400. }
  6401. }
  6402. this.initWeekFormData();
  6403. }else{
  6404. this.$message({
  6405. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6406. type:'error'
  6407. })
  6408. }
  6409. },
  6410. setWeekCardTimeData(list) {
  6411. for(let i in list){
  6412. let datei = '';
  6413. if (this.user.timeType.showDdCardtime == 1) {
  6414. datei = list[i].workDate;
  6415. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6416. datei = list[i].createDate;
  6417. } else if (this.user.timeType.syncFanwei == 1) {
  6418. datei = list[i].workDate;
  6419. }
  6420. for(let m in this.zhoData) {
  6421. if(datei == this.zhoData[m].zhoDataTime){
  6422. let item = {
  6423. startTime: list[i].startTime,
  6424. endTime: list[i].endTime,
  6425. workHours: list[i].workHours
  6426. }
  6427. this.$set(this.zhoData[m],'corpTime',item)
  6428. }
  6429. }
  6430. }
  6431. },
  6432. getWeeklyCardTime(){ //按周填报获取考勤信息
  6433. let dateStr = []
  6434. for(let i in this.zhoData){
  6435. dateStr.push(this.zhoData[i].zhoDataTime)
  6436. }
  6437. this.http.post('/report/getWeeklyCardTime',{
  6438. dateStr: JSON.stringify(dateStr)
  6439. },res => {
  6440. if(res.code == 'ok'){
  6441. for(let i in res.data){
  6442. let datei = '';
  6443. if (this.user.timeType.showDdCardtime == 1) {
  6444. datei = res.data[i].workDate.split('-');
  6445. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6446. datei = res.data[i].createDate.split('-');
  6447. }
  6448. for(let m in this.zhoData){
  6449. let datem = new Date(this.zhoData[m].zhoDataTime)
  6450. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6451. let item = {
  6452. startTime: res.data[i].startTime,
  6453. endTime: res.data[i].endTime,
  6454. workHours: res.data[i].workHours
  6455. }
  6456. this.$set(this.zhoData[m],'corpTime',item)
  6457. }
  6458. }
  6459. }
  6460. }else{
  6461. this.$message({
  6462. message: res.msg,
  6463. type: 'error'
  6464. })
  6465. }
  6466. },err => {
  6467. this.$message({
  6468. message: err,
  6469. type: 'error'
  6470. })
  6471. })
  6472. },
  6473. selListqx(){
  6474. this.fillWeekDialogVisi = false
  6475. this.selProjectList = []
  6476. this.selCon = []
  6477. },
  6478. handleScroll() {
  6479. this.changdu = this.projectList.length + 1
  6480. },
  6481. // 自动选择时间点的事件
  6482. // async zhoTimes(item, i) {
  6483. // var iss = i
  6484. // if(item.time == null) {
  6485. // return
  6486. // } else {
  6487. // const zhi = this.zhoData[iss];
  6488. // let he = 0;
  6489. // const timeArr = Object.values(zhi)
  6490. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6491. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6492. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6493. // console.log(data, 'data');
  6494. // zhi.he = `${he}h`;
  6495. // }
  6496. // },
  6497. async zhoTimes(item, index) {
  6498. const zho = this.zhoData[index];
  6499. if (!item.time) {
  6500. return;
  6501. }
  6502. const timeArr = Object.values(zho)
  6503. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6504. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6505. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6506. zho.he = `${totalHours[0]}h`;
  6507. },
  6508. // 判断两个时间段是否重叠
  6509. timeOverlap(idx, dateAr) {
  6510. let zhi = 0
  6511. for (let k in dateAr) {
  6512. if (idx !== k) {
  6513. 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))) {
  6514. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6515. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6516. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6517. }
  6518. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6519. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6520. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6521. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6522. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6523. } else {
  6524. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6525. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6526. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6527. }
  6528. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6529. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6530. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6531. }
  6532. }
  6533. }
  6534. }
  6535. }
  6536. return zhi
  6537. },
  6538. // 计算时间
  6539. getHourMinutes(str, end) {
  6540. var he = 0
  6541. var date2 = '2021/12/12 ' + end +':00'
  6542. var date1 = '2021/12/12 ' + str +':00'
  6543. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6544. var leave1=date3%(24*3600*1000)
  6545. var hours=Math.floor(leave1/(3600*1000))
  6546. var leave2=leave1%(3600*1000)
  6547. var minutes=Math.floor(leave2/(60*1000))
  6548. var shi = hours+'.'+ minutes
  6549. return he += +shi
  6550. },
  6551. // 自动选择事件长度的事件
  6552. zhoXuan(item, i) {
  6553. var iss = i
  6554. if(item.time == null) {
  6555. return
  6556. } else {
  6557. var zhi = this.zhoData[iss]
  6558. var he = 0
  6559. for(var i in zhi) {
  6560. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6561. he += +zhi[i].workingTime
  6562. }
  6563. }
  6564. zhi.he = he + 'h'
  6565. }
  6566. },
  6567. getPushWorkLogData(){
  6568. this.http.post('/sap-sync-log/list', {},
  6569. res => {
  6570. if (res.code == "ok") {
  6571. this.pushWorkTimeLogData = res.data;
  6572. } else {
  6573. this.$message({
  6574. message: res.msg,
  6575. type: "error"
  6576. });
  6577. }
  6578. },
  6579. error => {
  6580. this.$message({
  6581. message: error,
  6582. type: "error"
  6583. });
  6584. });
  6585. },
  6586. // 获取全部人员
  6587. getUsers() {
  6588. this.http.post('/user/getSimpleActiveUserList', {},
  6589. res => {
  6590. if (res.code == "ok") {
  6591. this.usersList = res.data;
  6592. } else {
  6593. this.$message({
  6594. message: res.msg,
  6595. type: "error"
  6596. });
  6597. }
  6598. },
  6599. error => {
  6600. this.$message({
  6601. message: error,
  6602. type: "error"
  6603. });
  6604. });
  6605. },
  6606. // 按时间比例
  6607. addBli(item, i) {
  6608. var iss = i
  6609. if(item.time == null) {
  6610. return
  6611. } else {
  6612. var zhi = this.zhoData[iss]
  6613. var he = 0
  6614. for(var i in zhi) {
  6615. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6616. he += +zhi[i].workingTime
  6617. }
  6618. }
  6619. zhi.he = he.toFixed(1) + 'h'
  6620. }
  6621. },
  6622. //按周填报选择的项目发生变化,需要设置列
  6623. onSelProjectChange() {
  6624. for (let i = 0; i < this.selCon.length; i++) {
  6625. var exists = false;
  6626. for (let j = 0; j < this.selProjectList.length; j++) {
  6627. if (this.selProjectList[j].id == this.selCon[i]) {
  6628. exists = true;
  6629. break;
  6630. }
  6631. }
  6632. if (!exists) {
  6633. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6634. this.selProjectList.push(newProject);
  6635. //添加新项目
  6636. for (var w in this.zhoData) {
  6637. var dayItem = this.zhoData[w];
  6638. var pName = newProject.projectName;
  6639. dayItem[pName] = {};
  6640. dayItem[pName].time = ''
  6641. dayItem[pName].content = ''
  6642. dayItem[pName].progress = 0
  6643. dayItem[pName].workingTime = 0
  6644. }
  6645. }
  6646. }
  6647. //去掉
  6648. for (let j = 0; j < this.selProjectList.length; j++) {
  6649. var exists = false;
  6650. for (let i = 0; i < this.selCon.length; i++) {
  6651. if (this.selProjectList[j].id == this.selCon[i]) {
  6652. exists = true;
  6653. break;
  6654. }
  6655. }
  6656. if (!exists) {
  6657. this.selProjectList.splice(j, 1);
  6658. j--;
  6659. }
  6660. }
  6661. this.loadFilledWeekReportItem();
  6662. //刷新表格
  6663. // this.$refs.weekTable.doLayout();
  6664. },
  6665. //根据选中的项目来刷新填写表格
  6666. loadFilledWeekReportItem() {
  6667. for (var w in this.zhoData) {
  6668. var dayItem = this.zhoData[w];
  6669. for (var i = 0; i < this.selProjectList.length; i++) {
  6670. var curColumnProject = this.selProjectList[i];
  6671. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6672. for (var t in dayItem.reportList) {
  6673. //有日报的项目,不能取消选择
  6674. for (var p in this.fillProjectList) {
  6675. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6676. }
  6677. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6678. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6679. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6680. if (this.reportTimeType.type == 2) {
  6681. //时间段模式
  6682. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6683. }
  6684. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6685. break;
  6686. }
  6687. }
  6688. // dayItem[curColumnProject.projectName] = matchReportItem;
  6689. }
  6690. }
  6691. this.$nextTick(()=>{
  6692. this.$refs.weekTable.doLayout();
  6693. });
  6694. },
  6695. initWeekFormData() {
  6696. this.weekDataLoading = true;
  6697. for (var p in this.fillProjectList) {
  6698. this.fillProjectList[p].canCancel = 1;
  6699. }
  6700. this.http.post('/report/getWeeklyReportData',{
  6701. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6702. },res => {
  6703. this.weekDataLoading = false;
  6704. if(res.code == 'ok'){
  6705. let projectList = res.data.projectList;
  6706. if (projectList.length > 0) {
  6707. //有选择过项目进行填报,直接选中
  6708. this.selProjectList = projectList;
  6709. this.selCon = [];
  6710. for (let i = 0; i < projectList.length; i++) {
  6711. this.selCon.push(projectList[i].id);
  6712. }
  6713. }
  6714. //设置日期
  6715. this.weekDateRange = res.data.dateList;
  6716. this.zhoData = [];
  6717. var arrst = []
  6718. for(var i in this.weekDateRange) {
  6719. var obj = {}
  6720. obj.zhoDataTime = this.weekDateRange[i].date
  6721. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6722. obj.he = this.weekDateRange[i].filledTime;
  6723. obj.canFill = this.weekDateRange[i].canFill;
  6724. // obj.filledTime = this.weekDateRange[i].filledTime;
  6725. obj.reportList = this.weekDateRange[i].reportList;
  6726. //初始化,防止渲染报错
  6727. for (var j = 0; j < this.selProjectList.length; j++) {
  6728. var pName = this.selProjectList[j].projectName
  6729. obj[pName] = {}
  6730. obj[pName].time = ''
  6731. obj[pName].content = ''
  6732. obj[pName].progress = 0
  6733. obj[pName].workingTime = 0
  6734. }
  6735. arrst.push(obj)
  6736. }
  6737. this.zhoData = arrst
  6738. this.setWeekCardTimeData(res.data.cardTimeList);
  6739. this.loadFilledWeekReportItem();
  6740. }else{
  6741. this.$message({
  6742. message: res.msg,
  6743. type: 'error'
  6744. })
  6745. }
  6746. },err => {
  6747. this.$message({
  6748. message: err,
  6749. type: 'error'
  6750. })
  6751. })
  6752. },
  6753. zhoZhi(res, i) {
  6754. var zhi = 0
  6755. for(var i in res) {
  6756. if(i != 'zhoDataTime' && i != 'he') {
  6757. zhi += +res[i]
  6758. }
  6759. }
  6760. res.he = zhi
  6761. },
  6762. zhoBtn(i) {
  6763. // this.zhoData.split(i, 1)
  6764. var arr = this.zhoData
  6765. arr.splice(i, 1)
  6766. },
  6767. zhoAddlast(){
  6768. this.selConShow = true
  6769. },
  6770. closeAddWeeklyReport(){
  6771. this.fillWeekDialogVisi = false
  6772. this.selConShow = true
  6773. this.selProjectList = []
  6774. this.selCon = []
  6775. },
  6776. checkDateWorkTime() {
  6777. //针对苏州景昱,单独的检查逻辑
  6778. if (this.user.companyId == 5978) {
  6779. //调接口,先检查工时是否存在异常
  6780. var zhi = this.zhoData;
  6781. var array = [];
  6782. for(let n in zhi){
  6783. if(zhi[n].he){
  6784. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6785. array.push(workData)
  6786. }
  6787. }
  6788. this.submitingReport = true;
  6789. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6790. res => {
  6791. this.submitingReport = false;
  6792. if (res.code == "ok") {
  6793. this.submitWeekReport(0)
  6794. } else {
  6795. this.$confirm(res.msg, '提示', {
  6796. confirmButtonText: '忽略并提交',
  6797. cancelButtonText: '取消',
  6798. type: 'error'
  6799. }).then(() => {
  6800. this.submitWeekReport(0)
  6801. }).catch(() => {
  6802. });
  6803. }
  6804. },
  6805. error => {
  6806. this.$message({
  6807. message: error,
  6808. type: "error"
  6809. });
  6810. });
  6811. }
  6812. },
  6813. // 提交按周填报
  6814. submitWeekReport(isDraft) {
  6815. var zhi = this.zhoData
  6816. var ll = 0
  6817. if(this.reportTimeType.type == 2) {
  6818. for(var i in zhi) {
  6819. this.dateAr = []
  6820. var alp = []
  6821. var zhis = zhi[i]
  6822. console.log(zhis)
  6823. for(var j in zhis) {
  6824. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6825. let objs = {}
  6826. objs.s = zhis[j].time[0]
  6827. objs.e = zhis[j].time[1]
  6828. objs.p = j
  6829. alp.push(objs)
  6830. }
  6831. }
  6832. console.log(alp)
  6833. this.dateAr = alp
  6834. if (this.reportTimeType.timeCanOverlap == 0) {
  6835. let str = this.$t('message.Filledtimeperiodsoverlap')
  6836. if(this.dateAr.length > 0) {
  6837. const trus = this.fns();
  6838. const overlapDataTime = this.getOverlapData(alp);
  6839. if (overlapDataTime.length > 0) {
  6840. const arrList = overlapDataTime.map((item) => item.p);
  6841. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6842. }
  6843. ll += 1
  6844. if(!trus) {
  6845. this.$message({
  6846. message: str,
  6847. type: 'error'
  6848. })
  6849. return false
  6850. }
  6851. }
  6852. } else {
  6853. if(this.dateAr.length > 0) {
  6854. ll +=1 ;
  6855. }
  6856. }
  6857. }
  6858. if(ll == 0) {
  6859. this.$message({
  6860. message: this.$t('message.Pleasefillinthetime'),
  6861. type: 'error'
  6862. })
  6863. return false
  6864. }
  6865. } else if(this.reportTimeType.type == 1){
  6866. for(var i in zhi) {
  6867. var zhis = zhi[i]
  6868. for(var j in zhis) {
  6869. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6870. ll += 1
  6871. }
  6872. }
  6873. }
  6874. if(ll == 0) {
  6875. this.$message({
  6876. message: this.$t('message.Pleaseselectatime'),
  6877. type: 'error'
  6878. })
  6879. return false
  6880. }
  6881. let overcorp = ''
  6882. for(let n in zhi){
  6883. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6884. overcorp += zhi[n].zhoDataTime + ','
  6885. }
  6886. }
  6887. if(this.user.companyId != 5978 && overcorp != ''){
  6888. overcorp = overcorp.substring(0,overcorp.length - 1)
  6889. this.$message({
  6890. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6891. type: 'error'
  6892. })
  6893. return
  6894. }
  6895. }
  6896. var submits = []
  6897. let formData = new FormData();
  6898. formData.append("draft", isDraft);
  6899. if(this.reportTimeType.multiWorktime == 1){
  6900. for (var i in this.zhoData) {
  6901. var zhoD = this.zhoData[i]
  6902. var flgs = false
  6903. for(var j in zhoD) {
  6904. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6905. flgs = true
  6906. // formData.append("degreeId", "-1");
  6907. formData.append("id", '-1');
  6908. for(var s in this.projectList) {
  6909. if(j == this.projectList[s].projectName) {
  6910. formData.append("projectId", this.projectList[s].id);
  6911. }
  6912. }
  6913. if(this.user.timeType.reportAuditType == 3){
  6914. let audItem = {}
  6915. if(this.user.timeType.auditLevel > 0){
  6916. audItem.auditorFirst = zhoD[j].auditorFirst
  6917. }
  6918. if(this.user.timeType.auditLevel > 1){
  6919. audItem.auditorSec = zhoD[j].auditorSec
  6920. }
  6921. if(this.user.timeType.auditLevel > 2){
  6922. audItem.auditorThird = zhoD[j].auditorThird
  6923. }
  6924. if(zhoD[j].ccUserid){
  6925. audItem.ccUserid = zhoD[j].ccUserid
  6926. }
  6927. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6928. }
  6929. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6930. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6931. formData.append("reportTimeType", this.reportTimeType.type);
  6932. formData.append("endTime", '');
  6933. formData.append("startTime", '');
  6934. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6935. var lix = []
  6936. var objjs = {}
  6937. objjs.startTime = zhoD[j].time[0]
  6938. objjs.endTime = zhoD[j].time[1]
  6939. if (zhoD[j].content == null || zhoD[j].content == '') {
  6940. zhoD[j].content == '-'
  6941. }
  6942. objjs.content = zhoD[j].content
  6943. lix.push(objjs)
  6944. var zhiZhi = JSON.stringify(lix)
  6945. zhiZhi = zhiZhi.replace(/,/g,"@");
  6946. formData.append("content", zhiZhi)
  6947. formData.append("isOvertime", 0)
  6948. formData.append("professionProgress", "[]")
  6949. if (zhoD[j].groupId) {
  6950. formData.append("groupId",zhoD[j].groupId)
  6951. } else {
  6952. //解决后台groupId数组越界的问题
  6953. formData.append("groupId",0)
  6954. }
  6955. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6956. formData.append("createDate",zhoD.zhoDataTime)
  6957. if (zhoD[j].projectAuditorId) {
  6958. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6959. }
  6960. if(zhoD[j].basecostId) {
  6961. formData.append("basecostId", zhoD[j].basecostId);
  6962. } else {
  6963. formData.append("basecostId", 0);
  6964. }
  6965. if(this.user.timeType.customDegreeActive){
  6966. if (this.user.timeType.customDegreeMultiple) {
  6967. if (zhoD[j].multiDegrIdArray) {
  6968. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6969. } else {
  6970. formData.append('multiDegrId','[]')
  6971. }
  6972. } else {
  6973. if (zhoD[j].degreeId) {
  6974. formData.append('degreeId',zhoD[j].degreeId)
  6975. } else {
  6976. formData.append('degreeId','-1')
  6977. }
  6978. }
  6979. }else{
  6980. formData.append("degreeId", "-1");
  6981. }
  6982. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6983. formData.append('customData',zhoD[j].customData)
  6984. }else if(this.user.timeType.customDataActive){
  6985. formData.append('customData',0)
  6986. }
  6987. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6988. formData.append('customText',zhoD[j].customText)
  6989. }else if(this.user.timeType.customTextActive){
  6990. formData.append('customText','-')
  6991. }
  6992. }
  6993. }
  6994. }
  6995. } else {
  6996. for (var i in this.zhoData) {
  6997. var zhoD = this.zhoData[i]
  6998. var flgs = false
  6999. if(this.reportTimeType.type == 2) {
  7000. for(var k in this.selProjectList) {
  7001. var pItem = this.selProjectList[k];
  7002. var pName = pItem.projectName;
  7003. var j = pName;
  7004. console.log('j==周报中的项目='+j);
  7005. if(zhoD[j].time && zhoD[j].time != 'null') {
  7006. flgs = true
  7007. // formData.append("degreeId", "-1");
  7008. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7009. for(var s in this.projectList) {
  7010. if(j == this.projectList[s].projectName) {
  7011. formData.append("projectId", this.projectList[s].id);
  7012. }
  7013. }
  7014. if(this.user.timeType.reportAuditType == 3){
  7015. let audItem = {}
  7016. if(this.user.timeType.auditLevel > 0){
  7017. audItem.auditorFirst = zhoD[j].auditorFirst
  7018. }
  7019. if(this.user.timeType.auditLevel > 1){
  7020. audItem.auditorSec = zhoD[j].auditorSec
  7021. }
  7022. if(this.user.timeType.auditLevel > 2){
  7023. audItem.auditorThird = zhoD[j].auditorThird
  7024. }
  7025. if(zhoD[j].ccUserid){
  7026. audItem.ccUserid = zhoD[j].ccUserid
  7027. }
  7028. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7029. }
  7030. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7031. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7032. formData.append("reportTimeType", this.reportTimeType.type);
  7033. formData.append("endTime", zhoD[j].time[1]);
  7034. formData.append("startTime", zhoD[j].time[0]);
  7035. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7036. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7037. formData.append("isOvertime", 0)
  7038. formData.append("professionProgress", "[]")
  7039. if (zhoD[j].groupId) {
  7040. formData.append("groupId",zhoD[j].groupId)
  7041. } else {
  7042. //解决后台groupId数组越界的问题
  7043. formData.append("groupId",0)
  7044. }
  7045. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7046. formData.append("createDate",zhoD.zhoDataTime)
  7047. if (zhoD[j].projectAuditorId) {
  7048. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7049. }
  7050. if(zhoD[j].basecostId) {
  7051. formData.append("basecostId", zhoD[j].basecostId);
  7052. } else {
  7053. formData.append("basecostId", 0);
  7054. }
  7055. if(this.user.timeType.customDegreeActive){
  7056. if (this.user.timeType.customDegreeMultiple) {
  7057. if (zhoD[j].multiDegrIdArray) {
  7058. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7059. } else {
  7060. formData.append("multiDegrId", "[]");
  7061. }
  7062. } else {
  7063. if (zhoD[j].degreeId) {
  7064. formData.append('degreeId',zhoD[j].degreeId)
  7065. } else {
  7066. formData.append("degreeId", "-1");
  7067. }
  7068. }
  7069. }else{
  7070. formData.append("degreeId", "-1");
  7071. }
  7072. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7073. formData.append('customData',zhoD[j].customData)
  7074. }else if(this.user.timeType.customDataActive){
  7075. formData.append('customData',0)
  7076. }
  7077. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7078. formData.append('customText',zhoD[j].customText)
  7079. }else if(this.user.timeType.customTextActive){
  7080. formData.append('customText','-')
  7081. }
  7082. }
  7083. }
  7084. } else {
  7085. for(var k in this.selProjectList) {
  7086. var pItem = this.selProjectList[k];
  7087. var pName = pItem.projectName;
  7088. var j = pName;
  7089. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7090. flgs = true
  7091. // formData.append("degreeId", "-1");
  7092. console.log('进入了workFpppp==='+j);
  7093. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7094. for(var s in this.projectList) {
  7095. if(j == this.projectList[s].projectName) {
  7096. formData.append("projectId", this.projectList[s].id);
  7097. }
  7098. }
  7099. if(this.user.timeType.reportAuditType == 3){
  7100. let audItem = {}
  7101. if(this.user.timeType.auditLevel > 0){
  7102. audItem.auditorFirst = zhoD[j].auditorFirst
  7103. }
  7104. if(this.user.timeType.auditLevel > 1){
  7105. audItem.auditorSec = zhoD[j].auditorSec
  7106. }
  7107. if(this.user.timeType.auditLevel > 2){
  7108. audItem.auditorThird = zhoD[j].auditorThird
  7109. }
  7110. if(zhoD[j].ccUserid){
  7111. audItem.ccUserid = zhoD[j].ccUserid
  7112. }
  7113. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7114. }
  7115. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7116. // formData.append("subProjectId", zhoD[j].subProjectId);
  7117. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7118. formData.append("reportTimeType", this.reportTimeType.type);
  7119. if(this.reportTimeType.type == 1) {
  7120. formData.append("workingTime", zhoD[j].workingTime);
  7121. } else if(this.reportTimeType.type == 2) {
  7122. formData.append("endTime", zhoD[j].time[1]);
  7123. formData.append("startTime", zhoD[j].time[0]);
  7124. } else if(this.reportTimeType.type == 3) {
  7125. formData.append("progress", zhoD[j].progress);
  7126. formData.append("workingTime", zhoD[j].workingTime);
  7127. }
  7128. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7129. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7130. formData.append("isOvertime", 0)
  7131. formData.append("professionProgress", "[]")
  7132. if (zhoD[j].groupId) {
  7133. formData.append("groupId",zhoD[j].groupId)
  7134. } else {
  7135. //解决后台groupId数组越界的问题
  7136. formData.append("groupId",0)
  7137. }
  7138. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7139. formData.append("createDate",zhoD.zhoDataTime)
  7140. if (zhoD[j].projectAuditorId) {
  7141. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7142. }
  7143. if(zhoD[j].basecostId) {
  7144. formData.append("basecostId", zhoD[j].basecostId);
  7145. } else {
  7146. formData.append("basecostId", 0);
  7147. }
  7148. if(this.user.timeType.customDegreeActive){
  7149. if (this.user.timeType.customDegreeMultiple) {
  7150. if (zhoD[j].multiDegrIdArray) {
  7151. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7152. } else {
  7153. formData.append("multiDegrId", "[]");
  7154. }
  7155. } else {
  7156. if (zhoD[j].degreeId) {
  7157. formData.append('degreeId',zhoD[j].degreeId)
  7158. } else {
  7159. formData.append("degreeId", "-1");
  7160. }
  7161. }
  7162. }else{
  7163. formData.append("degreeId", "-1");
  7164. }
  7165. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7166. formData.append('customData',zhoD[j].customData)
  7167. }else if(this.user.timeType.customDataActive){
  7168. formData.append('customData',0)
  7169. }
  7170. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7171. formData.append('customText',zhoD[j].customText)
  7172. }else if(this.user.timeType.customTextActive){
  7173. formData.append('customText','-')
  7174. }
  7175. }
  7176. }
  7177. }
  7178. }
  7179. }
  7180. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7181. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7182. if(!next) {
  7183. this.$message({
  7184. message: `【${error.join('、')}】请填写任务分组`,
  7185. type: 'error'
  7186. })
  7187. return
  7188. }
  7189. // 自定义维度
  7190. this.submitingReport = true;
  7191. this.http.uploadFile( this.port.report.editPort, formData,
  7192. res => {
  7193. // this.listLoading = false;
  7194. this.submitingReport = false;
  7195. if (res.code == "ok") {
  7196. this.$message({
  7197. message: this.$t('message.fillinsuccessfully'),
  7198. type: "success"
  7199. });
  7200. this.fillWeekDialogVisi = false
  7201. this.selConShow = true
  7202. this.zhoData = []
  7203. this.weekDateRange = ''
  7204. this.getReportList();
  7205. this.getDepartment();
  7206. // 关闭弹窗 并 清空
  7207. this.selProjectList = []
  7208. this.selCon = []
  7209. this.getRecentlyProject()
  7210. } else {
  7211. this.$message({
  7212. message: res.msg,
  7213. type: "error"
  7214. });
  7215. }
  7216. },
  7217. error => {
  7218. this.submitingReport = false;
  7219. this.$message({
  7220. message: error,
  7221. type: "error"
  7222. });
  7223. });
  7224. },
  7225. handleGroupAuditorData(data) {
  7226. const { reportAuditType } = this.user.timeType
  7227. if(reportAuditType != 1 && reportAuditType != 2) {
  7228. return {next: true}
  7229. }
  7230. let arrList = [];
  7231. Object.entries(data).forEach(([key, obj]) => {
  7232. Object.entries(obj).forEach(([projectName, projectData]) => {
  7233. if (projectData.workingTime && !projectData.groupId) {
  7234. arrList.push({
  7235. projectName,
  7236. date: obj.zhoDataTime,
  7237. dateText: obj.zhoDataTimeTxt
  7238. });
  7239. }
  7240. });
  7241. });
  7242. if(arrList.length > 0) {
  7243. return {
  7244. next: false,
  7245. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7246. }
  7247. } else {
  7248. return {
  7249. next: true,
  7250. error: [],
  7251. }
  7252. }
  7253. },
  7254. ChangeHourMinutestr (str) {
  7255. if (str !== "0" && str !== "" && str !== null) {
  7256. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7257. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7258. } else {
  7259. return "";
  7260. }
  7261. },
  7262. // 得到两个日期中间的日期
  7263. getdiffdate(stime,etime){
  7264. //初始化日期列表,数组
  7265. var diffdate = new Array();
  7266. var i=0;
  7267. //开始日期小于等于结束日期,并循环
  7268. while(stime<=etime){
  7269. diffdate[i] = stime;
  7270. //获取开始日期时间戳
  7271. var stime_ts = new Date(stime).getTime();
  7272. //增加一天时间戳后的日期
  7273. var next_date = stime_ts + (24*60*60*1000);
  7274. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7275. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7276. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7277. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7278. stime = next_dates_y+next_dates_m+next_dates_d;
  7279. //增加数组key
  7280. i++;
  7281. }
  7282. return diffdate;
  7283. },
  7284. // 添加模块
  7285. addDomain(i) {
  7286. var leftProgress = 10;
  7287. if (this.reportTimeType.type == 3) {
  7288. //计算已经待分配工时比例
  7289. let array = this.workForm.domains;
  7290. let totalProgress = 0;
  7291. for (var i=0;i<array.length; i++) {
  7292. totalProgress += array[i].progress;
  7293. }
  7294. if (totalProgress < 100) {
  7295. leftProgress = 100 - totalProgress;
  7296. }
  7297. }
  7298. var addItem = {
  7299. projectId: "",
  7300. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7301. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7302. ),
  7303. content: "",
  7304. progress:leftProgress,
  7305. state:2,//2-表示待提交
  7306. multiWorktime: this.reportTimeType.multiWorktime,
  7307. worktimeList:[{}],
  7308. canEdit: true,
  7309. auditorFirst: '',
  7310. auditorSec: '',
  7311. auditorThird: '',
  7312. ccUserid: ''
  7313. // degreeId: '',
  7314. };
  7315. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7316. this.$set(addItem,'isOvertime',true)
  7317. if(this.reportTimeType.type == 3){
  7318. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7319. }
  7320. }
  7321. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7322. //默认给第一个,必填字段
  7323. addItem.basecostId = this.timeBasecostList[0].id;
  7324. }
  7325. this.workForm.domains.push(addItem);
  7326. document.getElementById('workFormsItemBottom').scrollIntoView()
  7327. this.canEdit = true
  7328. if (this.reportTimeType.type == 0) {
  7329. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7330. var length = this.workForm.domains.length;
  7331. if (length == 2) {
  7332. this.showAddMore = false;
  7333. }
  7334. }
  7335. this.chuji()
  7336. this.seleChn()
  7337. },
  7338. // 移除模块
  7339. delDomain(i) {
  7340. this.workForm.domains.splice(i,1)
  7341. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7342. if (!this.originCanEdit) {
  7343. let iscan = false
  7344. for(let i in this.workForm.domains){
  7345. if(this.workForm.domains[i].canEdit){
  7346. iscan = true
  7347. }
  7348. }
  7349. this.canEdit = iscan
  7350. }
  7351. //检测当前剩下的一个,时间类型是否是全天
  7352. if (this.reportTimeType.type == 0) {
  7353. if (this.workForm.domains[0].timeType == 0) {
  7354. this.showAddMore = false;
  7355. } else {
  7356. this.showAddMore = true;
  7357. }
  7358. }
  7359. if(this.user.timeType.multiWorktime == 1) {
  7360. this.iptChangs()
  7361. } else {
  7362. this.seleChn(0)
  7363. }
  7364. },
  7365. // 改变月份
  7366. changeMonth() {
  7367. this.isWeekend = false
  7368. let date = new Date()
  7369. let nowmon = date.getMonth() + 1
  7370. let nowday = date.getDate()
  7371. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7372. if (this.isBatch == 0) {
  7373. if(this.user.timeType.fillAhead == 0){
  7374. let date_a = new Date(this.workForm.createDate)
  7375. if(date_a.getTime() > date.getTime()){
  7376. this.workForm.createDate = nowdate
  7377. }
  7378. }
  7379. //只有按天填报才能获取当天的日报
  7380. if(!this.isSubstitude){
  7381. let weekday = new Date(this.workForm.createDate).getDay()
  7382. if(this.user.companyId == 817){
  7383. if(weekday == 0){
  7384. this.isWeekend = true
  7385. }
  7386. }else{
  7387. if(weekday == 0 || weekday == 6){
  7388. this.isWeekend = true
  7389. }
  7390. }
  7391. this.getReport()
  7392. }
  7393. }else {
  7394. if(this.user.timeType.fillAhead == 0){
  7395. let date_a = new Date(this.workForm.createDate[1])
  7396. if(date_a.getTime() > date.getTime()){
  7397. this.workForm.createDate[1] = nowdate
  7398. let sdate = new Date(this.workForm.createDate[0])
  7399. let edate = new Date(this.workForm.createDate[1])
  7400. if(sdate > edate){
  7401. this.workForm.createDate[0] = this.workForm.createDate[1]
  7402. }
  7403. }
  7404. }
  7405. }
  7406. },
  7407. // 判断时间段
  7408. fns() {
  7409. for (let k in this.dateAr) {
  7410. if (!this.judege(k)) {
  7411. return false
  7412. }
  7413. }
  7414. return true
  7415. },
  7416. judege(idx){
  7417. for (let k in this.dateAr) {
  7418. if (idx !== k) {
  7419. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7420. return false
  7421. }
  7422. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7423. return false
  7424. }
  7425. }
  7426. }
  7427. return true
  7428. },
  7429. getOverlapData(data) {
  7430. let overlapData = [];
  7431. for (let i = 0; i < data.length; i++) {
  7432. for (let j = i + 1; j < data.length; j++) {
  7433. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7434. overlapData.push(data[i], data[j]);
  7435. }
  7436. }
  7437. }
  7438. return overlapData;
  7439. },
  7440. // 保存日报111111
  7441. submitReport(isDraft) {
  7442. this.isDraft = isDraft;
  7443. this.$refs.workForm.validate(valid => {
  7444. if (valid) {
  7445. if (!isDraft) {
  7446. //针对苏州景昱,单独的检查逻辑
  7447. if (this.user.companyId == 5978) {
  7448. //调接口,先检查工时是否存在异常
  7449. var totalTime = 0;
  7450. for (var t=0;t<this.workForm.domains.length; t++) {
  7451. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7452. }
  7453. var array = [];
  7454. if (this.isBatch) {
  7455. var startDate = new Date(this.workForm.createDate[0]);
  7456. var endDate = new Date(this.workForm.createDate[1]);
  7457. if (startDate > endDate) {
  7458. this.$message({
  7459. message: '开始日期不能大于结束日期',
  7460. type: "error"
  7461. });
  7462. return
  7463. } else {
  7464. while(true){
  7465. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7466. array.push(workData);
  7467. startDate.setDate(startDate.getDate() + 1);
  7468. if (startDate > endDate) {
  7469. break;
  7470. }
  7471. }
  7472. }
  7473. } else {
  7474. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7475. array.push(workData)
  7476. }
  7477. this.submitingReport = true;
  7478. var passUserId = this.user.id;
  7479. if (this.isSubstitude) {
  7480. passUserId = this.targetUids;
  7481. }
  7482. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7483. res => {
  7484. this.submitingReport = false;
  7485. if (res.code == "ok") {
  7486. this.submitReportSon()
  7487. } else {
  7488. this.$confirm(res.msg, '提示', {
  7489. confirmButtonText: '忽略并提交',
  7490. cancelButtonText: '取消',
  7491. type: 'error'
  7492. }).then(() => {
  7493. this.submitReportSon()
  7494. }).catch(() => {
  7495. });
  7496. }
  7497. },
  7498. error => {
  7499. this.$message({
  7500. message: error,
  7501. type: "error"
  7502. });
  7503. });
  7504. } else {
  7505. if(this.totalReportHours < this.user.timeType.allday){
  7506. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7507. confirmButtonText: '确定',
  7508. cancelButtonText: '取消',
  7509. type: 'warning'
  7510. }).then(() => {
  7511. this.submitReportSon()
  7512. }).catch(() => {
  7513. });
  7514. }else{
  7515. this.submitReportSon()
  7516. }
  7517. }
  7518. } else {
  7519. //暂存,不需要检查工时是否超过考勤
  7520. this.submitReportSon()
  7521. }
  7522. }
  7523. });
  7524. },
  7525. submitReportSon() {
  7526. this.dateAr = []
  7527. //检查重叠
  7528. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7529. let alp = []
  7530. if(this.user.timeType.multiWorktime != 1) {
  7531. for(var p in this.workForm.domains) {
  7532. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7533. let objs = {}
  7534. objs.s = this.workForm.domains[p].startTime
  7535. objs.e = this.workForm.domains[p].endTime
  7536. alp.push(objs)
  7537. }
  7538. }
  7539. this.dateAr = alp
  7540. if(this.dateAr.length > 0) {
  7541. let trus = this.fns()
  7542. if(!trus) {
  7543. this.$message({
  7544. message: this.$t('message.Filledtimeperiodsoverlap'),
  7545. type: "error"
  7546. });
  7547. return
  7548. }
  7549. }
  7550. } else {
  7551. for(var p in this.workForm.domains) {
  7552. var slll = this.workForm.domains[p]
  7553. for(var o in slll.worktimeList) {
  7554. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7555. let objs = {}
  7556. objs.s = slll.worktimeList[o].startTime
  7557. objs.e = slll.worktimeList[o].endTime
  7558. alp.push(objs)
  7559. }
  7560. }
  7561. }
  7562. this.dateAr = alp
  7563. if(this.dateAr.length > 0) {
  7564. let trus = this.fns()
  7565. if(!trus) {
  7566. this.$message({
  7567. message: this.$t('message.Filledtimeperiodsoverlap'),
  7568. type: "error"
  7569. });
  7570. return
  7571. }
  7572. }
  7573. }
  7574. }
  7575. //检查子项目
  7576. if (this.user.timeType.subProMustFill == 1) {
  7577. for(var p in this.workForm.domains) {
  7578. var oneProItem = this.workForm.domains[p]
  7579. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7580. //没有选择子项目
  7581. this.$message({
  7582. message: '子项目必填,请检查',
  7583. type: "error"
  7584. });
  7585. return
  7586. }
  7587. }
  7588. }
  7589. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7590. if (this.user.companyId == this.yuzhongCompId) {
  7591. for(var p in this.workForm.domains) {
  7592. var oneProItem = this.workForm.domains[p]
  7593. if (!oneProItem.extraField1) {
  7594. this.$message({
  7595. message: '角色必填,请检查',
  7596. type: "error"
  7597. });
  7598. return
  7599. }
  7600. if (!oneProItem.extraField2) {
  7601. this.$message({
  7602. message: '工作职责必填,请检查',
  7603. type: "error"
  7604. });
  7605. return
  7606. }
  7607. if (!oneProItem.extraField3) {
  7608. this.$message({
  7609. message: '工作内容必填,请检查',
  7610. type: "error"
  7611. });
  7612. return
  7613. }
  7614. }
  7615. }
  7616. // return
  7617. //代填的情况,检查人员是否已经选择
  7618. if (this.isSubstitude) {
  7619. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7620. this.$message({
  7621. message: this.$t('message.pleaseselectthepersontofillin'),
  7622. type: "error"
  7623. });
  7624. return;
  7625. }
  7626. }
  7627. //检查时间,全天和上下午不能同时存在
  7628. if (this.reportTimeType.type == 0) {
  7629. var alldayNum = 0;
  7630. var amNum = 0;
  7631. var pmNum = 0;
  7632. for(var i in this.workForm.domains) {
  7633. if (this.workForm.domains[i].timeType == 0) {
  7634. alldayNum ++;
  7635. } else if (this.workForm.domains[i].timeType == 1) {
  7636. amNum++;
  7637. } else if (this.workForm.domains[i].timeType == 2) {
  7638. pmNum++;
  7639. }
  7640. }
  7641. if (alldayNum > 1) {
  7642. this.$message({
  7643. // message: "工作时间-全天,只能选择一次",
  7644. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7645. type: "error"
  7646. });
  7647. return;
  7648. }
  7649. if (amNum > 1) {
  7650. this.$message({
  7651. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7652. type: "error"
  7653. });
  7654. return;
  7655. }
  7656. if (pmNum > 1) {
  7657. this.$message({
  7658. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7659. type: "error"
  7660. });
  7661. return;
  7662. }
  7663. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7664. this.$message({
  7665. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7666. type: "error"
  7667. });
  7668. return;
  7669. }
  7670. } else if (this.reportTimeType.type == 3) {
  7671. //总百分比不能超过100%
  7672. let total = 0;
  7673. this.workForm.domains.forEach(w=>{total += w.progress});
  7674. if (total > 100) {
  7675. this.$message({
  7676. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7677. type: "error"
  7678. });
  7679. return;
  7680. } else if (total < 100) {
  7681. this.$message({
  7682. message: this.$t('message.cannotbesubmitted'),
  7683. type: "error"
  7684. });
  7685. return;
  7686. }
  7687. }
  7688. this.listLoading = true;
  7689. let formData = new FormData();
  7690. formData.append("draft", this.isDraft);
  7691. var totalTime = 0;
  7692. for (var t=0;t<this.workForm.domains.length; t++) {
  7693. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7694. }
  7695. //批量填报不校验考勤时长,交给后台校验
  7696. if (!this.isBatch) {
  7697. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7698. if (this.workForm.time){
  7699. if (this.workForm.time.workHours == 0){
  7700. this.$message({
  7701. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7702. type: 'error'
  7703. })
  7704. return
  7705. }
  7706. }else{
  7707. this.$message({
  7708. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7709. type: 'error'
  7710. })
  7711. return
  7712. }
  7713. }
  7714. }
  7715. //针对凡己和景昱,此处不校验考勤时长
  7716. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7717. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7718. this.$message({
  7719. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7720. type: "error"
  7721. });
  7722. return;
  7723. }
  7724. }
  7725. for(var i in this.workForm.domains) {
  7726. // 检查任务/里程碑是否为必填
  7727. let taskRequired = this.user.timeType.taskRequired
  7728. if(taskRequired == 1) {
  7729. if(!this.workForm.domains[i].taskId) {
  7730. this.$message({
  7731. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7732. type: "error"
  7733. });
  7734. return
  7735. }
  7736. }
  7737. if(this.user.timeType.reportAuditType == 3){
  7738. let audItem = {}
  7739. let auditRule = ''
  7740. if(this.workForm.domains[i].id){
  7741. audItem.reportId = this.workForm.domains[i].id
  7742. }
  7743. if(this.user.timeType.auditLevel > 0){
  7744. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7745. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7746. }
  7747. if(this.user.timeType.auditLevel > 1){
  7748. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7749. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7750. }
  7751. if(this.user.timeType.auditLevel > 2){
  7752. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7753. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7754. }
  7755. if(this.workForm.domains[i].ccUserid){
  7756. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7757. }
  7758. if(auditRule){
  7759. auditRule = auditRule.substring(0,auditRule.length - 1)
  7760. this.$message({
  7761. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7762. type: 'error'
  7763. })
  7764. return
  7765. }
  7766. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7767. }
  7768. if (this.user.timeType.customDegreeActive) {
  7769. if (this.user.timeType.customDegreeMultiple) {
  7770. //多选
  7771. if (this.workForm.domains[i].multiDegrIdArray) {
  7772. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7773. degreeArray = degreeArray.replace(/,/g,"@");
  7774. formData.append("multiDegrId", degreeArray);
  7775. } else {
  7776. formData.append("multiDegrId", '[]');
  7777. }
  7778. } else {
  7779. //单选
  7780. if (this.workForm.domains[i].degreeId) {
  7781. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7782. } else {
  7783. formData.append("degreeId", -1);
  7784. }
  7785. }
  7786. } else {
  7787. formData.append("degreeId", -1);
  7788. }
  7789. if(this.workForm.domains[i].customData) {
  7790. // var sss = this.workForm.domains[i].degreeId.toString()
  7791. formData.append("customData", this.workForm.domains[i].customData);
  7792. } else {
  7793. formData.append("customData", 0);
  7794. }
  7795. if(this.workForm.domains[i].customText) {
  7796. formData.append("customText", this.workForm.domains[i].customText);
  7797. } else {
  7798. formData.append("customText", '-');
  7799. }
  7800. if (this.workForm.domains[i].id) {
  7801. formData.append("id", this.workForm.domains[i].id);
  7802. } else {
  7803. formData.append("id", -1);
  7804. }
  7805. formData.append("projectId", this.workForm.domains[i].projectId);
  7806. if (this.workForm.domains[i].subProjectId) {
  7807. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7808. } else {
  7809. formData.append("subProjectId", 0);
  7810. }
  7811. if (this.workForm.domains[i].groupId) {
  7812. formData.append("groupId", this.workForm.domains[i].groupId);
  7813. } else {
  7814. formData.append("groupId", 0);
  7815. }
  7816. if (this.workForm.domains[i].taskId) {
  7817. formData.append("taskId", this.workForm.domains[i].taskId);
  7818. } else {
  7819. formData.append("taskId", 0);
  7820. }
  7821. if (this.workForm.domains[i].taskFinish == true) {
  7822. formData.append("taskFinish", 1);
  7823. } else {
  7824. formData.append("taskFinish", 0);
  7825. }
  7826. formData.append("reportTimeType", this.reportTimeType.type);
  7827. if (this.reportTimeType.type == 0) {
  7828. formData.append("timeType", this.workForm.domains[i].timeType);
  7829. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7830. formData.append("workingTime", workingTime);
  7831. } else if (this.reportTimeType.type == 1){
  7832. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7833. } else if (this.reportTimeType.type == 2) {
  7834. formData.append("endTime", this.workForm.domains[i].endTime);
  7835. formData.append("startTime", this.workForm.domains[i].startTime);
  7836. } else if (this.reportTimeType.type == 3) {
  7837. //按比例分配
  7838. formData.append("progress", this.workForm.domains[i].progress);
  7839. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7840. }
  7841. if(this.user.timeType.choseFromAlbum == 1 ) {
  7842. console.log(this.workForm.domains[i].imgList)
  7843. if(this.workForm.domains[i].imgList) {
  7844. let imgListFor = this.workForm.domains[i].imgList
  7845. for(var b in imgListFor) {
  7846. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7847. }
  7848. console.log(imgListFor)
  7849. let m = JSON.stringify(imgListFor);
  7850. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7851. formData.append("picStr", m);
  7852. } else {
  7853. formData.append("picStr", '[]');
  7854. }
  7855. }
  7856. //处理多个时间事项
  7857. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7858. if (this.reportTimeType.multiWorktime == 1) {
  7859. //检查时间是否有重叠
  7860. var workList = this.workForm.domains[i].worktimeList;
  7861. for (var j=0;j<workList.length; j++) {
  7862. var curItem = workList[j];
  7863. //检查开始时间是否大于结束时间
  7864. if (curItem.startTime >= curItem.endTime) {
  7865. this.$message({
  7866. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7867. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7868. type: "error"
  7869. });
  7870. return;
  7871. }
  7872. //时间不可重叠
  7873. if (this.reportTimeType.timeCanOverlap == 0) {
  7874. for (var p = j+1;p<workList.length; p++) {
  7875. var jItem = workList[p];
  7876. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7877. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7878. this.$message({
  7879. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7880. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7881. type: "error"
  7882. });
  7883. return;
  7884. }
  7885. }
  7886. }
  7887. }
  7888. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7889. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7890. formData.append("content", m);
  7891. } else {
  7892. if (this.workForm.domains[i].content) {
  7893. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7894. m = m.replace(/,/g,",");
  7895. console.log(m, '需要传值的数据')
  7896. // formData.append("content", this.workForm.domains[i].content);
  7897. formData.append("content", m);
  7898. } else {
  7899. formData.append("content", '-');
  7900. }
  7901. }
  7902. if (this.isBatch == 0) {
  7903. formData.append("createDate", this.workForm.createDate);
  7904. } else {
  7905. //批量填报,时间范围
  7906. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7907. }
  7908. if(this.workForm.domains[i].isOvertime) {
  7909. formData.append("isOvertime", 1);
  7910. } else {
  7911. formData.append("isOvertime", 0);
  7912. }
  7913. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7914. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7915. } else {
  7916. formData.append("overtimeHours", 0);
  7917. }
  7918. if(this.workForm.domains[i].basecostId) {
  7919. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7920. } else {
  7921. formData.append("basecostId", 0);
  7922. }
  7923. if (this.workForm.userId != null) {
  7924. var targetUids = '';
  7925. this.workForm.userId.forEach(u=>{
  7926. targetUids += u + '@';
  7927. });
  7928. if (targetUids.length > 0) {
  7929. targetUids = targetUids.substring(0, targetUids.length -1);
  7930. formData.append("targetUids", targetUids);
  7931. }
  7932. }
  7933. //项目专业进度
  7934. if (this.workForm.domains[i].professionProgress) {
  7935. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7936. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7937. formData.append("professionProgress", m);
  7938. } else {
  7939. formData.append("professionProgress", "[]");
  7940. }
  7941. if (this.workForm.domains[i].stage) {
  7942. formData.append("stage", this.workForm.domains[i].stage);
  7943. } else {
  7944. formData.append("stage", "-");
  7945. }
  7946. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7947. if (this.workForm.domains[i].projectAuditorId) {
  7948. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7949. } else {
  7950. // console.log('执行到了这里')
  7951. // console.log(this.user.timeType.reportAuditType)
  7952. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7953. this.$message({
  7954. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7955. type: "error"
  7956. });
  7957. return;
  7958. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7959. //分组负责人先审核, 确定是选择了任务分组
  7960. if (this.workForm.domains[i].taskGroups.length == 0) {
  7961. this.$message({
  7962. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7963. type: "error"
  7964. });
  7965. } else if (!this.workForm.domains[i].groupId) {
  7966. // console.log(this.workForm.domains[i]);
  7967. this.$message({
  7968. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7969. type: "error"
  7970. });
  7971. } else {
  7972. this.$message({
  7973. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7974. type: "error"
  7975. });
  7976. }
  7977. return;
  7978. }
  7979. }
  7980. if (this.user.companyId == this.yuzhongCompId) {
  7981. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7982. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7983. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7984. }
  7985. //依斯贝的服务Id
  7986. if (this.user.companyId == this.yisibeiCompId) {
  7987. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7988. }
  7989. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7990. this.$message({
  7991. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7992. type: "error"
  7993. });
  7994. return
  7995. }
  7996. if(this.user.timeType.userWithMultiDept == 1) {
  7997. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  7998. }
  7999. }
  8000. this.submitingReport = true;
  8001. this.http.uploadFile( this.port.report.editPort, formData,
  8002. res => {
  8003. this.listLoading = false;
  8004. this.submitingReport = false;
  8005. if (res.code == "ok") {
  8006. if(res.msg!=null){
  8007. this.$message({
  8008. dangerouslyUseHTMLString: true,
  8009. message: res.msg,
  8010. type: "warning",
  8011. showClose: true,
  8012. duration: 0
  8013. });
  8014. }else{
  8015. this.$message({
  8016. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8017. type: "success"
  8018. });
  8019. }
  8020. this.dialogVisible = false;
  8021. this.jsDay = 0
  8022. this.jsTime = 0
  8023. this.getReportList();
  8024. this.getDepartment();
  8025. this.getRecentlyProject()
  8026. } else {
  8027. this.$message({
  8028. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8029. type: "error"
  8030. });
  8031. }
  8032. },
  8033. error => {
  8034. this.listLoading = false;
  8035. this.submitingReport = false;
  8036. this.$message({
  8037. message: error,
  8038. type: "error"
  8039. });
  8040. });
  8041. },
  8042. // 判断是展示那个工时导入
  8043. imports() {
  8044. if(this.user.timeType.syncCorpwxTime == 0) {
  8045. this.importDialog = true
  8046. } else {
  8047. this.importWxDialog = true
  8048. }
  8049. },
  8050. // 跳转
  8051. junpToDeskTop(id) {
  8052. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8053. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8054. },
  8055. // 通过日报
  8056. approve(id, item) {
  8057. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8058. this.approveinData = {
  8059. id: id,
  8060. date: this.date +day,
  8061. reportIds: item.id
  8062. }
  8063. if(this.user.timeType.needEvaluate == 1){
  8064. this.$set(this.approveinData,'evaluate','')
  8065. this.approveinDialog = true
  8066. }else{
  8067. this.logining = true;
  8068. this.approveinfun()
  8069. }
  8070. },
  8071. approveinfun(){
  8072. this.http.post( this.port.report.approve, this.approveinData,
  8073. res => {
  8074. this.logining = false;
  8075. if (res.code == "ok") {
  8076. this.approveinDialog = false
  8077. this.$message({
  8078. message: this.$t('message.Reviewsucceeded'),
  8079. type: "success"
  8080. });
  8081. this.refreshReportData(this.approveinData.reportIds);
  8082. this.getDepartment();
  8083. } else {
  8084. this.$message({
  8085. message: res.msg,
  8086. type: "error"
  8087. });
  8088. }
  8089. },
  8090. error => {
  8091. this.logining = false;
  8092. this.$message({
  8093. message: error,
  8094. type: "error"
  8095. });
  8096. });
  8097. },
  8098. //撤回日报
  8099. cancel(item,e) {
  8100. // console.log('can can need',item);
  8101. this.logining = true;
  8102. var ids = '';
  8103. var data = e ? item : item.data;
  8104. data.forEach(element => {
  8105. if(element.id){
  8106. ids +=(element.id+',');
  8107. }
  8108. });
  8109. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8110. res => {
  8111. this.logining = false;
  8112. if (res.code == "ok") {
  8113. this.$message({
  8114. message:this.$t('message.Withdrawalsucceeded'),
  8115. type: "success"
  8116. });
  8117. this.getReportList();
  8118. if(e){this.getReport()}
  8119. this.getDepartment();
  8120. } else {
  8121. this.$message({
  8122. message: res.msg,
  8123. type: "error"
  8124. });
  8125. }
  8126. },
  8127. error => {
  8128. this.logining = false;
  8129. this.$message({
  8130. message: error,
  8131. type: "error"
  8132. });
  8133. });
  8134. },
  8135. showDenyDialog(id,i, item) {
  8136. this.denyReasonDialog = true;
  8137. this.isDenying = false;
  8138. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8139. var ids = item.id;
  8140. // var data = item.data;
  8141. // data.forEach(element => {
  8142. // ids +=(element.id+',');
  8143. // });
  8144. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8145. },
  8146. // 未通过日报
  8147. deny() {
  8148. this.logining = true;
  8149. this.isDenying = true;
  8150. this.http.post( this.port.report.deny, this.denyForm,
  8151. res => {
  8152. this.logining = false;
  8153. this.isDenying = false;
  8154. if (res.code == "ok") {
  8155. this.$message({
  8156. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8157. type: "success"
  8158. });
  8159. this.refreshReportData(this.denyForm.reportIds);
  8160. this.getDepartment();
  8161. this.denyReasonDialog = false;
  8162. } else {
  8163. this.$message({
  8164. message: res.msg,
  8165. type: "error"
  8166. });
  8167. }
  8168. },
  8169. error => {
  8170. this.logining = false;
  8171. this.$message({
  8172. message: error,
  8173. type: "error"
  8174. });
  8175. });
  8176. },
  8177. // 查看工时记录弹窗
  8178. toView() {
  8179. this.toViewDialogVisible = true
  8180. this.toViewloading = true
  8181. this.getToView()
  8182. },
  8183. getToView() {
  8184. this.http.post( '/report-import-log/getList', this.toViewForm,
  8185. res => {
  8186. this.toViewloading = false;
  8187. if (res.code == "ok") {
  8188. // console.log(res.data, '数据数据')
  8189. this.toViewList = res.data.records
  8190. this.toViewForm.total = res.data.total
  8191. } else {
  8192. this.toViewloading = false;
  8193. this.$message({
  8194. message: res.msg,
  8195. type: "error"
  8196. });
  8197. }
  8198. })
  8199. },
  8200. // 触发 selectCat 组件更改他的值
  8201. selectCatCli(obj) {
  8202. // console.log(obj, '看看')
  8203. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8204. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8205. },
  8206. vueCasader(obj) {
  8207. console.log(obj, '看看值')
  8208. if(obj.distinction == 1 && obj.item) {
  8209. let arr = []
  8210. arr.push(obj.item.value)
  8211. this.exportParam.departmentId = arr
  8212. }
  8213. if(obj.distinction == '10' && obj) {
  8214. const { id, other } = obj
  8215. this.workForm.domains[other].reportTargetDeptId = id
  8216. }
  8217. },
  8218. //分页
  8219. handleCurrentChange(val) {
  8220. this.toViewForm.pageIndex = val;
  8221. this.getToView();
  8222. },
  8223. handleSizeChange(val) {
  8224. this.toViewForm.pageSize = val;
  8225. this.getToView();
  8226. },
  8227. getAllUsersList(){
  8228. this.http.post('/user/getSimpleActiveUserList',{
  8229. },res => {
  8230. if(res.code == 'ok'){
  8231. this.allUsersList = res.data
  8232. }else{
  8233. this.$message({
  8234. message: res.msg,
  8235. type: 'error'
  8236. })
  8237. }
  8238. },err => {
  8239. this.$message({
  8240. message: err,
  8241. type: 'error'
  8242. })
  8243. })
  8244. },
  8245. //景昱变更提醒
  8246. changeReminder(item){
  8247. console.log("============",item)
  8248. let parameter={
  8249. startDate: this.WorktimeDatepickValue[0],
  8250. endDate: this.WorktimeDatepickValue[1],
  8251. }
  8252. if(item){
  8253. parameter.createDate=item.createDate,
  8254. parameter.userId=item.userId
  8255. }
  8256. this.http.post('/report/changeReminder',parameter,res => {
  8257. if(res.code == 'ok'){
  8258. this.$message({
  8259. message: res.msg,
  8260. type: 'success'
  8261. })
  8262. }else{
  8263. this.$message({
  8264. message: res.msg,
  8265. type: 'error'
  8266. })
  8267. }
  8268. },err => {
  8269. this.$message({
  8270. message: err,
  8271. type: 'error'
  8272. })
  8273. })
  8274. },
  8275. //景昱取消异常
  8276. cancelReminder(item){
  8277. let parameter={}
  8278. if(item){
  8279. parameter.createDate=item.createDate,
  8280. parameter.userId=item.userId
  8281. }
  8282. this.http.post('/report/cancelReminder',parameter,res => {
  8283. if(res.code == 'ok'){
  8284. this.$message({
  8285. message: res.msg,
  8286. type: 'success'
  8287. })
  8288. }else{
  8289. this.$message({
  8290. message: res.msg,
  8291. type: 'error'
  8292. })
  8293. }
  8294. },err => {
  8295. this.$message({
  8296. message: err,
  8297. type: 'error'
  8298. })
  8299. })
  8300. this.showMonthWorkTimeReminder()
  8301. },
  8302. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8303. fillWeekCustomClne() {
  8304. this.fillWeekDialogVisiCustom = false
  8305. },
  8306. fillWeekCustomSubmit() {
  8307. this.getReportList();
  8308. this.getDepartment();
  8309. this.getRecentlyProject()
  8310. },
  8311. // 待填日报姓名搜索
  8312. nameAearchSeek(flg) {
  8313. if(!this.nameAearch) {
  8314. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8315. return
  8316. }
  8317. if(flg) {
  8318. this.enterpriseWechatgetUser()
  8319. }
  8320. },
  8321. handleThreeData(userList) {
  8322. console.log(userList, '人员数据')
  8323. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8324. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8325. },
  8326. // 过滤树节点
  8327. filterTreeNodes(treeData, filterKeywords) {
  8328. return treeData.filter((node) => {
  8329. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8330. if (node.children && node.children.length > 0) {
  8331. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8332. }
  8333. return true;
  8334. }
  8335. if (node.children && node.children.length > 0) {
  8336. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8337. return node.children.length > 0;
  8338. }
  8339. return false;
  8340. });
  8341. },
  8342. // 企业微信获取人员
  8343. enterpriseWechatgetUser() {
  8344. this.deptMembDataLoading = true
  8345. this.http.post('/user/getEmployeeList',{
  8346. departmentId: -1,
  8347. pageIndex: 1,
  8348. pageSize: 100,
  8349. keyword: this.nameAearch,
  8350. status: '',
  8351. roleId: '',
  8352. cursor: '',
  8353. onlyDirect: '',
  8354. matchingType: ''
  8355. },res => {
  8356. if(res.code == 'ok'){
  8357. this.deptMembDataLoading = false
  8358. const userListName = res.data.records.map(item => item.name)
  8359. this.handleThreeData(userListName)
  8360. }else{
  8361. this.deptMembDataLoading = false
  8362. this.$message({
  8363. message: res.msg,
  8364. type: 'error'
  8365. })
  8366. }
  8367. },err => {
  8368. this.deptMembDataLoading = false
  8369. this.$message({
  8370. message: err,
  8371. type: 'error'
  8372. })
  8373. })
  8374. },
  8375. // 按周填报获取相关任务
  8376. async getWeeklyTaskList(item) {
  8377. console.log(item, '<=== 数据')
  8378. const { projectId, groupId, stage, taskId } = item
  8379. console.log(projectId, groupId, stage)
  8380. let parms = { projectId, isSubstitude: 0 }
  8381. groupId ? parms.groupId = groupId : ''
  8382. stage ? parms.stage = stage : ''
  8383. const { data } = await this.postData('/task/getRecentTask', parms)
  8384. this.zhoBao.taskId = taskId
  8385. this.$set(this.zhoBao, 'taskList', data)
  8386. console.log(this.zhoBao)
  8387. },
  8388. // 封装 post 请求
  8389. postData(url, params) {
  8390. return new Promise((resolve, reject) => {
  8391. this.http.post(url, { ...params },
  8392. res => {
  8393. resolve(res)
  8394. },
  8395. error => {
  8396. this.$message({
  8397. message: error,
  8398. type: "error"
  8399. });
  8400. reject(error)
  8401. })
  8402. })
  8403. },
  8404. // 自定义事件
  8405. selectCal(obj) {
  8406. console.log(obj, '传数据来源')
  8407. if(obj.distinction == '1') {
  8408. this.zhoBao.projectAuditorId = obj.id
  8409. } else if(obj.distinction == '2') {
  8410. this.zhoBao.auditorFirst = obj.id
  8411. } else if(obj.distinction == '3') {
  8412. this.zhoBao.auditorSec = obj.id
  8413. } else if(obj.distinction == '4') {
  8414. this.zhoBao.auditorThird = obj.id
  8415. } else if(obj.distinction == '5') {
  8416. this.zhoBao.ccUserid = obj.id
  8417. } else if(obj.distinction == '12') {
  8418. this.usersListId = obj.id
  8419. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8420. this.searchKeyword = obj.name
  8421. } else {
  8422. this.searchKeyword = ''
  8423. }
  8424. this.searchScreen(0)
  8425. } else if(obj.distinction == '13') {
  8426. this.usersListId = obj.id
  8427. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8428. this.searchKeyword = obj.name
  8429. } else {
  8430. this.searchKeyword = ''
  8431. }
  8432. this.searchScreen(1)
  8433. }
  8434. }
  8435. },
  8436. created() {
  8437. this.getUsers()
  8438. let height = window.innerHeight;
  8439. this.tableHeight = height - 178;
  8440. const that = this;
  8441. window.onresize = function temp() {
  8442. that.tableHeight = window.innerHeight - 178;
  8443. };
  8444. this.toViewForm.companyId = this.user.companyId
  8445. this.initDrag([{
  8446. type: "LR",
  8447. domClass: {
  8448. // 中间分割线的名字
  8449. resize: "line-line",
  8450. // 左侧盒子的名字
  8451. left: "box-left",
  8452. // 右侧盒子的名字
  8453. right: "box-right",
  8454. // 父级的名字
  8455. box: "box-father",
  8456. },
  8457. otherInfo: {
  8458. // 限制左边栏最低宽度
  8459. leftWidth: 120,
  8460. },
  8461. },
  8462. {
  8463. type: "LR",
  8464. domClass: {
  8465. // 中间分割线的名字
  8466. resize: "line-second",
  8467. // 左侧盒子的名字
  8468. left: "left-laowang",
  8469. // 右侧盒子的名字
  8470. right: "box-second-father",
  8471. // 父级的名字
  8472. box: "grand",
  8473. },
  8474. otherInfo: {
  8475. // 限制左边栏最低宽度
  8476. leftWidth: 120,
  8477. },
  8478. },
  8479. ]);
  8480. }
  8481. };
  8482. </script>
  8483. <style lang="scss" scoped>
  8484. .fillWeekDialogVisiCustom {
  8485. width: 100%;
  8486. height: 70vh;
  8487. }
  8488. .fillWeekCustom {
  8489. .el-dialog__body {
  8490. padding: 20px 20px !important;
  8491. }
  8492. }
  8493. .photos {
  8494. position: relative;
  8495. display: flex;
  8496. flex-wrap: wrap;
  8497. }
  8498. .photos_img {
  8499. width: 120px;
  8500. height: 120px;
  8501. margin-right: 20px;
  8502. margin-bottom: 20px;
  8503. cursor: pointer;
  8504. img {
  8505. width: 100%;
  8506. height: 100%;
  8507. }
  8508. }
  8509. .paginatis {
  8510. padding: 10px 10px;
  8511. background: #f2f2f2;
  8512. }
  8513. .waiting {
  8514. color:orange;
  8515. }
  8516. .filledReportStyle {
  8517. color:#32CD32;
  8518. }
  8519. .RejectStyle {
  8520. color:red;
  8521. }
  8522. .waitSubmitStyle{
  8523. color: #409eff;
  8524. }
  8525. .chooseDate {
  8526. .waiting {
  8527. color: #20a0ff;
  8528. }
  8529. .filledReportStyle {
  8530. color:#20a0ff;
  8531. }
  8532. .RejectStyle {
  8533. color: #20a0ff;
  8534. }
  8535. .waitSubmitStyle{
  8536. color: #20a0ff;
  8537. }
  8538. }
  8539. .allDaily {
  8540. width:100%;
  8541. }
  8542. .report_title {
  8543. padding:10px 0;
  8544. color:#666;
  8545. }
  8546. .clearfix {
  8547. overflow-x: auto;
  8548. white-space: nowrap;
  8549. padding: 15px 0 10px 0;
  8550. // overflow-y: hidden;
  8551. .date_item {
  8552. padding: 0 3px;
  8553. cursor: pointer;
  8554. position: relative;
  8555. }
  8556. .chooseDate {
  8557. position: absolute;
  8558. bottom: -3px;
  8559. width: 37px;
  8560. height: 2px;
  8561. left: 14px;
  8562. background: #20a0ff;
  8563. }
  8564. }
  8565. .one_daily {
  8566. i {
  8567. color: #9ed0ff;
  8568. margin-right: 5px;
  8569. }
  8570. .one_daily_body {
  8571. padding: 10px 0px;
  8572. p {
  8573. margin: 0;
  8574. line-height: 30px;
  8575. }
  8576. }
  8577. ul {
  8578. padding: 0;
  8579. }
  8580. }
  8581. .checkbtn {
  8582. float: right;
  8583. margin-top: -10px;
  8584. }
  8585. .selConStyle{
  8586. margin-top:9rem;
  8587. margin-bottom:11rem;
  8588. .selConStyle_title{
  8589. height: 3rem;
  8590. text-align: center;
  8591. font-size: 17px;
  8592. }
  8593. .el-select{
  8594. margin: 0 15%;
  8595. width: 70%;
  8596. }
  8597. }
  8598. </style>
  8599. <style lang="scss">
  8600. /*去除upload组件过渡效果*/
  8601. .photos .el-upload-list__item {
  8602. transition: none !important;
  8603. }
  8604. .daily {
  8605. .el-card__body {
  8606. height: 80%;
  8607. overflow-y: auto;
  8608. }
  8609. .el-card__header {
  8610. padding: 0 20px;
  8611. }
  8612. }
  8613. .membListClass{
  8614. .el-dialog__body{
  8615. padding-top: 10px;
  8616. }
  8617. }
  8618. // .editReportDialog .el-dialog__footer{
  8619. // position: sticky;
  8620. // bottom: 0;
  8621. // background: #fff;
  8622. // height: 70px;
  8623. // z-index: 1010;
  8624. // }
  8625. .editReportDialog{
  8626. min-width: 800px;
  8627. }
  8628. .touruxiangmu{
  8629. max-width: 1000px;
  8630. }
  8631. </style>
  8632. <style scoped>
  8633. /* 项目标签的样式 */
  8634. .el-tag + .el-tag {
  8635. margin-left: 10px;
  8636. }
  8637. .button-new-tag {
  8638. margin-left: 10px;
  8639. height: 32px;
  8640. line-height: 30px;
  8641. padding-top: 0;
  8642. padding-bottom: 0;
  8643. }
  8644. .input-new-tag {
  8645. width: 90px;
  8646. margin-left: 10px;
  8647. vertical-align: bottom;
  8648. }
  8649. .selectworktime .el-table__fixed-body-wrapper{
  8650. top: 48px !important;
  8651. }
  8652. .selectworktime_export .selectworktime_export_l{
  8653. width: 650px;
  8654. float: left;
  8655. height: 42px;
  8656. }
  8657. .approvalProcessBox{
  8658. margin-left: 30px;
  8659. font-size: 14px;
  8660. line-height: 16px;
  8661. cursor: pointer;
  8662. }
  8663. .approvalProcessBox i {
  8664. margin-right: 0;
  8665. height: 16px;
  8666. width: 16px;
  8667. display: inline-block;
  8668. transform: scale(1.2);
  8669. position: relative;
  8670. top: 0.5px;
  8671. color: #409eff;
  8672. }
  8673. .approvalProcessBox .approvalProcessClick{
  8674. cursor: pointer;
  8675. color: #409eff;
  8676. font-size: 14px;
  8677. }
  8678. .approvalProcessBox:hover .approvalProcessClick{
  8679. color: #3485fb;
  8680. }
  8681. </style>
  8682. <style lang="scss" scoped>
  8683. .bionicClass {
  8684. -webkit-appearance: none;
  8685. background-color: #FFF;
  8686. background-image: none;
  8687. border-radius: 4px;
  8688. border: 1px solid #DCDFE6;
  8689. box-sizing: border-box;
  8690. color: #606266;
  8691. display: inline-block;
  8692. height: 40px;
  8693. line-height: 40px;
  8694. outline: 0;
  8695. padding: 0 15px;
  8696. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8697. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8698. width: 350px;
  8699. cursor: pointer;
  8700. .bionicClassText {
  8701. color: #C0C4CC;
  8702. }
  8703. }
  8704. // 加班样式
  8705. .overtime {
  8706. display: inline-block;
  8707. margin-left: 20px;
  8708. input {
  8709. display: inline-block;
  8710. margin-top: 5px;
  8711. }
  8712. }
  8713. .plus {
  8714. display: inline-block;
  8715. }
  8716. // .tages {
  8717. // float: right;
  8718. // }
  8719. .overtime {
  8720. display: inline-block;
  8721. margin-left: 30px;
  8722. }
  8723. .bloks {
  8724. display: inline-block;
  8725. width: 380px;
  8726. }
  8727. .zhiss {
  8728. display: flex;
  8729. justify-content: space-around;
  8730. align-items: center;
  8731. }
  8732. .zhoFel {
  8733. display: flex;
  8734. justify-content: space-between;
  8735. align-items: center;
  8736. }
  8737. // 左右滑动样式
  8738. .line {
  8739. width: 30px;
  8740. /* height: 500px; */
  8741. background: #f2f2f2;
  8742. cursor: w-resize;
  8743. }
  8744. .box-father {
  8745. border: 8px solid #000;
  8746. }
  8747. .line-second {
  8748. width: 10px;
  8749. /* background: red; */
  8750. }
  8751. .flex {
  8752. display: flex;
  8753. width: 100%;
  8754. }
  8755. .box-left {
  8756. flex: 0 0 400px;
  8757. /* height: 600px; */
  8758. /* background: blue; */
  8759. }
  8760. .box-right {
  8761. /* height: 600px; */
  8762. /* background: green; */
  8763. flex: 1;
  8764. }
  8765. .box-postion {
  8766. width: 200px;
  8767. /* height: 400px; */
  8768. background: #ccc;
  8769. }
  8770. .custom-tree-node {
  8771. flex: 1;
  8772. display: flex;
  8773. align-items: center;
  8774. justify-content: space-between;
  8775. font-size: 14px;
  8776. padding-right: 8px;
  8777. }
  8778. .daitianrbao {
  8779. width: 100%;
  8780. box-sizing: border-box;
  8781. height: 40px;
  8782. border-radius: 4px;
  8783. border: 1px solid #DCDFE6;
  8784. overflow: hidden;
  8785. text-overflow: ellipsis;
  8786. display: flex;
  8787. // align-items: center;
  8788. }
  8789. .daitianrbao .spnn {
  8790. display: inline-block;
  8791. box-sizing: border-box;
  8792. padding: 0 15px;
  8793. overflow: hidden;
  8794. text-overflow: ellipsis;
  8795. }
  8796. .daitianrbao .hover {
  8797. color: #DCDFE6 !important;
  8798. }
  8799. </style>