daily.vue 489 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  136. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  137. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  138. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  139. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  140. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  141. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  142. <!--部门负责人给个导出工时的功能 -->
  143. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  144. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  146. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  147. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  148. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  149. </span>
  150. </div>
  151. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  152. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  153. <i class="fa fa-circle"></i>
  154. <!-- {{item1.name}} -->
  155. <span v-if="user.userNameNeedTranslate == '1'">
  156. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  157. </span>
  158. <span v-if="user.userNameNeedTranslate != '1'">
  159. {{item1.name}}
  160. </span>
  161. <span style="margin-left:30px;">
  162. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  163. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  164. <!-- 工作总时长: -->
  165. {{$t('other.totalWorkingHours')}}
  166. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  167. <span >{{item1.reportTime | amounts}}</span>h
  168. </span>
  169. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  170. <i class="iconfont firerock-iconliucheng1"></i>
  171. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  172. <!-- 审批流程 -->
  173. {{$t('other.approvalProcess')}}
  174. </span>
  175. </span>
  176. </span>
  177. <div class="checkbtn" style="padding-right:20px;">
  178. <!--编辑和删除日报-->
  179. <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>
  180. <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>
  181. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  182. </div>
  183. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  184. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  185. </div>
  186. <div class="one_daily_body">
  187. <el-timeline>
  188. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  189. <el-card shadow="never">
  190. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  191. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  192. <span v-if="user.company.packageEngineering == 0">
  193. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  194. <span v-if="user.timeType.reportAuditType == 7" >
  195. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  196. <span v-if="item2.deptAuditorName">、</span>
  197. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  198. </span>
  199. <span v-else>
  200. <span v-if="item2.isDeptAudit==0">
  201. <span v-if="item2.projectAuditState==0">
  202. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  206. )</span>
  207. <!-- 审核 --> {{$t('other.audit')}}
  208. </span>
  209. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  210. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  211. <span v-if="item2.projectAuditorName != null">(
  212. <!-- {{item2.projectAuditorName}} -->
  213. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  214. )</span>
  215. <!-- 审核通过 --> {{$t('state.approved')}}
  216. </span>
  217. </span>
  218. <span v-else-if="item2.isDeptAudit==1">
  219. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  220. ({{$t('other.await')}}
  221. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  222. {{$t('other.audit')}})
  223. </span>
  224. </span>
  225. ]</span>
  226. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  227. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  228. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  229. </span>
  230. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  232. </span>
  233. <!-- <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> -->
  234. <span v-if="user.company.packageEngineering == 1">
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  238. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  239. (
  240. <!-- <span v-if="user.userNameNeedTranslate != 1">
  241. {{item2.projectAuditorName}}
  242. </span>
  243. <span v-if="user.userNameNeedTranslate == 1">
  244. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  245. </span> -->
  246. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  247. )
  248. </span>{{$t('other.audit')}} ]</span>
  249. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  252. </span>
  253. <!--每个项目上单独审核 -->
  254. <span style="float:right;">
  255. <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>
  256. <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"
  257. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  258. <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"
  259. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  260. <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"
  261. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  262. <!--自己可以撤回待审核状态的报告 -->
  263. <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>
  264. </span>
  265. </p>
  266. <p v-if="user.companyId == yuzhongCompId">
  267. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  268. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  270. <!--任务分组和阶段 -->
  271. <p v-if="item2.groupId != 0">
  272. {{$t('other.taskGroup')}}:{{item2.groupName}}
  273. <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>
  274. </p>
  275. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  276. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  277. <!-- 自定义日报文本 -->
  278. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  279. <p v-if="user.company.packageEngineering == 1">
  280. {{$t('other.professionalProgress')}}:
  281. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  282. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  283. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  284. </el-tooltip>
  285. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  286. <i class="iconfont firerock-iconshenhetongguo"></i>
  287. </el-tooltip>
  288. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  289. <i class="iconfont firerock-iconshenhebohui"></i>
  290. </el-tooltip>
  291. </span>
  292. </p>
  293. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  294. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  295. </p>
  296. <div v-if="item2.multiWorktime==0">
  297. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  298. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  299. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  300. {{item2.time.toFixed(1)}}h
  301. <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>
  302. </p>
  303. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  304. <span style="margin-right:10px;">{{item2.progress}}%</span>
  305. </p>
  306. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  307. </div>
  308. <div v-if="item2.multiWorktime==1" >
  309. <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>
  310. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  311. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  312. <p style="display: inline-block;">{{$t('time.duration')}}:
  313. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  314. {{timeItem.time.toFixed(1)}}h
  315. </p>
  316. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  317. </div>
  318. </div>
  319. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  320. <!--照片的显示 -->
  321. <p v-if="item2.pics != null && item2.pics.length > 0">
  322. <el-image v-for="(pic, index) in item2.pics" :key="index"
  323. style="width: 100px; height: 100px; margin-right:10px;"
  324. :src="pic"
  325. :preview-src-list="item2.pics">
  326. </el-image>
  327. </p>
  328. </el-card>
  329. </el-timeline-item>
  330. </el-timeline>
  331. </div>
  332. </div>
  333. <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;">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  334. <!-- 简陋的无报告提示 -->
  335. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </el-card>
  342. </div>
  343. <!-- 工时推送日志弹窗 -->
  344. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  345. <template>
  346. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  347. </template>
  348. <template>
  349. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  350. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  351. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  352. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  353. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  354. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  355. <template slot-scope="scope">
  356. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  357. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  358. </template>
  359. </el-table-column>
  360. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  361. </el-table>
  362. </template>
  363. <span slot="footer" class="dialog-footer">
  364. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  365. </span>
  366. </el-dialog>
  367. <!-- 填写日报的dialog -->
  368. <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">
  369. <div style="height: 65vh;overflow: auto;">
  370. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  371. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  372. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  373. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  374. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  375. <span class="spnn" v-if="workForm.userNames">
  376. <span v-for="(item, index) in workForm.userNames" :key="index">
  377. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  378. <span v-if="index < workForm.userNames.length - 1">,</span>
  379. </span>
  380. </span>
  381. <span class="spnn hover" v-else>
  382. {{$t('defaultText.pleaseSelectAsubstitute')}}
  383. </span>
  384. </div>
  385. </el-form-item>
  386. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  387. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  388. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  389. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  390. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  391. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  392. <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>
  393. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  394. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  395. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  396. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  397. <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>
  398. <!-- AI智能填报 -->
  399. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  400. </el-form-item>
  401. <!--考勤时长显示-->
  402. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  403. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  404. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  405. </span>
  406. <!--批量填报和批量代填不显示考勤记录-->
  407. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  408. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  409. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  410. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  411. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  412. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  413. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  414. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  415. @click="refreshAttendance(workForm.createDate)"></el-button>
  416. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  417. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  418. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  419. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  420. </el-form-item>
  421. <!-- 000000 -->
  422. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  423. <div v-if="reportTimeType.multiWorktime==0">
  424. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  425. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  426. <el-select v-model="domain.timeType" style="width:200px;"
  427. v-if="reportTimeType.type == 0"
  428. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  429. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  430. @change="onTimeTypeChange(domain.timeType)">
  431. <el-option
  432. v-for="item in timeType"
  433. :key="item.value"
  434. :label="item.label"
  435. :value="item.value">
  436. </el-option>
  437. </el-select>
  438. <!-- 数字时长选择 -->
  439. <el-select v-model="domain.workingTime" style="width:200px;"
  440. v-if="reportTimeType.type == 1"
  441. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  442. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  443. @change="seleChn(0,domain)">
  444. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  445. </el-select>
  446. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  447. <span v-if="reportTimeType.type == 2">
  448. <!--时间范围选择 -->
  449. <el-time-picker
  450. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  451. v-model="domain.startTime"
  452. :placeholder="$t('time.startTime')"
  453. style="width:120px;"
  454. format="HH:mm"
  455. value-format="HH:mm"
  456. :picker-options="{
  457. start: '08:00',
  458. end: '23:30'
  459. }"
  460. @change="iptChang()">
  461. </el-time-picker> - <el-time-picker
  462. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  463. v-model="domain.endTime"
  464. :placeholder="$t('time.endTime')"
  465. style="width:120px;"
  466. format="HH:mm"
  467. value-format="HH:mm"
  468. :picker-options="{
  469. start: '08:00',
  470. end: '23:30',
  471. minTime: domain.startTime
  472. }"
  473. @change="iptChang()">
  474. </el-time-picker>
  475. </span>
  476. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  477. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  478. <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>
  479. </div>
  480. </el-form-item>
  481. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  482. :prop="'domains.' + index + '.reportTargetDeptId'"
  483. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  484. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  485. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  486. <span style="float: left">
  487. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  488. </span>
  489. </el-option>
  490. </el-select>
  491. <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>
  492. </el-form-item>
  493. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  494. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  495. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  496. @change="selectProject(domain, index)"
  497. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  498. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  499. <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">
  500. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  501. <span style="float: right;">{{ item.projectName }}</span>
  502. </el-option>
  503. </el-option-group>
  504. </el-select>
  505. <!--昱众不显示子项目-->
  506. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  507. <span style="margin-left:45px;">
  508. {{$t('lable.subproject')}}</span>
  509. <!--子项目 -->
  510. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  511. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  512. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  513. </el-select>
  514. </template>
  515. <template v-if="user.companyId == yuzhongCompId">
  516. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  517. <!--角色选择 -->
  518. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  519. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  520. <el-option
  521. v-for="item in roleList"
  522. :key="item.value"
  523. :label="item.label"
  524. :value="item.value">
  525. </el-option>
  526. </el-select>
  527. </template>
  528. <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%;"
  529. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  530. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  531. </el-link>
  532. <!-- <el-link type="primary" v-if="canEdit"
  533. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  534. </el-form-item>
  535. <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">
  536. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  537. </el-form-item>
  538. <!--如果设置了工时成本预警的预算成本项-->
  539. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  540. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  541. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  542. </el-select>
  543. </el-form-item>
  544. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  545. <template slot="label">
  546. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  547. <span >{{$t('lable.taskGrouping')}}</span>
  548. </template>
  549. <!-- 任务分组 -->
  550. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  551. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  552. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  553. </el-select>
  554. <template v-if="user.companyId == yuzhongCompId">
  555. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  556. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  557. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  558. <el-option
  559. v-for="item in domain.filteredRespList"
  560. :key="item.id"
  561. :label="item.jobRespon"
  562. :value="item.id">
  563. </el-option>
  564. </el-select>
  565. </template>
  566. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  567. <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>
  568. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  569. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  570. @change="changeStages(domain, index)"
  571. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  572. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  573. </el-select>
  574. </template>
  575. </el-form-item>
  576. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  577. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  578. <template slot="label">
  579. <span style="color:#FF0000;">*</span>
  580. <span >{{$t('other.projectAuditor')}}</span>
  581. </template>
  582. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  583. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  584. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  585. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  586. </el-option>
  587. </el-select>
  588. <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>
  589. </el-form-item>
  590. </div>
  591. <el-form-item v-if="user.companyId == yuzhongCompId">
  592. <template slot="label">
  593. <span style="color:#FF0000;">*</span>
  594. <span >{{ $t('gongZuoNeiRong') }}</span>
  595. </template>
  596. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  597. :disabled="(workForm.domains[index].state>=2?false:true)" >
  598. <el-option
  599. v-for="item in domain.workContentList"
  600. :key="item.id"
  601. :label="item.workContext"
  602. :value="item.id">
  603. </el-option>
  604. </el-select>
  605. </el-form-item>
  606. <!-- 111111 -->
  607. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  608. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  609. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  610. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  611. <span v-else>{{item.name}}</span>
  612. </el-option>
  613. </el-select>
  614. <template v-if="user.timeType.auditLevel > 1">
  615. <i class="el-icon-right"></i>
  616. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  617. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  618. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  619. <span v-else>{{item.name}}</span>
  620. </el-option>
  621. </el-select>
  622. </template>
  623. <template v-if="user.timeType.auditLevel > 2">
  624. <i class="el-icon-right"></i>
  625. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  626. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  627. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  628. <span v-else>{{item.name}}</span>
  629. </el-option>
  630. </el-select>
  631. </template>
  632. </el-form-item>
  633. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  634. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  635. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  636. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  637. <span v-else>{{item.name}}</span>
  638. </el-option>
  639. </el-select>
  640. </el-form-item>
  641. <!-- 相关维度/自定义维度 -->
  642. <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'">
  643. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  644. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  645. </el-option>
  646. </el-select>
  647. </el-form-item>
  648. <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'">
  649. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  650. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  651. </el-option>
  652. </el-select>
  653. </el-form-item>
  654. <!-- 相关数值 -->
  655. <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">
  656. <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>
  657. </el-form-item>
  658. <!-- 自定义文本 -->
  659. <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">
  660. <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>
  661. </el-form-item>
  662. <!--按比例填报-->
  663. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  664. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  665. <div style="width:400px;">
  666. <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>
  667. <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>
  668. </div>
  669. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  670. <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>
  671. </div>
  672. </el-form-item>
  673. <!--工程专业版本模式下, 各个专业的进度填报 -->
  674. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  675. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  676. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  677. <el-input size="mini" style="width:60px;" v-model="item.progress"
  678. @keyup.native="onProgressChange"
  679. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  680. </span>
  681. </el-form-item>
  682. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  683. <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))" >
  684. <template slot="label" v-if="user.timeType.taskRequired == 1">
  685. <span style="color:#FF0000;">*</span>
  686. <span >{{ $t('other.task') }}</span>
  687. </template>
  688. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  689. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  690. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  691. </el-select>
  692. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  693. </el-form-item>
  694. <!--针对依斯贝的SAP服务-->
  695. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  696. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  697. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  698. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  699. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  700. </el-select>
  701. </el-form-item>
  702. <!--工作事项-->
  703. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  704. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  705. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  707. </el-form-item>
  708. <!-- 拍照上传 -->
  709. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  710. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  711. <div class="photos">
  712. <div>
  713. <el-upload
  714. list-type="picture-card"
  715. :http-request="(file) => {return addImg(file, index)}"
  716. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  717. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  718. :file-list="domain.imgListUrl" :limit="9"
  719. :disabled="workForm.domains[index].state>=2?false:true">
  720. <i class="el-icon-plus"></i>
  721. </el-upload>
  722. </div>
  723. </div>
  724. </el-form-item>
  725. </div>
  726. <!--多个工作事项填报的情况 -->
  727. <div v-if="reportTimeType.multiWorktime==1">
  728. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  729. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  730. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  731. @change="selectProject(domain, index)"
  732. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  733. <!-- <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">
  734. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  735. <span style="float: right;">{{ item.projectName }}</span>
  736. </el-option> -->
  737. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  738. <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">
  739. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  740. <span style="float: right;">{{ item.projectName }}</span>
  741. </el-option>
  742. </el-option-group>
  743. </el-select>
  744. <template v-if="user.timeType.mainProjectState != 1">
  745. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  746. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  747. <!--子项目 -->
  748. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  749. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  750. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  751. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  752. </el-select>
  753. </template>
  754. <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;"
  755. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  756. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  757. </el-link>
  758. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  759. <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>
  760. </div>
  761. <!-- <el-link type="primary" v-if="canEdit"
  762. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  763. </el-form-item>
  764. <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">
  765. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  766. </el-form-item>
  767. <!--如果设置了工时成本预警的预算成本项-->
  768. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  769. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  770. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  771. </el-select>
  772. </el-form-item>
  773. <el-form-item v-if="user.company.packageProject == 1">
  774. <template slot="label">
  775. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  776. <span >{{$t('lable.taskGrouping')}}</span>
  777. </template>
  778. <!-- 任务分组 -->
  779. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  780. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  781. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  782. </el-select>
  783. <!-- 项目的阶段 -->
  784. <span v-if="domain.stages != null && domain.stages.length> 0"
  785. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  786. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  787. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  788. @change="changeStages(domain, index)"
  789. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  790. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  791. </el-select>
  792. </el-form-item>
  793. <el-form-item :label="$t('other.projectAuditor')" >
  794. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  795. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  796. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  797. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  798. </el-option>
  799. </el-select>
  800. <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>
  801. </el-form-item>
  802. <!--工程专业版本模式下, 各个专业的进度填报 -->
  803. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  804. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  805. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  806. <el-input size="mini" style="width:60px;" v-model="item.progress"
  807. @keyup.native="onProgressChange"
  808. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  809. </span>
  810. </el-form-item>
  811. <!-- 相关维度 -->
  812. <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'">
  813. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  814. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  815. </el-option>
  816. </el-select>
  817. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  818. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  819. </el-option>
  820. </el-select>
  821. </el-form-item>
  822. <!-- 相关数值 -->
  823. <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">
  824. <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>
  825. </el-form-item>
  826. <!-- 自定义文本 -->
  827. <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">
  828. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  829. </el-form-item>
  830. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  831. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  832. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  833. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  834. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  835. </el-select>
  836. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  837. </el-form-item>
  838. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  839. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  840. <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>
  841. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  842. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  843. <span v-if="reportTimeType.type == 2">
  844. <!-- <span> -->
  845. <!--时间范围选择 -->
  846. <el-time-picker
  847. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  848. v-model="timeItem.startTime"
  849. :placeholder="$t('time.startTime')"
  850. style="width:120px;"
  851. format="HH:mm"
  852. value-format="HH:mm"
  853. :picker-options="{
  854. start: '00:00',
  855. end: '23:59',
  856. }"
  857. @change="iptChangs()">
  858. </el-time-picker> - <el-time-picker
  859. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  860. v-model="timeItem.endTime"
  861. :placeholder="$t('time.endTime')"
  862. style="width:120px;"
  863. format="HH:mm"
  864. value-format="HH:mm"
  865. :picker-options="{
  866. start: '00:00',
  867. end: '23:59',
  868. minTime: timeItem.startTime
  869. }"
  870. @change="iptChangs()">
  871. </el-time-picker>
  872. </span>
  873. </el-form-item>
  874. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  875. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  876. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  877. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  878. ></el-input>
  879. </el-form-item>
  880. </div>
  881. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  882. </div>
  883. <!--照片的显示 -->
  884. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  885. <el-image v-for="(pic, index) in domain.pics" :key="index"
  886. style="width: 100px; height: 100px; margin-right:10px;"
  887. :src="pic"
  888. :preview-src-list="domain.pics">
  889. </el-image>
  890. </p>
  891. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  892. </div>
  893. <span id="workFormsItemBottom"></span>
  894. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  895. </el-form>
  896. </div>
  897. <span slot="footer" class="dialog-footer">
  898. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  899. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  900. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  901. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  902. <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>
  903. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  904. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  905. </span>
  906. </el-dialog>
  907. <!-- 按周填报 -->
  908. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  909. <!-- 按周填报-已填工时-点击 -->
  910. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  911. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  912. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  913. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  914. <el-table-column prop="state" :label="$t('state.states')">
  915. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  916. </el-table-column>
  917. </el-table>
  918. <span slot="footer" class="dialog-footer">
  919. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  920. </span>
  921. </el-dialog>
  922. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  923. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  924. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  925. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  926. <span class="spnn" v-if="workForm.userNames">
  927. <span v-for="(item, index) in workForm.userNames" :key="index">
  928. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  929. <span v-if="index < workForm.userNames.length - 1">,</span>
  930. </span>
  931. </span>
  932. <span class="spnn hover" v-else>
  933. {{$t('defaultText.pleaseSelectAsubstitute')}}
  934. </span>
  935. </div>
  936. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  937. </div>
  938. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  939. <el-form-item style="height:30px;margin-top:-72px;">
  940. <!-- <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> -->
  941. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  942. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  943. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  944. <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>
  945. <el-option
  946. v-for="item in fillProjectList"
  947. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  948. :key="item.id"
  949. :label="item.projectName + '\u3000' + item.projectCode"
  950. :value="item.id">
  951. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  952. <span style="float: right">{{ item.projectName }}</span>
  953. </el-option>
  954. </el-select>
  955. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  956. </el-form-item>
  957. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  958. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  959. <template slot-scope="scope">
  960. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  961. </template>
  962. </el-table-column>
  963. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  964. <template slot-scope="scope">
  965. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  966. <p v-else></p>
  967. </template>
  968. </el-table-column> -->
  969. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  970. <template slot-scope="scope">
  971. <div v-if="scope.row.canFill == 1">
  972. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  973. <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>
  974. <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>
  975. <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>
  976. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  977. </div>
  978. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  979. <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>
  980. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  981. </div>
  982. </div>
  983. <div v-else >
  984. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  985. </div>
  986. </template>
  987. </el-table-column>
  988. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  989. <template slot-scope="scope">
  990. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  991. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  992. </template>
  993. </el-table-column>
  994. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  995. <template slot-scope="scope">
  996. <div class="zhiss">
  997. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  998. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  999. </div>
  1000. </template>
  1001. </el-table-column>
  1002. </el-table>
  1003. </el-form>
  1004. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1005. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1006. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1007. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1008. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1009. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1010. <!--针对景昱,先检查工时是否存在异常-->
  1011. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1012. </span>
  1013. </el-dialog>
  1014. <!-- 重庆物奇私人定制的按周填报 -->
  1015. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1016. <div class="fillWeekDialogVisiCustom">
  1017. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1018. </div>
  1019. </el-dialog>
  1020. <!-- 选择时间 -->
  1021. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1022. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1023. <span slot="footer" class="dialog-footer">
  1024. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1025. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1026. </span>
  1027. </el-dialog>
  1028. <!-- 按周填报弹窗 -->
  1029. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1030. <div>
  1031. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1032. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1033. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1034. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1035. </el-select>
  1036. </div>
  1037. <!--如果设置了工时成本预警的预算成本项-->
  1038. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1039. <p>{{$t('lable.budgetSource')}}</p>
  1040. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1041. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1042. </el-select>
  1043. </div>
  1044. <!-- 任务分组 -->
  1045. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1046. <p>{{$t('lable.taskGrouping')}}</p>
  1047. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1048. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1049. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1050. </el-select>
  1051. </div>
  1052. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1053. <p>{{$t('other.inputStage')}}</p>
  1054. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1055. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1056. </el-select>
  1057. </div>
  1058. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1059. <p>{{$t('other.reviewer')}}</p>
  1060. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1061. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. <template v-if="user.timeType.reportAuditType == 3">
  1066. <div class="zhoFel">
  1067. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1068. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1069. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1070. </el-select>
  1071. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1072. </div>
  1073. <div class="zhoFel">
  1074. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1075. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1076. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1077. </el-select>
  1078. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1079. </div>
  1080. <div class="zhoFel">
  1081. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1082. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1083. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1084. </el-select>
  1085. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1086. </div>
  1087. <div class="zhoFel">
  1088. <p>{{ $t('chao-song-ren') }}</p>
  1089. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1090. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1091. </el-select>
  1092. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1093. </div>
  1094. </template>
  1095. <!-- 自定义维度 -->
  1096. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1097. <p>{{user.timeType.customDegreeName}}</p>
  1098. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1099. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1100. </el-select>
  1101. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1102. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1103. </el-select>
  1104. </div>
  1105. <!-- 自定义数值 -->
  1106. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1107. <p>{{user.timeType.customDataName}}</p>
  1108. <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>
  1109. </div>
  1110. <!-- 自定义文本 -->
  1111. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1112. <p>{{user.timeType.customTextName}}</p>
  1113. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1114. </div>
  1115. <!-- 选择任务 -->
  1116. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1117. <p>{{ $t('renWuLiChengBei') }}</p>
  1118. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1119. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1120. </el-select>
  1121. </div>
  1122. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1123. <p>{{$t('other.timeSelection')}}</p>
  1124. <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>
  1125. </div>
  1126. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1127. <p>{{$t('other.chooseDuration')}}</p>
  1128. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1129. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1130. </el-select>
  1131. </div>
  1132. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1133. <p>{{$t('lable.percentageOfTime')}}</p>
  1134. <div style="width:400px;display: flex;align-items: center;">
  1135. <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>
  1136. <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>
  1137. </div>
  1138. </div>
  1139. <div class="zhoFel">
  1140. <p>{{$t('other.workMatters')}}</p>
  1141. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1142. </div>
  1143. </div>
  1144. <span slot="footer" class="dialog-footer">
  1145. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1146. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1147. </span>
  1148. </el-dialog>
  1149. <!--导出报表条件选择 -->
  1150. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" :model="exportParam" >
  1152. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1153. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1154. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1155. </el-select>
  1156. </el-form-item>
  1157. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1158. <!-- <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>
  1159. <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> -->
  1160. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1161. </el-form-item>
  1162. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1163. <el-date-picker
  1164. v-model="exportParam.dateRange" :editable="false"
  1165. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1166. :range-separator="$t('other.to')"
  1167. type="daterange"
  1168. :start-placeholder="$t('time.startDate')"
  1169. :end-placeholder="$t('time.endDate')"
  1170. ></el-date-picker>
  1171. </el-form-item>
  1172. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1173. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1174. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1175. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1176. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1177. </el-select>
  1178. </el-form-item>
  1179. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1180. <div class="exportReportRadio">
  1181. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1182. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1183. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1184. <i class="el-icon-question"></i>
  1185. </el-tooltip>
  1186. </div>
  1187. </el-form-item>
  1188. </el-form>
  1189. <div slot="footer" class="dialog-footer">
  1190. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1191. </div>
  1192. </el-dialog>
  1193. <!--导出报表条件选择 -->
  1194. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1195. <el-form ref="form3" :model="exportParam" >
  1196. <el-form-item prop="range" :label="$t('time.dateRange')">
  1197. <el-date-picker
  1198. v-model="exportParam.dateRange" :editable="false"
  1199. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1200. :clearable="true"
  1201. :range-separator="$t('other.to')"
  1202. type="daterange"
  1203. :start-placeholder="$t('time.startDate')"
  1204. :end-placeholder="$t('time.endDate')"
  1205. ></el-date-picker>
  1206. </el-form-item>
  1207. </el-form>
  1208. <div slot="footer" class="dialog-footer">
  1209. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1210. </div>
  1211. </el-dialog>
  1212. <!--人员列表 -->
  1213. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1214. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1215. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1216. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1217. <el-table-column type="selection"></el-table-column>
  1218. <el-table-column prop="label" :label="$t('lable.name')" >
  1219. <template slot-scope="scope">
  1220. <span>
  1221. <!-- {{(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}} -->
  1222. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1223. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1224. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1225. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1226. </span>
  1227. <span v-else>
  1228. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1229. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1230. </span>
  1231. </span>
  1232. </template>
  1233. </el-table-column>
  1234. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1235. <template slot-scope="scope">
  1236. <div>
  1237. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1238. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1239. </div>
  1240. </template>
  1241. </el-table-column>
  1242. </el-table>
  1243. </el-tab-pane>
  1244. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1245. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1246. <el-table-column prop="label" :label="$t('lable.name')" >
  1247. <template slot-scope="scope">
  1248. <!-- <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> -->
  1249. <!-- <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> -->
  1250. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1251. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1252. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1253. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1254. </span>
  1255. <span v-else>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1257. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1258. </span>
  1259. </template>
  1260. </el-table-column>
  1261. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1262. <template slot-scope="scope">
  1263. <div>
  1264. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1265. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1266. </div>
  1267. </template>
  1268. </el-table-column>
  1269. </el-table>
  1270. </el-tab-pane>
  1271. </el-tabs>
  1272. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1273. <el-table-column type="selection"></el-table-column>
  1274. <el-table-column prop="label" :label="$t('lable.name')" >
  1275. <template slot-scope="scope">
  1276. <div>
  1277. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1278. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1279. </div>
  1280. </template>
  1281. </el-table-column>
  1282. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1283. <template slot-scope="scope">
  1284. <div>
  1285. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1286. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1287. </div>
  1288. </template>
  1289. </el-table-column>
  1290. </el-table>
  1291. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1292. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1293. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1294. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1295. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1296. </div>
  1297. </el-dialog>
  1298. <!-- 日报审核修改 -->
  1299. <el-dialog
  1300. :title="$t('riBaoShenHeXiuGai')"
  1301. :visible.sync="reportLogCheckDialog"
  1302. width="30%"
  1303. :before-close="handleClose">
  1304. <el-form ref="form3" :model="exportReportLogParam" >
  1305. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1306. <el-date-picker
  1307. v-model="exportReportLogParam.dateRange" :editable="false"
  1308. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1309. :range-separator="$t('other.to')"
  1310. type="daterange"
  1311. :start-placeholder="$t('time.startDate')"
  1312. :end-placeholder="$t('time.endDate')"
  1313. ></el-date-picker>
  1314. </el-form-item>
  1315. </el-form>
  1316. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1317. <br>
  1318. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1319. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1320. <span slot="footer" class="dialog-footer">
  1321. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1322. </span>
  1323. </el-dialog>
  1324. <!-- 按部门选择人员 -->
  1325. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1326. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1327. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1328. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1329. </el-input>
  1330. <div class="tree" style="height:400px">
  1331. <el-scrollbar style="height:100%">
  1332. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1333. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1334. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1335. <span class="custom-tree-node" slot-scope="{ node }">
  1336. <span v-if="user.userNameNeedTranslate == '1'">
  1337. <span v-if="node.data.children">
  1338. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1339. </span>
  1340. <span v-else>
  1341. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1342. </span>
  1343. </span>
  1344. <span v-if="user.userNameNeedTranslate != '1'">
  1345. {{ node.label }}
  1346. </span>
  1347. <!-- {{ node.label }} -->
  1348. </span>
  1349. </el-tree>
  1350. </el-scrollbar>
  1351. </div>
  1352. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1353. <div slot="footer" class="dialog-footer">
  1354. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1355. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1356. </div>
  1357. </el-dialog>
  1358. <el-dialog
  1359. v-if="monthWorkTimeDialog"
  1360. :visible.sync="monthWorkTimeDialog"
  1361. :close-on-click-modal="false"
  1362. customClass="customWidth selectworktime"
  1363. width="92%"
  1364. top="60px"
  1365. >
  1366. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1367. <el-tabs v-model="activeName" @tab-click="handleClick">
  1368. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1369. <div class="selectworktime_export" style="margin-top:10px;">
  1370. <div class="selectworktime_export_l">
  1371. <el-date-picker
  1372. class="selecteworktime_datapick"
  1373. v-model="WorktimeDatepickValue"
  1374. value-format="yyyy-MM-dd"
  1375. type="daterange"
  1376. align="right"
  1377. unlink-panels
  1378. :range-separator="$t('other.to')"
  1379. :start-placeholder="$t('time.startDate')"
  1380. :end-placeholder="$t('time.endDate')"
  1381. :default-time="['12:00:00', '12:00:00']"
  1382. size="small"
  1383. popper-class="selecteorktime_datapick_popper"
  1384. @change="showMonthWorkTime()"
  1385. >
  1386. </el-date-picker>
  1387. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1388. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1389. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1390. <!-- 222 -->
  1391. </div>
  1392. <div>
  1393. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1394. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1395. <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">
  1396. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1397. </el-input>
  1398. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1399. </div>
  1400. <div style="float: left; height:32px; padding-top:10px;">
  1401. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1402. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1403. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1404. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1405. </div>
  1406. <div style="float: right; vertical-align: middle;height:32px">
  1407. <el-link
  1408. type="primary"
  1409. @click="exportMembWorkHours()"
  1410. >{{$t('export.exportData')}}</el-link
  1411. >
  1412. </div>
  1413. </div>
  1414. <el-table ref="hasworkTbl"
  1415. :data="monthWorkDataS"
  1416. v-el-table-infinite-scroll="listScroll"
  1417. border
  1418. :height="'70vh'"
  1419. highlight-current-row
  1420. style="width: 100%"
  1421. v-loading="tbload"
  1422. :lazy="true"
  1423. :cell-style="hasworkTblCellStyle"
  1424. >
  1425. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1426. <template slot-scope="scope">
  1427. {{ scope.$index + 1 }}
  1428. </template>
  1429. </el-table-column>
  1430. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1431. <template slot-scope="scope">
  1432. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1433. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1434. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1435. <!-- {{scope.row.name}} -->
  1436. </span>
  1437. </template>
  1438. </el-table-column>
  1439. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1440. <template slot-scope="scope">
  1441. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1442. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1443. </template>
  1444. </el-table-column>
  1445. <el-table-column
  1446. min-width="60"
  1447. v-for="(item, index) in pickDateArray"
  1448. :key="index"
  1449. :label="item"
  1450. align="center"
  1451. >
  1452. <template slot="header" slot-scope="scope">
  1453. <div>{{ scope.column.label.dateStr }}</div>
  1454. <div>{{ scope.column.label.weekStr }}</div>
  1455. </template>
  1456. <template slot-scope="scope">
  1457. <div
  1458. v-if="
  1459. scope.row.worktimeList.filter(
  1460. (w) =>
  1461. w.createDate==item.date
  1462. ).length > 0 &&
  1463. scope.row.worktimeList.filter(
  1464. (w) =>w.createDate==item.date
  1465. )[0].workingTime < reportTimeType.allday
  1466. "
  1467. >
  1468. {{
  1469. scope.row.worktimeList.filter(
  1470. (w) =>w.createDate==item.date
  1471. )[0].workingTime.toFixed(1)
  1472. }}
  1473. </div>
  1474. <div
  1475. v-if="
  1476. scope.row.worktimeList.filter(
  1477. (w) =>w.createDate==item.date
  1478. ).length > 0 &&
  1479. scope.row.worktimeList.filter(
  1480. (w) =>w.createDate==item.date
  1481. )[0].workingTime > reportTimeType.allday
  1482. "
  1483. >
  1484. {{
  1485. scope.row.worktimeList.filter(
  1486. (w) =>w.createDate==item.date
  1487. )[0].workingTime.toFixed(1)
  1488. }}
  1489. </div>
  1490. <div
  1491. v-if="
  1492. scope.row.worktimeList.filter(
  1493. (w) =>w.createDate==item.date
  1494. ).length > 0 &&
  1495. scope.row.worktimeList.filter(
  1496. (w) =>w.createDate==item.date
  1497. )[0].workingTime == reportTimeType.allday
  1498. "
  1499. >
  1500. {{
  1501. scope.row.worktimeList.filter(
  1502. (w) =>w.createDate==item.date
  1503. )[0].workingTime
  1504. }}
  1505. </div>
  1506. <div
  1507. v-if="
  1508. scope.row.worktimeList.filter(
  1509. (w) =>w.createDate==item.date
  1510. ).length == 0
  1511. "
  1512. >
  1513. 0
  1514. </div>
  1515. <div
  1516. v-if="
  1517. scope.row.worktimeList.filter(
  1518. (w) =>w.createDate==item.date
  1519. ).length > 0 &&
  1520. typeof scope.row.worktimeList.filter(
  1521. (w) =>w.createDate==item.date
  1522. )[0].workingTime == 'string'
  1523. "
  1524. >
  1525. {{
  1526. scope.row.worktimeList.filter(
  1527. (w) =>w.createDate==item.date
  1528. )[0].workingTime
  1529. }}
  1530. </div>
  1531. </template>
  1532. </el-table-column>
  1533. </el-table>
  1534. <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>
  1535. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1536. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1537. <label style="font-size: 16px">员工每日已填报工时数</label>
  1538. <el-link
  1539. type="primary"
  1540. style="float: right; margin-right: 60px"
  1541. @click="exportMembWorkHours()"
  1542. >导出已填报数据</el-link
  1543. > -->
  1544. <!-- <el-button >导出</el-button> -->
  1545. <!-- </div> -->
  1546. </el-tab-pane>
  1547. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1548. <div class="selectworktime_export" style="margin-top:10px">
  1549. <div class="selectworktime_export_l">
  1550. <el-date-picker
  1551. class="selecteworktime_datapick"
  1552. v-model="WorktimeDatepickValue"
  1553. value-format="yyyy-MM-dd"
  1554. type="daterange"
  1555. align="right"
  1556. unlink-panels
  1557. :range-separator="$t('other.to')"
  1558. :start-placeholder="$t('time.startDate')"
  1559. :end-placeholder="$t('time.endDate')"
  1560. :default-time="['12:00:00', '12:00:00']"
  1561. size="small"
  1562. popper-class="selecteorktime_datapick_popper"
  1563. @change="showMonthNotWorkTime()"
  1564. >
  1565. </el-date-picker>
  1566. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1567. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1568. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1569. </div>
  1570. <div>
  1571. <div style="margin-top:10px;">
  1572. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1573. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1574. <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">
  1575. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1576. </el-input>
  1577. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1578. <el-link
  1579. type="primary"
  1580. style="float: right; vertical-align: middle;height:32px"
  1581. @click="exportMembNotWorkHours()"
  1582. >{{$t('export.exportData')}}</el-link
  1583. >
  1584. </div>
  1585. </div>
  1586. </div>
  1587. <el-table
  1588. ref="hasworkTbl2"
  1589. :data="monthNotWorkDateS"
  1590. v-el-table-infinite-scroll="notListScroll"
  1591. border
  1592. :height="'70vh'"
  1593. highlight-current-row
  1594. style="width: 100%"
  1595. v-loading="tbload"
  1596. lazy
  1597. >
  1598. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1599. <template slot-scope="scope">
  1600. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1601. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1602. </template>
  1603. </el-table-column>
  1604. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1605. <template slot-scope="scope">
  1606. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1607. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1608. </template>
  1609. </el-table-column>
  1610. <el-table-column
  1611. min-width="200"
  1612. :label="$t('weekDay.date')"
  1613. align="center"
  1614. prop="createDate"
  1615. >
  1616. </el-table-column>
  1617. <el-table-column
  1618. min-width="200"
  1619. :label="$t('state.states')"
  1620. align="center"
  1621. prop="status"
  1622. />
  1623. <el-table-column
  1624. min-width="200"
  1625. :label="$t('other.attendanceData')"
  1626. prop="cardTime"
  1627. align="center"
  1628. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1629. </el-table>
  1630. <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>
  1631. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1632. </el-tab-pane>
  1633. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1634. <div class="selectworktime_export" style="margin-top:10px;">
  1635. <div class="selectworktime_export_l">
  1636. <el-date-picker
  1637. class="selecteworktime_datapick"
  1638. v-model="WorktimeDatepickValue"
  1639. value-format="yyyy-MM-dd"
  1640. type="daterange"
  1641. align="right"
  1642. unlink-panels
  1643. :range-separator="$t('other.to')"
  1644. :start-placeholder="$t('time.startDate')"
  1645. :end-placeholder="$t('time.endDate')"
  1646. :default-time="['12:00:00', '12:00:00']"
  1647. size="small"
  1648. popper-class="selecteorktime_datapick_popper"
  1649. @change="showMonthWorkTimeReminder()"
  1650. >
  1651. </el-date-picker>
  1652. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1653. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1654. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1655. </div>
  1656. <div>
  1657. <div style="margin-top:10px;">
  1658. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1659. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1660. <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">
  1661. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1662. </el-input>
  1663. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1664. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1665. </div>
  1666. </div>
  1667. <div style="float: right; vertical-align: middle;height:32px">
  1668. <el-link
  1669. type="primary"
  1670. @click="changeReminder()"
  1671. >{{ $t('bianGengTiXing') }}</el-link
  1672. >
  1673. <el-link
  1674. type="primary"
  1675. @click="exportMembWorkHoursReminder()"
  1676. >{{$t('export.exportData')}}</el-link
  1677. >
  1678. </div>
  1679. </div>
  1680. <el-table ref="hasworkTbl"
  1681. :data="monthWorkDataS"
  1682. v-el-table-infinite-scroll="listScroll"
  1683. border
  1684. :height="'70vh'"
  1685. highlight-current-row
  1686. style="width: 100%"
  1687. v-loading="tbload"
  1688. :lazy="true"
  1689. >
  1690. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1691. <template slot-scope="scope">
  1692. {{ scope.row.createDate}}
  1693. </template>
  1694. </el-table-column>
  1695. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1696. <template slot-scope="scope">
  1697. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1698. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1699. <!-- {{scope.row.name}} -->
  1700. </template>
  1701. </el-table-column>
  1702. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1703. <template slot-scope="scope">
  1704. {{scope.row.invokeValue}}
  1705. </template>
  1706. </el-table-column>
  1707. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1708. <template slot-scope="scope">
  1709. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1710. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1711. </template>
  1712. </el-table-column>
  1713. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1714. <template slot-scope="scope">
  1715. {{ scope.row.workingTime}}
  1716. </template>
  1717. </el-table-column>
  1718. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1719. <template slot-scope="scope">
  1720. {{ scope.row.cardTime}}
  1721. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1722. </template>
  1723. </el-table-column>
  1724. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1725. <template slot-scope="scope">
  1726. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1727. </template>
  1728. </el-table-column>
  1729. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1730. <template slot-scope="scope">
  1731. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1732. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1733. </template>
  1734. </el-table-column>
  1735. </el-table>
  1736. <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>
  1737. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1738. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1739. <label style="font-size: 16px">员工每日已填报工时数</label>
  1740. <el-link
  1741. type="primary"
  1742. style="float: right; margin-right: 60px"
  1743. @click="exportMembWorkHours()"
  1744. >导出已填报数据</el-link
  1745. > -->
  1746. <!-- <el-button >导出</el-button> -->
  1747. <!-- </div> -->
  1748. </el-tab-pane>
  1749. </el-tabs>
  1750. </el-dialog>
  1751. <!--驳回弹出框 -->
  1752. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1753. <div>
  1754. <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')" />
  1755. </div>
  1756. <div slot="footer" class="dialog-footer">
  1757. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1758. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1759. </div>
  1760. </el-dialog>
  1761. <!-- 通过弹出框 -->
  1762. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1763. <div>
  1764. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1765. </div>
  1766. <div slot="footer" class="dialog-footer">
  1767. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1768. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1769. </div>
  1770. </el-dialog>
  1771. <!--批量导入日报 -->
  1772. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1773. <p>1. {{$t('other.download')}}
  1774. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./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>
  1775. </p>
  1776. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1777. <p style="display: flex;justify-content: center;">
  1778. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1779. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1780. </el-upload>
  1781. </p>
  1782. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1783. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1784. </div>
  1785. </el-dialog>
  1786. <!-- 工时导入记录弹窗 -->
  1787. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1788. <div style="height: 452px">
  1789. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1790. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1791. <el-table-column prop="userName" :label="$t('other.operator')">
  1792. <template slot-scope="scope">
  1793. <div>
  1794. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1795. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1796. </div>
  1797. </template>
  1798. </el-table-column>
  1799. <el-table-column prop="datel" :label="$t('other.document')">
  1800. <template slot-scope="scope">
  1801. <div>
  1802. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1803. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1804. </div>
  1805. </template>
  1806. </el-table-column>
  1807. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1808. <template slot-scope="scope">
  1809. <div>
  1810. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1811. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1812. </div>
  1813. </template>
  1814. </el-table-column>
  1815. </el-table>
  1816. <el-col :span="24" class="paginatis">
  1817. <el-pagination
  1818. @size-change="handleSizeChange"
  1819. @current-change="handleCurrentChange"
  1820. :page-sizes="[20 , 50 , 80 , 100]"
  1821. :page-size="20"
  1822. layout="total, sizes, prev, pager, next"
  1823. :total="toViewForm.total"
  1824. style="float:right;"
  1825. ></el-pagination>
  1826. </el-col>
  1827. </div>
  1828. </el-dialog>
  1829. <!--基于企业微信考勤数据的工时导入 -->
  1830. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1831. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1832. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1833. </el-step>
  1834. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1835. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1836. </el-steps>
  1837. <div v-if="active==0" style="padding:30px;height:360px;">
  1838. <div style="margin-top:50px;margin-left:280px;">
  1839. <el-date-picker
  1840. v-model="importWxParam.date" :editable="false"
  1841. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1842. :clearable="true"
  1843. :range-separator="$t('other.to')"
  1844. type="daterange"
  1845. :start-placeholder="$t('time.startDate')"
  1846. :end-placeholder="$t('time.endDate')"
  1847. @change="loadCheckInData"
  1848. ></el-date-picker>
  1849. </div>
  1850. </div>
  1851. <div v-if="active==1" style="padding:10px;">
  1852. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1853. style="width: 100%;margin-top:5px;" >
  1854. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1855. <template slot-scope="scope">
  1856. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1857. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1858. </template>
  1859. </el-table-column>
  1860. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1861. </el-table-column>
  1862. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1863. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1864. <template slot-scope="scope">
  1865. <div>
  1866. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1867. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1868. </div>
  1869. </template>
  1870. </el-table-column>
  1871. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1872. <template slot-scope="scope">
  1873. <div>
  1874. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1875. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1876. </div>
  1877. </template>
  1878. </el-table-column>
  1879. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1880. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1881. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1882. <template slot-scope="scope">
  1883. {{scope.row.workHours.toFixed(1)}}h
  1884. </template>
  1885. </el-table-column>
  1886. </el-table>
  1887. </div>
  1888. <div v-if="active==2" >
  1889. <p style="display: flex;justify-content: center;height:390px;">
  1890. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1891. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1892. </el-upload>
  1893. </p>
  1894. </div>
  1895. <div slot="title">
  1896. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1897. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1898. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1899. <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">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  1900. <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;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  1901. <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();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  1902. </div>
  1903. <span slot="footer">
  1904. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1905. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1906. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1907. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1908. </span>
  1909. </el-dialog>
  1910. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1911. <p style="display: flex;justify-content: center;height:100px;">
  1912. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1913. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1914. </el-upload>
  1915. </p>
  1916. </el-dialog>
  1917. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1918. <div>
  1919. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1920. v-model="deleteReportParam.date" :editable="false"
  1921. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1922. :clearable="true"
  1923. :range-separator="$t('other.to')"
  1924. type="daterange"
  1925. :start-placeholder="$t('time.startDate')"
  1926. :end-placeholder="$t('time.endDate')"
  1927. ></el-date-picker>
  1928. </div>
  1929. <div style="margin-top:10px;">
  1930. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  1931. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1932. <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>
  1933. </div>
  1934. <div style="margin-top:10px;">
  1935. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  1936. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  1937. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1938. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1939. <span v-else>{{item.name}}</span>
  1940. </el-option>
  1941. </el-select>
  1942. </div>
  1943. <span slot="footer">
  1944. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  1945. </span>
  1946. </el-dialog>
  1947. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1948. <div>
  1949. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1950. v-model="deleteReportParam.date" :editable="false"
  1951. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1952. :clearable="true"
  1953. :range-separator="$t('other.to')"
  1954. type="daterange"
  1955. :start-placeholder="$t('time.startDate')"
  1956. :end-placeholder="$t('time.endDate')"
  1957. ></el-date-picker>
  1958. </div>
  1959. <div style="margin-top:15px;">
  1960. <span>{{ $t('other.selectdepartment') }}:</span>
  1961. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  1962. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1963. size="small" v-if="user.userNameNeedTranslate != 1"
  1964. ></el-cascader>
  1965. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1966. </div>
  1967. <span slot="footer">
  1968. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  1969. </span>
  1970. </el-dialog>
  1971. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1972. <div>
  1973. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  1974. v-model="modImportTime"
  1975. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1976. :clearable="true"
  1977. type="datetime"
  1978. ></el-date-picker>
  1979. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  1980. v-model="modImportUserId"
  1981. >
  1982. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1983. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1984. <span v-else>{{item.name}}</span>
  1985. </el-option>
  1986. </el-select>
  1987. </div>
  1988. <span slot="footer">
  1989. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  1990. </span>
  1991. </el-dialog>
  1992. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1993. <div>
  1994. <span>{{ $t('qingXuanZeNianYue') }}</span>
  1995. <el-date-picker
  1996. v-model="ratioYmonth" :editable="false"
  1997. format="yyyyMM" value-format="yyyyMM"
  1998. type="month"
  1999. ></el-date-picker>
  2000. </div>
  2001. <span slot="footer">
  2002. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2003. </span>
  2004. </el-dialog>
  2005. <!--工时批量代填 -->
  2006. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2007. <div>
  2008. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2009. v-model="importWxParam.date" :editable="false"
  2010. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2011. :clearable="true"
  2012. :range-separator="$t('other.to')"
  2013. type="daterange"
  2014. :start-placeholder="$t('time.startDate')"
  2015. :end-placeholder="$t('time.endDate')"
  2016. @change="loadCheckInData"
  2017. ></el-date-picker>
  2018. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2019. </div>
  2020. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2021. :key="timeStamp"
  2022. style="width: 100%;margin-top:5px;" ref="tab">
  2023. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2024. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2025. <template slot-scope="scope">
  2026. <div>
  2027. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2028. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2029. </div>
  2030. </template>
  2031. </el-table-column>
  2032. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2033. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2034. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2035. <template slot-scope="scope">
  2036. {{scope.row.workHours.toFixed(1)}}h
  2037. </template>
  2038. </el-table-column>
  2039. <!--项目名称列表 -->
  2040. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2041. <template slot-scope="scope">
  2042. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2043. </template>
  2044. </el-table-column>
  2045. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2046. <template slot-scope="scope">
  2047. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2048. </template>
  2049. </el-table-column>
  2050. </el-table>
  2051. </el-dialog>
  2052. <!--基于企业微信考勤数据的工时导入 -->
  2053. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2054. <div style="padding-bottom:10px;">
  2055. <p>{{importResultMsg}}</p>
  2056. </div>
  2057. <!-- <span slot="footer" class="dialog-footer">
  2058. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2059. </span> -->
  2060. </el-dialog>
  2061. <!-- 审核流程展示 -->
  2062. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2063. <div style="padding:20px 40px 20px 0">
  2064. <el-timeline :reverse="false">
  2065. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2066. <!-- {{item.msg}} -->
  2067. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2068. <span v-if="user.userNameNeedTranslate == 1">
  2069. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2070. <span>{{item.msgCon.two}}</span>
  2071. </span>
  2072. </el-timeline-item>
  2073. </el-timeline>
  2074. </div>
  2075. </el-dialog>
  2076. <!-- 威派格定制 -->
  2077. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2078. </section>
  2079. </template>
  2080. <script>
  2081. // 左右滑动
  2082. import dragMixin from "@/common/js/tensile.js";
  2083. import util from "../../common/js/util";
  2084. // 自定义select组件
  2085. import selectCat from "@/components/select.vue"
  2086. // 引入自定义级联组件
  2087. import vueCascader from "@/components/cascader.vue"
  2088. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2089. // 重庆物奇定制组件
  2090. import WeeklyCustomization from "./weeklyCustomization.vue"
  2091. // 威派格定制转移工时
  2092. import TransferWorkingHours from "./transferWorkingHours.vue"
  2093. import { mapMutations } from 'vuex'
  2094. let _that = this
  2095. export default {
  2096. mixins: [dragMixin],
  2097. components: {
  2098. selectCat,
  2099. vueCascader,
  2100. WeeklyCustomization,
  2101. vueMultipleDept,
  2102. TransferWorkingHours
  2103. },
  2104. data() {
  2105. return {
  2106. substitudeStep: 1,
  2107. showHidden: false,
  2108. pageIndex: 0,
  2109. hasMore: true,
  2110. exportType: 0,
  2111. exportingData: false,
  2112. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2113. jobResponseList:[],
  2114. yisibeiCompId: 3092,
  2115. yuzhongCompId: 3385,
  2116. mingyiName : '成都明夷电子科技有限公司',
  2117. // mingyiName : '明夷',
  2118. modItemDataId: null,
  2119. modImportTime: null,
  2120. modImportUserId: null,
  2121. showModImportTimeDialog: false,
  2122. showBatchSimpleApproveReport: false,
  2123. startDeleting: false,
  2124. showBatchDeleteReport: false,
  2125. deleteReportParam: {date:null, userIds:[]},
  2126. isDenying: false,
  2127. targetWeekDate: null,//填写周报中的周日期
  2128. importCardTimeVisi: false,
  2129. startRatioExporting: false,
  2130. exportUserRatio: false,
  2131. ratioYmonth:null,
  2132. hasWrittenReport: false,
  2133. today:null,
  2134. syncTimeLoading: false,
  2135. seluserText: '',
  2136. translation: '1', // 1、文字, 2、部门, 3、人员
  2137. exportLoad: false,
  2138. getPickerOptions: {
  2139. disabledDate: (time) => {
  2140. var date = new Date();
  2141. var year = date.getFullYear();
  2142. var month = date.getMonth() + 1;
  2143. if (month >= 1 && month <= 9) {
  2144. month = "0" + month;
  2145. }
  2146. var currentdate = year.toString() + month.toString();
  2147. var timeyear = time.getFullYear();
  2148. var timemonth = time.getMonth() + 1;
  2149. if (timemonth >= 1 && timemonth <= 9) {
  2150. timemonth = "0" + timemonth;
  2151. }
  2152. var timedate = timeyear.toString() + timemonth.toString();
  2153. if(this.user.timeType.fillAhead == 0){
  2154. return currentdate < timedate;
  2155. }else{
  2156. return false
  2157. }
  2158. }
  2159. },
  2160. alalal: '8.0',
  2161. timeBasecostList:null,
  2162. tbload: false,
  2163. exportTimeDialog: false,
  2164. searchKeyword: '',
  2165. monthWorkDataS: [],
  2166. monthNotWorkDateS: [],
  2167. pickDateArray:[],
  2168. WorktimeDatepickValue: [],
  2169. activeName:"first",
  2170. isLeave: 0,
  2171. submitingReport: false,
  2172. importResultMsg:null,
  2173. showImportResult:false,
  2174. importingData: false,
  2175. isDraft: 0,
  2176. timeStamp: 0,
  2177. projectColumns:[],
  2178. checkinLoading:false,
  2179. importWxParam:{date:null,},
  2180. active:0,
  2181. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2182. importWxDialog:false,
  2183. importDialog:false,
  2184. denyForm:null,
  2185. denyReasonDialog:false,
  2186. monthWorkTimeDialog: false,
  2187. isSubstitude:false,
  2188. isFill:false,
  2189. unFillList:[],
  2190. fillList:[],
  2191. fillMembList:[],
  2192. fillMembList_leave: [],
  2193. membListVisible: false,
  2194. isBatch:0,//是否是批量填报
  2195. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2196. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2197. 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')],
  2198. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2199. fillStatusList: [],
  2200. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2201. exportReportLogParam:{dateRange:[]},
  2202. exportDialog:false,
  2203. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2204. subProjectList:[],
  2205. canEdit: true,
  2206. originCanEdit: true,
  2207. 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],
  2208. selectTime:null,
  2209. reportTimeType:{},
  2210. curDate:'',
  2211. isAllSelect: false,
  2212. approveDialogVisible:false,
  2213. deptId:null,
  2214. targetUid: null,
  2215. membCount:0,
  2216. selectState:"-1",
  2217. user: JSON.parse(sessionStorage.getItem("user")),
  2218. allUsersList: [],
  2219. showAddMore:false,
  2220. allDate: [],
  2221. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2222. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2223. choseDay: 0,
  2224. tableHeight: 0,
  2225. listLoading: false,
  2226. projectList: [], //项目列表
  2227. fillProjectList: [],
  2228. reportList: [], //日报列表
  2229. reportNames:[], //批量审批列表
  2230. selCon:[], //筛选条件
  2231. selProjectList:[], //筛选后项目列表
  2232. selConShow: true,
  2233. usersList: [], // 全部人员列表
  2234. usersListId: '', // 选中的人员id
  2235. dialogVisible: false, //项目弹窗
  2236. report: '',
  2237. workForm: {
  2238. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2239. domains: [{
  2240. id: null,
  2241. projectId: "",
  2242. workingTime: "",
  2243. timeType:0,
  2244. content: "",
  2245. state: 2,
  2246. multiWorktime:0,
  2247. worktimeList:[],
  2248. degreeId: null,
  2249. auditUserList: [],
  2250. }],
  2251. showRefresh: false,
  2252. },
  2253. workRules: {
  2254. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2255. },
  2256. chooseParticipVisible: false,
  2257. logining: false,
  2258. isDisable: false,
  2259. timeType:[],
  2260. deptMembData: [
  2261. ],
  2262. //部门人员树状结构
  2263. data: [
  2264. {
  2265. id: -1,
  2266. label: this.$t('lable.allStaff'),
  2267. membCount:0
  2268. },
  2269. {
  2270. id: 0,
  2271. label: this.$t('lable.unassigned'),
  2272. }
  2273. ],
  2274. allData:{},
  2275. batchShowData:{},
  2276. option: [],
  2277. deptOptionList: [],
  2278. depData: {
  2279. id: -1,
  2280. label: this.$t('lable.allStaff'),
  2281. },
  2282. defaultProps: {
  2283. children: 'children',
  2284. label: 'label'
  2285. },
  2286. isNew: false,
  2287. selected: false,
  2288. valuet: new Date(),
  2289. domObj: null,
  2290. participator:[],
  2291. chosenMembCount:0,
  2292. jsDay: 0,
  2293. jsTime: 0,
  2294. falsss: false,
  2295. weidu: [],
  2296. weiduList: [],
  2297. yonghuUser: [],
  2298. dateAr: [],
  2299. batchSubFillDialog: false,
  2300. isSubstiS: false,
  2301. fillWeekDialogVisi: false,
  2302. fillWeekDialogVisiCustom: false,
  2303. zhoData: [],
  2304. weekDateRange: [],
  2305. btnZho: false,
  2306. weekDataLoading: false,
  2307. changdu: 6,
  2308. tianxieDialogVisible: false,
  2309. scopess: {},
  2310. zhoBao: {
  2311. time: '',
  2312. workingTime: '',
  2313. progress: '',
  2314. con: '',
  2315. subProjectId: '',
  2316. stage: '',
  2317. subProjectList: [],
  2318. stages: [],
  2319. },
  2320. zhoBaoIdx: '',
  2321. zhoBaoName: '',
  2322. zhis: {},
  2323. dealList: [],
  2324. toViewDialogVisible: false,
  2325. toViewList: [],
  2326. toViewloading: true,
  2327. toViewForm: {
  2328. pageIndex: '1',
  2329. pageSize: '20',
  2330. total: 0,
  2331. },
  2332. toViewloadings: false,
  2333. tabPositionss: 'top',
  2334. monthTotal: 0,
  2335. monthTotalPage: 0,
  2336. monthTotalLages: 20,
  2337. monthWorkData: [],
  2338. monthNotWorkDate: [],
  2339. monthWorkDataS1: [],
  2340. monthnotTotal: 0,
  2341. monthnotTotalPage: 0,
  2342. monthnotTotalLages: 20,
  2343. monthNotWorkDateS1: [],
  2344. deptMembDataText: '',
  2345. isFlag: false,
  2346. isMore: false,
  2347. stateKey: '0',
  2348. expandDate: [],
  2349. notifySelList:[],
  2350. departmentList: [],
  2351. trandepartmentList:[],
  2352. approvalProcessDialog: false,
  2353. approvalProcessData: [],
  2354. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2355. 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')],
  2356. isWeekend: false,
  2357. canCancelInDialog: false,
  2358. approveinData: {},
  2359. approveinDialog: false,
  2360. reportCanDelete: false,
  2361. weeklyFilledTimeDialog: false,
  2362. weeklyFilledTimeList: [],
  2363. weeklyFilledTimeLoading: false,
  2364. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2365. weeklyFilledTimeCanDelete: false,
  2366. weeklyFilledTimeDate: null,
  2367. leaveAllNum: 0,
  2368. dataLoading: false,
  2369. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2370. vacationTime: {},
  2371. integrationProjectList: [],
  2372. totalReportHours: 0, // 合计的工时
  2373. workTimeForMinYi:0,
  2374. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2375. weekIndex: 1,
  2376. weekParentData: {},
  2377. deptIdForNoReport:[],
  2378. deptIdForReminder:[],
  2379. nameAearch: '', // 企业微信姓名搜索
  2380. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2381. deptMembDataLoading: false,
  2382. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2383. {
  2384. id: 4811,
  2385. // id: 10,
  2386. name: '陕西柘中建设工程有限公司'
  2387. }
  2388. ],
  2389. pushWorkTimeLogDig:false,
  2390. pushWorkTimeLogData:[],
  2391. userReportDeptList: [],
  2392. isReminder:true,
  2393. reportLogCheckDialog:false,
  2394. deptIdForHasReport:[],
  2395. transferWorkingHoursVisable: false
  2396. };
  2397. },
  2398. watch: {
  2399. deptMembDataText(val) {
  2400. this.$refs.chooseMembTree.filter(val);
  2401. }
  2402. },
  2403. filters: {
  2404. // 过滤
  2405. amounts(value) {
  2406. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2407. return 0
  2408. }
  2409. var zhi = +value + 0
  2410. return zhi.toFixed(1)
  2411. },
  2412. // zhoData
  2413. zhoData(value, arr) {
  2414. var dateArray = value.split("-");
  2415. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2416. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2417. // console.log(arr[date.getDay()])
  2418. // return "周" + "日一二三四五六".charAt(date.getDay());
  2419. return arr[date.getDay()]
  2420. },
  2421. // 过滤数字
  2422. numbers(value) {
  2423. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2424. return 0
  2425. }
  2426. return value
  2427. },
  2428. },
  2429. computed: {},
  2430. mounted() {
  2431. var now = new Date();
  2432. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2433. this.today = t;
  2434. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2435. this.exportParam.dateRange = [startStr,t];
  2436. this.exportReportLogParam.dateRange = [startStr,t];
  2437. this.getAllDate(1);
  2438. this.getReportList();
  2439. this.getProjectList();
  2440. this.getFillProjectList();
  2441. this.getTimeType();
  2442. this.getDepartment();
  2443. this.scrollFunction()
  2444. this.userssHu();
  2445. this.getFirstAndLastDay()
  2446. if(this.user.timeType.reportAuditType == 3){
  2447. this.getAllUsersList()
  2448. }
  2449. if (this.user.company.packageProject == 1) {
  2450. this.getBasecostItemList();
  2451. }
  2452. if(this.user.timeType.userWithMultiDept == 1) {
  2453. this.getDeptMembData();
  2454. }
  2455. if(this.user.timeType.lockWorktime){
  2456. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2457. }
  2458. //设置了下限
  2459. if (this.user.timeType.minReportTime) {
  2460. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2461. }
  2462. const that = this
  2463. if(this.user.userNameNeedTranslate == 1) {
  2464. that.dataLoading = that.$store.state.dataLoading
  2465. this.upDataLoading()
  2466. setTimeout(()=>{
  2467. that.dataLoading = that.$store.state.dataLoading
  2468. }, 1000)
  2469. }
  2470. if (this.user.companyId == this.yuzhongCompId) {
  2471. this.getJobResponList();
  2472. }
  2473. },
  2474. methods: {
  2475. ...mapMutations(['upDataLoading']),
  2476. // 已填工时情况表设置背景色
  2477. hasworkTblCellStyle({ columnIndex, row, column }) {
  2478. if(columnIndex > 2) {
  2479. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2480. const worktimeList = row.worktimeList || []
  2481. const times = this.reportTimeType.allday
  2482. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2483. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2484. const missReport = filterData[0] && filterData[0].missReport;
  2485. const state = filterData[0] && filterData[0].state
  2486. if (missReport) {
  2487. return "backgroundColor: red"
  2488. } else {
  2489. if (state == 0 || state == -1) {
  2490. return "backgroundColor: orange"
  2491. } else if (state == 1) {
  2492. //审核通过
  2493. return "backgroundColor: #32CD32"
  2494. } else if (state == 2) {
  2495. return "backgroundColor: red"
  2496. } else {
  2497. return "backgroundColor: #E0E0E0"
  2498. }
  2499. }
  2500. }
  2501. },
  2502. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2503. isCustomization(userInfo, permissionArray) {
  2504. const { companyId } = userInfo
  2505. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2506. return isReportPictureRequired
  2507. },
  2508. showHiddenFunction() {
  2509. this.showHidden = true;
  2510. },
  2511. // 获取如何信息选的可填写部门
  2512. getDeptMembData() {
  2513. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2514. if (res.code == "ok") {
  2515. let lists = res.data.userReportDeptList || []
  2516. const optimizedList = lists.map(item => ({
  2517. ...item,
  2518. label: item.departmentName,
  2519. value: item.departmentId,
  2520. }));
  2521. this.$set(this, 'userReportDeptList', optimizedList || []);
  2522. } else {
  2523. this.$message({
  2524. message: res.msg,
  2525. type: "error"
  2526. });
  2527. }
  2528. },error => { });
  2529. },
  2530. //任务被选中
  2531. onTaskSelected(domainItem) {
  2532. //取服务
  2533. if (domainItem.taskId) {
  2534. var that = this;
  2535. var param = {taskId:domainItem.taskId};
  2536. if (this.isSubstitude) {
  2537. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2538. param.userId = this.workForm.userId[0];
  2539. }
  2540. }
  2541. this.http.post('/task/getMyTaskService',param, res => {
  2542. if (res.code == "ok") {
  2543. // domainItem.workContentList = res.data;
  2544. that.$set(domainItem, 'sapServiceId', null);
  2545. that.$set(domainItem, 'serviceList', res.data);
  2546. } else {
  2547. this.$message({
  2548. message: res.msg,
  2549. type: "error"
  2550. });
  2551. }
  2552. },error => {
  2553. this.$message({
  2554. message: error,
  2555. type: "error"
  2556. });
  2557. }
  2558. );
  2559. } else {
  2560. //清空服务
  2561. }
  2562. },
  2563. onBatchTimeChange() {
  2564. //反向计算每日工作时长
  2565. if (this.workForm.createDate) {
  2566. let sdate = new Date(this.workForm.createDate[0]);
  2567. let edate = new Date(this.workForm.createDate[1]);
  2568. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2569. console.log('days===', days)
  2570. if (days < 0) {
  2571. return;
  2572. }
  2573. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2574. //总时长发生改变,自动按比例计算
  2575. this.workForm.domains.forEach(d=>{
  2576. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2577. });
  2578. }
  2579. },
  2580. //更新工作内容列表
  2581. updateJobContent(domainItem) {
  2582. var that = this;
  2583. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2584. if (res.code == "ok") {
  2585. // domainItem.workContentList = res.data;
  2586. that.$set(domainItem, 'extraField3', null);
  2587. that.$set(domainItem, 'workContentList', res.data);
  2588. } else {
  2589. this.$message({
  2590. message: res.msg,
  2591. type: "error"
  2592. });
  2593. }
  2594. },error => {
  2595. this.$message({
  2596. message: error,
  2597. type: "error"
  2598. });
  2599. }
  2600. );
  2601. },
  2602. updateResponse(domainItem) {
  2603. var that = this;
  2604. var selectPid = domainItem.projectId;
  2605. domainItem.extraField2 = null;
  2606. domainItem.extraField3 = null;
  2607. if (selectPid && domainItem.extraField1) {
  2608. //是否非项目
  2609. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2610. console.log('==========','isPublic=='+isPublic);
  2611. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2612. console.log(filteredRespList);
  2613. domainItem.filteredRespList = filteredRespList;
  2614. }
  2615. },
  2616. getJobResponList() {
  2617. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2618. if (res.code == "ok") {
  2619. this.jobResponseList = res.data;
  2620. } else {
  2621. this.$message({
  2622. message: res.msg,
  2623. type: "error"
  2624. });
  2625. }
  2626. },error => {
  2627. this.$message({
  2628. message: error,
  2629. type: "error"
  2630. });
  2631. }
  2632. );
  2633. },
  2634. openModImportTime(row) {
  2635. this.showModImportTimeDialog = true;
  2636. this.modItemDataId = row.id;
  2637. },
  2638. delImportTime(row) {
  2639. let rowId = row.id;
  2640. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2641. confirmButtonText: this.$t('btn.determine'),
  2642. cancelButtonText: this.$t('btn.cancel'),
  2643. type: "warning"
  2644. })
  2645. .then(() => {
  2646. this.http.post('/report-import-log/delete',{
  2647. id: rowId
  2648. },res => {
  2649. if (res.code == "ok") {
  2650. this.$message({
  2651. message: this.$t('message.successfullyDeleted'),
  2652. type: "success"
  2653. });
  2654. this.getToView();
  2655. } else {
  2656. this.$message({
  2657. message: res.msg,
  2658. type: "error"
  2659. });
  2660. }
  2661. },error => {
  2662. this.$message({
  2663. message: error,
  2664. type: "error"
  2665. });
  2666. }
  2667. );
  2668. }).catch(() => {this.startDeleting = false});
  2669. },
  2670. confirmChangeModTime() {
  2671. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2672. this.$message({
  2673. message: this.$t('message.Pleaseselectatime'),
  2674. type: "error"
  2675. });
  2676. return;
  2677. }
  2678. this.http.post('/report-import-log/changeTime',{
  2679. modLogDateTime: this.modImportTime,
  2680. modImportUserId: this.modImportUserId,
  2681. id: this.modItemDataId
  2682. },res => {
  2683. if (res.code == "ok") {
  2684. this.$message({
  2685. message: this.$t('message.modifyTheSuccess'),
  2686. type: "success"
  2687. });
  2688. this.getToView();
  2689. this.showModImportTimeDialog = false;
  2690. } else {
  2691. this.$message({
  2692. message: res.msg,
  2693. type: "error"
  2694. });
  2695. }
  2696. },error => {
  2697. this.$message({
  2698. message: error,
  2699. type: "error"
  2700. });
  2701. }
  2702. );
  2703. },
  2704. confirmBatchApproveReport() {
  2705. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2706. this.$message({
  2707. message: this.$t('qingXuanZeRiQiFanWei'),
  2708. type: "error"
  2709. });
  2710. return;
  2711. }
  2712. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2713. confirmButtonText: this.$t('btn.determine'),
  2714. cancelButtonText: this.$t('btn.cancel'),
  2715. type: "warning"
  2716. })
  2717. .then(() => {
  2718. this.startDeleting = true;
  2719. let obj = {
  2720. startDate: this.deleteReportParam.date[0],
  2721. endDate: this.deleteReportParam.date[1]
  2722. }
  2723. if(this.deleteReportParam.departmentId) {
  2724. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2725. } else {
  2726. obj.departmentId = null
  2727. }
  2728. this.http.post('/report/batchApproveByDate',obj,res => {
  2729. if (res.code == "ok") {
  2730. this.$message({
  2731. message: this.$t('state.approved'),
  2732. type: "success"
  2733. });
  2734. this.getReportList();
  2735. this.getDepartment();
  2736. this.startDeleting = false;
  2737. } else {
  2738. this.$message({
  2739. message: res.msg,
  2740. type: "error"
  2741. });
  2742. }
  2743. },error => {
  2744. this.$message({
  2745. message: error,
  2746. type: "error"
  2747. });
  2748. }
  2749. );
  2750. }).catch(() => {this.startDeleting = false});
  2751. },
  2752. confirmBatchDelReport() {
  2753. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2754. this.$message({
  2755. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2756. type: "error"
  2757. });
  2758. return;
  2759. }
  2760. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2761. this.$message({
  2762. message: this.$t('qingXuanZeRiQiFanWei'),
  2763. type: "error"
  2764. });
  2765. return;
  2766. }
  2767. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2768. confirmButtonText: this.$t('btn.determine'),
  2769. cancelButtonText: this.$t('btn.cancel'),
  2770. type: "warning"
  2771. })
  2772. .then(() => {
  2773. this.startDeleting = true;
  2774. this.http.post('/report/batchDelete',{
  2775. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2776. startDate: this.deleteReportParam.date[0],
  2777. endDate: this.deleteReportParam.date[1],
  2778. deptId: this.deleteReportParam.deptId[0]
  2779. },res => {
  2780. if (res.code == "ok") {
  2781. this.$message({
  2782. message: this.$t('message.successfullyDeleted'),
  2783. type: "success"
  2784. });
  2785. this.getReportList();
  2786. this.getDepartment();
  2787. this.startDeleting = false;
  2788. } else {
  2789. this.$message({
  2790. message: res.msg,
  2791. type: "error"
  2792. });
  2793. }
  2794. },error => {
  2795. this.$message({
  2796. message: error,
  2797. type: "error"
  2798. });
  2799. }
  2800. );
  2801. }).catch(() => {this.startDeleting = false});
  2802. },
  2803. getRecentlyProject() {
  2804. this.http.post('/project/nearProject',{},res => {
  2805. if(res.code == 'ok'){
  2806. let topObj = {
  2807. label: this.$t('zuiJinXuanZeXiangMu'),
  2808. peojectList: res.data
  2809. }
  2810. let botomObj = {
  2811. label: this.$t('other.allProject'),
  2812. peojectList: this.fillProjectList
  2813. }
  2814. //最近项目如果在fillProjectList中不存在,需要移除
  2815. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2816. this.integrationProjectList = [topObj, botomObj]
  2817. }else {
  2818. this.$message({
  2819. message: res.msg,
  2820. type: 'error'
  2821. })
  2822. }
  2823. },err => {
  2824. this.$message({
  2825. message: err,
  2826. type: 'error'
  2827. })
  2828. })
  2829. },
  2830. handlePictureCardPreview(file, index) {
  2831. console.log(file, index)
  2832. let arr = []
  2833. let imgArr = this.workForm.domains[index].imgListUrl
  2834. for(var i in imgArr) {
  2835. arr.push(imgArr[i].url)
  2836. }
  2837. console.log(arr, '图片数据')
  2838. const $viewer = this.$viewerApi({
  2839. images: arr
  2840. });
  2841. },
  2842. // 图片上传
  2843. addImg(e, index) {
  2844. console.log(e, '数据')
  2845. let formData = new FormData()
  2846. formData.append('multipartFile', e.file)
  2847. this.http.uploadFile('/common/uploadFile', formData,
  2848. res => {
  2849. if (res.code == "ok") {
  2850. this.$message({
  2851. message: this.$t('uploadedsuccessfully'),
  2852. type: "success"
  2853. });
  2854. if(!this.workForm.domains[index].imgList) {
  2855. this.workForm.domains[index].imgList = []
  2856. this.workForm.domains[index].imgListUrl = []
  2857. }
  2858. this.workForm.domains[index].imgList.push(res.data)
  2859. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2860. } else {
  2861. this.$message({message: res.msg,type: "error"});
  2862. }
  2863. console.log(this.workForm.domains[index])
  2864. },
  2865. error => {this.$message({message: error,type: "error"});
  2866. });
  2867. },
  2868. // 删除图片
  2869. delImg(file,fileList, index) {
  2870. console.log(file, fileList)
  2871. let idx = 0
  2872. for(let i in fileList) {
  2873. if(fileList[i].uid == file.uid) {
  2874. idx = i
  2875. }
  2876. }
  2877. this.workForm.domains[index].imgList.splice(idx, 1)
  2878. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2879. console.log(this.workForm.domains[index])
  2880. },
  2881. test(){
  2882. console.log('test',this.workForm.domains);
  2883. },
  2884. getHour(s1, s2) {
  2885. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2886. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2887. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2888. var ms = s2.getTime() - s1.getTime();
  2889. if (ms < 0) return 0;
  2890. let ma = ms / 1000 / 60 / 60
  2891. return ma; //小时
  2892. },
  2893. refreshWXCardTime(workdate) {
  2894. if (!workdate) return;
  2895. this.syncTimeLoading = true;
  2896. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2897. date: workdate,
  2898. },res => {
  2899. this.syncTimeLoading = false;
  2900. if(res.code == 'ok'){
  2901. this.workForm.time = res.data.time;
  2902. }else {
  2903. this.$message({
  2904. message: res.msg,
  2905. type: 'error'
  2906. })
  2907. }
  2908. },err => {
  2909. this.syncTimeLoading = false;
  2910. this.$message({
  2911. message: err,
  2912. type: 'error'
  2913. })
  2914. })
  2915. },
  2916. refreshAttendance(workdate) {
  2917. if (!workdate) return;
  2918. this.syncTimeLoading = true;
  2919. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2920. startDate: workdate[0],
  2921. endDate: workdate[1]
  2922. },res => {
  2923. this.syncTimeLoading = false;
  2924. if(res.code == 'ok'){
  2925. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2926. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2927. this.totalReportHours = this.workTimeForMinYi;
  2928. }else {
  2929. this.$message({
  2930. message: res.msg,
  2931. type: 'error'
  2932. })
  2933. }
  2934. },err => {
  2935. this.syncTimeLoading = false;
  2936. this.$message({
  2937. message: err,
  2938. type: 'error'
  2939. })
  2940. })
  2941. },
  2942. refreshBeiSengAttendance(workdate) {
  2943. if (!workdate) return;
  2944. this.syncTimeLoading = true;
  2945. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2946. createDate: workdate
  2947. },res => {
  2948. this.syncTimeLoading = false;
  2949. if(res.code == 'ok'){
  2950. this.workForm.time = res.data;
  2951. }else {
  2952. this.$message({
  2953. message: res.msg,
  2954. type: 'error'
  2955. })
  2956. }
  2957. },err => {
  2958. this.syncTimeLoading = false;
  2959. this.$message({
  2960. message: err,
  2961. type: 'error'
  2962. })
  2963. })
  2964. },
  2965. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2966. this.weeklyFilledTimeDialog = true
  2967. this.weeklyFilledTimeLoading = true
  2968. this.weeklyFilledTimeDate = parameterDate
  2969. this.http.post('/report/getReportList',{
  2970. date: parameterDate,
  2971. userId: this.user.id
  2972. },res => {
  2973. this.weeklyFilledTimeLoading = false
  2974. if(res.code == 'ok'){
  2975. this.weeklyFilledTimeList = res.data[0].data
  2976. let candelete = true
  2977. for(let i in this.weeklyFilledTimeList){
  2978. if(this.weeklyFilledTimeList[i].state < 2){
  2979. candelete = false
  2980. }
  2981. }
  2982. this.weeklyFilledTimeCanDelete = candelete
  2983. }else {
  2984. this.$message({
  2985. message: res.msg,
  2986. type: 'error'
  2987. })
  2988. }
  2989. },err => {
  2990. this.weeklyFilledTimeLoading = false
  2991. this.$message({
  2992. message: err,
  2993. type: 'error'
  2994. })
  2995. })
  2996. },
  2997. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2998. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2999. confirmButtonText: this.$t('btn.determine'),
  3000. cancelButtonText: this.$t('btn.cancel'),
  3001. type: "warning"
  3002. })
  3003. .then(() => {
  3004. this.http.post('/report/delete',{
  3005. userId: this.user.id,
  3006. date: this.weeklyFilledTimeDate
  3007. },res => {
  3008. if (res.code == "ok") {
  3009. this.$message({
  3010. message: this.$t('message.successfullyDeleted'),
  3011. type: "success"
  3012. });
  3013. this.getWeeklyWorkTime()
  3014. this.getReportList();
  3015. this.getDepartment();
  3016. this.weeklyFilledTimeDialog = false;
  3017. } else {
  3018. this.$message({
  3019. message: res.msg,
  3020. type: "error"
  3021. });
  3022. }
  3023. },error => {
  3024. this.$message({
  3025. message: error,
  3026. type: "error"
  3027. });
  3028. }
  3029. );
  3030. }).catch(() => {});
  3031. },
  3032. getApprovalProcess(item){
  3033. // console.log('this.date',this.choseDate);
  3034. this.http.post('/report-log/get',{
  3035. creatorId: item.id,
  3036. createDate: sessionStorage.msg
  3037. },res => {
  3038. if(res.code == 'ok'){
  3039. this.approvalProcessDialog = true
  3040. if(this.user.userNameNeedTranslate == 1) {
  3041. for(var i in res.data) {
  3042. let obj = {
  3043. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3044. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3045. }
  3046. res.data[i].msgCon = obj
  3047. }
  3048. }
  3049. this.approvalProcessData = res.data
  3050. console.log(this.approvalProcessData, '数据卡看')
  3051. }else{
  3052. this.$message({
  3053. message: res.msg,
  3054. type: 'error'
  3055. })
  3056. }
  3057. },err => {
  3058. this.$message({
  3059. message: err,
  3060. type: 'error'
  3061. })
  3062. })
  3063. },
  3064. filterNode(value, data) {
  3065. if (!value) return true;
  3066. return data.label.indexOf(value) !== -1;
  3067. },
  3068. triggerCalculateOT(index) {
  3069. var str = this.workForm.domains[index].overtimeHours + ''
  3070. if(str.indexOf('.') != '-1') {
  3071. var s = str.split('.')[0]
  3072. var st = str.split('.')[1]
  3073. var sts = st.split('')
  3074. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3075. }
  3076. },
  3077. searchScreen(e){
  3078. if(e){
  3079. this.monthNotWorkDateS1 = []
  3080. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3081. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3082. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3083. }
  3084. }
  3085. if (this.monthNotWorkDateS1.length > 50) {
  3086. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3087. }else{
  3088. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3089. }
  3090. // if (this.monthNotWorkDateS1.length > 0) {
  3091. // setTimeout(() => {
  3092. // this.tableListenernot()
  3093. // }, 1000);
  3094. // }
  3095. }else{
  3096. this.monthWorkDataS1 = []
  3097. for (let i = 0; i < this.monthWorkData.length; i++) {
  3098. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3099. this.monthWorkDataS1.push(this.monthWorkData[i])
  3100. }
  3101. }
  3102. if (this.monthWorkDataS1.length > 50) {
  3103. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3104. }else{
  3105. this.monthWorkDataS = this.monthWorkDataS1
  3106. }
  3107. // if (this.monthWorkDataS1.length > 0) {
  3108. // setTimeout(() => {
  3109. // this.tableListener()
  3110. // }, 1000);
  3111. // }
  3112. }
  3113. },
  3114. addUpload(data) {
  3115. // var zhi = data.fileName.split('.')[0]
  3116. // var sss = zhi + '.xlsx'
  3117. // return
  3118. var filePath = '/upload/' + data.serverName;
  3119. const a = document.createElement('a'); // 创建a标签
  3120. a.setAttribute('download', data.fileName);// download属性
  3121. a.setAttribute('href', filePath);// href链接
  3122. a.click(); //自执行点击事件
  3123. a.remove();
  3124. },
  3125. restrictNumber(targetId) {
  3126. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3127. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3128. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3129. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3130. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3131. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3132. inpu.value = parseFloat(inpu.value);
  3133. }
  3134. },
  3135. //获取项目下的任务分组
  3136. getTaskGroups(domain, index) {
  3137. domain.groupId=null;
  3138. this.http.post('/task-group/listMyJoinGroup',{
  3139. projectId: domain.projectId,
  3140. isSubstitude: this.isSubstitude ? 1 : 0
  3141. },
  3142. res => {
  3143. if (res.code == "ok") {
  3144. this.workForm.domains[index].taskGroups = res.data;
  3145. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3146. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3147. // this.getGroupStages(domain, index);
  3148. // }
  3149. this.$forceUpdate();
  3150. }
  3151. },
  3152. error => {
  3153. this.$message({
  3154. message: error,
  3155. type: "error"
  3156. });
  3157. }
  3158. );
  3159. },
  3160. //下载填报工时占比报表
  3161. downloadProjectRatio() {
  3162. this.exportUserRatio = true;
  3163. // let now = new Date();
  3164. // let month = now.getMonth();//默认看上个月的
  3165. // let monthStr = month<10? ('0'+month): month;
  3166. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3167. const today = new Date();
  3168. const year = today.getFullYear();
  3169. const month = today.getMonth() + 1;
  3170. let lastMonthYear, lastMonth;
  3171. if (month === 1) {
  3172. lastMonthYear = year - 1;
  3173. lastMonth = 12;
  3174. } else {
  3175. lastMonthYear = year;
  3176. lastMonth = month - 1;
  3177. }
  3178. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3179. console.log('赋值 ==>', this.ratioYmonth)
  3180. },
  3181. confirmDownloadRatio() {
  3182. this.startRatioExporting = true;
  3183. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3184. ymonth: this.ratioYmonth
  3185. },
  3186. res => {
  3187. if (res.code == "ok") {
  3188. this.startRatioExporting = false;
  3189. var filePath = res.data;
  3190. const a = document.createElement('a'); // 创建a标签
  3191. var data = filePath.split("/");
  3192. a.setAttribute('download', data[data.length-1]);// download属性
  3193. a.setAttribute('href', filePath);// href链接
  3194. a.click(); //自执行点击事件
  3195. a.remove();
  3196. } else {
  3197. this.startRatioExporting = false;
  3198. this.$message({
  3199. message: res.msg,
  3200. type: "error"
  3201. });
  3202. }
  3203. },
  3204. error => {
  3205. this.checkinLoading = false;
  3206. this.$message({
  3207. message: error,
  3208. type: "error"
  3209. });
  3210. }
  3211. );
  3212. },
  3213. //下载带企业微信考勤数据的工时统计模板
  3214. downloadCheckInExcel() {
  3215. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3216. startDate: this.importWxParam.date[0],
  3217. endDate: this.importWxParam.date[1],
  3218. },
  3219. res => {
  3220. if (res.code == "ok") {
  3221. var filePath = res.data;
  3222. const a = document.createElement('a'); // 创建a标签
  3223. var data = filePath.split("/");
  3224. a.setAttribute('download', data[data.length-1]);// download属性
  3225. a.setAttribute('href', filePath);// href链接
  3226. a.click(); //自执行点击事件
  3227. a.remove();
  3228. } else {
  3229. this.$message({
  3230. message: res.msg,
  3231. type: "error"
  3232. });
  3233. }
  3234. },
  3235. error => {
  3236. this.checkinLoading = false;
  3237. this.$message({
  3238. message: error,
  3239. type: "error"
  3240. });
  3241. }
  3242. );
  3243. },
  3244. pre() {
  3245. if (this.active == 0) return;
  3246. this.active--;
  3247. },
  3248. next() {
  3249. this.active++;
  3250. },
  3251. triggerTotalTime(index) {
  3252. var item = this.checkinList[index];
  3253. var total = 0.0;
  3254. for (var i=0;i<this.projectColumns.length; i++) {
  3255. var key = this.projectColumns[i];
  3256. if (item[key] != null && item[key] != '') {
  3257. total += parseFloat(item[key]);
  3258. }
  3259. }
  3260. item.totalFillTime = total;
  3261. },
  3262. //提交批量代填的数据
  3263. submitBatchSubFillData() {
  3264. var data = JSON.stringify(this.checkinList);
  3265. this.http.post('/user-corpwx-time/submitProjectTime',{
  3266. json: data,
  3267. projectColumns: JSON.stringify(this.projectColumns)
  3268. },
  3269. res => {
  3270. if (res.code == "ok") {
  3271. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3272. this.importWxDialog = false;
  3273. }
  3274. },
  3275. error => {
  3276. this.checkinLoading = false;
  3277. this.$message({
  3278. message: error,
  3279. type: "error"
  3280. });
  3281. }
  3282. );
  3283. },
  3284. loadCheckInData() {
  3285. if (this.importWxParam.date == null) {
  3286. this.checkinList = [];
  3287. return;
  3288. }
  3289. this.checkinLoading = true;
  3290. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3291. startDate: this.importWxParam.date[0],
  3292. endDate: this.importWxParam.date[1],
  3293. },
  3294. res => {
  3295. if (res.code == "ok") {
  3296. this.checkinLoading = false;
  3297. this.checkinList = res.data.list;
  3298. this.projectColumns = res.data.projects;
  3299. // 自定义表格会导致表格错乱,需重新计算表格
  3300. this.$nextTick(()=>{
  3301. this.$refs.tab.doLayout()
  3302. })
  3303. }
  3304. },
  3305. error => {
  3306. this.checkinLoading = false;
  3307. this.$message({
  3308. message: error,
  3309. type: "error"
  3310. });
  3311. }
  3312. );
  3313. },
  3314. importCardTime(item) {
  3315. //首先判断文件类型
  3316. let str = item.file.name.split(".");
  3317. let format = str[str.length - 1];
  3318. if (format != "xls" && format != "xlsx") {
  3319. this.$message({
  3320. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3321. type: "error"
  3322. });
  3323. } else {
  3324. this.importingData = true;
  3325. let formData = new FormData();
  3326. formData.append("multipartFile", item.file);
  3327. formData.append("companyId", this.user.companyId);
  3328. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3329. res => {
  3330. this.$refs.uploadCardTime.clearFiles();
  3331. this.importingData = false;
  3332. if (res.code == "ok") {
  3333. //换成弹出框,以免有人等了半天回来啥也没看到
  3334. this.$message({
  3335. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3336. type: "success"
  3337. });
  3338. } else {
  3339. this.$message({
  3340. message: res.msg,
  3341. type: "error"
  3342. });
  3343. }
  3344. },
  3345. error => {
  3346. this.$refs.upload.clearFiles();
  3347. this.listLoading = false;
  3348. this.$message({
  3349. message: error,
  3350. type: "error"
  3351. });
  3352. });
  3353. }
  3354. },
  3355. batchImportWxData(item) {
  3356. //首先判断文件类型
  3357. let str = item.file.name.split(".");
  3358. let format = str[str.length - 1];
  3359. if (format != "xls" && format != "xlsx") {
  3360. this.$message({
  3361. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3362. type: "error"
  3363. });
  3364. } else {
  3365. this.importingData = true;
  3366. let formData = new FormData();
  3367. formData.append("file", item.file);
  3368. formData.append("companyId", this.user.companyId);
  3369. formData.append("withCheckIn", 1);
  3370. this.http.uploadFile('/report/importData', formData,
  3371. res => {
  3372. this.$refs.upload.clearFiles();
  3373. this.showImportResult = true;
  3374. this.importingData = false;
  3375. if (res.code == "ok") {
  3376. //换成弹出框,以免有人等了半天回来啥也没看到
  3377. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3378. this.getReportList();
  3379. this.importWxDialog = false;
  3380. } else {
  3381. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3382. }
  3383. },
  3384. error => {
  3385. this.$refs.upload.clearFiles();
  3386. this.listLoading = false;
  3387. this.$message({
  3388. message: error,
  3389. type: "error"
  3390. });
  3391. });
  3392. }
  3393. },
  3394. batchImportData(item) {
  3395. //首先判断文件类型
  3396. let str = item.file.name.split(".");
  3397. let format = str[str.length - 1];
  3398. if (format != "xls" && format != "xlsx") {
  3399. this.$message({
  3400. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3401. type: "error"
  3402. });
  3403. } else {
  3404. this.importingData = true;
  3405. let formData = new FormData();
  3406. formData.append("file", item.file);
  3407. formData.append("companyId", this.user.companyId);
  3408. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3409. this.http.uploadFile(url, formData,
  3410. res => {
  3411. this.$refs.upload.clearFiles();
  3412. this.importingData = false;
  3413. this.showImportResult = true;
  3414. if (res.code == "ok") {
  3415. //换成弹出框,以免有人等了半天回来啥也没看到
  3416. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3417. this.getReportList();
  3418. this.importWXDialog = false;
  3419. } else {
  3420. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3421. }
  3422. },
  3423. error => {
  3424. this.$refs.upload.clearFiles();
  3425. this.importingData = false;
  3426. this.$message({
  3427. message: error,
  3428. type: "error"
  3429. });
  3430. });
  3431. }
  3432. },
  3433. userssHu() {
  3434. this.http.post('/time-type/getCompanyTimeSetting',{
  3435. companyId: this.user.companyId
  3436. },
  3437. res => {
  3438. if (res.code == "ok") {
  3439. this.yonghuUser = res.data
  3440. }
  3441. },
  3442. error => {
  3443. this.$message({
  3444. message: error,
  3445. type: "error"
  3446. });
  3447. }
  3448. );
  3449. },
  3450. iptBlur(i) {
  3451. if(this.isBatch == 0) {
  3452. return
  3453. }
  3454. var reqParam = {
  3455. startDate: this.workForm.createDate[0],
  3456. endDate: this.workForm.createDate[1]
  3457. };
  3458. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3459. reqParam.userId = this.workForm.userId[0];
  3460. }
  3461. this.http.post('/report/getWorkDays',reqParam,
  3462. res => {
  3463. if (res.code == "ok") {
  3464. this.jsDay = res.data
  3465. this.chuji(i)
  3466. } else {
  3467. this.$message({
  3468. message: res.msg,
  3469. type: "error"
  3470. });
  3471. }
  3472. },
  3473. error => {
  3474. this.$message({
  3475. message: error,
  3476. type: "error"
  3477. });
  3478. }
  3479. );
  3480. //明夷硬编码获取
  3481. if (this.user.company.companyName == this.mingyiName) {
  3482. this.getWorkTimeForMinYi();
  3483. }
  3484. },
  3485. getWorkTimeForMinYi(){
  3486. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3487. startDate: this.workForm.createDate[0],
  3488. endDate: this.workForm.createDate[1]
  3489. },
  3490. res => {
  3491. if (res.code == "ok") {
  3492. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3493. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3494. this.totalReportHours = this.workTimeForMinYi;
  3495. } else {
  3496. this.$message({
  3497. message: res.msg,
  3498. type: "error"
  3499. });
  3500. this.workForm.createDate = [];
  3501. }
  3502. },
  3503. error => {
  3504. this.$message({
  3505. message: error,
  3506. type: "error"
  3507. });
  3508. }
  3509. );
  3510. },
  3511. chuji(i) {
  3512. if(i == 0) {
  3513. this.seleChn(1)
  3514. } else if(i == 1) {
  3515. this.seleChn(0)
  3516. } else if(i == 2) {
  3517. if(this.workForm.domains[0].multiWorktime > 0) {
  3518. this.iptChangs()
  3519. } else {
  3520. this.iptChang()
  3521. }
  3522. } else if(i == 3) {
  3523. this.seleChn(0)
  3524. }
  3525. },
  3526. seleChn(e,domain) {
  3527. if(e == 1) {
  3528. for(var i in this.workForm.domains) {
  3529. if(this.workForm.domains[i].timeType == 0) {
  3530. this.workForm.domains[i].workingTime = 8
  3531. } else {
  3532. this.workForm.domains[i].workingTime = 4
  3533. }
  3534. }
  3535. }
  3536. var quanbu = 0
  3537. var spl = this.workForm.domains
  3538. var zhi = ''
  3539. for(var i in spl) {
  3540. var sp = +spl[i].workingTime + 0
  3541. zhi = this.jsDay * sp
  3542. quanbu = +quanbu + zhi
  3543. }
  3544. this.jsTime = quanbu
  3545. this.totalReportHours = quanbu
  3546. let worktime = this.jsTime
  3547. // 自动计算加班时长
  3548. if(this.isBatch != 0){
  3549. worktime = this.jsTime / this.jsDay
  3550. }
  3551. if(this.user.timeType.fillOvertime && domain){
  3552. let isover = false
  3553. let alltime = 0
  3554. let allover = 0 //此处alltime同上面的worktime
  3555. for(let d in spl){
  3556. if(spl[d].isOvertime){
  3557. isover = true
  3558. allover += spl[d].overtimeHours*1
  3559. }
  3560. alltime += spl[d].workingTime*1
  3561. }
  3562. if(domain.overtimeHours){
  3563. allover = allover - domain.overtimeHours
  3564. }
  3565. if(worktime*1 > this.user.timeType.allday){
  3566. if(isover){
  3567. if(alltime > (allover + this.user.timeType.allday)){
  3568. this.$set(domain,'isOvertime',true)
  3569. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3570. }else{
  3571. this.$set(domain,'isOvertime',false)
  3572. this.$set(domain,'overtimeHours',null)
  3573. if(alltime < (allover + this.user.timeType.allday)){
  3574. let overtime = allover + this.user.timeType.allday - alltime
  3575. for(let pi in spl){
  3576. if(spl[pi].overtimeHours){
  3577. if((overtime - spl[pi].overtimeHours*1) > 0){
  3578. overtime = overtime - spl[pi].overtimeHours*1
  3579. this.$set(spl[pi],'isOvertime',false)
  3580. this.$set(spl[pi],'overtimeHours',null)
  3581. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3582. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3583. break
  3584. }else{
  3585. this.$set(spl[pi],'isOvertime',false)
  3586. this.$set(spl[pi],'overtimeHours',null)
  3587. break
  3588. }
  3589. }
  3590. }
  3591. }
  3592. }
  3593. }else{
  3594. this.$set(domain,'isOvertime',true)
  3595. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3596. }
  3597. }else{
  3598. for(let di in spl){
  3599. this.$set(spl[di],'isOvertime',false)
  3600. this.$set(spl[di],'overtimeHours',null)
  3601. }
  3602. }
  3603. }
  3604. },
  3605. iptChang() {
  3606. var sl = this.workForm.domains
  3607. let timeArr = []
  3608. for(var i in sl) {
  3609. if(sl[i].startTime && sl[i].endTime) {
  3610. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3611. }
  3612. }
  3613. this.getTimeHours(timeArr)
  3614. // for(let j in arrNum) {
  3615. // this.timeJsonStr += arrNum[j]
  3616. // if(flg) {
  3617. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3618. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3619. // }
  3620. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3621. // flg = true
  3622. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3623. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3624. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3625. // }
  3626. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3627. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3628. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3629. // }
  3630. // }
  3631. },
  3632. iptChangs() {
  3633. var sl = this.workForm.domains
  3634. let timeArr = []
  3635. for(var i in sl) {
  3636. for(var j in sl[i].worktimeList){
  3637. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3638. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3639. }
  3640. }
  3641. }
  3642. this.getTimeHours(timeArr)
  3643. },
  3644. // 调用接口或去数据
  3645. getTimeHours(arr) {
  3646. this.http.post('/report/getHoursByTimeRange',{
  3647. timeJsonStr: JSON.stringify(arr)
  3648. },res => {
  3649. if(res.code === 'ok') {
  3650. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3651. } else {
  3652. this.$message({
  3653. message: res.msg,
  3654. type: 'error'
  3655. })
  3656. }
  3657. },err => {
  3658. this.$message({
  3659. message: err,
  3660. type: 'error'
  3661. })
  3662. })
  3663. },
  3664. // 按周填报调用接口计算时间
  3665. async getWeekHoursByTimeRange(timeRange) {
  3666. const url = '/report/getHoursByTimeRange';
  3667. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3668. var that = this;
  3669. return new Promise((resolve, reject) => {
  3670. this.http.post(url, data, function(res) {
  3671. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3672. }, function(err) {
  3673. reject(err);
  3674. });
  3675. });
  3676. },
  3677. removeTimeItem(item, index) {
  3678. item.worktimeList.splice(index, 1);
  3679. this.iptChangs()
  3680. },
  3681. //添加工时
  3682. addNewWorktime(index, item) {
  3683. if(item.worktimeList == null ) {
  3684. item.worktimeList = []
  3685. }
  3686. item.worktimeList.push({});
  3687. },
  3688. //复制项目
  3689. copyProject(index) {
  3690. var leftProgress = 10;
  3691. if (this.reportTimeType.type == 3) {
  3692. //计算已经待分配工时比例
  3693. let array = this.workForm.domains;
  3694. let totalProgress = 0;
  3695. for (var i=0;i<array.length; i++) {
  3696. totalProgress += array[i].progress;
  3697. }
  3698. if (totalProgress < 100) {
  3699. leftProgress = 100 - totalProgress;
  3700. }
  3701. }
  3702. var newIndex = index+1;
  3703. var itemDomain = {
  3704. projectId: this.workForm.domains[index].projectId,
  3705. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3706. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3707. ),
  3708. content: "",
  3709. progress:leftProgress,
  3710. state:2,//2-表示待提交
  3711. };
  3712. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3713. if (this.reportTimeType.type == 0) {
  3714. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3715. var length = this.workForm.domains.length;
  3716. if (length == 2) {
  3717. this.showAddMore = false;
  3718. }
  3719. }
  3720. this.selectProject(itemDomain, newIndex);
  3721. },
  3722. pushWorkTime(reportId){
  3723. let url=''
  3724. if(this.user.timeType.syncSap == 1){
  3725. url='/report/pushProjectReportToSap'
  3726. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3727. var pushDate = this.date + day;
  3728. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3729. confirmButtonText: this.$t('btn.determine'),
  3730. cancelButtonText: this.$t('btn.cancel'),
  3731. type: 'info'
  3732. }).then(() => {
  3733. const loading = this.$loading({
  3734. lock: true,
  3735. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3736. spinner: 'el-icon-loading',
  3737. background: 'rgba(0, 0, 0, 0.7)'
  3738. });
  3739. this.http.post(url,{
  3740. pushDate: pushDate,
  3741. reportId: reportId
  3742. },res => {
  3743. loading.close();
  3744. if(res.code == 'ok'){
  3745. this.$message({
  3746. type: 'success',
  3747. message: res.data
  3748. });
  3749. }else{
  3750. this.$message({
  3751. type: 'error',
  3752. message: res.msg
  3753. })
  3754. }
  3755. },err => {
  3756. loading.close();
  3757. this.$message({
  3758. type: 'error',
  3759. message: err
  3760. })
  3761. })
  3762. }).catch(() => {
  3763. });
  3764. }else{
  3765. url='/report/pushReportDataToThird'
  3766. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3767. confirmButtonText: this.$t('btn.determine'),
  3768. cancelButtonText: this.$t('btn.cancel'),
  3769. type: 'info'
  3770. }).then(() => {
  3771. const loading = this.$loading({
  3772. lock: true,
  3773. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3774. spinner: 'el-icon-loading',
  3775. background: 'rgba(0, 0, 0, 0.7)'
  3776. });
  3777. this.http.post(url,{
  3778. yearMonth: this.date
  3779. },res => {
  3780. loading.close();
  3781. if(res.code == 'ok'){
  3782. this.$message({
  3783. type: 'success',
  3784. message: this.$t('tuiSongChengGong')
  3785. });
  3786. }else{
  3787. this.$message({
  3788. type: 'error',
  3789. message: res.msg
  3790. })
  3791. }
  3792. },err => {
  3793. loading.close();
  3794. this.$message({
  3795. type: 'error',
  3796. message: err
  3797. })
  3798. })
  3799. }).catch(() => {
  3800. });
  3801. }
  3802. },
  3803. showWorkTime(){
  3804. this.monthWorkTimeDialog = true;
  3805. this.searchKeyword = ''
  3806. this.WorktimeDatepickValue = this.istoMonth()
  3807. if(this.WorktimeDatepickValue.length == 0){
  3808. let newdate = new Date();
  3809. let nowdate = newdate.toLocaleDateString();
  3810. let getauto = this.getAutoWeekDate(nowdate)
  3811. let nowwd = [getauto[0],getauto[6]]
  3812. this.WorktimeDatepickValue = nowwd
  3813. }
  3814. this.showMonthWorkTime()
  3815. },
  3816. handleClick(t,e){
  3817. if (t.name == "second") {
  3818. this.showMonthNotWorkTime()
  3819. }else if(t.name == "first"){
  3820. this.showMonthWorkTime()
  3821. }else if(t.name == "third"){
  3822. this.showMonthWorkTimeReminder()
  3823. }
  3824. },
  3825. //导出员工每日填报工时数
  3826. exportMembWorkHours() {
  3827. this.http.post(
  3828. "/report/exportUserDailyWorkTime",
  3829. {
  3830. // month: this.date,
  3831. startDate: this.WorktimeDatepickValue[0],
  3832. endDate: this.WorktimeDatepickValue[1],
  3833. },
  3834. (res) => {
  3835. if (res.code == "ok") {
  3836. let url = res.data;
  3837. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3838. }
  3839. },
  3840. (error) => {
  3841. this.$message({
  3842. message: error,
  3843. type: "error",
  3844. });
  3845. }
  3846. );
  3847. },
  3848. exportMembWorkHoursReminder() {
  3849. this.http.post(
  3850. "/report/exportUserDailyWorkTimeReminder",
  3851. {
  3852. // month: this.date,
  3853. startDate: this.WorktimeDatepickValue[0],
  3854. endDate: this.WorktimeDatepickValue[1],
  3855. },
  3856. (res) => {
  3857. if (res.code == "ok") {
  3858. let url = res.data;
  3859. this.downloadByA('工时异常表.xlsx', url);
  3860. }
  3861. },
  3862. (error) => {
  3863. this.$message({
  3864. message: error,
  3865. type: "error",
  3866. });
  3867. }
  3868. );
  3869. },
  3870. exportMembNotWorkHours() {
  3871. this.http.post(
  3872. "/report/exportNoReportUserList",
  3873. {
  3874. // month: this.date,
  3875. startDate: this.WorktimeDatepickValue[0],
  3876. endDate: this.WorktimeDatepickValue[1],
  3877. },
  3878. (res) => {
  3879. if (res.code == "ok") {
  3880. let url = res.data;
  3881. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3882. }
  3883. },
  3884. (error) => {
  3885. this.$message({
  3886. message: error,
  3887. type: "error",
  3888. });
  3889. }
  3890. );
  3891. },
  3892. downloadByA(name, url) {
  3893. const a = document.createElement("a"); // 创建a标签
  3894. a.setAttribute("download", name); // download属性
  3895. a.setAttribute("href", url); // href链接
  3896. a.click(); // 自执行点击事件
  3897. a.remove();
  3898. },
  3899. // 是否本月判断
  3900. istoMonth(){
  3901. let todate = new Date()
  3902. let tomonth = todate.getMonth() + 1
  3903. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3904. if(this.date == adate){
  3905. return []
  3906. }else{
  3907. let sedate = new Date(this.date)
  3908. let semonth = sedate.getMonth() + 1
  3909. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3910. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3911. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3912. return [sedates1, sedates2]
  3913. }
  3914. },
  3915. showMonthWorkTime() {
  3916. this.monthTotalPage = 0,
  3917. this.tbload = true
  3918. let parameter={
  3919. startDate: this.WorktimeDatepickValue[0],
  3920. endDate: this.WorktimeDatepickValue[1],
  3921. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3922. }
  3923. this.http.post(
  3924. "/report/getUserDailyWorkTime",
  3925. // "/report/getNoReportUserList",
  3926. parameter,
  3927. (res) => {
  3928. if (res.code == "ok") {
  3929. this.tbload = false;
  3930. this.pickDateArray = res.data.days.map(item => {
  3931. return {
  3932. ...item,
  3933. dateStr: item.label.split('/')[0],
  3934. weekStr: item.label.split('/')[1]
  3935. }
  3936. });
  3937. // console.log('dataarray',res.data.days);
  3938. this.monthWorkData = res.data.list;
  3939. // this.monthWorkDataS = this.monthWorkData
  3940. // this.monthWorkDataS1 = res.data.list
  3941. this.monthTotal = res.data.list.length
  3942. if (this.monthWorkData.length > 50) {
  3943. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3944. }else{
  3945. this.monthWorkDataS = this.monthWorkData
  3946. }
  3947. this.searchScreen(0)
  3948. // this.monthWorkDataS = infoList
  3949. // 判断
  3950. // if (this.monthWorkDataS1.length > 0) {
  3951. // setTimeout(() => {
  3952. // this.tableListener()
  3953. // }, 1000);
  3954. // }
  3955. this.$nextTick(function(){
  3956. this.$refs.hasworkTbl.doLayout();
  3957. });
  3958. // this.$forceUpdate()
  3959. }
  3960. },
  3961. (error) => {
  3962. this.tbload = false
  3963. this.$message({
  3964. message: error,
  3965. type: "error",
  3966. });
  3967. }
  3968. );
  3969. },
  3970. showMonthWorkTimeReminder() {
  3971. this.monthTotalPage = 0,
  3972. this.tbload = true
  3973. let parameter={}
  3974. parameter={
  3975. startDate: this.WorktimeDatepickValue[0],
  3976. endDate: this.WorktimeDatepickValue[1],
  3977. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3978. viewValue:this.isReminder?1:0
  3979. }
  3980. this.http.post(
  3981. "/report/getUserDailyWorkTimeReminder",
  3982. parameter,
  3983. (res) => {
  3984. if (res.code == "ok") {
  3985. this.tbload = false;
  3986. this.monthWorkData = res.data.list;
  3987. this.monthTotal = res.data.list.length
  3988. if (this.monthWorkData.length > 50) {
  3989. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3990. }else{
  3991. this.monthWorkDataS = this.monthWorkData
  3992. }
  3993. this.searchScreen(0)
  3994. this.$nextTick(function(){
  3995. this.$refs.hasworkTbl.doLayout();
  3996. });
  3997. }
  3998. },
  3999. (error) => {
  4000. this.tbload = false
  4001. this.$message({
  4002. message: error,
  4003. type: "error",
  4004. });
  4005. }
  4006. );
  4007. },
  4008. // tableListener(){
  4009. // let that = this;
  4010. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4011. // // 添加scroll监听事件
  4012. // dom.addEventListener("scroll", function () {
  4013. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4014. // if (scrollDistance < 2) {
  4015. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4016. // that.monthTotalPage++; //当前页数自增
  4017. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4018. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4019. // var infoList = arrList.splice(
  4020. // that.monthTotalPage * that.monthTotalLages,
  4021. // that.monthTotalLages
  4022. // );
  4023. // // 数据添加
  4024. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4025. // }
  4026. // }
  4027. // })
  4028. // },
  4029. showMonthNotWorkTime() {
  4030. this.monthTotalPage = 0,
  4031. this.tbload = true,
  4032. this.http.post(
  4033. "/report/getNoReportUserList",
  4034. {
  4035. startDate: this.WorktimeDatepickValue[0],
  4036. endDate: this.WorktimeDatepickValue[1],
  4037. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4038. },
  4039. (res) => {
  4040. if (res.code == "ok") {
  4041. this.tbload = false
  4042. this.monthNotWorkDate = res.data;
  4043. // this.monthNotWorkDateS1 = res.data
  4044. this.monthnotTotal = res.data.length
  4045. // 2222111
  4046. if (this.monthNotWorkDate.length > 50) {
  4047. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4048. } else {
  4049. this.monthNotWorkDateS = this.monthNotWorkDate
  4050. }
  4051. this.searchScreen(1)
  4052. // 判断
  4053. // if (this.monthnotworkDateS1.length > 0) {
  4054. // setTimeout(() => {
  4055. // this.tableListenernot()
  4056. // }, 1000);
  4057. // }
  4058. this.$nextTick(function(){
  4059. this.$refs.hasworkTbl2.doLayout();
  4060. });
  4061. }
  4062. },
  4063. (error) => {
  4064. this.tbload = false
  4065. this.$message({
  4066. message: error,
  4067. type: "error",
  4068. });
  4069. }
  4070. );
  4071. },
  4072. // tableListenernot(){
  4073. // let that = this;
  4074. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4075. // dom.addEventListener("scroll", function () {
  4076. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4077. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4078. // if (scrollDistance2 < 2) {
  4079. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4080. // that.monthnotTotalPage++; //当前页数自增
  4081. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4082. // var infoList = arrList.splice(
  4083. // that.monthnotTotalPage * that.monthnotTotalLages,
  4084. // that.monthnotTotalLages
  4085. // );
  4086. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4087. // }
  4088. // }
  4089. // })
  4090. // },
  4091. listScroll(){
  4092. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4093. this.isMore = true
  4094. setTimeout(()=>{
  4095. this.isMore = false
  4096. },1000)
  4097. }else {
  4098. this.isFlag = true
  4099. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4100. this.monthWorkDataS = datalist
  4101. setTimeout(()=>{
  4102. this.isFlag = false
  4103. },300)
  4104. }
  4105. },
  4106. notListScroll(){
  4107. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4108. this.isMore = true
  4109. setTimeout(()=>{
  4110. this.isMore = false
  4111. },1000)
  4112. }else {
  4113. this.isFlag = true
  4114. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4115. this.monthNotWorkDateS = datalist
  4116. // console.log('length',this.monthNotWorkDateS.length)
  4117. setTimeout(()=>{
  4118. this.isFlag = false
  4119. },300)
  4120. }
  4121. },
  4122. getFirstAndLastDay() {
  4123. // 将选定的月份转换为Date对象
  4124. var monthDate = new Date();
  4125. var year = monthDate.getFullYear();
  4126. var month = monthDate.getMonth();
  4127. // 计算起始日和结束日
  4128. var startDay = new Date(year, month, 1);
  4129. var endDay = new Date(year, month + 1, 0);
  4130. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4131. this.WorktimeDatepickValueForMonth=lastmd
  4132. },
  4133. formatDate(date) {
  4134. var year = date.getFullYear();
  4135. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4136. var day = ("0" + date.getDate()).slice(-2);
  4137. return year + "-" + month + "-" + day;
  4138. },
  4139. // 获取默认这zhou日期参数 222
  4140. getLastWeek(e){
  4141. let newdate = new Date()
  4142. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4143. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4144. if(e==1){
  4145. this.WorktimeDatepickValue = lastwd
  4146. this.showMonthWorkTime()
  4147. }else if(e==2){
  4148. this.WorktimeDatepickValue = lastwd
  4149. this.showMonthWorkTimeReminder()
  4150. }else{
  4151. this.WorktimeDatepickValue = lastwd
  4152. this.showMonthNotWorkTime()
  4153. }
  4154. },
  4155. getThisWeek(e){
  4156. let newdate = new Date();
  4157. let nowdate = newdate.toLocaleDateString();
  4158. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4159. if(e==1){
  4160. this.WorktimeDatepickValue = nowwd
  4161. this.showMonthWorkTime()
  4162. }else if(e==2){
  4163. this.WorktimeDatepickValue = nowwd
  4164. this.showMonthWorkTimeReminder()
  4165. }else{
  4166. this.WorktimeDatepickValue = nowwd
  4167. this.showMonthNotWorkTime()
  4168. }
  4169. },
  4170. getDoubleLastWeek(e){
  4171. let newdate = new Date()
  4172. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4173. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4174. if(e==1){
  4175. this.WorktimeDatepickValue = nextwd
  4176. this.showMonthWorkTime()
  4177. }else if(e==2){
  4178. this.WorktimeDatepickValue = nextwd
  4179. this.showMonthWorkTimeReminder()
  4180. }else{
  4181. this.WorktimeDatepickValue = nextwd
  4182. this.showMonthNotWorkTime()
  4183. }
  4184. },
  4185. alreadyAllDate(stime,etime){
  4186. let diffdate = new Array();
  4187. let i=0;
  4188. while(stime<=etime){
  4189. let dateArray = stime.split("-");
  4190. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4191. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4192. let stimewk = this.weekDay[date.getDay()]
  4193. 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')
  4194. 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])
  4195. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4196. let stime_ts = new Date(stime).getTime();
  4197. let next_date = stime_ts + (24*60*60*1000);
  4198. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4199. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4200. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4201. stime = next_dates_y+next_dates_m+next_dates_d;
  4202. i++;
  4203. }
  4204. return diffdate
  4205. },
  4206. getAutoWeekDate(e) {
  4207. let dateString = e;
  4208. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4209. if (dateString.match(dateStringReg)) {
  4210. let presentDate = new Date(dateString),
  4211. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4212. return Array.from(new Array(7), function (val, index) {
  4213. let formatDate = new Date(
  4214. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4215. );
  4216. return (
  4217. formatDate.getFullYear() +
  4218. "-" +
  4219. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4220. "-" +
  4221. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4222. );
  4223. });
  4224. } else {
  4225. throw new Error(
  4226. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4227. );
  4228. }
  4229. },
  4230. onProgressChange() {
  4231. this.$forceUpdate();
  4232. },
  4233. showChooseMembTree() {
  4234. this.chosenMembCount = this.participator.length;
  4235. this.chooseParticipVisible = true;
  4236. },
  4237. onTreeItemChange() {
  4238. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4239. var list = chosenList.filter(item=>item.isUser == 1);
  4240. this.chosenMembCount = list.length;
  4241. },
  4242. findUserInTree() {
  4243. if (this.filterName == '') {
  4244. this.deptMembData = this.allMembData;
  4245. } else {
  4246. var list = this.findRecursively(this.filterName, this.allMembData);
  4247. this.deptMembData = list;
  4248. }
  4249. },
  4250. findRecursively(username, list) {
  4251. var filterList = [];
  4252. for (var i=0;i<list.length; i++) {
  4253. if (list[i].isUser == 1) {
  4254. if (list[i].label.indexOf(username) >= 0) {
  4255. //匹配上了
  4256. filterList.push(list[i]);
  4257. }
  4258. } else if (list[i].children != null && list[i].children.length > 0) {
  4259. var subList = this.findRecursively(username, list[i].children);
  4260. if (subList.length > 0) {
  4261. subList.forEach(s=>filterList.push(s));
  4262. }
  4263. }
  4264. }
  4265. return filterList;
  4266. },
  4267. //确定选择参与人
  4268. chooseParticip() {
  4269. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4270. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4271. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4272. if (this.user.company.packageProject == 1) {
  4273. if (this.chosenMembList.length > 1) {
  4274. this.$message({
  4275. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4276. type: "error",
  4277. });
  4278. return;
  4279. }
  4280. }
  4281. this.chooseParticipVisible = false;
  4282. this.workForm.userNames = '';
  4283. this.workForm.userId = [];
  4284. this.participator = [];
  4285. for (var i=0;i<this.chosenMembList.length; i++) {
  4286. this.workForm.userId.push(this.chosenMembList[i].id);
  4287. this.workForm.userNames += this.chosenMembList[i].label+',';
  4288. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4289. this.participator.push(item);
  4290. }
  4291. if (this.workForm.userNames.length > 0) {
  4292. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4293. }
  4294. if(this.user.userNameNeedTranslate == 1) {
  4295. if(this.workForm.userNames) {
  4296. this.workForm.userNames = this.workForm.userNames.split(',')
  4297. }
  4298. }
  4299. },
  4300. notifySel(sel){
  4301. // console.log(sel);
  4302. this.notifySelList = sel
  4303. },
  4304. //微信通知人员填写
  4305. Notify(code) {
  4306. if (this.notifySelList.length == 0) return;
  4307. var ids = '';
  4308. this.notifySelList.forEach(f=>{
  4309. ids += f.id+',';
  4310. })
  4311. this.http.post('/user/pushFillReport',{
  4312. ids: ids, date: this.curDate,
  4313. code: code
  4314. },
  4315. res => {
  4316. if (res.code == "ok") {
  4317. this.$message({
  4318. message: this.$t('message.sentSuccessfully'),
  4319. type: "success"
  4320. });
  4321. }
  4322. },
  4323. error => {
  4324. this.$message({
  4325. message: error,
  4326. type: "error"
  4327. });
  4328. }
  4329. );
  4330. },
  4331. //导出人员列表
  4332. exportMemb() {
  4333. if (this.fillMembList.length == 0) return;
  4334. var ids = '';
  4335. this.fillMembList.forEach(f=>{
  4336. ids += f.id+',';
  4337. })
  4338. this.http.post('/user/exportMembList',{
  4339. ids: ids,isFill: this.isFill, date: this.curDate
  4340. },
  4341. res => {
  4342. if (res.code == "ok") {
  4343. var aTag = document.createElement('a');
  4344. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4345. aTag.href = res.data;
  4346. aTag.click();
  4347. }
  4348. },
  4349. error => {
  4350. this.$message({
  4351. message: error,
  4352. type: "error"
  4353. });
  4354. }
  4355. );
  4356. },
  4357. showMembList(fill) {
  4358. this.membListVisible = true;
  4359. if (fill == 0) {
  4360. this.fillMembList = this.unFillList;
  4361. this.isFill = false;
  4362. let leaveList = []
  4363. let unleaveList = []
  4364. for(let i in this.fillMembList){
  4365. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4366. leaveList.push(this.fillMembList[i])
  4367. }else{
  4368. unleaveList.push(this.fillMembList[i])
  4369. }
  4370. }
  4371. this.fillMembList = unleaveList
  4372. this.fillMembList_leave = leaveList
  4373. } else if(fill == 1){
  4374. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4375. this.isFill = true;
  4376. }else{
  4377. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4378. this.isFill = true;
  4379. }
  4380. },
  4381. //获取自己填写的日报状态
  4382. getReportFillStatus() {
  4383. this.http.post('/report/getReportFillStatus',{
  4384. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4385. },
  4386. res => {
  4387. if (res.code == "ok") {
  4388. this.fillStatusList = res.data;
  4389. this.allDate.forEach(d=>{
  4390. var fillInfo = null;
  4391. d.state = null;
  4392. this.fillStatusList.forEach(s=>{
  4393. var d1 = s.createDate.split('-')[2];
  4394. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4395. if (d1.indexOf('0') == 0) {
  4396. d1 = d1.substring(1,d1.length);
  4397. }
  4398. if (d1 == d2) {
  4399. d.state = s.state;
  4400. d.missReport = s.missReport;//是否漏填
  4401. d.exceedCardTime = s.exceedCardTime
  4402. }
  4403. })
  4404. })
  4405. this.$forceUpdate();
  4406. }
  4407. },
  4408. error => {
  4409. this.$message({
  4410. message: error,
  4411. type: "error"
  4412. });
  4413. }
  4414. );
  4415. },
  4416. scrollFunction () {
  4417. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4418. if (this.domObj.attachEvent) { // IE
  4419. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4420. } else if (this.domObj.addEventListener) {
  4421. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4422. }
  4423. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4424. },
  4425. mouseScroll(event) { // google 浏览器下
  4426. let detail = event.wheelDelta || event.detail
  4427. let moveForwardStep = -1
  4428. let moveBackStep = 1
  4429. let step = 0
  4430. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4431. event.preventDefault() // 阻止浏览器默认事件
  4432. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4433. },
  4434. // //左右滚动
  4435. // wheel(e){
  4436. // var a = document.getElementById("dateScroll");
  4437. // var scroll_width = 80; //滚动一下的距离
  4438. // var e = e || window.event, v;
  4439. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4440. // if(v>3||-v>3) v=-v;
  4441. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4442. // e.preventDefault(); //阻止浏览器的默认滚动
  4443. // },
  4444. showExportDialog() {
  4445. this.exportType = 0
  4446. this.exportDialog = true;
  4447. },
  4448. showExportTimeDialog() {
  4449. this.exportTimeDialog = true;
  4450. },
  4451. changeAllTime() {
  4452. //总时长发生改变,自动按比例计算
  4453. this.workForm.domains.forEach(d=>{
  4454. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4455. });
  4456. //计算jsTime
  4457. if (this.workForm.createDate) {
  4458. let sdate = new Date(this.workForm.createDate[0]);
  4459. let edate = new Date(this.workForm.createDate[1]);
  4460. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4461. console.log('days===', days)
  4462. if (days < 0) {
  4463. days = 0;
  4464. }
  4465. this.jsTime = this.reportTimeType.allday * days;
  4466. }
  4467. },
  4468. // 是否加班的单机事件
  4469. check() {
  4470. this.selected = !this.selected
  4471. this.isNew = this.selected
  4472. },
  4473. updateSubProject() {
  4474. this.$forceUpdate();
  4475. },
  4476. selectDegreeId(domain, index) {
  4477. this.http.post('/report/defaultDegree',{
  4478. projectId: domain.projectId
  4479. },
  4480. res => {
  4481. if (res.code == "ok") {
  4482. if(res.data) {
  4483. this.workForm.domains[index].degreeId = res.data.id + ''
  4484. this.$forceUpdate();
  4485. }
  4486. }
  4487. },
  4488. error => {
  4489. this.$message({
  4490. message: error,
  4491. type: "error"
  4492. });
  4493. }
  4494. );
  4495. },
  4496. //项目选中了, 加载子项目
  4497. selectProject(domain, index) {
  4498. if(!domain.projectId){
  4499. return;
  4500. }
  4501. // 默认选中上次填写的自定义维度
  4502. if(this.yonghuUser.customDegreeActive == 1) {
  4503. this.selectDegreeId(domain, index)
  4504. }
  4505. // console.log('projectId===',domain.projectId);
  4506. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4507. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4508. this.http.post('/sub-project/list',{
  4509. projectId: domain.projectId,
  4510. isReport: true
  4511. },
  4512. res => {
  4513. //清空之前选中的子项目
  4514. // this.workForm.domains[index].subProjectId = 0;
  4515. if (res.code == "ok") {
  4516. this.workForm.domains[index].subProjectList = res.data;
  4517. this.workForm.domains[index].subProjectId = null;
  4518. this.$forceUpdate();
  4519. }
  4520. },
  4521. error => {
  4522. this.$message({
  4523. message: error,
  4524. type: "error"
  4525. });
  4526. }
  4527. );
  4528. //项目相关的近期任务
  4529. if (this.user.company.packageProject == 1) {
  4530. this.getRecentTaskList(domain, index);
  4531. //获取项目相关专业
  4532. if (this.user.company.packageEngineering == 1) {
  4533. this.getProjectProfessions(domain, index);
  4534. }
  4535. //获取项目下的任务分组
  4536. this.getTaskGroups(domain, index);
  4537. }
  4538. // 获取项目相关的维度
  4539. // domain.degreeId = null
  4540. this.$set(domain,'degreeId',null)
  4541. this.$set(domain,'multiDegrIdArray',null)
  4542. this.dimension(domain, index);
  4543. //获取项目审核人
  4544. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4545. this.getProjectAuditorList(domain, index);
  4546. } else {
  4547. //按分组的负责人来审核
  4548. domain.projectAuditorId = null;
  4549. domain.projectAuditorName = null;
  4550. domain.auditUserList = null;
  4551. }
  4552. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4553. if (this.reportTimeType.type == 3) {
  4554. //新增项目时,自动计算
  4555. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4556. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4557. }
  4558. //加载昱众的工作职责
  4559. if (this.user.companyId == this.yuzhongCompId) {
  4560. this.updateResponse(domain);
  4561. }
  4562. },
  4563. getRecentTaskList(domain, index) {
  4564. //刷新任务时,清空服务
  4565. this.$set(domain, 'sapServiceId', null);
  4566. this.$set(domain, 'taskId', null);
  4567. var param = {
  4568. projectId: domain.projectId,
  4569. isSubstitude:this.isSubstitude?1:0,
  4570. };
  4571. if (domain.groupId) {
  4572. param.groupId = domain.groupId;
  4573. }
  4574. if (domain.stage) {
  4575. param.stage = domain.stage;
  4576. }
  4577. //专业版代填,获取代填员工的任务
  4578. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4579. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4580. this.$message({
  4581. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4582. type: "error"
  4583. });
  4584. return;
  4585. } else {
  4586. param.userId = this.workForm.userId[0];
  4587. }
  4588. }
  4589. this.http.post('/task/getRecentTask',param,
  4590. res => {
  4591. if (res.code == "ok") {
  4592. this.workForm.domains[index].allTaskList = res.data;
  4593. this.workForm.domains[index].taskList = res.data;
  4594. this.$forceUpdate();
  4595. }
  4596. },
  4597. error => {
  4598. this.$message({
  4599. message: error,
  4600. type: "error"
  4601. });
  4602. }
  4603. );
  4604. },
  4605. //获取项目审核人
  4606. getProjectAuditorList(domainItem, index) {
  4607. if(domainItem.projectId == '') {
  4608. return
  4609. }
  4610. domainItem.projectAuditorId = null;
  4611. domainItem.projectAuditorName = null;
  4612. this.http.post('/project-auditor/getList',{
  4613. projectId: domainItem.projectId,
  4614. },
  4615. res => {
  4616. if (res.code == "ok") {
  4617. domainItem.auditUserList = res.data;
  4618. if (res.data.length==0) {
  4619. this.$message({
  4620. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4621. type: "error"
  4622. });
  4623. } else if (res.data.length==1) {
  4624. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4625. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4626. }
  4627. this.$forceUpdate();
  4628. }
  4629. },
  4630. error => {
  4631. this.$message({
  4632. message: error,
  4633. type: "error"
  4634. });
  4635. }
  4636. );
  4637. },
  4638. // 获取维度数据
  4639. dimension(domain, index) {
  4640. if(domain.projectId == '') {
  4641. return
  4642. }
  4643. this.http.post('/project/getDegreeList',{
  4644. projectId: domain.projectId,
  4645. },
  4646. res => {
  4647. if (res.code == "ok") {
  4648. // console.log("维度数据",res.data);
  4649. this.workForm.domains[index].wuduList = res.data
  4650. // this.workForm = this.workForm
  4651. this.$forceUpdate()
  4652. }
  4653. },
  4654. error => {
  4655. this.$message({
  4656. message: error,
  4657. type: "error"
  4658. });
  4659. }
  4660. );
  4661. },
  4662. //切换任务阶段
  4663. changeStages(domain, index) {
  4664. if (domain.stage == null || domain.stage == '') {
  4665. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4666. } else {
  4667. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4668. }
  4669. this.getRecentTaskList(domain, index);
  4670. this.$forceUpdate();
  4671. },
  4672. getGroupStages(domain, index, keepStage) {
  4673. // console.log(domain);
  4674. if(!domain.groupId){
  4675. domain.projectAuditorId = ''
  4676. domain.stages = []
  4677. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4678. domain.taskId = ''
  4679. domain.sapServiceId = ''
  4680. }
  4681. if(this.user.timeType.reportAuditType >= 1){
  4682. domain.auditUserList = []
  4683. }
  4684. this.$forceUpdate();
  4685. return
  4686. }
  4687. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4688. res => {
  4689. if (res.code == "ok") {
  4690. if (!keepStage) {
  4691. domain.stage = '';
  4692. }
  4693. domain.stages = res.data;
  4694. this.getRecentTaskList(domain, index);
  4695. this.$forceUpdate();
  4696. }
  4697. },
  4698. error => {
  4699. this.$message({
  4700. message: error,
  4701. type: "error"
  4702. });
  4703. });
  4704. //检查当前的项目是否需要获取分组的负责人
  4705. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4706. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4707. res => {
  4708. if (res.code == "ok") {
  4709. domain.getProjectAuditorList = res.data;
  4710. domain.auditUserList = res.data;
  4711. if (res.data.length==1) {
  4712. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4713. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4714. } else if (res.data.length==0) {
  4715. domain.projectAuditorId = null;
  4716. domain.projectAuditorName = null;
  4717. }
  4718. this.$forceUpdate();
  4719. }
  4720. },
  4721. error => {
  4722. this.$message({
  4723. message: error,
  4724. type: "error"
  4725. });
  4726. });
  4727. }
  4728. },
  4729. getProjectProfessions(domain, index) {
  4730. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4731. res => {
  4732. if (res.code == "ok") {
  4733. this.workForm.domains[index].professionProgress = res.data;
  4734. this.$forceUpdate();
  4735. }
  4736. },
  4737. error => {
  4738. this.$message({
  4739. message: error,
  4740. type: "error"
  4741. });
  4742. });
  4743. },
  4744. //删除自己的日报
  4745. deleteReport() {
  4746. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4747. confirmButtonText: this.$t('btn.determine'),
  4748. cancelButtonText: this.$t('btn.cancel'),
  4749. type: "warning"
  4750. })
  4751. .then(() => {
  4752. this.listLoading = true;
  4753. this.http.post('/report/delete',{
  4754. userId: this.user.id,
  4755. date: this.workForm.createDate
  4756. },
  4757. res => {
  4758. this.listLoading = false;
  4759. if (res.code == "ok") {
  4760. this.$message({
  4761. message: this.$t('message.successfullyDeleted'),
  4762. type: "success"
  4763. });
  4764. this.getReportList();
  4765. this.getDepartment();
  4766. this.dialogVisible = false;
  4767. } else {
  4768. this.$message({
  4769. message: res.msg,
  4770. type: "error"
  4771. });
  4772. }
  4773. },
  4774. error => {
  4775. this.listLoading = false;
  4776. this.$message({
  4777. message: error,
  4778. type: "error"
  4779. });
  4780. }
  4781. );
  4782. })
  4783. .catch(() => {});
  4784. },
  4785. // 管理员删除日报
  4786. guanli(item) {
  4787. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4788. let param = {date: this.date + day, userId: item.id};
  4789. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4790. confirmButtonText: this.$t('btn.determine'),
  4791. cancelButtonText: this.$t('btn.cancel'),
  4792. type: "warning"
  4793. })
  4794. .then(() => {
  4795. this.listLoading = true;
  4796. this.http.post('/report/delete',param,
  4797. res => {
  4798. this.listLoading = false;
  4799. if (res.code == "ok") {
  4800. this.$message({
  4801. message: this.$t('message.successfullyDeleted'),
  4802. type: "success"
  4803. });
  4804. this.getReportList();
  4805. this.getDepartment();
  4806. this.dialogVisible = false;
  4807. } else {
  4808. this.$message({
  4809. message: res.msg,
  4810. type: "error"
  4811. });
  4812. }
  4813. },
  4814. error => {
  4815. this.listLoading = false;
  4816. this.$message({
  4817. message: error,
  4818. type: "error"
  4819. });
  4820. }
  4821. );
  4822. })
  4823. .catch(() => {});
  4824. },
  4825. selectAll() {
  4826. if (this.isAllSelect) {
  4827. var keys = [];
  4828. this.reportNames.forEach(b=>{
  4829. keys.push(b.id);
  4830. })
  4831. this.$refs.approveTree.setCheckedKeys(keys);
  4832. } else {
  4833. this.$refs.approveTree.setCheckedKeys([]);
  4834. }
  4835. },
  4836. removeEmptyNode(list) {
  4837. for (var i=0;i<list.length;i++) {
  4838. var cnt = 0;
  4839. if (list[i].membCount == 0) {
  4840. list.splice(i, 1);
  4841. i--;
  4842. } else if (list[i].children != null) {
  4843. this.removeEmptyNode(list[i].children);
  4844. }
  4845. }
  4846. },
  4847. calculateMembCount(list) {
  4848. for (var i in list) {
  4849. var cnt = 0;
  4850. if (list[i].children != null) {
  4851. this.calculateMembCount(list[i].children);
  4852. for (var m in list[i].children) {
  4853. cnt += list[i].children[m].membCount;
  4854. }
  4855. }
  4856. if (list[i].isUser == 1) {
  4857. cnt++;
  4858. this.membCount++;
  4859. }
  4860. list[i].membCount = cnt;
  4861. }
  4862. },
  4863. stateChange() {
  4864. // console.log(this.allData,'alldate');
  4865. this.membCount = 0;
  4866. if (this.selectState == -1) {
  4867. //全部状态
  4868. this.data = this.allData;
  4869. } else {
  4870. //未填报
  4871. this.seluserText = ''
  4872. var newData = JSON.parse(JSON.stringify(this.allData));
  4873. this.filterState(this.selectState, newData);
  4874. this.data = newData;
  4875. }
  4876. this.calculateMembCount(this.data);
  4877. this.data[0].membCount = this.membCount;//总人数
  4878. },
  4879. //按状态过滤部门人员
  4880. filterState(state, list) {
  4881. for (var i =0;i<list.length; i++) {
  4882. var obj = list[i];
  4883. if (obj.isUser == 1) {
  4884. var match = false;
  4885. if (state == -2) {
  4886. if (obj.state == null) {
  4887. match = true;
  4888. }
  4889. } else {
  4890. if (obj.state == state) {
  4891. match = true;
  4892. }
  4893. }
  4894. if (!match) {
  4895. list.splice(i, 1);
  4896. i--;
  4897. } else {
  4898. }
  4899. } else {
  4900. if (obj.children != null) {
  4901. this.filterState(state, obj.children);
  4902. }
  4903. }
  4904. }
  4905. },
  4906. //a按名称过滤部门人员
  4907. async seluserforText(){
  4908. const { userNameNeedTranslate } = this.user
  4909. this.membCount = 0;
  4910. var newData = JSON.parse(JSON.stringify(this.allData));
  4911. let textList = [this.seluserText]
  4912. if(userNameNeedTranslate == 1) {
  4913. this.dataLoading = true
  4914. let res = await this.postData('/user/getEmployeeList', {
  4915. keyword: this.seluserText,
  4916. cursor: '',
  4917. departmentId: -1,
  4918. pageIndex: 1,
  4919. pageSize: 1000
  4920. })
  4921. textList = res.data.records.map(item => item.name)
  4922. this.dataLoading = false
  4923. }
  4924. // return
  4925. console.log(textList, '<=== textList')
  4926. this.seluserforTextin(this.seluserText, newData, textList)
  4927. console.log(newData, 'Data')
  4928. this.data = newData;
  4929. this.calculateMembCount(this.data);
  4930. this.data[0].membCount = this.membCount;//总人数
  4931. },
  4932. seluserforTextin(text, list, textList = []){
  4933. for (var i =0;i<list.length; i++) {
  4934. var obj = list[i];
  4935. if (obj.isUser == 1) {
  4936. var match = false;
  4937. // if (obj.label.indexOf(text) != -1) {
  4938. // match = true
  4939. // }
  4940. if(textList.some(item => item.includes(obj.label))) {
  4941. match = true
  4942. }
  4943. if (!match) {
  4944. list.splice(i, 1);
  4945. i--;
  4946. } else {
  4947. }
  4948. } else {
  4949. if (obj.children != null) {
  4950. this.seluserforTextin(text, obj.children, textList);
  4951. }
  4952. }
  4953. }
  4954. },
  4955. // 当节点发生变化时
  4956. nodeChangeExpand(data) {
  4957. // 保存当前展开的节点
  4958. let flag = false
  4959. this.nodeModelData.some(item => {
  4960. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4961. flag = true
  4962. return true
  4963. }
  4964. })
  4965. if (!flag) { // 不存在则存到数组里
  4966. this.nodeModelData.push(data.id)
  4967. }
  4968. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4969. },
  4970. nodeChangeCollapse(data) {
  4971. console.log(this.nodeModelData)
  4972. this.nodeModelData.some((item, i) => {
  4973. if (item === data.id) {
  4974. this.nodeModelData.length = i
  4975. }
  4976. })
  4977. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4978. },
  4979. // 部门列表点击
  4980. handleNodeClick(data) {
  4981. // this.dealList = data
  4982. this.theValues(data.id, this.allData)
  4983. // this.depData = data;
  4984. var list = [];
  4985. if (data.id == -1) {
  4986. this.deptId = null;
  4987. this.targetUid = null;
  4988. list = this.data;
  4989. } else if (data.isUser == 1) {
  4990. this.deptId = null;
  4991. this.targetUid = data.id;
  4992. } else {
  4993. this.deptId = data.id;
  4994. this.targetUid = null;
  4995. list.push(data);
  4996. }
  4997. this.getReportList();
  4998. if (list.length > 0) {
  4999. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5000. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5001. }
  5002. },
  5003. exportPushLog(){
  5004. this.http.post('/sap-sync-log/export',{},
  5005. res => {
  5006. if (res.code == "ok") {
  5007. var filePath = res.data;
  5008. var fName = '推送日志.xlsx'
  5009. const a = document.createElement('a'); // 创建a标签
  5010. a.setAttribute('download', fName);// download属性
  5011. a.setAttribute('href', filePath);// href链接
  5012. a.click(); //自执行点击事件
  5013. a.remove();
  5014. } else {
  5015. this.$message({
  5016. message: res.msg,
  5017. type: "error"
  5018. });
  5019. }
  5020. },
  5021. error => {
  5022. this.$message({
  5023. message: error,
  5024. type: "error"
  5025. });
  5026. });
  5027. },
  5028. theValues(id, item) {
  5029. for(var i in item) {
  5030. if(item[i].id == id) {
  5031. this.depData = item[i]
  5032. if(id == '-1') {
  5033. this.translation = '1'
  5034. } else {
  5035. if(item[i].children) {
  5036. this.translation = '2'
  5037. } else {
  5038. this.translation = '3'
  5039. }
  5040. }
  5041. return
  5042. } else {
  5043. if(item[i].children) {
  5044. this.theValues(id, item[i].children)
  5045. }
  5046. }
  5047. }
  5048. },
  5049. //获取可以选择的代填的人员列表
  5050. getSubstitudeUserDeptList() {
  5051. if (this.deptMembData.length == 0) {
  5052. this.http.post("/department/listMyMembs", {},
  5053. res => {
  5054. if (res.code == "ok") {
  5055. let noAllData = JSON.parse(JSON.stringify(res.data));
  5056. if (noAllData.length > 0) {
  5057. // if (noAllData[0].label == '全部人员') {
  5058. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5059. noAllData.splice(0,1);
  5060. }
  5061. }
  5062. this.setUserToDept(noAllData);
  5063. this.deptMembData = noAllData;
  5064. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5065. console.log(this.deptMembData, '代填人员数据')
  5066. } else {
  5067. this.$message({
  5068. message: res.msg,
  5069. type: "error"
  5070. });
  5071. }
  5072. },
  5073. error => {
  5074. this.$message({
  5075. message: error,
  5076. type: "error"
  5077. });
  5078. });
  5079. }
  5080. },
  5081. // 获取部门列表
  5082. getDepartmentForApprove() {
  5083. this.http.post( this.port.manage.depList, {},
  5084. res => {
  5085. if (res.code == "ok") {
  5086. var list1 = JSON.parse(JSON.stringify(res.data));
  5087. this.deptOptionList = this.changeArr(list1);
  5088. console.log(this.deptOptionList, '部门')
  5089. } else {
  5090. this.$message({
  5091. message: res.msg,
  5092. type: "error"
  5093. });
  5094. }
  5095. },
  5096. error => {
  5097. this.$message({
  5098. message: error,
  5099. type: "error"
  5100. });
  5101. });
  5102. },
  5103. // 获取部门列表
  5104. getDepartment() {
  5105. //如果没有权限,就不需要获取
  5106. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5107. return;
  5108. }
  5109. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5110. var param = {date:this.date + day};
  5111. this.http.post("/report/getMembList", param,
  5112. res => {
  5113. if (res.code == "ok") {
  5114. if(res.data.length == 0){
  5115. return
  5116. }
  5117. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5118. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5119. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5120. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5121. // if (this.user.role > 0) {
  5122. // }
  5123. list.splice(0,0,{
  5124. id: -1,
  5125. label: this.$t('lable.allStaff'),
  5126. })
  5127. this.membCount = 0;
  5128. //设置员工到部门下面
  5129. this.setUserToDept(list);
  5130. this.data = list;
  5131. // console.log('data',this.data);
  5132. this.expandDate = [this.data[1].id]
  5133. this.allData = list;
  5134. // if (noAllData.length > 0) {
  5135. // if (noAllData[0].label == '全部人员') {
  5136. // noAllData.splice(0,1);
  5137. // }
  5138. // }
  5139. // this.setUserToDept(noAllData);
  5140. // this.deptMembData = noAllData;
  5141. this.option = this.changeArr(list1);
  5142. list[0].membCount = this.membCount;
  5143. if (this.depData.id == -1) {
  5144. this.depData.membCount = this.membCount;
  5145. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5146. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5147. } else {
  5148. if (this.depData.isUser == null) {
  5149. var dep = this.findTargetDept(this.data, this.depData.id);
  5150. var membDeptList = [];
  5151. membDeptList.push(dep);
  5152. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5153. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5154. }
  5155. }
  5156. if (this.depData.isUser == null) {
  5157. if (this.isFill) {
  5158. this.fillMembList = this.fillList;
  5159. } else {
  5160. this.fillMembList = this.unFillList;
  5161. }
  5162. }
  5163. this.leaveAllNum = 0
  5164. for(let i in this.unFillList){
  5165. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5166. this.leaveAllNum += 1
  5167. }
  5168. }
  5169. this.stateChange()
  5170. } else {
  5171. this.$message({
  5172. message: res.msg,
  5173. type: "error"
  5174. });
  5175. }
  5176. },
  5177. error => {
  5178. this.$message({
  5179. message: error,
  5180. type: "error"
  5181. });
  5182. });
  5183. this.getReportFillStatus();
  5184. },
  5185. findTargetDept(list, deptId) {
  5186. var t = null;
  5187. for (var i=0;i<list.length; i++) {
  5188. if (list[i].isUser == null && list[i].id == deptId) {
  5189. t = list[i];
  5190. break;
  5191. }
  5192. }
  5193. if (t == null) {
  5194. for (var i=0;i<list.length; i++) {
  5195. if (list[i].children != null && list[i].children.length > 0) {
  5196. t = this.findTargetDept(list[i].children, deptId);
  5197. if (t != null) {
  5198. break;
  5199. }
  5200. }
  5201. }
  5202. }
  5203. return t;
  5204. },
  5205. getUserMembListFromDeptList(list, isFill) {
  5206. var membList = [];
  5207. for (var i in list) {
  5208. var deptName = list[i].label;
  5209. if (list[i].userList != null) {
  5210. list[i].userList.forEach(element => {
  5211. if (isFill == 0) {
  5212. //获取未填的
  5213. if (element.state == null) {
  5214. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5215. membList.push(obj);
  5216. }
  5217. } else {
  5218. if (element.state != null) {
  5219. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5220. membList.push(obj);
  5221. }
  5222. }
  5223. });
  5224. }
  5225. if (list[i].children != null) {
  5226. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5227. }
  5228. }
  5229. return membList;
  5230. },
  5231. setUserToDept(list) {
  5232. for (var i in list) {
  5233. var cnt = 0;
  5234. if (list[i].children != null) {
  5235. this.setUserToDept(list[i].children);
  5236. for (var m in list[i].children) {
  5237. cnt += list[i].children[m].membCount;
  5238. }
  5239. }
  5240. if (list[i].userList != null) {
  5241. if (list[i].children == null) {
  5242. list[i].children = [];
  5243. }
  5244. list[i].userList.forEach(element => {
  5245. var obj = {
  5246. id: element.id,
  5247. label:element.name,
  5248. state:element.state,
  5249. parentId:element.departmentId,
  5250. isUser:1,
  5251. workingTime: element.workingTime,
  5252. leaveDays: element.leaveDays,
  5253. leaveTimes: element.leaveTimes
  5254. };
  5255. list[i].children.push(obj);
  5256. this.membCount++;
  5257. cnt++;
  5258. });
  5259. }
  5260. list[i].membCount = cnt;
  5261. }
  5262. },
  5263. // 修改数组
  5264. changeArr(arr) {
  5265. for (var i = 0; i < arr.length; i++) {
  5266. if(arr[i].id != -1 && arr[i].id != 0) {
  5267. if (arr[i].children != null && arr[i].children.length>0) {
  5268. arr[i].children = this.changeArr(arr[i].children);
  5269. }
  5270. arr[i].id && (arr[i].value = arr[i].id);
  5271. delete arr[i].id;
  5272. }
  5273. }
  5274. for(var i in arr) {
  5275. if(arr[i].id == -1 || arr[i].id == 0) {
  5276. arr.splice(i,1)
  5277. }
  5278. }
  5279. return arr;
  5280. },
  5281. //时间段范围设置改动,监听
  5282. onTimeTypeChange(timeType) {
  5283. this.seleChn(1)
  5284. this.showAddMore = true;
  5285. for(var i in this.workForm.domains) {
  5286. if (this.workForm.domains[i].timeType == 0) {
  5287. this.showAddMore = false;
  5288. break;
  5289. }
  5290. }
  5291. if (this.showAddMore) {
  5292. //检测数量
  5293. if (this.workForm.domains.length == 2) {
  5294. this.showAddMore = false;
  5295. } else {
  5296. this.showAddMore = true;
  5297. }
  5298. }
  5299. },
  5300. getTimeType() {
  5301. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5302. res => {
  5303. if (res.code == "ok") {
  5304. var t = res.data;
  5305. this.reportTimeType = t;
  5306. if (this.reportTimeType.type > 0) {
  5307. this.showAddMore = true;
  5308. }
  5309. //转化时间格式
  5310. if (t.allday != null) {
  5311. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5312. }
  5313. if (t.am != null) {
  5314. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5315. }
  5316. if (t.pm != null) {
  5317. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5318. }
  5319. let arr = []
  5320. for(var i in res.data.excludeTimeList) {
  5321. let obj = {
  5322. s: res.data.excludeTimeList[i].startTime,
  5323. e: res.data.excludeTimeList[i].endTime,
  5324. }
  5325. arr.push(obj)
  5326. }
  5327. this.vacationTime = arr
  5328. } else {
  5329. this.$message({
  5330. message: res.msg,
  5331. type: "error"
  5332. });
  5333. }
  5334. },
  5335. error => {
  5336. this.listLoading = false;
  5337. this.$message({
  5338. message: error,
  5339. type: "error"
  5340. });
  5341. });
  5342. },
  5343. // 改变月份 -------
  5344. changeMonthOut() {
  5345. this.getAllDate();
  5346. this.getReportList();
  5347. this.getDepartment();
  5348. },
  5349. // 选择日期
  5350. choseDate(i, item) {
  5351. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5352. return
  5353. }
  5354. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5355. this.choseDay = i;
  5356. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5357. sessionStorage.msg = this.date + day,
  5358. this.getReportList();
  5359. this.getDepartment();
  5360. this.curDate = item.date;
  5361. },
  5362. canClick(i, item){
  5363. let nowDate = new Date()
  5364. let nowDateYear = nowDate.getFullYear()
  5365. let itemYear = parseInt(this.date.split('-')[0])
  5366. let nowDateMonth = nowDate.getMonth() + 1
  5367. let itemMonth = parseInt(this.date.split('-')[1])
  5368. let nowDateDay = nowDate.getDate()
  5369. let itemDay = parseInt(item.showDate.split('.')[1])
  5370. if(nowDateYear < itemYear){
  5371. return false
  5372. }else if(nowDateYear == itemYear){
  5373. if(nowDateMonth < itemMonth){
  5374. return false
  5375. }else if(nowDateMonth == itemMonth){
  5376. if(nowDateDay < itemDay){
  5377. return false
  5378. }
  5379. }
  5380. }
  5381. },
  5382. // 获取日期列表
  5383. getAllDate(e) {
  5384. var dayArry = [];
  5385. var day = this.getCountDays();
  5386. let curMonthDay = null;
  5387. for (var k = 1; k <= day; k++) {
  5388. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5389. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5390. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5391. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5392. if(sessionStorage.msg) {
  5393. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5394. this.choseDay = k - 1;
  5395. curMonthDay = str;
  5396. }
  5397. } else {
  5398. if (new Date().getDate() == k) {
  5399. this.choseDay = k - 1;
  5400. }
  5401. }
  5402. } else {
  5403. this.choseDay = 0;
  5404. }
  5405. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5406. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5407. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5408. }
  5409. this.allDate = dayArry;
  5410. //不能超过最大日期
  5411. if (this.choseDay > day-1) {
  5412. this.choseDay = day-1;
  5413. }
  5414. if(sessionStorage.from != 1){
  5415. let nowmonth = new Date().getMonth() + 1
  5416. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5417. let nowdate = new Date().getDate()
  5418. if(nowd == this.date){
  5419. if(e && sessionStorage.msg){
  5420. }else{
  5421. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5422. }
  5423. let nowday = new Date(sessionStorage.msg).getDate()
  5424. this.choseDay = nowday - 1
  5425. let monthdate = new Date(sessionStorage.msg)
  5426. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5427. }else{
  5428. if(e && sessionStorage.msg){
  5429. }else{
  5430. sessionStorage.msg = this.date + '-01'
  5431. }
  5432. let monthdate = new Date(sessionStorage.msg)
  5433. this.choseDay = monthdate.getDate() - 1
  5434. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5435. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5436. }
  5437. }else{
  5438. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5439. }
  5440. //从消息点击跳转过来的,直接加载指定日期
  5441. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5442. this.curDate = sessionStorage.msg;
  5443. sessionStorage.from = 0;
  5444. } else {
  5445. // if (curMonthDay != null) {
  5446. // // this.curDate = curMonthDay;
  5447. // let d = new Date(sessionStorage.msg)
  5448. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5449. // } else {
  5450. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5451. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5452. // }
  5453. }
  5454. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5455. // if(!sessionStorage.msg){
  5456. // let msgday = this.choseDay + 1
  5457. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5458. // }
  5459. this.getReportFillStatus();
  5460. },
  5461. getCountDays() {
  5462. var newstr = this.date.replace(/-/g, "/");
  5463. var curDate = new Date(newstr+'/01');
  5464. var curMonth = curDate.getMonth();
  5465. curDate.setMonth(curMonth + 1);
  5466. curDate.setDate(0);
  5467. return curDate.getDate();
  5468. },
  5469. reqMore() {
  5470. if (this.hasMore) {
  5471. this.pageIndex++;
  5472. this.requestHttpReports();
  5473. }
  5474. },
  5475. //加载日报数据
  5476. requestHttpReports() {
  5477. //请求数据
  5478. this.listLoading = true;
  5479. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5480. let param = {date: this.date + day};
  5481. if (this.deptId) {
  5482. param.deptId = this.deptId;
  5483. }
  5484. if (this.targetUid) {
  5485. param.userId = this.targetUid;
  5486. }
  5487. //传页码
  5488. if (this.hasMore) {
  5489. param.pageIndex = this.pageIndex;
  5490. }
  5491. this.http.post( this.port.report.list, param,
  5492. res => {
  5493. this.listLoading = false;
  5494. if (res.code == "ok") {
  5495. //扩增
  5496. if (res.data.data.length > 0) {
  5497. this.reportList = this.reportList.concat(res.data.data);
  5498. } else if (this.pageIndex > 1){
  5499. this.$message({
  5500. message: this.$t('meiYouGengDuoShuJuLe'),
  5501. type: "info"
  5502. });
  5503. }
  5504. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5505. if(document.querySelector("#day"+this.choseDay)){
  5506. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5507. }
  5508. } else {
  5509. this.$message({
  5510. message: res.msg,
  5511. type: "error"
  5512. });
  5513. }
  5514. },
  5515. error => {
  5516. this.listLoading = false;
  5517. this.$message({
  5518. message: error,
  5519. type: "error"
  5520. });
  5521. });
  5522. },
  5523. //获取日报列表
  5524. getReportList() {
  5525. //初始化,重置数据
  5526. this.pageIndex = 0;
  5527. this.hasMore = true;
  5528. this.reportList = [];
  5529. this.requestHttpReports();
  5530. },
  5531. //刷新日报状态,用于审核后更新
  5532. refreshReportData(reportId) {
  5533. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5534. res => {
  5535. if (res.code == "ok") {
  5536. for (var m=0;m<this.reportList.length; m++) {
  5537. var d = this.reportList[m].data;
  5538. var find = d.filter(r=>r.id == reportId);
  5539. if (find.length > 0) {
  5540. find[0].state = res.data.state;
  5541. if (find[0].state == 2) {//被驳回,要可以编辑
  5542. this.reportList[m].state = 2;
  5543. }
  5544. find[0].isDeptAudit = res.data.isDeptAudit;
  5545. find[0].departmentAuditState = res.data.departmentAuditState;
  5546. find[0].projectAuditorName = res.data.projectAuditorName;
  5547. find[0].projectAuditorId = res.data.projectAuditorId;
  5548. find[0].projectAuditState = res.data.projectAuditState;
  5549. find[0].rejectUserid = res.data.rejectUserid;
  5550. find[0].rejectUsername = res.data.rejectUsername;
  5551. find[0].rejectReason = res.data.rejectReason;
  5552. this.$forceUpdate();
  5553. break;
  5554. }
  5555. }
  5556. } else {
  5557. this.$message({
  5558. message: res.msg,
  5559. type: "error"
  5560. });
  5561. }
  5562. },
  5563. error => {
  5564. this.listLoading = false;
  5565. this.$message({
  5566. message: error,
  5567. type: "error"
  5568. });
  5569. });
  5570. },
  5571. //导出员工工时统计
  5572. exportUserTime() {
  5573. this.listLoading = true;
  5574. var param = {};
  5575. if (this.exportParam.dateRange != null) {
  5576. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5577. }
  5578. this.http.post('/department/exportDeptStatistic', param,
  5579. res => {
  5580. this.listLoading = false;
  5581. if (res.code == "ok") {
  5582. location.href = res.data;
  5583. this.exportTimeDialog = false;
  5584. } else {
  5585. this.$message({
  5586. message: res.msg,
  5587. type: "error"
  5588. });
  5589. }
  5590. },
  5591. error => {
  5592. this.listLoading = false;
  5593. this.$message({
  5594. message: error,
  5595. type: "error"
  5596. });
  5597. });
  5598. },
  5599. //导出日报
  5600. exportReport() {
  5601. this.exportingData = true;
  5602. var param = {};
  5603. if (this.exportParam.dateRange != null) {
  5604. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5605. }
  5606. if (this.exportParam.projectId != null) {
  5607. param.projectId = this.exportParam.projectId;
  5608. }
  5609. if (this.exportParam.departmentId != null) {
  5610. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5611. param.departmentIds = this.exportParam.departmentId.join(',')
  5612. }
  5613. param.stateKey = this.stateKey
  5614. // param.departmentId = this.user.departmentId
  5615. console.log(param, '《=== 导出传的参数');
  5616. console.log('开始调用exportReport接口');
  5617. this.http.post(this.port.report.export, param,
  5618. res => {
  5619. this.exportingData = false;
  5620. if (res.code == "ok") {
  5621. var filePath = res.data;
  5622. const a = document.createElement('a'); // 创建a标签
  5623. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5624. a.setAttribute('href', filePath);// href链接
  5625. a.click(); //自执行点击事件
  5626. a.remove();
  5627. this.exportDialog = false;
  5628. } else {
  5629. this.$message({
  5630. message: res.msg,
  5631. type: "error"
  5632. });
  5633. }
  5634. },
  5635. error => {
  5636. this.exportingData = false;
  5637. this.$message({
  5638. message: error,
  5639. type: "error"
  5640. });
  5641. });
  5642. },
  5643. //导出日报审核记录
  5644. exportReportLog() {
  5645. this.exportingData = true;
  5646. var param = {};
  5647. if (this.exportReportLogParam.dateRange != null) {
  5648. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5649. }
  5650. this.http.post('/report-log/exportReportLog', param,
  5651. res => {
  5652. this.exportingData = false;
  5653. if (res.code == "ok") {
  5654. var filePath = res.data;
  5655. const a = document.createElement('a'); // 创建a标签
  5656. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5657. a.setAttribute('href', filePath);// href链接
  5658. a.click(); //自执行点击事件
  5659. a.remove();
  5660. this.exportDialog = false;
  5661. } else {
  5662. this.$message({
  5663. message: res.msg,
  5664. type: "error"
  5665. });
  5666. }
  5667. },
  5668. error => {
  5669. this.exportingData = false;
  5670. this.$message({
  5671. message: error,
  5672. type: "error"
  5673. });
  5674. });
  5675. },
  5676. restUserCardTime(item){
  5677. let param={}
  5678. param.userId=item.userId
  5679. param.createDate=item.createDate
  5680. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5681. res => {
  5682. if (res.code == "ok") {
  5683. this.showMonthWorkTimeReminder()
  5684. } else {
  5685. this.$message({
  5686. message: res.msg,
  5687. type: "error"
  5688. });
  5689. }
  5690. },
  5691. error => {
  5692. this.$message({
  5693. message: error,
  5694. type: "error"
  5695. });
  5696. });
  5697. },
  5698. importReportLog(item){
  5699. //首先判断文件类型
  5700. let str = item.file.name.split(".");
  5701. let format = str[str.length - 1];
  5702. if (format != "xls" && format != "xlsx") {
  5703. this.$message({
  5704. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5705. type: "error"
  5706. });
  5707. } else {
  5708. const loading = this.$loading({
  5709. lock: true,
  5710. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5711. spinner: 'el-icon-loading',
  5712. background: 'rgba(0, 0, 0, 0.7)'
  5713. });
  5714. let formData = new FormData();
  5715. formData.append("multipartFile", item.file);
  5716. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5717. res => {
  5718. this.$refs.upload.clearFiles();
  5719. loading.close();
  5720. if (res.code == "ok") {
  5721. this.$message({
  5722. message: res.msg,
  5723. type: "success"
  5724. });
  5725. } else {
  5726. this.$message({
  5727. message: res.msg,
  5728. type: "error"
  5729. });
  5730. }
  5731. },
  5732. error => {
  5733. this.$refs.upload.clearFiles();
  5734. loading.close();
  5735. this.$message({
  5736. message: error,
  5737. type: "error"
  5738. });
  5739. });
  5740. }
  5741. },
  5742. //获取项目列表
  5743. getProjectList() {
  5744. this.listLoading = true;
  5745. this.http.post( this.port.project.list, {},
  5746. res => {
  5747. this.listLoading = false;
  5748. if (res.code == "ok") {
  5749. for(var i in res.data) {
  5750. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5751. res.data[i].projectCode = ''
  5752. }
  5753. }
  5754. this.projectList = res.data;
  5755. console.log("项目列表",this.projectList);
  5756. } else {
  5757. this.$message({
  5758. message: res.msg,
  5759. type: "error"
  5760. });
  5761. }
  5762. },
  5763. error => {
  5764. this.listLoading = false;
  5765. this.$message({
  5766. message: error,
  5767. type: "error"
  5768. });
  5769. });
  5770. },
  5771. // 获取填报日报的项目下拉列表
  5772. getFillProjectList() {
  5773. this.http.post( this.port.project.list, {
  5774. forReport: 1
  5775. },res => {
  5776. if (res.code == "ok") {
  5777. for(var i in res.data) {
  5778. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5779. res.data[i].projectCode = ''
  5780. }
  5781. }
  5782. this.fillProjectList = res.data;
  5783. this.getRecentlyProject()
  5784. } else {
  5785. this.$message({
  5786. message: res.msg,
  5787. type: "error"
  5788. });
  5789. }
  5790. },
  5791. error => {
  5792. this.$message({
  5793. message: error,
  5794. type: "error"
  5795. });
  5796. });
  5797. },
  5798. getBasecostItemList() {
  5799. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5800. companyId: this.user.companyId
  5801. },
  5802. res => {
  5803. if (res.code == "ok") {
  5804. this.timeBasecostList = res.data;
  5805. }
  5806. });
  5807. },
  5808. getAIReport(createDate) {
  5809. this.http.post('/report/getAIReport', {},
  5810. res => {
  5811. if (res.code == "ok") {
  5812. var quanbu = 0
  5813. this.jsDay = 1
  5814. var zhi = ''
  5815. var slp = res.data
  5816. for(var i in slp) {
  5817. var sp = +slp[i].workingTime + 0
  5818. zhi = this.jsDay * sp
  5819. quanbu = +quanbu + zhi
  5820. }
  5821. this.jsTime = quanbu
  5822. var aiReportData = res.data;
  5823. this.canCancelInDialog = false
  5824. if(aiReportData.length != 0) {
  5825. var arr = [];
  5826. for(var i in aiReportData) {
  5827. arr.push({
  5828. id: null,
  5829. projectId: aiReportData[i].projectId,
  5830. workingTime: aiReportData[i].workingTime,
  5831. content: '',
  5832. progress:100,
  5833. state: 2,
  5834. timeType: aiReportData[i].timeType,
  5835. subProjectList: aiReportData[i].subProjectList,
  5836. taskList: aiReportData[i].taskList,
  5837. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5838. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5839. taskId: aiReportData[i].taskId,
  5840. startTime: aiReportData[i].startTime,
  5841. endTime: aiReportData[i].endTime,
  5842. isOvertime: 0,
  5843. progress:aiReportData[i].progress,
  5844. professionProgress: aiReportData[i].professionProgressList,
  5845. stages:aiReportData[i].stages,
  5846. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5847. pics: null,
  5848. multiWorktime: aiReportData[i].multiWorktime || 0,
  5849. worktimeList: [{}],
  5850. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5851. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5852. wuduList: aiReportData[i].degreeList,
  5853. taskGroups:aiReportData[i].taskGroups,
  5854. customData: aiReportData[i].customData,//自定义的数值
  5855. auditUserList: aiReportData[i].auditUserList,
  5856. projectAuditorId: aiReportData[i].projectAuditorId,
  5857. projectAuditorName: aiReportData[i].projectAuditorName,
  5858. overtimeHours: aiReportData[i].overtimeHours,
  5859. customText: aiReportData[i].customText,
  5860. basecostId: aiReportData[i].basecostId,
  5861. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5862. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5863. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5864. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5865. canEdit: true
  5866. })
  5867. }
  5868. this.workForm.domains = arr;
  5869. } else {
  5870. }
  5871. this.canEdit = true;
  5872. this.originCanEdit = true;
  5873. this.seleChn()
  5874. } else {
  5875. this.$message({
  5876. message: res.msg,
  5877. type: "error"
  5878. });
  5879. }
  5880. },
  5881. error => {
  5882. this.$message({
  5883. message: error,
  5884. type: "error"
  5885. });
  5886. });
  5887. },
  5888. // 获取个人某天的日报 111111
  5889. getReport() {
  5890. this.http.post( this.port.report.getPort, {
  5891. date: this.workForm.createDate
  5892. },
  5893. res => {
  5894. if (res.code == "ok") {
  5895. var quanbu = 0
  5896. this.jsDay = 1
  5897. var zhi = ''
  5898. var slp = res.data.report
  5899. for(var i in slp) {
  5900. var sp = +slp[i].workingTime + 0
  5901. zhi = this.jsDay * sp
  5902. quanbu = +quanbu + zhi
  5903. }
  5904. this.jsTime = quanbu
  5905. var list = res.data;
  5906. this.report = list;
  5907. this.reportTimeType = this.report.timeType;
  5908. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5909. this.isWeekend = !this.report.isWorkDay;
  5910. this.canCancelInDialog = false;
  5911. this.hasWrittenReport = list.report.length != 0;
  5912. if(list.report.length != 0) {
  5913. var arr = [];
  5914. this.canEdit = false;
  5915. let candelete = true
  5916. for(var i in list.report) {
  5917. var flg = null
  5918. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5919. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5920. var filteredRespList = null
  5921. if (targetP.length > 0) {
  5922. var isPublic = targetP[0].isPublic;
  5923. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5924. }
  5925. arr.push({
  5926. id: list.report[i].id,
  5927. projectId: list.report[i].projectId,
  5928. workingTime: list.report[i].workingTime,
  5929. content: list.report[i].content,
  5930. state: list.report[i].state,
  5931. timeType: list.report[i].timeType,
  5932. subProjectList: list.report[i].subProjectList,
  5933. taskList: list.report[i].taskList,
  5934. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5935. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5936. taskId: list.report[i].taskId,
  5937. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5938. startTime: list.report[i].startTime,
  5939. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5940. endTime: list.report[i].endTime,
  5941. isOvertime: flg,
  5942. progress:list.report[i].progress,
  5943. professionProgress: list.report[i].professionProgressList,
  5944. stages:list.report[i].stages,
  5945. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5946. pics: list.report[i].pics,
  5947. multiWorktime: list.report[i].multiWorktime,
  5948. worktimeList: list.report[i].worktimeList,
  5949. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5950. multiDegrIdArray: list.report[i].multiDegrIdList,
  5951. wuduList: list.report[i].degreeList,
  5952. taskGroups:list.report[i].taskGroups,
  5953. customData: list.report[i].customData,//自定义的数值
  5954. auditUserList: list.report[i].auditUserList,
  5955. projectAuditorId: list.report[i].projectAuditorId,
  5956. projectAuditorName: list.report[i].projectAuditorName,
  5957. overtimeHours: list.report[i].overtimeHours,
  5958. customText: list.report[i].customText,
  5959. basecostId: list.report[i].basecostId,
  5960. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5961. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5962. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5963. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5964. canEdit: list.report[i].state >= 2 ? true : false,
  5965. extraField1: list.report[i].extraField1,
  5966. extraField2: list.report[i].extraField2,
  5967. extraField3: list.report[i].extraField3,
  5968. workContentList: list.report[i].workContentList,
  5969. filteredRespList: filteredRespList,
  5970. serviceList: list.report[i].serviceList,
  5971. sapServiceId: list.report[i].sapServiceId,
  5972. reportTargetDeptId: list.report[i].deptId
  5973. })
  5974. if (list.report[i].state >= 2) {
  5975. this.canEdit = true;
  5976. }
  5977. if(list.report[i].state < 2){
  5978. candelete = false
  5979. }
  5980. if (list.report[i].state == 0){
  5981. this.canCancelInDialog = true
  5982. }
  5983. // 加判断
  5984. if(this.user.timeType.choseFromAlbum == 1) {
  5985. let arrList = []
  5986. for(var k in list.report[i].pics) {
  5987. let obj = {
  5988. name: k,
  5989. url: list.report[i].pics[k]
  5990. }
  5991. arrList.push(obj)
  5992. }
  5993. arr[i].imgListUrl = arrList
  5994. arr[i].imgList = list.report[i].pics
  5995. }
  5996. }
  5997. this.reportCanDelete = candelete
  5998. this.workForm = {
  5999. createDate: this.workForm.createDate,
  6000. domains: arr,
  6001. userNames:null,
  6002. userId:null,
  6003. time: list.time,
  6004. showRefresh: list.showRefresh
  6005. }
  6006. console.log('workForm', this.workForm)
  6007. } else {
  6008. this.workForm = {
  6009. createDate: this.workForm.createDate,
  6010. domains: [{
  6011. id: null,
  6012. projectId: "",
  6013. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6014. content: "",
  6015. progress:100,
  6016. state: 2,
  6017. timeType:0,
  6018. multiWorktime: this.reportTimeType.multiWorktime,
  6019. worktimeList:[{}],
  6020. canEdit: true,
  6021. auditorFirst: '',
  6022. auditorSec: '',
  6023. auditorThird: '',
  6024. ccUserid: ''
  6025. }],
  6026. userId:null,
  6027. userNames:null,
  6028. time: this.report.time,
  6029. showRefresh: list.showRefresh
  6030. }
  6031. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6032. this.$set(this.workForm.domains[0],'isOvertime',true)
  6033. if(this.reportTimeType.type != 2){
  6034. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6035. }
  6036. }
  6037. if(this.user.timeType.type == 1) {
  6038. var shuzhi = this.user.timeType.allday + ''
  6039. // console.log('执行一次', shuzhi.indexOf('.'))
  6040. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6041. }
  6042. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6043. //默认给第一个,必填字段
  6044. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6045. }
  6046. this.canEdit = true;
  6047. }
  6048. this.originCanEdit = this.canEdit;
  6049. this.seleChn()
  6050. } else {
  6051. this.$message({
  6052. message: res.msg,
  6053. type: "error"
  6054. });
  6055. }
  6056. },
  6057. error => {
  6058. this.$message({
  6059. message: error,
  6060. type: "error"
  6061. });
  6062. });
  6063. },
  6064. guanbi() {
  6065. this.falsss = false,
  6066. this.workTimeForMinYi=0
  6067. },
  6068. // 打开日报填写
  6069. fillInReport(i, isBatch) {
  6070. this.isWeekend = false
  6071. this.reportCanDelete = false
  6072. // console.log(this.user.timeType.type, '选择时长')
  6073. if(i != 1) {
  6074. this.falsss = false
  6075. } else {
  6076. this.falsss = true
  6077. }
  6078. if (this.isSubstitude) {
  6079. this.getSubstitudeUserDeptList();
  6080. }
  6081. if(i == -1 || this.isSubstitude) {
  6082. this.isDisable = false;
  6083. } else {
  6084. this.isDisable = true;
  6085. }
  6086. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6087. this.isBatch = isBatch;
  6088. if (this.isBatch == 0 && !this.isSubstitude) {
  6089. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6090. let weekday = new Date(this.workForm.createDate).getDay()
  6091. if(this.user.companyId == 817){
  6092. if(weekday == 0){
  6093. this.isWeekend = true
  6094. }
  6095. }else{
  6096. if(weekday == 0 || weekday == 6){
  6097. this.isWeekend = true
  6098. }
  6099. }
  6100. this.getReport(i);
  6101. } else {
  6102. // console.log('执行到了这里')
  6103. this.jsTime = 0
  6104. this.jsDay = 0
  6105. this.workForm = {
  6106. createDate: null,//批量填报没有日期
  6107. domains: [{
  6108. id: null,
  6109. projectId: "",
  6110. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6111. content: "",
  6112. progress:100,
  6113. state: 2,
  6114. timeType:0,
  6115. multiWorktime: this.reportTimeType.multiWorktime,
  6116. worktimeList:[{}],
  6117. canEdit: true,
  6118. }],
  6119. }
  6120. if(this.user.timeType.type == 1) {
  6121. var shuzhi = this.user.timeType.allday + ''
  6122. // console.log('执行二次')
  6123. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6124. }
  6125. // console.log(this.workForm)
  6126. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6127. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6128. }
  6129. this.canEdit = true;
  6130. }
  6131. this.dialogVisible = true;
  6132. },
  6133. //按周填报的弹窗口中编辑单项目相关数据
  6134. setWeekFormReportItem(reportId, i, names, row,sss) {
  6135. console.log(sss)
  6136. this.http.post('/report/getReportById', {
  6137. reportId: reportId
  6138. },
  6139. res => {
  6140. if (res.code == "ok") {
  6141. var data = res.data.report;
  6142. sss.subProjectId = data.subProjectId
  6143. sss.subProjectList = data.subProjectList;
  6144. sss.stage = data.stage
  6145. sss.subProjectList = data.subProjectList
  6146. sss.stages = data.stages
  6147. sss.taskGroups = data.taskGroups;
  6148. sss.auditUserList = data.auditUserList;
  6149. sss.degreeId = data.degreeId;
  6150. sss.customData = data.customData;
  6151. sss.wuduList = data.degreeList;
  6152. this.zhoBaoIdx = i
  6153. this.zhoBaoName = names
  6154. this.zhoBao = sss
  6155. this.zhis = row
  6156. if (sss.groupId) {
  6157. //最后一个参数表示是否保留stage的值,不要重置为空
  6158. this.getGroupStages(this.zhoBao, 0, true)
  6159. }
  6160. this.$forceUpdate();
  6161. }
  6162. });
  6163. },
  6164. // 按周填报里内容的填写
  6165. showWeekItemEdit(item, i, projectId,names, row) {
  6166. if (item.state == 0) {
  6167. this.$message({
  6168. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6169. type: "error"
  6170. });
  6171. return;
  6172. }
  6173. if (item.state == 1) {
  6174. this.$message({
  6175. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6176. type: "error"
  6177. });
  6178. return;
  6179. }
  6180. if(this.user.timeType.notAllowedNoAttendance == 1){
  6181. if(this.zhoData[i].corpTime){
  6182. if(this.zhoData[i].corpTime.workHours == 0){
  6183. this.$message({
  6184. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6185. type: 'error'
  6186. })
  6187. return
  6188. }
  6189. }else{
  6190. this.$message({
  6191. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6192. type: 'error'
  6193. })
  6194. return
  6195. }
  6196. }
  6197. var obj = {}
  6198. obj.projectId = projectId
  6199. this.tianxieDialogVisible = true
  6200. this.scopess = item
  6201. var sss = {}
  6202. if (item.id != null) {
  6203. sss.id = item.id;
  6204. sss.state = item.state;
  6205. } else {
  6206. sss.id = -1;
  6207. sss.state = 3;
  6208. }
  6209. sss.projectId = projectId;
  6210. sss.progress = item.progress
  6211. sss.time = item.time
  6212. sss.content = item.content;
  6213. console.log('333', sss.content)
  6214. if (sss.time == '' && this.reportTimeType.type == 2) {
  6215. //取已填时间范围中最大的一个作为开始时间
  6216. var startTime = '09:00';
  6217. var fillStartTime = '00:00';
  6218. for (var t in this.selProjectList) {
  6219. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6220. if (fillItem.time) {
  6221. if (fillItem.time[1] > fillStartTime) {
  6222. fillStartTime = fillItem.time[1];
  6223. }
  6224. }
  6225. }
  6226. if (fillStartTime == '00:00') {
  6227. fillStartTime = '09:00';
  6228. }
  6229. var fillEndMax = '18:00';
  6230. if (fillStartTime >= '18:00') {
  6231. fillEndMax = '23:59';
  6232. }
  6233. sss.time = [fillStartTime, fillEndMax];
  6234. }
  6235. sss.groupId = item.groupId
  6236. sss.stage = item.stage;
  6237. sss.workingTime = item.workingTime
  6238. sss.projectAuditorId = item.projectAuditorId;
  6239. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6240. //默认选中第一个
  6241. sss.basecostId = this.timeBasecostList[0].id;
  6242. }
  6243. var hasEdited = this.zhoData[i][names].hasEdited;
  6244. if (hasEdited) {
  6245. sss = { ...item }
  6246. //编辑过了
  6247. sss.subProjectId = item.subProjectId
  6248. sss.stage = item.stage
  6249. sss.subProjectList = item.subProjectList
  6250. sss.stages = item.stages
  6251. sss.taskGroups = item.taskGroups;
  6252. console.log(sss.taskGroups, '33333');
  6253. sss.auditUserList = obj.auditUserList;
  6254. sss.degreeId = item.degreeId;
  6255. sss.customData = item.customData;
  6256. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6257. //只有一个审核人,自动设置上去
  6258. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6259. }
  6260. sss.wuduList = item.wuduList;
  6261. this.zhoBaoIdx = i
  6262. this.zhoBaoName = names
  6263. this.zhoBao = sss
  6264. this.zhis = row
  6265. if (sss.groupId) {
  6266. //最后一个参数表示是否保留stage的值,不要重置为空
  6267. this.getGroupStages(this.zhoBao, 0, true)
  6268. }
  6269. this.$forceUpdate();
  6270. this.getWeeklyTaskList(sss)
  6271. console.log('最后的周报 ===>', this.zhoBao)
  6272. } else {
  6273. //第一次打开,获取数据
  6274. if (sss.id == -1) {
  6275. //新填报的
  6276. this.selectProject(obj, 0);
  6277. var that = this
  6278. setTimeout(() =>{
  6279. sss.subProjectId = that.workForm.domains[0].subProjectId
  6280. sss.subProjectList = item.subProjectList;
  6281. sss.stage = that.workForm.domains[0].stage
  6282. sss.subProjectList = that.workForm.domains[0].subProjectList
  6283. sss.stages = that.workForm.domains[0].stages
  6284. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6285. sss.auditUserList = obj.auditUserList;
  6286. sss.degreeId = item.degreeId;
  6287. sss.customData = item.customData;
  6288. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6289. //只有一个审核人,自动设置上去
  6290. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6291. }
  6292. sss.wuduList = row[0].wuduList
  6293. that.zhoBaoIdx = i
  6294. that.zhoBaoName = names
  6295. that.zhoBao = sss
  6296. that.zhis = row
  6297. if (sss.groupId) {
  6298. //最后一个参数表示是否保留stage的值,不要重置为空
  6299. this.getGroupStages(that.zhoBao, 0, false)
  6300. }
  6301. that.$forceUpdate();
  6302. this.getWeeklyTaskList(sss)
  6303. },600);
  6304. } else {
  6305. //编辑填报过的;数据库已经存在的
  6306. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6307. }
  6308. }
  6309. },
  6310. // 按周填报里内容的填写点击确定
  6311. setWeekProItemData() {
  6312. //专业版模式下,任务分组和阶段必填
  6313. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6314. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6315. this.$message({
  6316. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6317. type: "error"
  6318. });
  6319. return;
  6320. }
  6321. }
  6322. // 检查任务分组
  6323. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6324. this.$message({
  6325. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6326. type: "error"
  6327. });
  6328. return
  6329. }
  6330. //检查子项目是否必填
  6331. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6332. this.$message({
  6333. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6334. type: "error"
  6335. });
  6336. return;
  6337. }
  6338. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6339. this.$message({
  6340. message: this.$t('message.Pleaseselectareviewer'),
  6341. type: "error"
  6342. });
  6343. return
  6344. }
  6345. if(this.user.timeType.reportAuditType == 3){
  6346. let auditTips = ''
  6347. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6348. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6349. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6350. if(auditTips){
  6351. auditTips = auditTips.substring(0,auditTips.length - 1)
  6352. this.$message({
  6353. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6354. type: 'error'
  6355. })
  6356. return
  6357. }
  6358. }
  6359. let errtips = ''
  6360. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6361. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6362. errtips += this.user.timeType.customDegreeName + '、'
  6363. }
  6364. }
  6365. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6366. errtips += this.user.timeType.customDataName + '、'
  6367. }
  6368. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6369. errtips += this.user.timeType.customTextName + '、'
  6370. }
  6371. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6372. errtips += this.$t('other.workMatters') +'、'
  6373. }
  6374. if(errtips){
  6375. errtips = errtips.substring(0,errtips.length - 1)
  6376. this.$message({
  6377. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6378. type: 'error'
  6379. })
  6380. return
  6381. }
  6382. this.tianxieDialogVisible = false
  6383. var zhong = this.zhoData
  6384. this.zhoBao.hasEdited = true;
  6385. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6386. this.zhoData = zhong
  6387. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6388. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6389. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6390. },
  6391. // 获取本周
  6392. getCurrentWeek() {
  6393. //今天
  6394. this.targetWeekDate = new Date();
  6395. this.initWeekFormData();
  6396. // this.jiazai()
  6397. },
  6398. // 获取上周
  6399. handleGetPrevWeek() {
  6400. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6401. this.initWeekFormData();
  6402. // this.jiazai()
  6403. },
  6404. // 获取下周
  6405. handleGetNextvWeek() {
  6406. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6407. this.initWeekFormData()
  6408. },
  6409. // 加载动画
  6410. jiazai() {
  6411. this.weekDataLoading = true
  6412. var that = this
  6413. setTimeout(() =>{
  6414. that.weekDataLoading = false
  6415. },1000);
  6416. },
  6417. // 转时间格式
  6418. dealdate(date) {
  6419. const dt = new Date(date)
  6420. const y = dt.getFullYear()
  6421. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6422. const d = (dt.getDate() + '').padStart(2, '0')
  6423. return `${y}-${m}-${d}`
  6424. },
  6425. // 按周填报
  6426. fillInReportss() {
  6427. window.addEventListener('scroll', this.handleScroll, true)
  6428. // this.jiazai()
  6429. this.fillWeekDialogVisi = true;
  6430. if (this.isSubstitude) {
  6431. this.substitudeStep = 1;
  6432. this.getSubstitudeUserDeptList();
  6433. } else {
  6434. this.getCurrentWeek();
  6435. }
  6436. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6437. //重新获取工时预警类型的预算项
  6438. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6439. companyId: this.user.companyId
  6440. },
  6441. res => {
  6442. if (res.code == "ok") {
  6443. this.timeBasecostList = res.data;
  6444. }
  6445. });
  6446. }
  6447. },
  6448. fillInReportCustom() {
  6449. this.weekIndex++
  6450. this.weekParentData = {
  6451. isSubstitude: this.isSubstitude
  6452. }
  6453. this.fillWeekDialogVisiCustom = true
  6454. },
  6455. // 按周填报的项目筛选
  6456. selListFun(){
  6457. this.selProjectList = []
  6458. if(this.selCon.length){
  6459. for (let i = 0; i < this.selCon.length; i++) {
  6460. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6461. }
  6462. this.selConShow = false ;
  6463. for (let i in this.zhoData) {
  6464. var obj = this.zhoData[i];
  6465. for(var j in this.selProjectList) {
  6466. var xinzhi = this.selProjectList[j].projectName
  6467. obj[xinzhi] = {}
  6468. obj[xinzhi].time = ''
  6469. obj[xinzhi].content = ''
  6470. obj[xinzhi].progress = 0
  6471. obj[xinzhi].workingTime = 0
  6472. }
  6473. }
  6474. this.initWeekFormData();
  6475. }else{
  6476. this.$message({
  6477. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6478. type:'error'
  6479. })
  6480. }
  6481. },
  6482. setWeekCardTimeData(list) {
  6483. for(let i in list){
  6484. let datei = '';
  6485. if (this.user.timeType.showDdCardtime == 1) {
  6486. datei = list[i].workDate;
  6487. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6488. datei = list[i].createDate;
  6489. } else if (this.user.timeType.syncFanwei == 1) {
  6490. datei = list[i].workDate;
  6491. }
  6492. for(let m in this.zhoData) {
  6493. if(datei == this.zhoData[m].zhoDataTime){
  6494. let item = {
  6495. startTime: list[i].startTime,
  6496. endTime: list[i].endTime,
  6497. workHours: list[i].workHours
  6498. }
  6499. this.$set(this.zhoData[m],'corpTime',item)
  6500. }
  6501. }
  6502. }
  6503. },
  6504. getWeeklyCardTime(){ //按周填报获取考勤信息
  6505. let dateStr = []
  6506. for(let i in this.zhoData){
  6507. dateStr.push(this.zhoData[i].zhoDataTime)
  6508. }
  6509. this.http.post('/report/getWeeklyCardTime',{
  6510. dateStr: JSON.stringify(dateStr)
  6511. },res => {
  6512. if(res.code == 'ok'){
  6513. for(let i in res.data){
  6514. let datei = '';
  6515. if (this.user.timeType.showDdCardtime == 1) {
  6516. datei = res.data[i].workDate.split('-');
  6517. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6518. datei = res.data[i].createDate.split('-');
  6519. }
  6520. for(let m in this.zhoData){
  6521. let datem = new Date(this.zhoData[m].zhoDataTime)
  6522. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6523. let item = {
  6524. startTime: res.data[i].startTime,
  6525. endTime: res.data[i].endTime,
  6526. workHours: res.data[i].workHours
  6527. }
  6528. this.$set(this.zhoData[m],'corpTime',item)
  6529. }
  6530. }
  6531. }
  6532. }else{
  6533. this.$message({
  6534. message: res.msg,
  6535. type: 'error'
  6536. })
  6537. }
  6538. },err => {
  6539. this.$message({
  6540. message: err,
  6541. type: 'error'
  6542. })
  6543. })
  6544. },
  6545. selListqx(){
  6546. this.fillWeekDialogVisi = false
  6547. this.selProjectList = []
  6548. this.selCon = []
  6549. },
  6550. handleScroll() {
  6551. this.changdu = this.projectList.length + 1
  6552. },
  6553. // 自动选择时间点的事件
  6554. // async zhoTimes(item, i) {
  6555. // var iss = i
  6556. // if(item.time == null) {
  6557. // return
  6558. // } else {
  6559. // const zhi = this.zhoData[iss];
  6560. // let he = 0;
  6561. // const timeArr = Object.values(zhi)
  6562. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6563. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6564. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6565. // console.log(data, 'data');
  6566. // zhi.he = `${he}h`;
  6567. // }
  6568. // },
  6569. async zhoTimes(item, index) {
  6570. const zho = this.zhoData[index];
  6571. if (!item.time) {
  6572. return;
  6573. }
  6574. const timeArr = Object.values(zho)
  6575. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6576. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6577. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6578. zho.he = `${totalHours[0]}h`;
  6579. },
  6580. // 判断两个时间段是否重叠
  6581. timeOverlap(idx, dateAr) {
  6582. let zhi = 0
  6583. for (let k in dateAr) {
  6584. if (idx !== k) {
  6585. 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))) {
  6586. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6587. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6588. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6589. }
  6590. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6591. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6592. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6593. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6594. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6595. } else {
  6596. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6597. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6598. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6599. }
  6600. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6601. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6602. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6603. }
  6604. }
  6605. }
  6606. }
  6607. }
  6608. return zhi
  6609. },
  6610. // 计算时间
  6611. getHourMinutes(str, end) {
  6612. var he = 0
  6613. var date2 = '2021/12/12 ' + end +':00'
  6614. var date1 = '2021/12/12 ' + str +':00'
  6615. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6616. var leave1=date3%(24*3600*1000)
  6617. var hours=Math.floor(leave1/(3600*1000))
  6618. var leave2=leave1%(3600*1000)
  6619. var minutes=Math.floor(leave2/(60*1000))
  6620. var shi = hours+'.'+ minutes
  6621. return he += +shi
  6622. },
  6623. // 自动选择事件长度的事件
  6624. zhoXuan(item, i) {
  6625. var iss = i
  6626. if(item.time == null) {
  6627. return
  6628. } else {
  6629. var zhi = this.zhoData[iss]
  6630. var he = 0
  6631. for(var i in zhi) {
  6632. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6633. he += +zhi[i].workingTime
  6634. }
  6635. }
  6636. zhi.he = he + 'h'
  6637. }
  6638. },
  6639. getPushWorkLogData(){
  6640. this.http.post('/sap-sync-log/list', {},
  6641. res => {
  6642. if (res.code == "ok") {
  6643. this.pushWorkTimeLogData = res.data;
  6644. } else {
  6645. this.$message({
  6646. message: res.msg,
  6647. type: "error"
  6648. });
  6649. }
  6650. },
  6651. error => {
  6652. this.$message({
  6653. message: error,
  6654. type: "error"
  6655. });
  6656. });
  6657. },
  6658. // 获取全部人员
  6659. getUsers() {
  6660. this.http.post('/user/getSimpleActiveUserList', {},
  6661. res => {
  6662. if (res.code == "ok") {
  6663. this.usersList = res.data;
  6664. } else {
  6665. this.$message({
  6666. message: res.msg,
  6667. type: "error"
  6668. });
  6669. }
  6670. },
  6671. error => {
  6672. this.$message({
  6673. message: error,
  6674. type: "error"
  6675. });
  6676. });
  6677. },
  6678. // 按时间比例
  6679. addBli(item, i) {
  6680. var iss = i
  6681. if(item.time == null) {
  6682. return
  6683. } else {
  6684. var zhi = this.zhoData[iss]
  6685. var he = 0
  6686. for(var i in zhi) {
  6687. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6688. he += +zhi[i].workingTime
  6689. }
  6690. }
  6691. zhi.he = he.toFixed(1) + 'h'
  6692. }
  6693. },
  6694. //按周填报选择的项目发生变化,需要设置列
  6695. onSelProjectChange() {
  6696. for (let i = 0; i < this.selCon.length; i++) {
  6697. var exists = false;
  6698. for (let j = 0; j < this.selProjectList.length; j++) {
  6699. if (this.selProjectList[j].id == this.selCon[i]) {
  6700. exists = true;
  6701. break;
  6702. }
  6703. }
  6704. if (!exists) {
  6705. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6706. this.selProjectList.push(newProject);
  6707. //添加新项目
  6708. for (var w in this.zhoData) {
  6709. var dayItem = this.zhoData[w];
  6710. var pName = newProject.projectName;
  6711. dayItem[pName] = {};
  6712. dayItem[pName].time = ''
  6713. dayItem[pName].content = ''
  6714. dayItem[pName].progress = 0
  6715. dayItem[pName].workingTime = 0
  6716. }
  6717. }
  6718. }
  6719. //去掉
  6720. for (let j = 0; j < this.selProjectList.length; j++) {
  6721. var exists = false;
  6722. for (let i = 0; i < this.selCon.length; i++) {
  6723. if (this.selProjectList[j].id == this.selCon[i]) {
  6724. exists = true;
  6725. break;
  6726. }
  6727. }
  6728. if (!exists) {
  6729. this.selProjectList.splice(j, 1);
  6730. j--;
  6731. }
  6732. }
  6733. this.loadFilledWeekReportItem();
  6734. //刷新表格
  6735. // this.$refs.weekTable.doLayout();
  6736. },
  6737. //根据选中的项目来刷新填写表格
  6738. loadFilledWeekReportItem() {
  6739. for (var w in this.zhoData) {
  6740. var dayItem = this.zhoData[w];
  6741. for (var i = 0; i < this.selProjectList.length; i++) {
  6742. var curColumnProject = this.selProjectList[i];
  6743. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6744. for (var t in dayItem.reportList) {
  6745. //有日报的项目,不能取消选择
  6746. for (var p in this.fillProjectList) {
  6747. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6748. }
  6749. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6750. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6751. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6752. if (this.reportTimeType.type == 2) {
  6753. //时间段模式
  6754. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6755. }
  6756. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6757. break;
  6758. }
  6759. }
  6760. // dayItem[curColumnProject.projectName] = matchReportItem;
  6761. }
  6762. }
  6763. this.$nextTick(()=>{
  6764. this.$refs.weekTable.doLayout();
  6765. });
  6766. },
  6767. initWeekFormData() {
  6768. this.weekDataLoading = true;
  6769. for (var p in this.fillProjectList) {
  6770. this.fillProjectList[p].canCancel = 1;
  6771. }
  6772. var param = {
  6773. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6774. };
  6775. if (this.isSubstitude) {
  6776. //传代填人的userId
  6777. param.targetUserId = this.workForm.userId[0];
  6778. }
  6779. this.http.post('/report/getWeeklyReportData',param,res => {
  6780. this.weekDataLoading = false;
  6781. if(res.code == 'ok'){
  6782. let projectList = res.data.projectList;
  6783. if (projectList.length > 0) {
  6784. //有选择过项目进行填报,直接选中
  6785. this.selProjectList = projectList;
  6786. this.selCon = [];
  6787. for (let i = 0; i < projectList.length; i++) {
  6788. this.selCon.push(projectList[i].id);
  6789. }
  6790. }
  6791. //设置日期
  6792. this.weekDateRange = res.data.dateList;
  6793. this.zhoData = [];
  6794. var arrst = []
  6795. for(var i in this.weekDateRange) {
  6796. var obj = {}
  6797. obj.zhoDataTime = this.weekDateRange[i].date
  6798. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6799. obj.he = this.weekDateRange[i].filledTime;
  6800. obj.canFill = this.weekDateRange[i].canFill;
  6801. // obj.filledTime = this.weekDateRange[i].filledTime;
  6802. obj.reportList = this.weekDateRange[i].reportList;
  6803. //初始化,防止渲染报错
  6804. for (var j = 0; j < this.selProjectList.length; j++) {
  6805. var pName = this.selProjectList[j].projectName
  6806. obj[pName] = {}
  6807. obj[pName].time = ''
  6808. obj[pName].content = ''
  6809. obj[pName].progress = 0
  6810. obj[pName].workingTime = 0
  6811. }
  6812. arrst.push(obj)
  6813. }
  6814. this.zhoData = arrst
  6815. this.setWeekCardTimeData(res.data.cardTimeList);
  6816. this.loadFilledWeekReportItem();
  6817. }else{
  6818. this.$message({
  6819. message: res.msg,
  6820. type: 'error'
  6821. })
  6822. }
  6823. },err => {
  6824. this.$message({
  6825. message: err,
  6826. type: 'error'
  6827. })
  6828. })
  6829. },
  6830. zhoZhi(res, i) {
  6831. var zhi = 0
  6832. for(var i in res) {
  6833. if(i != 'zhoDataTime' && i != 'he') {
  6834. zhi += +res[i]
  6835. }
  6836. }
  6837. res.he = zhi
  6838. },
  6839. zhoBtn(i) {
  6840. // this.zhoData.split(i, 1)
  6841. var arr = this.zhoData
  6842. arr.splice(i, 1)
  6843. },
  6844. zhoAddlast(){
  6845. this.selConShow = true
  6846. },
  6847. closeAddWeeklyReport(){
  6848. this.fillWeekDialogVisi = false
  6849. this.selConShow = true
  6850. this.selProjectList = []
  6851. this.selCon = []
  6852. },
  6853. checkDateWorkTime() {
  6854. //针对苏州景昱,单独的检查逻辑
  6855. if (this.user.companyId == 5978) {
  6856. //调接口,先检查工时是否存在异常
  6857. var zhi = this.zhoData;
  6858. var array = [];
  6859. for(let n in zhi){
  6860. if(zhi[n].he){
  6861. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6862. array.push(workData)
  6863. }
  6864. }
  6865. this.submitingReport = true;
  6866. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6867. res => {
  6868. this.submitingReport = false;
  6869. if (res.code == "ok") {
  6870. this.submitWeekReport(0)
  6871. } else {
  6872. this.$confirm(res.msg, this.$t('other.prompts'), {
  6873. confirmButtonText: this.$t('huLveBingTiJiao'),
  6874. cancelButtonText: this.$t('btn.cancel'),
  6875. type: 'error'
  6876. }).then(() => {
  6877. this.submitWeekReport(0)
  6878. }).catch(() => {
  6879. });
  6880. }
  6881. },
  6882. error => {
  6883. this.$message({
  6884. message: error,
  6885. type: "error"
  6886. });
  6887. });
  6888. }
  6889. },
  6890. // 提交按周填报
  6891. submitWeekReport(isDraft) {
  6892. var zhi = this.zhoData
  6893. var ll = 0
  6894. if(this.reportTimeType.type == 2) {
  6895. for(var i in zhi) {
  6896. this.dateAr = []
  6897. var alp = []
  6898. var zhis = zhi[i]
  6899. console.log(zhis)
  6900. for(var j in zhis) {
  6901. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6902. let objs = {}
  6903. objs.s = zhis[j].time[0]
  6904. objs.e = zhis[j].time[1]
  6905. objs.p = j
  6906. alp.push(objs)
  6907. }
  6908. }
  6909. console.log(alp)
  6910. this.dateAr = alp
  6911. if (this.reportTimeType.timeCanOverlap == 0) {
  6912. let str = this.$t('message.Filledtimeperiodsoverlap')
  6913. if(this.dateAr.length > 0) {
  6914. const trus = this.fns();
  6915. const overlapDataTime = this.getOverlapData(alp);
  6916. if (overlapDataTime.length > 0) {
  6917. const arrList = overlapDataTime.map((item) => item.p);
  6918. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6919. }
  6920. ll += 1
  6921. if(!trus) {
  6922. this.$message({
  6923. message: str,
  6924. type: 'error'
  6925. })
  6926. return false
  6927. }
  6928. }
  6929. } else {
  6930. if(this.dateAr.length > 0) {
  6931. ll +=1 ;
  6932. }
  6933. }
  6934. }
  6935. if(ll == 0) {
  6936. this.$message({
  6937. message: this.$t('message.Pleasefillinthetime'),
  6938. type: 'error'
  6939. })
  6940. return false
  6941. }
  6942. } else if(this.reportTimeType.type == 1){
  6943. for(var i in zhi) {
  6944. var zhis = zhi[i]
  6945. for(var j in zhis) {
  6946. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6947. ll += 1
  6948. }
  6949. }
  6950. }
  6951. if(ll == 0) {
  6952. this.$message({
  6953. message: this.$t('message.Pleaseselectatime'),
  6954. type: 'error'
  6955. })
  6956. return false
  6957. }
  6958. let overcorp = ''
  6959. for(let n in zhi){
  6960. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6961. overcorp += zhi[n].zhoDataTime + ','
  6962. }
  6963. }
  6964. if(this.user.companyId != 5978 && overcorp != ''){
  6965. overcorp = overcorp.substring(0,overcorp.length - 1)
  6966. this.$message({
  6967. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6968. type: 'error'
  6969. })
  6970. return
  6971. }
  6972. }
  6973. var submits = []
  6974. let formData = new FormData();
  6975. formData.append("draft", isDraft);
  6976. if(this.reportTimeType.multiWorktime == 1){
  6977. for (var i in this.zhoData) {
  6978. var zhoD = this.zhoData[i]
  6979. var flgs = false
  6980. for(var j in zhoD) {
  6981. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6982. flgs = true
  6983. // formData.append("degreeId", "-1");
  6984. formData.append("id", '-1');
  6985. if (this.isSubstitude) {
  6986. formData.append('targetUids',this.workForm.userId[0]);
  6987. }
  6988. for(var s in this.projectList) {
  6989. if(j == this.projectList[s].projectName) {
  6990. formData.append("projectId", this.projectList[s].id);
  6991. }
  6992. }
  6993. if(this.user.timeType.reportAuditType == 3){
  6994. let audItem = {}
  6995. if(this.user.timeType.auditLevel > 0){
  6996. audItem.auditorFirst = zhoD[j].auditorFirst
  6997. }
  6998. if(this.user.timeType.auditLevel > 1){
  6999. audItem.auditorSec = zhoD[j].auditorSec
  7000. }
  7001. if(this.user.timeType.auditLevel > 2){
  7002. audItem.auditorThird = zhoD[j].auditorThird
  7003. }
  7004. if(zhoD[j].ccUserid){
  7005. audItem.ccUserid = zhoD[j].ccUserid
  7006. }
  7007. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7008. }
  7009. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7010. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7011. formData.append("reportTimeType", this.reportTimeType.type);
  7012. formData.append("endTime", '');
  7013. formData.append("startTime", '');
  7014. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7015. var lix = []
  7016. var objjs = {}
  7017. objjs.startTime = zhoD[j].time[0]
  7018. objjs.endTime = zhoD[j].time[1]
  7019. if (zhoD[j].content == null || zhoD[j].content == '') {
  7020. zhoD[j].content == '-'
  7021. }
  7022. objjs.content = zhoD[j].content
  7023. lix.push(objjs)
  7024. var zhiZhi = JSON.stringify(lix)
  7025. zhiZhi = zhiZhi.replace(/,/g,"@");
  7026. formData.append("content", zhiZhi)
  7027. formData.append("isOvertime", 0)
  7028. formData.append("professionProgress", "[]")
  7029. if (zhoD[j].groupId) {
  7030. formData.append("groupId",zhoD[j].groupId)
  7031. } else {
  7032. //解决后台groupId数组越界的问题
  7033. formData.append("groupId",0)
  7034. }
  7035. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7036. formData.append("createDate",zhoD.zhoDataTime)
  7037. if (zhoD[j].projectAuditorId) {
  7038. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7039. }
  7040. if(zhoD[j].basecostId) {
  7041. formData.append("basecostId", zhoD[j].basecostId);
  7042. } else {
  7043. formData.append("basecostId", 0);
  7044. }
  7045. if(this.user.timeType.customDegreeActive){
  7046. if (this.user.timeType.customDegreeMultiple) {
  7047. if (zhoD[j].multiDegrIdArray) {
  7048. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7049. } else {
  7050. formData.append('multiDegrId','[]')
  7051. }
  7052. } else {
  7053. if (zhoD[j].degreeId) {
  7054. formData.append('degreeId',zhoD[j].degreeId)
  7055. } else {
  7056. formData.append('degreeId','-1')
  7057. }
  7058. }
  7059. }else{
  7060. formData.append("degreeId", "-1");
  7061. }
  7062. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7063. formData.append('customData',zhoD[j].customData)
  7064. }else if(this.user.timeType.customDataActive){
  7065. formData.append('customData',0)
  7066. }
  7067. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7068. formData.append('customText',zhoD[j].customText)
  7069. }else if(this.user.timeType.customTextActive){
  7070. formData.append('customText','-')
  7071. }
  7072. }
  7073. }
  7074. }
  7075. } else {
  7076. for (var i in this.zhoData) {
  7077. var zhoD = this.zhoData[i]
  7078. var flgs = false
  7079. if(this.reportTimeType.type == 2) {
  7080. for(var k in this.selProjectList) {
  7081. var pItem = this.selProjectList[k];
  7082. var pName = pItem.projectName;
  7083. var j = pName;
  7084. console.log('j==周报中的项目='+j);
  7085. if(zhoD[j].time && zhoD[j].time != 'null') {
  7086. flgs = true
  7087. // formData.append("degreeId", "-1");
  7088. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7089. if (this.isSubstitude) {
  7090. formData.append('targetUids',this.workForm.userId[0]);
  7091. }
  7092. for(var s in this.projectList) {
  7093. if(j == this.projectList[s].projectName) {
  7094. formData.append("projectId", this.projectList[s].id);
  7095. }
  7096. }
  7097. if(this.user.timeType.reportAuditType == 3){
  7098. let audItem = {}
  7099. if(this.user.timeType.auditLevel > 0){
  7100. audItem.auditorFirst = zhoD[j].auditorFirst
  7101. }
  7102. if(this.user.timeType.auditLevel > 1){
  7103. audItem.auditorSec = zhoD[j].auditorSec
  7104. }
  7105. if(this.user.timeType.auditLevel > 2){
  7106. audItem.auditorThird = zhoD[j].auditorThird
  7107. }
  7108. if(zhoD[j].ccUserid){
  7109. audItem.ccUserid = zhoD[j].ccUserid
  7110. }
  7111. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7112. }
  7113. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7114. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7115. formData.append("reportTimeType", this.reportTimeType.type);
  7116. formData.append("endTime", zhoD[j].time[1]);
  7117. formData.append("startTime", zhoD[j].time[0]);
  7118. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7119. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7120. formData.append("isOvertime", 0)
  7121. formData.append("professionProgress", "[]")
  7122. if (zhoD[j].groupId) {
  7123. formData.append("groupId",zhoD[j].groupId)
  7124. } else {
  7125. //解决后台groupId数组越界的问题
  7126. formData.append("groupId",0)
  7127. }
  7128. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7129. formData.append("createDate",zhoD.zhoDataTime)
  7130. if (zhoD[j].projectAuditorId) {
  7131. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7132. }
  7133. if(zhoD[j].basecostId) {
  7134. formData.append("basecostId", zhoD[j].basecostId);
  7135. } else {
  7136. formData.append("basecostId", 0);
  7137. }
  7138. if(this.user.timeType.customDegreeActive){
  7139. if (this.user.timeType.customDegreeMultiple) {
  7140. if (zhoD[j].multiDegrIdArray) {
  7141. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7142. } else {
  7143. formData.append("multiDegrId", "[]");
  7144. }
  7145. } else {
  7146. if (zhoD[j].degreeId) {
  7147. formData.append('degreeId',zhoD[j].degreeId)
  7148. } else {
  7149. formData.append("degreeId", "-1");
  7150. }
  7151. }
  7152. }else{
  7153. formData.append("degreeId", "-1");
  7154. }
  7155. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7156. formData.append('customData',zhoD[j].customData)
  7157. }else if(this.user.timeType.customDataActive){
  7158. formData.append('customData',0)
  7159. }
  7160. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7161. formData.append('customText',zhoD[j].customText)
  7162. }else if(this.user.timeType.customTextActive){
  7163. formData.append('customText','-')
  7164. }
  7165. }
  7166. }
  7167. } else {
  7168. for(var k in this.selProjectList) {
  7169. var pItem = this.selProjectList[k];
  7170. var pName = pItem.projectName;
  7171. var j = pName;
  7172. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7173. flgs = true
  7174. // formData.append("degreeId", "-1");
  7175. console.log('进入了workFpppp==='+j);
  7176. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7177. if (this.isSubstitude) {
  7178. formData.append('targetUids',this.workForm.userId[0]);
  7179. }
  7180. for(var s in this.projectList) {
  7181. if(j == this.projectList[s].projectName) {
  7182. formData.append("projectId", this.projectList[s].id);
  7183. }
  7184. }
  7185. if(this.user.timeType.reportAuditType == 3){
  7186. let audItem = {}
  7187. if(this.user.timeType.auditLevel > 0){
  7188. audItem.auditorFirst = zhoD[j].auditorFirst
  7189. }
  7190. if(this.user.timeType.auditLevel > 1){
  7191. audItem.auditorSec = zhoD[j].auditorSec
  7192. }
  7193. if(this.user.timeType.auditLevel > 2){
  7194. audItem.auditorThird = zhoD[j].auditorThird
  7195. }
  7196. if(zhoD[j].ccUserid){
  7197. audItem.ccUserid = zhoD[j].ccUserid
  7198. }
  7199. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7200. }
  7201. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7202. // formData.append("subProjectId", zhoD[j].subProjectId);
  7203. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7204. formData.append("reportTimeType", this.reportTimeType.type);
  7205. if(this.reportTimeType.type == 1) {
  7206. formData.append("workingTime", zhoD[j].workingTime);
  7207. } else if(this.reportTimeType.type == 2) {
  7208. formData.append("endTime", zhoD[j].time[1]);
  7209. formData.append("startTime", zhoD[j].time[0]);
  7210. } else if(this.reportTimeType.type == 3) {
  7211. formData.append("progress", zhoD[j].progress);
  7212. formData.append("workingTime", zhoD[j].workingTime);
  7213. }
  7214. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7215. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7216. formData.append("isOvertime", 0)
  7217. formData.append("professionProgress", "[]")
  7218. if (zhoD[j].groupId) {
  7219. formData.append("groupId",zhoD[j].groupId)
  7220. } else {
  7221. //解决后台groupId数组越界的问题
  7222. formData.append("groupId",0)
  7223. }
  7224. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7225. formData.append("createDate",zhoD.zhoDataTime)
  7226. if (zhoD[j].projectAuditorId) {
  7227. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7228. }
  7229. if(zhoD[j].basecostId) {
  7230. formData.append("basecostId", zhoD[j].basecostId);
  7231. } else {
  7232. formData.append("basecostId", 0);
  7233. }
  7234. if(this.user.timeType.customDegreeActive){
  7235. if (this.user.timeType.customDegreeMultiple) {
  7236. if (zhoD[j].multiDegrIdArray) {
  7237. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7238. } else {
  7239. formData.append("multiDegrId", "[]");
  7240. }
  7241. } else {
  7242. if (zhoD[j].degreeId) {
  7243. formData.append('degreeId',zhoD[j].degreeId)
  7244. } else {
  7245. formData.append("degreeId", "-1");
  7246. }
  7247. }
  7248. }else{
  7249. formData.append("degreeId", "-1");
  7250. }
  7251. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7252. formData.append('customData',zhoD[j].customData)
  7253. }else if(this.user.timeType.customDataActive){
  7254. formData.append('customData',0)
  7255. }
  7256. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7257. formData.append('customText',zhoD[j].customText)
  7258. }else if(this.user.timeType.customTextActive){
  7259. formData.append('customText','-')
  7260. }
  7261. }
  7262. }
  7263. }
  7264. }
  7265. }
  7266. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7267. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7268. if(!next) {
  7269. this.$message({
  7270. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7271. type: 'error'
  7272. })
  7273. return
  7274. }
  7275. // 自定义维度
  7276. this.submitingReport = true;
  7277. this.http.uploadFile( this.port.report.editPort, formData,
  7278. res => {
  7279. // this.listLoading = false;
  7280. this.submitingReport = false;
  7281. if (res.code == "ok") {
  7282. this.$message({
  7283. message: this.$t('message.fillinsuccessfully'),
  7284. type: "success"
  7285. });
  7286. this.fillWeekDialogVisi = false
  7287. this.selConShow = true
  7288. this.zhoData = []
  7289. this.weekDateRange = ''
  7290. this.getReportList();
  7291. this.getDepartment();
  7292. // 关闭弹窗 并 清空
  7293. this.selProjectList = []
  7294. this.selCon = []
  7295. this.getRecentlyProject()
  7296. } else {
  7297. this.$message({
  7298. message: res.msg,
  7299. type: "error"
  7300. });
  7301. }
  7302. },
  7303. error => {
  7304. this.submitingReport = false;
  7305. this.$message({
  7306. message: error,
  7307. type: "error"
  7308. });
  7309. });
  7310. },
  7311. handleGroupAuditorData(data) {
  7312. const { reportAuditType } = this.user.timeType
  7313. if(reportAuditType != 1 && reportAuditType != 2) {
  7314. return {next: true}
  7315. }
  7316. let arrList = [];
  7317. Object.entries(data).forEach(([key, obj]) => {
  7318. Object.entries(obj).forEach(([projectName, projectData]) => {
  7319. if (projectData.workingTime && !projectData.groupId) {
  7320. arrList.push({
  7321. projectName,
  7322. date: obj.zhoDataTime,
  7323. dateText: obj.zhoDataTimeTxt
  7324. });
  7325. }
  7326. });
  7327. });
  7328. if(arrList.length > 0) {
  7329. return {
  7330. next: false,
  7331. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7332. }
  7333. } else {
  7334. return {
  7335. next: true,
  7336. error: [],
  7337. }
  7338. }
  7339. },
  7340. ChangeHourMinutestr (str) {
  7341. if (str !== "0" && str !== "" && str !== null) {
  7342. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7343. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7344. } else {
  7345. return "";
  7346. }
  7347. },
  7348. // 得到两个日期中间的日期
  7349. getdiffdate(stime,etime){
  7350. //初始化日期列表,数组
  7351. var diffdate = new Array();
  7352. var i=0;
  7353. //开始日期小于等于结束日期,并循环
  7354. while(stime<=etime){
  7355. diffdate[i] = stime;
  7356. //获取开始日期时间戳
  7357. var stime_ts = new Date(stime).getTime();
  7358. //增加一天时间戳后的日期
  7359. var next_date = stime_ts + (24*60*60*1000);
  7360. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7361. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7362. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7363. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7364. stime = next_dates_y+next_dates_m+next_dates_d;
  7365. //增加数组key
  7366. i++;
  7367. }
  7368. return diffdate;
  7369. },
  7370. // 添加模块
  7371. addDomain(i) {
  7372. var leftProgress = 10;
  7373. if (this.reportTimeType.type == 3) {
  7374. //计算已经待分配工时比例
  7375. let array = this.workForm.domains;
  7376. let totalProgress = 0;
  7377. for (var i=0;i<array.length; i++) {
  7378. totalProgress += array[i].progress;
  7379. }
  7380. if (totalProgress < 100) {
  7381. leftProgress = 100 - totalProgress;
  7382. }
  7383. }
  7384. var addItem = {
  7385. projectId: "",
  7386. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7387. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7388. ),
  7389. content: "",
  7390. progress:leftProgress,
  7391. state:2,//2-表示待提交
  7392. multiWorktime: this.reportTimeType.multiWorktime,
  7393. worktimeList:[{}],
  7394. canEdit: true,
  7395. auditorFirst: '',
  7396. auditorSec: '',
  7397. auditorThird: '',
  7398. ccUserid: ''
  7399. // degreeId: '',
  7400. };
  7401. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7402. this.$set(addItem,'isOvertime',true)
  7403. if(this.reportTimeType.type == 3){
  7404. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7405. }
  7406. }
  7407. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7408. //默认给第一个,必填字段
  7409. addItem.basecostId = this.timeBasecostList[0].id;
  7410. }
  7411. this.workForm.domains.push(addItem);
  7412. document.getElementById('workFormsItemBottom').scrollIntoView()
  7413. this.canEdit = true
  7414. if (this.reportTimeType.type == 0) {
  7415. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7416. var length = this.workForm.domains.length;
  7417. if (length == 2) {
  7418. this.showAddMore = false;
  7419. }
  7420. }
  7421. this.chuji()
  7422. this.seleChn()
  7423. },
  7424. // 移除模块
  7425. delDomain(i) {
  7426. this.workForm.domains.splice(i,1)
  7427. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7428. if (!this.originCanEdit) {
  7429. let iscan = false
  7430. for(let i in this.workForm.domains){
  7431. if(this.workForm.domains[i].canEdit){
  7432. iscan = true
  7433. }
  7434. }
  7435. this.canEdit = iscan
  7436. }
  7437. //检测当前剩下的一个,时间类型是否是全天
  7438. if (this.reportTimeType.type == 0) {
  7439. if (this.workForm.domains[0].timeType == 0) {
  7440. this.showAddMore = false;
  7441. } else {
  7442. this.showAddMore = true;
  7443. }
  7444. }
  7445. if(this.user.timeType.multiWorktime == 1) {
  7446. this.iptChangs()
  7447. } else {
  7448. this.seleChn(0)
  7449. }
  7450. },
  7451. // 改变月份
  7452. changeMonth() {
  7453. this.isWeekend = false
  7454. let date = new Date()
  7455. let nowmon = date.getMonth() + 1
  7456. let nowday = date.getDate()
  7457. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7458. if (this.isBatch == 0) {
  7459. if(this.user.timeType.fillAhead == 0){
  7460. let date_a = new Date(this.workForm.createDate)
  7461. if(date_a.getTime() > date.getTime()){
  7462. this.workForm.createDate = nowdate
  7463. }
  7464. }
  7465. //只有按天填报才能获取当天的日报
  7466. if(!this.isSubstitude){
  7467. let weekday = new Date(this.workForm.createDate).getDay()
  7468. if(this.user.companyId == 817){
  7469. if(weekday == 0){
  7470. this.isWeekend = true
  7471. }
  7472. }else{
  7473. if(weekday == 0 || weekday == 6){
  7474. this.isWeekend = true
  7475. }
  7476. }
  7477. this.getReport()
  7478. }
  7479. }else {
  7480. if(this.user.timeType.fillAhead == 0){
  7481. let date_a = new Date(this.workForm.createDate[1])
  7482. if(date_a.getTime() > date.getTime()){
  7483. this.workForm.createDate[1] = nowdate
  7484. let sdate = new Date(this.workForm.createDate[0])
  7485. let edate = new Date(this.workForm.createDate[1])
  7486. if(sdate > edate){
  7487. this.workForm.createDate[0] = this.workForm.createDate[1]
  7488. }
  7489. }
  7490. }
  7491. }
  7492. },
  7493. // 判断时间段
  7494. fns() {
  7495. for (let k in this.dateAr) {
  7496. if (!this.judege(k)) {
  7497. return false
  7498. }
  7499. }
  7500. return true
  7501. },
  7502. judege(idx){
  7503. for (let k in this.dateAr) {
  7504. if (idx !== k) {
  7505. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7506. return false
  7507. }
  7508. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7509. return false
  7510. }
  7511. }
  7512. }
  7513. return true
  7514. },
  7515. getOverlapData(data) {
  7516. let overlapData = [];
  7517. for (let i = 0; i < data.length; i++) {
  7518. for (let j = i + 1; j < data.length; j++) {
  7519. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7520. overlapData.push(data[i], data[j]);
  7521. }
  7522. }
  7523. }
  7524. return overlapData;
  7525. },
  7526. // 保存日报111111
  7527. submitReport(isDraft) {
  7528. this.isDraft = isDraft;
  7529. this.$refs.workForm.validate(valid => {
  7530. if (valid) {
  7531. if (!isDraft) {
  7532. //针对苏州景昱,单独的检查逻辑
  7533. if (this.user.companyId == 5978) {
  7534. //调接口,先检查工时是否存在异常
  7535. var totalTime = 0;
  7536. for (var t=0;t<this.workForm.domains.length; t++) {
  7537. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7538. }
  7539. var array = [];
  7540. if (this.isBatch) {
  7541. var startDate = new Date(this.workForm.createDate[0]);
  7542. var endDate = new Date(this.workForm.createDate[1]);
  7543. if (startDate > endDate) {
  7544. this.$message({
  7545. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7546. type: "error"
  7547. });
  7548. return
  7549. } else {
  7550. while(true){
  7551. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7552. array.push(workData);
  7553. startDate.setDate(startDate.getDate() + 1);
  7554. if (startDate > endDate) {
  7555. break;
  7556. }
  7557. }
  7558. }
  7559. } else {
  7560. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7561. array.push(workData)
  7562. }
  7563. this.submitingReport = true;
  7564. var passUserId = this.user.id;
  7565. if (this.isSubstitude) {
  7566. passUserId = this.targetUids;
  7567. }
  7568. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7569. res => {
  7570. this.submitingReport = false;
  7571. if (res.code == "ok") {
  7572. this.submitReportSon()
  7573. } else {
  7574. this.$confirm(res.msg, this.$t('other.prompts'), {
  7575. confirmButtonText: this.$t('huLveBingTiJiao'),
  7576. cancelButtonText: this.$t('btn.cancel'),
  7577. type: 'error'
  7578. }).then(() => {
  7579. this.submitReportSon()
  7580. }).catch(() => {
  7581. });
  7582. }
  7583. },
  7584. error => {
  7585. this.$message({
  7586. message: error,
  7587. type: "error"
  7588. });
  7589. });
  7590. } else {
  7591. if(this.totalReportHours < this.user.timeType.allday){
  7592. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7593. confirmButtonText: this.$t('btn.determine'),
  7594. cancelButtonText: this.$t('btn.cancel'),
  7595. type: 'warning'
  7596. }).then(() => {
  7597. this.submitReportSon()
  7598. }).catch(() => {
  7599. });
  7600. }else{
  7601. this.submitReportSon()
  7602. }
  7603. }
  7604. } else {
  7605. //暂存,不需要检查工时是否超过考勤
  7606. this.submitReportSon()
  7607. }
  7608. }
  7609. });
  7610. },
  7611. submitReportSon() {
  7612. this.dateAr = []
  7613. //检查重叠
  7614. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7615. let alp = []
  7616. if(this.user.timeType.multiWorktime != 1) {
  7617. for(var p in this.workForm.domains) {
  7618. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7619. let objs = {}
  7620. objs.s = this.workForm.domains[p].startTime
  7621. objs.e = this.workForm.domains[p].endTime
  7622. alp.push(objs)
  7623. }
  7624. }
  7625. this.dateAr = alp
  7626. if(this.dateAr.length > 0) {
  7627. let trus = this.fns()
  7628. if(!trus) {
  7629. this.$message({
  7630. message: this.$t('message.Filledtimeperiodsoverlap'),
  7631. type: "error"
  7632. });
  7633. return
  7634. }
  7635. }
  7636. } else {
  7637. for(var p in this.workForm.domains) {
  7638. var slll = this.workForm.domains[p]
  7639. for(var o in slll.worktimeList) {
  7640. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7641. let objs = {}
  7642. objs.s = slll.worktimeList[o].startTime
  7643. objs.e = slll.worktimeList[o].endTime
  7644. alp.push(objs)
  7645. }
  7646. }
  7647. }
  7648. this.dateAr = alp
  7649. if(this.dateAr.length > 0) {
  7650. let trus = this.fns()
  7651. if(!trus) {
  7652. this.$message({
  7653. message: this.$t('message.Filledtimeperiodsoverlap'),
  7654. type: "error"
  7655. });
  7656. return
  7657. }
  7658. }
  7659. }
  7660. }
  7661. //检查子项目
  7662. if (this.user.timeType.subProMustFill == 1) {
  7663. for(var p in this.workForm.domains) {
  7664. var oneProItem = this.workForm.domains[p]
  7665. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7666. //没有选择子项目
  7667. this.$message({
  7668. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7669. type: "error"
  7670. });
  7671. return
  7672. }
  7673. }
  7674. }
  7675. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7676. if (this.user.companyId == this.yuzhongCompId) {
  7677. for(var p in this.workForm.domains) {
  7678. var oneProItem = this.workForm.domains[p]
  7679. if (!oneProItem.extraField1) {
  7680. this.$message({
  7681. message: this.$t('jiaoSeBiTianQingJianCha'),
  7682. type: "error"
  7683. });
  7684. return
  7685. }
  7686. if (!oneProItem.extraField2) {
  7687. this.$message({
  7688. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7689. type: "error"
  7690. });
  7691. return
  7692. }
  7693. if (!oneProItem.extraField3) {
  7694. this.$message({
  7695. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7696. type: "error"
  7697. });
  7698. return
  7699. }
  7700. }
  7701. }
  7702. // return
  7703. //代填的情况,检查人员是否已经选择
  7704. if (this.isSubstitude) {
  7705. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7706. this.$message({
  7707. message: this.$t('message.pleaseselectthepersontofillin'),
  7708. type: "error"
  7709. });
  7710. return;
  7711. }
  7712. }
  7713. //检查时间,全天和上下午不能同时存在
  7714. if (this.reportTimeType.type == 0) {
  7715. var alldayNum = 0;
  7716. var amNum = 0;
  7717. var pmNum = 0;
  7718. for(var i in this.workForm.domains) {
  7719. if (this.workForm.domains[i].timeType == 0) {
  7720. alldayNum ++;
  7721. } else if (this.workForm.domains[i].timeType == 1) {
  7722. amNum++;
  7723. } else if (this.workForm.domains[i].timeType == 2) {
  7724. pmNum++;
  7725. }
  7726. }
  7727. if (alldayNum > 1) {
  7728. this.$message({
  7729. // message: "工作时间-全天,只能选择一次",
  7730. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7731. type: "error"
  7732. });
  7733. return;
  7734. }
  7735. if (amNum > 1) {
  7736. this.$message({
  7737. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7738. type: "error"
  7739. });
  7740. return;
  7741. }
  7742. if (pmNum > 1) {
  7743. this.$message({
  7744. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7745. type: "error"
  7746. });
  7747. return;
  7748. }
  7749. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7750. this.$message({
  7751. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7752. type: "error"
  7753. });
  7754. return;
  7755. }
  7756. } else if (this.reportTimeType.type == 3) {
  7757. //总百分比不能超过100%
  7758. let total = 0;
  7759. this.workForm.domains.forEach(w=>{total += w.progress});
  7760. if (total > 100) {
  7761. this.$message({
  7762. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7763. type: "error"
  7764. });
  7765. return;
  7766. } else if (total < 100) {
  7767. this.$message({
  7768. message: this.$t('message.cannotbesubmitted'),
  7769. type: "error"
  7770. });
  7771. return;
  7772. }
  7773. }
  7774. this.listLoading = true;
  7775. let formData = new FormData();
  7776. formData.append("draft", this.isDraft);
  7777. var totalTime = 0;
  7778. for (var t=0;t<this.workForm.domains.length; t++) {
  7779. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7780. }
  7781. //批量填报不校验考勤时长,交给后台校验
  7782. if (!this.isBatch) {
  7783. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7784. if (this.workForm.time){
  7785. if (this.workForm.time.workHours == 0){
  7786. this.$message({
  7787. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7788. type: 'error'
  7789. })
  7790. return
  7791. }
  7792. }else{
  7793. this.$message({
  7794. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7795. type: 'error'
  7796. })
  7797. return
  7798. }
  7799. }
  7800. }
  7801. //针对凡己和景昱,此处不校验考勤时长
  7802. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7803. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7804. this.$message({
  7805. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7806. type: "error"
  7807. });
  7808. return;
  7809. }
  7810. }
  7811. for(var i in this.workForm.domains) {
  7812. // 检查任务/里程碑是否为必填
  7813. let taskRequired = this.user.timeType.taskRequired
  7814. if(taskRequired == 1) {
  7815. if(!this.workForm.domains[i].taskId) {
  7816. this.$message({
  7817. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  7818. type: "error"
  7819. });
  7820. return
  7821. }
  7822. }
  7823. if(this.user.timeType.reportAuditType == 3){
  7824. let audItem = {}
  7825. let auditRule = ''
  7826. if(this.workForm.domains[i].id){
  7827. audItem.reportId = this.workForm.domains[i].id
  7828. }
  7829. if(this.user.timeType.auditLevel > 0){
  7830. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7831. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7832. }
  7833. if(this.user.timeType.auditLevel > 1){
  7834. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7835. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7836. }
  7837. if(this.user.timeType.auditLevel > 2){
  7838. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7839. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7840. }
  7841. if(this.workForm.domains[i].ccUserid){
  7842. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7843. }
  7844. if(auditRule){
  7845. auditRule = auditRule.substring(0,auditRule.length - 1)
  7846. this.$message({
  7847. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7848. type: 'error'
  7849. })
  7850. return
  7851. }
  7852. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7853. }
  7854. if (this.user.timeType.customDegreeActive) {
  7855. if (this.user.timeType.customDegreeMultiple) {
  7856. //多选
  7857. if (this.workForm.domains[i].multiDegrIdArray) {
  7858. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7859. degreeArray = degreeArray.replace(/,/g,"@");
  7860. formData.append("multiDegrId", degreeArray);
  7861. } else {
  7862. formData.append("multiDegrId", '[]');
  7863. }
  7864. } else {
  7865. //单选
  7866. if (this.workForm.domains[i].degreeId) {
  7867. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7868. } else {
  7869. formData.append("degreeId", -1);
  7870. }
  7871. }
  7872. } else {
  7873. formData.append("degreeId", -1);
  7874. }
  7875. if(this.workForm.domains[i].customData) {
  7876. // var sss = this.workForm.domains[i].degreeId.toString()
  7877. formData.append("customData", this.workForm.domains[i].customData);
  7878. } else {
  7879. formData.append("customData", 0);
  7880. }
  7881. if(this.workForm.domains[i].customText) {
  7882. formData.append("customText", this.workForm.domains[i].customText);
  7883. } else {
  7884. formData.append("customText", '-');
  7885. }
  7886. if (this.workForm.domains[i].id) {
  7887. formData.append("id", this.workForm.domains[i].id);
  7888. } else {
  7889. formData.append("id", -1);
  7890. }
  7891. formData.append("projectId", this.workForm.domains[i].projectId);
  7892. if (this.workForm.domains[i].subProjectId) {
  7893. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7894. } else {
  7895. formData.append("subProjectId", 0);
  7896. }
  7897. if (this.workForm.domains[i].groupId) {
  7898. formData.append("groupId", this.workForm.domains[i].groupId);
  7899. } else {
  7900. formData.append("groupId", 0);
  7901. }
  7902. if (this.workForm.domains[i].taskId) {
  7903. formData.append("taskId", this.workForm.domains[i].taskId);
  7904. } else {
  7905. formData.append("taskId", 0);
  7906. }
  7907. if (this.workForm.domains[i].taskFinish == true) {
  7908. formData.append("taskFinish", 1);
  7909. } else {
  7910. formData.append("taskFinish", 0);
  7911. }
  7912. formData.append("reportTimeType", this.reportTimeType.type);
  7913. if (this.reportTimeType.type == 0) {
  7914. formData.append("timeType", this.workForm.domains[i].timeType);
  7915. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7916. formData.append("workingTime", workingTime);
  7917. } else if (this.reportTimeType.type == 1){
  7918. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7919. } else if (this.reportTimeType.type == 2) {
  7920. formData.append("endTime", this.workForm.domains[i].endTime);
  7921. formData.append("startTime", this.workForm.domains[i].startTime);
  7922. } else if (this.reportTimeType.type == 3) {
  7923. //按比例分配
  7924. formData.append("progress", this.workForm.domains[i].progress);
  7925. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7926. }
  7927. if(this.user.timeType.choseFromAlbum == 1 ) {
  7928. console.log(this.workForm.domains[i].imgList)
  7929. if(this.workForm.domains[i].imgList) {
  7930. let imgListFor = this.workForm.domains[i].imgList
  7931. for(var b in imgListFor) {
  7932. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7933. }
  7934. console.log(imgListFor)
  7935. let m = JSON.stringify(imgListFor);
  7936. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7937. formData.append("picStr", m);
  7938. } else {
  7939. formData.append("picStr", '[]');
  7940. }
  7941. }
  7942. //处理多个时间事项
  7943. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7944. if (this.reportTimeType.multiWorktime == 1) {
  7945. //检查时间是否有重叠
  7946. var workList = this.workForm.domains[i].worktimeList;
  7947. for (var j=0;j<workList.length; j++) {
  7948. var curItem = workList[j];
  7949. //检查开始时间是否大于结束时间
  7950. if (curItem.startTime >= curItem.endTime) {
  7951. this.$message({
  7952. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7953. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7954. type: "error"
  7955. });
  7956. return;
  7957. }
  7958. //时间不可重叠
  7959. if (this.reportTimeType.timeCanOverlap == 0) {
  7960. for (var p = j+1;p<workList.length; p++) {
  7961. var jItem = workList[p];
  7962. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7963. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7964. this.$message({
  7965. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7966. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7967. type: "error"
  7968. });
  7969. return;
  7970. }
  7971. }
  7972. }
  7973. }
  7974. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7975. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7976. formData.append("content", m);
  7977. } else {
  7978. if (this.workForm.domains[i].content) {
  7979. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7980. m = m.replace(/,/g,",");
  7981. console.log(m, '需要传值的数据')
  7982. // formData.append("content", this.workForm.domains[i].content);
  7983. formData.append("content", m);
  7984. } else {
  7985. formData.append("content", '-');
  7986. }
  7987. }
  7988. if (this.isBatch == 0) {
  7989. formData.append("createDate", this.workForm.createDate);
  7990. } else {
  7991. //批量填报,时间范围
  7992. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7993. }
  7994. if(this.workForm.domains[i].isOvertime) {
  7995. formData.append("isOvertime", 1);
  7996. } else {
  7997. formData.append("isOvertime", 0);
  7998. }
  7999. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8000. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8001. } else {
  8002. formData.append("overtimeHours", 0);
  8003. }
  8004. if(this.workForm.domains[i].basecostId) {
  8005. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8006. } else {
  8007. formData.append("basecostId", 0);
  8008. }
  8009. if (this.workForm.userId != null) {
  8010. var targetUids = '';
  8011. this.workForm.userId.forEach(u=>{
  8012. targetUids += u + '@';
  8013. });
  8014. if (targetUids.length > 0) {
  8015. targetUids = targetUids.substring(0, targetUids.length -1);
  8016. formData.append("targetUids", targetUids);
  8017. }
  8018. }
  8019. //项目专业进度
  8020. if (this.workForm.domains[i].professionProgress) {
  8021. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8022. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8023. formData.append("professionProgress", m);
  8024. } else {
  8025. formData.append("professionProgress", "[]");
  8026. }
  8027. if (this.workForm.domains[i].stage) {
  8028. formData.append("stage", this.workForm.domains[i].stage);
  8029. } else {
  8030. formData.append("stage", "-");
  8031. }
  8032. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  8033. if (this.workForm.domains[i].projectAuditorId) {
  8034. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8035. } else {
  8036. // console.log('执行到了这里')
  8037. // console.log(this.user.timeType.reportAuditType)
  8038. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8039. this.$message({
  8040. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8041. type: "error"
  8042. });
  8043. return;
  8044. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  8045. //分组负责人先审核, 确定是选择了任务分组
  8046. if (this.workForm.domains[i].taskGroups.length == 0) {
  8047. this.$message({
  8048. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8049. type: "error"
  8050. });
  8051. } else if (!this.workForm.domains[i].groupId) {
  8052. // console.log(this.workForm.domains[i]);
  8053. this.$message({
  8054. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8055. type: "error"
  8056. });
  8057. } else {
  8058. this.$message({
  8059. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  8060. type: "error"
  8061. });
  8062. }
  8063. return;
  8064. }
  8065. }
  8066. if (this.user.companyId == this.yuzhongCompId) {
  8067. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8068. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8069. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8070. }
  8071. //依斯贝的服务Id
  8072. if (this.user.companyId == this.yisibeiCompId) {
  8073. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8074. }
  8075. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8076. this.$message({
  8077. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8078. type: "error"
  8079. });
  8080. return
  8081. }
  8082. if(this.user.timeType.userWithMultiDept == 1) {
  8083. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8084. }
  8085. }
  8086. this.submitingReport = true;
  8087. this.http.uploadFile( this.port.report.editPort, formData,
  8088. res => {
  8089. this.listLoading = false;
  8090. this.submitingReport = false;
  8091. if (res.code == "ok") {
  8092. if(res.msg!=null){
  8093. this.$message({
  8094. dangerouslyUseHTMLString: true,
  8095. message: res.msg,
  8096. type: "warning",
  8097. showClose: true,
  8098. duration: 0
  8099. });
  8100. }else{
  8101. this.$message({
  8102. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8103. type: "success"
  8104. });
  8105. }
  8106. this.dialogVisible = false;
  8107. this.jsDay = 0
  8108. this.jsTime = 0
  8109. this.getReportList();
  8110. this.getDepartment();
  8111. this.getRecentlyProject()
  8112. } else {
  8113. this.$message({
  8114. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8115. type: "error"
  8116. });
  8117. }
  8118. },
  8119. error => {
  8120. this.listLoading = false;
  8121. this.submitingReport = false;
  8122. this.$message({
  8123. message: error,
  8124. type: "error"
  8125. });
  8126. });
  8127. },
  8128. // 判断是展示那个工时导入
  8129. imports() {
  8130. if(this.user.timeType.syncCorpwxTime == 0) {
  8131. this.importDialog = true
  8132. } else {
  8133. this.importWxDialog = true
  8134. }
  8135. },
  8136. // 跳转
  8137. junpToDeskTop(id) {
  8138. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8139. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8140. },
  8141. // 通过日报
  8142. approve(id, item) {
  8143. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8144. this.approveinData = {
  8145. id: id,
  8146. date: this.date +day,
  8147. reportIds: item.id
  8148. }
  8149. if(this.user.timeType.needEvaluate == 1){
  8150. this.$set(this.approveinData,'evaluate','')
  8151. this.approveinDialog = true
  8152. }else{
  8153. this.logining = true;
  8154. this.approveinfun()
  8155. }
  8156. },
  8157. approveinfun(){
  8158. this.http.post( this.port.report.approve, this.approveinData,
  8159. res => {
  8160. this.logining = false;
  8161. if (res.code == "ok") {
  8162. this.approveinDialog = false
  8163. this.$message({
  8164. message: this.$t('message.Reviewsucceeded'),
  8165. type: "success"
  8166. });
  8167. this.refreshReportData(this.approveinData.reportIds);
  8168. this.getDepartment();
  8169. } else {
  8170. this.$message({
  8171. message: res.msg,
  8172. type: "error"
  8173. });
  8174. }
  8175. },
  8176. error => {
  8177. this.logining = false;
  8178. this.$message({
  8179. message: error,
  8180. type: "error"
  8181. });
  8182. });
  8183. },
  8184. //撤回日报
  8185. cancel(item,e) {
  8186. // console.log('can can need',item);
  8187. this.logining = true;
  8188. var ids = '';
  8189. var data = e ? item : item.data;
  8190. data.forEach(element => {
  8191. if(element.id){
  8192. ids +=(element.id+',');
  8193. }
  8194. });
  8195. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8196. res => {
  8197. this.logining = false;
  8198. if (res.code == "ok") {
  8199. this.$message({
  8200. message:this.$t('message.Withdrawalsucceeded'),
  8201. type: "success"
  8202. });
  8203. this.getReportList();
  8204. if(e){this.getReport()}
  8205. this.getDepartment();
  8206. } else {
  8207. this.$message({
  8208. message: res.msg,
  8209. type: "error"
  8210. });
  8211. }
  8212. },
  8213. error => {
  8214. this.logining = false;
  8215. this.$message({
  8216. message: error,
  8217. type: "error"
  8218. });
  8219. });
  8220. },
  8221. showDenyDialog(id,i, item) {
  8222. this.denyReasonDialog = true;
  8223. this.isDenying = false;
  8224. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8225. var ids = item.id;
  8226. // var data = item.data;
  8227. // data.forEach(element => {
  8228. // ids +=(element.id+',');
  8229. // });
  8230. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8231. },
  8232. // 未通过日报
  8233. deny() {
  8234. this.logining = true;
  8235. this.isDenying = true;
  8236. this.http.post( this.port.report.deny, this.denyForm,
  8237. res => {
  8238. this.logining = false;
  8239. this.isDenying = false;
  8240. if (res.code == "ok") {
  8241. this.$message({
  8242. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8243. type: "success"
  8244. });
  8245. this.refreshReportData(this.denyForm.reportIds);
  8246. this.getDepartment();
  8247. this.denyReasonDialog = false;
  8248. } else {
  8249. this.$message({
  8250. message: res.msg,
  8251. type: "error"
  8252. });
  8253. }
  8254. },
  8255. error => {
  8256. this.logining = false;
  8257. this.$message({
  8258. message: error,
  8259. type: "error"
  8260. });
  8261. });
  8262. },
  8263. // 查看工时记录弹窗
  8264. toView() {
  8265. this.toViewDialogVisible = true
  8266. this.toViewloading = true
  8267. this.getToView()
  8268. },
  8269. getToView() {
  8270. this.http.post( '/report-import-log/getList', this.toViewForm,
  8271. res => {
  8272. this.toViewloading = false;
  8273. if (res.code == "ok") {
  8274. // console.log(res.data, '数据数据')
  8275. this.toViewList = res.data.records
  8276. this.toViewForm.total = res.data.total
  8277. } else {
  8278. this.toViewloading = false;
  8279. this.$message({
  8280. message: res.msg,
  8281. type: "error"
  8282. });
  8283. }
  8284. })
  8285. },
  8286. // 触发 selectCat 组件更改他的值
  8287. selectCatCli(obj) {
  8288. // console.log(obj, '看看')
  8289. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8290. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8291. },
  8292. vueCasader(obj) {
  8293. console.log(obj, '看看值', this.departmentList)
  8294. if(obj.distinction == 1 && obj.item) {
  8295. let arr = []
  8296. arr.push(obj.item.value)
  8297. this.exportParam.departmentId = arr
  8298. }
  8299. if(obj.distinction == '10' && obj) {
  8300. const { id, other } = obj
  8301. this.workForm.domains[other].reportTargetDeptId = id
  8302. }
  8303. if(obj.distinction == '14' && obj) {
  8304. let arr = []
  8305. arr.push(obj.id)
  8306. this.deptIdForHasReport = arr
  8307. this.showMonthWorkTime()
  8308. }
  8309. if(obj.distinction == '15' && obj) {
  8310. let arr = []
  8311. arr.push(obj.id)
  8312. this.deptIdForNoReport = arr
  8313. this.showMonthNotWorkTime()
  8314. }
  8315. if(obj.distinction == '16' && obj) {
  8316. let arr = []
  8317. arr.push(obj.id)
  8318. this.deptIdForReminder = arr
  8319. this.showMonthWorkTimeReminder()
  8320. }
  8321. },
  8322. //分页
  8323. handleCurrentChange(val) {
  8324. this.toViewForm.pageIndex = val;
  8325. this.getToView();
  8326. },
  8327. handleSizeChange(val) {
  8328. this.toViewForm.pageSize = val;
  8329. this.getToView();
  8330. },
  8331. getAllUsersList(){
  8332. this.http.post('/user/getSimpleActiveUserList',{
  8333. },res => {
  8334. if(res.code == 'ok'){
  8335. this.allUsersList = res.data
  8336. }else{
  8337. this.$message({
  8338. message: res.msg,
  8339. type: 'error'
  8340. })
  8341. }
  8342. },err => {
  8343. this.$message({
  8344. message: err,
  8345. type: 'error'
  8346. })
  8347. })
  8348. },
  8349. //景昱变更提醒
  8350. changeReminder(item){
  8351. console.log("============",item)
  8352. let parameter={
  8353. startDate: this.WorktimeDatepickValue[0],
  8354. endDate: this.WorktimeDatepickValue[1],
  8355. }
  8356. if(item){
  8357. parameter.createDate=item.createDate,
  8358. parameter.userId=item.userId
  8359. }
  8360. this.http.post('/report/changeReminder',parameter,res => {
  8361. if(res.code == 'ok'){
  8362. this.$message({
  8363. message: res.msg,
  8364. type: 'success'
  8365. })
  8366. }else{
  8367. this.$message({
  8368. message: res.msg,
  8369. type: 'error'
  8370. })
  8371. }
  8372. },err => {
  8373. this.$message({
  8374. message: err,
  8375. type: 'error'
  8376. })
  8377. })
  8378. },
  8379. //景昱取消异常
  8380. cancelReminder(item){
  8381. let parameter={}
  8382. if(item){
  8383. parameter.createDate=item.createDate,
  8384. parameter.userId=item.userId
  8385. }
  8386. this.http.post('/report/cancelReminder',parameter,res => {
  8387. if(res.code == 'ok'){
  8388. this.$message({
  8389. message: res.msg,
  8390. type: 'success'
  8391. })
  8392. }else{
  8393. this.$message({
  8394. message: res.msg,
  8395. type: 'error'
  8396. })
  8397. }
  8398. },err => {
  8399. this.$message({
  8400. message: err,
  8401. type: 'error'
  8402. })
  8403. })
  8404. this.showMonthWorkTimeReminder()
  8405. },
  8406. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8407. fillWeekCustomClne() {
  8408. this.fillWeekDialogVisiCustom = false
  8409. },
  8410. fillWeekCustomSubmit() {
  8411. this.getReportList();
  8412. this.getDepartment();
  8413. this.getRecentlyProject()
  8414. },
  8415. // 待填日报姓名搜索
  8416. nameAearchSeek(flg) {
  8417. if(!this.nameAearch) {
  8418. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8419. return
  8420. }
  8421. if(flg) {
  8422. this.enterpriseWechatgetUser()
  8423. }
  8424. },
  8425. handleThreeData(userList) {
  8426. console.log(userList, '人员数据')
  8427. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8428. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8429. },
  8430. // 过滤树节点
  8431. filterTreeNodes(treeData, filterKeywords) {
  8432. return treeData.filter((node) => {
  8433. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8434. if (node.children && node.children.length > 0) {
  8435. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8436. }
  8437. return true;
  8438. }
  8439. if (node.children && node.children.length > 0) {
  8440. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8441. return node.children.length > 0;
  8442. }
  8443. return false;
  8444. });
  8445. },
  8446. // 企业微信获取人员
  8447. enterpriseWechatgetUser() {
  8448. this.deptMembDataLoading = true
  8449. this.http.post('/user/getEmployeeList',{
  8450. departmentId: -1,
  8451. pageIndex: 1,
  8452. pageSize: 100,
  8453. keyword: this.nameAearch,
  8454. status: '',
  8455. roleId: '',
  8456. cursor: '',
  8457. onlyDirect: '',
  8458. matchingType: ''
  8459. },res => {
  8460. if(res.code == 'ok'){
  8461. this.deptMembDataLoading = false
  8462. const userListName = res.data.records.map(item => item.name)
  8463. this.handleThreeData(userListName)
  8464. setTimeout(() => {
  8465. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8466. }, 200)
  8467. }else{
  8468. this.deptMembDataLoading = false
  8469. this.$message({
  8470. message: res.msg,
  8471. type: 'error'
  8472. })
  8473. }
  8474. },err => {
  8475. this.deptMembDataLoading = false
  8476. this.$message({
  8477. message: err,
  8478. type: 'error'
  8479. })
  8480. })
  8481. },
  8482. changeTreeNodeStatus(node) {
  8483. console.log(node)
  8484. let allZt = true
  8485. node.expanded = allZt
  8486. for (let i = 0; i < node.childNodes.length; i++) {
  8487. node.childNodes[i].expanded = allZt
  8488. if (node.childNodes[i].childNodes.length > 0) {
  8489. this.changeTreeNodeStatus(node.childNodes[i])
  8490. }
  8491. }
  8492. },
  8493. // 按周填报获取相关任务
  8494. async getWeeklyTaskList(item) {
  8495. console.log(item, '<=== 数据')
  8496. const { projectId, groupId, stage, taskId } = item
  8497. console.log(projectId, groupId, stage)
  8498. let parms = { projectId, isSubstitude: 0 }
  8499. groupId ? parms.groupId = groupId : ''
  8500. stage ? parms.stage = stage : ''
  8501. const { data } = await this.postData('/task/getRecentTask', parms)
  8502. this.zhoBao.taskId = taskId
  8503. this.$set(this.zhoBao, 'taskList', data)
  8504. console.log(this.zhoBao)
  8505. },
  8506. // 封装 post 请求
  8507. postData(url, params) {
  8508. return new Promise((resolve, reject) => {
  8509. this.http.post(url, { ...params },
  8510. res => {
  8511. resolve(res)
  8512. },
  8513. error => {
  8514. this.$message({
  8515. message: error,
  8516. type: "error"
  8517. });
  8518. reject(error)
  8519. })
  8520. })
  8521. },
  8522. // 自定义事件
  8523. selectCal(obj) {
  8524. console.log(obj, '传数据来源')
  8525. if(obj.distinction == '1') {
  8526. this.zhoBao.projectAuditorId = obj.id
  8527. } else if(obj.distinction == '2') {
  8528. this.zhoBao.auditorFirst = obj.id
  8529. } else if(obj.distinction == '3') {
  8530. this.zhoBao.auditorSec = obj.id
  8531. } else if(obj.distinction == '4') {
  8532. this.zhoBao.auditorThird = obj.id
  8533. } else if(obj.distinction == '5') {
  8534. this.zhoBao.ccUserid = obj.id
  8535. } else if(obj.distinction == '12') {
  8536. this.usersListId = obj.id
  8537. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8538. this.searchKeyword = obj.name
  8539. } else {
  8540. this.searchKeyword = ''
  8541. }
  8542. this.searchScreen(0)
  8543. } else if(obj.distinction == '13') {
  8544. this.usersListId = obj.id
  8545. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8546. this.searchKeyword = obj.name
  8547. } else {
  8548. this.searchKeyword = ''
  8549. }
  8550. this.searchScreen(1)
  8551. }
  8552. }
  8553. },
  8554. created() {
  8555. this.getUsers()
  8556. let height = window.innerHeight;
  8557. this.tableHeight = height - 178;
  8558. const that = this;
  8559. window.onresize = function temp() {
  8560. that.tableHeight = window.innerHeight - 178;
  8561. };
  8562. this.toViewForm.companyId = this.user.companyId
  8563. this.initDrag([{
  8564. type: "LR",
  8565. domClass: {
  8566. // 中间分割线的名字
  8567. resize: "line-line",
  8568. // 左侧盒子的名字
  8569. left: "box-left",
  8570. // 右侧盒子的名字
  8571. right: "box-right",
  8572. // 父级的名字
  8573. box: "box-father",
  8574. },
  8575. otherInfo: {
  8576. // 限制左边栏最低宽度
  8577. leftWidth: 120,
  8578. },
  8579. },
  8580. {
  8581. type: "LR",
  8582. domClass: {
  8583. // 中间分割线的名字
  8584. resize: "line-second",
  8585. // 左侧盒子的名字
  8586. left: "left-laowang",
  8587. // 右侧盒子的名字
  8588. right: "box-second-father",
  8589. // 父级的名字
  8590. box: "grand",
  8591. },
  8592. otherInfo: {
  8593. // 限制左边栏最低宽度
  8594. leftWidth: 120,
  8595. },
  8596. },
  8597. ]);
  8598. }
  8599. };
  8600. </script>
  8601. <style lang="scss" scoped>
  8602. .fillWeekDialogVisiCustom {
  8603. width: 100%;
  8604. height: 70vh;
  8605. }
  8606. .fillWeekCustom {
  8607. .el-dialog__body {
  8608. padding: 20px 20px !important;
  8609. }
  8610. }
  8611. .photos {
  8612. position: relative;
  8613. display: flex;
  8614. flex-wrap: wrap;
  8615. }
  8616. .photos_img {
  8617. width: 120px;
  8618. height: 120px;
  8619. margin-right: 20px;
  8620. margin-bottom: 20px;
  8621. cursor: pointer;
  8622. img {
  8623. width: 100%;
  8624. height: 100%;
  8625. }
  8626. }
  8627. .paginatis {
  8628. padding: 10px 10px;
  8629. background: #f2f2f2;
  8630. }
  8631. .waiting {
  8632. color:orange;
  8633. }
  8634. .filledReportStyle {
  8635. color:#32CD32;
  8636. }
  8637. .RejectStyle {
  8638. color:red;
  8639. }
  8640. .waitSubmitStyle{
  8641. color: #409eff;
  8642. }
  8643. .chooseDate {
  8644. .waiting {
  8645. color: #20a0ff;
  8646. }
  8647. .filledReportStyle {
  8648. color:#20a0ff;
  8649. }
  8650. .RejectStyle {
  8651. color: #20a0ff;
  8652. }
  8653. .waitSubmitStyle{
  8654. color: #20a0ff;
  8655. }
  8656. }
  8657. .allDaily {
  8658. width:100%;
  8659. }
  8660. .report_title {
  8661. padding:10px 0;
  8662. color:#666;
  8663. }
  8664. .clearfix {
  8665. overflow-x: auto;
  8666. white-space: nowrap;
  8667. padding: 15px 0 10px 0;
  8668. // overflow-y: hidden;
  8669. .date_item {
  8670. padding: 0 3px;
  8671. cursor: pointer;
  8672. position: relative;
  8673. }
  8674. .chooseDate {
  8675. position: absolute;
  8676. bottom: -3px;
  8677. width: 37px;
  8678. height: 2px;
  8679. left: 14px;
  8680. background: #20a0ff;
  8681. }
  8682. }
  8683. .one_daily {
  8684. i {
  8685. color: #9ed0ff;
  8686. margin-right: 5px;
  8687. }
  8688. .one_daily_body {
  8689. padding: 10px 0px;
  8690. p {
  8691. margin: 0;
  8692. line-height: 30px;
  8693. }
  8694. }
  8695. ul {
  8696. padding: 0;
  8697. }
  8698. }
  8699. .checkbtn {
  8700. float: right;
  8701. margin-top: -10px;
  8702. }
  8703. .selConStyle{
  8704. margin-top:9rem;
  8705. margin-bottom:11rem;
  8706. .selConStyle_title{
  8707. height: 3rem;
  8708. text-align: center;
  8709. font-size: 17px;
  8710. }
  8711. .el-select{
  8712. margin: 0 15%;
  8713. width: 70%;
  8714. }
  8715. }
  8716. </style>
  8717. <style lang="scss">
  8718. /*去除upload组件过渡效果*/
  8719. .photos .el-upload-list__item {
  8720. transition: none !important;
  8721. }
  8722. .daily {
  8723. .el-card__body {
  8724. height: 80%;
  8725. overflow-y: auto;
  8726. }
  8727. .el-card__header {
  8728. padding: 0 20px;
  8729. }
  8730. }
  8731. .membListClass{
  8732. .el-dialog__body{
  8733. padding-top: 10px;
  8734. }
  8735. }
  8736. // .editReportDialog .el-dialog__footer{
  8737. // position: sticky;
  8738. // bottom: 0;
  8739. // background: #fff;
  8740. // height: 70px;
  8741. // z-index: 1010;
  8742. // }
  8743. .editReportDialog{
  8744. min-width: 800px;
  8745. }
  8746. .touruxiangmu{
  8747. max-width: 1000px;
  8748. }
  8749. </style>
  8750. <style scoped>
  8751. /* 项目标签的样式 */
  8752. .el-tag + .el-tag {
  8753. margin-left: 10px;
  8754. }
  8755. .button-new-tag {
  8756. margin-left: 10px;
  8757. height: 32px;
  8758. line-height: 30px;
  8759. padding-top: 0;
  8760. padding-bottom: 0;
  8761. }
  8762. .input-new-tag {
  8763. width: 90px;
  8764. margin-left: 10px;
  8765. vertical-align: bottom;
  8766. }
  8767. .selectworktime .el-table__fixed-body-wrapper{
  8768. top: 48px !important;
  8769. }
  8770. .selectworktime_export .selectworktime_export_l{
  8771. width: 650px;
  8772. float: left;
  8773. height: 42px;
  8774. }
  8775. .approvalProcessBox{
  8776. margin-left: 30px;
  8777. font-size: 14px;
  8778. line-height: 16px;
  8779. cursor: pointer;
  8780. }
  8781. .approvalProcessBox i {
  8782. margin-right: 0;
  8783. height: 16px;
  8784. width: 16px;
  8785. display: inline-block;
  8786. transform: scale(1.2);
  8787. position: relative;
  8788. top: 0.5px;
  8789. color: #409eff;
  8790. }
  8791. .approvalProcessBox .approvalProcessClick{
  8792. cursor: pointer;
  8793. color: #409eff;
  8794. font-size: 14px;
  8795. }
  8796. .approvalProcessBox:hover .approvalProcessClick{
  8797. color: #3485fb;
  8798. }
  8799. </style>
  8800. <style lang="scss" scoped>
  8801. .bionicClass {
  8802. -webkit-appearance: none;
  8803. background-color: #FFF;
  8804. background-image: none;
  8805. border-radius: 4px;
  8806. border: 1px solid #DCDFE6;
  8807. box-sizing: border-box;
  8808. color: #606266;
  8809. display: inline-block;
  8810. height: 40px;
  8811. line-height: 40px;
  8812. outline: 0;
  8813. padding: 0 15px;
  8814. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8815. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8816. width: 350px;
  8817. cursor: pointer;
  8818. .bionicClassText {
  8819. color: #C0C4CC;
  8820. }
  8821. }
  8822. // 加班样式
  8823. .overtime {
  8824. display: inline-block;
  8825. margin-left: 20px;
  8826. input {
  8827. display: inline-block;
  8828. margin-top: 5px;
  8829. }
  8830. }
  8831. .plus {
  8832. display: inline-block;
  8833. }
  8834. // .tages {
  8835. // float: right;
  8836. // }
  8837. .overtime {
  8838. display: inline-block;
  8839. margin-left: 30px;
  8840. }
  8841. .bloks {
  8842. display: inline-block;
  8843. width: 380px;
  8844. }
  8845. .zhiss {
  8846. display: flex;
  8847. justify-content: space-around;
  8848. align-items: center;
  8849. }
  8850. .zhoFel {
  8851. display: flex;
  8852. justify-content: space-between;
  8853. align-items: center;
  8854. }
  8855. // 左右滑动样式
  8856. .line {
  8857. width: 30px;
  8858. /* height: 500px; */
  8859. background: #f2f2f2;
  8860. cursor: w-resize;
  8861. }
  8862. .box-father {
  8863. border: 8px solid #000;
  8864. }
  8865. .line-second {
  8866. width: 10px;
  8867. /* background: red; */
  8868. }
  8869. .flex {
  8870. display: flex;
  8871. width: 100%;
  8872. }
  8873. .box-left {
  8874. flex: 0 0 400px;
  8875. /* height: 600px; */
  8876. /* background: blue; */
  8877. }
  8878. .box-right {
  8879. /* height: 600px; */
  8880. /* background: green; */
  8881. flex: 1;
  8882. }
  8883. .box-postion {
  8884. width: 200px;
  8885. /* height: 400px; */
  8886. background: #ccc;
  8887. }
  8888. .custom-tree-node {
  8889. flex: 1;
  8890. display: flex;
  8891. align-items: center;
  8892. justify-content: space-between;
  8893. font-size: 14px;
  8894. padding-right: 8px;
  8895. }
  8896. .daitianrbao {
  8897. width: 100%;
  8898. box-sizing: border-box;
  8899. height: 40px;
  8900. border-radius: 4px;
  8901. border: 1px solid #DCDFE6;
  8902. overflow: hidden;
  8903. text-overflow: ellipsis;
  8904. display: flex;
  8905. // align-items: center;
  8906. }
  8907. .daitianrbao .spnn {
  8908. display: inline-block;
  8909. box-sizing: border-box;
  8910. padding: 0 15px;
  8911. overflow: hidden;
  8912. text-overflow: ellipsis;
  8913. }
  8914. .daitianrbao .hover {
  8915. color: #DCDFE6 !important;
  8916. }
  8917. </style>