daily.vue 499 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <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>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <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>
  178. <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>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1" style="margin-left:20px;">
  182. <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. <p v-if="item1.attachment != null" >附件
  184. <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
  185. </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <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> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <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>
  257. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <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"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <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"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <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>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <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>
  275. </p>
  276. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  277. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  278. <!-- 自定义日报文本 -->
  279. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  280. <p v-if="user.company.packageEngineering == 1">
  281. {{$t('other.professionalProgress')}}:
  282. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  283. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  284. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  285. </el-tooltip>
  286. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  287. <i class="iconfont firerock-iconshenhetongguo"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhebohui"></i>
  291. </el-tooltip>
  292. </span>
  293. </p>
  294. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  295. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  296. </p>
  297. <div v-if="item2.multiWorktime==0">
  298. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  299. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  300. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  301. {{item2.time.toFixed(1)}}h
  302. <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>
  303. </p>
  304. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  305. <span style="margin-right:10px;">{{item2.progress}}%</span>
  306. </p>
  307. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  308. </div>
  309. <div v-if="item2.multiWorktime==1" >
  310. <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>
  311. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  312. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  313. <p style="display: inline-block;">{{$t('time.duration')}}:
  314. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  315. {{timeItem.time.toFixed(1)}}h
  316. </p>
  317. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  318. </div>
  319. </div>
  320. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  321. <!--照片的显示 -->
  322. <p v-if="item2.pics != null && item2.pics.length > 0">
  323. <el-image v-for="(pic, index) in item2.pics" :key="index"
  324. style="width: 100px; height: 100px; margin-right:10px;"
  325. :src="pic"
  326. :preview-src-list="item2.pics">
  327. </el-image>
  328. </p>
  329. </el-card>
  330. </el-timeline-item>
  331. </el-timeline>
  332. </div>
  333. </div>
  334. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  335. <!-- 简陋的无报告提示 -->
  336. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. </el-card>
  343. </div>
  344. <!-- 工时推送日志弹窗 -->
  345. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  346. <template>
  347. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  348. </template>
  349. <template>
  350. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  351. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  352. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  353. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  354. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  355. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  356. <template slot-scope="scope">
  357. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  358. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  359. </template>
  360. </el-table-column>
  361. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  362. </el-table>
  363. </template>
  364. <span slot="footer" class="dialog-footer">
  365. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  366. </span>
  367. </el-dialog>
  368. <!-- 填写日报的dialog -->
  369. <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  370. <div style="height: 65vh;overflow: auto;">
  371. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  372. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  373. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  374. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  375. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  376. <span class="spnn" v-if="workForm.userNames">
  377. <span v-for="(item, index) in workForm.userNames" :key="index">
  378. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  379. <span v-if="index < workForm.userNames.length - 1">,</span>
  380. </span>
  381. </span>
  382. <span class="spnn hover" v-else>
  383. {{$t('defaultText.pleaseSelectAsubstitute')}}
  384. </span>
  385. </div>
  386. </el-form-item>
  387. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  388. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  389. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  390. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  391. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  392. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  393. <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>
  394. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  395. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  396. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  397. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  398. <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>
  399. <!-- AI智能填报 -->
  400. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  401. </el-form-item>
  402. <!--考勤时长显示-->
  403. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  404. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  405. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  406. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  407. </span>
  408. <!--批量填报不显示考勤记录-->
  409. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  410. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  411. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  414. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  415. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  416. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  417. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  418. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  419. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  420. @click="refreshAttendance(workForm.createDate)"></el-button>
  421. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  422. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  423. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  424. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  425. </el-form-item>
  426. <!-- 000000 -->
  427. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  428. <div v-if="reportTimeType.multiWorktime==0">
  429. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  430. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  431. <el-select v-model="domain.timeType" style="width:200px;"
  432. v-if="reportTimeType.type == 0"
  433. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  434. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  435. @change="onTimeTypeChange(domain.timeType)">
  436. <el-option
  437. v-for="item in timeType"
  438. :key="item.value"
  439. :label="item.label"
  440. :value="item.value">
  441. </el-option>
  442. </el-select>
  443. <!-- 数字时长选择 -->
  444. <el-select v-model="domain.workingTime" style="width:200px;"
  445. v-if="reportTimeType.type == 1"
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  448. @change="seleChn(0,domain)">
  449. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  450. </el-select>
  451. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  452. <span v-if="reportTimeType.type == 2">
  453. <!--时间范围选择 -->
  454. <el-time-picker
  455. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  456. v-model="domain.startTime"
  457. :placeholder="$t('time.startTime')"
  458. style="width:120px;"
  459. format="HH:mm"
  460. value-format="HH:mm"
  461. :picker-options="{
  462. start: '08:00',
  463. end: '23:30'
  464. }"
  465. @change="iptChang()">
  466. </el-time-picker> - <el-time-picker
  467. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  468. v-model="domain.endTime"
  469. :placeholder="$t('time.endTime')"
  470. style="width:120px;"
  471. format="HH:mm"
  472. value-format="HH:mm"
  473. :picker-options="{
  474. start: '08:00',
  475. end: '23:30',
  476. minTime: domain.startTime
  477. }"
  478. @change="iptChang()">
  479. </el-time-picker>
  480. </span>
  481. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  482. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  483. <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>
  484. </div>
  485. </el-form-item>
  486. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  487. :prop="'domains.' + index + '.reportTargetDeptId'"
  488. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  489. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  490. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  491. <span style="float: left">
  492. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  493. </span>
  494. </el-option>
  495. </el-select>
  496. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  497. </el-form-item>
  498. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  499. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  500. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  501. @change="selectProject(domain, index)"
  502. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  503. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  504. <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">
  505. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  506. <span style="float: right;">{{ item.projectName }}</span>
  507. </el-option>
  508. </el-option-group>
  509. </el-select>
  510. <!--昱众不显示子项目-->
  511. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  512. <span style="margin-left:45px;">
  513. {{$t('lable.subproject')}}</span>
  514. <!--子项目 -->
  515. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  516. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  517. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  518. </el-select>
  519. </template>
  520. <template v-if="user.companyId == yuzhongCompId">
  521. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  522. <!--角色选择 -->
  523. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  524. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  525. <el-option
  526. v-for="item in roleList"
  527. :key="item.value"
  528. :label="item.label"
  529. :value="item.value">
  530. </el-option>
  531. </el-select>
  532. </template>
  533. <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%;"
  534. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  535. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  536. </el-link>
  537. <!-- <el-link type="primary" v-if="canEdit"
  538. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  539. </el-form-item>
  540. <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">
  541. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  542. </el-form-item>
  543. <!--如果设置了工时成本预警的预算成本项-->
  544. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  545. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  546. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  547. </el-select>
  548. </el-form-item>
  549. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  550. <template slot="label">
  551. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  552. <span >{{$t('lable.taskGrouping')}}</span>
  553. </template>
  554. <!-- 任务分组 -->
  555. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  556. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  557. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  558. </el-select>
  559. <template v-if="user.companyId == yuzhongCompId">
  560. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  561. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  562. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  563. <el-option
  564. v-for="item in domain.filteredRespList"
  565. :key="item.id"
  566. :label="item.jobRespon"
  567. :value="item.id">
  568. </el-option>
  569. </el-select>
  570. </template>
  571. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  572. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  573. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  574. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  575. @change="changeStages(domain, index)"
  576. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  577. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  578. </el-select>
  579. </template>
  580. </el-form-item>
  581. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
  582. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  583. <template slot="label">
  584. <span style="color:#FF0000;">*</span>
  585. <span >{{$t('other.projectAuditor')}}</span>
  586. </template>
  587. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  588. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  589. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  590. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  591. </el-option>
  592. </el-select>
  593. <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>
  594. </el-form-item>
  595. </div>
  596. <el-form-item v-if="user.companyId == yuzhongCompId">
  597. <template slot="label">
  598. <span style="color:#FF0000;">*</span>
  599. <span >{{ $t('gongZuoNeiRong') }}</span>
  600. </template>
  601. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  602. :disabled="(workForm.domains[index].state>=2?false:true)" >
  603. <el-option
  604. v-for="item in domain.workContentList"
  605. :key="item.id"
  606. :label="item.workContext"
  607. :value="item.id">
  608. </el-option>
  609. </el-select>
  610. </el-form-item>
  611. <!-- 111111 -->
  612. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  613. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  614. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  615. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  616. <span v-else>{{item.name}}</span>
  617. </el-option>
  618. </el-select>
  619. <template v-if="user.timeType.auditLevel > 1">
  620. <i class="el-icon-right"></i>
  621. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  622. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  623. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  624. <span v-else>{{item.name}}</span>
  625. </el-option>
  626. </el-select>
  627. </template>
  628. <template v-if="user.timeType.auditLevel > 2">
  629. <i class="el-icon-right"></i>
  630. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  631. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  632. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  633. <span v-else>{{item.name}}</span>
  634. </el-option>
  635. </el-select>
  636. </template>
  637. </el-form-item>
  638. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  639. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  640. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  641. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  642. <span v-else>{{item.name}}</span>
  643. </el-option>
  644. </el-select>
  645. </el-form-item>
  646. <!-- 相关维度/自定义维度 -->
  647. <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'">
  648. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  649. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  650. </el-option>
  651. </el-select>
  652. </el-form-item>
  653. <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'">
  654. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  655. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  656. </el-option>
  657. </el-select>
  658. </el-form-item>
  659. <!-- 相关数值 -->
  660. <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">
  661. <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>
  662. </el-form-item>
  663. <!-- 自定义文本 -->
  664. <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">
  665. <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>
  666. </el-form-item>
  667. <!--按比例填报-->
  668. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  669. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  670. <div style="width:400px;">
  671. <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>
  672. <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>
  673. </div>
  674. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  675. <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>
  676. </div>
  677. </el-form-item>
  678. <!--工程专业版本模式下, 各个专业的进度填报 -->
  679. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  680. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  681. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  682. <el-input size="mini" style="width:60px;" v-model="item.progress"
  683. @keyup.native="onProgressChange"
  684. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  685. </span>
  686. </el-form-item>
  687. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  688. <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))" >
  689. <template slot="label" v-if="user.timeType.taskRequired == 1">
  690. <span style="color:#FF0000;">*</span>
  691. <span >{{ $t('other.task') }}</span>
  692. </template>
  693. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  694. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  695. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  696. </el-select>
  697. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  698. </el-form-item>
  699. <!--针对依斯贝的SAP服务-->
  700. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  701. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  702. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  703. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  704. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  705. </el-select>
  706. </el-form-item>
  707. <!--工作事项-->
  708. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  709. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  710. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  711. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  712. </el-form-item>
  713. <!-- 拍照上传 -->
  714. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  715. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  716. <div class="photos">
  717. <div>
  718. <el-upload
  719. list-type="picture-card"
  720. :http-request="(file) => {return addImg(file, index)}"
  721. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  722. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  723. :file-list="domain.imgListUrl" :limit="9"
  724. :disabled="workForm.domains[index].state>=2?false:true">
  725. <i class="el-icon-plus"></i>
  726. </el-upload>
  727. </div>
  728. </div>
  729. </el-form-item>
  730. </div>
  731. <!--多个工作事项填报的情况 -->
  732. <div v-if="reportTimeType.multiWorktime==1">
  733. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  734. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  735. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  736. @change="selectProject(domain, index)"
  737. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  738. <!-- <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">
  739. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  740. <span style="float: right;">{{ item.projectName }}</span>
  741. </el-option> -->
  742. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  743. <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">
  744. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  745. <span style="float: right;">{{ item.projectName }}</span>
  746. </el-option>
  747. </el-option-group>
  748. </el-select>
  749. <template v-if="user.timeType.mainProjectState != 1">
  750. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  751. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  752. <!--子项目 -->
  753. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  754. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  755. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  756. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  757. </el-select>
  758. </template>
  759. <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;"
  760. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  761. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  762. </el-link>
  763. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  764. <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>
  765. </div>
  766. <!-- <el-link type="primary" v-if="canEdit"
  767. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  768. </el-form-item>
  769. <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">
  770. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  771. </el-form-item>
  772. <!--如果设置了工时成本预警的预算成本项-->
  773. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  774. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  775. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  776. </el-select>
  777. </el-form-item>
  778. <el-form-item v-if="user.company.packageProject == 1">
  779. <template slot="label">
  780. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  781. <span >{{$t('lable.taskGrouping')}}</span>
  782. </template>
  783. <!-- 任务分组 -->
  784. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  785. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  786. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  787. </el-select>
  788. <!-- 项目的阶段 -->
  789. <span v-if="domain.stages != null && domain.stages.length> 0"
  790. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  791. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  792. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  793. @change="changeStages(domain, index)"
  794. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  795. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  796. </el-select>
  797. </el-form-item>
  798. <el-form-item :label="$t('other.projectAuditor')" >
  799. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  800. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  801. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  802. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  803. </el-option>
  804. </el-select>
  805. <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>
  806. </el-form-item>
  807. <!--工程专业版本模式下, 各个专业的进度填报 -->
  808. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  809. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  810. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  811. <el-input size="mini" style="width:60px;" v-model="item.progress"
  812. @keyup.native="onProgressChange"
  813. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  814. </span>
  815. </el-form-item>
  816. <!-- 相关维度 -->
  817. <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'">
  818. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  819. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  820. </el-option>
  821. </el-select>
  822. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  823. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  824. </el-option>
  825. </el-select>
  826. </el-form-item>
  827. <!-- 相关数值 -->
  828. <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">
  829. <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>
  830. </el-form-item>
  831. <!-- 自定义文本 -->
  832. <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">
  833. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  834. </el-form-item>
  835. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  836. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  837. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  838. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  839. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  840. </el-select>
  841. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  842. </el-form-item>
  843. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  844. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  845. <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>
  846. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  847. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  848. <span v-if="reportTimeType.type == 2">
  849. <!-- <span> -->
  850. <!--时间范围选择 -->
  851. <el-time-picker
  852. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  853. v-model="timeItem.startTime"
  854. :placeholder="$t('time.startTime')"
  855. style="width:120px;"
  856. format="HH:mm"
  857. value-format="HH:mm"
  858. :picker-options="{
  859. start: '00:00',
  860. end: '23:59',
  861. }"
  862. @change="iptChangs()">
  863. </el-time-picker> - <el-time-picker
  864. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  865. v-model="timeItem.endTime"
  866. :placeholder="$t('time.endTime')"
  867. style="width:120px;"
  868. format="HH:mm"
  869. value-format="HH:mm"
  870. :picker-options="{
  871. start: '00:00',
  872. end: '23:59',
  873. minTime: timeItem.startTime
  874. }"
  875. @change="iptChangs()">
  876. </el-time-picker>
  877. </span>
  878. </el-form-item>
  879. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  880. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  881. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  882. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  883. ></el-input>
  884. </el-form-item>
  885. </div>
  886. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  887. </div>
  888. <!--照片的显示 -->
  889. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  890. <el-image v-for="(pic, index) in domain.pics" :key="index"
  891. style="width: 100px; height: 100px; margin-right:10px;"
  892. :src="pic"
  893. :preview-src-list="domain.pics">
  894. </el-image>
  895. </p>
  896. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  897. </div>
  898. <span id="workFormsItemBottom"></span>
  899. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  900. </el-form>
  901. </div>
  902. <span slot="footer" class="dialog-footer">
  903. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  904. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  905. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  906. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  907. <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>
  908. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  909. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  910. </span>
  911. </el-dialog>
  912. <!-- 按周填报 -->
  913. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  914. <!-- 按周填报-已填工时-点击 -->
  915. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  916. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  917. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  918. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  919. <el-table-column prop="state" :label="$t('state.states')">
  920. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  921. </el-table-column>
  922. </el-table>
  923. <span slot="footer" class="dialog-footer">
  924. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  925. </span>
  926. </el-dialog>
  927. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  928. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  929. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  930. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  931. <span class="spnn" v-if="workForm.userNames">
  932. <span v-for="(item, index) in workForm.userNames" :key="index">
  933. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  934. <span v-if="index < workForm.userNames.length - 1">,</span>
  935. </span>
  936. </span>
  937. <span class="spnn hover" v-else>
  938. {{$t('defaultText.pleaseSelectAsubstitute')}}
  939. </span>
  940. </div>
  941. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  942. </div>
  943. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  944. <el-form-item style="height:30px;margin-top:-72px;">
  945. <!-- <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> -->
  946. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  947. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  948. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  949. <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>
  950. <el-option
  951. v-for="item in fillProjectList"
  952. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  953. :key="item.id"
  954. :label="item.projectName + '\u3000' + item.projectCode"
  955. :value="item.id">
  956. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  957. <span style="float: right">{{ item.projectName }}</span>
  958. </el-option>
  959. </el-select>
  960. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  961. </el-form-item>
  962. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  963. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  964. <template slot-scope="scope">
  965. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  966. </template>
  967. </el-table-column>
  968. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  969. <template slot-scope="scope">
  970. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  971. <p v-else></p>
  972. </template>
  973. </el-table-column> -->
  974. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  975. <template slot-scope="scope">
  976. <div v-if="scope.row.canFill == 1">
  977. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  978. <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>
  979. <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>
  980. <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>
  981. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  982. </div>
  983. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  984. <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>
  985. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  986. </div>
  987. </div>
  988. <div v-else >
  989. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  990. </div>
  991. </template>
  992. </el-table-column>
  993. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  994. <template slot-scope="scope">
  995. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  996. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  997. </span>
  998. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  999. </template>
  1000. </el-table-column>
  1001. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1002. <template slot-scope="scope">
  1003. <div class="zhiss">
  1004. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1005. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1006. </div>
  1007. </template>
  1008. </el-table-column>
  1009. </el-table>
  1010. </el-form>
  1011. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1012. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1013. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1014. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1015. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1016. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1017. <!--针对景昱,先检查工时是否存在异常-->
  1018. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1019. </span>
  1020. </el-dialog>
  1021. <!-- 重庆物奇私人定制的按周填报 -->
  1022. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1023. <div class="fillWeekDialogVisiCustom">
  1024. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1025. </div>
  1026. </el-dialog>
  1027. <!-- enableNewWeeklyfill==2 -->
  1028. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1029. <div class="fillWeekDialogVisiCustom">
  1030. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1031. </div>
  1032. </el-dialog>
  1033. <!-- 选择时间 -->
  1034. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1035. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1036. <span slot="footer" class="dialog-footer">
  1037. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1038. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1039. </span>
  1040. </el-dialog>
  1041. <!-- 按周填报弹窗 -->
  1042. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1043. <div>
  1044. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1045. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1046. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1047. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. </div>
  1050. <!--如果设置了工时成本预警的预算成本项-->
  1051. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1052. <p>{{$t('lable.budgetSource')}}</p>
  1053. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1054. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1055. </el-select>
  1056. </div>
  1057. <!-- 任务分组 -->
  1058. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1059. <p>{{$t('lable.taskGrouping')}}</p>
  1060. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1061. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1062. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1063. </el-select>
  1064. </div>
  1065. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1066. <p>{{$t('other.inputStage')}}</p>
  1067. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1068. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1069. </el-select>
  1070. </div>
  1071. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1072. <p>{{$t('other.reviewer')}}</p>
  1073. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1074. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1075. </el-select>
  1076. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1077. </div>
  1078. <template v-if="user.timeType.reportAuditType == 3">
  1079. <div class="zhoFel">
  1080. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1081. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1082. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1083. </el-select>
  1084. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1085. </div>
  1086. <div class="zhoFel">
  1087. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1088. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1089. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1090. </el-select>
  1091. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1092. </div>
  1093. <div class="zhoFel">
  1094. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1095. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1096. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1097. </el-select>
  1098. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1099. </div>
  1100. <div class="zhoFel">
  1101. <p>{{ $t('chao-song-ren') }}</p>
  1102. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1103. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1104. </el-select>
  1105. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1106. </div>
  1107. </template>
  1108. <!-- 自定义维度 -->
  1109. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1110. <p>{{user.timeType.customDegreeName}}</p>
  1111. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1112. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1113. </el-select>
  1114. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1115. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1116. </el-select>
  1117. </div>
  1118. <!-- 自定义数值 -->
  1119. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1120. <p>{{user.timeType.customDataName}}</p>
  1121. <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>
  1122. </div>
  1123. <!-- 自定义文本 -->
  1124. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1125. <p>{{user.timeType.customTextName}}</p>
  1126. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1127. </div>
  1128. <!-- 选择任务 -->
  1129. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1130. <p>{{ $t('renWuLiChengBei') }}</p>
  1131. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1132. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1133. </el-select>
  1134. </div>
  1135. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1136. <p>{{$t('other.timeSelection')}}</p>
  1137. <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>
  1138. </div>
  1139. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1140. <p>{{$t('other.chooseDuration')}}</p>
  1141. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1142. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1143. </el-select>
  1144. </div>
  1145. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1146. <p>{{$t('lable.percentageOfTime')}}</p>
  1147. <div style="width:400px;display: flex;align-items: center;">
  1148. <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>
  1149. <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>
  1150. </div>
  1151. </div>
  1152. <div class="zhoFel">
  1153. <p>{{$t('other.workMatters')}}</p>
  1154. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1155. </div>
  1156. </div>
  1157. <span slot="footer" class="dialog-footer">
  1158. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1159. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1160. </span>
  1161. </el-dialog>
  1162. <!--导出报表条件选择 -->
  1163. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1164. <el-form ref="form3" :model="exportParam" >
  1165. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1166. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1167. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1168. </el-select>
  1169. </el-form-item>
  1170. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1171. <!-- <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>
  1172. <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> -->
  1173. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1174. </el-form-item>
  1175. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1176. <el-date-picker
  1177. v-model="exportParam.dateRange" :editable="false"
  1178. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1179. :range-separator="$t('other.to')"
  1180. type="daterange"
  1181. :start-placeholder="$t('time.startDate')"
  1182. :end-placeholder="$t('time.endDate')"
  1183. ></el-date-picker>
  1184. </el-form-item>
  1185. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1186. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1187. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1188. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1189. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1190. </el-select>
  1191. </el-form-item>
  1192. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1193. <div class="exportReportRadio">
  1194. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1195. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1196. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1197. <i class="el-icon-question"></i>
  1198. </el-tooltip>
  1199. </div>
  1200. </el-form-item>
  1201. </el-form>
  1202. <div slot="footer" class="dialog-footer">
  1203. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1204. </div>
  1205. </el-dialog>
  1206. <!--导出报表条件选择 -->
  1207. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1208. <el-form ref="form3" :model="exportParam" >
  1209. <el-form-item prop="range" :label="$t('time.dateRange')">
  1210. <el-date-picker
  1211. v-model="exportParam.dateRange" :editable="false"
  1212. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1213. :clearable="true"
  1214. :range-separator="$t('other.to')"
  1215. type="daterange"
  1216. :start-placeholder="$t('time.startDate')"
  1217. :end-placeholder="$t('time.endDate')"
  1218. ></el-date-picker>
  1219. </el-form-item>
  1220. </el-form>
  1221. <div slot="footer" class="dialog-footer">
  1222. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1223. </div>
  1224. </el-dialog>
  1225. <!--人员列表 -->
  1226. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1227. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1228. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1229. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1230. <el-table-column type="selection"></el-table-column>
  1231. <el-table-column prop="label" :label="$t('lable.name')" >
  1232. <template slot-scope="scope">
  1233. <span>
  1234. <!-- {{(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}} -->
  1235. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1236. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1237. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1238. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1239. </span>
  1240. <span v-else>
  1241. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1242. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1243. </span>
  1244. </span>
  1245. </template>
  1246. </el-table-column>
  1247. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1248. <template slot-scope="scope">
  1249. <div>
  1250. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1251. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1252. </div>
  1253. </template>
  1254. </el-table-column>
  1255. </el-table>
  1256. </el-tab-pane>
  1257. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1258. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1259. <el-table-column prop="label" :label="$t('lable.name')" >
  1260. <template slot-scope="scope">
  1261. <!-- <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> -->
  1262. <!-- <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> -->
  1263. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1264. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1265. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1266. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1267. </span>
  1268. <span v-else>
  1269. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1270. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1271. </span>
  1272. </template>
  1273. </el-table-column>
  1274. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1275. <template slot-scope="scope">
  1276. <div>
  1277. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1278. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1279. </div>
  1280. </template>
  1281. </el-table-column>
  1282. </el-table>
  1283. </el-tab-pane>
  1284. </el-tabs>
  1285. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1286. <el-table-column type="selection"></el-table-column>
  1287. <el-table-column prop="label" :label="$t('lable.name')" >
  1288. <template slot-scope="scope">
  1289. <div>
  1290. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1291. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1292. </div>
  1293. </template>
  1294. </el-table-column>
  1295. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1296. <template slot-scope="scope">
  1297. <div>
  1298. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1299. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1300. </div>
  1301. </template>
  1302. </el-table-column>
  1303. </el-table>
  1304. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1305. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1306. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1307. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1308. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1309. </div>
  1310. </el-dialog>
  1311. <!-- 日报审核修改 -->
  1312. <el-dialog
  1313. :title="$t('riBaoShenHeXiuGai')"
  1314. :visible.sync="reportLogCheckDialog"
  1315. width="30%"
  1316. :before-close="handleClose">
  1317. <el-form ref="form3" :model="exportReportLogParam" >
  1318. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1319. <el-date-picker
  1320. v-model="exportReportLogParam.dateRange" :editable="false"
  1321. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1322. :range-separator="$t('other.to')"
  1323. type="daterange"
  1324. :start-placeholder="$t('time.startDate')"
  1325. :end-placeholder="$t('time.endDate')"
  1326. ></el-date-picker>
  1327. </el-form-item>
  1328. </el-form>
  1329. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1330. <br>
  1331. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1332. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1333. <span slot="footer" class="dialog-footer">
  1334. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1335. </span>
  1336. </el-dialog>
  1337. <!-- 按部门选择人员 -->
  1338. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1339. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1340. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1341. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1342. </el-input>
  1343. <div class="tree" style="height:400px">
  1344. <el-scrollbar style="height:100%">
  1345. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1346. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1347. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1348. <span class="custom-tree-node" slot-scope="{ node }">
  1349. <span v-if="user.userNameNeedTranslate == '1'">
  1350. <span v-if="node.data.children">
  1351. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1352. </span>
  1353. <span v-else>
  1354. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1355. </span>
  1356. </span>
  1357. <span v-if="user.userNameNeedTranslate != '1'">
  1358. {{ node.label }}
  1359. </span>
  1360. <!-- {{ node.label }} -->
  1361. </span>
  1362. </el-tree>
  1363. </el-scrollbar>
  1364. </div>
  1365. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1366. <div slot="footer" class="dialog-footer">
  1367. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1368. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1369. </div>
  1370. </el-dialog>
  1371. <el-dialog
  1372. v-if="monthWorkTimeDialog"
  1373. :visible.sync="monthWorkTimeDialog"
  1374. :close-on-click-modal="false"
  1375. customClass="customWidth selectworktime"
  1376. width="92%"
  1377. top="60px"
  1378. >
  1379. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1380. <el-tabs v-model="activeName" @tab-click="handleClick">
  1381. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1382. <div class="selectworktime_export" style="margin-top:10px;">
  1383. <div class="selectworktime_export_l">
  1384. <el-date-picker
  1385. class="selecteworktime_datapick"
  1386. v-model="WorktimeDatepickValue"
  1387. value-format="yyyy-MM-dd"
  1388. type="daterange"
  1389. align="right"
  1390. unlink-panels
  1391. :range-separator="$t('other.to')"
  1392. :start-placeholder="$t('time.startDate')"
  1393. :end-placeholder="$t('time.endDate')"
  1394. :default-time="['12:00:00', '12:00:00']"
  1395. size="small"
  1396. popper-class="selecteorktime_datapick_popper"
  1397. @change="showMonthWorkTime()"
  1398. >
  1399. </el-date-picker>
  1400. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1401. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1402. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1403. <!-- 222 -->
  1404. </div>
  1405. <div>
  1406. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1407. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1408. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1409. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1410. </el-input>
  1411. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1412. </div>
  1413. <div style="float: left; height:32px; padding-top:10px;">
  1414. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1415. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1416. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1417. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1418. </div>
  1419. <div style="float: right; vertical-align: middle;height:32px">
  1420. <el-link
  1421. type="primary"
  1422. @click="exportMembWorkHours()"
  1423. >{{$t('export.exportData')}}</el-link
  1424. >
  1425. </div>
  1426. </div>
  1427. <el-table ref="hasworkTbl"
  1428. :data="monthWorkDataS"
  1429. v-el-table-infinite-scroll="listScroll"
  1430. border
  1431. :height="'70vh'"
  1432. highlight-current-row
  1433. style="width: 100%"
  1434. v-loading="tbload"
  1435. :lazy="true"
  1436. :cell-style="hasworkTblCellStyle"
  1437. >
  1438. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1439. <template slot-scope="scope">
  1440. {{ scope.$index + 1 }}
  1441. </template>
  1442. </el-table-column>
  1443. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1444. <template slot-scope="scope">
  1445. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1446. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1447. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1448. <!-- {{scope.row.name}} -->
  1449. </span>
  1450. </template>
  1451. </el-table-column>
  1452. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1453. <template slot-scope="scope">
  1454. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1455. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1456. </template>
  1457. </el-table-column>
  1458. <el-table-column
  1459. min-width="60"
  1460. v-for="(item, index) in pickDateArray"
  1461. :key="index"
  1462. :label="item"
  1463. align="center"
  1464. >
  1465. <template slot="header" slot-scope="scope">
  1466. <div>{{ scope.column.label.dateStr }}</div>
  1467. <div>{{ scope.column.label.weekStr }}</div>
  1468. </template>
  1469. <template slot-scope="scope">
  1470. <div
  1471. v-if="
  1472. scope.row.worktimeList.filter(
  1473. (w) =>
  1474. w.createDate==item.date
  1475. ).length > 0 &&
  1476. scope.row.worktimeList.filter(
  1477. (w) =>w.createDate==item.date
  1478. )[0].workingTime < reportTimeType.allday
  1479. "
  1480. >
  1481. {{
  1482. scope.row.worktimeList.filter(
  1483. (w) =>w.createDate==item.date
  1484. )[0].workingTime.toFixed(1)
  1485. }}
  1486. </div>
  1487. <div
  1488. v-if="
  1489. scope.row.worktimeList.filter(
  1490. (w) =>w.createDate==item.date
  1491. ).length > 0 &&
  1492. scope.row.worktimeList.filter(
  1493. (w) =>w.createDate==item.date
  1494. )[0].workingTime > reportTimeType.allday
  1495. "
  1496. >
  1497. {{
  1498. scope.row.worktimeList.filter(
  1499. (w) =>w.createDate==item.date
  1500. )[0].workingTime.toFixed(1)
  1501. }}
  1502. </div>
  1503. <div
  1504. v-if="
  1505. scope.row.worktimeList.filter(
  1506. (w) =>w.createDate==item.date
  1507. ).length > 0 &&
  1508. scope.row.worktimeList.filter(
  1509. (w) =>w.createDate==item.date
  1510. )[0].workingTime == reportTimeType.allday
  1511. "
  1512. >
  1513. {{
  1514. scope.row.worktimeList.filter(
  1515. (w) =>w.createDate==item.date
  1516. )[0].workingTime
  1517. }}
  1518. </div>
  1519. <div
  1520. v-if="
  1521. scope.row.worktimeList.filter(
  1522. (w) =>w.createDate==item.date
  1523. ).length == 0
  1524. "
  1525. >
  1526. 0
  1527. </div>
  1528. <div
  1529. v-if="
  1530. scope.row.worktimeList.filter(
  1531. (w) =>w.createDate==item.date
  1532. ).length > 0 &&
  1533. typeof scope.row.worktimeList.filter(
  1534. (w) =>w.createDate==item.date
  1535. )[0].workingTime == 'string'
  1536. "
  1537. >
  1538. {{
  1539. scope.row.worktimeList.filter(
  1540. (w) =>w.createDate==item.date
  1541. )[0].workingTime
  1542. }}
  1543. </div>
  1544. </template>
  1545. </el-table-column>
  1546. </el-table>
  1547. <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>
  1548. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1549. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1550. <label style="font-size: 16px">员工每日已填报工时数</label>
  1551. <el-link
  1552. type="primary"
  1553. style="float: right; margin-right: 60px"
  1554. @click="exportMembWorkHours()"
  1555. >导出已填报数据</el-link
  1556. > -->
  1557. <!-- <el-button >导出</el-button> -->
  1558. <!-- </div> -->
  1559. </el-tab-pane>
  1560. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1561. <div class="selectworktime_export" style="margin-top:10px">
  1562. <div class="selectworktime_export_l">
  1563. <el-date-picker
  1564. class="selecteworktime_datapick"
  1565. v-model="WorktimeDatepickValue"
  1566. value-format="yyyy-MM-dd"
  1567. type="daterange"
  1568. align="right"
  1569. unlink-panels
  1570. :range-separator="$t('other.to')"
  1571. :start-placeholder="$t('time.startDate')"
  1572. :end-placeholder="$t('time.endDate')"
  1573. :default-time="['12:00:00', '12:00:00']"
  1574. size="small"
  1575. popper-class="selecteorktime_datapick_popper"
  1576. @change="showMonthNotWorkTime()"
  1577. >
  1578. </el-date-picker>
  1579. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1580. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1581. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1582. </div>
  1583. <div>
  1584. <div style="margin-top:10px;">
  1585. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1586. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1587. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1588. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1589. </el-input>
  1590. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1591. <el-link
  1592. type="primary"
  1593. style="float: right; vertical-align: middle;height:32px"
  1594. @click="exportMembNotWorkHours()"
  1595. >{{$t('export.exportData')}}</el-link
  1596. >
  1597. </div>
  1598. </div>
  1599. </div>
  1600. <el-table
  1601. ref="hasworkTbl2"
  1602. :data="monthNotWorkDateS"
  1603. v-el-table-infinite-scroll="notListScroll"
  1604. border
  1605. :height="'70vh'"
  1606. highlight-current-row
  1607. style="width: 100%"
  1608. v-loading="tbload"
  1609. lazy
  1610. >
  1611. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1612. <template slot-scope="scope">
  1613. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1614. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1615. </template>
  1616. </el-table-column>
  1617. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1618. <template slot-scope="scope">
  1619. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1620. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1621. </template>
  1622. </el-table-column>
  1623. <el-table-column
  1624. min-width="200"
  1625. :label="$t('weekDay.date')"
  1626. align="center"
  1627. prop="createDate"
  1628. >
  1629. </el-table-column>
  1630. <el-table-column
  1631. min-width="200"
  1632. :label="$t('state.states')"
  1633. align="center"
  1634. prop="status"
  1635. />
  1636. <el-table-column
  1637. min-width="200"
  1638. :label="$t('other.attendanceData')"
  1639. prop="cardTime"
  1640. align="center"
  1641. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1642. </el-table>
  1643. <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>
  1644. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1645. </el-tab-pane>
  1646. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1">
  1647. <div class="selectworktime_export" style="margin-top:10px">
  1648. <div class="selectworktime_export_l">
  1649. <el-date-picker
  1650. class="selecteworktime_datapick"
  1651. v-model="notfullSelectDateMonth"
  1652. value-format="yyyy-MM"
  1653. type="month"
  1654. align="right"
  1655. unlink-panels
  1656. size="small"
  1657. popper-class="selecteorktime_datapick_popper"
  1658. @change="showReportTimeLessThanCardTimeList()"
  1659. >
  1660. </el-date-picker>
  1661. </div>
  1662. <div>
  1663. <div style="margin-top:10px;">
  1664. <!-- <el-link
  1665. type="primary"
  1666. style="float: right; vertical-align: middle;height:32px"
  1667. @click="exportMembNotWorkHours()"
  1668. >{{$t('export.exportData')}}</el-link> -->
  1669. </div>
  1670. </div>
  1671. </div>
  1672. <el-table
  1673. ref="hasworkTbl4"
  1674. :data="notFullData"
  1675. border
  1676. :height="'70vh'"
  1677. highlight-current-row
  1678. style="width: 100%"
  1679. v-loading="tbload"
  1680. lazy
  1681. >
  1682. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1683. <template slot-scope="scope">
  1684. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1685. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1686. </template>
  1687. </el-table-column>
  1688. <el-table-column
  1689. min-width="200"
  1690. :label="$t('weekDay.date')"
  1691. align="center"
  1692. prop="createDate"
  1693. >
  1694. </el-table-column>
  1695. <el-table-column
  1696. min-width="200"
  1697. :label="$t('fillReportTime')"
  1698. align="center"
  1699. prop="reportTime"
  1700. />
  1701. <el-table-column
  1702. min-width="200"
  1703. :label="$t('workAttendance')"
  1704. prop="workHours"
  1705. align="center"></el-table-column>
  1706. </el-table>
  1707. </el-tab-pane>
  1708. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1709. <div class="selectworktime_export" style="margin-top:10px;">
  1710. <div class="selectworktime_export_l">
  1711. <el-date-picker
  1712. class="selecteworktime_datapick"
  1713. v-model="WorktimeDatepickValue"
  1714. value-format="yyyy-MM-dd"
  1715. type="daterange"
  1716. align="right"
  1717. unlink-panels
  1718. :range-separator="$t('other.to')"
  1719. :start-placeholder="$t('time.startDate')"
  1720. :end-placeholder="$t('time.endDate')"
  1721. :default-time="['12:00:00', '12:00:00']"
  1722. size="small"
  1723. popper-class="selecteorktime_datapick_popper"
  1724. @change="showMonthWorkTimeReminder()"
  1725. >
  1726. </el-date-picker>
  1727. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1728. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1729. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1730. </div>
  1731. <div>
  1732. <div style="margin-top:10px;">
  1733. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1734. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1735. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1736. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1737. </el-input>
  1738. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1739. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1740. </div>
  1741. </div>
  1742. <div style="float: right; vertical-align: middle;height:32px">
  1743. <el-link
  1744. type="primary"
  1745. @click="changeReminder()"
  1746. >{{ $t('bianGengTiXing') }}</el-link
  1747. >
  1748. <el-link
  1749. type="primary"
  1750. @click="exportMembWorkHoursReminder()"
  1751. >{{$t('export.exportData')}}</el-link
  1752. >
  1753. </div>
  1754. </div>
  1755. <el-table ref="hasworkTbl"
  1756. :data="monthWorkDataS"
  1757. v-el-table-infinite-scroll="listScroll"
  1758. border
  1759. :height="'70vh'"
  1760. highlight-current-row
  1761. style="width: 100%"
  1762. v-loading="tbload"
  1763. :lazy="true"
  1764. >
  1765. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1766. <template slot-scope="scope">
  1767. {{ scope.row.createDate}}
  1768. </template>
  1769. </el-table-column>
  1770. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1771. <template slot-scope="scope">
  1772. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1773. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1774. <!-- {{scope.row.name}} -->
  1775. </template>
  1776. </el-table-column>
  1777. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1778. <template slot-scope="scope">
  1779. {{scope.row.invokeValue}}
  1780. </template>
  1781. </el-table-column>
  1782. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1783. <template slot-scope="scope">
  1784. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1785. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1786. </template>
  1787. </el-table-column>
  1788. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1789. <template slot-scope="scope">
  1790. {{ scope.row.workingTime}}
  1791. </template>
  1792. </el-table-column>
  1793. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1794. <template slot-scope="scope">
  1795. {{ scope.row.cardTime}}
  1796. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1797. </template>
  1798. </el-table-column>
  1799. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1800. <template slot-scope="scope">
  1801. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1802. </template>
  1803. </el-table-column>
  1804. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1805. <template slot-scope="scope">
  1806. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1807. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1808. </template>
  1809. </el-table-column>
  1810. </el-table>
  1811. <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>
  1812. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1813. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1814. <label style="font-size: 16px">员工每日已填报工时数</label>
  1815. <el-link
  1816. type="primary"
  1817. style="float: right; margin-right: 60px"
  1818. @click="exportMembWorkHours()"
  1819. >导出已填报数据</el-link
  1820. > -->
  1821. <!-- <el-button >导出</el-button> -->
  1822. <!-- </div> -->
  1823. </el-tab-pane>
  1824. </el-tabs>
  1825. </el-dialog>
  1826. <!--驳回弹出框 -->
  1827. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1828. <div>
  1829. <span style="color:red;">*</span><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')" />
  1830. </div>
  1831. <div slot="footer" class="dialog-footer">
  1832. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1833. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1834. </div>
  1835. </el-dialog>
  1836. <!-- 通过弹出框 -->
  1837. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1838. <div>
  1839. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1840. </div>
  1841. <div slot="footer" class="dialog-footer">
  1842. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1843. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1844. </div>
  1845. </el-dialog>
  1846. <!--批量导入日报 -->
  1847. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1848. <p>1. {{$t('other.download')}}
  1849. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1850. </p>
  1851. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1852. <p style="display: flex;justify-content: center;">
  1853. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1854. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1855. </el-upload>
  1856. </p>
  1857. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1858. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1859. </div>
  1860. </el-dialog>
  1861. <!-- 工时导入记录弹窗 -->
  1862. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1863. <div style="height: 452px">
  1864. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1865. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1866. <el-table-column prop="userName" :label="$t('other.operator')">
  1867. <template slot-scope="scope">
  1868. <div>
  1869. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1870. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1871. </div>
  1872. </template>
  1873. </el-table-column>
  1874. <el-table-column prop="datel" :label="$t('other.document')">
  1875. <template slot-scope="scope">
  1876. <div>
  1877. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1878. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1879. </div>
  1880. </template>
  1881. </el-table-column>
  1882. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1883. <template slot-scope="scope">
  1884. <div>
  1885. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1886. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1887. </div>
  1888. </template>
  1889. </el-table-column>
  1890. </el-table>
  1891. <el-col :span="24" class="paginatis">
  1892. <el-pagination
  1893. @size-change="handleSizeChange"
  1894. @current-change="handleCurrentChange"
  1895. :page-sizes="[20 , 50 , 80 , 100]"
  1896. :page-size="20"
  1897. layout="total, sizes, prev, pager, next"
  1898. :total="toViewForm.total"
  1899. style="float:right;"
  1900. ></el-pagination>
  1901. </el-col>
  1902. </div>
  1903. </el-dialog>
  1904. <!--基于企业微信考勤数据的工时导入 -->
  1905. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1906. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1907. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1908. </el-step>
  1909. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1910. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1911. </el-steps>
  1912. <div v-if="active==0" style="padding:30px;height:360px;">
  1913. <div style="margin-top:50px;margin-left:280px;">
  1914. <el-date-picker
  1915. v-model="importWxParam.date" :editable="false"
  1916. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1917. :clearable="true"
  1918. :range-separator="$t('other.to')"
  1919. type="daterange"
  1920. :start-placeholder="$t('time.startDate')"
  1921. :end-placeholder="$t('time.endDate')"
  1922. @change="loadCheckInData"
  1923. ></el-date-picker>
  1924. </div>
  1925. </div>
  1926. <div v-if="active==1" style="padding:10px;">
  1927. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1928. style="width: 100%;margin-top:5px;" >
  1929. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1930. <template slot-scope="scope">
  1931. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1932. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1933. </template>
  1934. </el-table-column>
  1935. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1936. </el-table-column>
  1937. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1938. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1939. <template slot-scope="scope">
  1940. <div>
  1941. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1942. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1943. </div>
  1944. </template>
  1945. </el-table-column>
  1946. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1947. <template slot-scope="scope">
  1948. <div>
  1949. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1950. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1951. </div>
  1952. </template>
  1953. </el-table-column>
  1954. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1955. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1956. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1957. <template slot-scope="scope">
  1958. {{scope.row.workHours.toFixed(1)}}h
  1959. </template>
  1960. </el-table-column>
  1961. </el-table>
  1962. </div>
  1963. <div v-if="active==2" >
  1964. <p style="display: flex;justify-content: center;height:390px;">
  1965. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1966. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1967. </el-upload>
  1968. </p>
  1969. </div>
  1970. <div slot="title">
  1971. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1972. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1973. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1974. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  1975. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  1976. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  1977. </div>
  1978. <span slot="footer">
  1979. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1980. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1981. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  1982. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1983. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1984. </span>
  1985. </el-dialog>
  1986. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1987. <p style="display: flex;justify-content: center;height:100px;">
  1988. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1989. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1990. </el-upload>
  1991. </p>
  1992. </el-dialog>
  1993. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1994. <div>
  1995. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1996. v-model="deleteReportParam.date" :editable="false"
  1997. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1998. :clearable="true"
  1999. :range-separator="$t('other.to')"
  2000. type="daterange"
  2001. :start-placeholder="$t('time.startDate')"
  2002. :end-placeholder="$t('time.endDate')"
  2003. ></el-date-picker>
  2004. </div>
  2005. <div style="margin-top:10px;">
  2006. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2007. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  2008. <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>
  2009. </div>
  2010. <div style="margin-top:10px;">
  2011. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2012. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2013. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2014. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2015. <span v-else>{{item.name}}</span>
  2016. </el-option>
  2017. </el-select>
  2018. </div>
  2019. <span slot="footer">
  2020. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2021. </span>
  2022. </el-dialog>
  2023. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2024. <div>
  2025. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2026. v-model="deleteReportParam.date" :editable="false"
  2027. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2028. :clearable="true"
  2029. :range-separator="$t('other.to')"
  2030. type="daterange"
  2031. :start-placeholder="$t('time.startDate')"
  2032. :end-placeholder="$t('time.endDate')"
  2033. ></el-date-picker>
  2034. </div>
  2035. <div style="margin-top:15px;">
  2036. <span>{{ $t('other.selectdepartment') }}:</span>
  2037. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2038. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2039. size="small" v-if="user.userNameNeedTranslate != 1"
  2040. ></el-cascader>
  2041. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2042. </div>
  2043. <span slot="footer">
  2044. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2045. </span>
  2046. </el-dialog>
  2047. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2048. <div>
  2049. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2050. v-model="modImportTime"
  2051. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2052. :clearable="true"
  2053. type="datetime"
  2054. ></el-date-picker>
  2055. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2056. v-model="modImportUserId"
  2057. >
  2058. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2059. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2060. <span v-else>{{item.name}}</span>
  2061. </el-option>
  2062. </el-select>
  2063. </div>
  2064. <span slot="footer">
  2065. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2066. </span>
  2067. </el-dialog>
  2068. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2069. <div>
  2070. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2071. <el-date-picker
  2072. v-model="ratioYmonth" :editable="false"
  2073. format="yyyyMM" value-format="yyyyMM"
  2074. type="month"
  2075. ></el-date-picker>
  2076. </div>
  2077. <span slot="footer">
  2078. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2079. </span>
  2080. </el-dialog>
  2081. <!--工时批量代填 -->
  2082. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2083. <div>
  2084. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2085. v-model="importWxParam.date" :editable="false"
  2086. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2087. :clearable="true"
  2088. :range-separator="$t('other.to')"
  2089. type="daterange"
  2090. :start-placeholder="$t('time.startDate')"
  2091. :end-placeholder="$t('time.endDate')"
  2092. @change="loadCheckInData"
  2093. ></el-date-picker>
  2094. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2095. </div>
  2096. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2097. :key="timeStamp"
  2098. style="width: 100%;margin-top:5px;" ref="tab">
  2099. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2100. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2101. <template slot-scope="scope">
  2102. <div>
  2103. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2104. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2105. </div>
  2106. </template>
  2107. </el-table-column>
  2108. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2109. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2110. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2111. <template slot-scope="scope">
  2112. {{scope.row.workHours.toFixed(1)}}h
  2113. </template>
  2114. </el-table-column>
  2115. <!--项目名称列表 -->
  2116. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2117. <template slot-scope="scope">
  2118. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2119. </template>
  2120. </el-table-column>
  2121. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2122. <template slot-scope="scope">
  2123. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2124. </template>
  2125. </el-table-column>
  2126. </el-table>
  2127. </el-dialog>
  2128. <!--基于企业微信考勤数据的工时导入 -->
  2129. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2130. <div style="padding-bottom:10px;">
  2131. <p>{{importResultMsg}}</p>
  2132. </div>
  2133. <!-- <span slot="footer" class="dialog-footer">
  2134. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2135. </span> -->
  2136. </el-dialog>
  2137. <!-- 审核流程展示 -->
  2138. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2139. <div style="padding:20px 40px 20px 0">
  2140. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2141. <el-step title="待提交"></el-step>
  2142. <el-step title="员工提交"></el-step>
  2143. <el-step title="审核通过"></el-step>
  2144. </el-steps>
  2145. <el-divider v-if="user.companyId == 7544"></el-divider>
  2146. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2147. <el-timeline :reverse="false" style="margin-top:10px;">
  2148. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2149. <!-- {{item.msg}} -->
  2150. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2151. <span v-if="user.userNameNeedTranslate == 1">
  2152. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2153. <span>{{item.msgCon.two}}</span>
  2154. </span>
  2155. </el-timeline-item>
  2156. </el-timeline>
  2157. </div>
  2158. </el-dialog>
  2159. <!-- 威派格定制 -->
  2160. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2161. </section>
  2162. </template>
  2163. <script>
  2164. // 左右滑动
  2165. import dragMixin from "@/common/js/tensile.js";
  2166. import util from "../../common/js/util";
  2167. // 自定义select组件
  2168. import selectCat from "@/components/select.vue"
  2169. // 引入自定义级联组件
  2170. import vueCascader from "@/components/cascader.vue"
  2171. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2172. // 重庆物奇定制组件
  2173. import WeeklyCustomization from "./weeklyCustomization.vue"
  2174. // 威派格定制转移工时
  2175. import TransferWorkingHours from "./transferWorkingHours.vue"
  2176. // 新的按周填报
  2177. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2178. import { mapMutations } from 'vuex'
  2179. let _that = this
  2180. export default {
  2181. mixins: [dragMixin],
  2182. components: {
  2183. selectCat,
  2184. vueCascader,
  2185. WeeklyCustomization,
  2186. vueMultipleDept,
  2187. TransferWorkingHours,
  2188. NewWeeklyCustomization
  2189. },
  2190. data() {
  2191. return {
  2192. singleDate:1,
  2193. subFillProjectList:[],
  2194. curAuditNode: 1,
  2195. refreshingTime: false,
  2196. substitudeStep: 1,
  2197. showHidden: false,
  2198. pageIndex: 0,
  2199. hasMore: true,
  2200. exportType: 0,
  2201. exportingData: false,
  2202. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2203. jobResponseList:[],
  2204. yisibeiCompId: 3092,
  2205. yuzhongCompId: 3385,
  2206. mingyiName : '成都明夷电子科技有限公司',
  2207. // mingyiName : '明夷',
  2208. modItemDataId: null,
  2209. modImportTime: null,
  2210. modImportUserId: null,
  2211. showModImportTimeDialog: false,
  2212. showBatchSimpleApproveReport: false,
  2213. startDeleting: false,
  2214. showBatchDeleteReport: false,
  2215. deleteReportParam: {date:null, userIds:[]},
  2216. isDenying: false,
  2217. targetWeekDate: null,//填写周报中的周日期
  2218. importCardTimeVisi: false,
  2219. startRatioExporting: false,
  2220. exportUserRatio: false,
  2221. ratioYmonth:null,
  2222. hasWrittenReport: false,
  2223. today:null,
  2224. syncTimeLoading: false,
  2225. seluserText: '',
  2226. translation: '1', // 1、文字, 2、部门, 3、人员
  2227. exportLoad: false,
  2228. getPickerOptions: {
  2229. disabledDate: (time) => {
  2230. var date = new Date();
  2231. var year = date.getFullYear();
  2232. var month = date.getMonth() + 1;
  2233. if (month >= 1 && month <= 9) {
  2234. month = "0" + month;
  2235. }
  2236. var currentdate = year.toString() + month.toString();
  2237. var timeyear = time.getFullYear();
  2238. var timemonth = time.getMonth() + 1;
  2239. if (timemonth >= 1 && timemonth <= 9) {
  2240. timemonth = "0" + timemonth;
  2241. }
  2242. var timedate = timeyear.toString() + timemonth.toString();
  2243. if(this.user.timeType.fillAhead == 0){
  2244. return currentdate < timedate;
  2245. }else{
  2246. return false
  2247. }
  2248. }
  2249. },
  2250. alalal: '8.0',
  2251. timeBasecostList:null,
  2252. tbload: false,
  2253. exportTimeDialog: false,
  2254. searchKeyword: '',
  2255. monthWorkDataS: [],
  2256. monthNotWorkDateS: [],
  2257. pickDateArray:[],
  2258. WorktimeDatepickValue: [],
  2259. activeName:"first",
  2260. isLeave: 0,
  2261. submitingReport: false,
  2262. importResultMsg:null,
  2263. showImportResult:false,
  2264. importingData: false,
  2265. isDraft: 0,
  2266. timeStamp: 0,
  2267. projectColumns:[],
  2268. checkinLoading:false,
  2269. importWxParam:{date:null,},
  2270. active:0,
  2271. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2272. importWxDialog:false,
  2273. importDialog:false,
  2274. denyForm:null,
  2275. denyReasonDialog:false,
  2276. monthWorkTimeDialog: false,
  2277. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2278. isSubstitude:false,
  2279. isFill:false,
  2280. unFillList:[],
  2281. fillList:[],
  2282. fillMembList:[],
  2283. fillMembList_leave: [],
  2284. membListVisible: false,
  2285. isBatch:0,//是否是批量填报
  2286. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2287. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2288. 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')],
  2289. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2290. fillStatusList: [],
  2291. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2292. exportReportLogParam:{dateRange:[]},
  2293. exportDialog:false,
  2294. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2295. subProjectList:[],
  2296. canEdit: true,
  2297. originCanEdit: true,
  2298. 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],
  2299. selectTime:null,
  2300. reportTimeType:{},
  2301. curDate:'',
  2302. isAllSelect: false,
  2303. approveDialogVisible:false,
  2304. deptId:null,
  2305. targetUid: null,
  2306. membCount:0,
  2307. selectState:"-1",
  2308. user: JSON.parse(sessionStorage.getItem("user")),
  2309. allUsersList: [],
  2310. showAddMore:false,
  2311. allDate: [],
  2312. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2313. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2314. choseDay: 0,
  2315. tableHeight: 0,
  2316. listLoading: false,
  2317. projectList: [], //项目列表
  2318. fillProjectList: [],
  2319. reportList: [], //日报列表
  2320. reportNames:[], //批量审批列表
  2321. selCon:[], //筛选条件
  2322. selProjectList:[], //筛选后项目列表
  2323. selConShow: true,
  2324. usersList: [], // 全部人员列表
  2325. usersListId: '', // 选中的人员id
  2326. dialogVisible: false, //项目弹窗
  2327. report: '',
  2328. workForm: {
  2329. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2330. domains: [{
  2331. id: null,
  2332. projectId: "",
  2333. workingTime: "",
  2334. timeType:0,
  2335. content: "",
  2336. state: 2,
  2337. multiWorktime:0,
  2338. worktimeList:[],
  2339. degreeId: null,
  2340. auditUserList: [],
  2341. }],
  2342. showRefresh: false,
  2343. },
  2344. workRules: {
  2345. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2346. },
  2347. chooseParticipVisible: false,
  2348. logining: false,
  2349. isDisable: false,
  2350. timeType:[],
  2351. deptMembData: [
  2352. ],
  2353. //部门人员树状结构
  2354. data: [
  2355. {
  2356. id: -1,
  2357. label: this.$t('lable.allStaff'),
  2358. membCount:0
  2359. },
  2360. {
  2361. id: 0,
  2362. label: this.$t('lable.unassigned'),
  2363. }
  2364. ],
  2365. allData:{},
  2366. batchShowData:{},
  2367. option: [],
  2368. deptOptionList: [],
  2369. depData: {
  2370. id: -1,
  2371. label: this.$t('lable.allStaff'),
  2372. },
  2373. defaultProps: {
  2374. children: 'children',
  2375. label: 'label'
  2376. },
  2377. isNew: false,
  2378. selected: false,
  2379. valuet: new Date(),
  2380. domObj: null,
  2381. participator:[],
  2382. chosenMembCount:0,
  2383. jsDay: 0,
  2384. jsTime: 0,
  2385. falsss: false,
  2386. weidu: [],
  2387. weiduList: [],
  2388. yonghuUser: [],
  2389. dateAr: [],
  2390. batchSubFillDialog: false,
  2391. isSubstiS: false,
  2392. fillWeekDialogVisi: false,
  2393. fillWeekDialogVisiCustom: false,
  2394. fillWeekDialogVisiCustomTwo: false,
  2395. zhoData: [],
  2396. weekDateRange: [],
  2397. btnZho: false,
  2398. weekDataLoading: false,
  2399. changdu: 6,
  2400. tianxieDialogVisible: false,
  2401. scopess: {},
  2402. zhoBao: {
  2403. time: '',
  2404. workingTime: '',
  2405. progress: '',
  2406. con: '',
  2407. subProjectId: '',
  2408. stage: '',
  2409. subProjectList: [],
  2410. stages: [],
  2411. },
  2412. zhoBaoIdx: '',
  2413. zhoBaoName: '',
  2414. zhis: {},
  2415. dealList: [],
  2416. toViewDialogVisible: false,
  2417. toViewList: [],
  2418. toViewloading: true,
  2419. toViewForm: {
  2420. pageIndex: '1',
  2421. pageSize: '20',
  2422. total: 0,
  2423. },
  2424. toViewloadings: false,
  2425. tabPositionss: 'top',
  2426. monthTotal: 0,
  2427. monthTotalPage: 0,
  2428. monthTotalLages: 20,
  2429. monthWorkData: [],
  2430. monthNotWorkDate: [],
  2431. monthWorkDataS1: [],
  2432. monthnotTotal: 0,
  2433. monthnotTotalPage: 0,
  2434. monthnotTotalLages: 20,
  2435. monthNotWorkDateS1: [],
  2436. deptMembDataText: '',
  2437. isFlag: false,
  2438. isMore: false,
  2439. stateKey: '0',
  2440. expandDate: [],
  2441. notifySelList:[],
  2442. departmentList: [],
  2443. trandepartmentList:[],
  2444. approvalProcessDialog: false,
  2445. approvalProcessData: [],
  2446. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2447. 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')],
  2448. isWeekend: false,
  2449. canCancelInDialog: false,
  2450. approveinData: {},
  2451. approveinDialog: false,
  2452. reportCanDelete: false,
  2453. weeklyFilledTimeDialog: false,
  2454. weeklyFilledTimeList: [],
  2455. weeklyFilledTimeLoading: false,
  2456. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2457. weeklyFilledTimeCanDelete: false,
  2458. weeklyFilledTimeDate: null,
  2459. leaveAllNum: 0,
  2460. dataLoading: false,
  2461. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2462. vacationTime: {},
  2463. integrationProjectList: [],
  2464. totalReportHours: 0, // 合计的工时
  2465. workTimeForMinYi:0,
  2466. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2467. weekIndex: 1,
  2468. weekParentData: {},
  2469. deptIdForNoReport:[],
  2470. deptIdForReminder:[],
  2471. nameAearch: '', // 企业微信姓名搜索
  2472. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2473. deptMembDataLoading: false,
  2474. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2475. {
  2476. id: 4811,
  2477. // id: 10,
  2478. name: '陕西柘中建设工程有限公司'
  2479. }
  2480. ],
  2481. pushWorkTimeLogDig:false,
  2482. pushWorkTimeLogData:[],
  2483. userReportDeptList: [],
  2484. isReminder:true,
  2485. reportLogCheckDialog:false,
  2486. deptIdForHasReport:[],
  2487. transferWorkingHoursVisable: false
  2488. };
  2489. },
  2490. watch: {
  2491. deptMembDataText(val) {
  2492. this.$refs.chooseMembTree.filter(val);
  2493. }
  2494. },
  2495. filters: {
  2496. // 过滤
  2497. amounts(value) {
  2498. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2499. return 0
  2500. }
  2501. var zhi = +value + 0
  2502. return zhi.toFixed(1)
  2503. },
  2504. // zhoData
  2505. zhoData(value, arr) {
  2506. var dateArray = value.split("-");
  2507. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2508. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2509. // console.log(arr[date.getDay()])
  2510. // return "周" + "日一二三四五六".charAt(date.getDay());
  2511. return arr[date.getDay()]
  2512. },
  2513. // 过滤数字
  2514. numbers(value) {
  2515. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2516. return 0
  2517. }
  2518. return value
  2519. },
  2520. },
  2521. computed: {},
  2522. mounted() {
  2523. var now = new Date();
  2524. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2525. this.today = t;
  2526. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2527. this.exportParam.dateRange = [startStr,t];
  2528. this.exportReportLogParam.dateRange = [startStr,t];
  2529. this.getAllDate(1);
  2530. this.getReportList();
  2531. this.getProjectList();
  2532. this.getFillProjectList();
  2533. this.getTimeType();
  2534. this.getDepartment();
  2535. this.scrollFunction()
  2536. this.userssHu();
  2537. this.getFirstAndLastDay()
  2538. if(this.user.timeType.reportAuditType == 3){
  2539. this.getAllUsersList()
  2540. }
  2541. if (this.user.company.packageProject == 1) {
  2542. this.getBasecostItemList();
  2543. }
  2544. if(this.user.timeType.userWithMultiDept == 1) {
  2545. this.getDeptMembData();
  2546. }
  2547. if(this.user.timeType.lockWorktime){
  2548. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2549. }
  2550. //设置了下限
  2551. if (this.user.timeType.minReportTime) {
  2552. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2553. }
  2554. const that = this
  2555. if(this.user.userNameNeedTranslate == 1) {
  2556. that.dataLoading = that.$store.state.dataLoading
  2557. this.upDataLoading()
  2558. setTimeout(()=>{
  2559. that.dataLoading = that.$store.state.dataLoading
  2560. }, 1000)
  2561. }
  2562. if (this.user.companyId == this.yuzhongCompId) {
  2563. this.getJobResponList();
  2564. }
  2565. },
  2566. methods: {
  2567. ...mapMutations(['upDataLoading']),
  2568. // 已填工时情况表设置背景色
  2569. hasworkTblCellStyle({ columnIndex, row, column }) {
  2570. if(columnIndex > 2) {
  2571. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2572. const worktimeList = row.worktimeList || []
  2573. const times = this.reportTimeType.allday
  2574. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2575. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2576. const missReport = filterData[0] && filterData[0].missReport;
  2577. const state = filterData[0] && filterData[0].state
  2578. if (missReport) {
  2579. return "backgroundColor: red"
  2580. } else {
  2581. if (state == 0 || state == -1) {
  2582. return "backgroundColor: orange"
  2583. } else if (state == 1) {
  2584. //审核通过
  2585. return "backgroundColor: #32CD32"
  2586. } else if (state == 2) {
  2587. return "backgroundColor: red"
  2588. } else {
  2589. return "backgroundColor: #E0E0E0"
  2590. }
  2591. }
  2592. }
  2593. },
  2594. showReportTimeLessThanCardTimeList() {
  2595. this.monthTotalPage = 0,
  2596. this.tbload = true,
  2597. this.http.post(
  2598. "/report/getReportTimeLessThanCardTimeList",
  2599. {
  2600. date: this.notfullSelectDateMonth
  2601. },
  2602. (res) => {
  2603. if (res.code == "ok") {
  2604. this.tbload = false
  2605. this.notFullData = res.data;
  2606. }
  2607. },
  2608. (error) => {
  2609. this.tbload = false
  2610. this.$message({
  2611. message: error,
  2612. type: "error",
  2613. });
  2614. }
  2615. );
  2616. },
  2617. //按选择的日期范围刷新考勤
  2618. refreshWXCardTimeByRange() {
  2619. this.refreshingTime = true;
  2620. this.http.post('/wxcorp/getUserCheckInDayData',{
  2621. companyId: this.user.companyId,
  2622. userId: this.user.id,
  2623. startDate: this.importWxParam.date[0],
  2624. endDate: this.importWxParam.date[1],
  2625. },res => {
  2626. this.refreshingTime = false;
  2627. if(res.code == 'ok'){
  2628. this.loadCheckInData();
  2629. }else {
  2630. this.$message({
  2631. message: res.msg,
  2632. type: 'error'
  2633. })
  2634. }
  2635. },err => {
  2636. this.syncTimeLoading = false;
  2637. this.$message({
  2638. message: err,
  2639. type: 'error'
  2640. })
  2641. })
  2642. },
  2643. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2644. isCustomization(userInfo, permissionArray) {
  2645. const { companyId } = userInfo
  2646. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2647. return isReportPictureRequired
  2648. },
  2649. showHiddenFunction() {
  2650. this.showHidden = true;
  2651. },
  2652. // 获取如何信息选的可填写部门
  2653. getDeptMembData() {
  2654. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2655. if (res.code == "ok") {
  2656. let lists = res.data.userReportDeptList || []
  2657. const optimizedList = lists.map(item => ({
  2658. ...item,
  2659. label: item.departmentName,
  2660. value: item.departmentId,
  2661. }));
  2662. this.$set(this, 'userReportDeptList', optimizedList || []);
  2663. } else {
  2664. this.$message({
  2665. message: res.msg,
  2666. type: "error"
  2667. });
  2668. }
  2669. },error => { });
  2670. },
  2671. //任务被选中
  2672. onTaskSelected(domainItem) {
  2673. //取服务
  2674. if (domainItem.taskId) {
  2675. var that = this;
  2676. var param = {taskId:domainItem.taskId};
  2677. if (this.isSubstitude) {
  2678. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2679. param.userId = this.workForm.userId[0];
  2680. }
  2681. }
  2682. this.http.post('/task/getMyTaskService',param, res => {
  2683. if (res.code == "ok") {
  2684. // domainItem.workContentList = res.data;
  2685. that.$set(domainItem, 'sapServiceId', null);
  2686. that.$set(domainItem, 'serviceList', res.data);
  2687. } else {
  2688. this.$message({
  2689. message: res.msg,
  2690. type: "error"
  2691. });
  2692. }
  2693. },error => {
  2694. this.$message({
  2695. message: error,
  2696. type: "error"
  2697. });
  2698. }
  2699. );
  2700. } else {
  2701. //清空服务
  2702. }
  2703. },
  2704. onBatchTimeChange() {
  2705. //反向计算每日工作时长
  2706. if (this.workForm.createDate) {
  2707. let sdate = new Date(this.workForm.createDate[0]);
  2708. let edate = new Date(this.workForm.createDate[1]);
  2709. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2710. if (days < 0) {
  2711. return;
  2712. }
  2713. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2714. //总时长发生改变,自动按比例计算
  2715. this.workForm.domains.forEach(d=>{
  2716. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2717. });
  2718. }
  2719. },
  2720. //更新工作内容列表
  2721. updateJobContent(domainItem) {
  2722. var that = this;
  2723. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2724. if (res.code == "ok") {
  2725. // domainItem.workContentList = res.data;
  2726. that.$set(domainItem, 'extraField3', null);
  2727. that.$set(domainItem, 'workContentList', res.data);
  2728. } else {
  2729. this.$message({
  2730. message: res.msg,
  2731. type: "error"
  2732. });
  2733. }
  2734. },error => {
  2735. this.$message({
  2736. message: error,
  2737. type: "error"
  2738. });
  2739. }
  2740. );
  2741. },
  2742. updateResponse(domainItem) {
  2743. var that = this;
  2744. var selectPid = domainItem.projectId;
  2745. domainItem.extraField2 = null;
  2746. domainItem.extraField3 = null;
  2747. if (selectPid && domainItem.extraField1) {
  2748. //是否非项目
  2749. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2750. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2751. domainItem.filteredRespList = filteredRespList;
  2752. }
  2753. },
  2754. getJobResponList() {
  2755. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2756. if (res.code == "ok") {
  2757. this.jobResponseList = res.data;
  2758. } else {
  2759. this.$message({
  2760. message: res.msg,
  2761. type: "error"
  2762. });
  2763. }
  2764. },error => {
  2765. this.$message({
  2766. message: error,
  2767. type: "error"
  2768. });
  2769. }
  2770. );
  2771. },
  2772. openModImportTime(row) {
  2773. this.showModImportTimeDialog = true;
  2774. this.modItemDataId = row.id;
  2775. },
  2776. delImportTime(row) {
  2777. let rowId = row.id;
  2778. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2779. confirmButtonText: this.$t('btn.determine'),
  2780. cancelButtonText: this.$t('btn.cancel'),
  2781. type: "warning"
  2782. })
  2783. .then(() => {
  2784. this.http.post('/report-import-log/delete',{
  2785. id: rowId
  2786. },res => {
  2787. if (res.code == "ok") {
  2788. this.$message({
  2789. message: this.$t('message.successfullyDeleted'),
  2790. type: "success"
  2791. });
  2792. this.getToView();
  2793. } else {
  2794. this.$message({
  2795. message: res.msg,
  2796. type: "error"
  2797. });
  2798. }
  2799. },error => {
  2800. this.$message({
  2801. message: error,
  2802. type: "error"
  2803. });
  2804. }
  2805. );
  2806. }).catch(() => {this.startDeleting = false});
  2807. },
  2808. confirmChangeModTime() {
  2809. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2810. this.$message({
  2811. message: this.$t('message.Pleaseselectatime'),
  2812. type: "error"
  2813. });
  2814. return;
  2815. }
  2816. this.http.post('/report-import-log/changeTime',{
  2817. modLogDateTime: this.modImportTime,
  2818. modImportUserId: this.modImportUserId,
  2819. id: this.modItemDataId
  2820. },res => {
  2821. if (res.code == "ok") {
  2822. this.$message({
  2823. message: this.$t('message.modifyTheSuccess'),
  2824. type: "success"
  2825. });
  2826. this.getToView();
  2827. this.showModImportTimeDialog = false;
  2828. } else {
  2829. this.$message({
  2830. message: res.msg,
  2831. type: "error"
  2832. });
  2833. }
  2834. },error => {
  2835. this.$message({
  2836. message: error,
  2837. type: "error"
  2838. });
  2839. }
  2840. );
  2841. },
  2842. confirmBatchApproveReport() {
  2843. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2844. this.$message({
  2845. message: this.$t('qingXuanZeRiQiFanWei'),
  2846. type: "error"
  2847. });
  2848. return;
  2849. }
  2850. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2851. confirmButtonText: this.$t('btn.determine'),
  2852. cancelButtonText: this.$t('btn.cancel'),
  2853. type: "warning"
  2854. })
  2855. .then(() => {
  2856. this.startDeleting = true;
  2857. let obj = {
  2858. startDate: this.deleteReportParam.date[0],
  2859. endDate: this.deleteReportParam.date[1]
  2860. }
  2861. if(this.deleteReportParam.departmentId) {
  2862. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2863. } else {
  2864. obj.departmentId = null
  2865. }
  2866. this.http.post('/report/batchApproveByDate',obj,res => {
  2867. if (res.code == "ok") {
  2868. this.$message({
  2869. message: this.$t('state.approved'),
  2870. type: "success"
  2871. });
  2872. this.getReportList();
  2873. this.getDepartment();
  2874. this.startDeleting = false;
  2875. } else {
  2876. this.$message({
  2877. message: res.msg,
  2878. type: "error"
  2879. });
  2880. }
  2881. },error => {
  2882. this.$message({
  2883. message: error,
  2884. type: "error"
  2885. });
  2886. }
  2887. );
  2888. }).catch(() => {this.startDeleting = false});
  2889. },
  2890. confirmBatchDelReport() {
  2891. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2892. this.$message({
  2893. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2894. type: "error"
  2895. });
  2896. return;
  2897. }
  2898. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2899. this.$message({
  2900. message: this.$t('qingXuanZeRiQiFanWei'),
  2901. type: "error"
  2902. });
  2903. return;
  2904. }
  2905. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2906. confirmButtonText: this.$t('btn.determine'),
  2907. cancelButtonText: this.$t('btn.cancel'),
  2908. type: "warning"
  2909. })
  2910. .then(() => {
  2911. this.startDeleting = true;
  2912. this.http.post('/report/batchDelete',{
  2913. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2914. startDate: this.deleteReportParam.date[0],
  2915. endDate: this.deleteReportParam.date[1],
  2916. deptId: this.deleteReportParam.deptId[0]
  2917. },res => {
  2918. if (res.code == "ok") {
  2919. this.$message({
  2920. message: this.$t('message.successfullyDeleted'),
  2921. type: "success"
  2922. });
  2923. this.getReportList();
  2924. this.getDepartment();
  2925. this.startDeleting = false;
  2926. } else {
  2927. this.$message({
  2928. message: res.msg,
  2929. type: "error"
  2930. });
  2931. }
  2932. },error => {
  2933. this.$message({
  2934. message: error,
  2935. type: "error"
  2936. });
  2937. }
  2938. );
  2939. }).catch(() => {this.startDeleting = false});
  2940. },
  2941. getRecentlyProject(userId) {
  2942. this.http.post('/project/nearProject',{userId: userId},res => {
  2943. if(res.code == 'ok'){
  2944. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  2945. let topObj = {
  2946. label: this.$t('zuiJinXuanZeXiangMu'),
  2947. peojectList: res.data
  2948. }
  2949. let botomObj = {
  2950. label: this.$t('other.allProject'),
  2951. peojectList: bottomList
  2952. }
  2953. //最近项目如果在fillProjectList中不存在,需要移除
  2954. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  2955. this.integrationProjectList = [topObj, botomObj]
  2956. }else {
  2957. this.$message({
  2958. message: res.msg,
  2959. type: 'error'
  2960. })
  2961. }
  2962. },err => {
  2963. this.$message({
  2964. message: err,
  2965. type: 'error'
  2966. })
  2967. })
  2968. },
  2969. handlePictureCardPreview(file, index) {
  2970. let arr = []
  2971. let imgArr = this.workForm.domains[index].imgListUrl
  2972. for(var i in imgArr) {
  2973. arr.push(imgArr[i].url)
  2974. }
  2975. const $viewer = this.$viewerApi({
  2976. images: arr
  2977. });
  2978. },
  2979. // 图片上传
  2980. addImg(e, index) {
  2981. let formData = new FormData()
  2982. formData.append('multipartFile', e.file)
  2983. this.http.uploadFile('/common/uploadFile', formData,
  2984. res => {
  2985. if (res.code == "ok") {
  2986. this.$message({
  2987. message: this.$t('uploadedsuccessfully'),
  2988. type: "success"
  2989. });
  2990. if(!this.workForm.domains[index].imgList) {
  2991. this.workForm.domains[index].imgList = []
  2992. this.workForm.domains[index].imgListUrl = []
  2993. }
  2994. this.workForm.domains[index].imgList.push(res.data)
  2995. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2996. } else {
  2997. this.$message({message: res.msg,type: "error"});
  2998. }
  2999. },
  3000. error => {this.$message({message: error,type: "error"});
  3001. });
  3002. },
  3003. // 删除图片
  3004. delImg(file,fileList, index) {
  3005. let idx = 0
  3006. for(let i in fileList) {
  3007. if(fileList[i].uid == file.uid) {
  3008. idx = i
  3009. }
  3010. }
  3011. this.workForm.domains[index].imgList.splice(idx, 1)
  3012. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3013. },
  3014. test(){
  3015. console.log('test',this.workForm.domains);
  3016. },
  3017. getHour(s1, s2) {
  3018. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3019. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3020. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3021. var ms = s2.getTime() - s1.getTime();
  3022. if (ms < 0) return 0;
  3023. let ma = ms / 1000 / 60 / 60
  3024. return ma; //小时
  3025. },
  3026. refreshDDCardTime(workdate) {
  3027. if (!workdate) return;
  3028. this.syncTimeLoading = true;
  3029. this.http.post('/dingding/refreshUserCardTime',{
  3030. companyId: this.user.companyId,
  3031. userId: this.user.id,
  3032. date: workdate,
  3033. },res => {
  3034. this.syncTimeLoading = false;
  3035. if(res.code == 'ok'){
  3036. if (!res.data) {
  3037. this.$message({
  3038. message: '获取考勤失败',
  3039. type: 'error'
  3040. })
  3041. } else {
  3042. this.workForm.time = res.data;
  3043. }
  3044. }else {
  3045. this.$message({
  3046. message: res.msg,
  3047. type: 'error'
  3048. })
  3049. }
  3050. },err => {
  3051. this.syncTimeLoading = false;
  3052. this.$message({
  3053. message: err,
  3054. type: 'error'
  3055. })
  3056. })
  3057. },
  3058. refreshWXCardTime(workdate) {
  3059. if (!workdate) return;
  3060. this.syncTimeLoading = true;
  3061. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3062. date: workdate,
  3063. },res => {
  3064. this.syncTimeLoading = false;
  3065. if(res.code == 'ok'){
  3066. this.workForm.time = res.data.time;
  3067. }else {
  3068. this.$message({
  3069. message: res.msg,
  3070. type: 'error'
  3071. })
  3072. }
  3073. },err => {
  3074. this.syncTimeLoading = false;
  3075. this.$message({
  3076. message: err,
  3077. type: 'error'
  3078. })
  3079. })
  3080. },
  3081. refreshAttendance(workdate) {
  3082. if (!workdate) return;
  3083. this.syncTimeLoading = true;
  3084. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3085. startDate: workdate[0],
  3086. endDate: workdate[1]
  3087. },res => {
  3088. this.syncTimeLoading = false;
  3089. if(res.code == 'ok'){
  3090. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3091. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3092. this.totalReportHours = this.workTimeForMinYi;
  3093. }else {
  3094. this.$message({
  3095. message: res.msg,
  3096. type: 'error'
  3097. })
  3098. }
  3099. },err => {
  3100. this.syncTimeLoading = false;
  3101. this.$message({
  3102. message: err,
  3103. type: 'error'
  3104. })
  3105. })
  3106. },
  3107. refreshBeiSengAttendance(workdate) {
  3108. if (!workdate) return;
  3109. this.syncTimeLoading = true;
  3110. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3111. createDate: workdate
  3112. },res => {
  3113. this.syncTimeLoading = false;
  3114. if(res.code == 'ok'){
  3115. this.workForm.time = res.data;
  3116. }else {
  3117. this.$message({
  3118. message: res.msg,
  3119. type: 'error'
  3120. })
  3121. }
  3122. },err => {
  3123. this.syncTimeLoading = false;
  3124. this.$message({
  3125. message: err,
  3126. type: 'error'
  3127. })
  3128. })
  3129. },
  3130. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3131. this.weeklyFilledTimeDialog = true
  3132. this.weeklyFilledTimeLoading = true
  3133. this.weeklyFilledTimeDate = parameterDate
  3134. this.http.post('/report/getReportList',{
  3135. date: parameterDate,
  3136. userId: this.user.id
  3137. },res => {
  3138. this.weeklyFilledTimeLoading = false
  3139. if(res.code == 'ok'){
  3140. this.weeklyFilledTimeList = res.data[0].data
  3141. let candelete = true
  3142. for(let i in this.weeklyFilledTimeList){
  3143. if(this.weeklyFilledTimeList[i].state < 2){
  3144. candelete = false
  3145. }
  3146. }
  3147. this.weeklyFilledTimeCanDelete = candelete
  3148. }else {
  3149. this.$message({
  3150. message: res.msg,
  3151. type: 'error'
  3152. })
  3153. }
  3154. },err => {
  3155. this.weeklyFilledTimeLoading = false
  3156. this.$message({
  3157. message: err,
  3158. type: 'error'
  3159. })
  3160. })
  3161. },
  3162. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3163. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3164. confirmButtonText: this.$t('btn.determine'),
  3165. cancelButtonText: this.$t('btn.cancel'),
  3166. type: "warning"
  3167. })
  3168. .then(() => {
  3169. this.http.post('/report/delete',{
  3170. userId: this.user.id,
  3171. date: this.weeklyFilledTimeDate
  3172. },res => {
  3173. if (res.code == "ok") {
  3174. this.$message({
  3175. message: this.$t('message.successfullyDeleted'),
  3176. type: "success"
  3177. });
  3178. this.getWeeklyWorkTime()
  3179. this.getReportList();
  3180. this.getDepartment();
  3181. this.weeklyFilledTimeDialog = false;
  3182. } else {
  3183. this.$message({
  3184. message: res.msg,
  3185. type: "error"
  3186. });
  3187. }
  3188. },error => {
  3189. this.$message({
  3190. message: error,
  3191. type: "error"
  3192. });
  3193. }
  3194. );
  3195. }).catch(() => {});
  3196. },
  3197. getApprovalProcess(item){
  3198. // console.log('this.date',this.choseDate);
  3199. this.http.post('/report-log/get',{
  3200. creatorId: item.id,
  3201. createDate: sessionStorage.msg
  3202. },res => {
  3203. if(res.code == 'ok'){
  3204. this.approvalProcessDialog = true
  3205. if(this.user.userNameNeedTranslate == 1) {
  3206. for(var i in res.data) {
  3207. let obj = {
  3208. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3209. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3210. }
  3211. res.data[i].msgCon = obj
  3212. }
  3213. }
  3214. this.approvalProcessData = res.data
  3215. }else{
  3216. this.$message({
  3217. message: res.msg,
  3218. type: 'error'
  3219. })
  3220. }
  3221. },err => {
  3222. this.$message({
  3223. message: err,
  3224. type: 'error'
  3225. })
  3226. })
  3227. //获取审批节点状态
  3228. if (this.user.companyId == 7544) {
  3229. this.http.post('/report/getCurAuditNode',{
  3230. userId: item.id,
  3231. date: sessionStorage.msg
  3232. },res => {
  3233. if(res.code == 'ok'){
  3234. this.curAuditNode = res.data
  3235. }else{
  3236. }
  3237. },err => {
  3238. this.$message({
  3239. message: err,
  3240. type: 'error'
  3241. })
  3242. })
  3243. }
  3244. },
  3245. filterNode(value, data) {
  3246. if (!value) return true;
  3247. return data.label.indexOf(value) !== -1;
  3248. },
  3249. triggerCalculateOT(index) {
  3250. var str = this.workForm.domains[index].overtimeHours + ''
  3251. if(str.indexOf('.') != '-1') {
  3252. var s = str.split('.')[0]
  3253. var st = str.split('.')[1]
  3254. var sts = st.split('')
  3255. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3256. }
  3257. },
  3258. searchScreen(e){
  3259. if(e){
  3260. this.monthNotWorkDateS1 = []
  3261. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3262. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3263. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3264. }
  3265. }
  3266. if (this.monthNotWorkDateS1.length > 50) {
  3267. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3268. }else{
  3269. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3270. }
  3271. // if (this.monthNotWorkDateS1.length > 0) {
  3272. // setTimeout(() => {
  3273. // this.tableListenernot()
  3274. // }, 1000);
  3275. // }
  3276. }else{
  3277. this.monthWorkDataS1 = []
  3278. for (let i = 0; i < this.monthWorkData.length; i++) {
  3279. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3280. this.monthWorkDataS1.push(this.monthWorkData[i])
  3281. }
  3282. }
  3283. if (this.monthWorkDataS1.length > 50) {
  3284. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3285. }else{
  3286. this.monthWorkDataS = this.monthWorkDataS1
  3287. }
  3288. // if (this.monthWorkDataS1.length > 0) {
  3289. // setTimeout(() => {
  3290. // this.tableListener()
  3291. // }, 1000);
  3292. // }
  3293. }
  3294. },
  3295. addUpload(data) {
  3296. // var zhi = data.fileName.split('.')[0]
  3297. // var sss = zhi + '.xlsx'
  3298. // return
  3299. var filePath = '/upload/' + data.serverName;
  3300. const a = document.createElement('a'); // 创建a标签
  3301. a.setAttribute('download', data.fileName);// download属性
  3302. a.setAttribute('href', filePath);// href链接
  3303. a.click(); //自执行点击事件
  3304. a.remove();
  3305. },
  3306. restrictNumber(targetId) {
  3307. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3308. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3309. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3310. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3311. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3312. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3313. inpu.value = parseFloat(inpu.value);
  3314. }
  3315. },
  3316. //获取项目下的任务分组
  3317. getTaskGroups(domain, index) {
  3318. domain.groupId=null;
  3319. this.http.post('/task-group/listMyJoinGroup',{
  3320. projectId: domain.projectId,
  3321. isSubstitude: this.isSubstitude ? 1 : 0
  3322. },
  3323. res => {
  3324. if (res.code == "ok") {
  3325. this.workForm.domains[index].taskGroups = res.data;
  3326. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3327. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3328. // this.getGroupStages(domain, index);
  3329. // }
  3330. this.$forceUpdate();
  3331. }
  3332. },
  3333. error => {
  3334. this.$message({
  3335. message: error,
  3336. type: "error"
  3337. });
  3338. }
  3339. );
  3340. },
  3341. //下载填报工时占比报表
  3342. downloadProjectRatio() {
  3343. this.exportUserRatio = true;
  3344. // let now = new Date();
  3345. // let month = now.getMonth();//默认看上个月的
  3346. // let monthStr = month<10? ('0'+month): month;
  3347. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3348. const today = new Date();
  3349. const year = today.getFullYear();
  3350. const month = today.getMonth() + 1;
  3351. let lastMonthYear, lastMonth;
  3352. if (month === 1) {
  3353. lastMonthYear = year - 1;
  3354. lastMonth = 12;
  3355. } else {
  3356. lastMonthYear = year;
  3357. lastMonth = month - 1;
  3358. }
  3359. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3360. },
  3361. confirmDownloadRatio() {
  3362. this.startRatioExporting = true;
  3363. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3364. ymonth: this.ratioYmonth
  3365. },
  3366. res => {
  3367. if (res.code == "ok") {
  3368. this.startRatioExporting = false;
  3369. var filePath = res.data;
  3370. const a = document.createElement('a'); // 创建a标签
  3371. var data = filePath.split("/");
  3372. a.setAttribute('download', data[data.length-1]);// download属性
  3373. a.setAttribute('href', filePath);// href链接
  3374. a.click(); //自执行点击事件
  3375. a.remove();
  3376. } else {
  3377. this.startRatioExporting = false;
  3378. this.$message({
  3379. message: res.msg,
  3380. type: "error"
  3381. });
  3382. }
  3383. },
  3384. error => {
  3385. this.checkinLoading = false;
  3386. this.$message({
  3387. message: error,
  3388. type: "error"
  3389. });
  3390. }
  3391. );
  3392. },
  3393. //下载带企业微信考勤数据的工时统计模板
  3394. downloadCheckInExcel() {
  3395. var param = {
  3396. startDate: this.importWxParam.date[0],
  3397. endDate: this.importWxParam.date[1],
  3398. };
  3399. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3400. param.onlySelfData = false;
  3401. }
  3402. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3403. res => {
  3404. if (res.code == "ok") {
  3405. var filePath = res.data;
  3406. const a = document.createElement('a'); // 创建a标签
  3407. var data = filePath.split("/");
  3408. a.setAttribute('download', data[data.length-1]);// download属性
  3409. a.setAttribute('href', filePath);// href链接
  3410. a.click(); //自执行点击事件
  3411. a.remove();
  3412. } else {
  3413. this.$message({
  3414. message: res.msg,
  3415. type: "error"
  3416. });
  3417. }
  3418. },
  3419. error => {
  3420. this.checkinLoading = false;
  3421. this.$message({
  3422. message: error,
  3423. type: "error"
  3424. });
  3425. }
  3426. );
  3427. },
  3428. pre() {
  3429. if (this.active == 0) return;
  3430. this.active--;
  3431. },
  3432. next() {
  3433. this.active++;
  3434. },
  3435. triggerTotalTime(index) {
  3436. var item = this.checkinList[index];
  3437. var total = 0.0;
  3438. for (var i=0;i<this.projectColumns.length; i++) {
  3439. var key = this.projectColumns[i];
  3440. if (item[key] != null && item[key] != '') {
  3441. total += parseFloat(item[key]);
  3442. }
  3443. }
  3444. item.totalFillTime = total;
  3445. },
  3446. //提交批量代填的数据
  3447. submitBatchSubFillData() {
  3448. var data = JSON.stringify(this.checkinList);
  3449. this.http.post('/user-corpwx-time/submitProjectTime',{
  3450. json: data,
  3451. projectColumns: JSON.stringify(this.projectColumns)
  3452. },
  3453. res => {
  3454. if (res.code == "ok") {
  3455. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3456. this.importWxDialog = false;
  3457. }
  3458. },
  3459. error => {
  3460. this.checkinLoading = false;
  3461. this.$message({
  3462. message: error,
  3463. type: "error"
  3464. });
  3465. }
  3466. );
  3467. },
  3468. loadCheckInData() {
  3469. if (this.importWxParam.date == null) {
  3470. this.checkinList = [];
  3471. return;
  3472. }
  3473. this.checkinLoading = true;
  3474. this.http.post('/user-corpwx-time/getMyData',{
  3475. startDate: this.importWxParam.date[0],
  3476. endDate: this.importWxParam.date[1],
  3477. },
  3478. res => {
  3479. if (res.code == "ok") {
  3480. this.checkinLoading = false;
  3481. this.checkinList = res.data.list;
  3482. this.projectColumns = res.data.projects;
  3483. // 自定义表格会导致表格错乱,需重新计算表格
  3484. this.$nextTick(()=>{
  3485. this.$refs.tab.doLayout()
  3486. })
  3487. }
  3488. },
  3489. error => {
  3490. this.checkinLoading = false;
  3491. this.$message({
  3492. message: error,
  3493. type: "error"
  3494. });
  3495. }
  3496. );
  3497. },
  3498. importCardTime(item) {
  3499. //首先判断文件类型
  3500. let str = item.file.name.split(".");
  3501. let format = str[str.length - 1];
  3502. if (format != "xls" && format != "xlsx") {
  3503. this.$message({
  3504. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3505. type: "error"
  3506. });
  3507. } else {
  3508. this.importingData = true;
  3509. let formData = new FormData();
  3510. formData.append("multipartFile", item.file);
  3511. formData.append("companyId", this.user.companyId);
  3512. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3513. res => {
  3514. this.$refs.uploadCardTime.clearFiles();
  3515. this.importingData = false;
  3516. if (res.code == "ok") {
  3517. //换成弹出框,以免有人等了半天回来啥也没看到
  3518. this.$message({
  3519. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3520. type: "success"
  3521. });
  3522. } else {
  3523. this.$message({
  3524. message: res.msg,
  3525. type: "error"
  3526. });
  3527. }
  3528. },
  3529. error => {
  3530. this.$refs.upload.clearFiles();
  3531. this.listLoading = false;
  3532. this.$message({
  3533. message: error,
  3534. type: "error"
  3535. });
  3536. });
  3537. }
  3538. },
  3539. batchImportWxData(item) {
  3540. //首先判断文件类型
  3541. let str = item.file.name.split(".");
  3542. let format = str[str.length - 1];
  3543. if (format != "xls" && format != "xlsx") {
  3544. this.$message({
  3545. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3546. type: "error"
  3547. });
  3548. } else {
  3549. this.importingData = true;
  3550. let formData = new FormData();
  3551. formData.append("file", item.file);
  3552. formData.append("companyId", this.user.companyId);
  3553. formData.append("withCheckIn", 1);
  3554. this.http.uploadFile('/report/importData', formData,
  3555. res => {
  3556. this.$refs.upload.clearFiles();
  3557. this.showImportResult = true;
  3558. this.importingData = false;
  3559. if (res.code == "ok") {
  3560. //换成弹出框,以免有人等了半天回来啥也没看到
  3561. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3562. this.getReportList();
  3563. this.importWxDialog = false;
  3564. } else {
  3565. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3566. }
  3567. },
  3568. error => {
  3569. this.$refs.upload.clearFiles();
  3570. this.listLoading = false;
  3571. this.$message({
  3572. message: error,
  3573. type: "error"
  3574. });
  3575. });
  3576. }
  3577. },
  3578. batchImportData(item) {
  3579. //首先判断文件类型
  3580. let str = item.file.name.split(".");
  3581. let format = str[str.length - 1];
  3582. if (format != "xls" && format != "xlsx") {
  3583. this.$message({
  3584. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3585. type: "error"
  3586. });
  3587. } else {
  3588. this.importingData = true;
  3589. let formData = new FormData();
  3590. formData.append("file", item.file);
  3591. formData.append("companyId", this.user.companyId);
  3592. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3593. this.http.uploadFile(url, formData,
  3594. res => {
  3595. this.$refs.upload.clearFiles();
  3596. this.importingData = false;
  3597. this.showImportResult = true;
  3598. if (res.code == "ok") {
  3599. //换成弹出框,以免有人等了半天回来啥也没看到
  3600. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3601. this.getReportList();
  3602. this.importWXDialog = false;
  3603. } else {
  3604. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3605. }
  3606. },
  3607. error => {
  3608. this.$refs.upload.clearFiles();
  3609. this.importingData = false;
  3610. this.$message({
  3611. message: error,
  3612. type: "error"
  3613. });
  3614. });
  3615. }
  3616. },
  3617. userssHu() {
  3618. this.http.post('/time-type/getCompanyTimeSetting',{
  3619. companyId: this.user.companyId
  3620. },
  3621. res => {
  3622. if (res.code == "ok") {
  3623. this.yonghuUser = res.data
  3624. }
  3625. },
  3626. error => {
  3627. this.$message({
  3628. message: error,
  3629. type: "error"
  3630. });
  3631. }
  3632. );
  3633. },
  3634. iptBlur(i) {
  3635. if(this.isBatch == 0) {
  3636. return
  3637. }
  3638. var reqParam = {
  3639. startDate: this.workForm.createDate[0],
  3640. endDate: this.workForm.createDate[1]
  3641. };
  3642. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3643. reqParam.userId = this.workForm.userId[0];
  3644. }
  3645. this.http.post('/report/getWorkDays',reqParam,
  3646. res => {
  3647. if (res.code == "ok") {
  3648. this.jsDay = res.data
  3649. this.chuji(i)
  3650. } else {
  3651. this.$message({
  3652. message: res.msg,
  3653. type: "error"
  3654. });
  3655. }
  3656. },
  3657. error => {
  3658. this.$message({
  3659. message: error,
  3660. type: "error"
  3661. });
  3662. }
  3663. );
  3664. //明夷硬编码获取
  3665. if (this.user.company.companyName == this.mingyiName) {
  3666. this.getWorkTimeForMinYi();
  3667. }
  3668. },
  3669. getWorkTimeForMinYi(){
  3670. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3671. startDate: this.workForm.createDate[0],
  3672. endDate: this.workForm.createDate[1]
  3673. },
  3674. res => {
  3675. if (res.code == "ok") {
  3676. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3677. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3678. this.totalReportHours = this.workTimeForMinYi;
  3679. } else {
  3680. this.$message({
  3681. message: res.msg,
  3682. type: "error"
  3683. });
  3684. this.workForm.createDate = [];
  3685. }
  3686. },
  3687. error => {
  3688. this.$message({
  3689. message: error,
  3690. type: "error"
  3691. });
  3692. }
  3693. );
  3694. },
  3695. chuji(i) {
  3696. if(i == 0) {
  3697. this.seleChn(1)
  3698. } else if(i == 1) {
  3699. this.seleChn(0)
  3700. } else if(i == 2) {
  3701. if(this.workForm.domains[0].multiWorktime > 0) {
  3702. this.iptChangs()
  3703. } else {
  3704. this.iptChang()
  3705. }
  3706. } else if(i == 3) {
  3707. this.seleChn(0)
  3708. }
  3709. },
  3710. seleChn(e,domain) {
  3711. if(e == 1) {
  3712. for(var i in this.workForm.domains) {
  3713. if(this.workForm.domains[i].timeType == 0) {
  3714. this.workForm.domains[i].workingTime = 8
  3715. } else {
  3716. this.workForm.domains[i].workingTime = 4
  3717. }
  3718. }
  3719. }
  3720. var quanbu = 0
  3721. var spl = this.workForm.domains
  3722. var zhi = ''
  3723. for(var i in spl) {
  3724. var sp = +spl[i].workingTime + 0
  3725. zhi = this.jsDay * sp
  3726. quanbu = +quanbu + zhi
  3727. }
  3728. this.jsTime = quanbu
  3729. this.totalReportHours = quanbu
  3730. let worktime = this.jsTime
  3731. // 自动计算加班时长
  3732. if(this.isBatch != 0){
  3733. worktime = this.jsTime / this.jsDay
  3734. }
  3735. if(this.user.timeType.fillOvertime && domain){
  3736. let isover = false
  3737. let alltime = 0
  3738. let allover = 0 //此处alltime同上面的worktime
  3739. for(let d in spl){
  3740. if(spl[d].isOvertime){
  3741. isover = true
  3742. allover += spl[d].overtimeHours*1
  3743. }
  3744. alltime += spl[d].workingTime*1
  3745. }
  3746. if(domain.overtimeHours){
  3747. allover = allover - domain.overtimeHours
  3748. }
  3749. if(worktime*1 > this.user.timeType.allday){
  3750. if(isover){
  3751. if(alltime > (allover + this.user.timeType.allday)){
  3752. this.$set(domain,'isOvertime',true)
  3753. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3754. }else{
  3755. this.$set(domain,'isOvertime',false)
  3756. this.$set(domain,'overtimeHours',null)
  3757. if(alltime < (allover + this.user.timeType.allday)){
  3758. let overtime = allover + this.user.timeType.allday - alltime
  3759. for(let pi in spl){
  3760. if(spl[pi].overtimeHours){
  3761. if((overtime - spl[pi].overtimeHours*1) > 0){
  3762. overtime = overtime - spl[pi].overtimeHours*1
  3763. this.$set(spl[pi],'isOvertime',false)
  3764. this.$set(spl[pi],'overtimeHours',null)
  3765. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3766. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3767. break
  3768. }else{
  3769. this.$set(spl[pi],'isOvertime',false)
  3770. this.$set(spl[pi],'overtimeHours',null)
  3771. break
  3772. }
  3773. }
  3774. }
  3775. }
  3776. }
  3777. }else{
  3778. this.$set(domain,'isOvertime',true)
  3779. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3780. }
  3781. }else{
  3782. for(let di in spl){
  3783. this.$set(spl[di],'isOvertime',false)
  3784. this.$set(spl[di],'overtimeHours',null)
  3785. }
  3786. }
  3787. }
  3788. },
  3789. iptChang() {
  3790. var sl = this.workForm.domains
  3791. let timeArr = []
  3792. for(var i in sl) {
  3793. if(sl[i].startTime && sl[i].endTime) {
  3794. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3795. }
  3796. }
  3797. this.getTimeHours(timeArr)
  3798. },
  3799. iptChangs() {
  3800. var sl = this.workForm.domains
  3801. let timeArr = []
  3802. for(var i in sl) {
  3803. for(var j in sl[i].worktimeList){
  3804. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3805. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3806. }
  3807. }
  3808. }
  3809. this.getTimeHours(timeArr)
  3810. },
  3811. // 调用接口或去数据
  3812. getTimeHours(arr) {
  3813. this.http.post('/report/getHoursByTimeRange',{
  3814. timeJsonStr: JSON.stringify(arr)
  3815. },res => {
  3816. if(res.code === 'ok') {
  3817. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3818. } else {
  3819. this.$message({
  3820. message: res.msg,
  3821. type: 'error'
  3822. })
  3823. }
  3824. },err => {
  3825. this.$message({
  3826. message: err,
  3827. type: 'error'
  3828. })
  3829. })
  3830. },
  3831. // 按周填报调用接口计算时间
  3832. async getWeekHoursByTimeRange(timeRange) {
  3833. const url = '/report/getHoursByTimeRange';
  3834. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3835. var that = this;
  3836. return new Promise((resolve, reject) => {
  3837. this.http.post(url, data, function(res) {
  3838. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3839. }, function(err) {
  3840. reject(err);
  3841. });
  3842. });
  3843. },
  3844. removeTimeItem(item, index) {
  3845. item.worktimeList.splice(index, 1);
  3846. this.iptChangs()
  3847. },
  3848. //添加工时
  3849. addNewWorktime(index, item) {
  3850. if(item.worktimeList == null ) {
  3851. item.worktimeList = []
  3852. }
  3853. item.worktimeList.push({});
  3854. },
  3855. //复制项目
  3856. copyProject(index) {
  3857. var leftProgress = 10;
  3858. if (this.reportTimeType.type == 3) {
  3859. //计算已经待分配工时比例
  3860. let array = this.workForm.domains;
  3861. let totalProgress = 0;
  3862. for (var i=0;i<array.length; i++) {
  3863. totalProgress += array[i].progress;
  3864. }
  3865. if (totalProgress < 100) {
  3866. leftProgress = 100 - totalProgress;
  3867. }
  3868. }
  3869. var newIndex = index+1;
  3870. var itemDomain = {
  3871. projectId: this.workForm.domains[index].projectId,
  3872. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3873. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3874. ),
  3875. content: "",
  3876. progress:leftProgress,
  3877. state:2,//2-表示待提交
  3878. };
  3879. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3880. if (this.reportTimeType.type == 0) {
  3881. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3882. var length = this.workForm.domains.length;
  3883. if (length == 2) {
  3884. this.showAddMore = false;
  3885. }
  3886. }
  3887. this.selectProject(itemDomain, newIndex);
  3888. },
  3889. pushWorkTime(reportId){
  3890. let url=''
  3891. if(this.user.timeType.syncSap == 1){
  3892. url='/report/pushProjectReportToSap'
  3893. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3894. var pushDate = this.date + day;
  3895. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3896. confirmButtonText: this.$t('btn.determine'),
  3897. cancelButtonText: this.$t('btn.cancel'),
  3898. type: 'info'
  3899. }).then(() => {
  3900. const loading = this.$loading({
  3901. lock: true,
  3902. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3903. spinner: 'el-icon-loading',
  3904. background: 'rgba(0, 0, 0, 0.7)'
  3905. });
  3906. this.http.post(url,{
  3907. pushDate: pushDate,
  3908. reportId: reportId
  3909. },res => {
  3910. loading.close();
  3911. if(res.code == 'ok'){
  3912. this.$message({
  3913. type: 'success',
  3914. message: res.data
  3915. });
  3916. }else{
  3917. this.$message({
  3918. type: 'error',
  3919. message: res.msg
  3920. })
  3921. }
  3922. },err => {
  3923. loading.close();
  3924. this.$message({
  3925. type: 'error',
  3926. message: err
  3927. })
  3928. })
  3929. }).catch(() => {
  3930. });
  3931. }else{
  3932. url='/report/pushReportDataToThird'
  3933. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3934. confirmButtonText: this.$t('btn.determine'),
  3935. cancelButtonText: this.$t('btn.cancel'),
  3936. type: 'info'
  3937. }).then(() => {
  3938. const loading = this.$loading({
  3939. lock: true,
  3940. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3941. spinner: 'el-icon-loading',
  3942. background: 'rgba(0, 0, 0, 0.7)'
  3943. });
  3944. this.http.post(url,{
  3945. yearMonth: this.date
  3946. },res => {
  3947. loading.close();
  3948. if(res.code == 'ok'){
  3949. this.$message({
  3950. type: 'success',
  3951. message: this.$t('tuiSongChengGong')
  3952. });
  3953. }else{
  3954. this.$message({
  3955. type: 'error',
  3956. message: res.msg
  3957. })
  3958. }
  3959. },err => {
  3960. loading.close();
  3961. this.$message({
  3962. type: 'error',
  3963. message: err
  3964. })
  3965. })
  3966. }).catch(() => {
  3967. });
  3968. }
  3969. },
  3970. showWorkTime(){
  3971. this.monthWorkTimeDialog = true;
  3972. this.searchKeyword = ''
  3973. this.WorktimeDatepickValue = this.istoMonth()
  3974. if(this.WorktimeDatepickValue.length == 0){
  3975. let newdate = new Date();
  3976. let nowdate = newdate.toLocaleDateString();
  3977. let getauto = this.getAutoWeekDate(nowdate)
  3978. let nowwd = [getauto[0],getauto[6]]
  3979. this.WorktimeDatepickValue = nowwd
  3980. }
  3981. this.showMonthWorkTime()
  3982. },
  3983. handleClick(t,e){
  3984. if (t.name == "second") {
  3985. this.showMonthNotWorkTime()
  3986. }else if(t.name == "first"){
  3987. this.showMonthWorkTime()
  3988. }else if(t.name == "third"){
  3989. this.showMonthWorkTimeReminder()
  3990. } else if (t.name == "fourth") {
  3991. this.showReportTimeLessThanCardTimeList();
  3992. }
  3993. },
  3994. //导出员工每日填报工时数
  3995. exportMembWorkHours() {
  3996. this.http.post(
  3997. "/report/exportUserDailyWorkTime",
  3998. {
  3999. // month: this.date,
  4000. startDate: this.WorktimeDatepickValue[0],
  4001. endDate: this.WorktimeDatepickValue[1],
  4002. },
  4003. (res) => {
  4004. if (res.code == "ok") {
  4005. let url = res.data;
  4006. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4007. }
  4008. },
  4009. (error) => {
  4010. this.$message({
  4011. message: error,
  4012. type: "error",
  4013. });
  4014. }
  4015. );
  4016. },
  4017. exportMembWorkHoursReminder() {
  4018. this.http.post(
  4019. "/report/exportUserDailyWorkTimeReminder",
  4020. {
  4021. // month: this.date,
  4022. startDate: this.WorktimeDatepickValue[0],
  4023. endDate: this.WorktimeDatepickValue[1],
  4024. },
  4025. (res) => {
  4026. if (res.code == "ok") {
  4027. let url = res.data;
  4028. this.downloadByA('工时异常表.xlsx', url);
  4029. }
  4030. },
  4031. (error) => {
  4032. this.$message({
  4033. message: error,
  4034. type: "error",
  4035. });
  4036. }
  4037. );
  4038. },
  4039. exportMembNotWorkHours() {
  4040. this.http.post(
  4041. "/report/exportNoReportUserList",
  4042. {
  4043. // month: this.date,
  4044. startDate: this.WorktimeDatepickValue[0],
  4045. endDate: this.WorktimeDatepickValue[1],
  4046. },
  4047. (res) => {
  4048. if (res.code == "ok") {
  4049. let url = res.data;
  4050. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4051. }
  4052. },
  4053. (error) => {
  4054. this.$message({
  4055. message: error,
  4056. type: "error",
  4057. });
  4058. }
  4059. );
  4060. },
  4061. downloadByA(name, url) {
  4062. const a = document.createElement("a"); // 创建a标签
  4063. a.setAttribute("download", name); // download属性
  4064. a.setAttribute("href", url); // href链接
  4065. a.click(); // 自执行点击事件
  4066. a.remove();
  4067. },
  4068. // 是否本月判断
  4069. istoMonth(){
  4070. let todate = new Date()
  4071. let tomonth = todate.getMonth() + 1
  4072. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4073. if(this.date == adate){
  4074. return []
  4075. }else{
  4076. let sedate = new Date(this.date)
  4077. let semonth = sedate.getMonth() + 1
  4078. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4079. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4080. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4081. return [sedates1, sedates2]
  4082. }
  4083. },
  4084. showMonthWorkTime() {
  4085. this.monthTotalPage = 0,
  4086. this.tbload = true
  4087. let parameter={
  4088. startDate: this.WorktimeDatepickValue[0],
  4089. endDate: this.WorktimeDatepickValue[1],
  4090. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4091. }
  4092. this.http.post(
  4093. "/report/getUserDailyWorkTime",
  4094. // "/report/getNoReportUserList",
  4095. parameter,
  4096. (res) => {
  4097. if (res.code == "ok") {
  4098. this.tbload = false;
  4099. this.pickDateArray = res.data.days.map(item => {
  4100. return {
  4101. ...item,
  4102. dateStr: item.label.split('/')[0],
  4103. weekStr: item.label.split('/')[1]
  4104. }
  4105. });
  4106. // console.log('dataarray',res.data.days);
  4107. this.monthWorkData = res.data.list;
  4108. // this.monthWorkDataS = this.monthWorkData
  4109. // this.monthWorkDataS1 = res.data.list
  4110. this.monthTotal = res.data.list.length
  4111. if (this.monthWorkData.length > 50) {
  4112. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4113. }else{
  4114. this.monthWorkDataS = this.monthWorkData
  4115. }
  4116. this.searchScreen(0)
  4117. // this.monthWorkDataS = infoList
  4118. // 判断
  4119. // if (this.monthWorkDataS1.length > 0) {
  4120. // setTimeout(() => {
  4121. // this.tableListener()
  4122. // }, 1000);
  4123. // }
  4124. this.$nextTick(function(){
  4125. this.$refs.hasworkTbl.doLayout();
  4126. });
  4127. // this.$forceUpdate()
  4128. }
  4129. },
  4130. (error) => {
  4131. this.tbload = false
  4132. this.$message({
  4133. message: error,
  4134. type: "error",
  4135. });
  4136. }
  4137. );
  4138. },
  4139. showMonthWorkTimeReminder() {
  4140. this.monthTotalPage = 0,
  4141. this.tbload = true
  4142. let parameter={}
  4143. parameter={
  4144. startDate: this.WorktimeDatepickValue[0],
  4145. endDate: this.WorktimeDatepickValue[1],
  4146. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4147. viewValue:this.isReminder?1:0
  4148. }
  4149. this.http.post(
  4150. "/report/getUserDailyWorkTimeReminder",
  4151. parameter,
  4152. (res) => {
  4153. if (res.code == "ok") {
  4154. this.tbload = false;
  4155. this.monthWorkData = res.data.list;
  4156. this.monthTotal = res.data.list.length
  4157. if (this.monthWorkData.length > 50) {
  4158. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4159. }else{
  4160. this.monthWorkDataS = this.monthWorkData
  4161. }
  4162. this.searchScreen(0)
  4163. this.$nextTick(function(){
  4164. this.$refs.hasworkTbl.doLayout();
  4165. });
  4166. }
  4167. },
  4168. (error) => {
  4169. this.tbload = false
  4170. this.$message({
  4171. message: error,
  4172. type: "error",
  4173. });
  4174. }
  4175. );
  4176. },
  4177. // tableListener(){
  4178. // let that = this;
  4179. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4180. // // 添加scroll监听事件
  4181. // dom.addEventListener("scroll", function () {
  4182. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4183. // if (scrollDistance < 2) {
  4184. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4185. // that.monthTotalPage++; //当前页数自增
  4186. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4187. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4188. // var infoList = arrList.splice(
  4189. // that.monthTotalPage * that.monthTotalLages,
  4190. // that.monthTotalLages
  4191. // );
  4192. // // 数据添加
  4193. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4194. // }
  4195. // }
  4196. // })
  4197. // },
  4198. showMonthNotWorkTime() {
  4199. this.monthTotalPage = 0,
  4200. this.tbload = true,
  4201. this.http.post(
  4202. "/report/getNoReportUserList",
  4203. {
  4204. startDate: this.WorktimeDatepickValue[0],
  4205. endDate: this.WorktimeDatepickValue[1],
  4206. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4207. },
  4208. (res) => {
  4209. if (res.code == "ok") {
  4210. this.tbload = false
  4211. this.monthNotWorkDate = res.data;
  4212. // this.monthNotWorkDateS1 = res.data
  4213. this.monthnotTotal = res.data.length
  4214. // 2222111
  4215. if (this.monthNotWorkDate.length > 50) {
  4216. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4217. } else {
  4218. this.monthNotWorkDateS = this.monthNotWorkDate
  4219. }
  4220. this.searchScreen(1)
  4221. // 判断
  4222. // if (this.monthnotworkDateS1.length > 0) {
  4223. // setTimeout(() => {
  4224. // this.tableListenernot()
  4225. // }, 1000);
  4226. // }
  4227. this.$nextTick(function(){
  4228. this.$refs.hasworkTbl2.doLayout();
  4229. });
  4230. }
  4231. },
  4232. (error) => {
  4233. this.tbload = false
  4234. this.$message({
  4235. message: error,
  4236. type: "error",
  4237. });
  4238. }
  4239. );
  4240. },
  4241. // tableListenernot(){
  4242. // let that = this;
  4243. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4244. // dom.addEventListener("scroll", function () {
  4245. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4246. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4247. // if (scrollDistance2 < 2) {
  4248. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4249. // that.monthnotTotalPage++; //当前页数自增
  4250. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4251. // var infoList = arrList.splice(
  4252. // that.monthnotTotalPage * that.monthnotTotalLages,
  4253. // that.monthnotTotalLages
  4254. // );
  4255. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4256. // }
  4257. // }
  4258. // })
  4259. // },
  4260. listScroll(){
  4261. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4262. this.isMore = true
  4263. setTimeout(()=>{
  4264. this.isMore = false
  4265. },1000)
  4266. }else {
  4267. this.isFlag = true
  4268. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4269. this.monthWorkDataS = datalist
  4270. setTimeout(()=>{
  4271. this.isFlag = false
  4272. },300)
  4273. }
  4274. },
  4275. notListScroll(){
  4276. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4277. this.isMore = true
  4278. setTimeout(()=>{
  4279. this.isMore = false
  4280. },1000)
  4281. }else {
  4282. this.isFlag = true
  4283. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4284. this.monthNotWorkDateS = datalist
  4285. // console.log('length',this.monthNotWorkDateS.length)
  4286. setTimeout(()=>{
  4287. this.isFlag = false
  4288. },300)
  4289. }
  4290. },
  4291. getFirstAndLastDay() {
  4292. // 将选定的月份转换为Date对象
  4293. var monthDate = new Date();
  4294. var year = monthDate.getFullYear();
  4295. var month = monthDate.getMonth();
  4296. // 计算起始日和结束日
  4297. var startDay = new Date(year, month, 1);
  4298. var endDay = new Date(year, month + 1, 0);
  4299. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4300. this.WorktimeDatepickValueForMonth=lastmd
  4301. },
  4302. formatDate(date) {
  4303. var year = date.getFullYear();
  4304. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4305. var day = ("0" + date.getDate()).slice(-2);
  4306. return year + "-" + month + "-" + day;
  4307. },
  4308. // 获取默认这zhou日期参数 222
  4309. getLastWeek(e){
  4310. let newdate = new Date()
  4311. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4312. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4313. if(e==1){
  4314. this.WorktimeDatepickValue = lastwd
  4315. this.showMonthWorkTime()
  4316. }else if(e==2){
  4317. this.WorktimeDatepickValue = lastwd
  4318. this.showMonthWorkTimeReminder()
  4319. }else{
  4320. this.WorktimeDatepickValue = lastwd
  4321. this.showMonthNotWorkTime()
  4322. }
  4323. },
  4324. getThisWeek(e){
  4325. let newdate = new Date();
  4326. let nowdate = newdate.toLocaleDateString();
  4327. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4328. if(e==1){
  4329. this.WorktimeDatepickValue = nowwd
  4330. this.showMonthWorkTime()
  4331. }else if(e==2){
  4332. this.WorktimeDatepickValue = nowwd
  4333. this.showMonthWorkTimeReminder()
  4334. }else{
  4335. this.WorktimeDatepickValue = nowwd
  4336. this.showMonthNotWorkTime()
  4337. }
  4338. },
  4339. getDoubleLastWeek(e){
  4340. let newdate = new Date()
  4341. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4342. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4343. if(e==1){
  4344. this.WorktimeDatepickValue = nextwd
  4345. this.showMonthWorkTime()
  4346. }else if(e==2){
  4347. this.WorktimeDatepickValue = nextwd
  4348. this.showMonthWorkTimeReminder()
  4349. }else{
  4350. this.WorktimeDatepickValue = nextwd
  4351. this.showMonthNotWorkTime()
  4352. }
  4353. },
  4354. alreadyAllDate(stime,etime){
  4355. let diffdate = new Array();
  4356. let i=0;
  4357. while(stime<=etime){
  4358. let dateArray = stime.split("-");
  4359. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4360. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4361. let stimewk = this.weekDay[date.getDay()]
  4362. 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')
  4363. 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])
  4364. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4365. let stime_ts = new Date(stime).getTime();
  4366. let next_date = stime_ts + (24*60*60*1000);
  4367. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4368. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4369. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4370. stime = next_dates_y+next_dates_m+next_dates_d;
  4371. i++;
  4372. }
  4373. return diffdate
  4374. },
  4375. getAutoWeekDate(e) {
  4376. let dateString = e;
  4377. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4378. if (dateString.match(dateStringReg)) {
  4379. let presentDate = new Date(dateString),
  4380. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4381. return Array.from(new Array(7), function (val, index) {
  4382. let formatDate = new Date(
  4383. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4384. );
  4385. return (
  4386. formatDate.getFullYear() +
  4387. "-" +
  4388. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4389. "-" +
  4390. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4391. );
  4392. });
  4393. } else {
  4394. throw new Error(
  4395. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4396. );
  4397. }
  4398. },
  4399. onProgressChange() {
  4400. this.$forceUpdate();
  4401. },
  4402. showChooseMembTree() {
  4403. this.chosenMembCount = this.participator.length;
  4404. this.chooseParticipVisible = true;
  4405. },
  4406. onTreeItemChange() {
  4407. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4408. var list = chosenList.filter(item=>item.isUser == 1);
  4409. this.chosenMembCount = list.length;
  4410. },
  4411. findUserInTree() {
  4412. if (this.filterName == '') {
  4413. this.deptMembData = this.allMembData;
  4414. } else {
  4415. var list = this.findRecursively(this.filterName, this.allMembData);
  4416. this.deptMembData = list;
  4417. }
  4418. },
  4419. findRecursively(username, list) {
  4420. var filterList = [];
  4421. for (var i=0;i<list.length; i++) {
  4422. if (list[i].isUser == 1) {
  4423. if (list[i].label.indexOf(username) >= 0) {
  4424. //匹配上了
  4425. filterList.push(list[i]);
  4426. }
  4427. } else if (list[i].children != null && list[i].children.length > 0) {
  4428. var subList = this.findRecursively(username, list[i].children);
  4429. if (subList.length > 0) {
  4430. subList.forEach(s=>filterList.push(s));
  4431. }
  4432. }
  4433. }
  4434. return filterList;
  4435. },
  4436. //确定选择参与人
  4437. chooseParticip() {
  4438. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4439. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4440. //只能选择一个人进行代填,防止任务有问题
  4441. if (this.chosenMembList.length > 1) {
  4442. this.$message({
  4443. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4444. type: "error",
  4445. });
  4446. return;
  4447. }
  4448. this.chooseParticipVisible = false;
  4449. this.workForm.userNames = '';
  4450. this.workForm.userId = [];
  4451. this.participator = [];
  4452. for (var i=0;i<this.chosenMembList.length; i++) {
  4453. this.workForm.userId.push(this.chosenMembList[i].id);
  4454. this.workForm.userNames += this.chosenMembList[i].label+',';
  4455. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4456. this.participator.push(item);
  4457. }
  4458. if (this.workForm.userNames.length > 0) {
  4459. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4460. }
  4461. if(this.user.userNameNeedTranslate == 1) {
  4462. if(this.workForm.userNames) {
  4463. this.workForm.userNames = this.workForm.userNames.split(',')
  4464. }
  4465. }
  4466. //加载该人员的可填报项目
  4467. if (this.workForm.userId.length > 0) {
  4468. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4469. }
  4470. //打通企业微信考勤的情况,获取考勤
  4471. if (this.user.timeType.showCorpwxCardtime) {
  4472. this.getTargetUserCardTime();
  4473. }
  4474. },
  4475. getTargetUserCardTime() {
  4476. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4477. this.http.post('/user-corpwx-time/getUserCardTime',{
  4478. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4479. },
  4480. res => {
  4481. if (res.code == "ok") {
  4482. this.$set(this.workForm,'time', res.data);
  4483. }
  4484. },
  4485. error => {
  4486. this.$message({
  4487. message: error,
  4488. type: "error"
  4489. });
  4490. }
  4491. );
  4492. }
  4493. },
  4494. notifySel(sel){
  4495. // console.log(sel);
  4496. this.notifySelList = sel
  4497. },
  4498. //微信通知人员填写
  4499. Notify(code) {
  4500. if (this.notifySelList.length == 0) return;
  4501. var ids = '';
  4502. this.notifySelList.forEach(f=>{
  4503. ids += f.id+',';
  4504. })
  4505. this.http.post('/user/pushFillReport',{
  4506. ids: ids, date: this.curDate,
  4507. code: code
  4508. },
  4509. res => {
  4510. if (res.code == "ok") {
  4511. this.$message({
  4512. message: this.$t('message.sentSuccessfully'),
  4513. type: "success"
  4514. });
  4515. }
  4516. },
  4517. error => {
  4518. this.$message({
  4519. message: error,
  4520. type: "error"
  4521. });
  4522. }
  4523. );
  4524. },
  4525. //导出人员列表
  4526. exportMemb() {
  4527. if (this.fillMembList.length == 0) return;
  4528. var ids = '';
  4529. this.fillMembList.forEach(f=>{
  4530. ids += f.id+',';
  4531. })
  4532. this.http.post('/user/exportMembList',{
  4533. ids: ids,isFill: this.isFill, date: this.curDate
  4534. },
  4535. res => {
  4536. if (res.code == "ok") {
  4537. var aTag = document.createElement('a');
  4538. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4539. aTag.href = res.data;
  4540. aTag.click();
  4541. }
  4542. },
  4543. error => {
  4544. this.$message({
  4545. message: error,
  4546. type: "error"
  4547. });
  4548. }
  4549. );
  4550. },
  4551. showMembList(fill) {
  4552. this.membListVisible = true;
  4553. if (fill == 0) {
  4554. this.fillMembList = this.unFillList;
  4555. this.isFill = false;
  4556. let leaveList = []
  4557. let unleaveList = []
  4558. for(let i in this.fillMembList){
  4559. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4560. leaveList.push(this.fillMembList[i])
  4561. }else{
  4562. unleaveList.push(this.fillMembList[i])
  4563. }
  4564. }
  4565. this.fillMembList = unleaveList
  4566. this.fillMembList_leave = leaveList
  4567. } else if(fill == 1){
  4568. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4569. this.isFill = true;
  4570. }else{
  4571. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4572. this.isFill = true;
  4573. }
  4574. },
  4575. //获取自己填写的日报状态
  4576. getReportFillStatus() {
  4577. this.http.post('/report/getReportFillStatus',{
  4578. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4579. },
  4580. res => {
  4581. if (res.code == "ok") {
  4582. this.fillStatusList = res.data;
  4583. this.allDate.forEach(d=>{
  4584. var fillInfo = null;
  4585. d.state = null;
  4586. this.fillStatusList.forEach(s=>{
  4587. var d1 = s.createDate.split('-')[2];
  4588. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4589. if (d1.indexOf('0') == 0) {
  4590. d1 = d1.substring(1,d1.length);
  4591. }
  4592. if (d1 == d2) {
  4593. d.state = s.state;
  4594. d.missReport = s.missReport;//是否漏填
  4595. d.exceedCardTime = s.exceedCardTime
  4596. }
  4597. })
  4598. })
  4599. this.$forceUpdate();
  4600. }
  4601. },
  4602. error => {
  4603. this.$message({
  4604. message: error,
  4605. type: "error"
  4606. });
  4607. }
  4608. );
  4609. },
  4610. scrollFunction () {
  4611. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4612. if (this.domObj.attachEvent) { // IE
  4613. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4614. } else if (this.domObj.addEventListener) {
  4615. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4616. }
  4617. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4618. },
  4619. mouseScroll(event) { // google 浏览器下
  4620. let detail = event.wheelDelta || event.detail
  4621. let moveForwardStep = -1
  4622. let moveBackStep = 1
  4623. let step = 0
  4624. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4625. event.preventDefault() // 阻止浏览器默认事件
  4626. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4627. },
  4628. // //左右滚动
  4629. // wheel(e){
  4630. // var a = document.getElementById("dateScroll");
  4631. // var scroll_width = 80; //滚动一下的距离
  4632. // var e = e || window.event, v;
  4633. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4634. // if(v>3||-v>3) v=-v;
  4635. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4636. // e.preventDefault(); //阻止浏览器的默认滚动
  4637. // },
  4638. showExportDialog() {
  4639. this.exportType = 0
  4640. this.exportDialog = true;
  4641. },
  4642. showExportTimeDialog() {
  4643. this.exportTimeDialog = true;
  4644. },
  4645. changeAllTime() {
  4646. //总时长发生改变,自动按比例计算
  4647. this.workForm.domains.forEach(d=>{
  4648. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4649. });
  4650. //计算jsTime
  4651. if (this.workForm.createDate) {
  4652. let sdate = new Date(this.workForm.createDate[0]);
  4653. let edate = new Date(this.workForm.createDate[1]);
  4654. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4655. if (days < 0) {
  4656. days = 0;
  4657. }
  4658. this.jsTime = this.reportTimeType.allday * days;
  4659. }
  4660. },
  4661. // 是否加班的单机事件
  4662. check() {
  4663. this.selected = !this.selected
  4664. this.isNew = this.selected
  4665. },
  4666. updateSubProject() {
  4667. this.$forceUpdate();
  4668. },
  4669. selectDegreeId(domain, index) {
  4670. this.http.post('/report/defaultDegree',{
  4671. projectId: domain.projectId
  4672. },
  4673. res => {
  4674. if (res.code == "ok") {
  4675. if(res.data) {
  4676. this.workForm.domains[index].degreeId = res.data.id + ''
  4677. this.$forceUpdate();
  4678. }
  4679. }
  4680. },
  4681. error => {
  4682. this.$message({
  4683. message: error,
  4684. type: "error"
  4685. });
  4686. }
  4687. );
  4688. },
  4689. //项目选中了, 加载子项目
  4690. selectProject(domain, index) {
  4691. if(!domain.projectId){
  4692. return;
  4693. }
  4694. // 默认选中上次填写的自定义维度
  4695. if(this.yonghuUser.customDegreeActive == 1) {
  4696. this.selectDegreeId(domain, index)
  4697. }
  4698. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4699. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4700. this.http.post('/sub-project/list',{
  4701. projectId: domain.projectId,
  4702. isReport: true
  4703. },
  4704. res => {
  4705. //清空之前选中的子项目
  4706. // this.workForm.domains[index].subProjectId = 0;
  4707. if (res.code == "ok") {
  4708. this.workForm.domains[index].subProjectList = res.data;
  4709. this.workForm.domains[index].subProjectId = null;
  4710. this.$forceUpdate();
  4711. }
  4712. },
  4713. error => {
  4714. this.$message({
  4715. message: error,
  4716. type: "error"
  4717. });
  4718. }
  4719. );
  4720. //项目相关的近期任务
  4721. if (this.user.company.packageProject == 1) {
  4722. this.getRecentTaskList(domain, index);
  4723. //获取项目相关专业
  4724. if (this.user.company.packageEngineering == 1) {
  4725. this.getProjectProfessions(domain, index);
  4726. }
  4727. //获取项目下的任务分组
  4728. this.getTaskGroups(domain, index);
  4729. }
  4730. // 获取项目相关的维度
  4731. // domain.degreeId = null
  4732. this.$set(domain,'degreeId',null)
  4733. this.$set(domain,'multiDegrIdArray',null)
  4734. this.dimension(domain, index);
  4735. //获取项目审核人
  4736. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4737. this.getProjectAuditorList(domain, index);
  4738. } else {
  4739. //按分组的负责人来审核
  4740. domain.projectAuditorId = null;
  4741. domain.projectAuditorName = null;
  4742. domain.auditUserList = null;
  4743. }
  4744. if (this.reportTimeType.type == 3) {
  4745. //新增项目时,自动计算
  4746. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4747. }
  4748. //加载昱众的工作职责
  4749. if (this.user.companyId == this.yuzhongCompId) {
  4750. this.updateResponse(domain);
  4751. }
  4752. },
  4753. getRecentTaskList(domain, index) {
  4754. //刷新任务时,清空服务
  4755. this.$set(domain, 'sapServiceId', null);
  4756. this.$set(domain, 'taskId', null);
  4757. var param = {
  4758. projectId: domain.projectId,
  4759. isSubstitude:this.isSubstitude?1:0,
  4760. };
  4761. if (domain.groupId) {
  4762. param.groupId = domain.groupId;
  4763. }
  4764. if (domain.stage) {
  4765. param.stage = domain.stage;
  4766. }
  4767. //专业版代填,获取代填员工的任务
  4768. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4769. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4770. this.$message({
  4771. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4772. type: "error"
  4773. });
  4774. return;
  4775. } else {
  4776. param.userId = this.workForm.userId[0];
  4777. }
  4778. }
  4779. this.http.post('/task/getRecentTask',param,
  4780. res => {
  4781. if (res.code == "ok") {
  4782. this.workForm.domains[index].allTaskList = res.data;
  4783. this.workForm.domains[index].taskList = res.data;
  4784. this.$forceUpdate();
  4785. }
  4786. },
  4787. error => {
  4788. this.$message({
  4789. message: error,
  4790. type: "error"
  4791. });
  4792. }
  4793. );
  4794. },
  4795. //获取项目审核人
  4796. getProjectAuditorList(domainItem, index) {
  4797. if(domainItem.projectId == '') {
  4798. return
  4799. }
  4800. domainItem.projectAuditorId = null;
  4801. domainItem.projectAuditorName = null;
  4802. var param = { projectId: domainItem.projectId};
  4803. if (this.isSubstitude) {
  4804. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4805. param.userId = this.workForm.userId[0];
  4806. }
  4807. }
  4808. this.http.post('/project-auditor/getList',param,
  4809. res => {
  4810. if (res.code == "ok") {
  4811. domainItem.auditUserList = res.data;
  4812. if (res.data.length==0) {
  4813. this.$message({
  4814. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4815. type: "error"
  4816. });
  4817. } else if (res.data.length==1) {
  4818. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4819. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4820. }
  4821. this.$forceUpdate();
  4822. }
  4823. },
  4824. error => {
  4825. this.$message({
  4826. message: error,
  4827. type: "error"
  4828. });
  4829. }
  4830. );
  4831. },
  4832. // 获取维度数据
  4833. dimension(domain, index) {
  4834. if(domain.projectId == '') {
  4835. return
  4836. }
  4837. this.http.post('/project/getDegreeList',{
  4838. projectId: domain.projectId,
  4839. },
  4840. res => {
  4841. if (res.code == "ok") {
  4842. // console.log("维度数据",res.data);
  4843. this.workForm.domains[index].wuduList = res.data
  4844. // this.workForm = this.workForm
  4845. this.$forceUpdate()
  4846. }
  4847. },
  4848. error => {
  4849. this.$message({
  4850. message: error,
  4851. type: "error"
  4852. });
  4853. }
  4854. );
  4855. },
  4856. //切换任务阶段
  4857. changeStages(domain, index) {
  4858. if (domain.stage == null || domain.stage == '') {
  4859. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4860. } else {
  4861. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4862. }
  4863. this.getRecentTaskList(domain, index);
  4864. this.$forceUpdate();
  4865. },
  4866. getGroupStages(domain, index, keepStage) {
  4867. // console.log(domain);
  4868. if(!domain.groupId){
  4869. domain.projectAuditorId = ''
  4870. domain.stages = []
  4871. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4872. domain.taskId = ''
  4873. domain.sapServiceId = ''
  4874. }
  4875. if(this.user.timeType.reportAuditType >= 1){
  4876. domain.auditUserList = []
  4877. }
  4878. this.$forceUpdate();
  4879. return
  4880. }
  4881. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4882. res => {
  4883. if (res.code == "ok") {
  4884. if (!keepStage) {
  4885. domain.stage = '';
  4886. }
  4887. domain.stages = res.data;
  4888. this.getRecentTaskList(domain, index);
  4889. this.$forceUpdate();
  4890. }
  4891. },
  4892. error => {
  4893. this.$message({
  4894. message: error,
  4895. type: "error"
  4896. });
  4897. });
  4898. //检查当前的项目是否需要获取分组的负责人
  4899. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4900. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4901. res => {
  4902. if (res.code == "ok") {
  4903. domain.getProjectAuditorList = res.data;
  4904. domain.auditUserList = res.data;
  4905. if (res.data.length==1) {
  4906. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4907. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4908. } else if (res.data.length==0) {
  4909. domain.projectAuditorId = null;
  4910. domain.projectAuditorName = null;
  4911. }
  4912. this.$forceUpdate();
  4913. }
  4914. },
  4915. error => {
  4916. this.$message({
  4917. message: error,
  4918. type: "error"
  4919. });
  4920. });
  4921. }
  4922. },
  4923. getProjectProfessions(domain, index) {
  4924. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4925. res => {
  4926. if (res.code == "ok") {
  4927. this.workForm.domains[index].professionProgress = res.data;
  4928. this.$forceUpdate();
  4929. }
  4930. },
  4931. error => {
  4932. this.$message({
  4933. message: error,
  4934. type: "error"
  4935. });
  4936. });
  4937. },
  4938. //删除自己的日报
  4939. deleteReport() {
  4940. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4941. confirmButtonText: this.$t('btn.determine'),
  4942. cancelButtonText: this.$t('btn.cancel'),
  4943. type: "warning"
  4944. })
  4945. .then(() => {
  4946. this.listLoading = true;
  4947. this.http.post('/report/delete',{
  4948. userId: this.user.id,
  4949. date: this.workForm.createDate
  4950. },
  4951. res => {
  4952. this.listLoading = false;
  4953. if (res.code == "ok") {
  4954. this.$message({
  4955. message: this.$t('message.successfullyDeleted'),
  4956. type: "success"
  4957. });
  4958. this.getReportList();
  4959. this.getDepartment();
  4960. this.dialogVisible = false;
  4961. } else {
  4962. this.$message({
  4963. message: res.msg,
  4964. type: "error"
  4965. });
  4966. }
  4967. },
  4968. error => {
  4969. this.listLoading = false;
  4970. this.$message({
  4971. message: error,
  4972. type: "error"
  4973. });
  4974. }
  4975. );
  4976. })
  4977. .catch(() => {});
  4978. },
  4979. // 管理员删除日报
  4980. guanli(item) {
  4981. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4982. let param = {date: this.date + day, userId: item.id};
  4983. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4984. confirmButtonText: this.$t('btn.determine'),
  4985. cancelButtonText: this.$t('btn.cancel'),
  4986. type: "warning"
  4987. })
  4988. .then(() => {
  4989. this.listLoading = true;
  4990. this.http.post('/report/delete',param,
  4991. res => {
  4992. this.listLoading = false;
  4993. if (res.code == "ok") {
  4994. this.$message({
  4995. message: this.$t('message.successfullyDeleted'),
  4996. type: "success"
  4997. });
  4998. this.getReportList();
  4999. this.getDepartment();
  5000. this.dialogVisible = false;
  5001. } else {
  5002. this.$message({
  5003. message: res.msg,
  5004. type: "error"
  5005. });
  5006. }
  5007. },
  5008. error => {
  5009. this.listLoading = false;
  5010. this.$message({
  5011. message: error,
  5012. type: "error"
  5013. });
  5014. }
  5015. );
  5016. })
  5017. .catch(() => {});
  5018. },
  5019. selectAll() {
  5020. if (this.isAllSelect) {
  5021. var keys = [];
  5022. this.reportNames.forEach(b=>{
  5023. keys.push(b.id);
  5024. })
  5025. this.$refs.approveTree.setCheckedKeys(keys);
  5026. } else {
  5027. this.$refs.approveTree.setCheckedKeys([]);
  5028. }
  5029. },
  5030. removeEmptyNode(list) {
  5031. for (var i=0;i<list.length;i++) {
  5032. var cnt = 0;
  5033. if (list[i].membCount == 0) {
  5034. list.splice(i, 1);
  5035. i--;
  5036. } else if (list[i].children != null) {
  5037. this.removeEmptyNode(list[i].children);
  5038. }
  5039. }
  5040. },
  5041. calculateMembCount(list) {
  5042. for (var i in list) {
  5043. var cnt = 0;
  5044. if (list[i].children != null) {
  5045. this.calculateMembCount(list[i].children);
  5046. for (var m in list[i].children) {
  5047. cnt += list[i].children[m].membCount;
  5048. }
  5049. }
  5050. if (list[i].isUser == 1) {
  5051. cnt++;
  5052. this.membCount++;
  5053. }
  5054. list[i].membCount = cnt;
  5055. }
  5056. },
  5057. stateChange() {
  5058. // console.log(this.allData,'alldate');
  5059. this.membCount = 0;
  5060. if (this.selectState == -1) {
  5061. //全部状态
  5062. this.data = this.allData;
  5063. } else {
  5064. //未填报
  5065. this.seluserText = ''
  5066. var newData = JSON.parse(JSON.stringify(this.allData));
  5067. this.filterState(this.selectState, newData);
  5068. this.data = newData;
  5069. }
  5070. this.calculateMembCount(this.data);
  5071. this.data[0].membCount = this.membCount;//总人数
  5072. },
  5073. //按状态过滤部门人员
  5074. filterState(state, list) {
  5075. for (var i =0;i<list.length; i++) {
  5076. var obj = list[i];
  5077. if (obj.isUser == 1) {
  5078. var match = false;
  5079. if (state == -2) {
  5080. if (obj.state == null) {
  5081. match = true;
  5082. }
  5083. } else {
  5084. if (obj.state == state) {
  5085. match = true;
  5086. }
  5087. }
  5088. if (!match) {
  5089. list.splice(i, 1);
  5090. i--;
  5091. } else {
  5092. }
  5093. } else {
  5094. if (obj.children != null) {
  5095. this.filterState(state, obj.children);
  5096. }
  5097. }
  5098. }
  5099. },
  5100. //a按名称过滤部门人员
  5101. async seluserforText(){
  5102. const { userNameNeedTranslate } = this.user
  5103. this.membCount = 0;
  5104. var newData = JSON.parse(JSON.stringify(this.allData));
  5105. let textList = [this.seluserText]
  5106. if(userNameNeedTranslate == 1) {
  5107. this.dataLoading = true
  5108. let res = await this.postData('/user/getEmployeeList', {
  5109. keyword: this.seluserText,
  5110. cursor: '',
  5111. departmentId: -1,
  5112. pageIndex: 1,
  5113. pageSize: 1000
  5114. })
  5115. textList = res.data.records.map(item => item.name)
  5116. this.dataLoading = false
  5117. }
  5118. // return
  5119. this.seluserforTextin(this.seluserText, newData, textList)
  5120. this.data = newData;
  5121. this.calculateMembCount(this.data);
  5122. this.data[0].membCount = this.membCount;//总人数
  5123. },
  5124. seluserforTextin(text, list, textList = []){
  5125. for (var i =0;i<list.length; i++) {
  5126. var obj = list[i];
  5127. if (obj.isUser == 1) {
  5128. var match = false;
  5129. // if (obj.label.indexOf(text) != -1) {
  5130. // match = true
  5131. // }
  5132. if(textList.some(item => item.includes(obj.label))) {
  5133. match = true
  5134. }
  5135. if (!match) {
  5136. list.splice(i, 1);
  5137. i--;
  5138. } else {
  5139. }
  5140. } else {
  5141. if (obj.children != null) {
  5142. this.seluserforTextin(text, obj.children, textList);
  5143. }
  5144. }
  5145. }
  5146. },
  5147. // 当节点发生变化时
  5148. nodeChangeExpand(data) {
  5149. // 保存当前展开的节点
  5150. let flag = false
  5151. this.nodeModelData.some(item => {
  5152. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5153. flag = true
  5154. return true
  5155. }
  5156. })
  5157. if (!flag) { // 不存在则存到数组里
  5158. this.nodeModelData.push(data.id)
  5159. }
  5160. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5161. },
  5162. nodeChangeCollapse(data) {
  5163. this.nodeModelData.some((item, i) => {
  5164. if (item === data.id) {
  5165. this.nodeModelData.length = i
  5166. }
  5167. })
  5168. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5169. },
  5170. // 部门列表点击
  5171. handleNodeClick(data) {
  5172. // this.dealList = data
  5173. this.theValues(data.id, this.allData)
  5174. // this.depData = data;
  5175. var list = [];
  5176. if (data.id == -1) {
  5177. this.deptId = null;
  5178. this.targetUid = null;
  5179. list = this.data;
  5180. } else if (data.isUser == 1) {
  5181. this.deptId = null;
  5182. this.targetUid = data.id;
  5183. } else {
  5184. this.deptId = data.id;
  5185. this.targetUid = null;
  5186. list.push(data);
  5187. }
  5188. this.getReportList();
  5189. if (list.length > 0) {
  5190. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5191. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5192. }
  5193. },
  5194. exportPushLog(){
  5195. this.http.post('/sap-sync-log/export',{},
  5196. res => {
  5197. if (res.code == "ok") {
  5198. var filePath = res.data;
  5199. var fName = '推送日志.xlsx'
  5200. const a = document.createElement('a'); // 创建a标签
  5201. a.setAttribute('download', fName);// download属性
  5202. a.setAttribute('href', filePath);// href链接
  5203. a.click(); //自执行点击事件
  5204. a.remove();
  5205. } else {
  5206. this.$message({
  5207. message: res.msg,
  5208. type: "error"
  5209. });
  5210. }
  5211. },
  5212. error => {
  5213. this.$message({
  5214. message: error,
  5215. type: "error"
  5216. });
  5217. });
  5218. },
  5219. theValues(id, item) {
  5220. for(var i in item) {
  5221. if(item[i].id == id) {
  5222. this.depData = item[i]
  5223. if(id == '-1') {
  5224. this.translation = '1'
  5225. } else {
  5226. if(item[i].children) {
  5227. this.translation = '2'
  5228. } else {
  5229. this.translation = '3'
  5230. }
  5231. }
  5232. return
  5233. } else {
  5234. if(item[i].children) {
  5235. this.theValues(id, item[i].children)
  5236. }
  5237. }
  5238. }
  5239. },
  5240. //获取可以选择的代填的人员列表
  5241. getSubstitudeUserDeptList() {
  5242. if (this.deptMembData.length == 0) {
  5243. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5244. res => {
  5245. if (res.code == "ok") {
  5246. let noAllData = JSON.parse(JSON.stringify(res.data));
  5247. if (noAllData.length > 0) {
  5248. // if (noAllData[0].label == '全部人员') {
  5249. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5250. noAllData.splice(0,1);
  5251. }
  5252. }
  5253. this.setUserToDept(noAllData);
  5254. this.deptMembData = noAllData;
  5255. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5256. } else {
  5257. this.$message({
  5258. message: res.msg,
  5259. type: "error"
  5260. });
  5261. }
  5262. },
  5263. error => {
  5264. this.$message({
  5265. message: error,
  5266. type: "error"
  5267. });
  5268. });
  5269. }
  5270. },
  5271. // 获取部门列表
  5272. getDepartmentForApprove() {
  5273. this.http.post( this.port.manage.depList, {},
  5274. res => {
  5275. if (res.code == "ok") {
  5276. var list1 = JSON.parse(JSON.stringify(res.data));
  5277. this.deptOptionList = this.changeArr(list1);
  5278. } else {
  5279. this.$message({
  5280. message: res.msg,
  5281. type: "error"
  5282. });
  5283. }
  5284. },
  5285. error => {
  5286. this.$message({
  5287. message: error,
  5288. type: "error"
  5289. });
  5290. });
  5291. },
  5292. // 获取部门列表
  5293. getDepartment() {
  5294. //如果没有权限,就不需要获取
  5295. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5296. return;
  5297. }
  5298. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5299. var param = {date:this.date + day};
  5300. this.http.post("/report/getMembList", param,
  5301. res => {
  5302. if (res.code == "ok") {
  5303. if(res.data.length == 0){
  5304. return
  5305. }
  5306. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5307. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5308. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5309. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5310. // if (this.user.role > 0) {
  5311. // }
  5312. list.splice(0,0,{
  5313. id: -1,
  5314. label: this.$t('lable.allStaff'),
  5315. })
  5316. this.membCount = 0;
  5317. //设置员工到部门下面
  5318. this.setUserToDept(list);
  5319. this.data = list;
  5320. // console.log('data',this.data);
  5321. this.expandDate = [this.data[1].id]
  5322. this.allData = list;
  5323. // if (noAllData.length > 0) {
  5324. // if (noAllData[0].label == '全部人员') {
  5325. // noAllData.splice(0,1);
  5326. // }
  5327. // }
  5328. // this.setUserToDept(noAllData);
  5329. // this.deptMembData = noAllData;
  5330. this.option = this.changeArr(list1);
  5331. list[0].membCount = this.membCount;
  5332. if (this.depData.id == -1) {
  5333. this.depData.membCount = this.membCount;
  5334. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5335. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5336. } else {
  5337. if (this.depData.isUser == null) {
  5338. var dep = this.findTargetDept(this.data, this.depData.id);
  5339. var membDeptList = [];
  5340. membDeptList.push(dep);
  5341. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5342. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5343. }
  5344. }
  5345. if (this.depData.isUser == null) {
  5346. if (this.isFill) {
  5347. this.fillMembList = this.fillList;
  5348. } else {
  5349. this.fillMembList = this.unFillList;
  5350. }
  5351. }
  5352. this.leaveAllNum = 0
  5353. for(let i in this.unFillList){
  5354. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5355. this.leaveAllNum += 1
  5356. }
  5357. }
  5358. this.stateChange()
  5359. } else {
  5360. this.$message({
  5361. message: res.msg,
  5362. type: "error"
  5363. });
  5364. }
  5365. },
  5366. error => {
  5367. this.$message({
  5368. message: error,
  5369. type: "error"
  5370. });
  5371. });
  5372. this.getReportFillStatus();
  5373. },
  5374. findTargetDept(list, deptId) {
  5375. var t = null;
  5376. for (var i=0;i<list.length; i++) {
  5377. if (list[i].isUser == null && list[i].id == deptId) {
  5378. t = list[i];
  5379. break;
  5380. }
  5381. }
  5382. if (t == null) {
  5383. for (var i=0;i<list.length; i++) {
  5384. if (list[i].children != null && list[i].children.length > 0) {
  5385. t = this.findTargetDept(list[i].children, deptId);
  5386. if (t != null) {
  5387. break;
  5388. }
  5389. }
  5390. }
  5391. }
  5392. return t;
  5393. },
  5394. getUserMembListFromDeptList(list, isFill) {
  5395. var membList = [];
  5396. for (var i in list) {
  5397. var deptName = list[i].label;
  5398. if (list[i].userList != null) {
  5399. list[i].userList.forEach(element => {
  5400. if (isFill == 0) {
  5401. //获取未填的
  5402. if (element.state == null) {
  5403. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5404. membList.push(obj);
  5405. }
  5406. } else {
  5407. if (element.state != null) {
  5408. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5409. membList.push(obj);
  5410. }
  5411. }
  5412. });
  5413. }
  5414. if (list[i].children != null) {
  5415. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5416. }
  5417. }
  5418. return membList;
  5419. },
  5420. setUserToDept(list) {
  5421. for (var i in list) {
  5422. var cnt = 0;
  5423. if (list[i].children != null) {
  5424. this.setUserToDept(list[i].children);
  5425. for (var m in list[i].children) {
  5426. cnt += list[i].children[m].membCount;
  5427. }
  5428. }
  5429. if (list[i].userList != null) {
  5430. if (list[i].children == null) {
  5431. list[i].children = [];
  5432. }
  5433. list[i].userList.forEach(element => {
  5434. var obj = {
  5435. id: element.id,
  5436. label:element.name,
  5437. state:element.state,
  5438. parentId:element.departmentId,
  5439. isUser:1,
  5440. workingTime: element.workingTime,
  5441. leaveDays: element.leaveDays,
  5442. leaveTimes: element.leaveTimes
  5443. };
  5444. list[i].children.push(obj);
  5445. this.membCount++;
  5446. cnt++;
  5447. });
  5448. }
  5449. list[i].membCount = cnt;
  5450. }
  5451. },
  5452. // 修改数组
  5453. changeArr(arr) {
  5454. for (var i = 0; i < arr.length; i++) {
  5455. if(arr[i].id != -1 && arr[i].id != 0) {
  5456. if (arr[i].children != null && arr[i].children.length>0) {
  5457. arr[i].children = this.changeArr(arr[i].children);
  5458. }
  5459. arr[i].id && (arr[i].value = arr[i].id);
  5460. delete arr[i].id;
  5461. }
  5462. }
  5463. for(var i in arr) {
  5464. if(arr[i].id == -1 || arr[i].id == 0) {
  5465. arr.splice(i,1)
  5466. }
  5467. }
  5468. return arr;
  5469. },
  5470. //时间段范围设置改动,监听
  5471. onTimeTypeChange(timeType) {
  5472. this.seleChn(1)
  5473. this.showAddMore = true;
  5474. for(var i in this.workForm.domains) {
  5475. if (this.workForm.domains[i].timeType == 0) {
  5476. this.showAddMore = false;
  5477. break;
  5478. }
  5479. }
  5480. if (this.showAddMore) {
  5481. //检测数量
  5482. if (this.workForm.domains.length == 2) {
  5483. this.showAddMore = false;
  5484. } else {
  5485. this.showAddMore = true;
  5486. }
  5487. }
  5488. },
  5489. getTimeType() {
  5490. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5491. res => {
  5492. if (res.code == "ok") {
  5493. var t = res.data;
  5494. this.reportTimeType = t;
  5495. if (this.reportTimeType.type > 0) {
  5496. this.showAddMore = true;
  5497. }
  5498. //转化时间格式
  5499. if (t.allday != null) {
  5500. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5501. }
  5502. if (t.am != null) {
  5503. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5504. }
  5505. if (t.pm != null) {
  5506. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5507. }
  5508. let arr = []
  5509. for(var i in res.data.excludeTimeList) {
  5510. let obj = {
  5511. s: res.data.excludeTimeList[i].startTime,
  5512. e: res.data.excludeTimeList[i].endTime,
  5513. }
  5514. arr.push(obj)
  5515. }
  5516. this.vacationTime = arr
  5517. } else {
  5518. this.$message({
  5519. message: res.msg,
  5520. type: "error"
  5521. });
  5522. }
  5523. },
  5524. error => {
  5525. this.listLoading = false;
  5526. this.$message({
  5527. message: error,
  5528. type: "error"
  5529. });
  5530. });
  5531. },
  5532. // 改变月份 -------
  5533. changeMonthOut() {
  5534. this.getAllDate();
  5535. this.getReportList();
  5536. this.getDepartment();
  5537. },
  5538. // 选择日期
  5539. choseDate(i, item) {
  5540. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5541. return
  5542. }
  5543. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5544. this.choseDay = i;
  5545. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5546. sessionStorage.msg = this.date + day,
  5547. this.getReportList();
  5548. this.getDepartment();
  5549. this.curDate = item.date;
  5550. },
  5551. canClick(i, item){
  5552. let nowDate = new Date()
  5553. let nowDateYear = nowDate.getFullYear()
  5554. let itemYear = parseInt(this.date.split('-')[0])
  5555. let nowDateMonth = nowDate.getMonth() + 1
  5556. let itemMonth = parseInt(this.date.split('-')[1])
  5557. let nowDateDay = nowDate.getDate()
  5558. let itemDay = parseInt(item.showDate.split('.')[1])
  5559. if(nowDateYear < itemYear){
  5560. return false
  5561. }else if(nowDateYear == itemYear){
  5562. if(nowDateMonth < itemMonth){
  5563. return false
  5564. }else if(nowDateMonth == itemMonth){
  5565. if(nowDateDay < itemDay){
  5566. return false
  5567. }
  5568. }
  5569. }
  5570. },
  5571. // 获取日期列表
  5572. getAllDate(e) {
  5573. var dayArry = [];
  5574. var day = this.getCountDays();
  5575. let curMonthDay = null;
  5576. for (var k = 1; k <= day; k++) {
  5577. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5578. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5579. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5580. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5581. if(sessionStorage.msg) {
  5582. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5583. this.choseDay = k - 1;
  5584. curMonthDay = str;
  5585. }
  5586. } else {
  5587. if (new Date().getDate() == k) {
  5588. this.choseDay = k - 1;
  5589. }
  5590. }
  5591. } else {
  5592. this.choseDay = 0;
  5593. }
  5594. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5595. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5596. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5597. }
  5598. this.allDate = dayArry;
  5599. //不能超过最大日期
  5600. if (this.choseDay > day-1) {
  5601. this.choseDay = day-1;
  5602. }
  5603. if(sessionStorage.from != 1){
  5604. let nowmonth = new Date().getMonth() + 1
  5605. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5606. let nowdate = new Date().getDate()
  5607. if(nowd == this.date){
  5608. if(e && sessionStorage.msg){
  5609. }else{
  5610. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5611. }
  5612. let nowday = new Date(sessionStorage.msg).getDate()
  5613. this.choseDay = nowday - 1
  5614. let monthdate = new Date(sessionStorage.msg)
  5615. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5616. }else{
  5617. if(e && sessionStorage.msg){
  5618. }else{
  5619. sessionStorage.msg = this.date + '-01'
  5620. }
  5621. let monthdate = new Date(sessionStorage.msg)
  5622. this.choseDay = monthdate.getDate() - 1
  5623. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5624. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5625. }
  5626. }else{
  5627. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5628. }
  5629. //从消息点击跳转过来的,直接加载指定日期
  5630. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5631. this.curDate = sessionStorage.msg;
  5632. sessionStorage.from = 0;
  5633. } else {
  5634. // if (curMonthDay != null) {
  5635. // // this.curDate = curMonthDay;
  5636. // let d = new Date(sessionStorage.msg)
  5637. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5638. // } else {
  5639. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5640. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5641. // }
  5642. }
  5643. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5644. // if(!sessionStorage.msg){
  5645. // let msgday = this.choseDay + 1
  5646. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5647. // }
  5648. this.getReportFillStatus();
  5649. },
  5650. getCountDays() {
  5651. var newstr = this.date.replace(/-/g, "/");
  5652. var curDate = new Date(newstr+'/01');
  5653. var curMonth = curDate.getMonth();
  5654. curDate.setMonth(curMonth + 1);
  5655. curDate.setDate(0);
  5656. return curDate.getDate();
  5657. },
  5658. reqMore() {
  5659. if (this.hasMore) {
  5660. this.pageIndex++;
  5661. this.requestHttpReports();
  5662. }
  5663. },
  5664. //加载日报数据
  5665. requestHttpReports() {
  5666. //请求数据
  5667. this.listLoading = true;
  5668. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5669. let param = {date: this.date + day};
  5670. if (this.deptId) {
  5671. param.deptId = this.deptId;
  5672. }
  5673. if (this.targetUid) {
  5674. param.userId = this.targetUid;
  5675. }
  5676. //传页码
  5677. if (this.hasMore) {
  5678. param.pageIndex = this.pageIndex;
  5679. }
  5680. this.http.post( this.port.report.list, param,
  5681. res => {
  5682. this.listLoading = false;
  5683. if (res.code == "ok") {
  5684. //扩增
  5685. if (res.data.data.length > 0) {
  5686. this.reportList = this.reportList.concat(res.data.data);
  5687. } else if (this.pageIndex > 1){
  5688. this.$message({
  5689. message: this.$t('meiYouGengDuoShuJuLe'),
  5690. type: "info"
  5691. });
  5692. }
  5693. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5694. if(document.querySelector("#day"+this.choseDay)){
  5695. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5696. }
  5697. } else {
  5698. this.$message({
  5699. message: res.msg,
  5700. type: "error"
  5701. });
  5702. }
  5703. },
  5704. error => {
  5705. this.listLoading = false;
  5706. this.$message({
  5707. message: error,
  5708. type: "error"
  5709. });
  5710. });
  5711. },
  5712. //获取日报列表
  5713. getReportList() {
  5714. //初始化,重置数据
  5715. this.pageIndex = 0;
  5716. this.hasMore = true;
  5717. this.reportList = [];
  5718. this.requestHttpReports();
  5719. },
  5720. //刷新日报状态,用于审核后更新
  5721. refreshReportData(reportId) {
  5722. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5723. res => {
  5724. if (res.code == "ok") {
  5725. for (var m=0;m<this.reportList.length; m++) {
  5726. var d = this.reportList[m].data;
  5727. var find = d.filter(r=>r.id == reportId);
  5728. if (find.length > 0) {
  5729. find[0].state = res.data.state;
  5730. if (find[0].state == 2) {//被驳回,要可以编辑
  5731. this.reportList[m].state = 2;
  5732. }
  5733. find[0].isDeptAudit = res.data.isDeptAudit;
  5734. find[0].departmentAuditState = res.data.departmentAuditState;
  5735. find[0].projectAuditorName = res.data.projectAuditorName;
  5736. find[0].projectAuditorId = res.data.projectAuditorId;
  5737. find[0].projectAuditState = res.data.projectAuditState;
  5738. find[0].rejectUserid = res.data.rejectUserid;
  5739. find[0].rejectUsername = res.data.rejectUsername;
  5740. find[0].rejectReason = res.data.rejectReason;
  5741. this.$forceUpdate();
  5742. break;
  5743. }
  5744. }
  5745. } else {
  5746. this.$message({
  5747. message: res.msg,
  5748. type: "error"
  5749. });
  5750. }
  5751. },
  5752. error => {
  5753. this.listLoading = false;
  5754. this.$message({
  5755. message: error,
  5756. type: "error"
  5757. });
  5758. });
  5759. },
  5760. //导出员工工时统计
  5761. exportUserTime() {
  5762. this.listLoading = true;
  5763. var param = {};
  5764. if (this.exportParam.dateRange != null) {
  5765. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5766. }
  5767. this.http.post('/department/exportDeptStatistic', param,
  5768. res => {
  5769. this.listLoading = false;
  5770. if (res.code == "ok") {
  5771. location.href = res.data;
  5772. this.exportTimeDialog = false;
  5773. } else {
  5774. this.$message({
  5775. message: res.msg,
  5776. type: "error"
  5777. });
  5778. }
  5779. },
  5780. error => {
  5781. this.listLoading = false;
  5782. this.$message({
  5783. message: error,
  5784. type: "error"
  5785. });
  5786. });
  5787. },
  5788. //导出日报
  5789. exportReport() {
  5790. this.exportingData = true;
  5791. var param = {};
  5792. if (this.exportParam.dateRange != null) {
  5793. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5794. }
  5795. if (this.exportParam.projectId != null) {
  5796. param.projectId = this.exportParam.projectId;
  5797. }
  5798. if (this.exportParam.departmentId != null) {
  5799. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5800. param.departmentIds = this.exportParam.departmentId.join(',')
  5801. }
  5802. param.stateKey = this.stateKey
  5803. // param.departmentId = this.user.departmentId
  5804. this.http.post(this.port.report.export, param,
  5805. res => {
  5806. this.exportingData = false;
  5807. if (res.code == "ok") {
  5808. var filePath = res.data;
  5809. const a = document.createElement('a'); // 创建a标签
  5810. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5811. a.setAttribute('href', filePath);// href链接
  5812. a.click(); //自执行点击事件
  5813. a.remove();
  5814. this.exportDialog = false;
  5815. } else {
  5816. this.$message({
  5817. message: res.msg,
  5818. type: "error"
  5819. });
  5820. }
  5821. },
  5822. error => {
  5823. this.exportingData = false;
  5824. this.$message({
  5825. message: error,
  5826. type: "error"
  5827. });
  5828. });
  5829. },
  5830. //导出日报审核记录
  5831. exportReportLog() {
  5832. this.exportingData = true;
  5833. var param = {};
  5834. if (this.exportReportLogParam.dateRange != null) {
  5835. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5836. }
  5837. this.http.post('/report-log/exportReportLog', param,
  5838. res => {
  5839. this.exportingData = false;
  5840. if (res.code == "ok") {
  5841. var filePath = res.data;
  5842. const a = document.createElement('a'); // 创建a标签
  5843. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5844. a.setAttribute('href', filePath);// href链接
  5845. a.click(); //自执行点击事件
  5846. a.remove();
  5847. this.exportDialog = false;
  5848. } else {
  5849. this.$message({
  5850. message: res.msg,
  5851. type: "error"
  5852. });
  5853. }
  5854. },
  5855. error => {
  5856. this.exportingData = false;
  5857. this.$message({
  5858. message: error,
  5859. type: "error"
  5860. });
  5861. });
  5862. },
  5863. restUserCardTime(item){
  5864. let param={}
  5865. param.userId=item.userId
  5866. param.createDate=item.createDate
  5867. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5868. res => {
  5869. if (res.code == "ok") {
  5870. this.showMonthWorkTimeReminder()
  5871. } else {
  5872. this.$message({
  5873. message: res.msg,
  5874. type: "error"
  5875. });
  5876. }
  5877. },
  5878. error => {
  5879. this.$message({
  5880. message: error,
  5881. type: "error"
  5882. });
  5883. });
  5884. },
  5885. importReportLog(item){
  5886. //首先判断文件类型
  5887. let str = item.file.name.split(".");
  5888. let format = str[str.length - 1];
  5889. if (format != "xls" && format != "xlsx") {
  5890. this.$message({
  5891. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5892. type: "error"
  5893. });
  5894. } else {
  5895. const loading = this.$loading({
  5896. lock: true,
  5897. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5898. spinner: 'el-icon-loading',
  5899. background: 'rgba(0, 0, 0, 0.7)'
  5900. });
  5901. let formData = new FormData();
  5902. formData.append("multipartFile", item.file);
  5903. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5904. res => {
  5905. this.$refs.upload.clearFiles();
  5906. loading.close();
  5907. if (res.code == "ok") {
  5908. this.$message({
  5909. message: res.msg,
  5910. type: "success"
  5911. });
  5912. } else {
  5913. this.$message({
  5914. message: res.msg,
  5915. type: "error"
  5916. });
  5917. }
  5918. },
  5919. error => {
  5920. this.$refs.upload.clearFiles();
  5921. loading.close();
  5922. this.$message({
  5923. message: error,
  5924. type: "error"
  5925. });
  5926. });
  5927. }
  5928. },
  5929. //获取项目列表
  5930. getProjectList() {
  5931. this.listLoading = true;
  5932. this.http.post( this.port.project.list, {},
  5933. res => {
  5934. this.listLoading = false;
  5935. if (res.code == "ok") {
  5936. for(var i in res.data) {
  5937. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5938. res.data[i].projectCode = ''
  5939. }
  5940. }
  5941. this.projectList = res.data;
  5942. } else {
  5943. this.$message({
  5944. message: res.msg,
  5945. type: "error"
  5946. });
  5947. }
  5948. },
  5949. error => {
  5950. this.listLoading = false;
  5951. this.$message({
  5952. message: error,
  5953. type: "error"
  5954. });
  5955. });
  5956. },
  5957. getSubUsersFillProjectList(userId) {
  5958. this.http.post( this.port.project.list, {
  5959. forReport: 1,
  5960. userId: userId
  5961. },res => {
  5962. if (res.code == "ok") {
  5963. for(var i in res.data) {
  5964. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5965. res.data[i].projectCode = ''
  5966. }
  5967. }
  5968. this.subFillProjectList = res.data;
  5969. this.getRecentlyProject(userId)
  5970. } else {
  5971. this.$message({
  5972. message: res.msg,
  5973. type: "error"
  5974. });
  5975. }
  5976. },
  5977. error => {
  5978. this.$message({
  5979. message: error,
  5980. type: "error"
  5981. });
  5982. });
  5983. },
  5984. // 获取填报日报的项目下拉列表
  5985. getFillProjectList() {
  5986. this.http.post( this.port.project.list, {
  5987. forReport: 1
  5988. },res => {
  5989. if (res.code == "ok") {
  5990. for(var i in res.data) {
  5991. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5992. res.data[i].projectCode = ''
  5993. }
  5994. }
  5995. this.fillProjectList = res.data;
  5996. this.getRecentlyProject()
  5997. } else {
  5998. this.$message({
  5999. message: res.msg,
  6000. type: "error"
  6001. });
  6002. }
  6003. },
  6004. error => {
  6005. this.$message({
  6006. message: error,
  6007. type: "error"
  6008. });
  6009. });
  6010. },
  6011. //自己填写日报时,刷新到自己的可填报日报列表
  6012. refreshToMyReportProjectList() {
  6013. this.getRecentlyProject();
  6014. },
  6015. getBasecostItemList() {
  6016. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6017. companyId: this.user.companyId
  6018. },
  6019. res => {
  6020. if (res.code == "ok") {
  6021. this.timeBasecostList = res.data;
  6022. }
  6023. });
  6024. },
  6025. getAIReport(createDate) {
  6026. this.http.post('/report/getAIReport', {},
  6027. res => {
  6028. if (res.code == "ok") {
  6029. var quanbu = 0
  6030. this.jsDay = 1
  6031. var zhi = ''
  6032. var slp = res.data
  6033. for(var i in slp) {
  6034. var sp = +slp[i].workingTime + 0
  6035. zhi = this.jsDay * sp
  6036. quanbu = +quanbu + zhi
  6037. }
  6038. this.jsTime = quanbu
  6039. var aiReportData = res.data;
  6040. this.canCancelInDialog = false
  6041. if(aiReportData.length != 0) {
  6042. var arr = [];
  6043. for(var i in aiReportData) {
  6044. arr.push({
  6045. id: null,
  6046. projectId: aiReportData[i].projectId,
  6047. workingTime: aiReportData[i].workingTime,
  6048. content: '',
  6049. progress:100,
  6050. state: 2,
  6051. timeType: aiReportData[i].timeType,
  6052. subProjectList: aiReportData[i].subProjectList,
  6053. taskList: aiReportData[i].taskList,
  6054. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6055. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6056. taskId: aiReportData[i].taskId,
  6057. startTime: aiReportData[i].startTime,
  6058. endTime: aiReportData[i].endTime,
  6059. isOvertime: 0,
  6060. progress:aiReportData[i].progress,
  6061. professionProgress: aiReportData[i].professionProgressList,
  6062. stages:aiReportData[i].stages,
  6063. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6064. pics: null,
  6065. multiWorktime: aiReportData[i].multiWorktime || 0,
  6066. worktimeList: [{}],
  6067. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6068. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6069. wuduList: aiReportData[i].degreeList,
  6070. taskGroups:aiReportData[i].taskGroups,
  6071. customData: aiReportData[i].customData,//自定义的数值
  6072. auditUserList: aiReportData[i].auditUserList,
  6073. projectAuditorId: aiReportData[i].projectAuditorId,
  6074. projectAuditorName: aiReportData[i].projectAuditorName,
  6075. overtimeHours: aiReportData[i].overtimeHours,
  6076. customText: aiReportData[i].customText,
  6077. basecostId: aiReportData[i].basecostId,
  6078. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6079. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6080. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6081. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6082. canEdit: true
  6083. })
  6084. }
  6085. this.workForm.domains = arr;
  6086. } else {
  6087. }
  6088. this.canEdit = true;
  6089. this.originCanEdit = true;
  6090. this.seleChn()
  6091. } else {
  6092. this.$message({
  6093. message: res.msg,
  6094. type: "error"
  6095. });
  6096. }
  6097. },
  6098. error => {
  6099. this.$message({
  6100. message: error,
  6101. type: "error"
  6102. });
  6103. });
  6104. },
  6105. // 获取个人某天的日报 111111
  6106. getReport() {
  6107. this.http.post( this.port.report.getPort, {
  6108. date: this.workForm.createDate
  6109. },
  6110. res => {
  6111. if (res.code == "ok") {
  6112. var quanbu = 0
  6113. this.jsDay = 1
  6114. var zhi = ''
  6115. var slp = res.data.report
  6116. for(var i in slp) {
  6117. var sp = +slp[i].workingTime + 0
  6118. zhi = this.jsDay * sp
  6119. quanbu = +quanbu + zhi
  6120. }
  6121. this.jsTime = quanbu
  6122. var list = res.data;
  6123. this.report = list;
  6124. this.reportTimeType = this.report.timeType;
  6125. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6126. this.isWeekend = !this.report.isWorkDay;
  6127. this.canCancelInDialog = false;
  6128. this.hasWrittenReport = list.report.length != 0;
  6129. if(list.report.length != 0) {
  6130. var arr = [];
  6131. this.canEdit = false;
  6132. let candelete = true
  6133. for(var i in list.report) {
  6134. var flg = null
  6135. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6136. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6137. var filteredRespList = null
  6138. if (targetP.length > 0) {
  6139. var isPublic = targetP[0].isPublic;
  6140. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  6141. }
  6142. let copyData = {
  6143. id: list.report[i].id,
  6144. projectId: list.report[i].projectId,
  6145. workingTime: list.report[i].workingTime,
  6146. content: list.report[i].content,
  6147. state: list.report[i].state,
  6148. timeType: list.report[i].timeType,
  6149. subProjectList: list.report[i].subProjectList,
  6150. taskList: list.report[i].taskList,
  6151. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6152. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6153. taskId: list.report[i].taskId,
  6154. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6155. startTime: list.report[i].startTime,
  6156. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6157. endTime: list.report[i].endTime,
  6158. isOvertime: flg,
  6159. progress:list.report[i].progress,
  6160. professionProgress: list.report[i].professionProgressList,
  6161. stages:list.report[i].stages,
  6162. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6163. pics: list.report[i].pics,
  6164. multiWorktime: list.report[i].multiWorktime,
  6165. worktimeList: list.report[i].worktimeList,
  6166. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6167. multiDegrIdArray: list.report[i].multiDegrIdList,
  6168. wuduList: list.report[i].degreeList,
  6169. taskGroups:list.report[i].taskGroups,
  6170. customData: list.report[i].customData,//自定义的数值
  6171. auditUserList: list.report[i].auditUserList,
  6172. overtimeHours: list.report[i].overtimeHours,
  6173. customText: list.report[i].customText,
  6174. basecostId: list.report[i].basecostId,
  6175. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6176. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6177. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6178. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6179. canEdit: list.report[i].state >= 2 ? true : false,
  6180. extraField1: list.report[i].extraField1,
  6181. extraField2: list.report[i].extraField2,
  6182. extraField3: list.report[i].extraField3,
  6183. workContentList: list.report[i].workContentList,
  6184. filteredRespList: filteredRespList,
  6185. serviceList: list.report[i].serviceList,
  6186. sapServiceId: list.report[i].sapServiceId,
  6187. reportTargetDeptId: list.report[i].deptId
  6188. }
  6189. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6190. //分组负责人审核的情况下,前端不需要显示,无需设置
  6191. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6192. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6193. }
  6194. arr.push(copyData);
  6195. if (list.report[i].state >= 2) {
  6196. this.canEdit = true;
  6197. }
  6198. if(list.report[i].state < 2){
  6199. candelete = false
  6200. }
  6201. if (list.report[i].state == 0){
  6202. this.canCancelInDialog = true
  6203. }
  6204. // 加判断
  6205. if(this.user.timeType.choseFromAlbum == 1) {
  6206. let arrList = []
  6207. for(var k in list.report[i].pics) {
  6208. let obj = {
  6209. name: k,
  6210. url: list.report[i].pics[k]
  6211. }
  6212. arrList.push(obj)
  6213. }
  6214. arr[i].imgListUrl = arrList
  6215. arr[i].imgList = list.report[i].pics
  6216. }
  6217. }
  6218. this.reportCanDelete = candelete
  6219. this.workForm = {
  6220. createDate: this.workForm.createDate,
  6221. domains: arr,
  6222. userNames:null,
  6223. userId:null,
  6224. time: list.time,
  6225. showRefresh: list.showRefresh
  6226. }
  6227. } else {
  6228. this.workForm = {
  6229. createDate: this.workForm.createDate,
  6230. domains: [{
  6231. id: null,
  6232. projectId: "",
  6233. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6234. content: "",
  6235. progress:100,
  6236. state: 2,
  6237. timeType:0,
  6238. multiWorktime: this.reportTimeType.multiWorktime,
  6239. worktimeList:[{}],
  6240. canEdit: true,
  6241. auditorFirst: '',
  6242. auditorSec: '',
  6243. auditorThird: '',
  6244. ccUserid: ''
  6245. }],
  6246. userId:null,
  6247. userNames:null,
  6248. time: this.report.time,
  6249. showRefresh: list.showRefresh
  6250. }
  6251. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6252. this.$set(this.workForm.domains[0],'isOvertime',true)
  6253. if(this.reportTimeType.type != 2){
  6254. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6255. }
  6256. }
  6257. if(this.user.timeType.type == 1) {
  6258. var shuzhi = this.user.timeType.allday + ''
  6259. // console.log('执行一次', shuzhi.indexOf('.'))
  6260. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6261. }
  6262. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6263. //默认给第一个,必填字段
  6264. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6265. }
  6266. this.canEdit = true;
  6267. }
  6268. this.originCanEdit = this.canEdit;
  6269. this.seleChn()
  6270. } else {
  6271. this.$message({
  6272. message: res.msg,
  6273. type: "error"
  6274. });
  6275. }
  6276. },
  6277. error => {
  6278. this.$message({
  6279. message: error,
  6280. type: "error"
  6281. });
  6282. });
  6283. },
  6284. guanbi() {
  6285. this.falsss = false,
  6286. this.workTimeForMinYi=0
  6287. },
  6288. // 打开日报填写
  6289. fillInReport(i, isBatch) {
  6290. this.isWeekend = false
  6291. this.reportCanDelete = false
  6292. // console.log(this.user.timeType.type, '选择时长')
  6293. if(i != 1) {
  6294. this.falsss = false
  6295. } else {
  6296. this.falsss = true
  6297. }
  6298. if (this.isSubstitude) {
  6299. this.getSubstitudeUserDeptList();
  6300. } else {
  6301. this.refreshToMyReportProjectList();
  6302. }
  6303. if(i == -1 || this.isSubstitude) {
  6304. this.isDisable = false;
  6305. } else {
  6306. this.isDisable = true;
  6307. }
  6308. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6309. this.isBatch = isBatch;
  6310. if (this.isBatch == 0 && !this.isSubstitude) {
  6311. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6312. let weekday = new Date(this.workForm.createDate).getDay()
  6313. if(this.user.companyId == 817){
  6314. if(weekday == 0){
  6315. this.isWeekend = true
  6316. }
  6317. }else{
  6318. if(weekday == 0 || weekday == 6){
  6319. this.isWeekend = true
  6320. }
  6321. }
  6322. this.getReport(i);
  6323. } else {
  6324. this.jsTime = 0
  6325. this.jsDay = 0
  6326. this.workForm = {
  6327. createDate: null,//批量填报没有日期
  6328. domains: [{
  6329. id: null,
  6330. projectId: "",
  6331. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6332. content: "",
  6333. progress:100,
  6334. state: 2,
  6335. timeType:0,
  6336. multiWorktime: this.reportTimeType.multiWorktime,
  6337. worktimeList:[{}],
  6338. canEdit: true,
  6339. }],
  6340. }
  6341. if(this.user.timeType.type == 1) {
  6342. var shuzhi = this.user.timeType.allday + ''
  6343. // console.log('执行二次')
  6344. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6345. }
  6346. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6347. this.workForm.showRefresh = true;
  6348. }
  6349. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6350. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6351. }
  6352. this.canEdit = true;
  6353. }
  6354. if (this.isSubstitude) {
  6355. //代填情况,默认计算合计工时
  6356. this.jsDay = 1
  6357. this.seleChn();
  6358. }
  6359. this.dialogVisible = true;
  6360. },
  6361. //按周填报的弹窗口中编辑单项目相关数据
  6362. setWeekFormReportItem(reportId, i, names, row,sss) {
  6363. this.http.post('/report/getReportById', {
  6364. reportId: reportId
  6365. },
  6366. res => {
  6367. if (res.code == "ok") {
  6368. var data = res.data.report;
  6369. sss.subProjectId = data.subProjectId
  6370. sss.subProjectList = data.subProjectList;
  6371. sss.stage = data.stage
  6372. sss.subProjectList = data.subProjectList
  6373. sss.stages = data.stages
  6374. sss.taskGroups = data.taskGroups;
  6375. sss.auditUserList = data.auditUserList;
  6376. sss.degreeId = data.degreeId;
  6377. sss.customData = data.customData;
  6378. sss.wuduList = data.degreeList;
  6379. this.zhoBaoIdx = i
  6380. this.zhoBaoName = names
  6381. this.zhoBao = sss
  6382. this.zhis = row
  6383. if (sss.groupId) {
  6384. //最后一个参数表示是否保留stage的值,不要重置为空
  6385. this.getGroupStages(this.zhoBao, 0, true)
  6386. }
  6387. this.$forceUpdate();
  6388. }
  6389. });
  6390. },
  6391. // 按周填报里内容的填写
  6392. showWeekItemEdit(item, i, projectId,names, row) {
  6393. if (item.state == 0) {
  6394. this.$message({
  6395. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6396. type: "error"
  6397. });
  6398. return;
  6399. }
  6400. if (item.state == 1) {
  6401. this.$message({
  6402. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6403. type: "error"
  6404. });
  6405. return;
  6406. }
  6407. if(this.user.timeType.notAllowedNoAttendance == 1){
  6408. if(this.zhoData[i].corpTime){
  6409. if(this.zhoData[i].corpTime.workHours == 0){
  6410. this.$message({
  6411. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6412. type: 'error'
  6413. })
  6414. return
  6415. }
  6416. }else{
  6417. this.$message({
  6418. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6419. type: 'error'
  6420. })
  6421. return
  6422. }
  6423. }
  6424. var obj = {}
  6425. obj.projectId = projectId
  6426. this.tianxieDialogVisible = true
  6427. this.scopess = item
  6428. var sss = {}
  6429. if (item.id != null) {
  6430. sss.id = item.id;
  6431. sss.state = item.state;
  6432. } else {
  6433. sss.id = -1;
  6434. sss.state = 3;
  6435. }
  6436. sss.projectId = projectId;
  6437. sss.progress = item.progress
  6438. sss.time = item.time
  6439. sss.content = item.content;
  6440. if (sss.time == '' && this.reportTimeType.type == 2) {
  6441. //取已填时间范围中最大的一个作为开始时间
  6442. var startTime = '09:00';
  6443. var fillStartTime = '00:00';
  6444. for (var t in this.selProjectList) {
  6445. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6446. if (fillItem.time) {
  6447. if (fillItem.time[1] > fillStartTime) {
  6448. fillStartTime = fillItem.time[1];
  6449. }
  6450. }
  6451. }
  6452. if (fillStartTime == '00:00') {
  6453. fillStartTime = '09:00';
  6454. }
  6455. var fillEndMax = '18:00';
  6456. if (fillStartTime >= '18:00') {
  6457. fillEndMax = '23:59';
  6458. }
  6459. sss.time = [fillStartTime, fillEndMax];
  6460. }
  6461. sss.groupId = item.groupId
  6462. sss.stage = item.stage;
  6463. sss.workingTime = item.workingTime
  6464. sss.projectAuditorId = item.projectAuditorId;
  6465. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6466. //默认选中第一个
  6467. sss.basecostId = this.timeBasecostList[0].id;
  6468. }
  6469. var hasEdited = this.zhoData[i][names].hasEdited;
  6470. if (hasEdited) {
  6471. sss = { ...item }
  6472. //编辑过了
  6473. sss.subProjectId = item.subProjectId
  6474. sss.stage = item.stage
  6475. sss.subProjectList = item.subProjectList
  6476. sss.stages = item.stages
  6477. sss.taskGroups = item.taskGroups;
  6478. sss.auditUserList = obj.auditUserList;
  6479. sss.degreeId = item.degreeId;
  6480. sss.customData = item.customData;
  6481. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6482. //只有一个审核人,自动设置上去
  6483. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6484. }
  6485. sss.wuduList = item.wuduList;
  6486. this.zhoBaoIdx = i
  6487. this.zhoBaoName = names
  6488. this.zhoBao = sss
  6489. this.zhis = row
  6490. if (sss.groupId) {
  6491. //最后一个参数表示是否保留stage的值,不要重置为空
  6492. this.getGroupStages(this.zhoBao, 0, true)
  6493. }
  6494. this.$forceUpdate();
  6495. this.getWeeklyTaskList(sss)
  6496. } else {
  6497. //第一次打开,获取数据
  6498. if (sss.id == -1) {
  6499. //新填报的
  6500. this.selectProject(obj, 0);
  6501. var that = this
  6502. setTimeout(() =>{
  6503. sss.subProjectId = that.workForm.domains[0].subProjectId
  6504. sss.subProjectList = item.subProjectList;
  6505. sss.stage = that.workForm.domains[0].stage
  6506. sss.subProjectList = that.workForm.domains[0].subProjectList
  6507. sss.stages = that.workForm.domains[0].stages
  6508. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6509. sss.auditUserList = obj.auditUserList;
  6510. sss.degreeId = item.degreeId;
  6511. sss.customData = item.customData;
  6512. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6513. //只有一个审核人,自动设置上去
  6514. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6515. }
  6516. sss.wuduList = row[0].wuduList
  6517. that.zhoBaoIdx = i
  6518. that.zhoBaoName = names
  6519. that.zhoBao = sss
  6520. that.zhis = row
  6521. if (sss.groupId) {
  6522. //最后一个参数表示是否保留stage的值,不要重置为空
  6523. this.getGroupStages(that.zhoBao, 0, false)
  6524. }
  6525. that.$forceUpdate();
  6526. this.getWeeklyTaskList(sss)
  6527. },600);
  6528. } else {
  6529. //编辑填报过的;数据库已经存在的
  6530. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6531. }
  6532. }
  6533. },
  6534. // 按周填报里内容的填写点击确定
  6535. setWeekProItemData() {
  6536. //专业版模式下,任务分组和阶段必填
  6537. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6538. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6539. this.$message({
  6540. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6541. type: "error"
  6542. });
  6543. return;
  6544. }
  6545. }
  6546. // 检查任务分组
  6547. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6548. this.$message({
  6549. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6550. type: "error"
  6551. });
  6552. return
  6553. }
  6554. //检查子项目是否必填
  6555. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6556. this.$message({
  6557. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6558. type: "error"
  6559. });
  6560. return;
  6561. }
  6562. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6563. this.$message({
  6564. message: this.$t('message.Pleaseselectareviewer'),
  6565. type: "error"
  6566. });
  6567. return
  6568. }
  6569. if(this.user.timeType.reportAuditType == 3){
  6570. let auditTips = ''
  6571. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6572. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6573. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6574. if(auditTips){
  6575. auditTips = auditTips.substring(0,auditTips.length - 1)
  6576. this.$message({
  6577. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6578. type: 'error'
  6579. })
  6580. return
  6581. }
  6582. }
  6583. let errtips = ''
  6584. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6585. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6586. errtips += this.user.timeType.customDegreeName + '、'
  6587. }
  6588. }
  6589. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6590. errtips += this.user.timeType.customDataName + '、'
  6591. }
  6592. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6593. errtips += this.user.timeType.customTextName + '、'
  6594. }
  6595. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6596. errtips += this.$t('other.workMatters') +'、'
  6597. }
  6598. if(errtips){
  6599. errtips = errtips.substring(0,errtips.length - 1)
  6600. this.$message({
  6601. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6602. type: 'error'
  6603. })
  6604. return
  6605. }
  6606. this.tianxieDialogVisible = false
  6607. var zhong = this.zhoData
  6608. this.zhoBao.hasEdited = true;
  6609. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6610. this.zhoData = zhong
  6611. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6612. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6613. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6614. },
  6615. // 获取本周
  6616. getCurrentWeek() {
  6617. //今天
  6618. this.targetWeekDate = new Date();
  6619. this.initWeekFormData();
  6620. // this.jiazai()
  6621. },
  6622. // 获取上周
  6623. handleGetPrevWeek() {
  6624. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6625. this.initWeekFormData();
  6626. // this.jiazai()
  6627. },
  6628. // 获取下周
  6629. handleGetNextvWeek() {
  6630. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6631. this.initWeekFormData()
  6632. },
  6633. // 加载动画
  6634. jiazai() {
  6635. this.weekDataLoading = true
  6636. var that = this
  6637. setTimeout(() =>{
  6638. that.weekDataLoading = false
  6639. },1000);
  6640. },
  6641. // 转时间格式
  6642. dealdate(date) {
  6643. const dt = new Date(date)
  6644. const y = dt.getFullYear()
  6645. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6646. const d = (dt.getDate() + '').padStart(2, '0')
  6647. return `${y}-${m}-${d}`
  6648. },
  6649. // 按周填报
  6650. fillInReportss() {
  6651. window.addEventListener('scroll', this.handleScroll, true)
  6652. // this.jiazai()
  6653. this.fillWeekDialogVisi = true;
  6654. if (this.isSubstitude) {
  6655. this.substitudeStep = 1;
  6656. this.getSubstitudeUserDeptList();
  6657. } else {
  6658. this.getCurrentWeek();
  6659. }
  6660. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6661. //重新获取工时预警类型的预算项
  6662. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6663. companyId: this.user.companyId
  6664. },
  6665. res => {
  6666. if (res.code == "ok") {
  6667. this.timeBasecostList = res.data;
  6668. }
  6669. });
  6670. }
  6671. },
  6672. fillInReportCustom() {
  6673. this.weekIndex++
  6674. this.weekParentData = {
  6675. isSubstitude: this.isSubstitude
  6676. }
  6677. this.fillWeekDialogVisiCustom = true
  6678. },
  6679. // 按周填报的项目筛选
  6680. selListFun(){
  6681. this.selProjectList = []
  6682. if(this.selCon.length){
  6683. for (let i = 0; i < this.selCon.length; i++) {
  6684. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6685. }
  6686. this.selConShow = false ;
  6687. for (let i in this.zhoData) {
  6688. var obj = this.zhoData[i];
  6689. for(var j in this.selProjectList) {
  6690. var xinzhi = this.selProjectList[j].projectName
  6691. obj[xinzhi] = {}
  6692. obj[xinzhi].time = ''
  6693. obj[xinzhi].content = ''
  6694. obj[xinzhi].progress = 0
  6695. obj[xinzhi].workingTime = 0
  6696. }
  6697. }
  6698. this.initWeekFormData();
  6699. }else{
  6700. this.$message({
  6701. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6702. type:'error'
  6703. })
  6704. }
  6705. },
  6706. setWeekCardTimeData(list) {
  6707. for(let i in list){
  6708. let datei = '';
  6709. if (this.user.timeType.showDdCardtime == 1) {
  6710. datei = list[i].workDate;
  6711. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6712. datei = list[i].createDate;
  6713. } else if (this.user.timeType.syncFanwei == 1) {
  6714. datei = list[i].workDate;
  6715. }
  6716. for(let m in this.zhoData) {
  6717. if(datei == this.zhoData[m].zhoDataTime){
  6718. let item = {
  6719. startTime: list[i].startTime,
  6720. endTime: list[i].endTime,
  6721. workHours: list[i].workHours,
  6722. otTime: list[i].otTime
  6723. }
  6724. this.$set(this.zhoData[m],'corpTime',item)
  6725. }
  6726. }
  6727. }
  6728. },
  6729. getWeeklyCardTime(){ //按周填报获取考勤信息
  6730. let dateStr = []
  6731. for(let i in this.zhoData){
  6732. dateStr.push(this.zhoData[i].zhoDataTime)
  6733. }
  6734. this.http.post('/report/getWeeklyCardTime',{
  6735. dateStr: JSON.stringify(dateStr)
  6736. },res => {
  6737. if(res.code == 'ok'){
  6738. for(let i in res.data){
  6739. let datei = '';
  6740. if (this.user.timeType.showDdCardtime == 1) {
  6741. datei = res.data[i].workDate.split('-');
  6742. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6743. datei = res.data[i].createDate.split('-');
  6744. }
  6745. for(let m in this.zhoData){
  6746. let datem = new Date(this.zhoData[m].zhoDataTime)
  6747. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6748. let item = {
  6749. startTime: res.data[i].startTime,
  6750. endTime: res.data[i].endTime,
  6751. workHours: res.data[i].workHours
  6752. }
  6753. this.$set(this.zhoData[m],'corpTime',item)
  6754. }
  6755. }
  6756. }
  6757. }else{
  6758. this.$message({
  6759. message: res.msg,
  6760. type: 'error'
  6761. })
  6762. }
  6763. },err => {
  6764. this.$message({
  6765. message: err,
  6766. type: 'error'
  6767. })
  6768. })
  6769. },
  6770. selListqx(){
  6771. this.fillWeekDialogVisi = false
  6772. this.selProjectList = []
  6773. this.selCon = []
  6774. },
  6775. handleScroll() {
  6776. this.changdu = this.projectList.length + 1
  6777. },
  6778. // 自动选择时间点的事件
  6779. // async zhoTimes(item, i) {
  6780. // var iss = i
  6781. // if(item.time == null) {
  6782. // return
  6783. // } else {
  6784. // const zhi = this.zhoData[iss];
  6785. // let he = 0;
  6786. // const timeArr = Object.values(zhi)
  6787. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6788. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6789. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6790. // console.log(data, 'data');
  6791. // zhi.he = `${he}h`;
  6792. // }
  6793. // },
  6794. async zhoTimes(item, index) {
  6795. const zho = this.zhoData[index];
  6796. if (!item.time) {
  6797. return;
  6798. }
  6799. const timeArr = Object.values(zho)
  6800. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6801. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6802. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6803. zho.he = `${totalHours[0]}h`;
  6804. },
  6805. // 判断两个时间段是否重叠
  6806. timeOverlap(idx, dateAr) {
  6807. let zhi = 0
  6808. for (let k in dateAr) {
  6809. if (idx !== k) {
  6810. 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))) {
  6811. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6812. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6813. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6814. }
  6815. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6816. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6817. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6818. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6819. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6820. } else {
  6821. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6822. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6823. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6824. }
  6825. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6826. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6827. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6828. }
  6829. }
  6830. }
  6831. }
  6832. }
  6833. return zhi
  6834. },
  6835. // 计算时间
  6836. getHourMinutes(str, end) {
  6837. var he = 0
  6838. var date2 = '2021/12/12 ' + end +':00'
  6839. var date1 = '2021/12/12 ' + str +':00'
  6840. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6841. var leave1=date3%(24*3600*1000)
  6842. var hours=Math.floor(leave1/(3600*1000))
  6843. var leave2=leave1%(3600*1000)
  6844. var minutes=Math.floor(leave2/(60*1000))
  6845. var shi = hours+'.'+ minutes
  6846. return he += +shi
  6847. },
  6848. // 自动选择事件长度的事件
  6849. zhoXuan(item, i) {
  6850. var iss = i
  6851. if(item.time == null) {
  6852. return
  6853. } else {
  6854. var zhi = this.zhoData[iss]
  6855. var he = 0
  6856. for(var i in zhi) {
  6857. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6858. he += +zhi[i].workingTime
  6859. }
  6860. }
  6861. zhi.he = he + 'h'
  6862. }
  6863. },
  6864. getPushWorkLogData(){
  6865. this.http.post('/sap-sync-log/list', {},
  6866. res => {
  6867. if (res.code == "ok") {
  6868. this.pushWorkTimeLogData = res.data;
  6869. } else {
  6870. this.$message({
  6871. message: res.msg,
  6872. type: "error"
  6873. });
  6874. }
  6875. },
  6876. error => {
  6877. this.$message({
  6878. message: error,
  6879. type: "error"
  6880. });
  6881. });
  6882. },
  6883. // 获取全部人员
  6884. getUsers() {
  6885. this.http.post('/user/getSimpleActiveUserList', {},
  6886. res => {
  6887. if (res.code == "ok") {
  6888. this.usersList = res.data;
  6889. } else {
  6890. this.$message({
  6891. message: res.msg,
  6892. type: "error"
  6893. });
  6894. }
  6895. },
  6896. error => {
  6897. this.$message({
  6898. message: error,
  6899. type: "error"
  6900. });
  6901. });
  6902. },
  6903. // 按时间比例
  6904. addBli(item, i) {
  6905. var iss = i
  6906. if(item.time == null) {
  6907. return
  6908. } else {
  6909. var zhi = this.zhoData[iss]
  6910. var he = 0
  6911. for(var i in zhi) {
  6912. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6913. he += +zhi[i].workingTime
  6914. }
  6915. }
  6916. zhi.he = he.toFixed(1) + 'h'
  6917. }
  6918. },
  6919. //按周填报选择的项目发生变化,需要设置列
  6920. onSelProjectChange() {
  6921. for (let i = 0; i < this.selCon.length; i++) {
  6922. var exists = false;
  6923. for (let j = 0; j < this.selProjectList.length; j++) {
  6924. if (this.selProjectList[j].id == this.selCon[i]) {
  6925. exists = true;
  6926. break;
  6927. }
  6928. }
  6929. if (!exists) {
  6930. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6931. this.selProjectList.push(newProject);
  6932. //添加新项目
  6933. for (var w in this.zhoData) {
  6934. var dayItem = this.zhoData[w];
  6935. var pName = newProject.projectName;
  6936. dayItem[pName] = {};
  6937. dayItem[pName].time = ''
  6938. dayItem[pName].content = ''
  6939. dayItem[pName].progress = 0
  6940. dayItem[pName].workingTime = 0
  6941. }
  6942. }
  6943. }
  6944. //去掉
  6945. for (let j = 0; j < this.selProjectList.length; j++) {
  6946. var exists = false;
  6947. for (let i = 0; i < this.selCon.length; i++) {
  6948. if (this.selProjectList[j].id == this.selCon[i]) {
  6949. exists = true;
  6950. break;
  6951. }
  6952. }
  6953. if (!exists) {
  6954. this.selProjectList.splice(j, 1);
  6955. j--;
  6956. }
  6957. }
  6958. this.loadFilledWeekReportItem();
  6959. //刷新表格
  6960. // this.$refs.weekTable.doLayout();
  6961. },
  6962. //根据选中的项目来刷新填写表格
  6963. loadFilledWeekReportItem() {
  6964. for (var w in this.zhoData) {
  6965. var dayItem = this.zhoData[w];
  6966. for (var i = 0; i < this.selProjectList.length; i++) {
  6967. var curColumnProject = this.selProjectList[i];
  6968. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6969. for (var t in dayItem.reportList) {
  6970. //有日报的项目,不能取消选择
  6971. for (var p in this.fillProjectList) {
  6972. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6973. }
  6974. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6975. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6976. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6977. if (this.reportTimeType.type == 2) {
  6978. //时间段模式
  6979. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6980. }
  6981. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6982. break;
  6983. }
  6984. }
  6985. // dayItem[curColumnProject.projectName] = matchReportItem;
  6986. }
  6987. }
  6988. this.$nextTick(()=>{
  6989. this.$refs.weekTable.doLayout();
  6990. });
  6991. },
  6992. initWeekFormData() {
  6993. this.weekDataLoading = true;
  6994. for (var p in this.fillProjectList) {
  6995. this.fillProjectList[p].canCancel = 1;
  6996. }
  6997. var param = {
  6998. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6999. };
  7000. if (this.isSubstitude) {
  7001. //传代填人的userId
  7002. param.targetUserId = this.workForm.userId[0];
  7003. }
  7004. this.http.post('/report/getWeeklyReportData',param,res => {
  7005. this.weekDataLoading = false;
  7006. if(res.code == 'ok'){
  7007. let projectList = res.data.projectList;
  7008. if (projectList.length > 0) {
  7009. //有选择过项目进行填报,直接选中
  7010. this.selProjectList = projectList;
  7011. this.selCon = [];
  7012. for (let i = 0; i < projectList.length; i++) {
  7013. this.selCon.push(projectList[i].id);
  7014. }
  7015. }
  7016. //设置日期
  7017. this.weekDateRange = res.data.dateList;
  7018. this.zhoData = [];
  7019. var arrst = []
  7020. for(var i in this.weekDateRange) {
  7021. var obj = {}
  7022. obj.zhoDataTime = this.weekDateRange[i].date
  7023. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7024. obj.he = this.weekDateRange[i].filledTime;
  7025. obj.canFill = this.weekDateRange[i].canFill;
  7026. // obj.filledTime = this.weekDateRange[i].filledTime;
  7027. obj.reportList = this.weekDateRange[i].reportList;
  7028. //初始化,防止渲染报错
  7029. for (var j = 0; j < this.selProjectList.length; j++) {
  7030. var pName = this.selProjectList[j].projectName
  7031. obj[pName] = {}
  7032. obj[pName].time = ''
  7033. obj[pName].content = ''
  7034. obj[pName].progress = 0
  7035. obj[pName].workingTime = 0
  7036. }
  7037. arrst.push(obj)
  7038. }
  7039. this.zhoData = arrst
  7040. this.setWeekCardTimeData(res.data.cardTimeList);
  7041. this.loadFilledWeekReportItem();
  7042. }else{
  7043. this.$message({
  7044. message: res.msg,
  7045. type: 'error'
  7046. })
  7047. }
  7048. },err => {
  7049. this.$message({
  7050. message: err,
  7051. type: 'error'
  7052. })
  7053. })
  7054. },
  7055. zhoZhi(res, i) {
  7056. var zhi = 0
  7057. for(var i in res) {
  7058. if(i != 'zhoDataTime' && i != 'he') {
  7059. zhi += +res[i]
  7060. }
  7061. }
  7062. res.he = zhi
  7063. },
  7064. zhoBtn(i) {
  7065. // this.zhoData.split(i, 1)
  7066. var arr = this.zhoData
  7067. arr.splice(i, 1)
  7068. },
  7069. zhoAddlast(){
  7070. this.selConShow = true
  7071. },
  7072. closeAddWeeklyReport(){
  7073. this.fillWeekDialogVisi = false
  7074. this.selConShow = true
  7075. this.selProjectList = []
  7076. this.selCon = []
  7077. },
  7078. checkDateWorkTime() {
  7079. //针对苏州景昱,单独的检查逻辑
  7080. if (this.user.companyId == 5978) {
  7081. //调接口,先检查工时是否存在异常
  7082. var zhi = this.zhoData;
  7083. var array = [];
  7084. for(let n in zhi){
  7085. if(zhi[n].he){
  7086. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7087. array.push(workData)
  7088. }
  7089. }
  7090. this.submitingReport = true;
  7091. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7092. res => {
  7093. this.submitingReport = false;
  7094. if (res.code == "ok") {
  7095. this.submitWeekReport(0)
  7096. } else {
  7097. this.$confirm(res.msg, this.$t('other.prompts'), {
  7098. confirmButtonText: this.$t('huLveBingTiJiao'),
  7099. cancelButtonText: this.$t('btn.cancel'),
  7100. type: 'error'
  7101. }).then(() => {
  7102. this.submitWeekReport(0)
  7103. }).catch(() => {
  7104. });
  7105. }
  7106. },
  7107. error => {
  7108. this.$message({
  7109. message: error,
  7110. type: "error"
  7111. });
  7112. });
  7113. }
  7114. },
  7115. // 提交按周填报
  7116. submitWeekReport(isDraft) {
  7117. var zhi = this.zhoData
  7118. var ll = 0
  7119. if(this.reportTimeType.type == 2) {
  7120. for(var i in zhi) {
  7121. this.dateAr = []
  7122. var alp = []
  7123. var zhis = zhi[i]
  7124. for(var j in zhis) {
  7125. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7126. let objs = {}
  7127. objs.s = zhis[j].time[0]
  7128. objs.e = zhis[j].time[1]
  7129. objs.p = j
  7130. alp.push(objs)
  7131. }
  7132. }
  7133. this.dateAr = alp
  7134. if (this.reportTimeType.timeCanOverlap == 0) {
  7135. let str = this.$t('message.Filledtimeperiodsoverlap')
  7136. if(this.dateAr.length > 0) {
  7137. const trus = this.fns();
  7138. const overlapDataTime = this.getOverlapData(alp);
  7139. if (overlapDataTime.length > 0) {
  7140. const arrList = overlapDataTime.map((item) => item.p);
  7141. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7142. }
  7143. ll += 1
  7144. if(!trus) {
  7145. this.$message({
  7146. message: str,
  7147. type: 'error'
  7148. })
  7149. return false
  7150. }
  7151. }
  7152. } else {
  7153. if(this.dateAr.length > 0) {
  7154. ll +=1 ;
  7155. }
  7156. }
  7157. }
  7158. if(ll == 0) {
  7159. this.$message({
  7160. message: this.$t('message.Pleasefillinthetime'),
  7161. type: 'error'
  7162. })
  7163. return false
  7164. }
  7165. } else if(this.reportTimeType.type == 1){
  7166. for(var i in zhi) {
  7167. var zhis = zhi[i]
  7168. for(var j in zhis) {
  7169. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7170. ll += 1
  7171. }
  7172. }
  7173. }
  7174. if(ll == 0) {
  7175. this.$message({
  7176. message: this.$t('message.Pleaseselectatime'),
  7177. type: 'error'
  7178. })
  7179. return false
  7180. }
  7181. let overcorp = ''
  7182. for(let n in zhi){
  7183. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7184. overcorp += zhi[n].zhoDataTime + ','
  7185. }
  7186. }
  7187. if(this.user.companyId != 5978 && overcorp != ''){
  7188. overcorp = overcorp.substring(0,overcorp.length - 1)
  7189. this.$message({
  7190. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7191. type: 'error'
  7192. })
  7193. return
  7194. }
  7195. }
  7196. var submits = []
  7197. let formData = new FormData();
  7198. formData.append("draft", isDraft);
  7199. if(this.reportTimeType.multiWorktime == 1){
  7200. for (var i in this.zhoData) {
  7201. var zhoD = this.zhoData[i]
  7202. var flgs = false
  7203. for(var j in zhoD) {
  7204. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7205. flgs = true
  7206. // formData.append("degreeId", "-1");
  7207. formData.append("id", '-1');
  7208. if (this.isSubstitude) {
  7209. formData.append('targetUids',this.workForm.userId[0]);
  7210. }
  7211. for(var s in this.selProjectList) {
  7212. if(j == this.selProjectList[s].projectName) {
  7213. formData.append("projectId", this.selProjectList[s].id);
  7214. break;
  7215. }
  7216. }
  7217. if(this.user.timeType.reportAuditType == 3){
  7218. let audItem = {}
  7219. if(this.user.timeType.auditLevel > 0){
  7220. audItem.auditorFirst = zhoD[j].auditorFirst
  7221. }
  7222. if(this.user.timeType.auditLevel > 1){
  7223. audItem.auditorSec = zhoD[j].auditorSec
  7224. }
  7225. if(this.user.timeType.auditLevel > 2){
  7226. audItem.auditorThird = zhoD[j].auditorThird
  7227. }
  7228. if(zhoD[j].ccUserid){
  7229. audItem.ccUserid = zhoD[j].ccUserid
  7230. }
  7231. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7232. }
  7233. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7234. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7235. formData.append("reportTimeType", this.reportTimeType.type);
  7236. formData.append("endTime", '');
  7237. formData.append("startTime", '');
  7238. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7239. var lix = []
  7240. var objjs = {}
  7241. objjs.startTime = zhoD[j].time[0]
  7242. objjs.endTime = zhoD[j].time[1]
  7243. if (zhoD[j].content == null || zhoD[j].content == '') {
  7244. zhoD[j].content == '-'
  7245. }
  7246. objjs.content = zhoD[j].content
  7247. lix.push(objjs)
  7248. var zhiZhi = JSON.stringify(lix)
  7249. zhiZhi = zhiZhi.replace(/,/g,"@");
  7250. formData.append("content", zhiZhi)
  7251. formData.append("isOvertime", 0)
  7252. formData.append("professionProgress", "[]")
  7253. if (zhoD[j].groupId) {
  7254. formData.append("groupId",zhoD[j].groupId)
  7255. } else {
  7256. //解决后台groupId数组越界的问题
  7257. formData.append("groupId",0)
  7258. }
  7259. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7260. formData.append("createDate",zhoD.zhoDataTime)
  7261. if (zhoD[j].projectAuditorId) {
  7262. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7263. }
  7264. if(zhoD[j].basecostId) {
  7265. formData.append("basecostId", zhoD[j].basecostId);
  7266. } else {
  7267. formData.append("basecostId", 0);
  7268. }
  7269. if(this.user.timeType.customDegreeActive){
  7270. if (this.user.timeType.customDegreeMultiple) {
  7271. if (zhoD[j].multiDegrIdArray) {
  7272. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7273. } else {
  7274. formData.append('multiDegrId','[]')
  7275. }
  7276. } else {
  7277. if (zhoD[j].degreeId) {
  7278. formData.append('degreeId',zhoD[j].degreeId)
  7279. } else {
  7280. formData.append('degreeId','-1')
  7281. }
  7282. }
  7283. }else{
  7284. formData.append("degreeId", "-1");
  7285. }
  7286. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7287. formData.append('customData',zhoD[j].customData)
  7288. }else if(this.user.timeType.customDataActive){
  7289. formData.append('customData',0)
  7290. }
  7291. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7292. formData.append('customText',zhoD[j].customText)
  7293. }else if(this.user.timeType.customTextActive){
  7294. formData.append('customText','-')
  7295. }
  7296. }
  7297. }
  7298. }
  7299. } else {
  7300. for (var i in this.zhoData) {
  7301. var zhoD = this.zhoData[i]
  7302. var flgs = false
  7303. if(this.reportTimeType.type == 2) {
  7304. for(var k in this.selProjectList) {
  7305. var pItem = this.selProjectList[k];
  7306. var pName = pItem.projectName;
  7307. var j = pName;
  7308. var pid = pItem.id;
  7309. console.log('j==周报中的项目='+j);
  7310. if(zhoD[j].time && zhoD[j].time != 'null') {
  7311. flgs = true
  7312. // formData.append("degreeId", "-1");
  7313. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7314. if (this.isSubstitude) {
  7315. formData.append('targetUids',this.workForm.userId[0]);
  7316. }
  7317. formData.append("projectId", pid);
  7318. if(this.user.timeType.reportAuditType == 3){
  7319. let audItem = {}
  7320. if(this.user.timeType.auditLevel > 0){
  7321. audItem.auditorFirst = zhoD[j].auditorFirst
  7322. }
  7323. if(this.user.timeType.auditLevel > 1){
  7324. audItem.auditorSec = zhoD[j].auditorSec
  7325. }
  7326. if(this.user.timeType.auditLevel > 2){
  7327. audItem.auditorThird = zhoD[j].auditorThird
  7328. }
  7329. if(zhoD[j].ccUserid){
  7330. audItem.ccUserid = zhoD[j].ccUserid
  7331. }
  7332. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7333. }
  7334. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7335. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7336. formData.append("reportTimeType", this.reportTimeType.type);
  7337. formData.append("endTime", zhoD[j].time[1]);
  7338. formData.append("startTime", zhoD[j].time[0]);
  7339. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7340. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7341. formData.append("isOvertime", 0)
  7342. formData.append("professionProgress", "[]")
  7343. if (zhoD[j].groupId) {
  7344. formData.append("groupId",zhoD[j].groupId)
  7345. } else {
  7346. //解决后台groupId数组越界的问题
  7347. formData.append("groupId",0)
  7348. }
  7349. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7350. formData.append("createDate",zhoD.zhoDataTime)
  7351. if (zhoD[j].projectAuditorId) {
  7352. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7353. }
  7354. if(zhoD[j].basecostId) {
  7355. formData.append("basecostId", zhoD[j].basecostId);
  7356. } else {
  7357. formData.append("basecostId", 0);
  7358. }
  7359. if(this.user.timeType.customDegreeActive){
  7360. if (this.user.timeType.customDegreeMultiple) {
  7361. if (zhoD[j].multiDegrIdArray) {
  7362. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7363. } else {
  7364. formData.append("multiDegrId", "[]");
  7365. }
  7366. } else {
  7367. if (zhoD[j].degreeId) {
  7368. formData.append('degreeId',zhoD[j].degreeId)
  7369. } else {
  7370. formData.append("degreeId", "-1");
  7371. }
  7372. }
  7373. }else{
  7374. formData.append("degreeId", "-1");
  7375. }
  7376. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7377. formData.append('customData',zhoD[j].customData)
  7378. }else if(this.user.timeType.customDataActive){
  7379. formData.append('customData',0)
  7380. }
  7381. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7382. formData.append('customText',zhoD[j].customText)
  7383. }else if(this.user.timeType.customTextActive){
  7384. formData.append('customText','-')
  7385. }
  7386. }
  7387. }
  7388. } else {
  7389. for(var k in this.selProjectList) {
  7390. var pItem = this.selProjectList[k];
  7391. var pName = pItem.projectName;
  7392. var j = pName;
  7393. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7394. flgs = true
  7395. // formData.append("degreeId", "-1");
  7396. console.log('进入了workFpppp==='+j);
  7397. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7398. if (this.isSubstitude) {
  7399. formData.append('targetUids',this.workForm.userId[0]);
  7400. }
  7401. formData.append("projectId", pItem.id);
  7402. if(this.user.timeType.reportAuditType == 3){
  7403. let audItem = {}
  7404. if(this.user.timeType.auditLevel > 0){
  7405. audItem.auditorFirst = zhoD[j].auditorFirst
  7406. }
  7407. if(this.user.timeType.auditLevel > 1){
  7408. audItem.auditorSec = zhoD[j].auditorSec
  7409. }
  7410. if(this.user.timeType.auditLevel > 2){
  7411. audItem.auditorThird = zhoD[j].auditorThird
  7412. }
  7413. if(zhoD[j].ccUserid){
  7414. audItem.ccUserid = zhoD[j].ccUserid
  7415. }
  7416. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7417. }
  7418. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7419. // formData.append("subProjectId", zhoD[j].subProjectId);
  7420. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7421. formData.append("reportTimeType", this.reportTimeType.type);
  7422. if(this.reportTimeType.type == 1) {
  7423. formData.append("workingTime", zhoD[j].workingTime);
  7424. } else if(this.reportTimeType.type == 2) {
  7425. formData.append("endTime", zhoD[j].time[1]);
  7426. formData.append("startTime", zhoD[j].time[0]);
  7427. } else if(this.reportTimeType.type == 3) {
  7428. formData.append("progress", zhoD[j].progress);
  7429. formData.append("workingTime", zhoD[j].workingTime);
  7430. }
  7431. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7432. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7433. formData.append("isOvertime", 0)
  7434. formData.append("professionProgress", "[]")
  7435. if (zhoD[j].groupId) {
  7436. formData.append("groupId",zhoD[j].groupId)
  7437. } else {
  7438. //解决后台groupId数组越界的问题
  7439. formData.append("groupId",0)
  7440. }
  7441. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7442. formData.append("createDate",zhoD.zhoDataTime)
  7443. if (zhoD[j].projectAuditorId) {
  7444. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7445. }
  7446. if(zhoD[j].basecostId) {
  7447. formData.append("basecostId", zhoD[j].basecostId);
  7448. } else {
  7449. formData.append("basecostId", 0);
  7450. }
  7451. if(this.user.timeType.customDegreeActive){
  7452. if (this.user.timeType.customDegreeMultiple) {
  7453. if (zhoD[j].multiDegrIdArray) {
  7454. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7455. } else {
  7456. formData.append("multiDegrId", "[]");
  7457. }
  7458. } else {
  7459. if (zhoD[j].degreeId) {
  7460. formData.append('degreeId',zhoD[j].degreeId)
  7461. } else {
  7462. formData.append("degreeId", "-1");
  7463. }
  7464. }
  7465. }else{
  7466. formData.append("degreeId", "-1");
  7467. }
  7468. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7469. formData.append('customData',zhoD[j].customData)
  7470. }else if(this.user.timeType.customDataActive){
  7471. formData.append('customData',0)
  7472. }
  7473. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7474. formData.append('customText',zhoD[j].customText)
  7475. }else if(this.user.timeType.customTextActive){
  7476. formData.append('customText','-')
  7477. }
  7478. }
  7479. }
  7480. }
  7481. }
  7482. }
  7483. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7484. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7485. if(!next) {
  7486. this.$message({
  7487. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7488. type: 'error'
  7489. })
  7490. return
  7491. }
  7492. // 自定义维度
  7493. this.submitingReport = true;
  7494. this.http.uploadFile( this.port.report.editPort, formData,
  7495. res => {
  7496. // this.listLoading = false;
  7497. this.submitingReport = false;
  7498. if (res.code == "ok") {
  7499. this.$message({
  7500. message: this.$t('message.fillinsuccessfully'),
  7501. type: "success"
  7502. });
  7503. this.fillWeekDialogVisi = false
  7504. this.selConShow = true
  7505. this.zhoData = []
  7506. this.weekDateRange = ''
  7507. this.getReportList();
  7508. this.getDepartment();
  7509. // 关闭弹窗 并 清空
  7510. this.selProjectList = []
  7511. this.selCon = []
  7512. this.getRecentlyProject()
  7513. } else {
  7514. this.$message({
  7515. message: res.msg,
  7516. type: "error"
  7517. });
  7518. }
  7519. },
  7520. error => {
  7521. this.submitingReport = false;
  7522. this.$message({
  7523. message: error,
  7524. type: "error"
  7525. });
  7526. });
  7527. },
  7528. handleGroupAuditorData(data) {
  7529. const { reportAuditType } = this.user.timeType
  7530. if(reportAuditType != 1 && reportAuditType != 2) {
  7531. return {next: true}
  7532. }
  7533. let arrList = [];
  7534. Object.entries(data).forEach(([key, obj]) => {
  7535. Object.entries(obj).forEach(([projectName, projectData]) => {
  7536. if (projectData.workingTime && !projectData.groupId) {
  7537. arrList.push({
  7538. projectName,
  7539. date: obj.zhoDataTime,
  7540. dateText: obj.zhoDataTimeTxt
  7541. });
  7542. }
  7543. });
  7544. });
  7545. if(arrList.length > 0) {
  7546. return {
  7547. next: false,
  7548. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7549. }
  7550. } else {
  7551. return {
  7552. next: true,
  7553. error: [],
  7554. }
  7555. }
  7556. },
  7557. ChangeHourMinutestr (str) {
  7558. if (str !== "0" && str !== "" && str !== null) {
  7559. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7560. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7561. } else {
  7562. return "";
  7563. }
  7564. },
  7565. // 得到两个日期中间的日期
  7566. getdiffdate(stime,etime){
  7567. //初始化日期列表,数组
  7568. var diffdate = new Array();
  7569. var i=0;
  7570. //开始日期小于等于结束日期,并循环
  7571. while(stime<=etime){
  7572. diffdate[i] = stime;
  7573. //获取开始日期时间戳
  7574. var stime_ts = new Date(stime).getTime();
  7575. //增加一天时间戳后的日期
  7576. var next_date = stime_ts + (24*60*60*1000);
  7577. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7578. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7579. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7580. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7581. stime = next_dates_y+next_dates_m+next_dates_d;
  7582. //增加数组key
  7583. i++;
  7584. }
  7585. return diffdate;
  7586. },
  7587. // 添加模块
  7588. addDomain(i) {
  7589. var leftProgress = 10;
  7590. if (this.reportTimeType.type == 3) {
  7591. //计算已经待分配工时比例
  7592. let array = this.workForm.domains;
  7593. let totalProgress = 0;
  7594. for (var i=0;i<array.length; i++) {
  7595. totalProgress += array[i].progress;
  7596. }
  7597. if (totalProgress < 100) {
  7598. leftProgress = 100 - totalProgress;
  7599. }
  7600. }
  7601. var addItem = {
  7602. projectId: "",
  7603. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7604. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7605. ),
  7606. content: "",
  7607. progress:leftProgress,
  7608. state:2,//2-表示待提交
  7609. multiWorktime: this.reportTimeType.multiWorktime,
  7610. worktimeList:[{}],
  7611. canEdit: true,
  7612. auditorFirst: '',
  7613. auditorSec: '',
  7614. auditorThird: '',
  7615. ccUserid: ''
  7616. // degreeId: '',
  7617. };
  7618. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7619. this.$set(addItem,'isOvertime',true)
  7620. if(this.reportTimeType.type == 3){
  7621. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7622. }
  7623. }
  7624. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7625. //默认给第一个,必填字段
  7626. addItem.basecostId = this.timeBasecostList[0].id;
  7627. }
  7628. this.workForm.domains.push(addItem);
  7629. document.getElementById('workFormsItemBottom').scrollIntoView()
  7630. this.canEdit = true
  7631. if (this.reportTimeType.type == 0) {
  7632. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7633. var length = this.workForm.domains.length;
  7634. if (length == 2) {
  7635. this.showAddMore = false;
  7636. }
  7637. }
  7638. this.chuji()
  7639. this.seleChn()
  7640. },
  7641. // 移除模块
  7642. delDomain(i) {
  7643. this.workForm.domains.splice(i,1)
  7644. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7645. if (!this.originCanEdit) {
  7646. let iscan = false
  7647. for(let i in this.workForm.domains){
  7648. if(this.workForm.domains[i].canEdit){
  7649. iscan = true
  7650. }
  7651. }
  7652. this.canEdit = iscan
  7653. }
  7654. //检测当前剩下的一个,时间类型是否是全天
  7655. if (this.reportTimeType.type == 0) {
  7656. if (this.workForm.domains[0].timeType == 0) {
  7657. this.showAddMore = false;
  7658. } else {
  7659. this.showAddMore = true;
  7660. }
  7661. }
  7662. if(this.user.timeType.multiWorktime == 1) {
  7663. this.iptChangs()
  7664. } else {
  7665. this.seleChn(0)
  7666. }
  7667. },
  7668. // 改变月份
  7669. changeMonth() {
  7670. this.isWeekend = false
  7671. let date = new Date()
  7672. let nowmon = date.getMonth() + 1
  7673. let nowday = date.getDate()
  7674. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7675. if (this.isBatch == 0) {
  7676. if(this.user.timeType.fillAhead == 0){
  7677. let date_a = new Date(this.workForm.createDate)
  7678. if(date_a.getTime() > date.getTime()){
  7679. this.workForm.createDate = nowdate
  7680. }
  7681. }
  7682. //只有按天填报才能获取当天的日报
  7683. if(!this.isSubstitude){
  7684. let weekday = new Date(this.workForm.createDate).getDay()
  7685. if(this.user.companyId == 817){
  7686. if(weekday == 0){
  7687. this.isWeekend = true
  7688. }
  7689. }else{
  7690. if(weekday == 0 || weekday == 6){
  7691. this.isWeekend = true
  7692. }
  7693. }
  7694. this.getReport()
  7695. } else {
  7696. //获取代填人员的考勤
  7697. if (this.user.timeType.showCorpwxCardtime == 1) {
  7698. this.getTargetUserCardTime();
  7699. }
  7700. }
  7701. }else {
  7702. if(this.user.timeType.fillAhead == 0){
  7703. let date_a = new Date(this.workForm.createDate[1])
  7704. if(date_a.getTime() > date.getTime()){
  7705. this.workForm.createDate[1] = nowdate
  7706. let sdate = new Date(this.workForm.createDate[0])
  7707. let edate = new Date(this.workForm.createDate[1])
  7708. if(sdate > edate){
  7709. this.workForm.createDate[0] = this.workForm.createDate[1]
  7710. }
  7711. }
  7712. }
  7713. }
  7714. },
  7715. // 判断时间段
  7716. fns() {
  7717. for (let k in this.dateAr) {
  7718. if (!this.judege(k)) {
  7719. return false
  7720. }
  7721. }
  7722. return true
  7723. },
  7724. judege(idx){
  7725. for (let k in this.dateAr) {
  7726. if (idx !== k) {
  7727. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7728. return false
  7729. }
  7730. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7731. return false
  7732. }
  7733. }
  7734. }
  7735. return true
  7736. },
  7737. getOverlapData(data) {
  7738. let overlapData = [];
  7739. for (let i = 0; i < data.length; i++) {
  7740. for (let j = i + 1; j < data.length; j++) {
  7741. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7742. overlapData.push(data[i], data[j]);
  7743. }
  7744. }
  7745. }
  7746. return overlapData;
  7747. },
  7748. // 保存日报111111
  7749. submitReport(isDraft) {
  7750. this.isDraft = isDraft;
  7751. this.$refs.workForm.validate(valid => {
  7752. if (valid) {
  7753. if (!isDraft) {
  7754. //针对苏州景昱,单独的检查逻辑
  7755. if (this.user.companyId == 5978) {
  7756. //调接口,先检查工时是否存在异常
  7757. var totalTime = 0;
  7758. for (var t=0;t<this.workForm.domains.length; t++) {
  7759. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7760. }
  7761. var array = [];
  7762. if (this.isBatch) {
  7763. var startDate = new Date(this.workForm.createDate[0]);
  7764. var endDate = new Date(this.workForm.createDate[1]);
  7765. if (startDate > endDate) {
  7766. this.$message({
  7767. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7768. type: "error"
  7769. });
  7770. return
  7771. } else {
  7772. while(true){
  7773. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7774. array.push(workData);
  7775. startDate.setDate(startDate.getDate() + 1);
  7776. if (startDate > endDate) {
  7777. break;
  7778. }
  7779. }
  7780. }
  7781. } else {
  7782. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7783. array.push(workData)
  7784. }
  7785. this.submitingReport = true;
  7786. var passUserId = this.user.id;
  7787. if (this.isSubstitude) {
  7788. passUserId = this.targetUids;
  7789. }
  7790. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7791. res => {
  7792. this.submitingReport = false;
  7793. if (res.code == "ok") {
  7794. this.submitReportSon()
  7795. } else {
  7796. this.$confirm(res.msg, this.$t('other.prompts'), {
  7797. confirmButtonText: this.$t('huLveBingTiJiao'),
  7798. cancelButtonText: this.$t('btn.cancel'),
  7799. type: 'error'
  7800. }).then(() => {
  7801. this.submitReportSon()
  7802. }).catch(() => {
  7803. });
  7804. }
  7805. },
  7806. error => {
  7807. this.$message({
  7808. message: error,
  7809. type: "error"
  7810. });
  7811. });
  7812. } else if (this.user.companyId == 469) {
  7813. //试点,针对赛元微电子校验考勤工时
  7814. if (this.workForm.time && this.workForm.time.workHours) {
  7815. if (this.totalReportHours > this.workForm.time.workHours) {
  7816. this.$message({
  7817. message: '填报工时不得超过考勤时长',
  7818. type: "error"
  7819. });
  7820. } else if (this.totalReportHours < this.workForm.time.workHours) {
  7821. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  7822. confirmButtonText: this.$t('btn.determine'),
  7823. cancelButtonText: this.$t('btn.cancel'),
  7824. type: 'warning'
  7825. }).then(() => {
  7826. this.submitReportSon()
  7827. }).catch(() => {
  7828. });
  7829. } else {
  7830. this.submitReportSon();
  7831. }
  7832. } else {
  7833. this.$message({
  7834. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  7835. type: "error"
  7836. });
  7837. }
  7838. } else {
  7839. if(this.totalReportHours < this.user.timeType.allday){
  7840. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7841. confirmButtonText: this.$t('btn.determine'),
  7842. cancelButtonText: this.$t('btn.cancel'),
  7843. type: 'warning'
  7844. }).then(() => {
  7845. this.submitReportSon()
  7846. }).catch(() => {
  7847. });
  7848. }else{
  7849. this.submitReportSon()
  7850. }
  7851. }
  7852. } else {
  7853. //暂存,不需要检查工时是否超过考勤
  7854. this.submitReportSon()
  7855. }
  7856. }
  7857. });
  7858. },
  7859. submitReportSon() {
  7860. this.dateAr = []
  7861. //检查重叠
  7862. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7863. let alp = []
  7864. if(this.user.timeType.multiWorktime != 1) {
  7865. for(var p in this.workForm.domains) {
  7866. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7867. let objs = {}
  7868. objs.s = this.workForm.domains[p].startTime
  7869. objs.e = this.workForm.domains[p].endTime
  7870. alp.push(objs)
  7871. }
  7872. }
  7873. this.dateAr = alp
  7874. if(this.dateAr.length > 0) {
  7875. let trus = this.fns()
  7876. if(!trus) {
  7877. this.$message({
  7878. message: this.$t('message.Filledtimeperiodsoverlap'),
  7879. type: "error"
  7880. });
  7881. return
  7882. }
  7883. }
  7884. } else {
  7885. for(var p in this.workForm.domains) {
  7886. var slll = this.workForm.domains[p]
  7887. for(var o in slll.worktimeList) {
  7888. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7889. let objs = {}
  7890. objs.s = slll.worktimeList[o].startTime
  7891. objs.e = slll.worktimeList[o].endTime
  7892. alp.push(objs)
  7893. }
  7894. }
  7895. }
  7896. this.dateAr = alp
  7897. if(this.dateAr.length > 0) {
  7898. let trus = this.fns()
  7899. if(!trus) {
  7900. this.$message({
  7901. message: this.$t('message.Filledtimeperiodsoverlap'),
  7902. type: "error"
  7903. });
  7904. return
  7905. }
  7906. }
  7907. }
  7908. }
  7909. //检查子项目
  7910. if (this.user.timeType.subProMustFill == 1) {
  7911. for(var p in this.workForm.domains) {
  7912. var oneProItem = this.workForm.domains[p]
  7913. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7914. //没有选择子项目
  7915. this.$message({
  7916. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7917. type: "error"
  7918. });
  7919. return
  7920. }
  7921. }
  7922. }
  7923. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7924. if (this.user.companyId == this.yuzhongCompId) {
  7925. for(var p in this.workForm.domains) {
  7926. var oneProItem = this.workForm.domains[p]
  7927. if (!oneProItem.extraField1) {
  7928. this.$message({
  7929. message: this.$t('jiaoSeBiTianQingJianCha'),
  7930. type: "error"
  7931. });
  7932. return
  7933. }
  7934. if (!oneProItem.extraField2) {
  7935. this.$message({
  7936. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7937. type: "error"
  7938. });
  7939. return
  7940. }
  7941. if (!oneProItem.extraField3) {
  7942. this.$message({
  7943. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7944. type: "error"
  7945. });
  7946. return
  7947. }
  7948. }
  7949. }
  7950. // return
  7951. //代填的情况,检查人员是否已经选择
  7952. if (this.isSubstitude) {
  7953. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7954. this.$message({
  7955. message: this.$t('message.pleaseselectthepersontofillin'),
  7956. type: "error"
  7957. });
  7958. return;
  7959. }
  7960. }
  7961. //检查时间,全天和上下午不能同时存在
  7962. if (this.reportTimeType.type == 0) {
  7963. var alldayNum = 0;
  7964. var amNum = 0;
  7965. var pmNum = 0;
  7966. for(var i in this.workForm.domains) {
  7967. if (this.workForm.domains[i].timeType == 0) {
  7968. alldayNum ++;
  7969. } else if (this.workForm.domains[i].timeType == 1) {
  7970. amNum++;
  7971. } else if (this.workForm.domains[i].timeType == 2) {
  7972. pmNum++;
  7973. }
  7974. }
  7975. if (alldayNum > 1) {
  7976. this.$message({
  7977. // message: "工作时间-全天,只能选择一次",
  7978. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7979. type: "error"
  7980. });
  7981. return;
  7982. }
  7983. if (amNum > 1) {
  7984. this.$message({
  7985. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7986. type: "error"
  7987. });
  7988. return;
  7989. }
  7990. if (pmNum > 1) {
  7991. this.$message({
  7992. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7993. type: "error"
  7994. });
  7995. return;
  7996. }
  7997. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7998. this.$message({
  7999. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8000. type: "error"
  8001. });
  8002. return;
  8003. }
  8004. } else if (this.reportTimeType.type == 3) {
  8005. //总百分比不能超过100%
  8006. let total = 0;
  8007. this.workForm.domains.forEach(w=>{total += w.progress});
  8008. if (total > 100) {
  8009. this.$message({
  8010. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8011. type: "error"
  8012. });
  8013. return;
  8014. } else if (total < 100) {
  8015. this.$message({
  8016. message: this.$t('message.cannotbesubmitted'),
  8017. type: "error"
  8018. });
  8019. return;
  8020. }
  8021. }
  8022. this.listLoading = true;
  8023. let formData = new FormData();
  8024. formData.append("draft", this.isDraft);
  8025. var totalTime = 0;
  8026. for (var t=0;t<this.workForm.domains.length; t++) {
  8027. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8028. }
  8029. //批量填报不校验考勤时长,交给后台校验
  8030. if (!this.isBatch) {
  8031. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8032. if (this.workForm.time){
  8033. if (this.workForm.time.workHours == 0){
  8034. this.$message({
  8035. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8036. type: 'error'
  8037. })
  8038. return
  8039. }
  8040. }else{
  8041. this.$message({
  8042. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8043. type: 'error'
  8044. })
  8045. return
  8046. }
  8047. }
  8048. }
  8049. //针对凡己和景昱,苏州博海,此处不校验考勤时长
  8050. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.workForm.time) {
  8051. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8052. this.$message({
  8053. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8054. type: "error"
  8055. });
  8056. return;
  8057. }
  8058. }
  8059. for(var i in this.workForm.domains) {
  8060. // 检查任务/里程碑是否为必填
  8061. let taskRequired = this.user.timeType.taskRequired
  8062. if(taskRequired == 1) {
  8063. if(!this.workForm.domains[i].taskId) {
  8064. this.$message({
  8065. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8066. type: "error"
  8067. });
  8068. return
  8069. }
  8070. }
  8071. if(this.user.timeType.reportAuditType == 3){
  8072. let audItem = {}
  8073. let auditRule = ''
  8074. if(this.workForm.domains[i].id){
  8075. audItem.reportId = this.workForm.domains[i].id
  8076. }
  8077. if(this.user.timeType.auditLevel > 0){
  8078. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8079. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8080. }
  8081. if(this.user.timeType.auditLevel > 1){
  8082. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8083. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8084. }
  8085. if(this.user.timeType.auditLevel > 2){
  8086. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8087. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8088. }
  8089. if(this.workForm.domains[i].ccUserid){
  8090. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8091. }
  8092. if(auditRule){
  8093. auditRule = auditRule.substring(0,auditRule.length - 1)
  8094. this.$message({
  8095. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8096. type: 'error'
  8097. })
  8098. return
  8099. }
  8100. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8101. }
  8102. if (this.user.timeType.customDegreeActive) {
  8103. if (this.user.timeType.customDegreeMultiple) {
  8104. //多选
  8105. if (this.workForm.domains[i].multiDegrIdArray) {
  8106. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8107. degreeArray = degreeArray.replace(/,/g,"@");
  8108. formData.append("multiDegrId", degreeArray);
  8109. } else {
  8110. formData.append("multiDegrId", '[]');
  8111. }
  8112. } else {
  8113. //单选
  8114. if (this.workForm.domains[i].degreeId) {
  8115. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8116. } else {
  8117. formData.append("degreeId", -1);
  8118. }
  8119. }
  8120. } else {
  8121. formData.append("degreeId", -1);
  8122. }
  8123. if(this.workForm.domains[i].customData) {
  8124. // var sss = this.workForm.domains[i].degreeId.toString()
  8125. formData.append("customData", this.workForm.domains[i].customData);
  8126. } else {
  8127. formData.append("customData", 0);
  8128. }
  8129. if(this.workForm.domains[i].customText) {
  8130. formData.append("customText", this.workForm.domains[i].customText);
  8131. } else {
  8132. formData.append("customText", '-');
  8133. }
  8134. if (this.workForm.domains[i].id) {
  8135. formData.append("id", this.workForm.domains[i].id);
  8136. } else {
  8137. formData.append("id", -1);
  8138. }
  8139. formData.append("projectId", this.workForm.domains[i].projectId);
  8140. if (this.workForm.domains[i].subProjectId) {
  8141. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8142. } else {
  8143. formData.append("subProjectId", 0);
  8144. }
  8145. if (this.workForm.domains[i].groupId) {
  8146. formData.append("groupId", this.workForm.domains[i].groupId);
  8147. } else {
  8148. formData.append("groupId", 0);
  8149. }
  8150. if (this.workForm.domains[i].taskId) {
  8151. formData.append("taskId", this.workForm.domains[i].taskId);
  8152. } else {
  8153. formData.append("taskId", 0);
  8154. }
  8155. if (this.workForm.domains[i].taskFinish == true) {
  8156. formData.append("taskFinish", 1);
  8157. } else {
  8158. formData.append("taskFinish", 0);
  8159. }
  8160. formData.append("reportTimeType", this.reportTimeType.type);
  8161. if (this.reportTimeType.type == 0) {
  8162. formData.append("timeType", this.workForm.domains[i].timeType);
  8163. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8164. formData.append("workingTime", workingTime);
  8165. } else if (this.reportTimeType.type == 1){
  8166. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8167. } else if (this.reportTimeType.type == 2) {
  8168. formData.append("endTime", this.workForm.domains[i].endTime);
  8169. formData.append("startTime", this.workForm.domains[i].startTime);
  8170. } else if (this.reportTimeType.type == 3) {
  8171. //按比例分配
  8172. formData.append("progress", this.workForm.domains[i].progress);
  8173. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8174. }
  8175. if(this.user.timeType.choseFromAlbum == 1 ) {
  8176. console.log(this.workForm.domains[i].imgList)
  8177. if(this.workForm.domains[i].imgList) {
  8178. let imgListFor = this.workForm.domains[i].imgList
  8179. for(var b in imgListFor) {
  8180. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8181. }
  8182. console.log(imgListFor)
  8183. let m = JSON.stringify(imgListFor);
  8184. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8185. formData.append("picStr", m);
  8186. } else {
  8187. formData.append("picStr", '[]');
  8188. }
  8189. }
  8190. //处理多个时间事项
  8191. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8192. if (this.reportTimeType.multiWorktime == 1) {
  8193. //检查时间是否有重叠
  8194. var workList = this.workForm.domains[i].worktimeList;
  8195. for (var j=0;j<workList.length; j++) {
  8196. var curItem = workList[j];
  8197. //检查开始时间是否大于结束时间
  8198. if (curItem.startTime >= curItem.endTime) {
  8199. this.$message({
  8200. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8201. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8202. type: "error"
  8203. });
  8204. return;
  8205. }
  8206. //时间不可重叠
  8207. if (this.reportTimeType.timeCanOverlap == 0) {
  8208. for (var p = j+1;p<workList.length; p++) {
  8209. var jItem = workList[p];
  8210. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8211. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8212. this.$message({
  8213. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8214. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8215. type: "error"
  8216. });
  8217. return;
  8218. }
  8219. }
  8220. }
  8221. }
  8222. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8223. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8224. formData.append("content", m);
  8225. } else {
  8226. if (this.workForm.domains[i].content) {
  8227. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8228. m = m.replace(/,/g,",");
  8229. console.log(m, '需要传值的数据')
  8230. // formData.append("content", this.workForm.domains[i].content);
  8231. formData.append("content", m);
  8232. } else {
  8233. formData.append("content", '-');
  8234. }
  8235. }
  8236. if (this.isBatch == 0) {
  8237. formData.append("createDate", this.workForm.createDate);
  8238. } else {
  8239. //批量填报,时间范围
  8240. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8241. }
  8242. if(this.workForm.domains[i].isOvertime) {
  8243. formData.append("isOvertime", 1);
  8244. } else {
  8245. formData.append("isOvertime", 0);
  8246. }
  8247. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8248. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8249. } else {
  8250. formData.append("overtimeHours", 0);
  8251. }
  8252. if(this.workForm.domains[i].basecostId) {
  8253. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8254. } else {
  8255. formData.append("basecostId", 0);
  8256. }
  8257. if (this.workForm.userId != null) {
  8258. var targetUids = '';
  8259. this.workForm.userId.forEach(u=>{
  8260. targetUids += u + '@';
  8261. });
  8262. if (targetUids.length > 0) {
  8263. targetUids = targetUids.substring(0, targetUids.length -1);
  8264. formData.append("targetUids", targetUids);
  8265. }
  8266. }
  8267. //项目专业进度
  8268. if (this.workForm.domains[i].professionProgress) {
  8269. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8270. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8271. formData.append("professionProgress", m);
  8272. } else {
  8273. formData.append("professionProgress", "[]");
  8274. }
  8275. if (this.workForm.domains[i].stage) {
  8276. formData.append("stage", this.workForm.domains[i].stage);
  8277. } else {
  8278. formData.append("stage", "-");
  8279. }
  8280. if (this.workForm.domains[i].projectAuditorId) {
  8281. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8282. } else {
  8283. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8284. this.$message({
  8285. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8286. type: "error"
  8287. });
  8288. return;
  8289. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8290. //分组负责人先审核, 确定是选择了任务分组
  8291. if (this.workForm.domains[i].taskGroups.length == 0) {
  8292. this.$message({
  8293. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8294. type: "error"
  8295. });
  8296. return;
  8297. } else if (!this.workForm.domains[i].groupId) {
  8298. // console.log(this.workForm.domains[i]);
  8299. this.$message({
  8300. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8301. type: "error"
  8302. });
  8303. return;
  8304. }
  8305. }
  8306. }
  8307. if (this.user.companyId == this.yuzhongCompId) {
  8308. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8309. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8310. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8311. }
  8312. //依斯贝的服务Id
  8313. if (this.user.companyId == this.yisibeiCompId) {
  8314. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8315. }
  8316. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8317. this.$message({
  8318. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8319. type: "error"
  8320. });
  8321. return
  8322. }
  8323. if(this.user.timeType.userWithMultiDept == 1) {
  8324. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8325. }
  8326. }
  8327. this.submitingReport = true;
  8328. this.http.uploadFile( this.port.report.editPort, formData,
  8329. res => {
  8330. this.listLoading = false;
  8331. this.submitingReport = false;
  8332. if (res.code == "ok") {
  8333. if(res.msg!=null){
  8334. this.$message({
  8335. dangerouslyUseHTMLString: true,
  8336. message: res.msg,
  8337. type: "warning",
  8338. showClose: true,
  8339. duration: 0
  8340. });
  8341. }else{
  8342. this.$message({
  8343. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8344. type: "success"
  8345. });
  8346. }
  8347. this.dialogVisible = false;
  8348. this.jsDay = 0
  8349. this.jsTime = 0
  8350. this.getReportList();
  8351. this.getDepartment();
  8352. this.getRecentlyProject()
  8353. } else {
  8354. this.$message({
  8355. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8356. type: "error"
  8357. });
  8358. }
  8359. },
  8360. error => {
  8361. this.listLoading = false;
  8362. this.submitingReport = false;
  8363. this.$message({
  8364. message: error,
  8365. type: "error"
  8366. });
  8367. });
  8368. },
  8369. // 判断是展示那个工时导入
  8370. imports() {
  8371. if(this.user.timeType.syncCorpwxTime == 0) {
  8372. this.importDialog = true
  8373. } else {
  8374. this.importWxDialog = true
  8375. }
  8376. },
  8377. // 跳转
  8378. junpToDeskTop(id) {
  8379. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8380. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8381. },
  8382. // 通过日报
  8383. approve(id, item) {
  8384. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8385. this.approveinData = {
  8386. id: id,
  8387. date: this.date +day,
  8388. reportIds: item.id
  8389. }
  8390. if(this.user.timeType.needEvaluate == 1){
  8391. this.$set(this.approveinData,'evaluate','')
  8392. this.approveinDialog = true
  8393. }else{
  8394. this.logining = true;
  8395. this.approveinfun()
  8396. }
  8397. },
  8398. approveinfun(){
  8399. this.http.post( this.port.report.approve, this.approveinData,
  8400. res => {
  8401. this.logining = false;
  8402. if (res.code == "ok") {
  8403. this.approveinDialog = false
  8404. this.$message({
  8405. message: this.$t('message.Reviewsucceeded'),
  8406. type: "success"
  8407. });
  8408. this.refreshReportData(this.approveinData.reportIds);
  8409. this.getDepartment();
  8410. } else {
  8411. this.$message({
  8412. message: res.msg,
  8413. type: "error"
  8414. });
  8415. }
  8416. },
  8417. error => {
  8418. this.logining = false;
  8419. this.$message({
  8420. message: error,
  8421. type: "error"
  8422. });
  8423. });
  8424. },
  8425. //撤回日报
  8426. cancel(item,e) {
  8427. // console.log('can can need',item);
  8428. this.logining = true;
  8429. var ids = '';
  8430. var data = e ? item : item.data;
  8431. data.forEach(element => {
  8432. if(element.id){
  8433. ids +=(element.id+',');
  8434. }
  8435. });
  8436. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8437. res => {
  8438. this.logining = false;
  8439. if (res.code == "ok") {
  8440. this.$message({
  8441. message:this.$t('message.Withdrawalsucceeded'),
  8442. type: "success"
  8443. });
  8444. this.getReportList();
  8445. if(e){this.getReport()}
  8446. this.getDepartment();
  8447. } else {
  8448. this.$message({
  8449. message: res.msg,
  8450. type: "error"
  8451. });
  8452. }
  8453. },
  8454. error => {
  8455. this.logining = false;
  8456. this.$message({
  8457. message: error,
  8458. type: "error"
  8459. });
  8460. });
  8461. },
  8462. showDenyDialog(id,i, item) {
  8463. this.denyReasonDialog = true;
  8464. this.isDenying = false;
  8465. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8466. var ids = item.id;
  8467. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8468. },
  8469. // 未通过日报
  8470. deny() {
  8471. this.logining = true;
  8472. this.isDenying = true;
  8473. this.http.post( this.port.report.deny, this.denyForm,
  8474. res => {
  8475. this.logining = false;
  8476. this.isDenying = false;
  8477. if (res.code == "ok") {
  8478. this.$message({
  8479. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8480. type: "success"
  8481. });
  8482. this.refreshReportData(this.denyForm.reportIds);
  8483. this.getDepartment();
  8484. this.denyReasonDialog = false;
  8485. } else {
  8486. this.$message({
  8487. message: res.msg,
  8488. type: "error"
  8489. });
  8490. }
  8491. },
  8492. error => {
  8493. this.logining = false;
  8494. this.$message({
  8495. message: error,
  8496. type: "error"
  8497. });
  8498. });
  8499. },
  8500. // 查看工时记录弹窗
  8501. toView() {
  8502. this.toViewDialogVisible = true
  8503. this.toViewloading = true
  8504. this.getToView()
  8505. },
  8506. getToView() {
  8507. this.http.post( '/report-import-log/getList', this.toViewForm,
  8508. res => {
  8509. this.toViewloading = false;
  8510. if (res.code == "ok") {
  8511. // console.log(res.data, '数据数据')
  8512. this.toViewList = res.data.records
  8513. this.toViewForm.total = res.data.total
  8514. } else {
  8515. this.toViewloading = false;
  8516. this.$message({
  8517. message: res.msg,
  8518. type: "error"
  8519. });
  8520. }
  8521. })
  8522. },
  8523. // 触发 selectCat 组件更改他的值
  8524. selectCatCli(obj) {
  8525. // console.log(obj, '看看')
  8526. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8527. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8528. },
  8529. vueCasader(obj) {
  8530. if(obj.distinction == 1 && obj.item) {
  8531. let arr = []
  8532. arr.push(obj.item.value)
  8533. this.exportParam.departmentId = arr
  8534. }
  8535. if(obj.distinction == '10' && obj) {
  8536. const { id, other } = obj
  8537. this.workForm.domains[other].reportTargetDeptId = id
  8538. }
  8539. if(obj.distinction == '14' && obj) {
  8540. let arr = []
  8541. arr.push(obj.id)
  8542. this.deptIdForHasReport = arr
  8543. this.showMonthWorkTime()
  8544. }
  8545. if(obj.distinction == '15' && obj) {
  8546. let arr = []
  8547. arr.push(obj.id)
  8548. this.deptIdForNoReport = arr
  8549. this.showMonthNotWorkTime()
  8550. }
  8551. if(obj.distinction == '16' && obj) {
  8552. let arr = []
  8553. arr.push(obj.id)
  8554. this.deptIdForReminder = arr
  8555. this.showMonthWorkTimeReminder()
  8556. }
  8557. },
  8558. //分页
  8559. handleCurrentChange(val) {
  8560. this.toViewForm.pageIndex = val;
  8561. this.getToView();
  8562. },
  8563. handleSizeChange(val) {
  8564. this.toViewForm.pageSize = val;
  8565. this.getToView();
  8566. },
  8567. getAllUsersList(){
  8568. this.http.post('/user/getSimpleActiveUserList',{
  8569. },res => {
  8570. if(res.code == 'ok'){
  8571. this.allUsersList = res.data
  8572. }else{
  8573. this.$message({
  8574. message: res.msg,
  8575. type: 'error'
  8576. })
  8577. }
  8578. },err => {
  8579. this.$message({
  8580. message: err,
  8581. type: 'error'
  8582. })
  8583. })
  8584. },
  8585. //景昱变更提醒
  8586. changeReminder(item){
  8587. let parameter={
  8588. startDate: this.WorktimeDatepickValue[0],
  8589. endDate: this.WorktimeDatepickValue[1],
  8590. }
  8591. if(item){
  8592. parameter.createDate=item.createDate,
  8593. parameter.userId=item.userId
  8594. }
  8595. this.http.post('/report/changeReminder',parameter,res => {
  8596. if(res.code == 'ok'){
  8597. this.$message({
  8598. message: res.msg,
  8599. type: 'success'
  8600. })
  8601. }else{
  8602. this.$message({
  8603. message: res.msg,
  8604. type: 'error'
  8605. })
  8606. }
  8607. },err => {
  8608. this.$message({
  8609. message: err,
  8610. type: 'error'
  8611. })
  8612. })
  8613. },
  8614. //景昱取消异常
  8615. cancelReminder(item){
  8616. let parameter={}
  8617. if(item){
  8618. parameter.createDate=item.createDate,
  8619. parameter.userId=item.userId
  8620. }
  8621. this.http.post('/report/cancelReminder',parameter,res => {
  8622. if(res.code == 'ok'){
  8623. this.$message({
  8624. message: res.msg,
  8625. type: 'success'
  8626. })
  8627. }else{
  8628. this.$message({
  8629. message: res.msg,
  8630. type: 'error'
  8631. })
  8632. }
  8633. },err => {
  8634. this.$message({
  8635. message: err,
  8636. type: 'error'
  8637. })
  8638. })
  8639. this.showMonthWorkTimeReminder()
  8640. },
  8641. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8642. fillWeekCustomClne() {
  8643. this.fillWeekDialogVisiCustom = false
  8644. },
  8645. fillWeekCustomClneTwo() {
  8646. this.fillWeekDialogVisiCustomTwo = false
  8647. },
  8648. fillWeekCustomSubmit() {
  8649. this.getReportList();
  8650. this.getDepartment();
  8651. this.getRecentlyProject()
  8652. },
  8653. // 待填日报姓名搜索
  8654. nameAearchSeek(flg) {
  8655. if(!this.nameAearch) {
  8656. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8657. return
  8658. }
  8659. if(flg) {
  8660. this.enterpriseWechatgetUser()
  8661. }
  8662. },
  8663. handleThreeData(userList) {
  8664. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8665. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8666. },
  8667. // 过滤树节点
  8668. filterTreeNodes(treeData, filterKeywords) {
  8669. return treeData.filter((node) => {
  8670. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8671. if (node.children && node.children.length > 0) {
  8672. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8673. }
  8674. return true;
  8675. }
  8676. if (node.children && node.children.length > 0) {
  8677. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8678. return node.children.length > 0;
  8679. }
  8680. return false;
  8681. });
  8682. },
  8683. // 企业微信获取人员
  8684. enterpriseWechatgetUser() {
  8685. this.deptMembDataLoading = true
  8686. this.http.post('/user/getEmployeeList',{
  8687. departmentId: -1,
  8688. pageIndex: 1,
  8689. pageSize: 100,
  8690. keyword: this.nameAearch,
  8691. status: '',
  8692. roleId: '',
  8693. cursor: '',
  8694. onlyDirect: '',
  8695. matchingType: ''
  8696. },res => {
  8697. if(res.code == 'ok'){
  8698. this.deptMembDataLoading = false
  8699. const userListName = res.data.records.map(item => item.name)
  8700. this.handleThreeData(userListName)
  8701. setTimeout(() => {
  8702. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8703. }, 200)
  8704. }else{
  8705. this.deptMembDataLoading = false
  8706. this.$message({
  8707. message: res.msg,
  8708. type: 'error'
  8709. })
  8710. }
  8711. },err => {
  8712. this.deptMembDataLoading = false
  8713. this.$message({
  8714. message: err,
  8715. type: 'error'
  8716. })
  8717. })
  8718. },
  8719. changeTreeNodeStatus(node) {
  8720. let allZt = true
  8721. node.expanded = allZt
  8722. for (let i = 0; i < node.childNodes.length; i++) {
  8723. node.childNodes[i].expanded = allZt
  8724. if (node.childNodes[i].childNodes.length > 0) {
  8725. this.changeTreeNodeStatus(node.childNodes[i])
  8726. }
  8727. }
  8728. },
  8729. // 按周填报获取相关任务
  8730. async getWeeklyTaskList(item) {
  8731. const { projectId, groupId, stage, taskId } = item
  8732. let parms = { projectId, isSubstitude: 0 }
  8733. groupId ? parms.groupId = groupId : ''
  8734. stage ? parms.stage = stage : ''
  8735. const { data } = await this.postData('/task/getRecentTask', parms)
  8736. this.zhoBao.taskId = taskId
  8737. this.$set(this.zhoBao, 'taskList', data)
  8738. },
  8739. // 封装 post 请求
  8740. postData(url, params) {
  8741. return new Promise((resolve, reject) => {
  8742. this.http.post(url, { ...params },
  8743. res => {
  8744. resolve(res)
  8745. },
  8746. error => {
  8747. this.$message({
  8748. message: error,
  8749. type: "error"
  8750. });
  8751. reject(error)
  8752. })
  8753. })
  8754. },
  8755. // 自定义事件
  8756. selectCal(obj) {
  8757. if(obj.distinction == '1') {
  8758. this.zhoBao.projectAuditorId = obj.id
  8759. } else if(obj.distinction == '2') {
  8760. this.zhoBao.auditorFirst = obj.id
  8761. } else if(obj.distinction == '3') {
  8762. this.zhoBao.auditorSec = obj.id
  8763. } else if(obj.distinction == '4') {
  8764. this.zhoBao.auditorThird = obj.id
  8765. } else if(obj.distinction == '5') {
  8766. this.zhoBao.ccUserid = obj.id
  8767. } else if(obj.distinction == '12') {
  8768. this.usersListId = obj.id
  8769. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8770. this.searchKeyword = obj.name
  8771. } else {
  8772. this.searchKeyword = ''
  8773. }
  8774. this.searchScreen(0)
  8775. } else if(obj.distinction == '13') {
  8776. this.usersListId = obj.id
  8777. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8778. this.searchKeyword = obj.name
  8779. } else {
  8780. this.searchKeyword = ''
  8781. }
  8782. this.searchScreen(1)
  8783. }
  8784. }
  8785. },
  8786. created() {
  8787. this.getUsers()
  8788. let height = window.innerHeight;
  8789. this.tableHeight = height - 178;
  8790. const that = this;
  8791. window.onresize = function temp() {
  8792. that.tableHeight = window.innerHeight - 178;
  8793. };
  8794. this.toViewForm.companyId = this.user.companyId
  8795. this.initDrag([{
  8796. type: "LR",
  8797. domClass: {
  8798. // 中间分割线的名字
  8799. resize: "line-line",
  8800. // 左侧盒子的名字
  8801. left: "box-left",
  8802. // 右侧盒子的名字
  8803. right: "box-right",
  8804. // 父级的名字
  8805. box: "box-father",
  8806. },
  8807. otherInfo: {
  8808. // 限制左边栏最低宽度
  8809. leftWidth: 120,
  8810. },
  8811. },
  8812. {
  8813. type: "LR",
  8814. domClass: {
  8815. // 中间分割线的名字
  8816. resize: "line-second",
  8817. // 左侧盒子的名字
  8818. left: "left-laowang",
  8819. // 右侧盒子的名字
  8820. right: "box-second-father",
  8821. // 父级的名字
  8822. box: "grand",
  8823. },
  8824. otherInfo: {
  8825. // 限制左边栏最低宽度
  8826. leftWidth: 120,
  8827. },
  8828. },
  8829. ]);
  8830. }
  8831. };
  8832. </script>
  8833. <style lang="scss" scoped>
  8834. .fillWeekDialogVisiCustom {
  8835. width: 100%;
  8836. height: 70vh;
  8837. }
  8838. .fillWeekCustom {
  8839. .el-dialog__body {
  8840. padding: 20px 20px !important;
  8841. }
  8842. }
  8843. .photos {
  8844. position: relative;
  8845. display: flex;
  8846. flex-wrap: wrap;
  8847. }
  8848. .photos_img {
  8849. width: 120px;
  8850. height: 120px;
  8851. margin-right: 20px;
  8852. margin-bottom: 20px;
  8853. cursor: pointer;
  8854. img {
  8855. width: 100%;
  8856. height: 100%;
  8857. }
  8858. }
  8859. .paginatis {
  8860. padding: 10px 10px;
  8861. background: #f2f2f2;
  8862. }
  8863. .waiting {
  8864. color:orange;
  8865. }
  8866. .filledReportStyle {
  8867. color:#32CD32;
  8868. }
  8869. .RejectStyle {
  8870. color:red;
  8871. }
  8872. .waitSubmitStyle{
  8873. color: #409eff;
  8874. }
  8875. .chooseDate {
  8876. .waiting {
  8877. color: #20a0ff;
  8878. }
  8879. .filledReportStyle {
  8880. color:#20a0ff;
  8881. }
  8882. .RejectStyle {
  8883. color: #20a0ff;
  8884. }
  8885. .waitSubmitStyle{
  8886. color: #20a0ff;
  8887. }
  8888. }
  8889. .allDaily {
  8890. width:100%;
  8891. }
  8892. .report_title {
  8893. padding:10px 0;
  8894. color:#666;
  8895. }
  8896. .clearfix {
  8897. overflow-x: auto;
  8898. white-space: nowrap;
  8899. padding: 15px 0 10px 0;
  8900. // overflow-y: hidden;
  8901. .date_item {
  8902. padding: 0 3px;
  8903. cursor: pointer;
  8904. position: relative;
  8905. }
  8906. .chooseDate {
  8907. position: absolute;
  8908. bottom: -3px;
  8909. width: 37px;
  8910. height: 2px;
  8911. left: 14px;
  8912. background: #20a0ff;
  8913. }
  8914. }
  8915. .one_daily {
  8916. i {
  8917. color: #9ed0ff;
  8918. margin-right: 5px;
  8919. }
  8920. .one_daily_body {
  8921. padding: 10px 0px;
  8922. p {
  8923. margin: 0;
  8924. line-height: 30px;
  8925. }
  8926. }
  8927. ul {
  8928. padding: 0;
  8929. }
  8930. }
  8931. .checkbtn {
  8932. float: right;
  8933. margin-top: -10px;
  8934. }
  8935. .selConStyle{
  8936. margin-top:9rem;
  8937. margin-bottom:11rem;
  8938. .selConStyle_title{
  8939. height: 3rem;
  8940. text-align: center;
  8941. font-size: 17px;
  8942. }
  8943. .el-select{
  8944. margin: 0 15%;
  8945. width: 70%;
  8946. }
  8947. }
  8948. </style>
  8949. <style lang="scss">
  8950. /*去除upload组件过渡效果*/
  8951. .photos .el-upload-list__item {
  8952. transition: none !important;
  8953. }
  8954. .daily {
  8955. .el-card__body {
  8956. height: 80%;
  8957. overflow-y: auto;
  8958. }
  8959. .el-card__header {
  8960. padding: 0 20px;
  8961. }
  8962. }
  8963. .membListClass{
  8964. .el-dialog__body{
  8965. padding-top: 10px;
  8966. }
  8967. }
  8968. // .editReportDialog .el-dialog__footer{
  8969. // position: sticky;
  8970. // bottom: 0;
  8971. // background: #fff;
  8972. // height: 70px;
  8973. // z-index: 1010;
  8974. // }
  8975. .editReportDialog{
  8976. min-width: 800px;
  8977. }
  8978. .touruxiangmu{
  8979. max-width: 1000px;
  8980. }
  8981. </style>
  8982. <style scoped>
  8983. /* 项目标签的样式 */
  8984. .el-tag + .el-tag {
  8985. margin-left: 10px;
  8986. }
  8987. .button-new-tag {
  8988. margin-left: 10px;
  8989. height: 32px;
  8990. line-height: 30px;
  8991. padding-top: 0;
  8992. padding-bottom: 0;
  8993. }
  8994. .input-new-tag {
  8995. width: 90px;
  8996. margin-left: 10px;
  8997. vertical-align: bottom;
  8998. }
  8999. .selectworktime .el-table__fixed-body-wrapper{
  9000. top: 48px !important;
  9001. }
  9002. .selectworktime_export .selectworktime_export_l{
  9003. width: 650px;
  9004. float: left;
  9005. height: 42px;
  9006. }
  9007. .approvalProcessBox{
  9008. margin-left: 30px;
  9009. font-size: 14px;
  9010. line-height: 16px;
  9011. cursor: pointer;
  9012. }
  9013. .approvalProcessBox i {
  9014. margin-right: 0;
  9015. height: 16px;
  9016. width: 16px;
  9017. display: inline-block;
  9018. transform: scale(1.2);
  9019. position: relative;
  9020. top: 0.5px;
  9021. color: #409eff;
  9022. }
  9023. .approvalProcessBox .approvalProcessClick{
  9024. cursor: pointer;
  9025. color: #409eff;
  9026. font-size: 14px;
  9027. }
  9028. .approvalProcessBox:hover .approvalProcessClick{
  9029. color: #3485fb;
  9030. }
  9031. </style>
  9032. <style lang="scss" scoped>
  9033. .bionicClass {
  9034. -webkit-appearance: none;
  9035. background-color: #FFF;
  9036. background-image: none;
  9037. border-radius: 4px;
  9038. border: 1px solid #DCDFE6;
  9039. box-sizing: border-box;
  9040. color: #606266;
  9041. display: inline-block;
  9042. height: 40px;
  9043. line-height: 40px;
  9044. outline: 0;
  9045. padding: 0 15px;
  9046. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9047. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9048. width: 350px;
  9049. cursor: pointer;
  9050. .bionicClassText {
  9051. color: #C0C4CC;
  9052. }
  9053. }
  9054. // 加班样式
  9055. .overtime {
  9056. display: inline-block;
  9057. margin-left: 20px;
  9058. input {
  9059. display: inline-block;
  9060. margin-top: 5px;
  9061. }
  9062. }
  9063. .plus {
  9064. display: inline-block;
  9065. }
  9066. // .tages {
  9067. // float: right;
  9068. // }
  9069. .overtime {
  9070. display: inline-block;
  9071. margin-left: 30px;
  9072. }
  9073. .bloks {
  9074. display: inline-block;
  9075. width: 380px;
  9076. }
  9077. .zhiss {
  9078. display: flex;
  9079. justify-content: space-around;
  9080. align-items: center;
  9081. }
  9082. .zhoFel {
  9083. display: flex;
  9084. justify-content: space-between;
  9085. align-items: center;
  9086. }
  9087. // 左右滑动样式
  9088. .line {
  9089. width: 30px;
  9090. /* height: 500px; */
  9091. background: #f2f2f2;
  9092. cursor: w-resize;
  9093. }
  9094. .box-father {
  9095. border: 8px solid #000;
  9096. }
  9097. .line-second {
  9098. width: 10px;
  9099. /* background: red; */
  9100. }
  9101. .flex {
  9102. display: flex;
  9103. width: 100%;
  9104. }
  9105. .box-left {
  9106. flex: 0 0 400px;
  9107. /* height: 600px; */
  9108. /* background: blue; */
  9109. }
  9110. .box-right {
  9111. /* height: 600px; */
  9112. /* background: green; */
  9113. flex: 1;
  9114. }
  9115. .box-postion {
  9116. width: 200px;
  9117. /* height: 400px; */
  9118. background: #ccc;
  9119. }
  9120. .custom-tree-node {
  9121. flex: 1;
  9122. display: flex;
  9123. align-items: center;
  9124. justify-content: space-between;
  9125. font-size: 14px;
  9126. padding-right: 8px;
  9127. }
  9128. .daitianrbao {
  9129. width: 100%;
  9130. box-sizing: border-box;
  9131. height: 40px;
  9132. border-radius: 4px;
  9133. border: 1px solid #DCDFE6;
  9134. overflow: hidden;
  9135. text-overflow: ellipsis;
  9136. display: flex;
  9137. // align-items: center;
  9138. }
  9139. .daitianrbao .spnn {
  9140. display: inline-block;
  9141. box-sizing: border-box;
  9142. padding: 0 15px;
  9143. overflow: hidden;
  9144. text-overflow: ellipsis;
  9145. }
  9146. .daitianrbao .hover {
  9147. color: #DCDFE6 !important;
  9148. }
  9149. </style>