daily.vue 448 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475
  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')" 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 && user.companyId != 3092" 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-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <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> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  252. <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"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <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"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <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"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <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>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <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>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <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>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <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>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  327. <!-- 简陋的无报告提示 -->
  328. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </el-card>
  335. </div>
  336. <!-- 工时推送日志弹窗 -->
  337. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  338. <template>
  339. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  340. </template>
  341. <template>
  342. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  343. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  344. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  345. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  346. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  347. <el-table-column prop="result" label="推送结果" width="250">
  348. <template slot-scope="scope">
  349. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  350. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  354. </el-table>
  355. </template>
  356. <span slot="footer" class="dialog-footer">
  357. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  358. </span>
  359. </el-dialog>
  360. <!-- 填写日报的dialog -->
  361. <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">
  362. <div style="height: 65vh;overflow: auto;">
  363. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  364. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  365. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  366. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  367. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  368. <span class="spnn" v-if="workForm.userNames">
  369. <span v-for="(item, index) in workForm.userNames" :key="index">
  370. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  371. <span v-if="index < workForm.userNames.length - 1">,</span>
  372. </span>
  373. </span>
  374. <span class="spnn hover" v-else>
  375. {{$t('defaultText.pleaseSelectAsubstitute')}}
  376. </span>
  377. </div>
  378. </el-form-item>
  379. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  380. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  381. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  382. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  383. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  384. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  385. <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>
  386. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  387. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  389. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  390. <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>
  391. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  392. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  393. </span>
  394. <!--批量填报和批量代填不显示考勤记录-->
  395. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  396. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  397. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  398. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  399. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  400. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  401. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  402. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  403. @click="refreshAttendance(workForm.createDate)"></el-button>
  404. <!-- AI智能填报 -->
  405. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  406. </el-form-item>
  407. <!-- 000000 -->
  408. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  409. <div v-if="reportTimeType.multiWorktime==0">
  410. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  411. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  412. <el-select v-model="domain.timeType" style="width:200px;"
  413. v-if="reportTimeType.type == 0"
  414. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  415. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  416. @change="onTimeTypeChange(domain.timeType)">
  417. <el-option
  418. v-for="item in timeType"
  419. :key="item.value"
  420. :label="item.label"
  421. :value="item.value">
  422. </el-option>
  423. </el-select>
  424. <!-- 数字时长选择 -->
  425. <el-select v-model="domain.workingTime" style="width:200px;"
  426. v-if="reportTimeType.type == 1"
  427. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  428. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  429. @change="seleChn(0,domain)">
  430. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  431. </el-select>
  432. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  433. <span v-if="reportTimeType.type == 2">
  434. <!--时间范围选择 -->
  435. <el-time-picker
  436. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  437. v-model="domain.startTime"
  438. :placeholder="$t('time.startTime')"
  439. style="width:120px;"
  440. format="HH:mm"
  441. value-format="HH:mm"
  442. :picker-options="{
  443. start: '08:00',
  444. end: '23:30'
  445. }"
  446. @change="iptChang()">
  447. </el-time-picker> - <el-time-picker
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  449. v-model="domain.endTime"
  450. :placeholder="$t('time.endTime')"
  451. style="width:120px;"
  452. format="HH:mm"
  453. value-format="HH:mm"
  454. :picker-options="{
  455. start: '08:00',
  456. end: '23:30',
  457. minTime: domain.startTime
  458. }"
  459. @change="iptChang()">
  460. </el-time-picker>
  461. </span>
  462. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  463. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  464. <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>
  465. </div>
  466. </el-form-item>
  467. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  468. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  469. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  470. @change="selectProject(domain, index)"
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  472. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  473. <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">
  474. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  475. <span style="float: right;">{{ item.projectName }}</span>
  476. </el-option>
  477. </el-option-group>
  478. </el-select>
  479. <!--昱众不显示子项目-->
  480. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  481. <span style="margin-left:45px;">
  482. {{$t('lable.subproject')}}</span>
  483. <!--子项目 -->
  484. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  485. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  486. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </template>
  489. <template v-if="user.companyId == yuzhongCompId">
  490. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  491. <!--角色选择 -->
  492. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  493. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  494. <el-option
  495. v-for="item in roleList"
  496. :key="item.value"
  497. :label="item.label"
  498. :value="item.value">
  499. </el-option>
  500. </el-select>
  501. </template>
  502. <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%;"
  503. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  504. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  505. </el-link>
  506. <!-- <el-link type="primary" v-if="canEdit"
  507. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  508. </el-form-item>
  509. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  510. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  511. </el-form-item>
  512. <!--如果设置了工时成本预警的预算成本项-->
  513. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  514. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  515. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  516. </el-select>
  517. </el-form-item>
  518. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  519. <template slot="label">
  520. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  521. <span >{{$t('lable.taskGrouping')}}</span>
  522. </template>
  523. <!-- 任务分组 -->
  524. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  526. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  527. </el-select>
  528. <template v-if="user.companyId == yuzhongCompId">
  529. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  530. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  531. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  532. <el-option
  533. v-for="item in domain.filteredRespList"
  534. :key="item.id"
  535. :label="item.jobRespon"
  536. :value="item.id">
  537. </el-option>
  538. </el-select>
  539. </template>
  540. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  541. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  542. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  543. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  544. @change="changeStages(domain, index)"
  545. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  546. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  547. </el-select>
  548. </template>
  549. </el-form-item>
  550. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  551. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  552. <template slot="label">
  553. <span style="color:#FF0000;">*</span>
  554. <span >{{$t('other.projectAuditor')}}</span>
  555. </template>
  556. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  557. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  558. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  559. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  560. </el-option>
  561. </el-select>
  562. <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>
  563. </el-form-item>
  564. </div>
  565. <el-form-item v-if="user.companyId == yuzhongCompId">
  566. <template slot="label">
  567. <span style="color:#FF0000;">*</span>
  568. <span >工作内容</span>
  569. </template>
  570. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  571. :disabled="(workForm.domains[index].state>=2?false:true)" >
  572. <el-option
  573. v-for="item in domain.workContentList"
  574. :key="item.id"
  575. :label="item.workContext"
  576. :value="item.id">
  577. </el-option>
  578. </el-select>
  579. </el-form-item>
  580. <!-- 111111 -->
  581. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  582. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  583. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  584. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  585. <span v-else>{{item.name}}</span>
  586. </el-option>
  587. </el-select>
  588. <template v-if="user.timeType.auditLevel > 1">
  589. <i class="el-icon-right"></i>
  590. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  591. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  592. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  593. <span v-else>{{item.name}}</span>
  594. </el-option>
  595. </el-select>
  596. </template>
  597. <template v-if="user.timeType.auditLevel > 2">
  598. <i class="el-icon-right"></i>
  599. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  600. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  601. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  602. <span v-else>{{item.name}}</span>
  603. </el-option>
  604. </el-select>
  605. </template>
  606. </el-form-item>
  607. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  608. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  609. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  610. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  611. <span v-else>{{item.name}}</span>
  612. </el-option>
  613. </el-select>
  614. </el-form-item>
  615. <!-- 相关维度/自定义维度 -->
  616. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  617. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  618. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  623. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  624. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  625. </el-option>
  626. </el-select>
  627. </el-form-item>
  628. <!-- 相关数值 -->
  629. <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">
  630. <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>
  631. </el-form-item>
  632. <!-- 自定义文本 -->
  633. <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">
  634. <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>
  635. </el-form-item>
  636. <!--按比例填报-->
  637. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  638. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  639. <div style="width:400px;">
  640. <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>
  641. <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>
  642. </div>
  643. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  644. <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>
  645. </div>
  646. </el-form-item>
  647. <!--工程专业版本模式下, 各个专业的进度填报 -->
  648. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  649. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  650. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  651. <el-input size="mini" style="width:60px;" v-model="item.progress"
  652. @keyup.native="onProgressChange"
  653. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  654. </span>
  655. </el-form-item>
  656. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  657. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  658. <template slot="label" v-if="user.timeType.taskRequired == 1">
  659. <span style="color:#FF0000;">*</span>
  660. <span >任务</span>
  661. </template>
  662. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  664. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  665. </el-select>
  666. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  667. </el-form-item>
  668. <!--针对依斯贝的SAP服务-->
  669. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  670. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  671. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  673. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  674. </el-select>
  675. </el-form-item>
  676. <!--工作事项-->
  677. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  678. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  679. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  681. </el-form-item>
  682. <!-- 拍照上传 -->
  683. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  684. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  685. <div class="photos">
  686. <div>
  687. <el-upload
  688. list-type="picture-card"
  689. :http-request="(file) => {return addImg(file, index)}"
  690. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  691. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  692. :file-list="domain.imgListUrl" :limit="9"
  693. :disabled="workForm.domains[index].state>=2?false:true">
  694. <i class="el-icon-plus"></i>
  695. </el-upload>
  696. </div>
  697. </div>
  698. </el-form-item>
  699. </div>
  700. <!--多个工作事项填报的情况 -->
  701. <div v-if="reportTimeType.multiWorktime==1">
  702. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  703. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  704. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  705. @change="selectProject(domain, index)"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  707. <!-- <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">
  708. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  709. <span style="float: right;">{{ item.projectName }}</span>
  710. </el-option> -->
  711. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  712. <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">
  713. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  714. <span style="float: right;">{{ item.projectName }}</span>
  715. </el-option>
  716. </el-option-group>
  717. </el-select>
  718. <template v-if="user.timeType.mainProjectState != 1">
  719. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  720. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  721. <!--子项目 -->
  722. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  723. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  724. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  725. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  726. </el-select>
  727. </template>
  728. <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;"
  729. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  730. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  731. </el-link>
  732. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  733. <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>
  734. </div>
  735. <!-- <el-link type="primary" v-if="canEdit"
  736. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  737. </el-form-item>
  738. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  739. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  740. </el-form-item>
  741. <!--如果设置了工时成本预警的预算成本项-->
  742. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  743. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  744. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  745. </el-select>
  746. </el-form-item>
  747. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  748. <!-- 任务分组 -->
  749. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  750. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  751. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  752. </el-select>
  753. <!-- 项目的阶段 -->
  754. <span v-if="domain.stages != null && domain.stages.length> 0"
  755. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  756. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  757. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  758. @change="changeStages(domain, index)"
  759. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  760. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  761. </el-select>
  762. </el-form-item>
  763. <el-form-item :label="$t('other.projectAuditor')" >
  764. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  765. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  766. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  767. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  768. </el-option>
  769. </el-select>
  770. <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>
  771. </el-form-item>
  772. <!--工程专业版本模式下, 各个专业的进度填报 -->
  773. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  774. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  775. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  776. <el-input size="mini" style="width:60px;" v-model="item.progress"
  777. @keyup.native="onProgressChange"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  779. </span>
  780. </el-form-item>
  781. <!-- 相关维度 -->
  782. <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'">
  783. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  784. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  785. </el-option>
  786. </el-select>
  787. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  788. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  789. </el-option>
  790. </el-select>
  791. </el-form-item>
  792. <!-- 相关数值 -->
  793. <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">
  794. <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>
  795. </el-form-item>
  796. <!-- 自定义文本 -->
  797. <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">
  798. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  799. </el-form-item>
  800. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  801. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  802. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  803. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  804. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  805. </el-select>
  806. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  807. </el-form-item>
  808. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  809. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  810. <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>
  811. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  812. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  813. <span v-if="reportTimeType.type == 2">
  814. <!-- <span> -->
  815. <!--时间范围选择 -->
  816. <el-time-picker
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  818. v-model="timeItem.startTime"
  819. :placeholder="$t('time.startTime')"
  820. style="width:120px;"
  821. format="HH:mm"
  822. value-format="HH:mm"
  823. :picker-options="{
  824. start: '00:00',
  825. end: '23:59',
  826. }"
  827. @change="iptChangs()">
  828. </el-time-picker> - <el-time-picker
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  830. v-model="timeItem.endTime"
  831. :placeholder="$t('time.endTime')"
  832. style="width:120px;"
  833. format="HH:mm"
  834. value-format="HH:mm"
  835. :picker-options="{
  836. start: '00:00',
  837. end: '23:59',
  838. minTime: timeItem.startTime
  839. }"
  840. @change="iptChangs()">
  841. </el-time-picker>
  842. </span>
  843. </el-form-item>
  844. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  845. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  846. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  847. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  848. ></el-input>
  849. </el-form-item>
  850. </div>
  851. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  852. </div>
  853. <!--照片的显示 -->
  854. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  855. <el-image v-for="(pic, index) in domain.pics" :key="index"
  856. style="width: 100px; height: 100px; margin-right:10px;"
  857. :src="pic"
  858. :preview-src-list="domain.pics">
  859. </el-image>
  860. </p>
  861. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  862. </div>
  863. <span id="workFormsItemBottom"></span>
  864. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  865. </el-form>
  866. </div>
  867. <span slot="footer" class="dialog-footer">
  868. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  869. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  870. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  871. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  872. <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>
  873. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  874. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  875. </span>
  876. </el-dialog>
  877. <!-- 按周填报 -->
  878. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  879. <!-- 按周填报-已填工时-点击 -->
  880. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  881. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  882. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  883. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  884. <el-table-column prop="state" :label="$t('state.states')">
  885. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  886. </el-table-column>
  887. <!-- <el-table-column label="操作">
  888. <template slot-scope="scope">
  889. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  890. </template>
  891. </el-table-column> -->
  892. </el-table>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  895. </span>
  896. </el-dialog>
  897. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  898. <el-form-item style="height:30px;margin-top:-72px;">
  899. <!-- <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> -->
  900. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  901. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  902. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  903. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  904. <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>
  905. <el-option
  906. v-for="item in fillProjectList"
  907. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  908. :key="item.id"
  909. :label="item.projectName + '\u3000' + item.projectCode"
  910. :value="item.id">
  911. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  912. <span style="float: right">{{ item.projectName }}</span>
  913. </el-option>
  914. </el-select>
  915. <span style="float:right;margin-right:10px;">选择项目</span>
  916. </el-form-item>
  917. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  918. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  919. <template slot-scope="scope">
  920. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  921. </template>
  922. </el-table-column>
  923. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  924. <template slot-scope="scope">
  925. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  926. <p v-else></p>
  927. </template>
  928. </el-table-column> -->
  929. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  930. <template slot-scope="scope">
  931. <div v-if="scope.row.canFill == 1">
  932. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  933. <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>
  934. <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>
  935. <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>
  936. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  937. </div>
  938. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  939. <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>
  940. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  941. </div>
  942. </div>
  943. <div v-else >
  944. <span style="color:#999999;">不可超前填报</span>
  945. </div>
  946. </template>
  947. </el-table-column>
  948. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  949. <template slot-scope="scope">
  950. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  951. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  952. </template>
  953. </el-table-column>
  954. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  955. <template slot-scope="scope">
  956. <div class="zhiss">
  957. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  958. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. </el-table>
  963. </el-form>
  964. <span slot="footer" class="dialog-footer" >
  965. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  966. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  967. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  968. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  969. </span>
  970. </el-dialog>
  971. <!-- 重庆物奇私人定制的按周填报 -->
  972. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  973. <div class="fillWeekDialogVisiCustom">
  974. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  975. </div>
  976. </el-dialog>
  977. <!-- 选择时间 -->
  978. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  979. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  980. <span slot="footer" class="dialog-footer">
  981. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  982. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 按周填报弹窗 -->
  986. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  987. <div>
  988. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  989. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  990. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  991. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <!--如果设置了工时成本预警的预算成本项-->
  995. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  996. <p>{{$t('lable.budgetSource')}}</p>
  997. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  998. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  999. </el-select>
  1000. </div>
  1001. <!-- 任务分组 -->
  1002. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1003. <p>{{$t('lable.taskGrouping')}}</p>
  1004. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1005. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1006. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1007. </el-select>
  1008. </div>
  1009. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1010. <p>{{$t('other.inputStage')}}</p>
  1011. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1012. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1016. <p>{{$t('other.reviewer')}}</p>
  1017. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1018. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <template v-if="user.timeType.reportAuditType == 3">
  1023. <div class="zhoFel">
  1024. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1025. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1026. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1027. </el-select>
  1028. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1029. </div>
  1030. <div class="zhoFel">
  1031. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1032. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1033. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1034. </el-select>
  1035. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1036. </div>
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('chao-song-ren') }}</p>
  1046. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. </template>
  1052. <!-- 自定义维度 -->
  1053. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1054. <p>{{user.timeType.customDegreeName}}</p>
  1055. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1056. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1059. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1060. </el-select>
  1061. </div>
  1062. <!-- 自定义数值 -->
  1063. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1064. <p>{{user.timeType.customDataName}}</p>
  1065. <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>
  1066. </div>
  1067. <!-- 自定义文本 -->
  1068. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1069. <p>{{user.timeType.customTextName}}</p>
  1070. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1071. </div>
  1072. <!-- 选择任务 -->
  1073. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1074. <p>任务 / 里程碑</p>
  1075. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1076. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1080. <p>{{$t('other.timeSelection')}}</p>
  1081. <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>
  1082. </div>
  1083. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1084. <p>{{$t('other.chooseDuration')}}</p>
  1085. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1086. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1087. </el-select>
  1088. </div>
  1089. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1090. <p>{{$t('lable.percentageOfTime')}}</p>
  1091. <div style="width:400px;display: flex;align-items: center;">
  1092. <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>
  1093. <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>
  1094. </div>
  1095. </div>
  1096. <div class="zhoFel">
  1097. <p>{{$t('other.workMatters')}}</p>
  1098. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1099. </div>
  1100. </div>
  1101. <span slot="footer" class="dialog-footer">
  1102. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1103. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1104. </span>
  1105. </el-dialog>
  1106. <!--导出报表条件选择 -->
  1107. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1108. <el-form ref="form3" :model="exportParam" >
  1109. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1110. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1111. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1112. </el-select>
  1113. </el-form-item>
  1114. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1115. <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>
  1116. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1117. </el-form-item>
  1118. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :range-separator="$t('other.to')"
  1123. type="daterange"
  1124. :start-placeholder="$t('time.startDate')"
  1125. :end-placeholder="$t('time.endDate')"
  1126. ></el-date-picker>
  1127. </el-form-item>
  1128. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1129. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1130. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1131. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1132. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1136. <div class="exportReportRadio">
  1137. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1138. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1139. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1140. <i class="el-icon-question"></i>
  1141. </el-tooltip>
  1142. </div>
  1143. </el-form-item>
  1144. </el-form>
  1145. <div slot="footer" class="dialog-footer">
  1146. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1147. </div>
  1148. </el-dialog>
  1149. <!--导出报表条件选择 -->
  1150. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" :model="exportParam" >
  1152. <el-form-item prop="range" :label="$t('time.dateRange')">
  1153. <el-date-picker
  1154. v-model="exportParam.dateRange" :editable="false"
  1155. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1156. :clearable="true"
  1157. :range-separator="$t('other.to')"
  1158. type="daterange"
  1159. :start-placeholder="$t('time.startDate')"
  1160. :end-placeholder="$t('time.endDate')"
  1161. ></el-date-picker>
  1162. </el-form-item>
  1163. </el-form>
  1164. <div slot="footer" class="dialog-footer">
  1165. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1166. </div>
  1167. </el-dialog>
  1168. <!--人员列表 -->
  1169. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1170. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1171. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1172. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  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. <span>
  1177. <!-- {{(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}} -->
  1178. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1179. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1180. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1181. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1182. </span>
  1183. <span v-else>
  1184. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1185. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1186. </span>
  1187. </span>
  1188. </template>
  1189. </el-table-column>
  1190. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1191. <template slot-scope="scope">
  1192. <div>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1194. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1195. </div>
  1196. </template>
  1197. </el-table-column>
  1198. </el-table>
  1199. </el-tab-pane>
  1200. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1201. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1202. <el-table-column prop="label" :label="$t('lable.name')" >
  1203. <template slot-scope="scope">
  1204. <!-- <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> -->
  1205. <!-- <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> -->
  1206. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1208. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1209. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1210. </span>
  1211. <span v-else>
  1212. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1213. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1214. </span>
  1215. </template>
  1216. </el-table-column>
  1217. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1218. <template slot-scope="scope">
  1219. <div>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1222. </div>
  1223. </template>
  1224. </el-table-column>
  1225. </el-table>
  1226. </el-tab-pane>
  1227. </el-tabs>
  1228. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1229. <el-table-column type="selection"></el-table-column>
  1230. <el-table-column prop="label" :label="$t('lable.name')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1239. <template slot-scope="scope">
  1240. <div>
  1241. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1242. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1243. </div>
  1244. </template>
  1245. </el-table-column>
  1246. </el-table>
  1247. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1248. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1249. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1250. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1251. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <!-- 按部门选择人员 -->
  1255. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1256. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1257. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1258. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1259. </el-input>
  1260. <div class="tree" style="height:400px">
  1261. <el-scrollbar style="height:100%">
  1262. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1263. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1264. highlight-current :filter-node-method="filterNode">
  1265. <span class="custom-tree-node" slot-scope="{ node }">
  1266. <span v-if="user.userNameNeedTranslate == '1'">
  1267. <span v-if="node.data.children">
  1268. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1269. </span>
  1270. <span v-else>
  1271. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1272. </span>
  1273. </span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">
  1275. {{ node.label }}
  1276. </span>
  1277. <!-- {{ node.label }} -->
  1278. </span>
  1279. </el-tree>
  1280. </el-scrollbar>
  1281. </div>
  1282. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1283. <div slot="footer" class="dialog-footer">
  1284. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1285. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1286. </div>
  1287. </el-dialog>
  1288. <el-dialog
  1289. v-if="monthWorkTimeDialog"
  1290. :visible.sync="monthWorkTimeDialog"
  1291. :close-on-click-modal="false"
  1292. customClass="customWidth selectworktime"
  1293. width="1200px"
  1294. title=""
  1295. >
  1296. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1297. <el-tabs v-model="activeName" @tab-click="handleClick">
  1298. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1299. <div class="selectworktime_export" style="margin-top:10px;">
  1300. <div class="selectworktime_export_l">
  1301. <el-date-picker
  1302. class="selecteworktime_datapick"
  1303. v-model="WorktimeDatepickValue"
  1304. value-format="yyyy-MM-dd"
  1305. type="daterange"
  1306. align="right"
  1307. unlink-panels
  1308. :range-separator="$t('other.to')"
  1309. :start-placeholder="$t('time.startDate')"
  1310. :end-placeholder="$t('time.endDate')"
  1311. :default-time="['12:00:00', '12:00:00']"
  1312. size="small"
  1313. popper-class="selecteorktime_datapick_popper"
  1314. @change="showMonthWorkTime()"
  1315. >
  1316. </el-date-picker>
  1317. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1318. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1319. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1320. <!-- 222 -->
  1321. </div>
  1322. <div>
  1323. <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">
  1324. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1325. </el-input>
  1326. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1327. </div>
  1328. <el-link
  1329. type="primary"
  1330. style="float: right; vertical-align: middle;height:32px"
  1331. @click="exportMembWorkHours()"
  1332. >{{$t('export.exportData')}}</el-link
  1333. >
  1334. </div>
  1335. <el-table ref="hasworkTbl"
  1336. :data="monthWorkDataS"
  1337. v-el-table-infinite-scroll="listScroll"
  1338. border
  1339. :height="500"
  1340. highlight-current-row
  1341. style="width: 100%"
  1342. v-loading="tbload"
  1343. :lazy="true"
  1344. >
  1345. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1346. <template slot-scope="scope">
  1347. {{ scope.$index + 1 }}
  1348. </template>
  1349. </el-table-column>
  1350. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1351. <template slot-scope="scope">
  1352. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1353. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1354. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1355. <!-- {{scope.row.name}} -->
  1356. </span>
  1357. </template>
  1358. </el-table-column>
  1359. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1360. <template slot-scope="scope">
  1361. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1362. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1363. </template>
  1364. </el-table-column>
  1365. <el-table-column
  1366. min-width="105"
  1367. v-for="(item, index) in pickDateArray"
  1368. :key="index"
  1369. :label="item.label"
  1370. align="center"
  1371. >
  1372. <template slot-scope="scope">
  1373. <div
  1374. style="color: red"
  1375. v-if="
  1376. scope.row.worktimeList.filter(
  1377. (w) =>
  1378. w.createDate==item.date
  1379. ).length > 0 &&
  1380. scope.row.worktimeList.filter(
  1381. (w) =>w.createDate==item.date
  1382. )[0].workingTime < reportTimeType.allday
  1383. "
  1384. >
  1385. {{
  1386. scope.row.worktimeList.filter(
  1387. (w) =>w.createDate==item.date
  1388. )[0].workingTime.toFixed(1)
  1389. }}
  1390. </div>
  1391. <div
  1392. style="color: #20a0ff"
  1393. v-if="
  1394. scope.row.worktimeList.filter(
  1395. (w) =>w.createDate==item.date
  1396. ).length > 0 &&
  1397. scope.row.worktimeList.filter(
  1398. (w) =>w.createDate==item.date
  1399. )[0].workingTime > reportTimeType.allday
  1400. "
  1401. >
  1402. {{
  1403. scope.row.worktimeList.filter(
  1404. (w) =>w.createDate==item.date
  1405. )[0].workingTime.toFixed(1)
  1406. }}
  1407. </div>
  1408. <div
  1409. v-if="
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. ).length > 0 &&
  1413. scope.row.worktimeList.filter(
  1414. (w) =>w.createDate==item.date
  1415. )[0].workingTime == reportTimeType.allday
  1416. "
  1417. >
  1418. {{
  1419. scope.row.worktimeList.filter(
  1420. (w) =>w.createDate==item.date
  1421. )[0].workingTime
  1422. }}
  1423. </div>
  1424. <div
  1425. v-if="
  1426. scope.row.worktimeList.filter(
  1427. (w) =>w.createDate==item.date
  1428. ).length == 0
  1429. "
  1430. >
  1431. 0
  1432. </div>
  1433. <div
  1434. v-if="
  1435. scope.row.worktimeList.filter(
  1436. (w) =>w.createDate==item.date
  1437. ).length > 0 &&
  1438. typeof scope.row.worktimeList.filter(
  1439. (w) =>w.createDate==item.date
  1440. )[0].workingTime == 'string'
  1441. "
  1442. >
  1443. {{
  1444. scope.row.worktimeList.filter(
  1445. (w) =>w.createDate==item.date
  1446. )[0].workingTime
  1447. }}
  1448. </div>
  1449. </template>
  1450. </el-table-column>
  1451. </el-table>
  1452. <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>
  1453. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1454. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1455. <label style="font-size: 16px">员工每日已填报工时数</label>
  1456. <el-link
  1457. type="primary"
  1458. style="float: right; margin-right: 60px"
  1459. @click="exportMembWorkHours()"
  1460. >导出已填报数据</el-link
  1461. > -->
  1462. <!-- <el-button >导出</el-button> -->
  1463. <!-- </div> -->
  1464. </el-tab-pane>
  1465. <el-tab-pane label="未提交人员列表" name="second" >
  1466. <div class="selectworktime_export" style="margin-top:10px">
  1467. <div class="selectworktime_export_l">
  1468. <el-date-picker
  1469. class="selecteworktime_datapick"
  1470. v-model="WorktimeDatepickValue"
  1471. value-format="yyyy-MM-dd"
  1472. type="daterange"
  1473. align="right"
  1474. unlink-panels
  1475. :range-separator="$t('other.to')"
  1476. :start-placeholder="$t('time.startDate')"
  1477. :end-placeholder="$t('time.endDate')"
  1478. :default-time="['12:00:00', '12:00:00']"
  1479. size="small"
  1480. popper-class="selecteorktime_datapick_popper"
  1481. @change="showMonthNotWorkTime()"
  1482. >
  1483. </el-date-picker>
  1484. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1485. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1486. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1487. </div>
  1488. <div>
  1489. <div style="margin-top:10px;">
  1490. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1491. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1492. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1493. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1494. </el-input>
  1495. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1496. <el-link
  1497. type="primary"
  1498. style="float: right; vertical-align: middle;height:32px"
  1499. @click="exportMembNotWorkHours()"
  1500. >{{$t('export.exportData')}}</el-link
  1501. >
  1502. </div>
  1503. </div>
  1504. </div>
  1505. <el-table
  1506. ref="hasworkTbl2"
  1507. :data="monthNotWorkDateS"
  1508. v-el-table-infinite-scroll="notListScroll"
  1509. border
  1510. :height="500"
  1511. highlight-current-row
  1512. style="width: 100%"
  1513. v-loading="tbload"
  1514. lazy
  1515. >
  1516. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1517. <template slot-scope="scope">
  1518. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1519. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1520. </template>
  1521. </el-table-column>
  1522. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1523. <template slot-scope="scope">
  1524. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1525. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1526. </template>
  1527. </el-table-column>
  1528. <el-table-column
  1529. min-width="200"
  1530. :label="$t('weekDay.date')"
  1531. align="center"
  1532. prop="createDate"
  1533. >
  1534. </el-table-column>
  1535. <el-table-column
  1536. min-width="200"
  1537. :label="$t('state.states')"
  1538. align="center"
  1539. prop="status"
  1540. />
  1541. <el-table-column
  1542. min-width="200"
  1543. :label="$t('other.attendanceData')"
  1544. prop="cardTime"
  1545. align="center"
  1546. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1547. </el-table>
  1548. <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>
  1549. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1550. </el-tab-pane>
  1551. </el-tabs>
  1552. </el-dialog>
  1553. <!--驳回弹出框 -->
  1554. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1555. <div>
  1556. <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')" />
  1557. </div>
  1558. <div slot="footer" class="dialog-footer">
  1559. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1560. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1561. </div>
  1562. </el-dialog>
  1563. <!-- 通过弹出框 -->
  1564. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1565. <div>
  1566. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1567. </div>
  1568. <div slot="footer" class="dialog-footer">
  1569. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1570. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1571. </div>
  1572. </el-dialog>
  1573. <!--批量导入日报 -->
  1574. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1575. <p>1. {{$t('other.download')}}
  1576. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1577. </p>
  1578. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1579. <p style="display: flex;justify-content: center;">
  1580. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1581. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1582. </el-upload>
  1583. </p>
  1584. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1585. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1586. </div>
  1587. </el-dialog>
  1588. <!-- 工时导入记录弹窗 -->
  1589. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1590. <div style="height: 452px">
  1591. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1592. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1593. <el-table-column prop="userName" :label="$t('other.operator')">
  1594. <template slot-scope="scope">
  1595. <div>
  1596. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1597. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1598. </div>
  1599. </template>
  1600. </el-table-column>
  1601. <el-table-column prop="datel" :label="$t('other.document')">
  1602. <template slot-scope="scope">
  1603. <div>
  1604. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1605. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1606. </div>
  1607. </template>
  1608. </el-table-column>
  1609. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1610. <template slot-scope="scope">
  1611. <div>
  1612. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1613. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1614. </div>
  1615. </template>
  1616. </el-table-column>
  1617. </el-table>
  1618. <el-col :span="24" class="paginatis">
  1619. <el-pagination
  1620. @size-change="handleSizeChange"
  1621. @current-change="handleCurrentChange"
  1622. :page-sizes="[20 , 50 , 80 , 100]"
  1623. :page-size="20"
  1624. layout="total, sizes, prev, pager, next"
  1625. :total="toViewForm.total"
  1626. style="float:right;"
  1627. ></el-pagination>
  1628. </el-col>
  1629. </div>
  1630. </el-dialog>
  1631. <!--基于企业微信考勤数据的工时导入 -->
  1632. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1633. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1634. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1635. </el-step>
  1636. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1637. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1638. </el-steps>
  1639. <div v-if="active==0" style="padding:30px;height:360px;">
  1640. <div style="margin-top:50px;margin-left:280px;">
  1641. <el-date-picker
  1642. v-model="importWxParam.date" :editable="false"
  1643. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1644. :clearable="true"
  1645. :range-separator="$t('other.to')"
  1646. type="daterange"
  1647. :start-placeholder="$t('time.startDate')"
  1648. :end-placeholder="$t('time.endDate')"
  1649. @change="loadCheckInData"
  1650. ></el-date-picker>
  1651. </div>
  1652. </div>
  1653. <div v-if="active==1" style="padding:10px;">
  1654. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1655. style="width: 100%;margin-top:5px;" >
  1656. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1657. <template slot-scope="scope">
  1658. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1659. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1660. </template>
  1661. </el-table-column>
  1662. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1663. </el-table-column>
  1664. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1665. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1666. <template slot-scope="scope">
  1667. <div>
  1668. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1669. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1670. </div>
  1671. </template>
  1672. </el-table-column>
  1673. <el-table-column prop="departmentName" label="部门" >
  1674. <template slot-scope="scope">
  1675. <div>
  1676. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1677. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1678. </div>
  1679. </template>
  1680. </el-table-column>
  1681. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1682. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1683. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1684. <template slot-scope="scope">
  1685. {{scope.row.workHours.toFixed(1)}}h
  1686. </template>
  1687. </el-table-column>
  1688. </el-table>
  1689. </div>
  1690. <div v-if="active==2" >
  1691. <p style="display: flex;justify-content: center;height:390px;">
  1692. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1693. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1694. </el-upload>
  1695. </p>
  1696. </div>
  1697. <div slot="title">
  1698. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1699. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1700. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1701. <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>
  1702. <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>
  1703. <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>
  1704. </div>
  1705. <span slot="footer">
  1706. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1707. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1708. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1709. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1710. </span>
  1711. </el-dialog>
  1712. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1713. <p style="display: flex;justify-content: center;height:100px;">
  1714. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1715. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1716. </el-upload>
  1717. </p>
  1718. </el-dialog>
  1719. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1720. <div>
  1721. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1722. v-model="deleteReportParam.date" :editable="false"
  1723. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1724. :clearable="true"
  1725. :range-separator="$t('other.to')"
  1726. type="daterange"
  1727. :start-placeholder="$t('time.startDate')"
  1728. :end-placeholder="$t('time.endDate')"
  1729. ></el-date-picker>
  1730. </div>
  1731. <div style="margin-top:10px;">
  1732. <span>请选择部门:</span>
  1733. <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>
  1734. <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>
  1735. </div>
  1736. <div style="margin-top:10px;">
  1737. <span>请选择员工:</span>
  1738. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1739. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1740. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1741. <span v-else>{{item.name}}</span>
  1742. </el-option>
  1743. </el-select>
  1744. </div>
  1745. <span slot="footer">
  1746. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1747. </span>
  1748. </el-dialog>
  1749. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1750. <div>
  1751. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1752. v-model="deleteReportParam.date" :editable="false"
  1753. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1754. :clearable="true"
  1755. :range-separator="$t('other.to')"
  1756. type="daterange"
  1757. :start-placeholder="$t('time.startDate')"
  1758. :end-placeholder="$t('time.endDate')"
  1759. ></el-date-picker>
  1760. </div>
  1761. <div style="margin-top:15px;">
  1762. <span>选择部门:</span>
  1763. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1764. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1765. size="small" v-if="user.userNameNeedTranslate != 1"
  1766. ></el-cascader>
  1767. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1768. </div>
  1769. <span slot="footer">
  1770. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1771. </span>
  1772. </el-dialog>
  1773. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1774. <div>
  1775. <span>选择时间:</span><el-date-picker
  1776. v-model="modImportTime"
  1777. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1778. :clearable="true"
  1779. type="datetime"
  1780. ></el-date-picker>
  1781. <span>选择导入人员:</span><el-select
  1782. v-model="modImportUserId"
  1783. >
  1784. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1785. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1786. <span v-else>{{item.name}}</span>
  1787. </el-option>
  1788. </el-select>
  1789. </div>
  1790. <span slot="footer">
  1791. <el-button @click="confirmChangeModTime" >确认</el-button>
  1792. </span>
  1793. </el-dialog>
  1794. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1795. <div>
  1796. <span>请选择年月:</span>
  1797. <el-date-picker
  1798. v-model="ratioYmonth" :editable="false"
  1799. format="yyyyMM" value-format="yyyyMM"
  1800. type="month"
  1801. ></el-date-picker>
  1802. </div>
  1803. <span slot="footer">
  1804. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1805. </span>
  1806. </el-dialog>
  1807. <!--工时批量代填 -->
  1808. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1809. <div>
  1810. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1811. v-model="importWxParam.date" :editable="false"
  1812. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1813. :clearable="true"
  1814. :range-separator="$t('other.to')"
  1815. type="daterange"
  1816. :start-placeholder="$t('time.startDate')"
  1817. :end-placeholder="$t('time.endDate')"
  1818. @change="loadCheckInData"
  1819. ></el-date-picker>
  1820. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1821. </div>
  1822. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1823. :key="timeStamp"
  1824. style="width: 100%;margin-top:5px;" ref="tab">
  1825. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1826. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1827. <template slot-scope="scope">
  1828. <div>
  1829. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1830. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1831. </div>
  1832. </template>
  1833. </el-table-column>
  1834. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1835. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1836. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1837. <template slot-scope="scope">
  1838. {{scope.row.workHours.toFixed(1)}}h
  1839. </template>
  1840. </el-table-column>
  1841. <!--项目名称列表 -->
  1842. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1843. <template slot-scope="scope">
  1844. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1845. </template>
  1846. </el-table-column>
  1847. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1848. <template slot-scope="scope">
  1849. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1850. </template>
  1851. </el-table-column>
  1852. </el-table>
  1853. </el-dialog>
  1854. <!--基于企业微信考勤数据的工时导入 -->
  1855. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1856. <div style="padding-bottom:10px;">
  1857. <p>{{importResultMsg}}</p>
  1858. </div>
  1859. <!-- <span slot="footer" class="dialog-footer">
  1860. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1861. </span> -->
  1862. </el-dialog>
  1863. <!-- 审核流程展示 -->
  1864. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1865. <div style="padding:20px 40px 20px 0">
  1866. <el-timeline :reverse="false">
  1867. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1868. <!-- {{item.msg}} -->
  1869. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1870. <span v-if="user.userNameNeedTranslate == 1">
  1871. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1872. <span>{{item.msgCon.two}}</span>
  1873. </span>
  1874. </el-timeline-item>
  1875. </el-timeline>
  1876. </div>
  1877. </el-dialog>
  1878. </section>
  1879. </template>
  1880. <script>
  1881. // 左右滑动
  1882. import dragMixin from "@/common/js/tensile.js";
  1883. import util from "../../common/js/util";
  1884. // 自定义select组件
  1885. import selectCat from "@/components/select.vue"
  1886. // 引入自定义级联组件
  1887. import vueCascader from "@/components/cascader.vue"
  1888. // 重庆物奇定制组件
  1889. import WeeklyCustomization from "./weeklyCustomization.vue"
  1890. import { mapMutations } from 'vuex'
  1891. let _that = this
  1892. export default {
  1893. mixins: [dragMixin],
  1894. components: {
  1895. selectCat,
  1896. vueCascader,
  1897. WeeklyCustomization
  1898. },
  1899. data() {
  1900. return {
  1901. pageIndex: 0,
  1902. hasMore: true,
  1903. exportType: 0,
  1904. exportingData: false,
  1905. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1906. jobResponseList:[],
  1907. yisibeiCompId: 3092,
  1908. yuzhongCompId: 3385,
  1909. mingyiName : '成都明夷电子科技有限公司',
  1910. // mingyiName : '明夷',
  1911. modItemDataId: null,
  1912. modImportTime: null,
  1913. modImportUserId: null,
  1914. showModImportTimeDialog: false,
  1915. showBatchSimpleApproveReport: false,
  1916. startDeleting: false,
  1917. showBatchDeleteReport: false,
  1918. deleteReportParam: {date:null, userIds:[]},
  1919. isDenying: false,
  1920. targetWeekDate: null,//填写周报中的周日期
  1921. importCardTimeVisi: false,
  1922. startRatioExporting: false,
  1923. exportUserRatio: false,
  1924. ratioYmonth:null,
  1925. hasWrittenReport: false,
  1926. today:null,
  1927. syncTimeLoading: false,
  1928. seluserText: '',
  1929. translation: '1', // 1、文字, 2、部门, 3、人员
  1930. exportLoad: false,
  1931. getPickerOptions: {
  1932. disabledDate: (time) => {
  1933. var date = new Date();
  1934. var year = date.getFullYear();
  1935. var month = date.getMonth() + 1;
  1936. if (month >= 1 && month <= 9) {
  1937. month = "0" + month;
  1938. }
  1939. var currentdate = year.toString() + month.toString();
  1940. var timeyear = time.getFullYear();
  1941. var timemonth = time.getMonth() + 1;
  1942. if (timemonth >= 1 && timemonth <= 9) {
  1943. timemonth = "0" + timemonth;
  1944. }
  1945. var timedate = timeyear.toString() + timemonth.toString();
  1946. if(this.user.timeType.fillAhead == 0){
  1947. return currentdate < timedate;
  1948. }else{
  1949. return false
  1950. }
  1951. }
  1952. },
  1953. alalal: '8.0',
  1954. timeBasecostList:null,
  1955. tbload: false,
  1956. exportTimeDialog: false,
  1957. searchKeyword: '',
  1958. monthWorkDataS: [],
  1959. monthNotWorkDateS: [],
  1960. pickDateArray:[],
  1961. WorktimeDatepickValue: [],
  1962. activeName:"first",
  1963. isLeave: 0,
  1964. submitingReport: false,
  1965. importResultMsg:null,
  1966. showImportResult:false,
  1967. importingData: false,
  1968. isDraft: 0,
  1969. timeStamp: 0,
  1970. projectColumns:[],
  1971. checkinLoading:false,
  1972. importWxParam:{date:null,},
  1973. active:0,
  1974. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1975. importWxDialog:false,
  1976. importDialog:false,
  1977. denyForm:null,
  1978. denyReasonDialog:false,
  1979. monthWorkTimeDialog: false,
  1980. isSubstitude:false,
  1981. isFill:false,
  1982. unFillList:[],
  1983. fillList:[],
  1984. fillMembList:[],
  1985. fillMembList_leave: [],
  1986. membListVisible: false,
  1987. isBatch:0,//是否是批量填报
  1988. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1989. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1990. 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')],
  1991. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1992. fillStatusList: [],
  1993. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1994. exportDialog:false,
  1995. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1996. subProjectList:[],
  1997. canEdit: true,
  1998. originCanEdit: true,
  1999. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2000. selectTime:null,
  2001. reportTimeType:{},
  2002. curDate:'',
  2003. isAllSelect: false,
  2004. approveDialogVisible:false,
  2005. deptId:null,
  2006. targetUid: null,
  2007. membCount:0,
  2008. selectState:"-1",
  2009. user: JSON.parse(sessionStorage.getItem("user")),
  2010. allUsersList: [],
  2011. showAddMore:false,
  2012. allDate: [],
  2013. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2014. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2015. choseDay: 0,
  2016. tableHeight: 0,
  2017. listLoading: false,
  2018. projectList: [], //项目列表
  2019. fillProjectList: [],
  2020. reportList: [], //日报列表
  2021. reportNames:[], //批量审批列表
  2022. selCon:[], //筛选条件
  2023. selProjectList:[], //筛选后项目列表
  2024. selConShow: true,
  2025. usersList: [], // 全部人员列表
  2026. usersListId: '', // 选中的人员id
  2027. dialogVisible: false, //项目弹窗
  2028. report: '',
  2029. workForm: {
  2030. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2031. domains: [{
  2032. id: null,
  2033. projectId: "",
  2034. workingTime: "",
  2035. timeType:0,
  2036. content: "",
  2037. state: 2,
  2038. multiWorktime:0,
  2039. worktimeList:[],
  2040. degreeId: null,
  2041. auditUserList: [],
  2042. }],
  2043. },
  2044. workRules: {
  2045. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2046. },
  2047. chooseParticipVisible: false,
  2048. logining: false,
  2049. isDisable: false,
  2050. timeType:[],
  2051. deptMembData: [
  2052. ],
  2053. //部门人员树状结构
  2054. data: [
  2055. {
  2056. id: -1,
  2057. label: this.$t('lable.allStaff'),
  2058. membCount:0
  2059. },
  2060. {
  2061. id: 0,
  2062. label: this.$t('lable.unassigned'),
  2063. }
  2064. ],
  2065. allData:{},
  2066. batchShowData:{},
  2067. option: [],
  2068. deptOptionList: [],
  2069. depData: {
  2070. id: -1,
  2071. label: this.$t('lable.allStaff'),
  2072. },
  2073. defaultProps: {
  2074. children: 'children',
  2075. label: 'label'
  2076. },
  2077. isNew: false,
  2078. selected: false,
  2079. valuet: new Date(),
  2080. domObj: null,
  2081. participator:[],
  2082. chosenMembCount:0,
  2083. jsDay: 0,
  2084. jsTime: 0,
  2085. falsss: false,
  2086. weidu: [],
  2087. weiduList: [],
  2088. yonghuUser: [],
  2089. dateAr: [],
  2090. batchSubFillDialog: false,
  2091. isSubstiS: false,
  2092. fillWeekDialogVisi: false,
  2093. fillWeekDialogVisiCustom: false,
  2094. zhoData: [],
  2095. weekDateRange: [],
  2096. btnZho: false,
  2097. weekDataLoading: false,
  2098. changdu: 6,
  2099. tianxieDialogVisible: false,
  2100. scopess: {},
  2101. zhoBao: {
  2102. time: '',
  2103. workingTime: '',
  2104. progress: '',
  2105. con: '',
  2106. subProjectId: '',
  2107. stage: '',
  2108. subProjectList: [],
  2109. stages: [],
  2110. },
  2111. zhoBaoIdx: '',
  2112. zhoBaoName: '',
  2113. zhis: {},
  2114. dealList: [],
  2115. toViewDialogVisible: false,
  2116. toViewList: [],
  2117. toViewloading: true,
  2118. toViewForm: {
  2119. pageIndex: '1',
  2120. pageSize: '20',
  2121. total: 0,
  2122. },
  2123. toViewloadings: false,
  2124. tabPositionss: 'top',
  2125. monthTotal: 0,
  2126. monthTotalPage: 0,
  2127. monthTotalLages: 20,
  2128. monthWorkData: [],
  2129. monthNotWorkDate: [],
  2130. monthWorkDataS1: [],
  2131. monthnotTotal: 0,
  2132. monthnotTotalPage: 0,
  2133. monthnotTotalLages: 20,
  2134. monthNotWorkDateS1: [],
  2135. deptMembDataText: '',
  2136. isFlag: false,
  2137. isMore: false,
  2138. stateKey: '0',
  2139. expandDate: [],
  2140. notifySelList:[],
  2141. departmentList: [],
  2142. approvalProcessDialog: false,
  2143. approvalProcessData: [],
  2144. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2145. 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')],
  2146. isWeekend: false,
  2147. canCancelInDialog: false,
  2148. approveinData: {},
  2149. approveinDialog: false,
  2150. reportCanDelete: false,
  2151. weeklyFilledTimeDialog: false,
  2152. weeklyFilledTimeList: [],
  2153. weeklyFilledTimeLoading: false,
  2154. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2155. weeklyFilledTimeCanDelete: false,
  2156. weeklyFilledTimeDate: null,
  2157. leaveAllNum: 0,
  2158. dataLoading: false,
  2159. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2160. vacationTime: {},
  2161. integrationProjectList: [],
  2162. totalReportHours: 0, // 合计的工时
  2163. workTimeForMinYi:0,
  2164. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2165. weekIndex: 1,
  2166. weekParentData: {},
  2167. deptIdForNoReport:[],
  2168. nameAearch: '', // 企业微信姓名搜索
  2169. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2170. deptMembDataLoading: false,
  2171. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2172. {
  2173. id: 4811,
  2174. // id: 10,
  2175. name: '陕西柘中建设工程有限公司'
  2176. }
  2177. ],
  2178. pushWorkTimeLogDig:false,
  2179. pushWorkTimeLogData:[],
  2180. };
  2181. },
  2182. watch: {
  2183. deptMembDataText(val) {
  2184. this.$refs.chooseMembTree.filter(val);
  2185. }
  2186. },
  2187. filters: {
  2188. // 过滤
  2189. amounts(value) {
  2190. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2191. return 0
  2192. }
  2193. var zhi = +value + 0
  2194. return zhi.toFixed(1)
  2195. },
  2196. // zhoData
  2197. zhoData(value, arr) {
  2198. var dateArray = value.split("-");
  2199. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2200. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2201. // console.log(arr[date.getDay()])
  2202. // return "周" + "日一二三四五六".charAt(date.getDay());
  2203. return arr[date.getDay()]
  2204. },
  2205. // 过滤数字
  2206. numbers(value) {
  2207. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2208. return 0
  2209. }
  2210. return value
  2211. },
  2212. },
  2213. computed: {},
  2214. mounted() {
  2215. var now = new Date();
  2216. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2217. this.today = t;
  2218. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2219. this.exportParam.dateRange = [startStr,t];
  2220. this.getAllDate(1);
  2221. this.getReportList();
  2222. this.getProjectList();
  2223. this.getFillProjectList();
  2224. this.getTimeType();
  2225. this.getDepartment();
  2226. this.scrollFunction()
  2227. this.userssHu();
  2228. if(this.user.timeType.reportAuditType == 3){
  2229. this.getAllUsersList()
  2230. }
  2231. if (this.user.company.packageProject == 1) {
  2232. this.getBasecostItemList();
  2233. }
  2234. if(this.user.timeType.lockWorktime){
  2235. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2236. }
  2237. //设置了下限
  2238. if (this.user.timeType.minReportTime) {
  2239. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2240. }
  2241. const that = this
  2242. if(this.user.userNameNeedTranslate == 1) {
  2243. that.dataLoading = that.$store.state.dataLoading
  2244. this.upDataLoading()
  2245. setTimeout(()=>{
  2246. that.dataLoading = that.$store.state.dataLoading
  2247. }, 1000)
  2248. }
  2249. if (this.user.companyId == this.yuzhongCompId) {
  2250. this.getJobResponList();
  2251. }
  2252. },
  2253. methods: {
  2254. ...mapMutations(['upDataLoading']),
  2255. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2256. isCustomization(userInfo, permissionArray) {
  2257. const { companyId } = userInfo
  2258. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2259. return isReportPictureRequired
  2260. },
  2261. //任务被选中
  2262. onTaskSelected(domainItem) {
  2263. //取服务
  2264. if (domainItem.taskId) {
  2265. var that = this;
  2266. var param = {taskId:domainItem.taskId};
  2267. if (this.isSubstitude) {
  2268. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2269. param.userId = this.workForm.userId[0];
  2270. }
  2271. }
  2272. this.http.post('/task/getMyTaskService',param, res => {
  2273. if (res.code == "ok") {
  2274. // domainItem.workContentList = res.data;
  2275. that.$set(domainItem, 'sapServiceId', null);
  2276. that.$set(domainItem, 'serviceList', res.data);
  2277. } else {
  2278. this.$message({
  2279. message: res.msg,
  2280. type: "error"
  2281. });
  2282. }
  2283. },error => {
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. }
  2289. );
  2290. } else {
  2291. //清空服务
  2292. }
  2293. },
  2294. onBatchTimeChange() {
  2295. //反向计算每日工作时长
  2296. if (this.workForm.createDate) {
  2297. let sdate = new Date(this.workForm.createDate[0]);
  2298. let edate = new Date(this.workForm.createDate[1]);
  2299. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2300. console.log('days===', days)
  2301. if (days < 0) {
  2302. return;
  2303. }
  2304. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2305. //总时长发生改变,自动按比例计算
  2306. this.workForm.domains.forEach(d=>{
  2307. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2308. });
  2309. }
  2310. },
  2311. //更新工作内容列表
  2312. updateJobContent(domainItem) {
  2313. var that = this;
  2314. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2315. if (res.code == "ok") {
  2316. // domainItem.workContentList = res.data;
  2317. that.$set(domainItem, 'extraField3', null);
  2318. that.$set(domainItem, 'workContentList', res.data);
  2319. } else {
  2320. this.$message({
  2321. message: res.msg,
  2322. type: "error"
  2323. });
  2324. }
  2325. },error => {
  2326. this.$message({
  2327. message: error,
  2328. type: "error"
  2329. });
  2330. }
  2331. );
  2332. },
  2333. updateResponse(domainItem) {
  2334. var that = this;
  2335. var selectPid = domainItem.projectId;
  2336. domainItem.extraField2 = null;
  2337. domainItem.extraField3 = null;
  2338. if (selectPid && domainItem.extraField1) {
  2339. //是否非项目
  2340. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2341. console.log('==========','isPublic=='+isPublic);
  2342. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2343. console.log(filteredRespList);
  2344. domainItem.filteredRespList = filteredRespList;
  2345. }
  2346. },
  2347. getJobResponList() {
  2348. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2349. if (res.code == "ok") {
  2350. this.jobResponseList = res.data;
  2351. } else {
  2352. this.$message({
  2353. message: res.msg,
  2354. type: "error"
  2355. });
  2356. }
  2357. },error => {
  2358. this.$message({
  2359. message: error,
  2360. type: "error"
  2361. });
  2362. }
  2363. );
  2364. },
  2365. openModImportTime(row) {
  2366. this.showModImportTimeDialog = true;
  2367. this.modItemDataId = row.id;
  2368. },
  2369. delImportTime(row) {
  2370. let rowId = row.id;
  2371. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2372. confirmButtonText: this.$t('btn.determine'),
  2373. cancelButtonText: this.$t('btn.cancel'),
  2374. type: "warning"
  2375. })
  2376. .then(() => {
  2377. this.http.post('/report-import-log/delete',{
  2378. id: rowId
  2379. },res => {
  2380. if (res.code == "ok") {
  2381. this.$message({
  2382. message: '删除成功',
  2383. type: "success"
  2384. });
  2385. this.getToView();
  2386. } else {
  2387. this.$message({
  2388. message: res.msg,
  2389. type: "error"
  2390. });
  2391. }
  2392. },error => {
  2393. this.$message({
  2394. message: error,
  2395. type: "error"
  2396. });
  2397. }
  2398. );
  2399. }).catch(() => {this.startDeleting = false});
  2400. },
  2401. confirmChangeModTime() {
  2402. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2403. this.$message({
  2404. message: '请选择时间',
  2405. type: "error"
  2406. });
  2407. return;
  2408. }
  2409. this.http.post('/report-import-log/changeTime',{
  2410. modLogDateTime: this.modImportTime,
  2411. modImportUserId: this.modImportUserId,
  2412. id: this.modItemDataId
  2413. },res => {
  2414. if (res.code == "ok") {
  2415. this.$message({
  2416. message: '修改成功',
  2417. type: "success"
  2418. });
  2419. this.getToView();
  2420. this.showModImportTimeDialog = false;
  2421. } else {
  2422. this.$message({
  2423. message: res.msg,
  2424. type: "error"
  2425. });
  2426. }
  2427. },error => {
  2428. this.$message({
  2429. message: error,
  2430. type: "error"
  2431. });
  2432. }
  2433. );
  2434. },
  2435. confirmBatchApproveReport() {
  2436. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2437. this.$message({
  2438. message: '请选择日期范围',
  2439. type: "error"
  2440. });
  2441. return;
  2442. }
  2443. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2444. confirmButtonText: this.$t('btn.determine'),
  2445. cancelButtonText: this.$t('btn.cancel'),
  2446. type: "warning"
  2447. })
  2448. .then(() => {
  2449. this.startDeleting = true;
  2450. let obj = {
  2451. startDate: this.deleteReportParam.date[0],
  2452. endDate: this.deleteReportParam.date[1]
  2453. }
  2454. if(this.deleteReportParam.departmentId) {
  2455. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2456. } else {
  2457. obj.departmentId = null
  2458. }
  2459. this.http.post('/report/batchApproveByDate',obj,res => {
  2460. if (res.code == "ok") {
  2461. this.$message({
  2462. message: '审核通过',
  2463. type: "success"
  2464. });
  2465. this.getReportList();
  2466. this.getDepartment();
  2467. this.startDeleting = false;
  2468. } else {
  2469. this.$message({
  2470. message: res.msg,
  2471. type: "error"
  2472. });
  2473. }
  2474. },error => {
  2475. this.$message({
  2476. message: error,
  2477. type: "error"
  2478. });
  2479. }
  2480. );
  2481. }).catch(() => {this.startDeleting = false});
  2482. },
  2483. confirmBatchDelReport() {
  2484. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2485. this.$message({
  2486. message: '请选择部门或人员',
  2487. type: "error"
  2488. });
  2489. return;
  2490. }
  2491. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2492. this.$message({
  2493. message: '请选择日期范围',
  2494. type: "error"
  2495. });
  2496. return;
  2497. }
  2498. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2499. confirmButtonText: this.$t('btn.determine'),
  2500. cancelButtonText: this.$t('btn.cancel'),
  2501. type: "warning"
  2502. })
  2503. .then(() => {
  2504. this.startDeleting = true;
  2505. this.http.post('/report/batchDelete',{
  2506. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2507. startDate: this.deleteReportParam.date[0],
  2508. endDate: this.deleteReportParam.date[1],
  2509. deptId: this.deleteReportParam.deptId[0]
  2510. },res => {
  2511. if (res.code == "ok") {
  2512. this.$message({
  2513. message: this.$t('message.successfullyDeleted'),
  2514. type: "success"
  2515. });
  2516. this.getReportList();
  2517. this.getDepartment();
  2518. this.startDeleting = false;
  2519. } else {
  2520. this.$message({
  2521. message: res.msg,
  2522. type: "error"
  2523. });
  2524. }
  2525. },error => {
  2526. this.$message({
  2527. message: error,
  2528. type: "error"
  2529. });
  2530. }
  2531. );
  2532. }).catch(() => {this.startDeleting = false});
  2533. },
  2534. getRecentlyProject() {
  2535. this.http.post('/project/nearProject',{},res => {
  2536. if(res.code == 'ok'){
  2537. let topObj = {
  2538. label: '最近选择项目',
  2539. peojectList: res.data
  2540. }
  2541. let botomObj = {
  2542. label: '全部项目',
  2543. peojectList: this.fillProjectList
  2544. }
  2545. //最近项目如果在fillProjectList中不存在,需要移除
  2546. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2547. this.integrationProjectList = [topObj, botomObj]
  2548. }else {
  2549. this.$message({
  2550. message: res.msg,
  2551. type: 'error'
  2552. })
  2553. }
  2554. },err => {
  2555. this.$message({
  2556. message: err,
  2557. type: 'error'
  2558. })
  2559. })
  2560. },
  2561. handlePictureCardPreview(file, index) {
  2562. console.log(file, index)
  2563. let arr = []
  2564. let imgArr = this.workForm.domains[index].imgListUrl
  2565. for(var i in imgArr) {
  2566. arr.push(imgArr[i].url)
  2567. }
  2568. console.log(arr, '图片数据')
  2569. const $viewer = this.$viewerApi({
  2570. images: arr
  2571. });
  2572. },
  2573. // 图片上传
  2574. addImg(e, index) {
  2575. console.log(e, '数据')
  2576. let formData = new FormData()
  2577. formData.append('multipartFile', e.file)
  2578. this.http.uploadFile('/common/uploadFile', formData,
  2579. res => {
  2580. if (res.code == "ok") {
  2581. this.$message({
  2582. message: this.$t('uploadedsuccessfully'),
  2583. type: "success"
  2584. });
  2585. if(!this.workForm.domains[index].imgList) {
  2586. this.workForm.domains[index].imgList = []
  2587. this.workForm.domains[index].imgListUrl = []
  2588. }
  2589. this.workForm.domains[index].imgList.push(res.data)
  2590. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2591. } else {
  2592. this.$message({message: res.msg,type: "error"});
  2593. }
  2594. console.log(this.workForm.domains[index])
  2595. },
  2596. error => {this.$message({message: error,type: "error"});
  2597. });
  2598. },
  2599. // 删除图片
  2600. delImg(file,fileList, index) {
  2601. console.log(file, fileList)
  2602. let idx = 0
  2603. for(let i in fileList) {
  2604. if(fileList[i].uid == file.uid) {
  2605. idx = i
  2606. }
  2607. }
  2608. this.workForm.domains[index].imgList.splice(idx, 1)
  2609. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2610. console.log(this.workForm.domains[index])
  2611. },
  2612. test(){
  2613. console.log('test',this.workForm.domains);
  2614. },
  2615. getHour(s1, s2) {
  2616. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2617. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2618. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2619. var ms = s2.getTime() - s1.getTime();
  2620. if (ms < 0) return 0;
  2621. let ma = ms / 1000 / 60 / 60
  2622. return ma; //小时
  2623. },
  2624. refreshWXCardTime(workdate) {
  2625. if (!workdate) return;
  2626. this.syncTimeLoading = true;
  2627. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2628. date: workdate,
  2629. },res => {
  2630. this.syncTimeLoading = false;
  2631. if(res.code == 'ok'){
  2632. this.workForm.time = res.data.time;
  2633. }else {
  2634. this.$message({
  2635. message: res.msg,
  2636. type: 'error'
  2637. })
  2638. }
  2639. },err => {
  2640. this.syncTimeLoading = false;
  2641. this.$message({
  2642. message: err,
  2643. type: 'error'
  2644. })
  2645. })
  2646. },
  2647. refreshAttendance(workdate) {
  2648. if (!workdate) return;
  2649. this.syncTimeLoading = true;
  2650. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2651. startDate: workdate[0],
  2652. endDate: workdate[1]
  2653. },res => {
  2654. this.syncTimeLoading = false;
  2655. if(res.code == 'ok'){
  2656. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2657. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2658. this.totalReportHours = this.workTimeForMinYi;
  2659. }else {
  2660. this.$message({
  2661. message: res.msg,
  2662. type: 'error'
  2663. })
  2664. }
  2665. },err => {
  2666. this.syncTimeLoading = false;
  2667. this.$message({
  2668. message: err,
  2669. type: 'error'
  2670. })
  2671. })
  2672. },
  2673. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2674. this.weeklyFilledTimeDialog = true
  2675. this.weeklyFilledTimeLoading = true
  2676. this.weeklyFilledTimeDate = parameterDate
  2677. this.http.post('/report/getReportList',{
  2678. date: parameterDate,
  2679. userId: this.user.id
  2680. },res => {
  2681. this.weeklyFilledTimeLoading = false
  2682. if(res.code == 'ok'){
  2683. this.weeklyFilledTimeList = res.data[0].data
  2684. let candelete = true
  2685. for(let i in this.weeklyFilledTimeList){
  2686. if(this.weeklyFilledTimeList[i].state < 2){
  2687. candelete = false
  2688. }
  2689. }
  2690. this.weeklyFilledTimeCanDelete = candelete
  2691. }else {
  2692. this.$message({
  2693. message: res.msg,
  2694. type: 'error'
  2695. })
  2696. }
  2697. },err => {
  2698. this.weeklyFilledTimeLoading = false
  2699. this.$message({
  2700. message: err,
  2701. type: 'error'
  2702. })
  2703. })
  2704. },
  2705. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2706. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2707. confirmButtonText: this.$t('btn.determine'),
  2708. cancelButtonText: this.$t('btn.cancel'),
  2709. type: "warning"
  2710. })
  2711. .then(() => {
  2712. this.http.post('/report/delete',{
  2713. userId: this.user.id,
  2714. date: this.weeklyFilledTimeDate
  2715. },res => {
  2716. if (res.code == "ok") {
  2717. this.$message({
  2718. message: this.$t('message.successfullyDeleted'),
  2719. type: "success"
  2720. });
  2721. this.getWeeklyWorkTime()
  2722. this.getReportList();
  2723. this.getDepartment();
  2724. this.weeklyFilledTimeDialog = false;
  2725. } else {
  2726. this.$message({
  2727. message: res.msg,
  2728. type: "error"
  2729. });
  2730. }
  2731. },error => {
  2732. this.$message({
  2733. message: error,
  2734. type: "error"
  2735. });
  2736. }
  2737. );
  2738. }).catch(() => {});
  2739. },
  2740. getApprovalProcess(item){
  2741. // console.log('this.date',this.choseDate);
  2742. this.http.post('/report-log/get',{
  2743. creatorId: item.id,
  2744. createDate: sessionStorage.msg
  2745. },res => {
  2746. if(res.code == 'ok'){
  2747. this.approvalProcessDialog = true
  2748. if(this.user.userNameNeedTranslate == 1) {
  2749. for(var i in res.data) {
  2750. let obj = {
  2751. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2752. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2753. }
  2754. res.data[i].msgCon = obj
  2755. }
  2756. }
  2757. this.approvalProcessData = res.data
  2758. console.log(this.approvalProcessData, '数据卡看')
  2759. }else{
  2760. this.$message({
  2761. message: res.msg,
  2762. type: 'error'
  2763. })
  2764. }
  2765. },err => {
  2766. this.$message({
  2767. message: err,
  2768. type: 'error'
  2769. })
  2770. })
  2771. },
  2772. filterNode(value, data) {
  2773. if (!value) return true;
  2774. return data.label.indexOf(value) !== -1;
  2775. },
  2776. triggerCalculateOT(index) {
  2777. var str = this.workForm.domains[index].overtimeHours + ''
  2778. if(str.indexOf('.') != '-1') {
  2779. var s = str.split('.')[0]
  2780. var st = str.split('.')[1]
  2781. var sts = st.split('')
  2782. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2783. }
  2784. },
  2785. searchScreen(e){
  2786. if(e){
  2787. this.monthNotWorkDateS1 = []
  2788. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2789. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2790. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2791. }
  2792. }
  2793. if (this.monthNotWorkDateS1.length > 50) {
  2794. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2795. }else{
  2796. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2797. }
  2798. // if (this.monthNotWorkDateS1.length > 0) {
  2799. // setTimeout(() => {
  2800. // this.tableListenernot()
  2801. // }, 1000);
  2802. // }
  2803. }else{
  2804. this.monthWorkDataS1 = []
  2805. for (let i = 0; i < this.monthWorkData.length; i++) {
  2806. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2807. this.monthWorkDataS1.push(this.monthWorkData[i])
  2808. }
  2809. }
  2810. if (this.monthWorkDataS1.length > 50) {
  2811. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2812. }else{
  2813. this.monthWorkDataS = this.monthWorkDataS1
  2814. }
  2815. // if (this.monthWorkDataS1.length > 0) {
  2816. // setTimeout(() => {
  2817. // this.tableListener()
  2818. // }, 1000);
  2819. // }
  2820. }
  2821. },
  2822. addUpload(data) {
  2823. // var zhi = data.fileName.split('.')[0]
  2824. // var sss = zhi + '.xlsx'
  2825. // return
  2826. var filePath = '/upload/' + data.serverName;
  2827. const a = document.createElement('a'); // 创建a标签
  2828. a.setAttribute('download', data.fileName);// download属性
  2829. a.setAttribute('href', filePath);// href链接
  2830. a.click(); //自执行点击事件
  2831. a.remove();
  2832. },
  2833. restrictNumber(targetId) {
  2834. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2835. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2836. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2837. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2838. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2839. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2840. inpu.value = parseFloat(inpu.value);
  2841. }
  2842. },
  2843. //获取项目下的任务分组
  2844. getTaskGroups(domain, index) {
  2845. domain.groupId=null;
  2846. this.http.post('/task-group/listMyJoinGroup',{
  2847. projectId: domain.projectId,
  2848. isSubstitude: this.isSubstitude ? 1 : 0
  2849. },
  2850. res => {
  2851. if (res.code == "ok") {
  2852. this.workForm.domains[index].taskGroups = res.data;
  2853. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2854. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2855. // this.getGroupStages(domain, index);
  2856. // }
  2857. this.$forceUpdate();
  2858. }
  2859. },
  2860. error => {
  2861. this.$message({
  2862. message: error,
  2863. type: "error"
  2864. });
  2865. }
  2866. );
  2867. },
  2868. //下载填报工时占比报表
  2869. downloadProjectRatio() {
  2870. this.exportUserRatio = true;
  2871. // let now = new Date();
  2872. // let month = now.getMonth();//默认看上个月的
  2873. // let monthStr = month<10? ('0'+month): month;
  2874. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2875. const today = new Date();
  2876. const year = today.getFullYear();
  2877. const month = today.getMonth() + 1;
  2878. let lastMonthYear, lastMonth;
  2879. if (month === 1) {
  2880. lastMonthYear = year - 1;
  2881. lastMonth = 12;
  2882. } else {
  2883. lastMonthYear = year;
  2884. lastMonth = month - 1;
  2885. }
  2886. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2887. console.log('赋值 ==>', this.ratioYmonth)
  2888. },
  2889. confirmDownloadRatio() {
  2890. this.startRatioExporting = true;
  2891. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2892. ymonth: this.ratioYmonth
  2893. },
  2894. res => {
  2895. if (res.code == "ok") {
  2896. this.startRatioExporting = false;
  2897. var filePath = res.data;
  2898. const a = document.createElement('a'); // 创建a标签
  2899. var data = filePath.split("/");
  2900. a.setAttribute('download', data[data.length-1]);// download属性
  2901. a.setAttribute('href', filePath);// href链接
  2902. a.click(); //自执行点击事件
  2903. a.remove();
  2904. } else {
  2905. this.startRatioExporting = false;
  2906. this.$message({
  2907. message: res.msg,
  2908. type: "error"
  2909. });
  2910. }
  2911. },
  2912. error => {
  2913. this.checkinLoading = false;
  2914. this.$message({
  2915. message: error,
  2916. type: "error"
  2917. });
  2918. }
  2919. );
  2920. },
  2921. //下载带企业微信考勤数据的工时统计模板
  2922. downloadCheckInExcel() {
  2923. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2924. startDate: this.importWxParam.date[0],
  2925. endDate: this.importWxParam.date[1],
  2926. },
  2927. res => {
  2928. if (res.code == "ok") {
  2929. var filePath = res.data;
  2930. const a = document.createElement('a'); // 创建a标签
  2931. var data = filePath.split("/");
  2932. a.setAttribute('download', data[data.length-1]);// download属性
  2933. a.setAttribute('href', filePath);// href链接
  2934. a.click(); //自执行点击事件
  2935. a.remove();
  2936. } else {
  2937. this.$message({
  2938. message: res.msg,
  2939. type: "error"
  2940. });
  2941. }
  2942. },
  2943. error => {
  2944. this.checkinLoading = false;
  2945. this.$message({
  2946. message: error,
  2947. type: "error"
  2948. });
  2949. }
  2950. );
  2951. },
  2952. pre() {
  2953. if (this.active == 0) return;
  2954. this.active--;
  2955. },
  2956. next() {
  2957. this.active++;
  2958. },
  2959. triggerTotalTime(index) {
  2960. var item = this.checkinList[index];
  2961. var total = 0.0;
  2962. for (var i=0;i<this.projectColumns.length; i++) {
  2963. var key = this.projectColumns[i];
  2964. if (item[key] != null && item[key] != '') {
  2965. total += parseFloat(item[key]);
  2966. }
  2967. }
  2968. item.totalFillTime = total;
  2969. },
  2970. //提交批量代填的数据
  2971. submitBatchSubFillData() {
  2972. var data = JSON.stringify(this.checkinList);
  2973. this.http.post('/user-corpwx-time/submitProjectTime',{
  2974. json: data,
  2975. projectColumns: JSON.stringify(this.projectColumns)
  2976. },
  2977. res => {
  2978. if (res.code == "ok") {
  2979. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2980. this.importWxDialog = false;
  2981. }
  2982. },
  2983. error => {
  2984. this.checkinLoading = false;
  2985. this.$message({
  2986. message: error,
  2987. type: "error"
  2988. });
  2989. }
  2990. );
  2991. },
  2992. loadCheckInData() {
  2993. if (this.importWxParam.date == null) {
  2994. this.checkinList = [];
  2995. return;
  2996. }
  2997. this.checkinLoading = true;
  2998. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2999. startDate: this.importWxParam.date[0],
  3000. endDate: this.importWxParam.date[1],
  3001. },
  3002. res => {
  3003. if (res.code == "ok") {
  3004. this.checkinLoading = false;
  3005. this.checkinList = res.data.list;
  3006. this.projectColumns = res.data.projects;
  3007. // 自定义表格会导致表格错乱,需重新计算表格
  3008. this.$nextTick(()=>{
  3009. this.$refs.tab.doLayout()
  3010. })
  3011. }
  3012. },
  3013. error => {
  3014. this.checkinLoading = false;
  3015. this.$message({
  3016. message: error,
  3017. type: "error"
  3018. });
  3019. }
  3020. );
  3021. },
  3022. importCardTime(item) {
  3023. //首先判断文件类型
  3024. let str = item.file.name.split(".");
  3025. let format = str[str.length - 1];
  3026. if (format != "xls" && format != "xlsx") {
  3027. this.$message({
  3028. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3029. type: "error"
  3030. });
  3031. } else {
  3032. this.importingData = true;
  3033. let formData = new FormData();
  3034. formData.append("multipartFile", item.file);
  3035. formData.append("companyId", this.user.companyId);
  3036. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3037. res => {
  3038. this.$refs.uploadCardTime.clearFiles();
  3039. this.importingData = false;
  3040. if (res.code == "ok") {
  3041. //换成弹出框,以免有人等了半天回来啥也没看到
  3042. this.$message({
  3043. message: '导入考勤时长成功',
  3044. type: "success"
  3045. });
  3046. } else {
  3047. this.$message({
  3048. message: res.msg,
  3049. type: "error"
  3050. });
  3051. }
  3052. },
  3053. error => {
  3054. this.$refs.upload.clearFiles();
  3055. this.listLoading = false;
  3056. this.$message({
  3057. message: error,
  3058. type: "error"
  3059. });
  3060. });
  3061. }
  3062. },
  3063. batchImportWxData(item) {
  3064. //首先判断文件类型
  3065. let str = item.file.name.split(".");
  3066. let format = str[str.length - 1];
  3067. if (format != "xls" && format != "xlsx") {
  3068. this.$message({
  3069. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3070. type: "error"
  3071. });
  3072. } else {
  3073. this.importingData = true;
  3074. let formData = new FormData();
  3075. formData.append("file", item.file);
  3076. formData.append("companyId", this.user.companyId);
  3077. formData.append("withCheckIn", 1);
  3078. this.http.uploadFile('/report/importData', formData,
  3079. res => {
  3080. this.$refs.upload.clearFiles();
  3081. this.showImportResult = true;
  3082. this.importingData = false;
  3083. if (res.code == "ok") {
  3084. //换成弹出框,以免有人等了半天回来啥也没看到
  3085. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3086. this.getReportList();
  3087. this.importWxDialog = false;
  3088. } else {
  3089. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3090. }
  3091. },
  3092. error => {
  3093. this.$refs.upload.clearFiles();
  3094. this.listLoading = false;
  3095. this.$message({
  3096. message: error,
  3097. type: "error"
  3098. });
  3099. });
  3100. }
  3101. },
  3102. batchImportData(item) {
  3103. //首先判断文件类型
  3104. let str = item.file.name.split(".");
  3105. let format = str[str.length - 1];
  3106. if (format != "xls" && format != "xlsx") {
  3107. this.$message({
  3108. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3109. type: "error"
  3110. });
  3111. } else {
  3112. this.importingData = true;
  3113. let formData = new FormData();
  3114. formData.append("file", item.file);
  3115. formData.append("companyId", this.user.companyId);
  3116. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3117. this.http.uploadFile(url, formData,
  3118. res => {
  3119. this.$refs.upload.clearFiles();
  3120. this.importingData = false;
  3121. this.showImportResult = true;
  3122. if (res.code == "ok") {
  3123. //换成弹出框,以免有人等了半天回来啥也没看到
  3124. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3125. this.getReportList();
  3126. this.importWXDialog = false;
  3127. } else {
  3128. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3129. }
  3130. },
  3131. error => {
  3132. this.$refs.upload.clearFiles();
  3133. this.importingData = false;
  3134. this.$message({
  3135. message: error,
  3136. type: "error"
  3137. });
  3138. });
  3139. }
  3140. },
  3141. userssHu() {
  3142. this.http.post('/time-type/getCompanyTimeSetting',{
  3143. companyId: this.user.companyId
  3144. },
  3145. res => {
  3146. if (res.code == "ok") {
  3147. this.yonghuUser = res.data
  3148. }
  3149. },
  3150. error => {
  3151. this.$message({
  3152. message: error,
  3153. type: "error"
  3154. });
  3155. }
  3156. );
  3157. },
  3158. iptBlur(i) {
  3159. if(this.isBatch == 0) {
  3160. return
  3161. }
  3162. var reqParam = {
  3163. startDate: this.workForm.createDate[0],
  3164. endDate: this.workForm.createDate[1]
  3165. };
  3166. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3167. reqParam.userId = this.workForm.userId[0];
  3168. }
  3169. this.http.post('/report/getWorkDays',reqParam,
  3170. res => {
  3171. if (res.code == "ok") {
  3172. this.jsDay = res.data
  3173. this.chuji(i)
  3174. } else {
  3175. this.$message({
  3176. message: res.msg,
  3177. type: "error"
  3178. });
  3179. }
  3180. },
  3181. error => {
  3182. this.$message({
  3183. message: error,
  3184. type: "error"
  3185. });
  3186. }
  3187. );
  3188. //明夷硬编码获取
  3189. if (this.user.company.companyName == this.mingyiName) {
  3190. this.getWorkTimeForMinYi();
  3191. }
  3192. },
  3193. getWorkTimeForMinYi(){
  3194. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3195. startDate: this.workForm.createDate[0],
  3196. endDate: this.workForm.createDate[1]
  3197. },
  3198. res => {
  3199. if (res.code == "ok") {
  3200. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3201. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3202. this.totalReportHours = this.workTimeForMinYi;
  3203. } else {
  3204. this.$message({
  3205. message: res.msg,
  3206. type: "error"
  3207. });
  3208. this.workForm.createDate = [];
  3209. }
  3210. },
  3211. error => {
  3212. this.$message({
  3213. message: error,
  3214. type: "error"
  3215. });
  3216. }
  3217. );
  3218. },
  3219. chuji(i) {
  3220. if(i == 0) {
  3221. this.seleChn(1)
  3222. } else if(i == 1) {
  3223. this.seleChn(0)
  3224. } else if(i == 2) {
  3225. if(this.workForm.domains[0].multiWorktime > 0) {
  3226. this.iptChangs()
  3227. } else {
  3228. this.iptChang()
  3229. }
  3230. } else if(i == 3) {
  3231. this.seleChn(0)
  3232. }
  3233. },
  3234. seleChn(e,domain) {
  3235. if(e == 1) {
  3236. for(var i in this.workForm.domains) {
  3237. if(this.workForm.domains[i].timeType == 0) {
  3238. this.workForm.domains[i].workingTime = 8
  3239. } else {
  3240. this.workForm.domains[i].workingTime = 4
  3241. }
  3242. }
  3243. }
  3244. var quanbu = 0
  3245. var spl = this.workForm.domains
  3246. var zhi = ''
  3247. for(var i in spl) {
  3248. var sp = +spl[i].workingTime + 0
  3249. zhi = this.jsDay * sp
  3250. quanbu = +quanbu + zhi
  3251. }
  3252. this.jsTime = quanbu
  3253. this.totalReportHours = quanbu
  3254. let worktime = this.jsTime
  3255. // 自动计算加班时长
  3256. if(this.isBatch != 0){
  3257. worktime = this.jsTime / this.jsDay
  3258. }
  3259. if(this.user.timeType.fillOvertime && domain){
  3260. let isover = false
  3261. let alltime = 0
  3262. let allover = 0 //此处alltime同上面的worktime
  3263. for(let d in spl){
  3264. if(spl[d].isOvertime){
  3265. isover = true
  3266. allover += spl[d].overtimeHours*1
  3267. }
  3268. alltime += spl[d].workingTime*1
  3269. }
  3270. if(domain.overtimeHours){
  3271. allover = allover - domain.overtimeHours
  3272. }
  3273. if(worktime*1 > this.user.timeType.allday){
  3274. if(isover){
  3275. if(alltime > (allover + this.user.timeType.allday)){
  3276. this.$set(domain,'isOvertime',true)
  3277. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3278. }else{
  3279. this.$set(domain,'isOvertime',false)
  3280. this.$set(domain,'overtimeHours',null)
  3281. if(alltime < (allover + this.user.timeType.allday)){
  3282. let overtime = allover + this.user.timeType.allday - alltime
  3283. for(let pi in spl){
  3284. if(spl[pi].overtimeHours){
  3285. if((overtime - spl[pi].overtimeHours*1) > 0){
  3286. overtime = overtime - spl[pi].overtimeHours*1
  3287. this.$set(spl[pi],'isOvertime',false)
  3288. this.$set(spl[pi],'overtimeHours',null)
  3289. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3290. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3291. break
  3292. }else{
  3293. this.$set(spl[pi],'isOvertime',false)
  3294. this.$set(spl[pi],'overtimeHours',null)
  3295. break
  3296. }
  3297. }
  3298. }
  3299. }
  3300. }
  3301. }else{
  3302. this.$set(domain,'isOvertime',true)
  3303. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3304. }
  3305. }else{
  3306. for(let di in spl){
  3307. this.$set(spl[di],'isOvertime',false)
  3308. this.$set(spl[di],'overtimeHours',null)
  3309. }
  3310. }
  3311. }
  3312. },
  3313. iptChang() {
  3314. var sl = this.workForm.domains
  3315. let timeArr = []
  3316. for(var i in sl) {
  3317. if(sl[i].startTime && sl[i].endTime) {
  3318. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3319. }
  3320. }
  3321. this.getTimeHours(timeArr)
  3322. // for(let j in arrNum) {
  3323. // this.timeJsonStr += arrNum[j]
  3324. // if(flg) {
  3325. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3326. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3327. // }
  3328. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3329. // flg = true
  3330. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3331. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3332. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3333. // }
  3334. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3335. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3336. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3337. // }
  3338. // }
  3339. },
  3340. iptChangs() {
  3341. var sl = this.workForm.domains
  3342. let timeArr = []
  3343. for(var i in sl) {
  3344. for(var j in sl[i].worktimeList){
  3345. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3346. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3347. }
  3348. }
  3349. }
  3350. this.getTimeHours(timeArr)
  3351. },
  3352. // 调用接口或去数据
  3353. getTimeHours(arr) {
  3354. this.http.post('/report/getHoursByTimeRange',{
  3355. timeJsonStr: JSON.stringify(arr)
  3356. },res => {
  3357. if(res.code === 'ok') {
  3358. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3359. } else {
  3360. this.$message({
  3361. message: res.msg,
  3362. type: 'error'
  3363. })
  3364. }
  3365. },err => {
  3366. this.$message({
  3367. message: err,
  3368. type: 'error'
  3369. })
  3370. })
  3371. },
  3372. // 按周填报调用接口计算时间
  3373. async getWeekHoursByTimeRange(timeRange) {
  3374. const url = '/report/getHoursByTimeRange';
  3375. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3376. var that = this;
  3377. return new Promise((resolve, reject) => {
  3378. this.http.post(url, data, function(res) {
  3379. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3380. }, function(err) {
  3381. reject(err);
  3382. });
  3383. });
  3384. },
  3385. removeTimeItem(item, index) {
  3386. item.worktimeList.splice(index, 1);
  3387. this.iptChangs()
  3388. },
  3389. //添加工时
  3390. addNewWorktime(index, item) {
  3391. if(item.worktimeList == null ) {
  3392. item.worktimeList = []
  3393. }
  3394. item.worktimeList.push({});
  3395. },
  3396. //复制项目
  3397. copyProject(index) {
  3398. var leftProgress = 10;
  3399. if (this.reportTimeType.type == 3) {
  3400. //计算已经待分配工时比例
  3401. let array = this.workForm.domains;
  3402. let totalProgress = 0;
  3403. for (var i=0;i<array.length; i++) {
  3404. totalProgress += array[i].progress;
  3405. }
  3406. if (totalProgress < 100) {
  3407. leftProgress = 100 - totalProgress;
  3408. }
  3409. }
  3410. var newIndex = index+1;
  3411. var itemDomain = {
  3412. projectId: this.workForm.domains[index].projectId,
  3413. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3414. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3415. ),
  3416. content: "",
  3417. progress:leftProgress,
  3418. state:2,//2-表示待提交
  3419. };
  3420. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3421. if (this.reportTimeType.type == 0) {
  3422. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3423. var length = this.workForm.domains.length;
  3424. if (length == 2) {
  3425. this.showAddMore = false;
  3426. }
  3427. }
  3428. this.selectProject(itemDomain, newIndex);
  3429. },
  3430. pushWorkTime(reportId){
  3431. let url=''
  3432. if(this.user.timeType.syncSap == 1){
  3433. url='/report/pushProjectReportToSap'
  3434. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3435. var pushDate = this.date + day;
  3436. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3437. confirmButtonText: '确定',
  3438. cancelButtonText: '取消',
  3439. type: 'info'
  3440. }).then(() => {
  3441. const loading = this.$loading({
  3442. lock: true,
  3443. text: '正在推送中,请耐心等待。',
  3444. spinner: 'el-icon-loading',
  3445. background: 'rgba(0, 0, 0, 0.7)'
  3446. });
  3447. this.http.post(url,{
  3448. pushDate: pushDate,
  3449. reportId: reportId
  3450. },res => {
  3451. loading.close();
  3452. if(res.code == 'ok'){
  3453. this.$message({
  3454. type: 'success',
  3455. message: res.data
  3456. });
  3457. }else{
  3458. this.$message({
  3459. type: 'error',
  3460. message: res.msg
  3461. })
  3462. }
  3463. },err => {
  3464. loading.close();
  3465. this.$message({
  3466. type: 'error',
  3467. message: err
  3468. })
  3469. })
  3470. }).catch(() => {
  3471. });
  3472. }else{
  3473. url='/report/pushReportDataToThird'
  3474. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3475. confirmButtonText: '确定',
  3476. cancelButtonText: '取消',
  3477. type: 'info'
  3478. }).then(() => {
  3479. const loading = this.$loading({
  3480. lock: true,
  3481. text: '正在推送中,请耐心等待。',
  3482. spinner: 'el-icon-loading',
  3483. background: 'rgba(0, 0, 0, 0.7)'
  3484. });
  3485. this.http.post(url,{
  3486. yearMonth: this.date
  3487. },res => {
  3488. loading.close();
  3489. if(res.code == 'ok'){
  3490. this.$message({
  3491. type: 'success',
  3492. message: '推送成功!'
  3493. });
  3494. }else{
  3495. this.$message({
  3496. type: 'error',
  3497. message: res.msg
  3498. })
  3499. }
  3500. },err => {
  3501. loading.close();
  3502. this.$message({
  3503. type: 'error',
  3504. message: err
  3505. })
  3506. })
  3507. }).catch(() => {
  3508. });
  3509. }
  3510. },
  3511. showWorkTime(){
  3512. this.monthWorkTimeDialog = true;
  3513. this.searchKeyword = ''
  3514. this.WorktimeDatepickValue = this.istoMonth()
  3515. if(this.WorktimeDatepickValue.length == 0){
  3516. let newdate = new Date();
  3517. let nowdate = newdate.toLocaleDateString();
  3518. let getauto = this.getAutoWeekDate(nowdate)
  3519. let nowwd = [getauto[0],getauto[6]]
  3520. this.WorktimeDatepickValue = nowwd
  3521. }
  3522. this.showMonthWorkTime()
  3523. },
  3524. handleClick(t,e){
  3525. if (t.name == "first") {
  3526. this.showMonthWorkTime()
  3527. }else{
  3528. this.showMonthNotWorkTime()
  3529. }
  3530. },
  3531. //导出员工每日填报工时数
  3532. exportMembWorkHours() {
  3533. this.http.post(
  3534. "/report/exportUserDailyWorkTime",
  3535. {
  3536. // month: this.date,
  3537. startDate: this.WorktimeDatepickValue[0],
  3538. endDate: this.WorktimeDatepickValue[1],
  3539. },
  3540. (res) => {
  3541. if (res.code == "ok") {
  3542. let url = res.data;
  3543. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3544. }
  3545. },
  3546. (error) => {
  3547. this.$message({
  3548. message: error,
  3549. type: "error",
  3550. });
  3551. }
  3552. );
  3553. },
  3554. exportMembNotWorkHours() {
  3555. this.http.post(
  3556. "/report/exportNoReportUserList",
  3557. {
  3558. // month: this.date,
  3559. startDate: this.WorktimeDatepickValue[0],
  3560. endDate: this.WorktimeDatepickValue[1],
  3561. },
  3562. (res) => {
  3563. if (res.code == "ok") {
  3564. let url = res.data;
  3565. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3566. }
  3567. },
  3568. (error) => {
  3569. this.$message({
  3570. message: error,
  3571. type: "error",
  3572. });
  3573. }
  3574. );
  3575. },
  3576. downloadByA(name, url) {
  3577. const a = document.createElement("a"); // 创建a标签
  3578. a.setAttribute("download", name); // download属性
  3579. a.setAttribute("href", url); // href链接
  3580. a.click(); // 自执行点击事件
  3581. a.remove();
  3582. },
  3583. // 是否本月判断
  3584. istoMonth(){
  3585. let todate = new Date()
  3586. let tomonth = todate.getMonth() + 1
  3587. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3588. if(this.date == adate){
  3589. return []
  3590. }else{
  3591. let sedate = new Date(this.date)
  3592. let semonth = sedate.getMonth() + 1
  3593. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3594. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3595. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3596. return [sedates1, sedates2]
  3597. }
  3598. },
  3599. showMonthWorkTime() {
  3600. this.monthTotalPage = 0,
  3601. this.tbload = true
  3602. this.http.post(
  3603. "/report/getUserDailyWorkTime",
  3604. // "/report/getNoReportUserList",
  3605. {
  3606. // month: this.date,
  3607. startDate: this.WorktimeDatepickValue[0],
  3608. endDate: this.WorktimeDatepickValue[1],
  3609. },
  3610. (res) => {
  3611. if (res.code == "ok") {
  3612. this.tbload = false;
  3613. this.pickDateArray = res.data.days;
  3614. // console.log('dataarray',res.data.days);
  3615. this.monthWorkData = res.data.list;
  3616. // this.monthWorkDataS = this.monthWorkData
  3617. // this.monthWorkDataS1 = res.data.list
  3618. this.monthTotal = res.data.list.length
  3619. if (this.monthWorkData.length > 50) {
  3620. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3621. }else{
  3622. this.monthWorkDataS = this.monthWorkData
  3623. }
  3624. this.searchScreen(0)
  3625. // this.monthWorkDataS = infoList
  3626. // 判断
  3627. // if (this.monthWorkDataS1.length > 0) {
  3628. // setTimeout(() => {
  3629. // this.tableListener()
  3630. // }, 1000);
  3631. // }
  3632. this.$nextTick(function(){
  3633. this.$refs.hasworkTbl.doLayout();
  3634. });
  3635. // this.$forceUpdate()
  3636. }
  3637. },
  3638. (error) => {
  3639. this.tbload = false
  3640. this.$message({
  3641. message: error,
  3642. type: "error",
  3643. });
  3644. }
  3645. );
  3646. },
  3647. // tableListener(){
  3648. // let that = this;
  3649. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3650. // // 添加scroll监听事件
  3651. // dom.addEventListener("scroll", function () {
  3652. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3653. // if (scrollDistance < 2) {
  3654. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3655. // that.monthTotalPage++; //当前页数自增
  3656. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3657. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3658. // var infoList = arrList.splice(
  3659. // that.monthTotalPage * that.monthTotalLages,
  3660. // that.monthTotalLages
  3661. // );
  3662. // // 数据添加
  3663. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3664. // }
  3665. // }
  3666. // })
  3667. // },
  3668. showMonthNotWorkTime() {
  3669. this.monthTotalPage = 0,
  3670. this.tbload = true,
  3671. this.http.post(
  3672. "/report/getNoReportUserList",
  3673. {
  3674. startDate: this.WorktimeDatepickValue[0],
  3675. endDate: this.WorktimeDatepickValue[1],
  3676. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3677. },
  3678. (res) => {
  3679. if (res.code == "ok") {
  3680. this.tbload = false
  3681. this.monthNotWorkDate = res.data;
  3682. // this.monthNotWorkDateS1 = res.data
  3683. this.monthnotTotal = res.data.length
  3684. // 2222111
  3685. if (this.monthNotWorkDate.length > 50) {
  3686. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3687. } else {
  3688. this.monthNotWorkDateS = this.monthNotWorkDate
  3689. }
  3690. this.searchScreen(1)
  3691. // 判断
  3692. // if (this.monthnotworkDateS1.length > 0) {
  3693. // setTimeout(() => {
  3694. // this.tableListenernot()
  3695. // }, 1000);
  3696. // }
  3697. this.$nextTick(function(){
  3698. this.$refs.hasworkTbl2.doLayout();
  3699. });
  3700. }
  3701. },
  3702. (error) => {
  3703. this.tbload = false
  3704. this.$message({
  3705. message: error,
  3706. type: "error",
  3707. });
  3708. }
  3709. );
  3710. },
  3711. // tableListenernot(){
  3712. // let that = this;
  3713. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3714. // dom.addEventListener("scroll", function () {
  3715. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3716. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3717. // if (scrollDistance2 < 2) {
  3718. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3719. // that.monthnotTotalPage++; //当前页数自增
  3720. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3721. // var infoList = arrList.splice(
  3722. // that.monthnotTotalPage * that.monthnotTotalLages,
  3723. // that.monthnotTotalLages
  3724. // );
  3725. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3726. // }
  3727. // }
  3728. // })
  3729. // },
  3730. listScroll(){
  3731. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3732. this.isMore = true
  3733. setTimeout(()=>{
  3734. this.isMore = false
  3735. },1000)
  3736. }else {
  3737. this.isFlag = true
  3738. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3739. this.monthWorkDataS = datalist
  3740. setTimeout(()=>{
  3741. this.isFlag = false
  3742. },300)
  3743. }
  3744. },
  3745. notListScroll(){
  3746. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3747. this.isMore = true
  3748. setTimeout(()=>{
  3749. this.isMore = false
  3750. },1000)
  3751. }else {
  3752. this.isFlag = true
  3753. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3754. this.monthNotWorkDateS = datalist
  3755. // console.log('length',this.monthNotWorkDateS.length)
  3756. setTimeout(()=>{
  3757. this.isFlag = false
  3758. },300)
  3759. }
  3760. },
  3761. // 获取默认这zhou日期参数 222
  3762. getLastWeek(e){
  3763. let newdate = new Date()
  3764. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3765. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3766. if(e){
  3767. this.WorktimeDatepickValue = lastwd
  3768. this.showMonthWorkTime()
  3769. }else{
  3770. this.WorktimeDatepickValue = lastwd
  3771. this.showMonthNotWorkTime()
  3772. }
  3773. },
  3774. getThisWeek(e){
  3775. let newdate = new Date();
  3776. let nowdate = newdate.toLocaleDateString();
  3777. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3778. if(e){
  3779. this.WorktimeDatepickValue = nowwd
  3780. this.showMonthWorkTime()
  3781. }else{
  3782. this.WorktimeDatepickValue = nowwd
  3783. this.showMonthNotWorkTime()
  3784. }
  3785. },
  3786. getDoubleLastWeek(e){
  3787. let newdate = new Date()
  3788. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3789. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3790. if(e){
  3791. this.WorktimeDatepickValue = nextwd
  3792. this.showMonthWorkTime()
  3793. }else{
  3794. this.WorktimeDatepickValue = nextwd
  3795. this.showMonthNotWorkTime()
  3796. }
  3797. },
  3798. alreadyAllDate(stime,etime){
  3799. let diffdate = new Array();
  3800. let i=0;
  3801. while(stime<=etime){
  3802. let dateArray = stime.split("-");
  3803. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3804. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3805. let stimewk = this.weekDay[date.getDay()]
  3806. 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')
  3807. 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])
  3808. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3809. let stime_ts = new Date(stime).getTime();
  3810. let next_date = stime_ts + (24*60*60*1000);
  3811. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3812. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3813. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3814. stime = next_dates_y+next_dates_m+next_dates_d;
  3815. i++;
  3816. }
  3817. return diffdate
  3818. },
  3819. getAutoWeekDate(e) {
  3820. let dateString = e;
  3821. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3822. if (dateString.match(dateStringReg)) {
  3823. let presentDate = new Date(dateString),
  3824. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3825. return Array.from(new Array(7), function (val, index) {
  3826. let formatDate = new Date(
  3827. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3828. );
  3829. return (
  3830. formatDate.getFullYear() +
  3831. "-" +
  3832. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3833. "-" +
  3834. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3835. );
  3836. });
  3837. } else {
  3838. throw new Error(
  3839. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3840. );
  3841. }
  3842. },
  3843. onProgressChange() {
  3844. this.$forceUpdate();
  3845. },
  3846. showChooseMembTree() {
  3847. this.chosenMembCount = this.participator.length;
  3848. this.chooseParticipVisible = true;
  3849. },
  3850. onTreeItemChange() {
  3851. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3852. var list = chosenList.filter(item=>item.isUser == 1);
  3853. this.chosenMembCount = list.length;
  3854. },
  3855. findUserInTree() {
  3856. if (this.filterName == '') {
  3857. this.deptMembData = this.allMembData;
  3858. } else {
  3859. var list = this.findRecursively(this.filterName, this.allMembData);
  3860. this.deptMembData = list;
  3861. }
  3862. },
  3863. findRecursively(username, list) {
  3864. var filterList = [];
  3865. for (var i=0;i<list.length; i++) {
  3866. if (list[i].isUser == 1) {
  3867. if (list[i].label.indexOf(username) >= 0) {
  3868. //匹配上了
  3869. filterList.push(list[i]);
  3870. }
  3871. } else if (list[i].children != null && list[i].children.length > 0) {
  3872. var subList = this.findRecursively(username, list[i].children);
  3873. if (subList.length > 0) {
  3874. subList.forEach(s=>filterList.push(s));
  3875. }
  3876. }
  3877. }
  3878. return filterList;
  3879. },
  3880. //确定选择参与人
  3881. chooseParticip() {
  3882. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3883. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3884. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3885. if (this.user.company.packageProject == 1) {
  3886. if (this.chosenMembList.length > 1) {
  3887. this.$message({
  3888. message: '每次仅支持代填一个人',
  3889. type: "error",
  3890. });
  3891. return;
  3892. }
  3893. }
  3894. this.chooseParticipVisible = false;
  3895. this.workForm.userNames = '';
  3896. this.workForm.userId = [];
  3897. this.participator = [];
  3898. for (var i=0;i<this.chosenMembList.length; i++) {
  3899. this.workForm.userId.push(this.chosenMembList[i].id);
  3900. this.workForm.userNames += this.chosenMembList[i].label+',';
  3901. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3902. this.participator.push(item);
  3903. }
  3904. if (this.workForm.userNames.length > 0) {
  3905. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3906. }
  3907. if(this.user.userNameNeedTranslate == 1) {
  3908. if(this.workForm.userNames) {
  3909. this.workForm.userNames = this.workForm.userNames.split(',')
  3910. }
  3911. }
  3912. },
  3913. notifySel(sel){
  3914. // console.log(sel);
  3915. this.notifySelList = sel
  3916. },
  3917. //微信通知人员填写
  3918. Notify(code) {
  3919. if (this.notifySelList.length == 0) return;
  3920. var ids = '';
  3921. this.notifySelList.forEach(f=>{
  3922. ids += f.id+',';
  3923. })
  3924. this.http.post('/user/pushFillReport',{
  3925. ids: ids, date: this.curDate,
  3926. code: code
  3927. },
  3928. res => {
  3929. if (res.code == "ok") {
  3930. this.$message({
  3931. message: this.$t('message.sentSuccessfully'),
  3932. type: "success"
  3933. });
  3934. }
  3935. },
  3936. error => {
  3937. this.$message({
  3938. message: error,
  3939. type: "error"
  3940. });
  3941. }
  3942. );
  3943. },
  3944. //导出人员列表
  3945. exportMemb() {
  3946. if (this.fillMembList.length == 0) return;
  3947. var ids = '';
  3948. this.fillMembList.forEach(f=>{
  3949. ids += f.id+',';
  3950. })
  3951. this.http.post('/user/exportMembList',{
  3952. ids: ids,isFill: this.isFill, date: this.curDate
  3953. },
  3954. res => {
  3955. if (res.code == "ok") {
  3956. var aTag = document.createElement('a');
  3957. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3958. aTag.href = res.data;
  3959. aTag.click();
  3960. }
  3961. },
  3962. error => {
  3963. this.$message({
  3964. message: error,
  3965. type: "error"
  3966. });
  3967. }
  3968. );
  3969. },
  3970. showMembList(fill) {
  3971. this.membListVisible = true;
  3972. if (fill == 0) {
  3973. this.fillMembList = this.unFillList;
  3974. this.isFill = false;
  3975. let leaveList = []
  3976. let unleaveList = []
  3977. for(let i in this.fillMembList){
  3978. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3979. leaveList.push(this.fillMembList[i])
  3980. }else{
  3981. unleaveList.push(this.fillMembList[i])
  3982. }
  3983. }
  3984. this.fillMembList = unleaveList
  3985. this.fillMembList_leave = leaveList
  3986. } else if(fill == 1){
  3987. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3988. this.isFill = true;
  3989. }else{
  3990. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3991. this.isFill = true;
  3992. }
  3993. },
  3994. //获取自己填写的日报状态
  3995. getReportFillStatus() {
  3996. this.http.post('/report/getReportFillStatus',{
  3997. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3998. },
  3999. res => {
  4000. if (res.code == "ok") {
  4001. this.fillStatusList = res.data;
  4002. this.allDate.forEach(d=>{
  4003. var fillInfo = null;
  4004. d.state = null;
  4005. this.fillStatusList.forEach(s=>{
  4006. // console.log(d)
  4007. var d1 = s.createDate.split('-')[2];
  4008. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4009. // console.log(d2, '我被执行了')
  4010. if (d1.indexOf('0') == 0) {
  4011. d1 = d1.substring(1,d1.length);
  4012. }
  4013. if (d1 == d2) {
  4014. d.state = s.state;
  4015. }
  4016. })
  4017. })
  4018. this.$forceUpdate();
  4019. }
  4020. },
  4021. error => {
  4022. this.$message({
  4023. message: error,
  4024. type: "error"
  4025. });
  4026. }
  4027. );
  4028. },
  4029. scrollFunction () {
  4030. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4031. if (this.domObj.attachEvent) { // IE
  4032. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4033. } else if (this.domObj.addEventListener) {
  4034. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4035. }
  4036. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4037. },
  4038. mouseScroll(event) { // google 浏览器下
  4039. let detail = event.wheelDelta || event.detail
  4040. let moveForwardStep = -1
  4041. let moveBackStep = 1
  4042. let step = 0
  4043. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4044. event.preventDefault() // 阻止浏览器默认事件
  4045. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4046. },
  4047. // //左右滚动
  4048. // wheel(e){
  4049. // var a = document.getElementById("dateScroll");
  4050. // var scroll_width = 80; //滚动一下的距离
  4051. // var e = e || window.event, v;
  4052. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4053. // if(v>3||-v>3) v=-v;
  4054. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4055. // e.preventDefault(); //阻止浏览器的默认滚动
  4056. // },
  4057. showExportDialog() {
  4058. this.exportType = 0
  4059. this.exportDialog = true;
  4060. },
  4061. showExportTimeDialog() {
  4062. this.exportTimeDialog = true;
  4063. },
  4064. changeAllTime() {
  4065. //总时长发生改变,自动按比例计算
  4066. this.workForm.domains.forEach(d=>{
  4067. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4068. });
  4069. //计算jsTime
  4070. if (this.workForm.createDate) {
  4071. let sdate = new Date(this.workForm.createDate[0]);
  4072. let edate = new Date(this.workForm.createDate[1]);
  4073. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4074. console.log('days===', days)
  4075. if (days < 0) {
  4076. days = 0;
  4077. }
  4078. this.jsTime = this.reportTimeType.allday * days;
  4079. }
  4080. },
  4081. // 是否加班的单机事件
  4082. check() {
  4083. this.selected = !this.selected
  4084. this.isNew = this.selected
  4085. },
  4086. updateSubProject() {
  4087. this.$forceUpdate();
  4088. },
  4089. selectDegreeId(domain, index) {
  4090. this.http.post('/report/defaultDegree',{
  4091. projectId: domain.projectId
  4092. },
  4093. res => {
  4094. if (res.code == "ok") {
  4095. if(res.data) {
  4096. this.workForm.domains[index].degreeId = res.data.id + ''
  4097. this.$forceUpdate();
  4098. }
  4099. }
  4100. },
  4101. error => {
  4102. this.$message({
  4103. message: error,
  4104. type: "error"
  4105. });
  4106. }
  4107. );
  4108. },
  4109. //项目选中了, 加载子项目
  4110. selectProject(domain, index) {
  4111. if(!domain.projectId){
  4112. return;
  4113. }
  4114. // 默认选中上次填写的自定义维度
  4115. if(this.yonghuUser.customDegreeActive == 1) {
  4116. this.selectDegreeId(domain, index)
  4117. }
  4118. // console.log('projectId===',domain.projectId);
  4119. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4120. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4121. this.http.post('/sub-project/list',{
  4122. projectId: domain.projectId,
  4123. isReport: true
  4124. },
  4125. res => {
  4126. //清空之前选中的子项目
  4127. // this.workForm.domains[index].subProjectId = 0;
  4128. if (res.code == "ok") {
  4129. this.workForm.domains[index].subProjectList = res.data;
  4130. this.workForm.domains[index].subProjectId = null;
  4131. this.$forceUpdate();
  4132. }
  4133. },
  4134. error => {
  4135. this.$message({
  4136. message: error,
  4137. type: "error"
  4138. });
  4139. }
  4140. );
  4141. //项目相关的近期任务
  4142. if (this.user.company.packageProject == 1) {
  4143. this.getRecentTaskList(domain, index);
  4144. //获取项目相关专业
  4145. if (this.user.company.packageEngineering == 1) {
  4146. this.getProjectProfessions(domain, index);
  4147. }
  4148. //获取项目下的任务分组
  4149. this.getTaskGroups(domain, index);
  4150. }
  4151. // 获取项目相关的维度
  4152. // domain.degreeId = null
  4153. this.$set(domain,'degreeId',null)
  4154. this.$set(domain,'multiDegrIdArray',null)
  4155. this.dimension(domain, index);
  4156. //获取项目审核人
  4157. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4158. this.getProjectAuditorList(domain, index);
  4159. } else {
  4160. //按分组的负责人来审核
  4161. domain.projectAuditorId = null;
  4162. domain.projectAuditorName = null;
  4163. domain.auditUserList = null;
  4164. }
  4165. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4166. if (this.reportTimeType.type == 3) {
  4167. //新增项目时,自动计算
  4168. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4169. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4170. }
  4171. //加载昱众的工作职责
  4172. if (this.user.companyId == this.yuzhongCompId) {
  4173. this.updateResponse(domain);
  4174. }
  4175. },
  4176. getRecentTaskList(domain, index) {
  4177. //刷新任务时,清空服务
  4178. this.$set(domain, 'sapServiceId', null);
  4179. this.$set(domain, 'taskId', null);
  4180. var param = {
  4181. projectId: domain.projectId,
  4182. isSubstitude:this.isSubstitude?1:0,
  4183. };
  4184. if (domain.groupId) {
  4185. param.groupId = domain.groupId;
  4186. }
  4187. if (domain.stage) {
  4188. param.stage = domain.stage;
  4189. }
  4190. //专业版代填,获取代填员工的任务
  4191. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4192. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4193. this.$message({
  4194. message: '请选择代填的员工',
  4195. type: "error"
  4196. });
  4197. return;
  4198. } else {
  4199. param.userId = this.workForm.userId[0];
  4200. }
  4201. }
  4202. this.http.post('/task/getRecentTask',param,
  4203. res => {
  4204. if (res.code == "ok") {
  4205. this.workForm.domains[index].allTaskList = res.data;
  4206. this.workForm.domains[index].taskList = res.data;
  4207. this.$forceUpdate();
  4208. }
  4209. },
  4210. error => {
  4211. this.$message({
  4212. message: error,
  4213. type: "error"
  4214. });
  4215. }
  4216. );
  4217. },
  4218. //获取项目审核人
  4219. getProjectAuditorList(domainItem, index) {
  4220. if(domainItem.projectId == '') {
  4221. return
  4222. }
  4223. domainItem.projectAuditorId = null;
  4224. domainItem.projectAuditorName = null;
  4225. this.http.post('/project-auditor/getList',{
  4226. projectId: domainItem.projectId,
  4227. },
  4228. res => {
  4229. if (res.code == "ok") {
  4230. domainItem.auditUserList = res.data;
  4231. if (res.data.length==0) {
  4232. this.$message({
  4233. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4234. type: "error"
  4235. });
  4236. } else if (res.data.length==1) {
  4237. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4238. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4239. }
  4240. this.$forceUpdate();
  4241. }
  4242. },
  4243. error => {
  4244. this.$message({
  4245. message: error,
  4246. type: "error"
  4247. });
  4248. }
  4249. );
  4250. },
  4251. // 获取维度数据
  4252. dimension(domain, index) {
  4253. if(domain.projectId == '') {
  4254. return
  4255. }
  4256. this.http.post('/project/getDegreeList',{
  4257. projectId: domain.projectId,
  4258. },
  4259. res => {
  4260. if (res.code == "ok") {
  4261. // console.log("维度数据",res.data);
  4262. this.workForm.domains[index].wuduList = res.data
  4263. // this.workForm = this.workForm
  4264. this.$forceUpdate()
  4265. }
  4266. },
  4267. error => {
  4268. this.$message({
  4269. message: error,
  4270. type: "error"
  4271. });
  4272. }
  4273. );
  4274. },
  4275. //切换任务阶段
  4276. changeStages(domain, index) {
  4277. if (domain.stage == null || domain.stage == '') {
  4278. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4279. } else {
  4280. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4281. }
  4282. this.getRecentTaskList(domain, index);
  4283. this.$forceUpdate();
  4284. },
  4285. getGroupStages(domain, index, keepStage) {
  4286. // console.log(domain);
  4287. if(!domain.groupId){
  4288. domain.projectAuditorId = ''
  4289. domain.stages = []
  4290. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4291. domain.taskId = ''
  4292. domain.sapServiceId = ''
  4293. }
  4294. if(this.user.timeType.reportAuditType >= 1){
  4295. domain.auditUserList = []
  4296. }
  4297. this.$forceUpdate();
  4298. return
  4299. }
  4300. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4301. res => {
  4302. if (res.code == "ok") {
  4303. if (!keepStage) {
  4304. domain.stage = '';
  4305. }
  4306. domain.stages = res.data;
  4307. this.getRecentTaskList(domain, index);
  4308. this.$forceUpdate();
  4309. }
  4310. },
  4311. error => {
  4312. this.$message({
  4313. message: error,
  4314. type: "error"
  4315. });
  4316. });
  4317. //检查当前的项目是否需要获取分组的负责人
  4318. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4319. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4320. res => {
  4321. if (res.code == "ok") {
  4322. domain.getProjectAuditorList = res.data;
  4323. domain.auditUserList = res.data;
  4324. if (res.data.length==1) {
  4325. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4326. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4327. } else if (res.data.length==0) {
  4328. domain.projectAuditorId = null;
  4329. domain.projectAuditorName = null;
  4330. }
  4331. this.$forceUpdate();
  4332. }
  4333. },
  4334. error => {
  4335. this.$message({
  4336. message: error,
  4337. type: "error"
  4338. });
  4339. });
  4340. }
  4341. },
  4342. getProjectProfessions(domain, index) {
  4343. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4344. res => {
  4345. if (res.code == "ok") {
  4346. this.workForm.domains[index].professionProgress = res.data;
  4347. this.$forceUpdate();
  4348. }
  4349. },
  4350. error => {
  4351. this.$message({
  4352. message: error,
  4353. type: "error"
  4354. });
  4355. });
  4356. },
  4357. //删除自己的日报
  4358. deleteReport() {
  4359. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4360. confirmButtonText: this.$t('btn.determine'),
  4361. cancelButtonText: this.$t('btn.cancel'),
  4362. type: "warning"
  4363. })
  4364. .then(() => {
  4365. this.listLoading = true;
  4366. this.http.post('/report/delete',{
  4367. userId: this.user.id,
  4368. date: this.workForm.createDate
  4369. },
  4370. res => {
  4371. this.listLoading = false;
  4372. if (res.code == "ok") {
  4373. this.$message({
  4374. message: this.$t('message.successfullyDeleted'),
  4375. type: "success"
  4376. });
  4377. this.getReportList();
  4378. this.getDepartment();
  4379. this.dialogVisible = false;
  4380. } else {
  4381. this.$message({
  4382. message: res.msg,
  4383. type: "error"
  4384. });
  4385. }
  4386. },
  4387. error => {
  4388. this.listLoading = false;
  4389. this.$message({
  4390. message: error,
  4391. type: "error"
  4392. });
  4393. }
  4394. );
  4395. })
  4396. .catch(() => {});
  4397. },
  4398. // 管理员删除日报
  4399. guanli(item) {
  4400. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4401. let param = {date: this.date + day, userId: item.id};
  4402. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4403. confirmButtonText: this.$t('btn.determine'),
  4404. cancelButtonText: this.$t('btn.cancel'),
  4405. type: "warning"
  4406. })
  4407. .then(() => {
  4408. this.listLoading = true;
  4409. this.http.post('/report/delete',param,
  4410. res => {
  4411. this.listLoading = false;
  4412. if (res.code == "ok") {
  4413. this.$message({
  4414. message: this.$t('message.successfullyDeleted'),
  4415. type: "success"
  4416. });
  4417. this.getReportList();
  4418. this.getDepartment();
  4419. this.dialogVisible = false;
  4420. } else {
  4421. this.$message({
  4422. message: res.msg,
  4423. type: "error"
  4424. });
  4425. }
  4426. },
  4427. error => {
  4428. this.listLoading = false;
  4429. this.$message({
  4430. message: error,
  4431. type: "error"
  4432. });
  4433. }
  4434. );
  4435. })
  4436. .catch(() => {});
  4437. },
  4438. selectAll() {
  4439. if (this.isAllSelect) {
  4440. var keys = [];
  4441. this.reportNames.forEach(b=>{
  4442. keys.push(b.id);
  4443. })
  4444. this.$refs.approveTree.setCheckedKeys(keys);
  4445. } else {
  4446. this.$refs.approveTree.setCheckedKeys([]);
  4447. }
  4448. },
  4449. removeEmptyNode(list) {
  4450. for (var i=0;i<list.length;i++) {
  4451. var cnt = 0;
  4452. if (list[i].membCount == 0) {
  4453. list.splice(i, 1);
  4454. i--;
  4455. } else if (list[i].children != null) {
  4456. this.removeEmptyNode(list[i].children);
  4457. }
  4458. }
  4459. },
  4460. calculateMembCount(list) {
  4461. for (var i in list) {
  4462. var cnt = 0;
  4463. if (list[i].children != null) {
  4464. this.calculateMembCount(list[i].children);
  4465. for (var m in list[i].children) {
  4466. cnt += list[i].children[m].membCount;
  4467. }
  4468. }
  4469. if (list[i].isUser == 1) {
  4470. cnt++;
  4471. this.membCount++;
  4472. }
  4473. list[i].membCount = cnt;
  4474. }
  4475. },
  4476. stateChange() {
  4477. // console.log(this.allData,'alldate');
  4478. this.membCount = 0;
  4479. if (this.selectState == -1) {
  4480. //全部状态
  4481. this.data = this.allData;
  4482. } else {
  4483. //未填报
  4484. this.seluserText = ''
  4485. var newData = JSON.parse(JSON.stringify(this.allData));
  4486. this.filterState(this.selectState, newData);
  4487. this.data = newData;
  4488. }
  4489. this.calculateMembCount(this.data);
  4490. this.data[0].membCount = this.membCount;//总人数
  4491. },
  4492. //按状态过滤部门人员
  4493. filterState(state, list) {
  4494. for (var i =0;i<list.length; i++) {
  4495. var obj = list[i];
  4496. if (obj.isUser == 1) {
  4497. var match = false;
  4498. if (state == -2) {
  4499. if (obj.state == null) {
  4500. match = true;
  4501. }
  4502. } else {
  4503. if (obj.state == state) {
  4504. match = true;
  4505. }
  4506. }
  4507. if (!match) {
  4508. list.splice(i, 1);
  4509. i--;
  4510. } else {
  4511. }
  4512. } else {
  4513. if (obj.children != null) {
  4514. this.filterState(state, obj.children);
  4515. }
  4516. }
  4517. }
  4518. },
  4519. //a按名称过滤部门人员
  4520. async seluserforText(){
  4521. const { userNameNeedTranslate } = this.user
  4522. this.membCount = 0;
  4523. var newData = JSON.parse(JSON.stringify(this.allData));
  4524. let textList = [this.seluserText]
  4525. if(userNameNeedTranslate == 1) {
  4526. this.dataLoading = true
  4527. let res = await this.postData('/user/getEmployeeList', {
  4528. keyword: this.seluserText,
  4529. cursor: '',
  4530. departmentId: -1,
  4531. pageIndex: 1,
  4532. pageSize: 1000
  4533. })
  4534. textList = res.data.records.map(item => item.name)
  4535. this.dataLoading = false
  4536. }
  4537. // return
  4538. console.log(textList, '<=== textList')
  4539. this.seluserforTextin(this.seluserText, newData, textList)
  4540. console.log(newData, 'Data')
  4541. this.data = newData;
  4542. this.calculateMembCount(this.data);
  4543. this.data[0].membCount = this.membCount;//总人数
  4544. },
  4545. seluserforTextin(text, list, textList = []){
  4546. for (var i =0;i<list.length; i++) {
  4547. var obj = list[i];
  4548. if (obj.isUser == 1) {
  4549. var match = false;
  4550. // if (obj.label.indexOf(text) != -1) {
  4551. // match = true
  4552. // }
  4553. if(textList.some(item => item.includes(obj.label))) {
  4554. match = true
  4555. }
  4556. if (!match) {
  4557. list.splice(i, 1);
  4558. i--;
  4559. } else {
  4560. }
  4561. } else {
  4562. if (obj.children != null) {
  4563. this.seluserforTextin(text, obj.children, textList);
  4564. }
  4565. }
  4566. }
  4567. },
  4568. // 当节点发生变化时
  4569. nodeChangeExpand(data) {
  4570. // 保存当前展开的节点
  4571. let flag = false
  4572. this.nodeModelData.some(item => {
  4573. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4574. flag = true
  4575. return true
  4576. }
  4577. })
  4578. if (!flag) { // 不存在则存到数组里
  4579. this.nodeModelData.push(data.id)
  4580. }
  4581. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4582. },
  4583. nodeChangeCollapse(data) {
  4584. console.log(this.nodeModelData)
  4585. this.nodeModelData.some((item, i) => {
  4586. if (item === data.id) {
  4587. this.nodeModelData.length = i
  4588. }
  4589. })
  4590. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4591. },
  4592. // 部门列表点击
  4593. handleNodeClick(data) {
  4594. // this.dealList = data
  4595. this.theValues(data.id, this.allData)
  4596. // this.depData = data;
  4597. var list = [];
  4598. if (data.id == -1) {
  4599. this.deptId = null;
  4600. this.targetUid = null;
  4601. list = this.data;
  4602. } else if (data.isUser == 1) {
  4603. this.deptId = null;
  4604. this.targetUid = data.id;
  4605. } else {
  4606. this.deptId = data.id;
  4607. this.targetUid = null;
  4608. list.push(data);
  4609. }
  4610. this.getReportList();
  4611. if (list.length > 0) {
  4612. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4613. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4614. }
  4615. },
  4616. exportPushLog(){
  4617. this.http.post('/sap-sync-log/export',{},
  4618. res => {
  4619. if (res.code == "ok") {
  4620. var filePath = res.data;
  4621. var fName = '推送日志.xlsx'
  4622. const a = document.createElement('a'); // 创建a标签
  4623. a.setAttribute('download', fName);// download属性
  4624. a.setAttribute('href', filePath);// href链接
  4625. a.click(); //自执行点击事件
  4626. a.remove();
  4627. } else {
  4628. this.$message({
  4629. message: res.msg,
  4630. type: "error"
  4631. });
  4632. }
  4633. },
  4634. error => {
  4635. this.$message({
  4636. message: error,
  4637. type: "error"
  4638. });
  4639. });
  4640. },
  4641. theValues(id, item) {
  4642. for(var i in item) {
  4643. if(item[i].id == id) {
  4644. this.depData = item[i]
  4645. if(id == '-1') {
  4646. this.translation = '1'
  4647. } else {
  4648. if(item[i].children) {
  4649. this.translation = '2'
  4650. } else {
  4651. this.translation = '3'
  4652. }
  4653. }
  4654. return
  4655. } else {
  4656. if(item[i].children) {
  4657. this.theValues(id, item[i].children)
  4658. }
  4659. }
  4660. }
  4661. },
  4662. //获取可以选择的代填的人员列表
  4663. getSubstitudeUserDeptList() {
  4664. if (this.deptMembData.length == 0) {
  4665. this.http.post("/department/listMyMembs", {},
  4666. res => {
  4667. if (res.code == "ok") {
  4668. let noAllData = JSON.parse(JSON.stringify(res.data));
  4669. if (noAllData.length > 0) {
  4670. // if (noAllData[0].label == '全部人员') {
  4671. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4672. noAllData.splice(0,1);
  4673. }
  4674. }
  4675. this.setUserToDept(noAllData);
  4676. this.deptMembData = noAllData;
  4677. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4678. console.log(this.deptMembData, '代填人员数据')
  4679. } else {
  4680. this.$message({
  4681. message: res.msg,
  4682. type: "error"
  4683. });
  4684. }
  4685. },
  4686. error => {
  4687. this.$message({
  4688. message: error,
  4689. type: "error"
  4690. });
  4691. });
  4692. }
  4693. },
  4694. // 获取部门列表
  4695. getDepartmentForApprove() {
  4696. this.http.post( this.port.manage.depList, {},
  4697. res => {
  4698. if (res.code == "ok") {
  4699. var list1 = JSON.parse(JSON.stringify(res.data));
  4700. this.deptOptionList = this.changeArr(list1);
  4701. console.log(this.deptOptionList, '部门')
  4702. } else {
  4703. this.$message({
  4704. message: res.msg,
  4705. type: "error"
  4706. });
  4707. }
  4708. },
  4709. error => {
  4710. this.$message({
  4711. message: error,
  4712. type: "error"
  4713. });
  4714. });
  4715. },
  4716. // 获取部门列表
  4717. getDepartment() {
  4718. //如果没有权限,就不需要获取
  4719. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4720. return;
  4721. }
  4722. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4723. var param = {date:this.date + day};
  4724. this.http.post("/report/getMembList", param,
  4725. res => {
  4726. if (res.code == "ok") {
  4727. if(res.data.length == 0){
  4728. return
  4729. }
  4730. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4731. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4732. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4733. // if (this.user.role > 0) {
  4734. // }
  4735. list.splice(0,0,{
  4736. id: -1,
  4737. label: this.$t('lable.allStaff'),
  4738. })
  4739. this.membCount = 0;
  4740. //设置员工到部门下面
  4741. this.setUserToDept(list);
  4742. this.data = list;
  4743. // console.log('data',this.data);
  4744. this.expandDate = [this.data[1].id]
  4745. this.allData = list;
  4746. // if (noAllData.length > 0) {
  4747. // if (noAllData[0].label == '全部人员') {
  4748. // noAllData.splice(0,1);
  4749. // }
  4750. // }
  4751. // this.setUserToDept(noAllData);
  4752. // this.deptMembData = noAllData;
  4753. this.option = this.changeArr(list1);
  4754. list[0].membCount = this.membCount;
  4755. if (this.depData.id == -1) {
  4756. this.depData.membCount = this.membCount;
  4757. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4758. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4759. } else {
  4760. if (this.depData.isUser == null) {
  4761. var dep = this.findTargetDept(this.data, this.depData.id);
  4762. var membDeptList = [];
  4763. membDeptList.push(dep);
  4764. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4765. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4766. }
  4767. }
  4768. if (this.depData.isUser == null) {
  4769. if (this.isFill) {
  4770. this.fillMembList = this.fillList;
  4771. } else {
  4772. this.fillMembList = this.unFillList;
  4773. }
  4774. }
  4775. this.leaveAllNum = 0
  4776. for(let i in this.unFillList){
  4777. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4778. this.leaveAllNum += 1
  4779. }
  4780. }
  4781. this.stateChange()
  4782. } else {
  4783. this.$message({
  4784. message: res.msg,
  4785. type: "error"
  4786. });
  4787. }
  4788. },
  4789. error => {
  4790. this.$message({
  4791. message: error,
  4792. type: "error"
  4793. });
  4794. });
  4795. this.getReportFillStatus();
  4796. },
  4797. findTargetDept(list, deptId) {
  4798. var t = null;
  4799. for (var i=0;i<list.length; i++) {
  4800. if (list[i].isUser == null && list[i].id == deptId) {
  4801. t = list[i];
  4802. break;
  4803. }
  4804. }
  4805. if (t == null) {
  4806. for (var i=0;i<list.length; i++) {
  4807. if (list[i].children != null && list[i].children.length > 0) {
  4808. t = this.findTargetDept(list[i].children, deptId);
  4809. if (t != null) {
  4810. break;
  4811. }
  4812. }
  4813. }
  4814. }
  4815. return t;
  4816. },
  4817. getUserMembListFromDeptList(list, isFill) {
  4818. var membList = [];
  4819. for (var i in list) {
  4820. var deptName = list[i].label;
  4821. if (list[i].userList != null) {
  4822. list[i].userList.forEach(element => {
  4823. if (isFill == 0) {
  4824. //获取未填的
  4825. if (element.state == null) {
  4826. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4827. membList.push(obj);
  4828. }
  4829. } else {
  4830. if (element.state != null) {
  4831. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4832. membList.push(obj);
  4833. }
  4834. }
  4835. });
  4836. }
  4837. if (list[i].children != null) {
  4838. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4839. }
  4840. }
  4841. return membList;
  4842. },
  4843. setUserToDept(list) {
  4844. for (var i in list) {
  4845. var cnt = 0;
  4846. if (list[i].children != null) {
  4847. this.setUserToDept(list[i].children);
  4848. for (var m in list[i].children) {
  4849. cnt += list[i].children[m].membCount;
  4850. }
  4851. }
  4852. if (list[i].userList != null) {
  4853. if (list[i].children == null) {
  4854. list[i].children = [];
  4855. }
  4856. list[i].userList.forEach(element => {
  4857. var obj = {
  4858. id: element.id,
  4859. label:element.name,
  4860. state:element.state,
  4861. parentId:element.departmentId,
  4862. isUser:1,
  4863. workingTime: element.workingTime,
  4864. leaveDays: element.leaveDays,
  4865. leaveTimes: element.leaveTimes
  4866. };
  4867. list[i].children.push(obj);
  4868. this.membCount++;
  4869. cnt++;
  4870. });
  4871. }
  4872. list[i].membCount = cnt;
  4873. }
  4874. },
  4875. // 修改数组
  4876. changeArr(arr) {
  4877. for (var i = 0; i < arr.length; i++) {
  4878. if(arr[i].id != -1 && arr[i].id != 0) {
  4879. if (arr[i].children != null && arr[i].children.length>0) {
  4880. arr[i].children = this.changeArr(arr[i].children);
  4881. }
  4882. arr[i].id && (arr[i].value = arr[i].id);
  4883. delete arr[i].id;
  4884. }
  4885. }
  4886. for(var i in arr) {
  4887. if(arr[i].id == -1 || arr[i].id == 0) {
  4888. arr.splice(i,1)
  4889. }
  4890. }
  4891. return arr;
  4892. },
  4893. //时间段范围设置改动,监听
  4894. onTimeTypeChange(timeType) {
  4895. this.seleChn(1)
  4896. this.showAddMore = true;
  4897. for(var i in this.workForm.domains) {
  4898. if (this.workForm.domains[i].timeType == 0) {
  4899. this.showAddMore = false;
  4900. break;
  4901. }
  4902. }
  4903. if (this.showAddMore) {
  4904. //检测数量
  4905. if (this.workForm.domains.length == 2) {
  4906. this.showAddMore = false;
  4907. } else {
  4908. this.showAddMore = true;
  4909. }
  4910. }
  4911. },
  4912. getTimeType() {
  4913. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4914. res => {
  4915. if (res.code == "ok") {
  4916. var t = res.data;
  4917. this.reportTimeType = t;
  4918. if (this.reportTimeType.type > 0) {
  4919. this.showAddMore = true;
  4920. }
  4921. //转化时间格式
  4922. if (t.allday != null) {
  4923. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4924. }
  4925. if (t.am != null) {
  4926. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4927. }
  4928. if (t.pm != null) {
  4929. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4930. }
  4931. let arr = []
  4932. for(var i in res.data.excludeTimeList) {
  4933. let obj = {
  4934. s: res.data.excludeTimeList[i].startTime,
  4935. e: res.data.excludeTimeList[i].endTime,
  4936. }
  4937. arr.push(obj)
  4938. }
  4939. this.vacationTime = arr
  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. changeMonthOut() {
  4957. this.getAllDate();
  4958. this.getReportList();
  4959. this.getDepartment();
  4960. },
  4961. // 选择日期
  4962. choseDate(i, item) {
  4963. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4964. return
  4965. }
  4966. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4967. this.choseDay = i;
  4968. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4969. sessionStorage.msg = this.date + day,
  4970. this.getReportList();
  4971. this.getDepartment();
  4972. this.curDate = item.date;
  4973. },
  4974. canClick(i, item){
  4975. let nowDate = new Date()
  4976. let nowDateYear = nowDate.getFullYear()
  4977. let itemYear = parseInt(this.date.split('-')[0])
  4978. let nowDateMonth = nowDate.getMonth() + 1
  4979. let itemMonth = parseInt(this.date.split('-')[1])
  4980. let nowDateDay = nowDate.getDate()
  4981. let itemDay = parseInt(item.showDate.split('.')[1])
  4982. if(nowDateYear < itemYear){
  4983. return false
  4984. }else if(nowDateYear == itemYear){
  4985. if(nowDateMonth < itemMonth){
  4986. return false
  4987. }else if(nowDateMonth == itemMonth){
  4988. if(nowDateDay < itemDay){
  4989. return false
  4990. }
  4991. }
  4992. }
  4993. },
  4994. // 获取日期列表
  4995. getAllDate(e) {
  4996. var dayArry = [];
  4997. var day = this.getCountDays();
  4998. let curMonthDay = null;
  4999. for (var k = 1; k <= day; k++) {
  5000. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5001. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5002. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5003. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5004. if(sessionStorage.msg) {
  5005. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5006. this.choseDay = k - 1;
  5007. curMonthDay = str;
  5008. }
  5009. } else {
  5010. if (new Date().getDate() == k) {
  5011. this.choseDay = k - 1;
  5012. }
  5013. }
  5014. } else {
  5015. this.choseDay = 0;
  5016. }
  5017. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5018. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5019. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5020. }
  5021. this.allDate = dayArry;
  5022. //不能超过最大日期
  5023. if (this.choseDay > day-1) {
  5024. this.choseDay = day-1;
  5025. }
  5026. if(sessionStorage.from != 1){
  5027. let nowmonth = new Date().getMonth() + 1
  5028. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5029. let nowdate = new Date().getDate()
  5030. if(nowd == this.date){
  5031. if(e && sessionStorage.msg){
  5032. }else{
  5033. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5034. }
  5035. let nowday = new Date(sessionStorage.msg).getDate()
  5036. this.choseDay = nowday - 1
  5037. let monthdate = new Date(sessionStorage.msg)
  5038. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5039. }else{
  5040. if(e && sessionStorage.msg){
  5041. }else{
  5042. sessionStorage.msg = this.date + '-01'
  5043. }
  5044. let monthdate = new Date(sessionStorage.msg)
  5045. this.choseDay = monthdate.getDate() - 1
  5046. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5047. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5048. }
  5049. }else{
  5050. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5051. }
  5052. //从消息点击跳转过来的,直接加载指定日期
  5053. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5054. this.curDate = sessionStorage.msg;
  5055. sessionStorage.from = 0;
  5056. } else {
  5057. // if (curMonthDay != null) {
  5058. // // this.curDate = curMonthDay;
  5059. // let d = new Date(sessionStorage.msg)
  5060. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5061. // } else {
  5062. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5063. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5064. // }
  5065. }
  5066. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5067. // if(!sessionStorage.msg){
  5068. // let msgday = this.choseDay + 1
  5069. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5070. // }
  5071. this.getReportFillStatus();
  5072. },
  5073. getCountDays() {
  5074. var newstr = this.date.replace(/-/g, "/");
  5075. var curDate = new Date(newstr+'/01');
  5076. var curMonth = curDate.getMonth();
  5077. curDate.setMonth(curMonth + 1);
  5078. curDate.setDate(0);
  5079. return curDate.getDate();
  5080. },
  5081. reqMore() {
  5082. if (this.hasMore) {
  5083. this.pageIndex++;
  5084. this.requestHttpReports();
  5085. }
  5086. },
  5087. //加载日报数据
  5088. requestHttpReports() {
  5089. //请求数据
  5090. this.listLoading = true;
  5091. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5092. let param = {date: this.date + day};
  5093. if (this.deptId) {
  5094. param.deptId = this.deptId;
  5095. }
  5096. if (this.targetUid) {
  5097. param.userId = this.targetUid;
  5098. }
  5099. //传页码
  5100. if (this.hasMore) {
  5101. param.pageIndex = this.pageIndex;
  5102. }
  5103. this.http.post( this.port.report.list, param,
  5104. res => {
  5105. this.listLoading = false;
  5106. if (res.code == "ok") {
  5107. //扩增
  5108. this.reportList = this.reportList.concat(res.data.data);
  5109. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5110. if(document.querySelector("#day"+this.choseDay)){
  5111. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5112. }
  5113. } else {
  5114. this.$message({
  5115. message: res.msg,
  5116. type: "error"
  5117. });
  5118. }
  5119. },
  5120. error => {
  5121. this.listLoading = false;
  5122. this.$message({
  5123. message: error,
  5124. type: "error"
  5125. });
  5126. });
  5127. },
  5128. //获取日报列表
  5129. getReportList() {
  5130. //初始化,重置数据
  5131. this.pageIndex = 0;
  5132. this.hasMore = true;
  5133. this.reportList = [];
  5134. this.requestHttpReports();
  5135. },
  5136. //刷新日报状态,用于审核后更新
  5137. refreshReportData(reportId) {
  5138. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5139. res => {
  5140. if (res.code == "ok") {
  5141. for (var m=0;m<this.reportList.length; m++) {
  5142. var d = this.reportList[m].data;
  5143. var find = d.filter(r=>r.id == reportId);
  5144. if (find.length > 0) {
  5145. find[0].state = res.data.state;
  5146. if (find[0].state == 2) {//被驳回,要可以编辑
  5147. this.reportList[m].state = 2;
  5148. }
  5149. find[0].isDeptAudit = res.data.isDeptAudit;
  5150. find[0].departmentAuditState = res.data.departmentAuditState;
  5151. find[0].projectAuditorName = res.data.projectAuditorName;
  5152. find[0].projectAuditorId = res.data.projectAuditorId;
  5153. find[0].projectAuditState = res.data.projectAuditState;
  5154. find[0].rejectUserid = res.data.rejectUserid;
  5155. find[0].rejectUsername = res.data.rejectUsername;
  5156. find[0].rejectReason = res.data.rejectReason;
  5157. this.$forceUpdate();
  5158. break;
  5159. }
  5160. }
  5161. } else {
  5162. this.$message({
  5163. message: res.msg,
  5164. type: "error"
  5165. });
  5166. }
  5167. },
  5168. error => {
  5169. this.listLoading = false;
  5170. this.$message({
  5171. message: error,
  5172. type: "error"
  5173. });
  5174. });
  5175. },
  5176. //导出员工工时统计
  5177. exportUserTime() {
  5178. this.listLoading = true;
  5179. var param = {};
  5180. if (this.exportParam.dateRange != null) {
  5181. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5182. }
  5183. this.http.post('/department/exportDeptStatistic', param,
  5184. res => {
  5185. this.listLoading = false;
  5186. if (res.code == "ok") {
  5187. location.href = res.data;
  5188. this.exportTimeDialog = false;
  5189. } else {
  5190. this.$message({
  5191. message: res.msg,
  5192. type: "error"
  5193. });
  5194. }
  5195. },
  5196. error => {
  5197. this.listLoading = false;
  5198. this.$message({
  5199. message: error,
  5200. type: "error"
  5201. });
  5202. });
  5203. },
  5204. //导出日报
  5205. exportReport() {
  5206. this.exportingData = true;
  5207. var param = {};
  5208. if (this.exportParam.dateRange != null) {
  5209. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5210. }
  5211. if (this.exportParam.projectId != null) {
  5212. param.projectId = this.exportParam.projectId;
  5213. }
  5214. if (this.exportParam.departmentId != null) {
  5215. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5216. }
  5217. param.stateKey = this.stateKey
  5218. // param.departmentId = this.user.departmentId
  5219. console.log(param, '《=== 导出传的参数');
  5220. console.log('开始调用exportReport接口');
  5221. this.http.post(this.port.report.export, param,
  5222. res => {
  5223. this.exportingData = false;
  5224. if (res.code == "ok") {
  5225. location.href = res.data;
  5226. this.exportDialog = false;
  5227. } else {
  5228. this.$message({
  5229. message: res.msg,
  5230. type: "error"
  5231. });
  5232. }
  5233. },
  5234. error => {
  5235. this.exportingData = false;
  5236. this.$message({
  5237. message: error,
  5238. type: "error"
  5239. });
  5240. });
  5241. },
  5242. //获取项目列表
  5243. getProjectList() {
  5244. this.listLoading = true;
  5245. this.http.post( this.port.project.list, {},
  5246. res => {
  5247. this.listLoading = false;
  5248. if (res.code == "ok") {
  5249. for(var i in res.data) {
  5250. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5251. res.data[i].projectCode = ''
  5252. }
  5253. }
  5254. this.projectList = res.data;
  5255. console.log("项目列表",this.projectList);
  5256. } else {
  5257. this.$message({
  5258. message: res.msg,
  5259. type: "error"
  5260. });
  5261. }
  5262. },
  5263. error => {
  5264. this.listLoading = false;
  5265. this.$message({
  5266. message: error,
  5267. type: "error"
  5268. });
  5269. });
  5270. },
  5271. // 获取填报日报的项目下拉列表
  5272. getFillProjectList() {
  5273. this.http.post( this.port.project.list, {
  5274. forReport: 1
  5275. },res => {
  5276. if (res.code == "ok") {
  5277. for(var i in res.data) {
  5278. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5279. res.data[i].projectCode = ''
  5280. }
  5281. }
  5282. this.fillProjectList = res.data;
  5283. this.getRecentlyProject()
  5284. } else {
  5285. this.$message({
  5286. message: res.msg,
  5287. type: "error"
  5288. });
  5289. }
  5290. },
  5291. error => {
  5292. this.$message({
  5293. message: error,
  5294. type: "error"
  5295. });
  5296. });
  5297. },
  5298. getBasecostItemList() {
  5299. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5300. companyId: this.user.companyId
  5301. },
  5302. res => {
  5303. if (res.code == "ok") {
  5304. this.timeBasecostList = res.data;
  5305. }
  5306. });
  5307. },
  5308. getAIReport(createDate) {
  5309. this.http.post('/report/getAIReport', {},
  5310. res => {
  5311. if (res.code == "ok") {
  5312. var quanbu = 0
  5313. this.jsDay = 1
  5314. var zhi = ''
  5315. var slp = res.data
  5316. for(var i in slp) {
  5317. var sp = +slp[i].workingTime + 0
  5318. zhi = this.jsDay * sp
  5319. quanbu = +quanbu + zhi
  5320. }
  5321. this.jsTime = quanbu
  5322. var aiReportData = res.data;
  5323. this.canCancelInDialog = false
  5324. if(aiReportData.length != 0) {
  5325. var arr = [];
  5326. for(var i in aiReportData) {
  5327. arr.push({
  5328. id: null,
  5329. projectId: aiReportData[i].projectId,
  5330. workingTime: aiReportData[i].workingTime,
  5331. content: '',
  5332. progress:100,
  5333. state: 2,
  5334. timeType: aiReportData[i].timeType,
  5335. subProjectList: aiReportData[i].subProjectList,
  5336. taskList: aiReportData[i].taskList,
  5337. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5338. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5339. taskId: aiReportData[i].taskId,
  5340. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5341. startTime: aiReportData[i].startTime,
  5342. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5343. endTime: aiReportData[i].endTime,
  5344. isOvertime: 0,
  5345. progress:aiReportData[i].progress,
  5346. professionProgress: aiReportData[i].professionProgressList,
  5347. stages:aiReportData[i].stages,
  5348. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5349. pics: null,
  5350. multiWorktime: aiReportData[i].multiWorktime,
  5351. worktimeList: [{}],
  5352. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5353. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5354. wuduList: aiReportData[i].degreeList,
  5355. taskGroups:aiReportData[i].taskGroups,
  5356. customData: aiReportData[i].customData,//自定义的数值
  5357. auditUserList: aiReportData[i].auditUserList,
  5358. projectAuditorId: aiReportData[i].projectAuditorId,
  5359. projectAuditorName: aiReportData[i].projectAuditorName,
  5360. overtimeHours: aiReportData[i].overtimeHours,
  5361. customText: aiReportData[i].customText,
  5362. basecostId: aiReportData[i].basecostId,
  5363. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5364. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5365. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5366. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5367. canEdit: true
  5368. })
  5369. }
  5370. this.workForm.domains = arr;
  5371. } else {
  5372. }
  5373. this.canEdit = true;
  5374. this.originCanEdit = true;
  5375. this.seleChn()
  5376. } else {
  5377. this.$message({
  5378. message: res.msg,
  5379. type: "error"
  5380. });
  5381. }
  5382. },
  5383. error => {
  5384. this.$message({
  5385. message: error,
  5386. type: "error"
  5387. });
  5388. });
  5389. },
  5390. // 获取个人某天的日报 111111
  5391. getReport() {
  5392. this.http.post( this.port.report.getPort, {
  5393. date: this.workForm.createDate
  5394. },
  5395. res => {
  5396. if (res.code == "ok") {
  5397. var quanbu = 0
  5398. this.jsDay = 1
  5399. var zhi = ''
  5400. var slp = res.data.report
  5401. for(var i in slp) {
  5402. var sp = +slp[i].workingTime + 0
  5403. zhi = this.jsDay * sp
  5404. quanbu = +quanbu + zhi
  5405. }
  5406. this.jsTime = quanbu
  5407. var list = res.data;
  5408. this.report = list;
  5409. this.reportTimeType = this.report.timeType;
  5410. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5411. this.isWeekend = !this.report.isWorkDay;
  5412. this.canCancelInDialog = false;
  5413. this.hasWrittenReport = list.report.length != 0;
  5414. if(list.report.length != 0) {
  5415. var arr = [];
  5416. this.canEdit = false;
  5417. let candelete = true
  5418. for(var i in list.report) {
  5419. var flg = null
  5420. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5421. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5422. var filteredRespList = null
  5423. if (targetP.length > 0) {
  5424. var isPublic = targetP[0].isPublic;
  5425. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5426. }
  5427. arr.push({
  5428. id: list.report[i].id,
  5429. projectId: list.report[i].projectId,
  5430. workingTime: list.report[i].workingTime,
  5431. content: list.report[i].content,
  5432. state: list.report[i].state,
  5433. timeType: list.report[i].timeType,
  5434. subProjectList: list.report[i].subProjectList,
  5435. taskList: list.report[i].taskList,
  5436. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5437. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5438. taskId: list.report[i].taskId,
  5439. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5440. startTime: list.report[i].startTime,
  5441. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5442. endTime: list.report[i].endTime,
  5443. isOvertime: flg,
  5444. progress:list.report[i].progress,
  5445. professionProgress: list.report[i].professionProgressList,
  5446. stages:list.report[i].stages,
  5447. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5448. pics: list.report[i].pics,
  5449. multiWorktime: list.report[i].multiWorktime,
  5450. worktimeList: list.report[i].worktimeList,
  5451. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5452. multiDegrIdArray: list.report[i].multiDegrIdList,
  5453. wuduList: list.report[i].degreeList,
  5454. taskGroups:list.report[i].taskGroups,
  5455. customData: list.report[i].customData,//自定义的数值
  5456. auditUserList: list.report[i].auditUserList,
  5457. projectAuditorId: list.report[i].projectAuditorId,
  5458. projectAuditorName: list.report[i].projectAuditorName,
  5459. overtimeHours: list.report[i].overtimeHours,
  5460. customText: list.report[i].customText,
  5461. basecostId: list.report[i].basecostId,
  5462. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5463. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5464. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5465. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5466. canEdit: list.report[i].state >= 2 ? true : false,
  5467. extraField1: list.report[i].extraField1,
  5468. extraField2: list.report[i].extraField2,
  5469. extraField3: list.report[i].extraField3,
  5470. workContentList: list.report[i].workContentList,
  5471. filteredRespList: filteredRespList,
  5472. serviceList: list.report[i].serviceList,
  5473. sapServiceId: list.report[i].sapServiceId,
  5474. })
  5475. if (list.report[i].state >= 2) {
  5476. this.canEdit = true;
  5477. }
  5478. if(list.report[i].state < 2){
  5479. candelete = false
  5480. }
  5481. if (list.report[i].state == 0){
  5482. this.canCancelInDialog = true
  5483. }
  5484. // 加判断
  5485. if(this.user.timeType.choseFromAlbum == 1) {
  5486. let arrList = []
  5487. for(var k in list.report[i].pics) {
  5488. let obj = {
  5489. name: k,
  5490. url: list.report[i].pics[k]
  5491. }
  5492. arrList.push(obj)
  5493. }
  5494. arr[i].imgListUrl = arrList
  5495. arr[i].imgList = list.report[i].pics
  5496. }
  5497. }
  5498. this.reportCanDelete = candelete
  5499. this.workForm = {
  5500. createDate: this.workForm.createDate,
  5501. domains: arr,
  5502. userNames:null,
  5503. userId:null,
  5504. time: list.time
  5505. }
  5506. console.log('workForm', this.workForm)
  5507. } else {
  5508. this.workForm = {
  5509. createDate: this.workForm.createDate,
  5510. domains: [{
  5511. id: null,
  5512. projectId: "",
  5513. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5514. content: "",
  5515. progress:100,
  5516. state: 2,
  5517. timeType:0,
  5518. multiWorktime: this.reportTimeType.multiWorktime,
  5519. worktimeList:[{}],
  5520. canEdit: true,
  5521. auditorFirst: '',
  5522. auditorSec: '',
  5523. auditorThird: '',
  5524. ccUserid: ''
  5525. }],
  5526. userId:null,
  5527. userNames:null,
  5528. time: this.report.time
  5529. }
  5530. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5531. this.$set(this.workForm.domains[0],'isOvertime',true)
  5532. if(this.reportTimeType.type != 2){
  5533. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5534. }
  5535. }
  5536. if(this.user.timeType.type == 1) {
  5537. var shuzhi = this.user.timeType.allday + ''
  5538. // console.log('执行一次', shuzhi.indexOf('.'))
  5539. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5540. }
  5541. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5542. //默认给第一个,必填字段
  5543. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5544. }
  5545. this.canEdit = true;
  5546. }
  5547. this.originCanEdit = this.canEdit;
  5548. this.seleChn()
  5549. } else {
  5550. this.$message({
  5551. message: res.msg,
  5552. type: "error"
  5553. });
  5554. }
  5555. },
  5556. error => {
  5557. this.$message({
  5558. message: error,
  5559. type: "error"
  5560. });
  5561. });
  5562. },
  5563. guanbi() {
  5564. this.falsss = false,
  5565. this.workTimeForMinYi=0
  5566. },
  5567. // 打开日报填写
  5568. fillInReport(i, isBatch) {
  5569. this.isWeekend = false
  5570. this.reportCanDelete = false
  5571. // console.log(this.user.timeType.type, '选择时长')
  5572. if(i != 1) {
  5573. this.falsss = false
  5574. } else {
  5575. this.falsss = true
  5576. }
  5577. if (this.isSubstitude) {
  5578. this.getSubstitudeUserDeptList();
  5579. }
  5580. if(i == -1 || this.isSubstitude) {
  5581. this.isDisable = false;
  5582. } else {
  5583. this.isDisable = true;
  5584. }
  5585. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5586. this.isBatch = isBatch;
  5587. if (this.isBatch == 0 && !this.isSubstitude) {
  5588. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5589. let weekday = new Date(this.workForm.createDate).getDay()
  5590. if(this.user.companyId == 817){
  5591. if(weekday == 0){
  5592. this.isWeekend = true
  5593. }
  5594. }else{
  5595. if(weekday == 0 || weekday == 6){
  5596. this.isWeekend = true
  5597. }
  5598. }
  5599. this.getReport(i);
  5600. } else {
  5601. // console.log('执行到了这里')
  5602. this.jsTime = 0
  5603. this.jsDay = 0
  5604. this.workForm = {
  5605. createDate: null,//批量填报没有日期
  5606. domains: [{
  5607. id: null,
  5608. projectId: "",
  5609. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5610. content: "",
  5611. progress:100,
  5612. state: 2,
  5613. timeType:0,
  5614. multiWorktime: this.reportTimeType.multiWorktime,
  5615. worktimeList:[{}],
  5616. canEdit: true,
  5617. }],
  5618. }
  5619. if(this.user.timeType.type == 1) {
  5620. var shuzhi = this.user.timeType.allday + ''
  5621. // console.log('执行二次')
  5622. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5623. }
  5624. // console.log(this.workForm)
  5625. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5626. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5627. }
  5628. this.canEdit = true;
  5629. }
  5630. this.dialogVisible = true;
  5631. },
  5632. //按周填报的弹窗口中编辑单项目相关数据
  5633. setWeekFormReportItem(reportId, i, names, row,sss) {
  5634. console.log(sss)
  5635. this.http.post('/report/getReportById', {
  5636. reportId: reportId
  5637. },
  5638. res => {
  5639. if (res.code == "ok") {
  5640. var data = res.data.report;
  5641. sss.subProjectId = data.subProjectId
  5642. sss.subProjectList = data.subProjectList;
  5643. sss.stage = data.stage
  5644. sss.subProjectList = data.subProjectList
  5645. sss.stages = data.stages
  5646. sss.taskGroups = data.taskGroups;
  5647. sss.auditUserList = data.auditUserList;
  5648. sss.degreeId = data.degreeId;
  5649. sss.customData = data.customData;
  5650. sss.wuduList = data.degreeList;
  5651. this.zhoBaoIdx = i
  5652. this.zhoBaoName = names
  5653. this.zhoBao = sss
  5654. this.zhis = row
  5655. if (sss.groupId) {
  5656. //最后一个参数表示是否保留stage的值,不要重置为空
  5657. this.getGroupStages(this.zhoBao, 0, true)
  5658. }
  5659. this.$forceUpdate();
  5660. }
  5661. });
  5662. },
  5663. // 按周填报里内容的填写
  5664. tianxies(item, i, names, row) {
  5665. if (item.state == 0) {
  5666. this.$message({
  5667. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5668. type: "error"
  5669. });
  5670. return;
  5671. }
  5672. if (item.state == 1) {
  5673. this.$message({
  5674. message: '已通过状态不可修改',
  5675. type: "error"
  5676. });
  5677. return;
  5678. }
  5679. if(this.user.timeType.notAllowedNoAttendance == 1){
  5680. if(this.zhoData[i].corpTime){
  5681. if(this.zhoData[i].corpTime.workHours == 0){
  5682. this.$message({
  5683. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5684. type: 'error'
  5685. })
  5686. return
  5687. }
  5688. }else{
  5689. this.$message({
  5690. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5691. type: 'error'
  5692. })
  5693. return
  5694. }
  5695. }
  5696. var idd = ''
  5697. var obj = {}
  5698. for(var l in this.projectList) {
  5699. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5700. }
  5701. obj.projectId = idd
  5702. this.tianxieDialogVisible = true
  5703. this.scopess = item
  5704. console.log(item, '《==== 当前的对象')
  5705. var sss = {}
  5706. if (item.id != null) {
  5707. sss.id = item.id;
  5708. sss.state = item.state;
  5709. } else {
  5710. sss.id = -1;
  5711. sss.state = 3;
  5712. }
  5713. sss.projectId = idd;
  5714. sss.progress = item.progress
  5715. sss.time = item.time
  5716. sss.content = item.content;
  5717. console.log('333', sss.content)
  5718. if (sss.time == '' && this.reportTimeType.type == 2) {
  5719. //取已填时间范围中最大的一个作为开始时间
  5720. var startTime = '09:00';
  5721. var fillStartTime = '00:00';
  5722. for (var t in this.selProjectList) {
  5723. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5724. if (fillItem.time) {
  5725. if (fillItem.time[1] > fillStartTime) {
  5726. fillStartTime = fillItem.time[1];
  5727. }
  5728. }
  5729. }
  5730. if (fillStartTime == '00:00') {
  5731. fillStartTime = '09:00';
  5732. }
  5733. var fillEndMax = '18:00';
  5734. if (fillStartTime >= '18:00') {
  5735. fillEndMax = '23:59';
  5736. }
  5737. sss.time = [fillStartTime, fillEndMax];
  5738. }
  5739. sss.groupId = item.groupId
  5740. sss.stage = item.stage;
  5741. sss.workingTime = item.workingTime
  5742. sss.projectAuditorId = item.projectAuditorId;
  5743. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5744. //默认选中第一个
  5745. sss.basecostId = this.timeBasecostList[0].id;
  5746. }
  5747. var hasEdited = this.zhoData[i][names].hasEdited;
  5748. if (hasEdited) {
  5749. sss = { ...item }
  5750. //编辑过了
  5751. sss.subProjectId = item.subProjectId
  5752. sss.stage = item.stage
  5753. sss.subProjectList = item.subProjectList
  5754. sss.stages = item.stages
  5755. sss.taskGroups = item.taskGroups;
  5756. console.log(sss.taskGroups, '33333');
  5757. sss.auditUserList = obj.auditUserList;
  5758. sss.degreeId = item.degreeId;
  5759. sss.customData = item.customData;
  5760. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5761. //只有一个审核人,自动设置上去
  5762. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5763. }
  5764. sss.wuduList = item.wuduList;
  5765. this.zhoBaoIdx = i
  5766. this.zhoBaoName = names
  5767. this.zhoBao = sss
  5768. this.zhis = row
  5769. if (sss.groupId) {
  5770. //最后一个参数表示是否保留stage的值,不要重置为空
  5771. this.getGroupStages(this.zhoBao, 0, true)
  5772. }
  5773. this.$forceUpdate();
  5774. this.getWeeklyTaskList(sss)
  5775. console.log('最后的周报 ===>', this.zhoBao)
  5776. } else {
  5777. //第一次打开,获取数据
  5778. if (sss.id == -1) {
  5779. //新填报的
  5780. this.selectProject(obj, 0);
  5781. var that = this
  5782. setTimeout(() =>{
  5783. sss.subProjectId = that.workForm.domains[0].subProjectId
  5784. sss.subProjectList = item.subProjectList;
  5785. sss.stage = that.workForm.domains[0].stage
  5786. sss.subProjectList = that.workForm.domains[0].subProjectList
  5787. sss.stages = that.workForm.domains[0].stages
  5788. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5789. sss.auditUserList = obj.auditUserList;
  5790. sss.degreeId = item.degreeId;
  5791. sss.customData = item.customData;
  5792. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5793. //只有一个审核人,自动设置上去
  5794. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5795. }
  5796. sss.wuduList = row[0].wuduList
  5797. that.zhoBaoIdx = i
  5798. that.zhoBaoName = names
  5799. that.zhoBao = sss
  5800. that.zhis = row
  5801. if (sss.groupId) {
  5802. //最后一个参数表示是否保留stage的值,不要重置为空
  5803. this.getGroupStages(that.zhoBao, 0, false)
  5804. }
  5805. that.$forceUpdate();
  5806. this.getWeeklyTaskList(sss)
  5807. },600);
  5808. } else {
  5809. //编辑填报过的;数据库已经存在的
  5810. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5811. }
  5812. }
  5813. },
  5814. // 按周填报里内容的填写点击确定
  5815. setWeekProItemData() {
  5816. //专业版模式下,任务分组和阶段必填
  5817. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5818. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5819. this.$message({
  5820. message: '任务分组和阶段必填,请检查',
  5821. type: "error"
  5822. });
  5823. return;
  5824. }
  5825. }
  5826. // 检查任务分组
  5827. if(this.user.timeType.taskGroupRequired == 1 && this.zhoBao.groupId){
  5828. this.$message({
  5829. message: '任务分组,请检查',
  5830. type: "error"
  5831. });
  5832. return
  5833. }
  5834. //检查子项目是否必填
  5835. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5836. this.$message({
  5837. message: '子项目必填,请检查',
  5838. type: "error"
  5839. });
  5840. return;
  5841. }
  5842. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5843. this.$message({
  5844. message: this.$t('message.Pleaseselectareviewer'),
  5845. type: "error"
  5846. });
  5847. return
  5848. }
  5849. if(this.user.timeType.reportAuditType == 3){
  5850. let auditTips = ''
  5851. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5852. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5853. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5854. if(auditTips){
  5855. auditTips = auditTips.substring(0,auditTips.length - 1)
  5856. this.$message({
  5857. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5858. type: 'error'
  5859. })
  5860. return
  5861. }
  5862. }
  5863. let errtips = ''
  5864. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5865. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5866. errtips += this.user.timeType.customDegreeName + '、'
  5867. }
  5868. }
  5869. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5870. errtips += this.user.timeType.customDataName + '、'
  5871. }
  5872. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5873. errtips += this.user.timeType.customTextName + '、'
  5874. }
  5875. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5876. errtips += this.$t('other.workMatters') +'、'
  5877. }
  5878. if(errtips){
  5879. errtips = errtips.substring(0,errtips.length - 1)
  5880. this.$message({
  5881. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5882. type: 'error'
  5883. })
  5884. return
  5885. }
  5886. this.tianxieDialogVisible = false
  5887. var zhong = this.zhoData
  5888. this.zhoBao.hasEdited = true;
  5889. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5890. this.zhoData = zhong
  5891. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5892. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5893. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5894. },
  5895. // 获取本周
  5896. getCurrentWeek() {
  5897. //今天
  5898. this.targetWeekDate = new Date();
  5899. this.initWeekFormData();
  5900. // this.jiazai()
  5901. },
  5902. // 获取上周
  5903. handleGetPrevWeek() {
  5904. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5905. this.initWeekFormData();
  5906. // this.jiazai()
  5907. },
  5908. // 获取下周
  5909. handleGetNextvWeek() {
  5910. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5911. this.initWeekFormData()
  5912. },
  5913. // 加载动画
  5914. jiazai() {
  5915. this.weekDataLoading = true
  5916. var that = this
  5917. setTimeout(() =>{
  5918. that.weekDataLoading = false
  5919. },1000);
  5920. },
  5921. // 转时间格式
  5922. dealdate(date) {
  5923. const dt = new Date(date)
  5924. const y = dt.getFullYear()
  5925. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5926. const d = (dt.getDate() + '').padStart(2, '0')
  5927. return `${y}-${m}-${d}`
  5928. },
  5929. // 按周填报
  5930. fillInReportss() {
  5931. window.addEventListener('scroll', this.handleScroll, true)
  5932. // this.jiazai()
  5933. this.fillWeekDialogVisi = true
  5934. this.getCurrentWeek();
  5935. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5936. //重新获取工时预警类型的预算项
  5937. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5938. companyId: this.user.companyId
  5939. },
  5940. res => {
  5941. if (res.code == "ok") {
  5942. this.timeBasecostList = res.data;
  5943. }
  5944. });
  5945. }
  5946. },
  5947. fillInReportCustom() {
  5948. this.weekIndex++
  5949. this.weekParentData = {
  5950. isSubstitude: this.isSubstitude
  5951. }
  5952. this.fillWeekDialogVisiCustom = true
  5953. },
  5954. // 按周填报的项目筛选
  5955. selListFun(){
  5956. this.selProjectList = []
  5957. if(this.selCon.length){
  5958. for (let i = 0; i < this.selCon.length; i++) {
  5959. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5960. }
  5961. this.selConShow = false ;
  5962. for (let i in this.zhoData) {
  5963. var obj = this.zhoData[i];
  5964. for(var j in this.selProjectList) {
  5965. var xinzhi = this.selProjectList[j].projectName
  5966. obj[xinzhi] = {}
  5967. obj[xinzhi].time = ''
  5968. obj[xinzhi].content = ''
  5969. obj[xinzhi].progress = 0
  5970. obj[xinzhi].workingTime = 0
  5971. }
  5972. }
  5973. this.initWeekFormData();
  5974. }else{
  5975. this.$message({
  5976. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5977. type:'error'
  5978. })
  5979. }
  5980. },
  5981. setWeekCardTimeData(list) {
  5982. for(let i in list){
  5983. let datei = '';
  5984. if (this.user.timeType.showDdCardtime == 1) {
  5985. datei = list[i].workDate;
  5986. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5987. datei = list[i].createDate;
  5988. } else if (this.user.timeType.syncFanwei == 1) {
  5989. datei = list[i].workDate;
  5990. }
  5991. for(let m in this.zhoData) {
  5992. if(datei == this.zhoData[m].zhoDataTime){
  5993. let item = {
  5994. startTime: list[i].startTime,
  5995. endTime: list[i].endTime,
  5996. workHours: list[i].workHours
  5997. }
  5998. this.$set(this.zhoData[m],'corpTime',item)
  5999. }
  6000. }
  6001. }
  6002. },
  6003. getWeeklyCardTime(){ //按周填报获取考勤信息
  6004. let dateStr = []
  6005. for(let i in this.zhoData){
  6006. dateStr.push(this.zhoData[i].zhoDataTime)
  6007. }
  6008. this.http.post('/report/getWeeklyCardTime',{
  6009. dateStr: JSON.stringify(dateStr)
  6010. },res => {
  6011. if(res.code == 'ok'){
  6012. for(let i in res.data){
  6013. let datei = '';
  6014. if (this.user.timeType.showDdCardtime == 1) {
  6015. datei = res.data[i].workDate.split('-');
  6016. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6017. datei = res.data[i].createDate.split('-');
  6018. }
  6019. for(let m in this.zhoData){
  6020. let datem = new Date(this.zhoData[m].zhoDataTime)
  6021. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6022. let item = {
  6023. startTime: res.data[i].startTime,
  6024. endTime: res.data[i].endTime,
  6025. workHours: res.data[i].workHours
  6026. }
  6027. this.$set(this.zhoData[m],'corpTime',item)
  6028. }
  6029. }
  6030. }
  6031. }else{
  6032. this.$message({
  6033. message: res.msg,
  6034. type: 'error'
  6035. })
  6036. }
  6037. },err => {
  6038. this.$message({
  6039. message: err,
  6040. type: 'error'
  6041. })
  6042. })
  6043. },
  6044. selListqx(){
  6045. this.fillWeekDialogVisi = false
  6046. this.selProjectList = []
  6047. this.selCon = []
  6048. },
  6049. handleScroll() {
  6050. this.changdu = this.projectList.length + 1
  6051. },
  6052. // 自动选择时间点的事件
  6053. // async zhoTimes(item, i) {
  6054. // var iss = i
  6055. // if(item.time == null) {
  6056. // return
  6057. // } else {
  6058. // const zhi = this.zhoData[iss];
  6059. // let he = 0;
  6060. // const timeArr = Object.values(zhi)
  6061. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6062. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6063. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6064. // console.log(data, 'data');
  6065. // zhi.he = `${he}h`;
  6066. // }
  6067. // },
  6068. async zhoTimes(item, index) {
  6069. const zho = this.zhoData[index];
  6070. if (!item.time) {
  6071. return;
  6072. }
  6073. const timeArr = Object.values(zho)
  6074. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6075. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6076. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6077. zho.he = `${totalHours[0]}h`;
  6078. },
  6079. // 判断两个时间段是否重叠
  6080. timeOverlap(idx, dateAr) {
  6081. let zhi = 0
  6082. for (let k in dateAr) {
  6083. if (idx !== k) {
  6084. 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))) {
  6085. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6086. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6087. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6088. }
  6089. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6090. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6091. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6092. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6093. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6094. } else {
  6095. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6096. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6097. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6098. }
  6099. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6100. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6101. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6102. }
  6103. }
  6104. }
  6105. }
  6106. }
  6107. return zhi
  6108. },
  6109. // 计算时间
  6110. getHourMinutes(str, end) {
  6111. var he = 0
  6112. var date2 = '2021/12/12 ' + end +':00'
  6113. var date1 = '2021/12/12 ' + str +':00'
  6114. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6115. var leave1=date3%(24*3600*1000)
  6116. var hours=Math.floor(leave1/(3600*1000))
  6117. var leave2=leave1%(3600*1000)
  6118. var minutes=Math.floor(leave2/(60*1000))
  6119. var shi = hours+'.'+ minutes
  6120. return he += +shi
  6121. },
  6122. // 自动选择事件长度的事件
  6123. zhoXuan(item, i) {
  6124. var iss = i
  6125. if(item.time == null) {
  6126. return
  6127. } else {
  6128. var zhi = this.zhoData[iss]
  6129. var he = 0
  6130. for(var i in zhi) {
  6131. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6132. he += +zhi[i].workingTime
  6133. }
  6134. }
  6135. zhi.he = he + 'h'
  6136. }
  6137. },
  6138. getPushWorkLogData(){
  6139. this.http.post('/sap-sync-log/list', {},
  6140. res => {
  6141. if (res.code == "ok") {
  6142. this.pushWorkTimeLogData = res.data;
  6143. } else {
  6144. this.$message({
  6145. message: res.msg,
  6146. type: "error"
  6147. });
  6148. }
  6149. },
  6150. error => {
  6151. this.$message({
  6152. message: error,
  6153. type: "error"
  6154. });
  6155. });
  6156. },
  6157. // 获取全部人员
  6158. getUsers() {
  6159. this.http.post('/user/getSimpleActiveUserList', {},
  6160. res => {
  6161. if (res.code == "ok") {
  6162. this.usersList = res.data;
  6163. } else {
  6164. this.$message({
  6165. message: res.msg,
  6166. type: "error"
  6167. });
  6168. }
  6169. },
  6170. error => {
  6171. this.$message({
  6172. message: error,
  6173. type: "error"
  6174. });
  6175. });
  6176. },
  6177. // 按时间比例
  6178. addBli(item, i) {
  6179. var iss = i
  6180. if(item.time == null) {
  6181. return
  6182. } else {
  6183. var zhi = this.zhoData[iss]
  6184. var he = 0
  6185. for(var i in zhi) {
  6186. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6187. he += +zhi[i].workingTime
  6188. }
  6189. }
  6190. zhi.he = he.toFixed(1) + 'h'
  6191. }
  6192. },
  6193. //按周填报选择的项目发生变化,需要设置列
  6194. onSelProjectChange() {
  6195. for (let i = 0; i < this.selCon.length; i++) {
  6196. var exists = false;
  6197. for (let j = 0; j < this.selProjectList.length; j++) {
  6198. if (this.selProjectList[j].id == this.selCon[i]) {
  6199. exists = true;
  6200. break;
  6201. }
  6202. }
  6203. if (!exists) {
  6204. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6205. this.selProjectList.push(newProject);
  6206. //添加新项目
  6207. for (var w in this.zhoData) {
  6208. var dayItem = this.zhoData[w];
  6209. var pName = newProject.projectName;
  6210. dayItem[pName] = {};
  6211. dayItem[pName].time = ''
  6212. dayItem[pName].content = ''
  6213. dayItem[pName].progress = 0
  6214. dayItem[pName].workingTime = 0
  6215. }
  6216. }
  6217. }
  6218. //去掉
  6219. for (let j = 0; j < this.selProjectList.length; j++) {
  6220. var exists = false;
  6221. for (let i = 0; i < this.selCon.length; i++) {
  6222. if (this.selProjectList[j].id == this.selCon[i]) {
  6223. exists = true;
  6224. break;
  6225. }
  6226. }
  6227. if (!exists) {
  6228. this.selProjectList.splice(j, 1);
  6229. j--;
  6230. }
  6231. }
  6232. this.loadFilledWeekReportItem();
  6233. //刷新表格
  6234. // this.$refs.weekTable.doLayout();
  6235. },
  6236. //根据选中的项目来刷新填写表格
  6237. loadFilledWeekReportItem() {
  6238. for (var w in this.zhoData) {
  6239. var dayItem = this.zhoData[w];
  6240. for (var i = 0; i < this.selProjectList.length; i++) {
  6241. var curColumnProject = this.selProjectList[i];
  6242. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6243. for (var t in dayItem.reportList) {
  6244. //有日报的项目,不能取消选择
  6245. for (var p in this.fillProjectList) {
  6246. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6247. }
  6248. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6249. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6250. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6251. if (this.reportTimeType.type == 2) {
  6252. //时间段模式
  6253. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6254. }
  6255. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6256. break;
  6257. }
  6258. }
  6259. // dayItem[curColumnProject.projectName] = matchReportItem;
  6260. }
  6261. }
  6262. this.$nextTick(()=>{
  6263. this.$refs.weekTable.doLayout();
  6264. });
  6265. },
  6266. initWeekFormData() {
  6267. this.weekDataLoading = true;
  6268. for (var p in this.fillProjectList) {
  6269. this.fillProjectList[p].canCancel = 1;
  6270. }
  6271. this.http.post('/report/getWeeklyReportData',{
  6272. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6273. },res => {
  6274. this.weekDataLoading = false;
  6275. if(res.code == 'ok'){
  6276. let projectList = res.data.projectList;
  6277. if (projectList.length > 0) {
  6278. //有选择过项目进行填报,直接选中
  6279. this.selProjectList = projectList;
  6280. this.selCon = [];
  6281. for (let i = 0; i < projectList.length; i++) {
  6282. this.selCon.push(projectList[i].id);
  6283. }
  6284. }
  6285. //设置日期
  6286. this.weekDateRange = res.data.dateList;
  6287. this.zhoData = [];
  6288. var arrst = []
  6289. for(var i in this.weekDateRange) {
  6290. var obj = {}
  6291. obj.zhoDataTime = this.weekDateRange[i].date
  6292. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6293. obj.he = this.weekDateRange[i].filledTime;
  6294. obj.canFill = this.weekDateRange[i].canFill;
  6295. // obj.filledTime = this.weekDateRange[i].filledTime;
  6296. obj.reportList = this.weekDateRange[i].reportList;
  6297. //初始化,防止渲染报错
  6298. for (var j = 0; j < this.selProjectList.length; j++) {
  6299. var pName = this.selProjectList[j].projectName
  6300. obj[pName] = {}
  6301. obj[pName].time = ''
  6302. obj[pName].content = ''
  6303. obj[pName].progress = 0
  6304. obj[pName].workingTime = 0
  6305. }
  6306. arrst.push(obj)
  6307. }
  6308. this.zhoData = arrst
  6309. this.setWeekCardTimeData(res.data.cardTimeList);
  6310. this.loadFilledWeekReportItem();
  6311. }else{
  6312. this.$message({
  6313. message: res.msg,
  6314. type: 'error'
  6315. })
  6316. }
  6317. },err => {
  6318. this.$message({
  6319. message: err,
  6320. type: 'error'
  6321. })
  6322. })
  6323. },
  6324. zhoZhi(res, i) {
  6325. var zhi = 0
  6326. for(var i in res) {
  6327. if(i != 'zhoDataTime' && i != 'he') {
  6328. zhi += +res[i]
  6329. }
  6330. }
  6331. res.he = zhi
  6332. },
  6333. zhoBtn(i) {
  6334. // this.zhoData.split(i, 1)
  6335. var arr = this.zhoData
  6336. arr.splice(i, 1)
  6337. },
  6338. zhoAddlast(){
  6339. this.selConShow = true
  6340. },
  6341. closeAddWeeklyReport(){
  6342. this.fillWeekDialogVisi = false
  6343. this.selConShow = true
  6344. this.selProjectList = []
  6345. this.selCon = []
  6346. },
  6347. // 提交按周填报
  6348. submitWeekReport(isDraft) {
  6349. var zhi = this.zhoData
  6350. var ll = 0
  6351. if(this.reportTimeType.type == 2) {
  6352. for(var i in zhi) {
  6353. this.dateAr = []
  6354. var alp = []
  6355. var zhis = zhi[i]
  6356. console.log(zhis)
  6357. for(var j in zhis) {
  6358. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6359. let objs = {}
  6360. objs.s = zhis[j].time[0]
  6361. objs.e = zhis[j].time[1]
  6362. objs.p = j
  6363. alp.push(objs)
  6364. }
  6365. }
  6366. console.log(alp)
  6367. this.dateAr = alp
  6368. if (this.reportTimeType.timeCanOverlap == 0) {
  6369. let str = this.$t('message.Filledtimeperiodsoverlap')
  6370. if(this.dateAr.length > 0) {
  6371. const trus = this.fns();
  6372. const overlapDataTime = this.getOverlapData(alp);
  6373. if (overlapDataTime.length > 0) {
  6374. const arrList = overlapDataTime.map((item) => item.p);
  6375. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6376. }
  6377. ll += 1
  6378. if(!trus) {
  6379. this.$message({
  6380. message: str,
  6381. type: 'error'
  6382. })
  6383. return false
  6384. }
  6385. }
  6386. } else {
  6387. if(this.dateAr.length > 0) {
  6388. ll +=1 ;
  6389. }
  6390. }
  6391. }
  6392. if(ll == 0) {
  6393. this.$message({
  6394. message: this.$t('message.Pleasefillinthetime'),
  6395. type: 'error'
  6396. })
  6397. return false
  6398. }
  6399. } else if(this.reportTimeType.type == 1){
  6400. for(var i in zhi) {
  6401. var zhis = zhi[i]
  6402. for(var j in zhis) {
  6403. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6404. ll += 1
  6405. }
  6406. }
  6407. }
  6408. if(ll == 0) {
  6409. this.$message({
  6410. message: this.$t('message.Pleaseselectatime'),
  6411. type: 'error'
  6412. })
  6413. return false
  6414. }
  6415. let overcorp = ''
  6416. for(let n in zhi){
  6417. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6418. overcorp += zhi[n].zhoDataTime + ','
  6419. }
  6420. }
  6421. if(overcorp != ''){
  6422. overcorp = overcorp.substring(0,overcorp.length - 1)
  6423. this.$message({
  6424. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6425. type: 'error'
  6426. })
  6427. return
  6428. }
  6429. }
  6430. var submits = []
  6431. let formData = new FormData();
  6432. formData.append("draft", isDraft);
  6433. if(this.reportTimeType.multiWorktime == 1){
  6434. for (var i in this.zhoData) {
  6435. var zhoD = this.zhoData[i]
  6436. var flgs = false
  6437. for(var j in zhoD) {
  6438. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6439. flgs = true
  6440. // formData.append("degreeId", "-1");
  6441. formData.append("id", '-1');
  6442. for(var s in this.projectList) {
  6443. if(j == this.projectList[s].projectName) {
  6444. formData.append("projectId", this.projectList[s].id);
  6445. }
  6446. }
  6447. if(this.user.timeType.reportAuditType == 3){
  6448. let audItem = {}
  6449. if(this.user.timeType.auditLevel > 0){
  6450. audItem.auditorFirst = zhoD[j].auditorFirst
  6451. }
  6452. if(this.user.timeType.auditLevel > 1){
  6453. audItem.auditorSec = zhoD[j].auditorSec
  6454. }
  6455. if(this.user.timeType.auditLevel > 2){
  6456. audItem.auditorThird = zhoD[j].auditorThird
  6457. }
  6458. if(zhoD[j].ccUserid){
  6459. audItem.ccUserid = zhoD[j].ccUserid
  6460. }
  6461. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6462. }
  6463. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6464. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6465. formData.append("reportTimeType", this.reportTimeType.type);
  6466. formData.append("endTime", '');
  6467. formData.append("startTime", '');
  6468. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6469. var lix = []
  6470. var objjs = {}
  6471. objjs.startTime = zhoD[j].time[0]
  6472. objjs.endTime = zhoD[j].time[1]
  6473. if (zhoD[j].content == null || zhoD[j].content == '') {
  6474. zhoD[j].content == '-'
  6475. }
  6476. objjs.content = zhoD[j].content
  6477. lix.push(objjs)
  6478. var zhiZhi = JSON.stringify(lix)
  6479. zhiZhi = zhiZhi.replace(/,/g,"@");
  6480. formData.append("content", zhiZhi)
  6481. formData.append("isOvertime", 0)
  6482. formData.append("professionProgress", "[]")
  6483. if (zhoD[j].groupId) {
  6484. formData.append("groupId",zhoD[j].groupId)
  6485. } else {
  6486. //解决后台groupId数组越界的问题
  6487. formData.append("groupId",0)
  6488. }
  6489. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6490. formData.append("createDate",zhoD.zhoDataTime)
  6491. if (zhoD[j].projectAuditorId) {
  6492. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6493. }
  6494. if(zhoD[j].basecostId) {
  6495. formData.append("basecostId", zhoD[j].basecostId);
  6496. } else {
  6497. formData.append("basecostId", 0);
  6498. }
  6499. if(this.user.timeType.customDegreeActive){
  6500. if (this.user.timeType.customDegreeMultiple) {
  6501. if (zhoD[j].multiDegrIdArray) {
  6502. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6503. } else {
  6504. formData.append('multiDegrId','[]')
  6505. }
  6506. } else {
  6507. if (zhoD[j].degreeId) {
  6508. formData.append('degreeId',zhoD[j].degreeId)
  6509. } else {
  6510. formData.append('degreeId','-1')
  6511. }
  6512. }
  6513. }else{
  6514. formData.append("degreeId", "-1");
  6515. }
  6516. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6517. formData.append('customData',zhoD[j].customData)
  6518. }else if(this.user.timeType.customDataActive){
  6519. formData.append('customData',0)
  6520. }
  6521. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6522. formData.append('customText',zhoD[j].customText)
  6523. }else if(this.user.timeType.customTextActive){
  6524. formData.append('customText','-')
  6525. }
  6526. }
  6527. }
  6528. }
  6529. } else {
  6530. for (var i in this.zhoData) {
  6531. var zhoD = this.zhoData[i]
  6532. var flgs = false
  6533. if(this.reportTimeType.type == 2) {
  6534. for(var k in this.selProjectList) {
  6535. var pItem = this.selProjectList[k];
  6536. var pName = pItem.projectName;
  6537. var j = pName;
  6538. console.log('j==周报中的项目='+j);
  6539. if(zhoD[j].time && zhoD[j].time != 'null') {
  6540. flgs = true
  6541. // formData.append("degreeId", "-1");
  6542. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6543. for(var s in this.projectList) {
  6544. if(j == this.projectList[s].projectName) {
  6545. formData.append("projectId", this.projectList[s].id);
  6546. }
  6547. }
  6548. if(this.user.timeType.reportAuditType == 3){
  6549. let audItem = {}
  6550. if(this.user.timeType.auditLevel > 0){
  6551. audItem.auditorFirst = zhoD[j].auditorFirst
  6552. }
  6553. if(this.user.timeType.auditLevel > 1){
  6554. audItem.auditorSec = zhoD[j].auditorSec
  6555. }
  6556. if(this.user.timeType.auditLevel > 2){
  6557. audItem.auditorThird = zhoD[j].auditorThird
  6558. }
  6559. if(zhoD[j].ccUserid){
  6560. audItem.ccUserid = zhoD[j].ccUserid
  6561. }
  6562. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6563. }
  6564. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6565. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6566. formData.append("reportTimeType", this.reportTimeType.type);
  6567. formData.append("endTime", zhoD[j].time[1]);
  6568. formData.append("startTime", zhoD[j].time[0]);
  6569. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6570. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6571. formData.append("isOvertime", 0)
  6572. formData.append("professionProgress", "[]")
  6573. if (zhoD[j].groupId) {
  6574. formData.append("groupId",zhoD[j].groupId)
  6575. } else {
  6576. //解决后台groupId数组越界的问题
  6577. formData.append("groupId",0)
  6578. }
  6579. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6580. formData.append("createDate",zhoD.zhoDataTime)
  6581. if (zhoD[j].projectAuditorId) {
  6582. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6583. }
  6584. if(zhoD[j].basecostId) {
  6585. formData.append("basecostId", zhoD[j].basecostId);
  6586. } else {
  6587. formData.append("basecostId", 0);
  6588. }
  6589. if(this.user.timeType.customDegreeActive){
  6590. if (this.user.timeType.customDegreeMultiple) {
  6591. if (zhoD[j].multiDegrIdArray) {
  6592. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6593. } else {
  6594. formData.append("multiDegrId", "[]");
  6595. }
  6596. } else {
  6597. if (zhoD[j].degreeId) {
  6598. formData.append('degreeId',zhoD[j].degreeId)
  6599. } else {
  6600. formData.append("degreeId", "-1");
  6601. }
  6602. }
  6603. }else{
  6604. formData.append("degreeId", "-1");
  6605. }
  6606. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6607. formData.append('customData',zhoD[j].customData)
  6608. }else if(this.user.timeType.customDataActive){
  6609. formData.append('customData',0)
  6610. }
  6611. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6612. formData.append('customText',zhoD[j].customText)
  6613. }else if(this.user.timeType.customTextActive){
  6614. formData.append('customText','-')
  6615. }
  6616. }
  6617. }
  6618. } else {
  6619. for(var k in this.selProjectList) {
  6620. var pItem = this.selProjectList[k];
  6621. var pName = pItem.projectName;
  6622. var j = pName;
  6623. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6624. flgs = true
  6625. // formData.append("degreeId", "-1");
  6626. console.log('进入了workFpppp==='+j);
  6627. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6628. for(var s in this.projectList) {
  6629. if(j == this.projectList[s].projectName) {
  6630. formData.append("projectId", this.projectList[s].id);
  6631. }
  6632. }
  6633. if(this.user.timeType.reportAuditType == 3){
  6634. let audItem = {}
  6635. if(this.user.timeType.auditLevel > 0){
  6636. audItem.auditorFirst = zhoD[j].auditorFirst
  6637. }
  6638. if(this.user.timeType.auditLevel > 1){
  6639. audItem.auditorSec = zhoD[j].auditorSec
  6640. }
  6641. if(this.user.timeType.auditLevel > 2){
  6642. audItem.auditorThird = zhoD[j].auditorThird
  6643. }
  6644. if(zhoD[j].ccUserid){
  6645. audItem.ccUserid = zhoD[j].ccUserid
  6646. }
  6647. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6648. }
  6649. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6650. // formData.append("subProjectId", zhoD[j].subProjectId);
  6651. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6652. formData.append("reportTimeType", this.reportTimeType.type);
  6653. if(this.reportTimeType.type == 1) {
  6654. formData.append("workingTime", zhoD[j].workingTime);
  6655. } else if(this.reportTimeType.type == 2) {
  6656. formData.append("endTime", zhoD[j].time[1]);
  6657. formData.append("startTime", zhoD[j].time[0]);
  6658. } else if(this.reportTimeType.type == 3) {
  6659. formData.append("progress", zhoD[j].progress);
  6660. formData.append("workingTime", zhoD[j].workingTime);
  6661. }
  6662. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6663. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6664. formData.append("isOvertime", 0)
  6665. formData.append("professionProgress", "[]")
  6666. if (zhoD[j].groupId) {
  6667. formData.append("groupId",zhoD[j].groupId)
  6668. } else {
  6669. //解决后台groupId数组越界的问题
  6670. formData.append("groupId",0)
  6671. }
  6672. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6673. formData.append("createDate",zhoD.zhoDataTime)
  6674. if (zhoD[j].projectAuditorId) {
  6675. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6676. }
  6677. if(zhoD[j].basecostId) {
  6678. formData.append("basecostId", zhoD[j].basecostId);
  6679. } else {
  6680. formData.append("basecostId", 0);
  6681. }
  6682. if(this.user.timeType.customDegreeActive){
  6683. if (this.user.timeType.customDegreeMultiple) {
  6684. if (zhoD[j].multiDegrIdArray) {
  6685. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6686. } else {
  6687. formData.append("multiDegrId", "[]");
  6688. }
  6689. } else {
  6690. if (zhoD[j].degreeId) {
  6691. formData.append('degreeId',zhoD[j].degreeId)
  6692. } else {
  6693. formData.append("degreeId", "-1");
  6694. }
  6695. }
  6696. }else{
  6697. formData.append("degreeId", "-1");
  6698. }
  6699. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6700. formData.append('customData',zhoD[j].customData)
  6701. }else if(this.user.timeType.customDataActive){
  6702. formData.append('customData',0)
  6703. }
  6704. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6705. formData.append('customText',zhoD[j].customText)
  6706. }else if(this.user.timeType.customTextActive){
  6707. formData.append('customText','-')
  6708. }
  6709. }
  6710. }
  6711. }
  6712. }
  6713. }
  6714. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6715. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6716. if(!next) {
  6717. this.$message({
  6718. message: `【${error.join('、')}】请填写任务分组`,
  6719. type: 'error'
  6720. })
  6721. return
  6722. }
  6723. // 自定义维度
  6724. this.submitingReport = true;
  6725. this.http.uploadFile( this.port.report.editPort, formData,
  6726. res => {
  6727. // this.listLoading = false;
  6728. this.submitingReport = false;
  6729. if (res.code == "ok") {
  6730. this.$message({
  6731. message: this.$t('message.fillinsuccessfully'),
  6732. type: "success"
  6733. });
  6734. this.fillWeekDialogVisi = false
  6735. this.selConShow = true
  6736. this.zhoData = []
  6737. this.weekDateRange = ''
  6738. this.getReportList();
  6739. this.getDepartment();
  6740. // 关闭弹窗 并 清空
  6741. this.selProjectList = []
  6742. this.selCon = []
  6743. this.getRecentlyProject()
  6744. } else {
  6745. this.$message({
  6746. message: res.msg,
  6747. type: "error"
  6748. });
  6749. }
  6750. },
  6751. error => {
  6752. this.submitingReport = false;
  6753. this.$message({
  6754. message: error,
  6755. type: "error"
  6756. });
  6757. });
  6758. },
  6759. handleGroupAuditorData(data) {
  6760. const { reportAuditType } = this.user.timeType
  6761. if(reportAuditType != 1 && reportAuditType != 2) {
  6762. return {next: true}
  6763. }
  6764. let arrList = [];
  6765. Object.entries(data).forEach(([key, obj]) => {
  6766. Object.entries(obj).forEach(([projectName, projectData]) => {
  6767. if (projectData.workingTime && !projectData.groupId) {
  6768. arrList.push({
  6769. projectName,
  6770. date: obj.zhoDataTime,
  6771. dateText: obj.zhoDataTimeTxt
  6772. });
  6773. }
  6774. });
  6775. });
  6776. if(arrList.length > 0) {
  6777. return {
  6778. next: false,
  6779. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6780. }
  6781. } else {
  6782. return {
  6783. next: true,
  6784. error: [],
  6785. }
  6786. }
  6787. },
  6788. ChangeHourMinutestr (str) {
  6789. if (str !== "0" && str !== "" && str !== null) {
  6790. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6791. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6792. } else {
  6793. return "";
  6794. }
  6795. },
  6796. // 得到两个日期中间的日期
  6797. getdiffdate(stime,etime){
  6798. //初始化日期列表,数组
  6799. var diffdate = new Array();
  6800. var i=0;
  6801. //开始日期小于等于结束日期,并循环
  6802. while(stime<=etime){
  6803. diffdate[i] = stime;
  6804. //获取开始日期时间戳
  6805. var stime_ts = new Date(stime).getTime();
  6806. //增加一天时间戳后的日期
  6807. var next_date = stime_ts + (24*60*60*1000);
  6808. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6809. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6810. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6811. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6812. stime = next_dates_y+next_dates_m+next_dates_d;
  6813. //增加数组key
  6814. i++;
  6815. }
  6816. return diffdate;
  6817. },
  6818. // 添加模块
  6819. addDomain(i) {
  6820. var leftProgress = 10;
  6821. if (this.reportTimeType.type == 3) {
  6822. //计算已经待分配工时比例
  6823. let array = this.workForm.domains;
  6824. let totalProgress = 0;
  6825. for (var i=0;i<array.length; i++) {
  6826. totalProgress += array[i].progress;
  6827. }
  6828. if (totalProgress < 100) {
  6829. leftProgress = 100 - totalProgress;
  6830. }
  6831. }
  6832. var addItem = {
  6833. projectId: "",
  6834. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6835. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6836. ),
  6837. content: "",
  6838. progress:leftProgress,
  6839. state:2,//2-表示待提交
  6840. multiWorktime: this.reportTimeType.multiWorktime,
  6841. worktimeList:[{}],
  6842. canEdit: true,
  6843. auditorFirst: '',
  6844. auditorSec: '',
  6845. auditorThird: '',
  6846. ccUserid: ''
  6847. // degreeId: '',
  6848. };
  6849. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6850. this.$set(addItem,'isOvertime',true)
  6851. if(this.reportTimeType.type == 3){
  6852. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6853. }
  6854. }
  6855. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6856. //默认给第一个,必填字段
  6857. addItem.basecostId = this.timeBasecostList[0].id;
  6858. }
  6859. this.workForm.domains.push(addItem);
  6860. document.getElementById('workFormsItemBottom').scrollIntoView()
  6861. this.canEdit = true
  6862. if (this.reportTimeType.type == 0) {
  6863. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6864. var length = this.workForm.domains.length;
  6865. if (length == 2) {
  6866. this.showAddMore = false;
  6867. }
  6868. }
  6869. this.chuji()
  6870. this.seleChn()
  6871. },
  6872. // 移除模块
  6873. delDomain(i) {
  6874. this.workForm.domains.splice(i,1)
  6875. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6876. if (!this.originCanEdit) {
  6877. let iscan = false
  6878. for(let i in this.workForm.domains){
  6879. if(this.workForm.domains[i].canEdit){
  6880. iscan = true
  6881. }
  6882. }
  6883. this.canEdit = iscan
  6884. }
  6885. //检测当前剩下的一个,时间类型是否是全天
  6886. if (this.reportTimeType.type == 0) {
  6887. if (this.workForm.domains[0].timeType == 0) {
  6888. this.showAddMore = false;
  6889. } else {
  6890. this.showAddMore = true;
  6891. }
  6892. }
  6893. if(this.user.timeType.multiWorktime == 1) {
  6894. this.iptChangs()
  6895. } else {
  6896. this.seleChn(0)
  6897. }
  6898. },
  6899. // 改变月份
  6900. changeMonth() {
  6901. this.isWeekend = false
  6902. let date = new Date()
  6903. let nowmon = date.getMonth() + 1
  6904. let nowday = date.getDate()
  6905. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6906. if (this.isBatch == 0) {
  6907. if(this.user.timeType.fillAhead == 0){
  6908. let date_a = new Date(this.workForm.createDate)
  6909. if(date_a.getTime() > date.getTime()){
  6910. this.workForm.createDate = nowdate
  6911. }
  6912. }
  6913. //只有按天填报才能获取当天的日报
  6914. if(!this.isSubstitude){
  6915. let weekday = new Date(this.workForm.createDate).getDay()
  6916. if(this.user.companyId == 817){
  6917. if(weekday == 0){
  6918. this.isWeekend = true
  6919. }
  6920. }else{
  6921. if(weekday == 0 || weekday == 6){
  6922. this.isWeekend = true
  6923. }
  6924. }
  6925. this.getReport()
  6926. }
  6927. }else {
  6928. if(this.user.timeType.fillAhead == 0){
  6929. let date_a = new Date(this.workForm.createDate[1])
  6930. if(date_a.getTime() > date.getTime()){
  6931. this.workForm.createDate[1] = nowdate
  6932. let sdate = new Date(this.workForm.createDate[0])
  6933. let edate = new Date(this.workForm.createDate[1])
  6934. if(sdate > edate){
  6935. this.workForm.createDate[0] = this.workForm.createDate[1]
  6936. }
  6937. }
  6938. }
  6939. }
  6940. },
  6941. // 判断时间段
  6942. fns() {
  6943. for (let k in this.dateAr) {
  6944. if (!this.judege(k)) {
  6945. return false
  6946. }
  6947. }
  6948. return true
  6949. },
  6950. judege(idx){
  6951. for (let k in this.dateAr) {
  6952. if (idx !== k) {
  6953. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6954. return false
  6955. }
  6956. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6957. return false
  6958. }
  6959. }
  6960. }
  6961. return true
  6962. },
  6963. getOverlapData(data) {
  6964. let overlapData = [];
  6965. for (let i = 0; i < data.length; i++) {
  6966. for (let j = i + 1; j < data.length; j++) {
  6967. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6968. overlapData.push(data[i], data[j]);
  6969. }
  6970. }
  6971. }
  6972. return overlapData;
  6973. },
  6974. // 保存日报111111
  6975. submitReport(isDraft) {
  6976. this.isDraft = isDraft;
  6977. this.$refs.workForm.validate(valid => {
  6978. if (valid) {
  6979. if(this.totalReportHours < this.user.timeType.allday){
  6980. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6981. confirmButtonText: '确定',
  6982. cancelButtonText: '取消',
  6983. type: 'warning'
  6984. }).then(() => {
  6985. this.submitReportSon()
  6986. }).catch(() => {
  6987. });
  6988. }else{
  6989. this.submitReportSon()
  6990. }
  6991. }
  6992. });
  6993. },
  6994. submitReportSon() {
  6995. this.dateAr = []
  6996. //检查重叠
  6997. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6998. let alp = []
  6999. if(this.user.timeType.multiWorktime != 1) {
  7000. for(var p in this.workForm.domains) {
  7001. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7002. let objs = {}
  7003. objs.s = this.workForm.domains[p].startTime
  7004. objs.e = this.workForm.domains[p].endTime
  7005. alp.push(objs)
  7006. }
  7007. }
  7008. this.dateAr = alp
  7009. if(this.dateAr.length > 0) {
  7010. let trus = this.fns()
  7011. if(!trus) {
  7012. this.$message({
  7013. message: this.$t('message.Filledtimeperiodsoverlap'),
  7014. type: "error"
  7015. });
  7016. return
  7017. }
  7018. }
  7019. } else {
  7020. for(var p in this.workForm.domains) {
  7021. var slll = this.workForm.domains[p]
  7022. for(var o in slll.worktimeList) {
  7023. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7024. let objs = {}
  7025. objs.s = slll.worktimeList[o].startTime
  7026. objs.e = slll.worktimeList[o].endTime
  7027. alp.push(objs)
  7028. }
  7029. }
  7030. }
  7031. this.dateAr = alp
  7032. if(this.dateAr.length > 0) {
  7033. let trus = this.fns()
  7034. if(!trus) {
  7035. this.$message({
  7036. message: this.$t('message.Filledtimeperiodsoverlap'),
  7037. type: "error"
  7038. });
  7039. return
  7040. }
  7041. }
  7042. }
  7043. }
  7044. //检查子项目
  7045. if (this.user.timeType.subProMustFill == 1) {
  7046. for(var p in this.workForm.domains) {
  7047. var oneProItem = this.workForm.domains[p]
  7048. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7049. //没有选择子项目
  7050. this.$message({
  7051. message: '子项目必填,请检查',
  7052. type: "error"
  7053. });
  7054. return
  7055. }
  7056. }
  7057. }
  7058. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7059. if (this.user.companyId == this.yuzhongCompId) {
  7060. for(var p in this.workForm.domains) {
  7061. var oneProItem = this.workForm.domains[p]
  7062. if (!oneProItem.extraField1) {
  7063. this.$message({
  7064. message: '角色必填,请检查',
  7065. type: "error"
  7066. });
  7067. return
  7068. }
  7069. if (!oneProItem.extraField2) {
  7070. this.$message({
  7071. message: '工作职责必填,请检查',
  7072. type: "error"
  7073. });
  7074. return
  7075. }
  7076. if (!oneProItem.extraField3) {
  7077. this.$message({
  7078. message: '工作内容必填,请检查',
  7079. type: "error"
  7080. });
  7081. return
  7082. }
  7083. }
  7084. }
  7085. // return
  7086. //代填的情况,检查人员是否已经选择
  7087. if (this.isSubstitude) {
  7088. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7089. this.$message({
  7090. message: this.$t('message.pleaseselectthepersontofillin'),
  7091. type: "error"
  7092. });
  7093. return;
  7094. }
  7095. }
  7096. //检查时间,全天和上下午不能同时存在
  7097. if (this.reportTimeType.type == 0) {
  7098. var alldayNum = 0;
  7099. var amNum = 0;
  7100. var pmNum = 0;
  7101. for(var i in this.workForm.domains) {
  7102. if (this.workForm.domains[i].timeType == 0) {
  7103. alldayNum ++;
  7104. } else if (this.workForm.domains[i].timeType == 1) {
  7105. amNum++;
  7106. } else if (this.workForm.domains[i].timeType == 2) {
  7107. pmNum++;
  7108. }
  7109. }
  7110. if (alldayNum > 1) {
  7111. this.$message({
  7112. // message: "工作时间-全天,只能选择一次",
  7113. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7114. type: "error"
  7115. });
  7116. return;
  7117. }
  7118. if (amNum > 1) {
  7119. this.$message({
  7120. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7121. type: "error"
  7122. });
  7123. return;
  7124. }
  7125. if (pmNum > 1) {
  7126. this.$message({
  7127. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7128. type: "error"
  7129. });
  7130. return;
  7131. }
  7132. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7133. this.$message({
  7134. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7135. type: "error"
  7136. });
  7137. return;
  7138. }
  7139. } else if (this.reportTimeType.type == 3) {
  7140. //总百分比不能超过100%
  7141. let total = 0;
  7142. this.workForm.domains.forEach(w=>{total += w.progress});
  7143. if (total > 100) {
  7144. this.$message({
  7145. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7146. type: "error"
  7147. });
  7148. return;
  7149. } else if (total < 100) {
  7150. this.$message({
  7151. message: this.$t('message.cannotbesubmitted'),
  7152. type: "error"
  7153. });
  7154. return;
  7155. }
  7156. }
  7157. this.listLoading = true;
  7158. let formData = new FormData();
  7159. formData.append("draft", this.isDraft);
  7160. var totalTime = 0;
  7161. for (var t=0;t<this.workForm.domains.length; t++) {
  7162. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7163. }
  7164. //批量填报不校验考勤时长,交给后台校验
  7165. if (!this.isBatch) {
  7166. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7167. if (this.workForm.time){
  7168. if (this.workForm.time.workHours == 0){
  7169. this.$message({
  7170. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7171. type: 'error'
  7172. })
  7173. return
  7174. }
  7175. }else{
  7176. this.$message({
  7177. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7178. type: 'error'
  7179. })
  7180. return
  7181. }
  7182. }
  7183. }
  7184. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7185. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7186. this.$message({
  7187. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7188. type: "error"
  7189. });
  7190. return;
  7191. }
  7192. }
  7193. for(var i in this.workForm.domains) {
  7194. // 检查任务/里程碑是否为必填
  7195. let taskRequired = this.user.timeType.taskRequired
  7196. if(taskRequired == 1) {
  7197. if(!this.workForm.domains[i].taskId) {
  7198. this.$message({
  7199. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7200. type: "error"
  7201. });
  7202. return
  7203. }
  7204. }
  7205. if(this.user.timeType.reportAuditType == 3){
  7206. let audItem = {}
  7207. let auditRule = ''
  7208. if(this.workForm.domains[i].id){
  7209. audItem.reportId = this.workForm.domains[i].id
  7210. }
  7211. if(this.user.timeType.auditLevel > 0){
  7212. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7213. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7214. }
  7215. if(this.user.timeType.auditLevel > 1){
  7216. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7217. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7218. }
  7219. if(this.user.timeType.auditLevel > 2){
  7220. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7221. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7222. }
  7223. if(this.workForm.domains[i].ccUserid){
  7224. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7225. }
  7226. if(auditRule){
  7227. auditRule = auditRule.substring(0,auditRule.length - 1)
  7228. this.$message({
  7229. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7230. type: 'error'
  7231. })
  7232. return
  7233. }
  7234. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7235. }
  7236. if (this.user.timeType.customDegreeActive) {
  7237. if (this.user.timeType.customDegreeMultiple) {
  7238. //多选
  7239. if (this.workForm.domains[i].multiDegrIdArray) {
  7240. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7241. degreeArray = degreeArray.replace(/,/g,"@");
  7242. formData.append("multiDegrId", degreeArray);
  7243. } else {
  7244. formData.append("multiDegrId", '[]');
  7245. }
  7246. } else {
  7247. //单选
  7248. if (this.workForm.domains[i].degreeId) {
  7249. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7250. } else {
  7251. formData.append("degreeId", -1);
  7252. }
  7253. }
  7254. } else {
  7255. formData.append("degreeId", -1);
  7256. }
  7257. if(this.workForm.domains[i].customData) {
  7258. // var sss = this.workForm.domains[i].degreeId.toString()
  7259. formData.append("customData", this.workForm.domains[i].customData);
  7260. } else {
  7261. formData.append("customData", 0);
  7262. }
  7263. if(this.workForm.domains[i].customText) {
  7264. formData.append("customText", this.workForm.domains[i].customText);
  7265. } else {
  7266. formData.append("customText", '-');
  7267. }
  7268. if (this.workForm.domains[i].id) {
  7269. formData.append("id", this.workForm.domains[i].id);
  7270. } else {
  7271. formData.append("id", -1);
  7272. }
  7273. formData.append("projectId", this.workForm.domains[i].projectId);
  7274. if (this.workForm.domains[i].subProjectId) {
  7275. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7276. } else {
  7277. formData.append("subProjectId", 0);
  7278. }
  7279. if (this.workForm.domains[i].groupId) {
  7280. formData.append("groupId", this.workForm.domains[i].groupId);
  7281. } else {
  7282. formData.append("groupId", 0);
  7283. }
  7284. if (this.workForm.domains[i].taskId) {
  7285. formData.append("taskId", this.workForm.domains[i].taskId);
  7286. } else {
  7287. formData.append("taskId", 0);
  7288. }
  7289. if (this.workForm.domains[i].taskFinish == true) {
  7290. formData.append("taskFinish", 1);
  7291. } else {
  7292. formData.append("taskFinish", 0);
  7293. }
  7294. formData.append("reportTimeType", this.reportTimeType.type);
  7295. if (this.reportTimeType.type == 0) {
  7296. formData.append("timeType", this.workForm.domains[i].timeType);
  7297. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7298. formData.append("workingTime", workingTime);
  7299. } else if (this.reportTimeType.type == 1){
  7300. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7301. } else if (this.reportTimeType.type == 2) {
  7302. formData.append("endTime", this.workForm.domains[i].endTime);
  7303. formData.append("startTime", this.workForm.domains[i].startTime);
  7304. } else if (this.reportTimeType.type == 3) {
  7305. //按比例分配
  7306. formData.append("progress", this.workForm.domains[i].progress);
  7307. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7308. }
  7309. if(this.user.timeType.choseFromAlbum == 1 ) {
  7310. console.log(this.workForm.domains[i].imgList)
  7311. if(this.workForm.domains[i].imgList) {
  7312. let imgListFor = this.workForm.domains[i].imgList
  7313. for(var b in imgListFor) {
  7314. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7315. }
  7316. console.log(imgListFor)
  7317. let m = JSON.stringify(imgListFor);
  7318. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7319. formData.append("picStr", m);
  7320. } else {
  7321. formData.append("picStr", '[]');
  7322. }
  7323. }
  7324. //处理多个时间事项
  7325. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7326. if (this.reportTimeType.multiWorktime == 1) {
  7327. //检查时间是否有重叠
  7328. var workList = this.workForm.domains[i].worktimeList;
  7329. for (var j=0;j<workList.length; j++) {
  7330. var curItem = workList[j];
  7331. //检查开始时间是否大于结束时间
  7332. if (curItem.startTime >= curItem.endTime) {
  7333. this.$message({
  7334. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7335. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7336. type: "error"
  7337. });
  7338. return;
  7339. }
  7340. //时间不可重叠
  7341. if (this.reportTimeType.timeCanOverlap == 0) {
  7342. for (var p = j+1;p<workList.length; p++) {
  7343. var jItem = workList[p];
  7344. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7345. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7346. this.$message({
  7347. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7348. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7349. type: "error"
  7350. });
  7351. return;
  7352. }
  7353. }
  7354. }
  7355. }
  7356. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7357. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7358. formData.append("content", m);
  7359. } else {
  7360. if (this.workForm.domains[i].content) {
  7361. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7362. m = m.replace(/,/g,",");
  7363. console.log(m, '需要传值的数据')
  7364. // formData.append("content", this.workForm.domains[i].content);
  7365. formData.append("content", m);
  7366. } else {
  7367. formData.append("content", '-');
  7368. }
  7369. }
  7370. if (this.isBatch == 0) {
  7371. formData.append("createDate", this.workForm.createDate);
  7372. } else {
  7373. //批量填报,时间范围
  7374. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7375. }
  7376. if(this.workForm.domains[i].isOvertime) {
  7377. formData.append("isOvertime", 1);
  7378. } else {
  7379. formData.append("isOvertime", 0);
  7380. }
  7381. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7382. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7383. } else {
  7384. formData.append("overtimeHours", 0);
  7385. }
  7386. if(this.workForm.domains[i].basecostId) {
  7387. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7388. } else {
  7389. formData.append("basecostId", 0);
  7390. }
  7391. if (this.workForm.userId != null) {
  7392. var targetUids = '';
  7393. this.workForm.userId.forEach(u=>{
  7394. targetUids += u + '@';
  7395. });
  7396. if (targetUids.length > 0) {
  7397. targetUids = targetUids.substring(0, targetUids.length -1);
  7398. formData.append("targetUids", targetUids);
  7399. }
  7400. }
  7401. //项目专业进度
  7402. if (this.workForm.domains[i].professionProgress) {
  7403. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7404. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7405. formData.append("professionProgress", m);
  7406. } else {
  7407. formData.append("professionProgress", "[]");
  7408. }
  7409. if (this.workForm.domains[i].stage) {
  7410. formData.append("stage", this.workForm.domains[i].stage);
  7411. } else {
  7412. formData.append("stage", "-");
  7413. }
  7414. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7415. if (this.workForm.domains[i].projectAuditorId) {
  7416. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7417. } else {
  7418. // console.log('执行到了这里')
  7419. // console.log(this.user.timeType.reportAuditType)
  7420. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7421. this.$message({
  7422. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7423. type: "error"
  7424. });
  7425. return;
  7426. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7427. //分组负责人先审核, 确定是选择了任务分组
  7428. if (this.workForm.domains[i].taskGroups.length == 0) {
  7429. this.$message({
  7430. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7431. type: "error"
  7432. });
  7433. } else if (!this.workForm.domains[i].groupId) {
  7434. // console.log(this.workForm.domains[i]);
  7435. this.$message({
  7436. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7437. type: "error"
  7438. });
  7439. } else {
  7440. this.$message({
  7441. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7442. type: "error"
  7443. });
  7444. }
  7445. return;
  7446. }
  7447. }
  7448. if (this.user.companyId == this.yuzhongCompId) {
  7449. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7450. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7451. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7452. }
  7453. //依斯贝的服务Id
  7454. if (this.user.companyId == this.yisibeiCompId) {
  7455. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7456. }
  7457. if(this.user.timeType.taskGroupRequired == 1 && this.workForm.domains[i].groupId) {
  7458. this.$message({
  7459. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7460. type: "error"
  7461. });
  7462. }
  7463. }
  7464. this.submitingReport = true;
  7465. this.http.uploadFile( this.port.report.editPort, formData,
  7466. res => {
  7467. this.listLoading = false;
  7468. this.submitingReport = false;
  7469. if (res.code == "ok") {
  7470. if(res.msg!=null){
  7471. this.$message({
  7472. dangerouslyUseHTMLString: true,
  7473. message: res.msg,
  7474. type: "warning",
  7475. showClose: true,
  7476. duration: 0
  7477. });
  7478. }else{
  7479. this.$message({
  7480. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7481. type: "success"
  7482. });
  7483. }
  7484. this.dialogVisible = false;
  7485. this.jsDay = 0
  7486. this.jsTime = 0
  7487. this.getReportList();
  7488. this.getDepartment();
  7489. this.getRecentlyProject()
  7490. } else {
  7491. this.$message({
  7492. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7493. type: "error"
  7494. });
  7495. }
  7496. },
  7497. error => {
  7498. this.listLoading = false;
  7499. this.submitingReport = false;
  7500. this.$message({
  7501. message: error,
  7502. type: "error"
  7503. });
  7504. });
  7505. },
  7506. // 判断是展示那个工时导入
  7507. imports() {
  7508. if(this.user.timeType.syncCorpwxTime == 0) {
  7509. this.importDialog = true
  7510. } else {
  7511. this.importWxDialog = true
  7512. }
  7513. },
  7514. // 跳转
  7515. junpToDeskTop(id) {
  7516. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7517. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7518. },
  7519. // 通过日报
  7520. approve(id, item) {
  7521. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7522. this.approveinData = {
  7523. id: id,
  7524. date: this.date +day,
  7525. reportIds: item.id
  7526. }
  7527. if(this.user.timeType.needEvaluate == 1){
  7528. this.$set(this.approveinData,'evaluate','')
  7529. this.approveinDialog = true
  7530. }else{
  7531. this.logining = true;
  7532. this.approveinfun()
  7533. }
  7534. },
  7535. approveinfun(){
  7536. this.http.post( this.port.report.approve, this.approveinData,
  7537. res => {
  7538. this.logining = false;
  7539. if (res.code == "ok") {
  7540. this.approveinDialog = false
  7541. this.$message({
  7542. message: this.$t('message.Reviewsucceeded'),
  7543. type: "success"
  7544. });
  7545. this.refreshReportData(this.approveinData.reportIds);
  7546. this.getDepartment();
  7547. } else {
  7548. this.$message({
  7549. message: res.msg,
  7550. type: "error"
  7551. });
  7552. }
  7553. },
  7554. error => {
  7555. this.logining = false;
  7556. this.$message({
  7557. message: error,
  7558. type: "error"
  7559. });
  7560. });
  7561. },
  7562. //撤回日报
  7563. cancel(item,e) {
  7564. // console.log('can can need',item);
  7565. this.logining = true;
  7566. var ids = '';
  7567. var data = e ? item : item.data;
  7568. data.forEach(element => {
  7569. if(element.id){
  7570. ids +=(element.id+',');
  7571. }
  7572. });
  7573. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7574. res => {
  7575. this.logining = false;
  7576. if (res.code == "ok") {
  7577. this.$message({
  7578. message:this.$t('message.Withdrawalsucceeded'),
  7579. type: "success"
  7580. });
  7581. this.getReportList();
  7582. if(e){this.getReport()}
  7583. this.getDepartment();
  7584. } else {
  7585. this.$message({
  7586. message: res.msg,
  7587. type: "error"
  7588. });
  7589. }
  7590. },
  7591. error => {
  7592. this.logining = false;
  7593. this.$message({
  7594. message: error,
  7595. type: "error"
  7596. });
  7597. });
  7598. },
  7599. showDenyDialog(id,i, item) {
  7600. this.denyReasonDialog = true;
  7601. this.isDenying = false;
  7602. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7603. var ids = item.id;
  7604. // var data = item.data;
  7605. // data.forEach(element => {
  7606. // ids +=(element.id+',');
  7607. // });
  7608. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7609. },
  7610. // 未通过日报
  7611. deny() {
  7612. this.logining = true;
  7613. this.isDenying = true;
  7614. this.http.post( this.port.report.deny, this.denyForm,
  7615. res => {
  7616. this.logining = false;
  7617. this.isDenying = false;
  7618. if (res.code == "ok") {
  7619. this.$message({
  7620. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7621. type: "success"
  7622. });
  7623. this.refreshReportData(this.denyForm.reportIds);
  7624. this.getDepartment();
  7625. this.denyReasonDialog = false;
  7626. } else {
  7627. this.$message({
  7628. message: res.msg,
  7629. type: "error"
  7630. });
  7631. }
  7632. },
  7633. error => {
  7634. this.logining = false;
  7635. this.$message({
  7636. message: error,
  7637. type: "error"
  7638. });
  7639. });
  7640. },
  7641. // 查看工时记录弹窗
  7642. toView() {
  7643. this.toViewDialogVisible = true
  7644. this.toViewloading = true
  7645. this.getToView()
  7646. },
  7647. getToView() {
  7648. this.http.post( '/report-import-log/getList', this.toViewForm,
  7649. res => {
  7650. this.toViewloading = false;
  7651. if (res.code == "ok") {
  7652. // console.log(res.data, '数据数据')
  7653. this.toViewList = res.data.records
  7654. this.toViewForm.total = res.data.total
  7655. } else {
  7656. this.toViewloading = false;
  7657. this.$message({
  7658. message: res.msg,
  7659. type: "error"
  7660. });
  7661. }
  7662. })
  7663. },
  7664. // 触发 selectCat 组件更改他的值
  7665. selectCatCli(obj) {
  7666. // console.log(obj, '看看')
  7667. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7668. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7669. },
  7670. vueCasader(obj) {
  7671. console.log(obj, '看看值')
  7672. if(obj.distinction == 1 && obj.item) {
  7673. let arr = []
  7674. arr.push(obj.item.value)
  7675. this.exportParam.departmentId = arr
  7676. }
  7677. },
  7678. //分页
  7679. handleCurrentChange(val) {
  7680. this.toViewForm.pageIndex = val;
  7681. this.getToView();
  7682. },
  7683. handleSizeChange(val) {
  7684. this.toViewForm.pageSize = val;
  7685. this.getToView();
  7686. },
  7687. getAllUsersList(){
  7688. this.http.post('/user/getSimpleActiveUserList',{
  7689. },res => {
  7690. if(res.code == 'ok'){
  7691. this.allUsersList = res.data
  7692. }else{
  7693. this.$message({
  7694. message: res.msg,
  7695. type: 'error'
  7696. })
  7697. }
  7698. },err => {
  7699. this.$message({
  7700. message: err,
  7701. type: 'error'
  7702. })
  7703. })
  7704. },
  7705. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7706. fillWeekCustomClne() {
  7707. this.fillWeekDialogVisiCustom = false
  7708. },
  7709. fillWeekCustomSubmit() {
  7710. this.getReportList();
  7711. this.getDepartment();
  7712. this.getRecentlyProject()
  7713. },
  7714. // 待填日报姓名搜索
  7715. nameAearchSeek(flg) {
  7716. if(!this.nameAearch) {
  7717. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7718. return
  7719. }
  7720. if(flg) {
  7721. this.enterpriseWechatgetUser()
  7722. }
  7723. },
  7724. handleThreeData(userList) {
  7725. console.log(userList, '人员数据')
  7726. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7727. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7728. },
  7729. // 过滤树节点
  7730. filterTreeNodes(treeData, filterKeywords) {
  7731. return treeData.filter((node) => {
  7732. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7733. if (node.children && node.children.length > 0) {
  7734. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7735. }
  7736. return true;
  7737. }
  7738. if (node.children && node.children.length > 0) {
  7739. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7740. return node.children.length > 0;
  7741. }
  7742. return false;
  7743. });
  7744. },
  7745. // 企业微信获取人员
  7746. enterpriseWechatgetUser() {
  7747. this.deptMembDataLoading = true
  7748. this.http.post('/user/getEmployeeList',{
  7749. departmentId: -1,
  7750. pageIndex: 1,
  7751. pageSize: 100,
  7752. keyword: this.nameAearch,
  7753. status: '',
  7754. roleId: '',
  7755. cursor: '',
  7756. onlyDirect: '',
  7757. matchingType: ''
  7758. },res => {
  7759. if(res.code == 'ok'){
  7760. this.deptMembDataLoading = false
  7761. const userListName = res.data.records.map(item => item.name)
  7762. this.handleThreeData(userListName)
  7763. }else{
  7764. this.deptMembDataLoading = false
  7765. this.$message({
  7766. message: res.msg,
  7767. type: 'error'
  7768. })
  7769. }
  7770. },err => {
  7771. this.deptMembDataLoading = false
  7772. this.$message({
  7773. message: err,
  7774. type: 'error'
  7775. })
  7776. })
  7777. },
  7778. // 按周填报获取相关任务
  7779. async getWeeklyTaskList(item) {
  7780. console.log(item, '<=== 数据')
  7781. const { projectId, groupId, stage, taskId } = item
  7782. console.log(projectId, groupId, stage)
  7783. let parms = { projectId, isSubstitude: 0 }
  7784. groupId ? parms.groupId = groupId : ''
  7785. stage ? parms.stage = stage : ''
  7786. const { data } = await this.postData('/task/getRecentTask', parms)
  7787. this.zhoBao.taskId = taskId
  7788. this.$set(this.zhoBao, 'taskList', data)
  7789. console.log(this.zhoBao)
  7790. },
  7791. // 封装 post 请求
  7792. postData(url, params) {
  7793. return new Promise((resolve, reject) => {
  7794. this.http.post(url, { ...params },
  7795. res => {
  7796. resolve(res)
  7797. },
  7798. error => {
  7799. this.$message({
  7800. message: error,
  7801. type: "error"
  7802. });
  7803. reject(error)
  7804. })
  7805. })
  7806. },
  7807. // 自定义事件
  7808. selectCal(obj) {
  7809. console.log(obj, '传数据来源')
  7810. if(obj.distinction == '1') {
  7811. this.zhoBao.projectAuditorId = obj.id
  7812. } else if(obj.distinction == '2') {
  7813. this.zhoBao.auditorFirst = obj.id
  7814. } else if(obj.distinction == '3') {
  7815. this.zhoBao.auditorSec = obj.id
  7816. } else if(obj.distinction == '4') {
  7817. this.zhoBao.auditorThird = obj.id
  7818. } else if(obj.distinction == '5') {
  7819. this.zhoBao.ccUserid = obj.id
  7820. } else if(obj.distinction == '12') {
  7821. this.usersListId = obj.id
  7822. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7823. this.searchKeyword = obj.name
  7824. } else {
  7825. this.searchKeyword = ''
  7826. }
  7827. this.searchScreen(0)
  7828. } else if(obj.distinction == '13') {
  7829. this.usersListId = obj.id
  7830. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7831. this.searchKeyword = obj.name
  7832. } else {
  7833. this.searchKeyword = ''
  7834. }
  7835. this.searchScreen(1)
  7836. }
  7837. }
  7838. },
  7839. created() {
  7840. this.getUsers()
  7841. let height = window.innerHeight;
  7842. this.tableHeight = height - 178;
  7843. const that = this;
  7844. window.onresize = function temp() {
  7845. that.tableHeight = window.innerHeight - 178;
  7846. };
  7847. this.toViewForm.companyId = this.user.companyId
  7848. this.initDrag([{
  7849. type: "LR",
  7850. domClass: {
  7851. // 中间分割线的名字
  7852. resize: "line-line",
  7853. // 左侧盒子的名字
  7854. left: "box-left",
  7855. // 右侧盒子的名字
  7856. right: "box-right",
  7857. // 父级的名字
  7858. box: "box-father",
  7859. },
  7860. otherInfo: {
  7861. // 限制左边栏最低宽度
  7862. leftWidth: 120,
  7863. },
  7864. },
  7865. {
  7866. type: "LR",
  7867. domClass: {
  7868. // 中间分割线的名字
  7869. resize: "line-second",
  7870. // 左侧盒子的名字
  7871. left: "left-laowang",
  7872. // 右侧盒子的名字
  7873. right: "box-second-father",
  7874. // 父级的名字
  7875. box: "grand",
  7876. },
  7877. otherInfo: {
  7878. // 限制左边栏最低宽度
  7879. leftWidth: 120,
  7880. },
  7881. },
  7882. ]);
  7883. }
  7884. };
  7885. </script>
  7886. <style lang="scss" scoped>
  7887. .fillWeekDialogVisiCustom {
  7888. width: 100%;
  7889. height: 70vh;
  7890. }
  7891. .fillWeekCustom {
  7892. .el-dialog__body {
  7893. padding: 20px 20px !important;
  7894. }
  7895. }
  7896. .photos {
  7897. position: relative;
  7898. display: flex;
  7899. flex-wrap: wrap;
  7900. }
  7901. .photos_img {
  7902. width: 120px;
  7903. height: 120px;
  7904. margin-right: 20px;
  7905. margin-bottom: 20px;
  7906. cursor: pointer;
  7907. img {
  7908. width: 100%;
  7909. height: 100%;
  7910. }
  7911. }
  7912. .paginatis {
  7913. padding: 10px 10px;
  7914. background: #f2f2f2;
  7915. }
  7916. .waiting {
  7917. color:orange;
  7918. }
  7919. .filledReportStyle {
  7920. color:#32CD32;
  7921. }
  7922. .RejectStyle {
  7923. color:red;
  7924. }
  7925. .waitSubmitStyle{
  7926. color: #409eff;
  7927. }
  7928. .chooseDate {
  7929. .waiting {
  7930. color: #20a0ff;
  7931. }
  7932. .filledReportStyle {
  7933. color:#20a0ff;
  7934. }
  7935. .RejectStyle {
  7936. color: #20a0ff;
  7937. }
  7938. .waitSubmitStyle{
  7939. color: #20a0ff;
  7940. }
  7941. }
  7942. .allDaily {
  7943. width:100%;
  7944. }
  7945. .report_title {
  7946. padding:10px 0;
  7947. color:#666;
  7948. }
  7949. .clearfix {
  7950. overflow-x: auto;
  7951. white-space: nowrap;
  7952. padding: 15px 0 10px 0;
  7953. // overflow-y: hidden;
  7954. .date_item {
  7955. padding: 0 3px;
  7956. cursor: pointer;
  7957. position: relative;
  7958. }
  7959. .chooseDate {
  7960. position: absolute;
  7961. bottom: -3px;
  7962. width: 37px;
  7963. height: 2px;
  7964. left: 14px;
  7965. background: #20a0ff;
  7966. }
  7967. }
  7968. .one_daily {
  7969. i {
  7970. color: #9ed0ff;
  7971. margin-right: 5px;
  7972. }
  7973. .one_daily_body {
  7974. padding: 10px 0px;
  7975. p {
  7976. margin: 0;
  7977. line-height: 30px;
  7978. }
  7979. }
  7980. ul {
  7981. padding: 0;
  7982. }
  7983. }
  7984. .checkbtn {
  7985. float: right;
  7986. margin-top: -10px;
  7987. }
  7988. .selConStyle{
  7989. margin-top:9rem;
  7990. margin-bottom:11rem;
  7991. .selConStyle_title{
  7992. height: 3rem;
  7993. text-align: center;
  7994. font-size: 17px;
  7995. }
  7996. .el-select{
  7997. margin: 0 15%;
  7998. width: 70%;
  7999. }
  8000. }
  8001. </style>
  8002. <style lang="scss">
  8003. /*去除upload组件过渡效果*/
  8004. .photos .el-upload-list__item {
  8005. transition: none !important;
  8006. }
  8007. .daily {
  8008. .el-card__body {
  8009. height: 80%;
  8010. overflow-y: auto;
  8011. }
  8012. .el-card__header {
  8013. padding: 0 20px;
  8014. }
  8015. }
  8016. .membListClass{
  8017. .el-dialog__body{
  8018. padding-top: 10px;
  8019. }
  8020. }
  8021. // .editReportDialog .el-dialog__footer{
  8022. // position: sticky;
  8023. // bottom: 0;
  8024. // background: #fff;
  8025. // height: 70px;
  8026. // z-index: 1010;
  8027. // }
  8028. .editReportDialog{
  8029. min-width: 800px;
  8030. }
  8031. .touruxiangmu{
  8032. max-width: 1000px;
  8033. }
  8034. </style>
  8035. <style scoped>
  8036. /* 项目标签的样式 */
  8037. .el-tag + .el-tag {
  8038. margin-left: 10px;
  8039. }
  8040. .button-new-tag {
  8041. margin-left: 10px;
  8042. height: 32px;
  8043. line-height: 30px;
  8044. padding-top: 0;
  8045. padding-bottom: 0;
  8046. }
  8047. .input-new-tag {
  8048. width: 90px;
  8049. margin-left: 10px;
  8050. vertical-align: bottom;
  8051. }
  8052. .selectworktime .el-table__fixed-body-wrapper{
  8053. top: 48px !important;
  8054. }
  8055. .selectworktime_export .selectworktime_export_l{
  8056. width: 650px;
  8057. float: left;
  8058. height: 42px;
  8059. }
  8060. .approvalProcessBox{
  8061. margin-left: 30px;
  8062. font-size: 14px;
  8063. line-height: 16px;
  8064. cursor: pointer;
  8065. }
  8066. .approvalProcessBox i {
  8067. margin-right: 0;
  8068. height: 16px;
  8069. width: 16px;
  8070. display: inline-block;
  8071. transform: scale(1.2);
  8072. position: relative;
  8073. top: 0.5px;
  8074. color: #409eff;
  8075. }
  8076. .approvalProcessBox .approvalProcessClick{
  8077. cursor: pointer;
  8078. color: #409eff;
  8079. font-size: 14px;
  8080. }
  8081. .approvalProcessBox:hover .approvalProcessClick{
  8082. color: #3485fb;
  8083. }
  8084. </style>
  8085. <style lang="scss" scoped>
  8086. // 加班样式
  8087. .overtime {
  8088. display: inline-block;
  8089. margin-left: 20px;
  8090. input {
  8091. display: inline-block;
  8092. margin-top: 5px;
  8093. }
  8094. }
  8095. .plus {
  8096. display: inline-block;
  8097. }
  8098. // .tages {
  8099. // float: right;
  8100. // }
  8101. .overtime {
  8102. display: inline-block;
  8103. margin-left: 30px;
  8104. }
  8105. .bloks {
  8106. display: inline-block;
  8107. width: 380px;
  8108. }
  8109. .zhiss {
  8110. display: flex;
  8111. justify-content: space-around;
  8112. align-items: center;
  8113. }
  8114. .zhoFel {
  8115. display: flex;
  8116. justify-content: space-between;
  8117. align-items: center;
  8118. }
  8119. // 左右滑动样式
  8120. .line {
  8121. width: 30px;
  8122. /* height: 500px; */
  8123. background: #f2f2f2;
  8124. cursor: w-resize;
  8125. }
  8126. .box-father {
  8127. border: 8px solid #000;
  8128. }
  8129. .line-second {
  8130. width: 10px;
  8131. /* background: red; */
  8132. }
  8133. .flex {
  8134. display: flex;
  8135. width: 100%;
  8136. }
  8137. .box-left {
  8138. flex: 0 0 400px;
  8139. /* height: 600px; */
  8140. /* background: blue; */
  8141. }
  8142. .box-right {
  8143. /* height: 600px; */
  8144. /* background: green; */
  8145. flex: 1;
  8146. }
  8147. .box-postion {
  8148. width: 200px;
  8149. /* height: 400px; */
  8150. background: #ccc;
  8151. }
  8152. .custom-tree-node {
  8153. flex: 1;
  8154. display: flex;
  8155. align-items: center;
  8156. justify-content: space-between;
  8157. font-size: 14px;
  8158. padding-right: 8px;
  8159. }
  8160. .daitianrbao {
  8161. width: 100%;
  8162. box-sizing: border-box;
  8163. height: 40px;
  8164. border-radius: 4px;
  8165. border: 1px solid #DCDFE6;
  8166. overflow: hidden;
  8167. text-overflow: ellipsis;
  8168. display: flex;
  8169. // align-items: center;
  8170. }
  8171. .daitianrbao .spnn {
  8172. display: inline-block;
  8173. box-sizing: border-box;
  8174. padding: 0 15px;
  8175. overflow: hidden;
  8176. text-overflow: ellipsis;
  8177. }
  8178. .daitianrbao .hover {
  8179. color: #DCDFE6 !important;
  8180. }
  8181. </style>