daily.vue 414 KB

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