daily.vue 532 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981
  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 class="el-tree-resetStyles" :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="font-size:13px" class="themeFontColor">
  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 && user.timeType.weeklyChargeFilter != 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 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481 || user.companyName == mingyiName)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 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. <!-- 工单号,行号 -->
  277. <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
  278. <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
  279. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  280. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  281. <!-- 自定义日报文本 -->
  282. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  283. <p v-if="user.company.packageEngineering == 1">
  284. {{$t('other.professionalProgress')}}:
  285. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  286. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  287. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhetongguo"></i>
  291. </el-tooltip>
  292. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  293. <i class="iconfont firerock-iconshenhebohui"></i>
  294. </el-tooltip>
  295. </span>
  296. </p>
  297. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  298. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  299. </p>
  300. <div v-if="item2.multiWorktime==0">
  301. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  303. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  304. {{item2.time == '*' ? item2.time : item2.time.toFixed(2)}}h
  305. <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 === '*' ? '*' : item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  306. </p>
  307. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  308. <span style="margin-right:10px;">{{item2.progress}}%</span>
  309. </p>
  310. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  311. </div>
  312. <div v-if="item2.multiWorktime==1" >
  313. <p>{{$t('other.projectDuration')}}:{{item2.time == '*' ? item2.time : 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 === '*' ? '*' : item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  314. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  315. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  316. <p style="display: inline-block;">{{$t('time.duration')}}:
  317. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  318. {{timeItem.time.toFixed(1)}}h
  319. <span v-if="timeItem.detail" style="margin-left:10px;">
  320. {{timeItem.detail}}
  321. </span>
  322. </p>
  323. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  324. </div>
  325. </div>
  326. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  327. <!--照片的显示 -->
  328. <p v-if="item2.pics != null && item2.pics.length > 0">
  329. <el-image v-for="(pic, index) in item2.pics" :key="index"
  330. style="width: 100px; height: 100px; margin-right:10px;"
  331. :src="pic"
  332. :preview-src-list="item2.pics">
  333. </el-image>
  334. </p>
  335. </el-card>
  336. </el-timeline-item>
  337. </el-timeline>
  338. </div>
  339. </div>
  340. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false class="themeFontColor">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  341. <!-- 简陋的无报告提示 -->
  342. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </el-card>
  349. </div>
  350. <!-- 工时推送日志弹窗 -->
  351. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  352. <template>
  353. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  354. </template>
  355. <template>
  356. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  357. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  358. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  359. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  360. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  361. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  362. <template slot-scope="scope">
  363. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  364. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  368. </el-table>
  369. </template>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  372. </span>
  373. </el-dialog>
  374. <!-- 填写日报的dialog -->
  375. <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">
  376. <div style="height: 65vh;overflow: auto;">
  377. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  378. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  379. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  380. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  381. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  382. <span class="spnn" v-if="workForm.userNames">
  383. <span v-for="(item, index) in workForm.userNames" :key="index">
  384. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  385. <span v-if="index < workForm.userNames.length - 1">,</span>
  386. </span>
  387. </span>
  388. <span class="spnn hover" v-else>
  389. {{$t('defaultText.pleaseSelectAsubstitute')}}
  390. </span>
  391. </div>
  392. </el-form-item>
  393. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  394. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  395. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  396. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  397. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  398. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  399. <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>
  400. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  401. v-model="workForm.totalDuration" :precision="1" :step="0.5" :max="yonghuUser.maxReportTime || 12" :min="0.5"></el-input-number>
  402. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  403. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  404. <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>
  405. <template v-if="user.company.companyName === mingyiName">
  406. <span v-if="isBatch">,考勤时长:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  407. <span v-if="!isBatch"> 考勤时长:<span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}},{{workForm.time.workHours}}{{$t('time.hour')}}</span> </span>
  408. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" icon="el-icon-refresh"
  409. @click="refreshAttendance(workForm.createDate)"></el-button>
  410. </template>
  411. <!-- AI智能填报 -->
  412. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  413. </el-form-item>
  414. <!--考勤时长显示-->
  415. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh && user.company.companyName != mingyiName">
  416. <template v-if="user.companyId != 7536">
  417. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  418. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  419. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  420. </span>
  421. </template>
  422. <template v-if="user.companyId == 7536 && workForm.time"> <!--泓浒定制化显示-->
  423. {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  424. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  425. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  426. </template>
  427. <!--批量填报不显示考勤记录-->
  428. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  429. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  430. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  431. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  432. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  433. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  434. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  435. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  436. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  437. v-if="!isBatch && user.timeType.syncDingding==1 && isSubstitude && workForm.userNames" icon="el-icon-refresh"
  438. @click="refreshDDCardTime(workForm.createDate,( workForm.userId && workForm.userId[0]))"></el-button>
  439. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  440. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  441. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  442. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  443. v-if="!isBatch && user.companyId === 7536" icon="el-icon-refresh"
  444. @click="refreshBeiSengAttendanceTwo(workForm.createDate)"></el-button>
  445. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  446. </el-form-item>
  447. <!-- 000000 -->
  448. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  449. <div v-if="reportTimeType.multiWorktime==0">
  450. <el-form-item v-if="reportTimeType.type != 3 && !(permissions.reportHideWorkingHours && workForm.domains[index].state == 1)" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  451. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  452. <el-select v-model="domain.timeType" style="width:200px;"
  453. v-if="reportTimeType.type == 0"
  454. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  455. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  456. @change="onTimeTypeChange(domain.timeType)">
  457. <el-option
  458. v-for="item in timeType"
  459. :key="item.value"
  460. :label="item.label"
  461. :value="item.value">
  462. </el-option>
  463. </el-select>
  464. <!-- 数字时长选择 -->
  465. <el-select v-model="domain.workingTime" style="width:200px;"
  466. v-if="reportTimeType.type == 1"
  467. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  468. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  469. filterable
  470. :allow-create="user.companyId == 469"
  471. default-first-option
  472. @change="seleChn(0,domain)">
  473. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  474. </el-select>
  475. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  476. <span v-if="reportTimeType.type == 2">
  477. <!--时间范围选择 -->
  478. <el-time-picker
  479. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  480. v-model="domain.startTime"
  481. :placeholder="$t('time.startTime')"
  482. style="width:120px;"
  483. format="HH:mm"
  484. value-format="HH:mm"
  485. :picker-options="{
  486. start: '08:00',
  487. end: '23:30'
  488. }"
  489. @change="iptChang()">
  490. </el-time-picker> - <el-time-picker
  491. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  492. v-model="domain.endTime"
  493. :placeholder="$t('time.endTime')"
  494. style="width:120px;"
  495. format="HH:mm"
  496. value-format="HH:mm"
  497. :picker-options="{
  498. start: '08:00',
  499. end: '23:30',
  500. minTime: domain.startTime
  501. }"
  502. @change="iptChang()">
  503. </el-time-picker>
  504. </span>
  505. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  506. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  507. <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>
  508. </div>
  509. </el-form-item>
  510. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  511. :prop="'domains.' + index + '.reportTargetDeptId'"
  512. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  513. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  514. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  515. <span style="float: left">
  516. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  517. </span>
  518. </el-option>
  519. </el-select>
  520. <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>
  521. </el-form-item>
  522. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  523. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  524. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  525. @change="selectProject(domain, index)"
  526. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  527. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  528. <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">
  529. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  530. <span style="float: right;">{{ item.projectName }}</span>
  531. </el-option>
  532. </el-option-group>
  533. </el-select>
  534. <!--昱众不显示子项目-->
  535. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  536. <span style="margin-left:45px;">
  537. {{$t('lable.subproject')}}</span>
  538. <!--子项目 -->
  539. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  541. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  542. </el-select>
  543. </template>
  544. <template v-if="user.companyId == yuzhongCompId">
  545. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  546. <!--角色选择 -->
  547. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  548. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  549. <el-option
  550. v-for="item in roleList"
  551. :key="item.value"
  552. :label="item.label"
  553. :value="item.value">
  554. </el-option>
  555. </el-select>
  556. </template>
  557. <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%;"
  558. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  559. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  560. </el-link>
  561. <!-- <el-link type="primary" v-if="canEdit"
  562. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  563. </el-form-item>
  564. <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">
  565. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  566. </el-form-item>
  567. <!--如果设置了工时成本预警的预算成本项-->
  568. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  569. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  570. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  571. </el-select>
  572. </el-form-item>
  573. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  574. <template slot="label">
  575. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  576. <span >{{$t('lable.taskGrouping')}}</span>
  577. </template>
  578. <!-- 任务分组 -->
  579. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  580. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  581. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  582. </el-select>
  583. <template v-if="user.companyId == yuzhongCompId">
  584. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  585. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  586. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  587. <el-option
  588. v-for="item in domain.filteredRespList"
  589. :key="item.id"
  590. :label="item.jobRespon"
  591. :value="item.id">
  592. </el-option>
  593. </el-select>
  594. </template>
  595. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  596. <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>
  597. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  598. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  599. @change="changeStages(domain, index)"
  600. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  601. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  602. </el-select>
  603. </template>
  604. </el-form-item>
  605. <!-- 工单号,行号 -->
  606. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  607. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" @clear="domain.extraField5 = ''" :disabled="!domain.canEdit" filterable clearable >
  608. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  609. </el-option>
  610. </el-select>
  611. </el-form-item>
  612. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  613. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  614. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  615. </el-option>
  616. </el-select>
  617. </el-form-item>
  618. <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">
  619. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  620. <template slot="label">
  621. <span style="color:#FF0000;">*</span>
  622. <span >{{$t('other.projectAuditor')}}</span>
  623. </template>
  624. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  625. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  626. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  627. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  628. </el-option>
  629. </el-select>
  630. <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>
  631. </el-form-item>
  632. </div>
  633. <el-form-item v-if="user.companyId == yuzhongCompId">
  634. <template slot="label">
  635. <span style="color:#FF0000;">*</span>
  636. <span >{{ $t('gongZuoNeiRong') }}</span>
  637. </template>
  638. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  639. :disabled="(workForm.domains[index].state>=2?false:true)" >
  640. <el-option
  641. v-for="item in domain.workContentList"
  642. :key="item.id"
  643. :label="item.workContext"
  644. :value="item.id">
  645. </el-option>
  646. </el-select>
  647. </el-form-item>
  648. <!-- 111111 -->
  649. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  650. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  651. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  652. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  653. <span v-else>{{item.name}}</span>
  654. </el-option>
  655. </el-select>
  656. <template v-if="user.timeType.auditLevel > 1">
  657. <i class="el-icon-right"></i>
  658. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  659. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  660. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  661. <span v-else>{{item.name}}</span>
  662. </el-option>
  663. </el-select>
  664. </template>
  665. <template v-if="user.timeType.auditLevel > 2">
  666. <i class="el-icon-right"></i>
  667. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  668. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  669. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  670. <span v-else>{{item.name}}</span>
  671. </el-option>
  672. </el-select>
  673. </template>
  674. </el-form-item>
  675. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  676. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  677. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  678. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  679. <span v-else>{{item.name}}</span>
  680. </el-option>
  681. </el-select>
  682. </el-form-item>
  683. <!-- 相关维度/自定义维度 -->
  684. <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'">
  685. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  686. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  687. </el-option>
  688. </el-select>
  689. </el-form-item>
  690. <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'">
  691. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  692. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  693. </el-option>
  694. </el-select>
  695. </el-form-item>
  696. <!-- 相关数值 -->
  697. <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">
  698. <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>
  699. </el-form-item>
  700. <!-- 自定义文本 -->
  701. <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">
  702. <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>
  703. </el-form-item>
  704. <!--按比例填报-->
  705. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  706. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  707. <div style="width:400px;">
  708. <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 = (workForm.totalDuration*domain.progress/100)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  709. <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>
  710. </div>
  711. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  712. <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>
  713. </div>
  714. </el-form-item>
  715. <!--工程专业版本模式下, 各个专业的进度填报 -->
  716. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  717. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  718. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  719. <el-input size="mini" style="width:60px;" v-model="item.progress"
  720. @keyup.native="onProgressChange"
  721. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  722. </span>
  723. </el-form-item>
  724. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  725. <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))" >
  726. <template slot="label" v-if="user.timeType.taskRequired == 1">
  727. <span style="color:#FF0000;">*</span>
  728. <span >{{ $t('other.task') }}</span>
  729. </template>
  730. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  731. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  732. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  733. </el-select>
  734. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  735. </el-form-item>
  736. <!--针对依斯贝的SAP服务-->
  737. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  738. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  739. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  740. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  741. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  742. </el-select>
  743. </el-form-item>
  744. <!--工作事项-->
  745. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  746. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  747. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  748. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  749. </el-form-item>
  750. <!-- 拍照上传 -->
  751. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  752. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  753. <div class="photos">
  754. <div>
  755. <el-upload
  756. list-type="picture-card"
  757. :http-request="(file) => {return addImg(file, index)}"
  758. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  759. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  760. :file-list="domain.imgListUrl" :limit="9"
  761. :disabled="workForm.domains[index].state>=2?false:true">
  762. <i class="el-icon-plus"></i>
  763. </el-upload>
  764. </div>
  765. </div>
  766. </el-form-item>
  767. </div>
  768. <!--多个工作事项填报的情况 -->
  769. <div v-if="reportTimeType.multiWorktime==1">
  770. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  771. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  772. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  773. @change="selectProject(domain, index)"
  774. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  775. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  776. <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">
  777. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  778. <span style="float: right;">{{ item.projectName }}</span>
  779. </el-option>
  780. </el-option-group>
  781. </el-select>
  782. <template v-if="user.timeType.mainProjectState != 1">
  783. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  784. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  785. <!--子项目 -->
  786. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  787. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  788. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  789. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  790. </el-select>
  791. </template>
  792. <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;"
  793. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  794. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  795. </el-link>
  796. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  797. <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>
  798. </div>
  799. <!-- <el-link type="primary" v-if="canEdit"
  800. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  801. </el-form-item>
  802. <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">
  803. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  804. </el-form-item>
  805. <!--如果设置了工时成本预警的预算成本项-->
  806. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  807. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  808. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  809. </el-select>
  810. </el-form-item>
  811. <el-form-item v-if="user.company.packageProject == 1">
  812. <template slot="label">
  813. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  814. <span >{{$t('lable.taskGrouping')}}</span>
  815. </template>
  816. <!-- 任务分组 -->
  817. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  818. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  819. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  820. </el-select>
  821. <!-- 项目的阶段 -->
  822. <span v-if="domain.stages != null && domain.stages.length> 0"
  823. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  824. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  825. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  826. @change="changeStages(domain, index)"
  827. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  828. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  829. </el-select>
  830. </el-form-item>
  831. <el-form-item :label="$t('other.projectAuditor')" >
  832. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  833. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  834. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  835. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  836. </el-option>
  837. </el-select>
  838. <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>
  839. </el-form-item>
  840. <!--工程专业版本模式下, 各个专业的进度填报 -->
  841. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  842. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  843. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  844. <el-input size="mini" style="width:60px;" v-model="item.progress"
  845. @keyup.native="onProgressChange"
  846. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  847. </span>
  848. </el-form-item>
  849. <!-- 相关维度 -->
  850. <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'">
  851. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  852. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  853. </el-option>
  854. </el-select>
  855. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  856. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  857. </el-option>
  858. </el-select>
  859. </el-form-item>
  860. <!-- 相关数值 -->
  861. <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">
  862. <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>
  863. </el-form-item>
  864. <!-- 自定义文本 -->
  865. <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">
  866. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  867. </el-form-item>
  868. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  869. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  870. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  871. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  872. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  873. </el-select>
  874. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  875. </el-form-item>
  876. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  877. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  878. <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>
  879. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  880. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  881. <span v-if="reportTimeType.type == 2">
  882. <!-- <span> -->
  883. <!--时间范围选择 -->
  884. <el-time-picker
  885. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  886. v-model="timeItem.startTime"
  887. :placeholder="$t('time.startTime')"
  888. style="width:120px;"
  889. format="HH:mm"
  890. value-format="HH:mm"
  891. :picker-options="{
  892. start: '00:00',
  893. end: '23:59',
  894. }"
  895. @change="iptChangs()">
  896. </el-time-picker> - <el-time-picker
  897. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  898. v-model="timeItem.endTime"
  899. :placeholder="$t('time.endTime')"
  900. style="width:120px;"
  901. format="HH:mm"
  902. value-format="HH:mm"
  903. :picker-options="{
  904. start: '00:00',
  905. end: '23:59',
  906. minTime: timeItem.startTime
  907. }"
  908. @change="iptChangs()">
  909. </el-time-picker>
  910. </span>
  911. <!--工作细项-->
  912. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0 && user.canFillMoreOption"
  913. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  914. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  915. </el-select>
  916. </el-form-item>
  917. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  918. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  919. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  920. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  921. ></el-input>
  922. </el-form-item>
  923. </div>
  924. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  925. </div>
  926. <!--照片的显示 -->
  927. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  928. <el-image v-for="(pic, index) in domain.pics" :key="index"
  929. style="width: 100px; height: 100px; margin-right:10px;"
  930. :src="pic"
  931. :preview-src-list="domain.pics">
  932. </el-image>
  933. </p>
  934. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  935. </div>
  936. <span id="workFormsItemBottom"></span>
  937. <template v-if="yonghuUser.type != 3">
  938. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  939. </template>
  940. <template v-if="yonghuUser.type == 3">
  941. <el-link v-if="canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  942. </template>
  943. </el-form>
  944. </div>
  945. <span slot="footer" class="dialog-footer">
  946. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  947. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  948. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  949. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  950. <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>
  951. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  952. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  953. </span>
  954. </el-dialog>
  955. <!-- 按周填报 -->
  956. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  957. <!-- 按周填报-已填工时-点击 -->
  958. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  959. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  960. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  961. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  962. <el-table-column prop="state" :label="$t('state.states')">
  963. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  964. </el-table-column>
  965. </el-table>
  966. <span slot="footer" class="dialog-footer">
  967. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  968. </span>
  969. </el-dialog>
  970. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  971. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  972. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  973. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  974. <span class="spnn" v-if="workForm.userNames">
  975. <span v-for="(item, index) in workForm.userNames" :key="index">
  976. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  977. <span v-if="index < workForm.userNames.length - 1">,</span>
  978. </span>
  979. </span>
  980. <span class="spnn hover" v-else>
  981. {{$t('defaultText.pleaseSelectAsubstitute')}}
  982. </span>
  983. </div>
  984. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  985. </div>
  986. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  987. <el-form-item style="height:30px;margin-top:-72px;">
  988. <!-- <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> -->
  989. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  990. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  991. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  992. <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>
  993. <el-option
  994. v-for="item in fillProjectList"
  995. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  996. :key="item.id"
  997. :label="item.projectName + '\u3000' + item.projectCode"
  998. :value="item.id">
  999. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  1000. <span style="float: right">{{ item.projectName }}</span>
  1001. </el-option>
  1002. </el-select>
  1003. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  1004. </el-form-item>
  1005. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  1006. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  1007. <template slot-scope="scope">
  1008. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  1009. </template>
  1010. </el-table-column>
  1011. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  1012. <template slot-scope="scope">
  1013. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  1014. <p v-else></p>
  1015. </template>
  1016. </el-table-column> -->
  1017. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  1018. <template slot-scope="scope">
  1019. <div v-if="scope.row.canFill == 1">
  1020. <template v-if="!(scope.row[item.projectName].state == 1 && permissions.reportHideWorkingHours)">
  1021. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  1022. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  1023. <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)" @input="onInputWorkTime(scope.$index)"></el-input-number>
  1024. <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
  1025. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1026. </div>
  1027. </template>
  1028. <template v-else>
  1029. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1030. <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>
  1031. <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>
  1032. <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>
  1033. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1034. </div>
  1035. </template>
  1036. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1037. <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>
  1038. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1039. </div>
  1040. </template>
  1041. <template v-else>
  1042. <el-link type="success" :underline="false">*(已通过)</el-link>
  1043. </template>
  1044. </div>
  1045. <div v-else >
  1046. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1047. </div>
  1048. </template>
  1049. </el-table-column>
  1050. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1051. <template slot-scope="scope">
  1052. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1053. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1054. </span>
  1055. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1056. </template>
  1057. </el-table-column>
  1058. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1059. <template slot-scope="scope">
  1060. <div class="zhiss">
  1061. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1062. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1063. </div>
  1064. </template>
  1065. </el-table-column>
  1066. </el-table>
  1067. </el-form>
  1068. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1069. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1070. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1071. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1072. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1073. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1074. <!--针对景昱,先检查工时是否存在异常-->
  1075. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1076. </span>
  1077. </el-dialog>
  1078. <!-- 重庆物奇私人定制的按周填报 -->
  1079. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1080. <div class="fillWeekDialogVisiCustom">
  1081. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1082. </div>
  1083. </el-dialog>
  1084. <!-- enableNewWeeklyfill==2 -->
  1085. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1086. <div class="fillWeekDialogVisiCustom">
  1087. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1088. </div>
  1089. </el-dialog>
  1090. <!-- 选择时间 -->
  1091. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1092. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1093. <span slot="footer" class="dialog-footer">
  1094. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1095. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1096. </span>
  1097. </el-dialog>
  1098. <!-- 按周填报弹窗 -->
  1099. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1100. <div>
  1101. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1102. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1103. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1104. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1105. </el-select>
  1106. </div>
  1107. <!--如果设置了工时成本预警的预算成本项-->
  1108. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1109. <p>{{$t('lable.budgetSource')}}</p>
  1110. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1111. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1112. </el-select>
  1113. </div>
  1114. <!-- 任务分组 -->
  1115. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1116. <p>{{$t('lable.taskGrouping')}}</p>
  1117. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1118. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1119. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1120. </el-select>
  1121. </div>
  1122. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1123. <p>{{$t('other.inputStage')}}</p>
  1124. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1125. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1126. </el-select>
  1127. </div>
  1128. <!-- 工单号,行号 -->
  1129. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1130. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1131. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" @clear="zhoBao.extraField5 = ''" filterable style="width: 355px" clearable>
  1132. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1133. </el-option>
  1134. </el-select>
  1135. </div>
  1136. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1137. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1138. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1139. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1140. </el-option>
  1141. </el-select>
  1142. </div>
  1143. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1144. <p>{{$t('other.reviewer')}}</p>
  1145. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1146. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1147. </el-select>
  1148. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1149. </div>
  1150. <template v-if="user.timeType.reportAuditType == 3">
  1151. <div class="zhoFel">
  1152. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1153. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1154. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1155. </el-select>
  1156. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1157. </div>
  1158. <div class="zhoFel">
  1159. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1160. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1161. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1162. </el-select>
  1163. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1164. </div>
  1165. <div class="zhoFel">
  1166. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1167. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1168. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1169. </el-select>
  1170. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1171. </div>
  1172. <div class="zhoFel">
  1173. <p>{{ $t('chao-song-ren') }}</p>
  1174. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1175. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1176. </el-select>
  1177. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1178. </div>
  1179. </template>
  1180. <!-- 自定义维度 -->
  1181. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1182. <p>{{user.timeType.customDegreeName}}</p>
  1183. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1184. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1185. </el-select>
  1186. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1187. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1188. </el-select>
  1189. </div>
  1190. <!-- 自定义数值 -->
  1191. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1192. <p>{{user.timeType.customDataName}}</p>
  1193. <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>
  1194. </div>
  1195. <!-- 自定义文本 -->
  1196. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1197. <p>{{user.timeType.customTextName}}</p>
  1198. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1199. </div>
  1200. <!-- 选择任务 -->
  1201. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1202. <p>{{ $t('renWuLiChengBei') }}</p>
  1203. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1204. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1205. </el-select>
  1206. </div>
  1207. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1208. <p>{{$t('other.timeSelection')}}</p>
  1209. <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>
  1210. </div>
  1211. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1212. <p>{{$t('other.chooseDuration')}}</p>
  1213. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1214. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1215. </el-select>
  1216. </div>
  1217. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1218. <p>{{$t('lable.percentageOfTime')}}</p>
  1219. <div style="width:400px;display: flex;align-items: center;">
  1220. <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>
  1221. <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>
  1222. </div>
  1223. </div>
  1224. <div class="zhoFel">
  1225. <p>{{$t('other.workMatters')}}</p>
  1226. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1227. </div>
  1228. </div>
  1229. <span slot="footer" class="dialog-footer">
  1230. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1231. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1232. </span>
  1233. </el-dialog>
  1234. <!--导出报表条件选择 -->
  1235. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1236. <el-form ref="form3" :model="exportParam" label-width="105px">
  1237. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1238. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1239. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1240. </el-select>
  1241. </el-form-item>
  1242. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1243. <!-- <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>
  1244. <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> -->
  1245. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1246. </el-form-item>
  1247. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1248. <el-date-picker
  1249. v-model="exportParam.dateRange" :editable="false"
  1250. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1251. :range-separator="$t('other.to')"
  1252. type="daterange"
  1253. :start-placeholder="$t('time.startDate')"
  1254. :end-placeholder="$t('time.endDate')"
  1255. ></el-date-picker>
  1256. </el-form-item>
  1257. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1258. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1259. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1260. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1261. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1262. </el-select>
  1263. </el-form-item>
  1264. <el-form-item :label="customConfigurationRow.name" v-if="customConfigurationRow.name">
  1265. <el-select v-model="exportParam.plate" placeholder="请选择" clearable filterable style="width:350px;">
  1266. <el-option v-for="item in customConfigurationRow.subUserCustomList || []" :key="item.id" :label="item.name" :value="item.newId"></el-option>
  1267. </el-select>
  1268. </el-form-item>
  1269. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1270. <div class="exportReportRadio">
  1271. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1272. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1273. <el-tooltip effect="dark" v-if="user.companyId == '936'" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1274. <i class="el-icon-question"></i>
  1275. </el-tooltip>
  1276. <!-- <el-tooltip effect="dark" v-if="user.companyId == '1071'" content="精简日报不含填写审核节点信息和周总结" placement="top-start">
  1277. <i class="el-icon-question"></i>
  1278. </el-tooltip> -->
  1279. </div>
  1280. </el-form-item>
  1281. </el-form>
  1282. <div slot="footer" class="dialog-footer">
  1283. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1284. </div>
  1285. </el-dialog>
  1286. <!--导出报表条件选择 -->
  1287. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1288. <el-form ref="form3" :model="exportParam" >
  1289. <el-form-item prop="range" :label="$t('time.dateRange')">
  1290. <el-date-picker
  1291. v-model="exportParam.dateRange" :editable="false"
  1292. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1293. :clearable="true"
  1294. :range-separator="$t('other.to')"
  1295. type="daterange"
  1296. :start-placeholder="$t('time.startDate')"
  1297. :end-placeholder="$t('time.endDate')"
  1298. ></el-date-picker>
  1299. </el-form-item>
  1300. </el-form>
  1301. <div slot="footer" class="dialog-footer">
  1302. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1303. </div>
  1304. </el-dialog>
  1305. <!--人员列表 -->
  1306. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1307. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1308. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1309. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1310. <el-table-column type="selection"></el-table-column>
  1311. <el-table-column prop="label" :label="$t('lable.name')" >
  1312. <template slot-scope="scope">
  1313. <span>
  1314. <!-- {{(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}} -->
  1315. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1316. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1317. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1318. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1319. </span>
  1320. <span v-else>
  1321. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1322. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1323. </span>
  1324. </span>
  1325. </template>
  1326. </el-table-column>
  1327. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1328. <template slot-scope="scope">
  1329. <div>
  1330. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1331. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1332. </div>
  1333. </template>
  1334. </el-table-column>
  1335. </el-table>
  1336. </el-tab-pane>
  1337. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1338. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1339. <el-table-column prop="label" :label="$t('lable.name')" >
  1340. <template slot-scope="scope">
  1341. <!-- <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> -->
  1342. <!-- <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> -->
  1343. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1344. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1345. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1346. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1347. </span>
  1348. <span v-else>
  1349. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1350. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1351. </span>
  1352. </template>
  1353. </el-table-column>
  1354. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1355. <template slot-scope="scope">
  1356. <div>
  1357. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1358. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1359. </div>
  1360. </template>
  1361. </el-table-column>
  1362. </el-table>
  1363. </el-tab-pane>
  1364. </el-tabs>
  1365. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1366. <el-table-column type="selection"></el-table-column>
  1367. <el-table-column prop="label" :label="$t('lable.name')" >
  1368. <template slot-scope="scope">
  1369. <div>
  1370. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1371. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1372. </div>
  1373. </template>
  1374. </el-table-column>
  1375. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1376. <template slot-scope="scope">
  1377. <div>
  1378. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1379. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1380. </div>
  1381. </template>
  1382. </el-table-column>
  1383. </el-table>
  1384. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1385. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1386. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1387. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1388. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1389. </div>
  1390. </el-dialog>
  1391. <!-- 日报审核修改 -->
  1392. <el-dialog
  1393. :title="$t('riBaoShenHeXiuGai')"
  1394. :visible.sync="reportLogCheckDialog"
  1395. width="30%"
  1396. :before-close="handleClose">
  1397. <el-form ref="form3" :model="exportReportLogParam" >
  1398. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1399. <el-date-picker
  1400. v-model="exportReportLogParam.dateRange" :editable="false"
  1401. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1402. :range-separator="$t('other.to')"
  1403. type="daterange"
  1404. :start-placeholder="$t('time.startDate')"
  1405. :end-placeholder="$t('time.endDate')"
  1406. ></el-date-picker>
  1407. </el-form-item>
  1408. </el-form>
  1409. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1410. <br>
  1411. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1412. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1413. <span slot="footer" class="dialog-footer">
  1414. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1415. </span>
  1416. </el-dialog>
  1417. <!-- 按部门选择人员 -->
  1418. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1419. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1420. <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)">
  1421. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1422. </el-input>
  1423. <div class="tree" style="height:400px">
  1424. <el-scrollbar style="height:100%">
  1425. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1426. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1427. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1428. <span class="custom-tree-node" slot-scope="{ node }">
  1429. <span v-if="user.userNameNeedTranslate == '1'">
  1430. <span v-if="node.data.children">
  1431. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1432. </span>
  1433. <span v-else>
  1434. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1435. </span>
  1436. </span>
  1437. <span v-if="user.userNameNeedTranslate != '1'">
  1438. {{ node.label }}
  1439. </span>
  1440. <!-- {{ node.label }} -->
  1441. </span>
  1442. </el-tree>
  1443. </el-scrollbar>
  1444. </div>
  1445. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1446. <div slot="footer" class="dialog-footer">
  1447. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1448. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1449. </div>
  1450. </el-dialog>
  1451. <el-dialog
  1452. v-if="monthWorkTimeDialog"
  1453. :visible.sync="monthWorkTimeDialog"
  1454. :close-on-click-modal="false"
  1455. customClass="customWidth selectworktime"
  1456. width="92%"
  1457. top="60px"
  1458. >
  1459. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1460. <el-tabs v-model="activeName" @tab-click="handleClick">
  1461. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1462. <div class="selectworktime_export" style="margin-top:10px;">
  1463. <div class="selectworktime_export_l">
  1464. <el-date-picker
  1465. class="selecteworktime_datapick"
  1466. v-model="WorktimeDatepickValue"
  1467. value-format="yyyy-MM-dd"
  1468. type="daterange"
  1469. align="right"
  1470. unlink-panels
  1471. :range-separator="$t('other.to')"
  1472. :start-placeholder="$t('time.startDate')"
  1473. :end-placeholder="$t('time.endDate')"
  1474. :default-time="['12:00:00', '12:00:00']"
  1475. size="small"
  1476. popper-class="selecteorktime_datapick_popper"
  1477. @change="showMonthWorkTime()"
  1478. >
  1479. </el-date-picker>
  1480. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1481. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1482. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1483. <!-- 222 -->
  1484. </div>
  1485. <div>
  1486. <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>
  1487. <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>
  1488. <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">
  1489. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1490. </el-input>
  1491. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1492. </div>
  1493. <div style="float: left; height:32px; padding-top:10px;">
  1494. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1495. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1496. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1497. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1498. </div>
  1499. <div style="float: right; vertical-align: middle;height:32px">
  1500. <el-link
  1501. type="primary"
  1502. @click="exportMembWorkHours()"
  1503. >{{$t('export.exportData')}}</el-link
  1504. >
  1505. </div>
  1506. </div>
  1507. <el-table ref="hasworkTbl"
  1508. :data="monthWorkDataS"
  1509. v-el-table-infinite-scroll="listScroll"
  1510. border
  1511. :height="'70vh'"
  1512. highlight-current-row
  1513. style="width: 100%"
  1514. v-loading="tbload"
  1515. :lazy="true"
  1516. :cell-style="hasworkTblCellStyle"
  1517. >
  1518. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1519. <template slot-scope="scope">
  1520. {{ scope.$index + 1 }}
  1521. </template>
  1522. </el-table-column>
  1523. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1524. <template slot-scope="scope">
  1525. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1526. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1527. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1528. <!-- {{scope.row.name}} -->
  1529. </span>
  1530. </template>
  1531. </el-table-column>
  1532. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1533. <template slot-scope="scope">
  1534. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1535. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1536. </template>
  1537. </el-table-column>
  1538. <el-table-column
  1539. min-width="60"
  1540. v-for="(item, index) in pickDateArray"
  1541. :key="index"
  1542. :label="item"
  1543. align="center"
  1544. >
  1545. <template slot="header" slot-scope="scope">
  1546. <div>{{ scope.column.label.dateStr }}</div>
  1547. <div>{{ scope.column.label.weekStr }}</div>
  1548. </template>
  1549. <template slot-scope="scope">
  1550. <div
  1551. v-if="
  1552. scope.row.worktimeList.filter(
  1553. (w) =>
  1554. w.createDate==item.date
  1555. ).length > 0 &&
  1556. scope.row.worktimeList.filter(
  1557. (w) =>w.createDate==item.date
  1558. )[0].workingTime < reportTimeType.allday
  1559. "
  1560. >
  1561. {{
  1562. scope.row.worktimeList.filter(
  1563. (w) =>w.createDate==item.date
  1564. )[0].workingTime.toFixed(1)
  1565. }}
  1566. </div>
  1567. <div
  1568. v-if="
  1569. scope.row.worktimeList.filter(
  1570. (w) =>w.createDate==item.date
  1571. ).length > 0 &&
  1572. scope.row.worktimeList.filter(
  1573. (w) =>w.createDate==item.date
  1574. )[0].workingTime > reportTimeType.allday
  1575. "
  1576. >
  1577. {{
  1578. scope.row.worktimeList.filter(
  1579. (w) =>w.createDate==item.date
  1580. )[0].workingTime.toFixed(1)
  1581. }}
  1582. </div>
  1583. <div
  1584. v-if="
  1585. scope.row.worktimeList.filter(
  1586. (w) =>w.createDate==item.date
  1587. ).length > 0 &&
  1588. scope.row.worktimeList.filter(
  1589. (w) =>w.createDate==item.date
  1590. )[0].workingTime == reportTimeType.allday
  1591. "
  1592. >
  1593. {{
  1594. scope.row.worktimeList.filter(
  1595. (w) =>w.createDate==item.date
  1596. )[0].workingTime
  1597. }}
  1598. </div>
  1599. <div
  1600. v-if="
  1601. scope.row.worktimeList.filter(
  1602. (w) =>w.createDate==item.date
  1603. ).length == 0
  1604. "
  1605. >
  1606. 0
  1607. </div>
  1608. <div
  1609. v-if="
  1610. scope.row.worktimeList.filter(
  1611. (w) =>w.createDate==item.date
  1612. ).length > 0 &&
  1613. typeof scope.row.worktimeList.filter(
  1614. (w) =>w.createDate==item.date
  1615. )[0].workingTime == 'string'
  1616. "
  1617. >
  1618. {{
  1619. scope.row.worktimeList.filter(
  1620. (w) =>w.createDate==item.date
  1621. )[0].workingTime
  1622. }}
  1623. </div>
  1624. </template>
  1625. </el-table-column>
  1626. </el-table>
  1627. <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>
  1628. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1629. </el-tab-pane>
  1630. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1631. <div class="selectworktime_export" style="margin-top:10px">
  1632. <div class="selectworktime_export_l">
  1633. <el-date-picker
  1634. class="selecteworktime_datapick"
  1635. v-model="WorktimeDatepickValue"
  1636. value-format="yyyy-MM-dd"
  1637. type="daterange"
  1638. align="right"
  1639. unlink-panels
  1640. :range-separator="$t('other.to')"
  1641. :start-placeholder="$t('time.startDate')"
  1642. :end-placeholder="$t('time.endDate')"
  1643. :default-time="['12:00:00', '12:00:00']"
  1644. size="small"
  1645. popper-class="selecteorktime_datapick_popper"
  1646. @change="showMonthNotWorkTime()"
  1647. >
  1648. </el-date-picker>
  1649. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1650. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1651. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1652. </div>
  1653. <div>
  1654. <div style="margin-top:10px;">
  1655. <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>
  1656. <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>
  1657. <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">
  1658. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1659. </el-input>
  1660. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1661. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1662. <el-link
  1663. type="primary"
  1664. style="float: right; vertical-align: middle;height:32px"
  1665. @click="exportMembNotWorkHours()"
  1666. >{{$t('export.exportData')}}</el-link
  1667. >
  1668. </div>
  1669. </div>
  1670. </div>
  1671. <el-table
  1672. ref="hasworkTbl2"
  1673. :data="monthNotWorkDateS"
  1674. v-el-table-infinite-scroll="notListScroll"
  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" :label="$t('lable.department')" prop="department">
  1683. <template slot-scope="scope">
  1684. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1685. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1686. </template>
  1687. </el-table-column>
  1688. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1689. <template slot-scope="scope">
  1690. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1691. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1692. </template>
  1693. </el-table-column>
  1694. <el-table-column
  1695. min-width="200"
  1696. :label="$t('weekDay.date')"
  1697. align="center"
  1698. prop="createDate"
  1699. >
  1700. </el-table-column>
  1701. <el-table-column
  1702. min-width="200"
  1703. :label="$t('state.states')"
  1704. align="center"
  1705. prop="status"
  1706. >
  1707. <template slot-scope="scope">
  1708. <span v-if="scope.row.status == '待提交'" style="color:orange" >{{ scope.row.status }}</span>
  1709. <span v-else-if="scope.row.status == '驳回'" style="color:red" >{{ scope.row.status }}</span>
  1710. <span v-else-if="scope.row.status == '请假'" style="color:green" >{{ scope.row.status }}</span>
  1711. <span v-else >{{ scope.row.status }}</span>
  1712. </template>
  1713. </el-table-column>
  1714. <el-table-column
  1715. min-width="200"
  1716. :label="$t('other.attendanceData')"
  1717. prop="cardTime"
  1718. align="center"
  1719. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1720. </el-table>
  1721. <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>
  1722. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1723. </el-tab-pane>
  1724. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="(user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1 || user.timeType.syncDingding == 1) && user.companyId!=5978">
  1725. <div class="selectworktime_export" style="margin-top:10px">
  1726. <div class="selectworktime_export_l">
  1727. <el-date-picker
  1728. class="selecteworktime_datapick"
  1729. v-model="notfullSelectDateMonth"
  1730. value-format="yyyy-MM"
  1731. type="month"
  1732. align="right"
  1733. unlink-panels
  1734. size="small"
  1735. popper-class="selecteorktime_datapick_popper"
  1736. @change="showReportTimeLessThanCardTimeList()"
  1737. >
  1738. </el-date-picker>
  1739. </div>
  1740. <div>
  1741. <div style="margin-top:10px;">
  1742. <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="showReportTimeLessThanCardTimeList()"></el-cascader>
  1743. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'17'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1744. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(2)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1745. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1746. </el-input>
  1747. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1748. <div style="float: right; vertical-align: middle;height:32px">
  1749. <el-link v-if="user.companyId==7536" style="margin-right: 14px"
  1750. type="primary" v-loading="refreshAttendanceLoading"
  1751. @click="refreshAttendanceCli()" >刷新考勤</el-link>
  1752. <el-link
  1753. type="primary" v-loading="remindering"
  1754. @click="batchRejectAndRemind()" >一键驳回并提醒</el-link>
  1755. <!-- <el-link
  1756. type="primary"
  1757. @click="exportMembWorkHoursReminder()"
  1758. >{{$t('export.exportData')}}</el-link> -->
  1759. </div>
  1760. <!-- <el-link
  1761. type="primary"
  1762. style="float: right; vertical-align: middle;height:32px"
  1763. @click="exportMembNotWorkHours()"
  1764. >{{$t('export.exportData')}}</el-link
  1765. > -->
  1766. </div>
  1767. </div>
  1768. </div>
  1769. <el-table
  1770. ref="hasworkTbl4"
  1771. :data="notFullData"
  1772. border
  1773. :height="'70vh'"
  1774. highlight-current-row
  1775. style="width: 100%"
  1776. v-loading="tbload"
  1777. lazy
  1778. >
  1779. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1780. <template slot-scope="scope">
  1781. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1782. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1783. </template>
  1784. </el-table-column>
  1785. <el-table-column
  1786. min-width="200"
  1787. :label="$t('weekDay.date')"
  1788. align="center"
  1789. prop="createDate"
  1790. >
  1791. </el-table-column>
  1792. <el-table-column
  1793. min-width="200"
  1794. :label="$t('fillReportTime')"
  1795. align="center"
  1796. prop="reportTime"
  1797. />
  1798. <el-table-column
  1799. min-width="200"
  1800. :label="$t('workAttendance')"
  1801. prop="workHours"
  1802. align="center"></el-table-column>
  1803. </el-table>
  1804. </el-tab-pane>
  1805. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1806. <div class="selectworktime_export" style="margin-top:10px;">
  1807. <div class="selectworktime_export_l">
  1808. <el-date-picker
  1809. class="selecteworktime_datapick"
  1810. v-model="WorktimeDatepickValue"
  1811. value-format="yyyy-MM-dd"
  1812. type="daterange"
  1813. align="right"
  1814. unlink-panels
  1815. :range-separator="$t('other.to')"
  1816. :start-placeholder="$t('time.startDate')"
  1817. :end-placeholder="$t('time.endDate')"
  1818. :default-time="['12:00:00', '12:00:00']"
  1819. size="small"
  1820. popper-class="selecteorktime_datapick_popper"
  1821. @change="showMonthWorkTimeReminder()"
  1822. >
  1823. </el-date-picker>
  1824. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1825. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1826. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1827. </div>
  1828. <div>
  1829. <div style="margin-top:10px;">
  1830. <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>
  1831. <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>
  1832. <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">
  1833. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1834. </el-input>
  1835. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1836. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1837. </div>
  1838. </div>
  1839. <div style="float: right; vertical-align: middle;height:32px">
  1840. <el-link
  1841. type="primary" v-loading="remindering"
  1842. @click="changeReminder()"
  1843. >{{ $t('bianGengTiXing') }}</el-link>
  1844. <el-link
  1845. type="primary"
  1846. @click="exportMembWorkHoursReminder()"
  1847. >{{$t('export.exportData')}}</el-link>
  1848. </div>
  1849. </div>
  1850. <el-table ref="hasworkTbl"
  1851. :data="monthWorkDataS"
  1852. v-el-table-infinite-scroll="listScroll"
  1853. border
  1854. :height="'70vh'"
  1855. highlight-current-row
  1856. style="width: 100%"
  1857. v-loading="tbload"
  1858. :lazy="true"
  1859. >
  1860. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1861. <template slot-scope="scope">
  1862. {{ scope.row.createDate}}
  1863. </template>
  1864. </el-table-column>
  1865. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1866. <template slot-scope="scope">
  1867. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1868. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1869. <!-- {{scope.row.name}} -->
  1870. </template>
  1871. </el-table-column>
  1872. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1873. <template slot-scope="scope">
  1874. {{scope.row.invokeValue}}
  1875. </template>
  1876. </el-table-column>
  1877. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1878. <template slot-scope="scope">
  1879. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1880. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1881. </template>
  1882. </el-table-column>
  1883. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1884. <template slot-scope="scope">
  1885. {{ scope.row.workingTime}}
  1886. </template>
  1887. </el-table-column>
  1888. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1889. <template slot-scope="scope">
  1890. {{ scope.row.cardTime}}
  1891. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1892. </template>
  1893. </el-table-column>
  1894. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1895. <template slot-scope="scope">
  1896. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1897. </template>
  1898. </el-table-column>
  1899. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1900. <template slot-scope="scope">
  1901. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1902. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1903. </template>
  1904. </el-table-column>
  1905. </el-table>
  1906. <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>
  1907. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1908. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1909. <label style="font-size: 16px">员工每日已填报工时数</label>
  1910. <el-link
  1911. type="primary"
  1912. style="float: right; margin-right: 60px"
  1913. @click="exportMembWorkHours()"
  1914. >导出已填报数据</el-link
  1915. > -->
  1916. <!-- <el-button >导出</el-button> -->
  1917. <!-- </div> -->
  1918. </el-tab-pane>
  1919. </el-tabs>
  1920. </el-dialog>
  1921. <!--驳回弹出框 -->
  1922. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1923. <div>
  1924. <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')" />
  1925. </div>
  1926. <div slot="footer" class="dialog-footer">
  1927. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1928. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1929. </div>
  1930. </el-dialog>
  1931. <!-- 通过弹出框 -->
  1932. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1933. <div>
  1934. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1935. </div>
  1936. <div slot="footer" class="dialog-footer">
  1937. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1938. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1939. </div>
  1940. </el-dialog>
  1941. <!--批量导入日报 -->
  1942. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1943. <p>1. {{$t('other.download')}}
  1944. <el-link v-if="user.companyId == 8264 || user.companyId == 8261 || user.companyId == 8138 || user.companyId == 8268" style="margin-left:5px;"
  1945. :underline="false" href="./upload/员工工时导入模板_zhengbei.xlsx" download="员工工时导入模板_zhengbei.xlsx">员工工时导入模板_zhengbei.xlsx</el-link>
  1946. <el-link v-else 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>
  1947. </p>
  1948. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1949. <p style="display: flex;justify-content: center;">
  1950. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1951. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1952. </el-upload>
  1953. </p>
  1954. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1955. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1956. </div>
  1957. </el-dialog>
  1958. <!-- 工时导入记录弹窗 -->
  1959. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1960. <div style="height: 452px">
  1961. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1962. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1963. <el-table-column prop="userName" :label="$t('other.operator')">
  1964. <template slot-scope="scope">
  1965. <div>
  1966. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1967. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1968. </div>
  1969. </template>
  1970. </el-table-column>
  1971. <el-table-column prop="datel" :label="$t('other.document')">
  1972. <template slot-scope="scope">
  1973. <div>
  1974. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1975. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1976. </div>
  1977. </template>
  1978. </el-table-column>
  1979. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1980. <template slot-scope="scope">
  1981. <div>
  1982. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1983. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1984. </div>
  1985. </template>
  1986. </el-table-column>
  1987. </el-table>
  1988. <el-col :span="24" class="paginatis">
  1989. <el-pagination
  1990. @size-change="handleSizeChange"
  1991. @current-change="handleCurrentChange"
  1992. :page-sizes="[20 , 50 , 80 , 100]"
  1993. :page-size="20"
  1994. layout="total, sizes, prev, pager, next"
  1995. :total="toViewForm.total"
  1996. style="float:right;"
  1997. ></el-pagination>
  1998. </el-col>
  1999. </div>
  2000. </el-dialog>
  2001. <!--基于企业微信考勤数据的工时导入 -->
  2002. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  2003. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  2004. <el-step :title="$t('other.selectadaterangetoimporthours')">
  2005. </el-step>
  2006. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  2007. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  2008. </el-steps>
  2009. <div v-if="active==0" style="padding:30px;height:360px;">
  2010. <div style="margin-top:50px;margin-left:280px;">
  2011. <el-date-picker
  2012. v-model="importWxParam.date" :editable="false"
  2013. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2014. :clearable="true"
  2015. :range-separator="$t('other.to')"
  2016. type="daterange"
  2017. :start-placeholder="$t('time.startDate')"
  2018. :end-placeholder="$t('time.endDate')"
  2019. @change="loadCheckInData"
  2020. ></el-date-picker>
  2021. </div>
  2022. </div>
  2023. <div v-if="active==1" style="padding:10px;">
  2024. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  2025. style="width: 100%;margin-top:5px;" >
  2026. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  2027. <template slot-scope="scope">
  2028. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  2029. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  2030. </template>
  2031. </el-table-column>
  2032. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  2033. </el-table-column>
  2034. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  2035. <el-table-column prop="username" :label="$t('screening.employeename')" >
  2036. <template slot-scope="scope">
  2037. <div>
  2038. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2039. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2040. </div>
  2041. </template>
  2042. </el-table-column>
  2043. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  2044. <template slot-scope="scope">
  2045. <div>
  2046. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  2047. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  2048. </div>
  2049. </template>
  2050. </el-table-column>
  2051. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  2052. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  2053. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  2054. <template slot-scope="scope">
  2055. {{scope.row.workHours.toFixed(1)}}h
  2056. </template>
  2057. </el-table-column>
  2058. </el-table>
  2059. </div>
  2060. <div v-if="active==2" >
  2061. <p style="display: flex;justify-content: center;height:390px;">
  2062. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2063. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2064. </el-upload>
  2065. </p>
  2066. </div>
  2067. <div slot="title">
  2068. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2069. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2070. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2071. <el-link v-if="active==0 && ((showHidden && user.companyId == 469) || user.companyId == 7703 || user.companyId == 7544) && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2072. <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>
  2073. <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>
  2074. </div>
  2075. <span slot="footer">
  2076. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2077. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2078. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2079. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2080. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2081. </span>
  2082. </el-dialog>
  2083. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2084. <p style="display: flex;justify-content: center;height:100px;">
  2085. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2086. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2087. </el-upload>
  2088. </p>
  2089. </el-dialog>
  2090. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2091. <div>
  2092. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2093. v-model="deleteReportParam.date" :editable="false"
  2094. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2095. :clearable="true"
  2096. :range-separator="$t('other.to')"
  2097. type="daterange"
  2098. :start-placeholder="$t('time.startDate')"
  2099. :end-placeholder="$t('time.endDate')"
  2100. ></el-date-picker>
  2101. </div>
  2102. <div style="margin-top:10px;">
  2103. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2104. <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>
  2105. <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>
  2106. </div>
  2107. <div style="margin-top:10px;">
  2108. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2109. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2110. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2111. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2112. <span v-else>{{item.name}}</span>
  2113. </el-option>
  2114. </el-select>
  2115. </div>
  2116. <span slot="footer">
  2117. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2118. </span>
  2119. </el-dialog>
  2120. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2121. <div>
  2122. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2123. v-model="deleteReportParam.date" :editable="false"
  2124. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2125. :clearable="true"
  2126. :range-separator="$t('other.to')"
  2127. type="daterange"
  2128. :start-placeholder="$t('time.startDate')"
  2129. :end-placeholder="$t('time.endDate')"
  2130. ></el-date-picker>
  2131. </div>
  2132. <div style="margin-top:15px;">
  2133. <span>{{ $t('other.selectdepartment') }}:</span>
  2134. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2135. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2136. size="small" v-if="user.userNameNeedTranslate != 1"
  2137. ></el-cascader>
  2138. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2139. </div>
  2140. <span slot="footer">
  2141. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2142. </span>
  2143. </el-dialog>
  2144. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2145. <div>
  2146. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2147. v-model="modImportTime"
  2148. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2149. :clearable="true"
  2150. type="datetime"
  2151. ></el-date-picker>
  2152. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2153. v-model="modImportUserId"
  2154. >
  2155. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2156. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2157. <span v-else>{{item.name}}</span>
  2158. </el-option>
  2159. </el-select>
  2160. </div>
  2161. <span slot="footer">
  2162. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2163. </span>
  2164. </el-dialog>
  2165. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2166. <div>
  2167. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2168. <el-date-picker
  2169. v-model="ratioYmonth" :editable="false"
  2170. format="yyyyMM" value-format="yyyyMM"
  2171. type="month"
  2172. ></el-date-picker>
  2173. </div>
  2174. <span slot="footer">
  2175. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2176. </span>
  2177. </el-dialog>
  2178. <!--工时批量代填 -->
  2179. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2180. <div>
  2181. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2182. v-model="importWxParam.date" :editable="false"
  2183. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2184. :clearable="true"
  2185. :range-separator="$t('other.to')"
  2186. type="daterange"
  2187. :start-placeholder="$t('time.startDate')"
  2188. :end-placeholder="$t('time.endDate')"
  2189. @change="loadCheckInData"
  2190. ></el-date-picker>
  2191. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2192. </div>
  2193. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2194. :key="timeStamp"
  2195. style="width: 100%;margin-top:5px;" ref="tab">
  2196. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2197. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2198. <template slot-scope="scope">
  2199. <div>
  2200. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2201. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2202. </div>
  2203. </template>
  2204. </el-table-column>
  2205. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2206. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2207. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2208. <template slot-scope="scope">
  2209. {{scope.row.workHours.toFixed(1)}}h
  2210. </template>
  2211. </el-table-column>
  2212. <!--项目名称列表 -->
  2213. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2214. <template slot-scope="scope">
  2215. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2216. </template>
  2217. </el-table-column>
  2218. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2219. <template slot-scope="scope">
  2220. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2221. </template>
  2222. </el-table-column>
  2223. </el-table>
  2224. </el-dialog>
  2225. <!--基于企业微信考勤数据的工时导入 -->
  2226. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2227. <div style="padding-bottom:10px;">
  2228. <p>{{importResultMsg}}</p>
  2229. </div>
  2230. <!-- <span slot="footer" class="dialog-footer">
  2231. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2232. </span> -->
  2233. </el-dialog>
  2234. <!-- 审核流程展示 -->
  2235. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2236. <div style="padding:20px 40px 20px 0">
  2237. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2238. <el-step title="待提交"></el-step>
  2239. <el-step title="员工提交"></el-step>
  2240. <el-step title="审核通过"></el-step>
  2241. </el-steps>
  2242. <el-divider v-if="user.companyId == 7544"></el-divider>
  2243. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2244. <el-timeline :reverse="false" style="margin-top:10px;">
  2245. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2246. <!-- {{item.msg}} -->
  2247. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2248. <span v-if="user.userNameNeedTranslate == 1">
  2249. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2250. <span>{{item.msgCon.two}}</span>
  2251. </span>
  2252. </el-timeline-item>
  2253. </el-timeline>
  2254. </div>
  2255. </el-dialog>
  2256. <!-- 威派格定制 -->
  2257. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2258. </section>
  2259. </template>
  2260. <script>
  2261. // 左右滑动
  2262. import dragMixin from "@/common/js/tensile.js";
  2263. import util from "../../common/js/util";
  2264. // 自定义select组件
  2265. import selectCat from "@/components/select.vue"
  2266. // 引入自定义级联组件
  2267. import vueCascader from "@/components/cascader.vue"
  2268. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2269. // 重庆物奇定制组件
  2270. import WeeklyCustomization from "./weeklyCustomization.vue"
  2271. // 威派格定制转移工时
  2272. import TransferWorkingHours from "./transferWorkingHours.vue"
  2273. // 新的按周填报
  2274. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2275. import { mapMutations } from 'vuex'
  2276. let _that = this
  2277. export default {
  2278. mixins: [dragMixin],
  2279. components: {
  2280. selectCat,
  2281. vueCascader,
  2282. WeeklyCustomization,
  2283. vueMultipleDept,
  2284. TransferWorkingHours,
  2285. NewWeeklyCustomization
  2286. },
  2287. data() {
  2288. return {
  2289. remindering: false,
  2290. onlyHaveAttendance: false,
  2291. notFullData:[],
  2292. notFullOriginList:[],
  2293. singleDate:1,
  2294. subFillProjectList:[],
  2295. curAuditNode: 1,
  2296. refreshingTime: false,
  2297. substitudeStep: 1,
  2298. showHidden: false,
  2299. pageIndex: 0,
  2300. hasMore: true,
  2301. exportType: 0,
  2302. exportingData: false,
  2303. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2304. jobResponseList:[],
  2305. yisibeiCompId: 3092,
  2306. yuzhongCompId: 3385,
  2307. mingyiName : '成都明夷电子科技股份有限公司',
  2308. // mingyiName : '明夷',
  2309. modItemDataId: null,
  2310. modImportTime: null,
  2311. modImportUserId: null,
  2312. showModImportTimeDialog: false,
  2313. showBatchSimpleApproveReport: false,
  2314. startDeleting: false,
  2315. showBatchDeleteReport: false,
  2316. deleteReportParam: {date:null, userIds:[]},
  2317. isDenying: false,
  2318. targetWeekDate: null,//填写周报中的周日期
  2319. importCardTimeVisi: false,
  2320. startRatioExporting: false,
  2321. exportUserRatio: false,
  2322. ratioYmonth:null,
  2323. hasWrittenReport: false,
  2324. today:null,
  2325. syncTimeLoading: false,
  2326. seluserText: '',
  2327. translation: '1', // 1、文字, 2、部门, 3、人员
  2328. exportLoad: false,
  2329. getPickerOptions: {
  2330. disabledDate: (time) => {
  2331. var date = new Date();
  2332. var year = date.getFullYear();
  2333. var month = date.getMonth() + 1;
  2334. if (month >= 1 && month <= 9) {
  2335. month = "0" + month;
  2336. }
  2337. var currentdate = year.toString() + month.toString();
  2338. var timeyear = time.getFullYear();
  2339. var timemonth = time.getMonth() + 1;
  2340. if (timemonth >= 1 && timemonth <= 9) {
  2341. timemonth = "0" + timemonth;
  2342. }
  2343. var timedate = timeyear.toString() + timemonth.toString();
  2344. if(this.user.timeType.fillAhead == 0){
  2345. return currentdate < timedate;
  2346. }else{
  2347. return false
  2348. }
  2349. }
  2350. },
  2351. alalal: '8.0',
  2352. timeBasecostList:null,
  2353. tbload: false,
  2354. exportTimeDialog: false,
  2355. searchKeyword: '',
  2356. monthWorkDataS: [],
  2357. monthNotWorkDateS: [],
  2358. pickDateArray:[],
  2359. WorktimeDatepickValue: [],
  2360. activeName:"first",
  2361. isLeave: 0,
  2362. submitingReport: false,
  2363. importResultMsg:null,
  2364. showImportResult:false,
  2365. importingData: false,
  2366. isDraft: 0,
  2367. timeStamp: 0,
  2368. projectColumns:[],
  2369. checkinLoading:false,
  2370. importWxParam:{date:null,},
  2371. active:0,
  2372. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2373. importWxDialog:false,
  2374. importDialog:false,
  2375. denyForm:null,
  2376. denyReasonDialog:false,
  2377. monthWorkTimeDialog: false,
  2378. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2379. isSubstitude:false,
  2380. isFill:false,
  2381. unFillList:[],
  2382. fillList:[],
  2383. fillMembList:[],
  2384. fillMembList_leave: [],
  2385. membListVisible: false,
  2386. isBatch:0,//是否是批量填报
  2387. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2388. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2389. 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')],
  2390. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2391. fillStatusList: [],
  2392. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2393. exportReportLogParam:{dateRange:[]},
  2394. exportDialog:false,
  2395. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2396. subProjectList:[],
  2397. canEdit: true,
  2398. originCanEdit: true,
  2399. 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],
  2400. selectTime:null,
  2401. reportTimeType:{},
  2402. curDate:'',
  2403. isAllSelect: false,
  2404. approveDialogVisible:false,
  2405. deptId:null,
  2406. targetUid: null,
  2407. membCount:0,
  2408. selectState:"-1",
  2409. user: JSON.parse(sessionStorage.getItem("user")),
  2410. allUsersList: [],
  2411. showAddMore:false,
  2412. allDate: [],
  2413. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2414. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2415. choseDay: 0,
  2416. tableHeight: 0,
  2417. listLoading: false,
  2418. projectList: [], //项目列表
  2419. fillProjectList: [],
  2420. reportList: [], //日报列表
  2421. reportNames:[], //批量审批列表
  2422. selCon:[], //筛选条件
  2423. selProjectList:[], //筛选后项目列表
  2424. selConShow: true,
  2425. usersList: [], // 全部人员列表
  2426. usersListId: '', // 选中的人员id
  2427. dialogVisible: false, //项目弹窗
  2428. report: '',
  2429. workForm: {
  2430. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2431. domains: [{
  2432. id: null,
  2433. projectId: "",
  2434. workingTime: "",
  2435. timeType:0,
  2436. content: "",
  2437. state: 2,
  2438. multiWorktime:0,
  2439. worktimeList:[],
  2440. degreeId: null,
  2441. auditUserList: [],
  2442. }],
  2443. showRefresh: false,
  2444. },
  2445. workRules: {
  2446. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2447. },
  2448. chooseParticipVisible: false,
  2449. logining: false,
  2450. isDisable: false,
  2451. timeType:[],
  2452. deptMembData: [
  2453. ],
  2454. //部门人员树状结构
  2455. data: [
  2456. {
  2457. id: -1,
  2458. label: this.$t('lable.allStaff'),
  2459. membCount:0
  2460. },
  2461. {
  2462. id: 0,
  2463. label: this.$t('lable.unassigned'),
  2464. }
  2465. ],
  2466. allData:{},
  2467. batchShowData:{},
  2468. option: [],
  2469. deptOptionList: [],
  2470. depData: {
  2471. id: -1,
  2472. label: this.$t('lable.allStaff'),
  2473. },
  2474. defaultProps: {
  2475. children: 'children',
  2476. label: 'label'
  2477. },
  2478. isNew: false,
  2479. selected: false,
  2480. valuet: new Date(),
  2481. domObj: null,
  2482. participator:[],
  2483. chosenMembCount:0,
  2484. jsDay: 0,
  2485. jsTime: 0,
  2486. falsss: false,
  2487. weidu: [],
  2488. weiduList: [],
  2489. yonghuUser: [],
  2490. dateAr: [],
  2491. batchSubFillDialog: false,
  2492. isSubstiS: false,
  2493. fillWeekDialogVisi: false,
  2494. fillWeekDialogVisiCustom: false,
  2495. fillWeekDialogVisiCustomTwo: false,
  2496. zhoData: [],
  2497. weekDateRange: [],
  2498. btnZho: false,
  2499. weekDataLoading: false,
  2500. changdu: 6,
  2501. tianxieDialogVisible: false,
  2502. scopess: {},
  2503. zhoBao: {
  2504. time: '',
  2505. workingTime: '',
  2506. progress: '',
  2507. con: '',
  2508. subProjectId: '',
  2509. stage: '',
  2510. subProjectList: [],
  2511. stages: [],
  2512. },
  2513. zhoBaoIdx: '',
  2514. zhoBaoName: '',
  2515. zhis: {},
  2516. dealList: [],
  2517. toViewDialogVisible: false,
  2518. toViewList: [],
  2519. toViewloading: true,
  2520. toViewForm: {
  2521. pageIndex: '1',
  2522. pageSize: '20',
  2523. total: 0,
  2524. },
  2525. toViewloadings: false,
  2526. tabPositionss: 'top',
  2527. monthTotal: 0,
  2528. monthTotalPage: 0,
  2529. monthTotalLages: 20,
  2530. monthWorkData: [],
  2531. monthNotWorkDate: [],
  2532. monthWorkDataS1: [],
  2533. monthnotTotal: 0,
  2534. monthnotTotalPage: 0,
  2535. monthnotTotalLages: 20,
  2536. monthNotWorkDateS1: [],
  2537. deptMembDataText: '',
  2538. isFlag: false,
  2539. isMore: false,
  2540. stateKey: '0',
  2541. expandDate: [],
  2542. notifySelList:[],
  2543. departmentList: [],
  2544. trandepartmentList:[],
  2545. approvalProcessDialog: false,
  2546. approvalProcessData: [],
  2547. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2548. 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')],
  2549. isWeekend: false,
  2550. canCancelInDialog: false,
  2551. approveinData: {},
  2552. approveinDialog: false,
  2553. reportCanDelete: false,
  2554. weeklyFilledTimeDialog: false,
  2555. weeklyFilledTimeList: [],
  2556. weeklyFilledTimeLoading: false,
  2557. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2558. weeklyFilledTimeCanDelete: false,
  2559. weeklyFilledTimeDate: null,
  2560. leaveAllNum: 0,
  2561. dataLoading: false,
  2562. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2563. vacationTime: {},
  2564. integrationProjectList: [],
  2565. totalReportHours: 0, // 合计的工时
  2566. workTimeForMinYi:0,
  2567. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2568. weekIndex: 1,
  2569. weekParentData: {},
  2570. deptIdForNoReport:[],
  2571. deptIdForReminder:[],
  2572. nameAearch: '', // 企业微信姓名搜索
  2573. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2574. deptMembDataLoading: false,
  2575. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2576. {
  2577. id: 4811,
  2578. // id: 10,
  2579. name: '陕西柘中建设工程有限公司'
  2580. }
  2581. ],
  2582. pushWorkTimeLogDig:false,
  2583. pushWorkTimeLogData:[],
  2584. userReportDeptList: [],
  2585. isReminder:true,
  2586. reportLogCheckDialog:false,
  2587. deptIdForHasReport:[],
  2588. transferWorkingHoursVisable: false,
  2589. multiOptionData:[],
  2590. businessTripsArray: [],
  2591. refreshAttendanceLoading: false,
  2592. customConfigurationRow: {
  2593. subUserCustomList: []
  2594. }
  2595. };
  2596. },
  2597. watch: {
  2598. deptMembDataText(val) {
  2599. this.$refs.chooseMembTree.filter(val);
  2600. }
  2601. },
  2602. filters: {
  2603. // 过滤
  2604. amounts(value) {
  2605. if(value == '*') {
  2606. return '*'
  2607. }
  2608. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2609. return 0
  2610. }
  2611. var zhi = +value + 0
  2612. return zhi.toFixed(1)
  2613. },
  2614. // zhoData
  2615. zhoData(value, arr) {
  2616. var dateArray = value.split("-");
  2617. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2618. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2619. // console.log(arr[date.getDay()])
  2620. // return "周" + "日一二三四五六".charAt(date.getDay());
  2621. return arr[date.getDay()]
  2622. },
  2623. // 过滤数字
  2624. numbers(value) {
  2625. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2626. return 0
  2627. }
  2628. return value
  2629. },
  2630. },
  2631. computed: {},
  2632. mounted() {
  2633. var now = new Date();
  2634. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2635. this.today = t;
  2636. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2637. this.exportParam.dateRange = [startStr,t];
  2638. this.exportReportLogParam.dateRange = [startStr,t];
  2639. this.getAllDate(1);
  2640. this.getReportList();
  2641. this.getProjectList();
  2642. this.getFillProjectList();
  2643. this.getTimeType();
  2644. this.getDepartment();
  2645. this.scrollFunction()
  2646. this.userssHu();
  2647. this.getFirstAndLastDay()
  2648. this.getMultiOptionData();
  2649. if(this.user.timeType.reportAuditType == 3){
  2650. this.getAllUsersList()
  2651. }
  2652. if (this.user.company.packageProject == 1) {
  2653. this.getBasecostItemList();
  2654. }
  2655. if(this.user.timeType.userWithMultiDept == 1) {
  2656. this.getDeptMembData();
  2657. }
  2658. if(this.user.timeType.lockWorktime){
  2659. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2660. }
  2661. //设置了下限
  2662. if (this.user.timeType.minReportTime) {
  2663. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2664. }
  2665. const that = this
  2666. if(this.user.userNameNeedTranslate == 1) {
  2667. that.dataLoading = that.$store.state.dataLoading
  2668. this.upDataLoading()
  2669. setTimeout(()=>{
  2670. that.dataLoading = that.$store.state.dataLoading
  2671. }, 1000)
  2672. }
  2673. if (this.user.companyId == this.yuzhongCompId) {
  2674. this.getJobResponList();
  2675. }
  2676. },
  2677. methods: {
  2678. ...mapMutations(['upDataLoading']),
  2679. // 刷新考勤
  2680. refreshAttendanceCli() {
  2681. const firstDay = this.dayjs(this.date, 'YYYY-MM').startOf('month');
  2682. const lastDay = this.dayjs(this.date, 'YYYY-MM').endOf('month');
  2683. const formData = {
  2684. startDate: firstDay.format('YYYY-MM-DD'),
  2685. endDate: lastDay.format('YYYY-MM-DD')
  2686. }
  2687. this.refreshAttendanceLoading = true;
  2688. this.http.post('/user-fv-time/syncHongHuFvTime',{
  2689. ...formData
  2690. },res => {
  2691. this.refreshAttendanceLoading = false;
  2692. if(res.code == 'ok'){
  2693. this.$message({
  2694. message: `刷新成功!`,
  2695. type: 'success'
  2696. })
  2697. this.showReportTimeLessThanCardTimeList()
  2698. }else {
  2699. this.$message({
  2700. message: res.msg,
  2701. type: 'error'
  2702. })
  2703. }
  2704. },err => {
  2705. this.refreshAttendanceLoading = false;
  2706. this.$message({
  2707. message: err,
  2708. type: 'error'
  2709. })
  2710. })
  2711. },
  2712. // 已填工时情况表设置背景色
  2713. hasworkTblCellStyle({ columnIndex, row, column }) {
  2714. if(columnIndex > 2) {
  2715. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2716. const worktimeList = row.worktimeList || []
  2717. const times = this.reportTimeType.allday
  2718. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2719. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2720. const missReport = filterData[0] && filterData[0].missReport;
  2721. const state = filterData[0] && filterData[0].state
  2722. if (missReport) {
  2723. return "backgroundColor: red"
  2724. } else {
  2725. if (state == 0 || state == -1) {
  2726. return "backgroundColor: orange"
  2727. } else if (state == 1) {
  2728. //审核通过
  2729. return "backgroundColor: #32CD32"
  2730. } else if (state == 2) {
  2731. return "backgroundColor: red"
  2732. } else {
  2733. return "backgroundColor: #E0E0E0"
  2734. }
  2735. }
  2736. }
  2737. },
  2738. getMultiOptionData() {
  2739. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2740. res => {
  2741. if (res.code == "ok") {
  2742. this.multiOptionData = res.data;
  2743. } else {
  2744. this.$message({
  2745. message: res.msg,
  2746. type: "error"
  2747. });
  2748. }
  2749. },
  2750. error => {
  2751. this.$message({
  2752. message: error,
  2753. type: "error"
  2754. });
  2755. }
  2756. );
  2757. },
  2758. showReportTimeLessThanCardTimeList() {
  2759. this.monthTotalPage = 0,
  2760. this.tbload = true,
  2761. this.http.post(
  2762. "/report/getReportTimeLessThanCardTimeList",
  2763. {
  2764. date: this.notfullSelectDateMonth,
  2765. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2766. userId: this.usersListId,
  2767. },
  2768. (res) => {
  2769. if (res.code == "ok") {
  2770. this.tbload = false
  2771. this.notFullData = res.data;
  2772. this.notFullOriginList = res.data;
  2773. }
  2774. },
  2775. (error) => {
  2776. this.tbload = false
  2777. this.$message({
  2778. message: error,
  2779. type: "error",
  2780. });
  2781. }
  2782. );
  2783. },
  2784. //按选择的日期范围刷新考勤
  2785. refreshWXCardTimeByRange() {
  2786. this.refreshingTime = true;
  2787. var param = {
  2788. companyId: this.user.companyId,
  2789. startDate: this.importWxParam.date[0],
  2790. endDate: this.importWxParam.date[1],
  2791. }
  2792. //非管理员只能看到自己的
  2793. if (this.user.roleName.indexOf('管理员') == -1) {
  2794. param.userId = this.user.id;
  2795. }
  2796. this.http.post('/wxcorp/getUserCheckInDayData',param,res => {
  2797. this.refreshingTime = false;
  2798. if(res.code == 'ok'){
  2799. this.loadCheckInData();
  2800. }else {
  2801. this.$message({
  2802. message: res.msg,
  2803. type: 'error'
  2804. })
  2805. }
  2806. },err => {
  2807. this.syncTimeLoading = false;
  2808. this.$message({
  2809. message: err,
  2810. type: 'error'
  2811. })
  2812. })
  2813. },
  2814. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2815. isCustomization(userInfo, permissionArray) {
  2816. const { companyId } = userInfo
  2817. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2818. return isReportPictureRequired
  2819. },
  2820. showHiddenFunction() {
  2821. this.showHidden = true;
  2822. },
  2823. // 获取如何信息选的可填写部门
  2824. getDeptMembData() {
  2825. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2826. if (res.code == "ok") {
  2827. let lists = res.data.userReportDeptList || []
  2828. const optimizedList = lists.map(item => ({
  2829. ...item,
  2830. label: item.departmentName,
  2831. value: item.departmentId,
  2832. }));
  2833. this.$set(this, 'userReportDeptList', optimizedList || []);
  2834. } else {
  2835. this.$message({
  2836. message: res.msg,
  2837. type: "error"
  2838. });
  2839. }
  2840. },error => { });
  2841. },
  2842. //任务被选中
  2843. onTaskSelected(domainItem) {
  2844. //取服务
  2845. if (domainItem.taskId) {
  2846. var that = this;
  2847. var param = {taskId:domainItem.taskId};
  2848. if (this.isSubstitude) {
  2849. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2850. param.userId = this.workForm.userId[0];
  2851. }
  2852. }
  2853. this.http.post('/task/getMyTaskService',param, res => {
  2854. if (res.code == "ok") {
  2855. // domainItem.workContentList = res.data;
  2856. that.$set(domainItem, 'sapServiceId', null);
  2857. that.$set(domainItem, 'serviceList', res.data);
  2858. } else {
  2859. this.$message({
  2860. message: res.msg,
  2861. type: "error"
  2862. });
  2863. }
  2864. },error => {
  2865. this.$message({
  2866. message: error,
  2867. type: "error"
  2868. });
  2869. }
  2870. );
  2871. } else {
  2872. //清空服务
  2873. }
  2874. },
  2875. onBatchTimeChange() {
  2876. //反向计算每日工作时长
  2877. if (this.workForm.createDate) {
  2878. let sdate = new Date(this.workForm.createDate[0]);
  2879. let edate = new Date(this.workForm.createDate[1]);
  2880. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2881. if (days < 0) {
  2882. return;
  2883. }
  2884. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2885. //总时长发生改变,自动按比例计算
  2886. this.workForm.domains.forEach(d=>{
  2887. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2888. });
  2889. }
  2890. },
  2891. //更新工作内容列表
  2892. updateJobContent(domainItem) {
  2893. var that = this;
  2894. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2895. if (res.code == "ok") {
  2896. // domainItem.workContentList = res.data;
  2897. that.$set(domainItem, 'extraField3', null);
  2898. that.$set(domainItem, 'workContentList', res.data);
  2899. } else {
  2900. this.$message({
  2901. message: res.msg,
  2902. type: "error"
  2903. });
  2904. }
  2905. },error => {
  2906. this.$message({
  2907. message: error,
  2908. type: "error"
  2909. });
  2910. }
  2911. );
  2912. },
  2913. updateResponse(domainItem) {
  2914. var that = this;
  2915. var selectPid = domainItem.projectId;
  2916. domainItem.extraField2 = null;
  2917. domainItem.extraField3 = null;
  2918. if (selectPid && domainItem.extraField1) {
  2919. //是否非项目
  2920. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2921. 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));
  2922. domainItem.filteredRespList = filteredRespList;
  2923. }
  2924. },
  2925. getJobResponList() {
  2926. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2927. if (res.code == "ok") {
  2928. this.jobResponseList = res.data;
  2929. } else {
  2930. this.$message({
  2931. message: res.msg,
  2932. type: "error"
  2933. });
  2934. }
  2935. },error => {
  2936. this.$message({
  2937. message: error,
  2938. type: "error"
  2939. });
  2940. }
  2941. );
  2942. },
  2943. openModImportTime(row) {
  2944. this.showModImportTimeDialog = true;
  2945. this.modItemDataId = row.id;
  2946. },
  2947. delImportTime(row) {
  2948. let rowId = row.id;
  2949. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2950. confirmButtonText: this.$t('btn.determine'),
  2951. cancelButtonText: this.$t('btn.cancel'),
  2952. type: "warning"
  2953. })
  2954. .then(() => {
  2955. this.http.post('/report-import-log/delete',{
  2956. id: rowId
  2957. },res => {
  2958. if (res.code == "ok") {
  2959. this.$message({
  2960. message: this.$t('message.successfullyDeleted'),
  2961. type: "success"
  2962. });
  2963. this.getToView();
  2964. } else {
  2965. this.$message({
  2966. message: res.msg,
  2967. type: "error"
  2968. });
  2969. }
  2970. },error => {
  2971. this.$message({
  2972. message: error,
  2973. type: "error"
  2974. });
  2975. }
  2976. );
  2977. }).catch(() => {this.startDeleting = false});
  2978. },
  2979. confirmChangeModTime() {
  2980. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2981. this.$message({
  2982. message: this.$t('message.Pleaseselectatime'),
  2983. type: "error"
  2984. });
  2985. return;
  2986. }
  2987. this.http.post('/report-import-log/changeTime',{
  2988. modLogDateTime: this.modImportTime,
  2989. modImportUserId: this.modImportUserId,
  2990. id: this.modItemDataId
  2991. },res => {
  2992. if (res.code == "ok") {
  2993. this.$message({
  2994. message: this.$t('message.modifyTheSuccess'),
  2995. type: "success"
  2996. });
  2997. this.getToView();
  2998. this.showModImportTimeDialog = false;
  2999. } else {
  3000. this.$message({
  3001. message: res.msg,
  3002. type: "error"
  3003. });
  3004. }
  3005. },error => {
  3006. this.$message({
  3007. message: error,
  3008. type: "error"
  3009. });
  3010. }
  3011. );
  3012. },
  3013. confirmBatchApproveReport() {
  3014. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  3015. this.$message({
  3016. message: this.$t('qingXuanZeRiQiFanWei'),
  3017. type: "error"
  3018. });
  3019. return;
  3020. }
  3021. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  3022. confirmButtonText: this.$t('btn.determine'),
  3023. cancelButtonText: this.$t('btn.cancel'),
  3024. type: "warning"
  3025. })
  3026. .then(() => {
  3027. this.startDeleting = true;
  3028. let obj = {
  3029. startDate: this.deleteReportParam.date[0],
  3030. endDate: this.deleteReportParam.date[1]
  3031. }
  3032. if(this.deleteReportParam.departmentId) {
  3033. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  3034. } else {
  3035. obj.departmentId = null
  3036. }
  3037. this.http.post('/report/batchApproveByDate',obj,res => {
  3038. if (res.code == "ok") {
  3039. this.$message({
  3040. message: this.$t('state.approved'),
  3041. type: "success"
  3042. });
  3043. this.getReportList();
  3044. this.getDepartment();
  3045. this.startDeleting = false;
  3046. } else {
  3047. this.$message({
  3048. message: res.msg,
  3049. type: "error"
  3050. });
  3051. }
  3052. },error => {
  3053. this.$message({
  3054. message: error,
  3055. type: "error"
  3056. });
  3057. }
  3058. );
  3059. }).catch(() => {this.startDeleting = false});
  3060. },
  3061. confirmBatchDelReport() {
  3062. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  3063. this.$message({
  3064. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  3065. type: "error"
  3066. });
  3067. return;
  3068. }
  3069. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  3070. this.$message({
  3071. message: this.$t('qingXuanZeRiQiFanWei'),
  3072. type: "error"
  3073. });
  3074. return;
  3075. }
  3076. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  3077. confirmButtonText: this.$t('btn.determine'),
  3078. cancelButtonText: this.$t('btn.cancel'),
  3079. type: "warning"
  3080. })
  3081. .then(() => {
  3082. this.startDeleting = true;
  3083. this.http.post('/report/batchDelete',{
  3084. userIds: JSON.stringify(this.deleteReportParam.userIds),
  3085. startDate: this.deleteReportParam.date[0],
  3086. endDate: this.deleteReportParam.date[1],
  3087. deptId: this.deleteReportParam.deptId[0]
  3088. },res => {
  3089. if (res.code == "ok") {
  3090. this.$message({
  3091. message: this.$t('message.successfullyDeleted'),
  3092. type: "success"
  3093. });
  3094. this.getReportList();
  3095. this.getDepartment();
  3096. this.startDeleting = false;
  3097. } else {
  3098. this.$message({
  3099. message: res.msg,
  3100. type: "error"
  3101. });
  3102. }
  3103. },error => {
  3104. this.$message({
  3105. message: error,
  3106. type: "error"
  3107. });
  3108. }
  3109. );
  3110. }).catch(() => {this.startDeleting = false});
  3111. },
  3112. getRecentlyProject(userId) {
  3113. this.http.post('/project/nearProject',{userId: userId},res => {
  3114. if(res.code == 'ok'){
  3115. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3116. let topObj = {
  3117. label: this.$t('zuiJinXuanZeXiangMu'),
  3118. peojectList: res.data
  3119. }
  3120. let botomObj = {
  3121. label: this.$t('other.allProject'),
  3122. peojectList: bottomList
  3123. }
  3124. //最近项目如果在fillProjectList中不存在,需要移除
  3125. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3126. this.integrationProjectList = [topObj, botomObj]
  3127. }else {
  3128. this.$message({
  3129. message: res.msg,
  3130. type: 'error'
  3131. })
  3132. }
  3133. },err => {
  3134. this.$message({
  3135. message: err,
  3136. type: 'error'
  3137. })
  3138. })
  3139. },
  3140. handlePictureCardPreview(file, index) {
  3141. let arr = []
  3142. let imgArr = this.workForm.domains[index].imgListUrl
  3143. for(var i in imgArr) {
  3144. arr.push(imgArr[i].url)
  3145. }
  3146. const $viewer = this.$viewerApi({
  3147. images: arr
  3148. });
  3149. },
  3150. // 图片上传
  3151. addImg(e, index) {
  3152. let formData = new FormData()
  3153. formData.append('multipartFile', e.file)
  3154. this.http.uploadFile('/common/uploadFile', formData,
  3155. res => {
  3156. if (res.code == "ok") {
  3157. this.$message({
  3158. message: this.$t('uploadedsuccessfully'),
  3159. type: "success"
  3160. });
  3161. if(!this.workForm.domains[index].imgList) {
  3162. this.workForm.domains[index].imgList = []
  3163. this.workForm.domains[index].imgListUrl = []
  3164. }
  3165. this.workForm.domains[index].imgList.push(res.data)
  3166. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3167. } else {
  3168. this.$message({message: res.msg,type: "error"});
  3169. }
  3170. },
  3171. error => {this.$message({message: error,type: "error"});
  3172. });
  3173. },
  3174. // 删除图片
  3175. delImg(file,fileList, index) {
  3176. let idx = 0
  3177. for(let i in fileList) {
  3178. if(fileList[i].uid == file.uid) {
  3179. idx = i
  3180. }
  3181. }
  3182. this.workForm.domains[index].imgList.splice(idx, 1)
  3183. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3184. },
  3185. test(){
  3186. console.log('test',this.workForm.domains);
  3187. },
  3188. getHour(s1, s2) {
  3189. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3190. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3191. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3192. var ms = s2.getTime() - s1.getTime();
  3193. if (ms < 0) return 0;
  3194. let ma = ms / 1000 / 60 / 60
  3195. return ma; //小时
  3196. },
  3197. refreshDDCardTime(workdate, userId) {
  3198. if (!workdate) return;
  3199. this.syncTimeLoading = true;
  3200. this.http.post('/dingding/refreshUserCardTime',{
  3201. companyId: this.user.companyId,
  3202. userId: userId ? userId : this.user.id,
  3203. date: workdate,
  3204. },res => {
  3205. this.syncTimeLoading = false;
  3206. if(res.code == 'ok'){
  3207. if (!res.data) {
  3208. this.$message({
  3209. message: '获取考勤失败',
  3210. type: 'error'
  3211. })
  3212. } else {
  3213. this.workForm.time = res.data;
  3214. }
  3215. }else {
  3216. this.$message({
  3217. message: res.msg,
  3218. type: 'error'
  3219. })
  3220. }
  3221. },err => {
  3222. this.syncTimeLoading = false;
  3223. this.$message({
  3224. message: err,
  3225. type: 'error'
  3226. })
  3227. })
  3228. },
  3229. refreshWXCardTime(workdate) {
  3230. if (!workdate) return;
  3231. this.syncTimeLoading = true;
  3232. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3233. date: workdate,
  3234. },res => {
  3235. this.syncTimeLoading = false;
  3236. if(res.code == 'ok'){
  3237. this.workForm.time = res.data.time;
  3238. }else {
  3239. this.$message({
  3240. message: res.msg,
  3241. type: 'error'
  3242. })
  3243. }
  3244. },err => {
  3245. this.syncTimeLoading = false;
  3246. this.$message({
  3247. message: err,
  3248. type: 'error'
  3249. })
  3250. })
  3251. },
  3252. refreshAttendance(workdate) {
  3253. if (!workdate) return;
  3254. if (this.isSubstitude && this.workForm.userId == null) return;
  3255. this.syncTimeLoading = true;
  3256. var param = {};
  3257. if (this.isBatch) {
  3258. param = {
  3259. startDate: workdate[0],
  3260. endDate: workdate[1],
  3261. userId: this.isSubstitude? this.workForm.userId[0] : this.user.id,
  3262. isBatch: this.isBatch
  3263. }
  3264. } else {
  3265. param = {
  3266. startDate: workdate,
  3267. endDate: workdate,
  3268. userId: this.user.id,
  3269. isBatch: this.isBatch
  3270. }
  3271. }
  3272. this.http.post('/user-fv-time/syncAttendanceForMingYi',param,res => {
  3273. this.syncTimeLoading = false;
  3274. if(res.code == 'ok'){
  3275. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3276. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3277. this.totalReportHours = this.workTimeForMinYi;
  3278. }else {
  3279. this.$message({
  3280. message: res.msg,
  3281. type: 'error'
  3282. })
  3283. }
  3284. },err => {
  3285. this.syncTimeLoading = false;
  3286. this.$message({
  3287. message: err,
  3288. type: 'error'
  3289. })
  3290. })
  3291. },
  3292. refreshBeiSengAttendance(workdate) {
  3293. if (!workdate) return;
  3294. this.syncTimeLoading = true;
  3295. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3296. createDate: workdate
  3297. },res => {
  3298. this.syncTimeLoading = false;
  3299. if(res.code == 'ok'){
  3300. this.workForm.time = res.data;
  3301. }else {
  3302. this.$message({
  3303. message: res.msg,
  3304. type: 'error'
  3305. })
  3306. }
  3307. },err => {
  3308. this.syncTimeLoading = false;
  3309. this.$message({
  3310. message: err,
  3311. type: 'error'
  3312. })
  3313. })
  3314. },
  3315. refreshBeiSengAttendanceTwo(workdate) {
  3316. if (!workdate) return;
  3317. this.syncTimeLoading = true;
  3318. this.http.post('/user-fv-time/syncHongHuFvTime',{
  3319. startDate: workdate,
  3320. endDate: workdate,
  3321. userId: this.user.id
  3322. },res => {
  3323. this.syncTimeLoading = false;
  3324. if(res.code == 'ok'){
  3325. this.workForm.time = res.data;
  3326. }else {
  3327. this.$message({
  3328. message: res.msg,
  3329. type: 'error'
  3330. })
  3331. }
  3332. },err => {
  3333. this.syncTimeLoading = false;
  3334. this.$message({
  3335. message: err,
  3336. type: 'error'
  3337. })
  3338. })
  3339. },
  3340. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3341. this.weeklyFilledTimeDialog = true
  3342. this.weeklyFilledTimeLoading = true
  3343. this.weeklyFilledTimeDate = parameterDate
  3344. this.http.post('/report/getReportList',{
  3345. date: parameterDate,
  3346. userId: this.user.id
  3347. },res => {
  3348. this.weeklyFilledTimeLoading = false
  3349. if(res.code == 'ok'){
  3350. this.weeklyFilledTimeList = res.data[0].data
  3351. let candelete = true
  3352. for(let i in this.weeklyFilledTimeList){
  3353. if(this.weeklyFilledTimeList[i].state < 2){
  3354. candelete = false
  3355. }
  3356. }
  3357. this.weeklyFilledTimeCanDelete = candelete
  3358. }else {
  3359. this.$message({
  3360. message: res.msg,
  3361. type: 'error'
  3362. })
  3363. }
  3364. },err => {
  3365. this.weeklyFilledTimeLoading = false
  3366. this.$message({
  3367. message: err,
  3368. type: 'error'
  3369. })
  3370. })
  3371. },
  3372. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3373. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3374. confirmButtonText: this.$t('btn.determine'),
  3375. cancelButtonText: this.$t('btn.cancel'),
  3376. type: "warning"
  3377. })
  3378. .then(() => {
  3379. this.http.post('/report/delete',{
  3380. userId: this.user.id,
  3381. date: this.weeklyFilledTimeDate
  3382. },res => {
  3383. if (res.code == "ok") {
  3384. this.$message({
  3385. message: this.$t('message.successfullyDeleted'),
  3386. type: "success"
  3387. });
  3388. this.getWeeklyWorkTime()
  3389. this.getReportList();
  3390. this.getDepartment();
  3391. this.weeklyFilledTimeDialog = false;
  3392. } else {
  3393. this.$message({
  3394. message: res.msg,
  3395. type: "error"
  3396. });
  3397. }
  3398. },error => {
  3399. this.$message({
  3400. message: error,
  3401. type: "error"
  3402. });
  3403. }
  3404. );
  3405. }).catch(() => {});
  3406. },
  3407. getApprovalProcess(item){
  3408. // console.log('this.date',this.choseDate);
  3409. this.http.post('/report-log/get',{
  3410. creatorId: item.id,
  3411. createDate: sessionStorage.msg
  3412. },res => {
  3413. if(res.code == 'ok'){
  3414. this.approvalProcessDialog = true
  3415. if(this.user.userNameNeedTranslate == 1) {
  3416. for(var i in res.data) {
  3417. let obj = {
  3418. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3419. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3420. }
  3421. res.data[i].msgCon = obj
  3422. }
  3423. }
  3424. this.approvalProcessData = res.data
  3425. }else{
  3426. this.$message({
  3427. message: res.msg,
  3428. type: 'error'
  3429. })
  3430. }
  3431. },err => {
  3432. this.$message({
  3433. message: err,
  3434. type: 'error'
  3435. })
  3436. })
  3437. //获取审批节点状态
  3438. if (this.user.companyId == 7544) {
  3439. this.http.post('/report/getCurAuditNode',{
  3440. userId: item.id,
  3441. date: sessionStorage.msg
  3442. },res => {
  3443. if(res.code == 'ok'){
  3444. this.curAuditNode = res.data
  3445. }else{
  3446. }
  3447. },err => {
  3448. this.$message({
  3449. message: err,
  3450. type: 'error'
  3451. })
  3452. })
  3453. }
  3454. },
  3455. filterNode(value, data) {
  3456. if (!value) return true;
  3457. return data.label.indexOf(value) !== -1;
  3458. },
  3459. triggerCalculateOT(index) {
  3460. var str = this.workForm.domains[index].overtimeHours + ''
  3461. if(str.indexOf('.') != '-1') {
  3462. var s = str.split('.')[0]
  3463. var st = str.split('.')[1]
  3464. var sts = st.split('')
  3465. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3466. }
  3467. },
  3468. searchScreen(e){
  3469. if(e == 1){
  3470. this.monthNotWorkDateS1 = []
  3471. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3472. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3473. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3474. }
  3475. }
  3476. if (this.monthNotWorkDateS1.length > 50) {
  3477. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3478. }else{
  3479. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3480. }
  3481. } else if (e == 0) {
  3482. this.monthWorkDataS1 = []
  3483. for (let i = 0; i < this.monthWorkData.length; i++) {
  3484. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3485. this.monthWorkDataS1.push(this.monthWorkData[i])
  3486. }
  3487. }
  3488. if (this.monthWorkDataS1.length > 50) {
  3489. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3490. }else{
  3491. this.monthWorkDataS = this.monthWorkDataS1
  3492. }
  3493. } else if (e == 2) {
  3494. this.monthWorkDataS1 = []
  3495. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3496. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3497. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3498. }
  3499. }
  3500. if (this.monthWorkDataS1.length > 50) {
  3501. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3502. }else{
  3503. this.notFullData = this.monthWorkDataS1
  3504. }
  3505. }
  3506. },
  3507. addUpload(data) {
  3508. // var zhi = data.fileName.split('.')[0]
  3509. // var sss = zhi + '.xlsx'
  3510. // return
  3511. var filePath = '/upload/' + data.serverName;
  3512. const a = document.createElement('a'); // 创建a标签
  3513. a.setAttribute('download', data.fileName);// download属性
  3514. a.setAttribute('href', filePath);// href链接
  3515. a.click(); //自执行点击事件
  3516. a.remove();
  3517. },
  3518. restrictNumber(targetId) {
  3519. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3520. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3521. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3522. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3523. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3524. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3525. inpu.value = parseFloat(inpu.value);
  3526. }
  3527. },
  3528. //获取项目下的任务分组
  3529. getTaskGroups(domain, index) {
  3530. domain.groupId=null;
  3531. this.http.post('/task-group/listMyJoinGroup',{
  3532. projectId: domain.projectId,
  3533. isSubstitude: this.isSubstitude ? 1 : 0
  3534. },
  3535. res => {
  3536. if (res.code == "ok") {
  3537. this.workForm.domains[index].taskGroups = res.data;
  3538. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3539. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3540. // this.getGroupStages(domain, index);
  3541. // }
  3542. const projectIdStr = domain.projectId;
  3543. const businessTripsArray = this.businessTripsArray
  3544. const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
  3545. if(list.length > 0) {
  3546. const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
  3547. this.workForm.domains[index].groupId = obj.id || ''
  3548. }
  3549. this.$forceUpdate();
  3550. }
  3551. },
  3552. error => {
  3553. this.$message({
  3554. message: error,
  3555. type: "error"
  3556. });
  3557. }
  3558. );
  3559. },
  3560. //下载填报工时占比报表
  3561. downloadProjectRatio() {
  3562. this.exportUserRatio = true;
  3563. // let now = new Date();
  3564. // let month = now.getMonth();//默认看上个月的
  3565. // let monthStr = month<10? ('0'+month): month;
  3566. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3567. const today = new Date();
  3568. const year = today.getFullYear();
  3569. const month = today.getMonth() + 1;
  3570. let lastMonthYear, lastMonth;
  3571. if (month === 1) {
  3572. lastMonthYear = year - 1;
  3573. lastMonth = 12;
  3574. } else {
  3575. lastMonthYear = year;
  3576. lastMonth = month - 1;
  3577. }
  3578. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3579. },
  3580. confirmDownloadRatio() {
  3581. this.startRatioExporting = true;
  3582. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3583. ymonth: this.ratioYmonth
  3584. },
  3585. res => {
  3586. if (res.code == "ok") {
  3587. this.startRatioExporting = false;
  3588. var filePath = res.data;
  3589. const a = document.createElement('a'); // 创建a标签
  3590. var data = filePath.split("/");
  3591. a.setAttribute('download', data[data.length-1]);// download属性
  3592. a.setAttribute('href', filePath);// href链接
  3593. a.click(); //自执行点击事件
  3594. a.remove();
  3595. } else {
  3596. this.startRatioExporting = false;
  3597. this.$message({
  3598. message: res.msg,
  3599. type: "error"
  3600. });
  3601. }
  3602. },
  3603. error => {
  3604. this.checkinLoading = false;
  3605. this.$message({
  3606. message: error,
  3607. type: "error"
  3608. });
  3609. }
  3610. );
  3611. },
  3612. //下载带企业微信考勤数据的工时统计模板
  3613. downloadCheckInExcel() {
  3614. var param = {
  3615. startDate: this.importWxParam.date[0],
  3616. endDate: this.importWxParam.date[1],
  3617. };
  3618. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3619. param.onlySelfData = false;
  3620. }
  3621. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3622. res => {
  3623. if (res.code == "ok") {
  3624. var filePath = res.data;
  3625. const a = document.createElement('a'); // 创建a标签
  3626. var data = filePath.split("/");
  3627. a.setAttribute('download', data[data.length-1]);// download属性
  3628. a.setAttribute('href', filePath);// href链接
  3629. a.click(); //自执行点击事件
  3630. a.remove();
  3631. } else {
  3632. this.$message({
  3633. message: res.msg,
  3634. type: "error"
  3635. });
  3636. }
  3637. },
  3638. error => {
  3639. this.checkinLoading = false;
  3640. this.$message({
  3641. message: error,
  3642. type: "error"
  3643. });
  3644. }
  3645. );
  3646. },
  3647. pre() {
  3648. if (this.active == 0) return;
  3649. this.active--;
  3650. },
  3651. next() {
  3652. this.active++;
  3653. },
  3654. triggerTotalTime(index) {
  3655. var item = this.checkinList[index];
  3656. var total = 0.0;
  3657. for (var i=0;i<this.projectColumns.length; i++) {
  3658. var key = this.projectColumns[i];
  3659. if (item[key] != null && item[key] != '') {
  3660. total += parseFloat(item[key]);
  3661. }
  3662. }
  3663. item.totalFillTime = total;
  3664. },
  3665. //提交批量代填的数据
  3666. submitBatchSubFillData() {
  3667. var data = JSON.stringify(this.checkinList);
  3668. this.http.post('/user-corpwx-time/submitProjectTime',{
  3669. json: data,
  3670. projectColumns: JSON.stringify(this.projectColumns)
  3671. },
  3672. res => {
  3673. if (res.code == "ok") {
  3674. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3675. this.importWxDialog = false;
  3676. }
  3677. },
  3678. error => {
  3679. this.checkinLoading = false;
  3680. this.$message({
  3681. message: error,
  3682. type: "error"
  3683. });
  3684. }
  3685. );
  3686. },
  3687. loadCheckInData() {
  3688. if (this.importWxParam.date == null) {
  3689. this.checkinList = [];
  3690. return;
  3691. }
  3692. this.checkinLoading = true;
  3693. this.http.post('/user-corpwx-time/getMyData',{
  3694. startDate: this.importWxParam.date[0],
  3695. endDate: this.importWxParam.date[1],
  3696. },
  3697. res => {
  3698. if (res.code == "ok") {
  3699. this.checkinLoading = false;
  3700. this.checkinList = res.data.list;
  3701. this.projectColumns = res.data.projects;
  3702. // 自定义表格会导致表格错乱,需重新计算表格
  3703. this.$nextTick(()=>{
  3704. this.$refs.tab.doLayout()
  3705. })
  3706. }
  3707. },
  3708. error => {
  3709. this.checkinLoading = false;
  3710. this.$message({
  3711. message: error,
  3712. type: "error"
  3713. });
  3714. }
  3715. );
  3716. },
  3717. importCardTime(item) {
  3718. //首先判断文件类型
  3719. let str = item.file.name.split(".");
  3720. let format = str[str.length - 1];
  3721. if (format != "xls" && format != "xlsx") {
  3722. this.$message({
  3723. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3724. type: "error"
  3725. });
  3726. } else {
  3727. this.importingData = true;
  3728. let formData = new FormData();
  3729. formData.append("multipartFile", item.file);
  3730. formData.append("companyId", this.user.companyId);
  3731. this.http.uploadFile(this.user.companyId == 7703?'/user-corpwx-time/importZhengBeiAttendance':'/user-corpwx-time/importCardTime', formData,
  3732. res => {
  3733. this.$refs.uploadCardTime.clearFiles();
  3734. this.importingData = false;
  3735. if (res.code == "ok") {
  3736. //换成弹出框,以免有人等了半天回来啥也没看到
  3737. this.$message({
  3738. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3739. type: "success"
  3740. });
  3741. } else {
  3742. this.$message({
  3743. message: res.msg,
  3744. type: "error"
  3745. });
  3746. }
  3747. },
  3748. error => {
  3749. this.$refs.upload.clearFiles();
  3750. this.listLoading = false;
  3751. this.$message({
  3752. message: error,
  3753. type: "error"
  3754. });
  3755. });
  3756. }
  3757. },
  3758. batchImportWxData(item) {
  3759. //首先判断文件类型
  3760. let str = item.file.name.split(".");
  3761. let format = str[str.length - 1];
  3762. if (format != "xls" && format != "xlsx") {
  3763. this.$message({
  3764. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3765. type: "error"
  3766. });
  3767. } else {
  3768. this.importingData = true;
  3769. let formData = new FormData();
  3770. formData.append("file", item.file);
  3771. formData.append("companyId", this.user.companyId);
  3772. formData.append("withCheckIn", 1);
  3773. this.http.uploadFile('/report/importData', formData,
  3774. res => {
  3775. this.$refs.upload.clearFiles();
  3776. this.showImportResult = true;
  3777. this.importingData = false;
  3778. if (res.code == "ok") {
  3779. //换成弹出框,以免有人等了半天回来啥也没看到
  3780. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3781. this.getReportList();
  3782. this.importWxDialog = false;
  3783. } else {
  3784. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3785. }
  3786. },
  3787. error => {
  3788. this.$refs.upload.clearFiles();
  3789. this.listLoading = false;
  3790. this.$message({
  3791. message: error,
  3792. type: "error"
  3793. });
  3794. });
  3795. }
  3796. },
  3797. batchImportData(item) {
  3798. //首先判断文件类型
  3799. let str = item.file.name.split(".");
  3800. let format = str[str.length - 1];
  3801. if (format != "xls" && format != "xlsx") {
  3802. this.$message({
  3803. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3804. type: "error"
  3805. });
  3806. } else {
  3807. this.importingData = true;
  3808. let formData = new FormData();
  3809. formData.append("file", item.file);
  3810. formData.append("companyId", this.user.companyId);
  3811. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3812. if (this.user.companyId == 8264 || this.user.companyId == 8261 || this.user.companyId == 8138 || this.user.companyId == 8268) {
  3813. url = "/report/importNewDataZhengbei"
  3814. }
  3815. this.http.uploadFile(url, formData,
  3816. res => {
  3817. this.$refs.upload.clearFiles();
  3818. this.importingData = false;
  3819. this.showImportResult = true;
  3820. if (res.code == "ok") {
  3821. //换成弹出框,以免有人等了半天回来啥也没看到
  3822. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3823. this.getReportList();
  3824. this.importWXDialog = false;
  3825. } else {
  3826. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3827. }
  3828. },
  3829. error => {
  3830. this.$refs.upload.clearFiles();
  3831. this.importingData = false;
  3832. this.$message({
  3833. message: error,
  3834. type: "error"
  3835. });
  3836. });
  3837. }
  3838. },
  3839. userssHu() {
  3840. this.http.post('/time-type/getCompanyTimeSetting',{
  3841. companyId: this.user.companyId
  3842. },
  3843. res => {
  3844. if (res.code == "ok") {
  3845. this.yonghuUser = res.data
  3846. }
  3847. },
  3848. error => {
  3849. this.$message({
  3850. message: error,
  3851. type: "error"
  3852. });
  3853. }
  3854. );
  3855. },
  3856. iptBlur(i) {
  3857. if(this.isBatch == 0) {
  3858. return
  3859. }
  3860. var reqParam = {
  3861. startDate: this.workForm.createDate[0],
  3862. endDate: this.workForm.createDate[1]
  3863. };
  3864. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3865. reqParam.userId = this.workForm.userId[0];
  3866. }
  3867. this.http.post('/report/getWorkDays',reqParam,
  3868. res => {
  3869. if (res.code == "ok") {
  3870. this.jsDay = res.data
  3871. this.chuji(i)
  3872. } else {
  3873. this.$message({
  3874. message: res.msg,
  3875. type: "error"
  3876. });
  3877. }
  3878. },
  3879. error => {
  3880. this.$message({
  3881. message: error,
  3882. type: "error"
  3883. });
  3884. }
  3885. );
  3886. //明夷硬编码获取
  3887. if (this.user.company.companyName == this.mingyiName) {
  3888. this.getWorkTimeForMinYi();
  3889. }
  3890. },
  3891. getWorkTimeForMinYi(){
  3892. if (this.isSubstitude && this.workForm.userId == null) {
  3893. this.$message({
  3894. message: "请先选择代填人员",
  3895. type: "error"
  3896. });
  3897. this.workForm.createDate = null;
  3898. return;
  3899. }
  3900. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3901. startDate: this.workForm.createDate[0],
  3902. endDate: this.workForm.createDate[1],
  3903. userId: this.isSubstitude?this.workForm.userId[0]:this.user.id
  3904. },
  3905. res => {
  3906. if (res.code == "ok") {
  3907. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3908. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3909. this.totalReportHours = this.workTimeForMinYi;
  3910. } else {
  3911. this.$message({
  3912. message: res.msg,
  3913. type: "error"
  3914. });
  3915. this.workForm.createDate = [];
  3916. }
  3917. },
  3918. error => {
  3919. this.$message({
  3920. message: error,
  3921. type: "error"
  3922. });
  3923. }
  3924. );
  3925. },
  3926. chuji(i) {
  3927. if(i == 0) {
  3928. this.seleChn(1)
  3929. } else if(i == 1) {
  3930. this.seleChn(0)
  3931. } else if(i == 2) {
  3932. if(this.workForm.domains[0].multiWorktime > 0) {
  3933. this.iptChangs()
  3934. } else {
  3935. this.iptChang()
  3936. }
  3937. } else if(i == 3) {
  3938. this.seleChn(0)
  3939. }
  3940. },
  3941. seleChn(e,domain) {
  3942. if(e == 1) {
  3943. for(var i in this.workForm.domains) {
  3944. if(this.workForm.domains[i].timeType == 0) {
  3945. this.workForm.domains[i].workingTime = 8
  3946. } else {
  3947. this.workForm.domains[i].workingTime = 4
  3948. }
  3949. }
  3950. }
  3951. var quanbu = 0
  3952. var spl = this.workForm.domains
  3953. var zhi = ''
  3954. for(var i in spl) {
  3955. var sp = +spl[i].workingTime + 0
  3956. zhi = this.jsDay * sp
  3957. quanbu = +quanbu + zhi
  3958. }
  3959. this.jsTime = quanbu
  3960. this.totalReportHours = quanbu
  3961. let worktime = this.jsTime
  3962. // 自动计算加班时长
  3963. if(this.isBatch != 0){
  3964. worktime = this.jsTime / this.jsDay
  3965. }
  3966. if(this.user.timeType.fillOvertime && domain){
  3967. let isover = false
  3968. let alltime = 0
  3969. let allover = 0 //此处alltime同上面的worktime
  3970. for(let d in spl){
  3971. if(spl[d].isOvertime){
  3972. isover = true
  3973. allover += spl[d].overtimeHours*1
  3974. }
  3975. alltime += spl[d].workingTime*1
  3976. }
  3977. if(domain.overtimeHours){
  3978. allover = allover - domain.overtimeHours
  3979. }
  3980. if(worktime*1 > this.user.timeType.allday){
  3981. if(isover){
  3982. if(alltime > (allover + this.user.timeType.allday)){
  3983. this.$set(domain,'isOvertime',true)
  3984. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3985. }else{
  3986. this.$set(domain,'isOvertime',false)
  3987. this.$set(domain,'overtimeHours',null)
  3988. if(alltime < (allover + this.user.timeType.allday)){
  3989. let overtime = allover + this.user.timeType.allday - alltime
  3990. for(let pi in spl){
  3991. if(spl[pi].overtimeHours){
  3992. if((overtime - spl[pi].overtimeHours*1) > 0){
  3993. overtime = overtime - spl[pi].overtimeHours*1
  3994. this.$set(spl[pi],'isOvertime',false)
  3995. this.$set(spl[pi],'overtimeHours',null)
  3996. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3997. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3998. break
  3999. }else{
  4000. this.$set(spl[pi],'isOvertime',false)
  4001. this.$set(spl[pi],'overtimeHours',null)
  4002. break
  4003. }
  4004. }
  4005. }
  4006. }
  4007. }
  4008. }else{
  4009. this.$set(domain,'isOvertime',true)
  4010. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  4011. }
  4012. }else{
  4013. for(let di in spl){
  4014. this.$set(spl[di],'isOvertime',false)
  4015. this.$set(spl[di],'overtimeHours',null)
  4016. }
  4017. }
  4018. }
  4019. },
  4020. iptChang() {
  4021. var sl = this.workForm.domains
  4022. let timeArr = []
  4023. for(var i in sl) {
  4024. if(sl[i].startTime && sl[i].endTime) {
  4025. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  4026. }
  4027. }
  4028. this.getTimeHours(timeArr)
  4029. },
  4030. iptChangs() {
  4031. var sl = this.workForm.domains
  4032. let timeArr = []
  4033. for(var i in sl) {
  4034. for(var j in sl[i].worktimeList){
  4035. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  4036. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  4037. }
  4038. }
  4039. }
  4040. this.getTimeHours(timeArr)
  4041. },
  4042. // 调用接口或去数据
  4043. getTimeHours(arr) {
  4044. this.http.post('/report/getHoursByTimeRange',{
  4045. timeJsonStr: JSON.stringify(arr)
  4046. },res => {
  4047. if(res.code === 'ok') {
  4048. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  4049. } else {
  4050. this.$message({
  4051. message: res.msg,
  4052. type: 'error'
  4053. })
  4054. }
  4055. },err => {
  4056. this.$message({
  4057. message: err,
  4058. type: 'error'
  4059. })
  4060. })
  4061. },
  4062. // 按周填报调用接口计算时间
  4063. async getWeekHoursByTimeRange(timeRange) {
  4064. const url = '/report/getHoursByTimeRange';
  4065. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  4066. var that = this;
  4067. return new Promise((resolve, reject) => {
  4068. this.http.post(url, data, function(res) {
  4069. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  4070. }, function(err) {
  4071. reject(err);
  4072. });
  4073. });
  4074. },
  4075. removeTimeItem(item, index) {
  4076. item.worktimeList.splice(index, 1);
  4077. this.iptChangs()
  4078. },
  4079. //添加工时
  4080. addNewWorktime(index, item) {
  4081. if(item.worktimeList == null ) {
  4082. item.worktimeList = []
  4083. }
  4084. item.worktimeList.push({});
  4085. },
  4086. //复制项目
  4087. copyProject(index) {
  4088. var leftProgress = 10;
  4089. if (this.reportTimeType.type == 3) {
  4090. //计算已经待分配工时比例
  4091. let array = this.workForm.domains;
  4092. let totalProgress = 0;
  4093. for (var i=0;i<array.length; i++) {
  4094. totalProgress += array[i].progress;
  4095. }
  4096. if (totalProgress < 100) {
  4097. leftProgress = 100 - totalProgress;
  4098. }
  4099. }
  4100. var newIndex = index+1;
  4101. var itemDomain = {
  4102. projectId: this.workForm.domains[index].projectId,
  4103. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(2):(
  4104. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(2)
  4105. ),
  4106. content: "",
  4107. progress:leftProgress,
  4108. state:2,//2-表示待提交
  4109. };
  4110. this.workForm.domains.splice(newIndex, 0,itemDomain);
  4111. if (this.reportTimeType.type == 0) {
  4112. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  4113. var length = this.workForm.domains.length;
  4114. if (length == 2) {
  4115. this.showAddMore = false;
  4116. }
  4117. }
  4118. this.selectProject(itemDomain, newIndex);
  4119. },
  4120. pushWorkTime(reportId){
  4121. let url=''
  4122. if(this.user.timeType.syncSap == 1){
  4123. url='/report/pushProjectReportToSap'
  4124. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4125. var pushDate = this.date + day;
  4126. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  4127. confirmButtonText: this.$t('btn.determine'),
  4128. cancelButtonText: this.$t('btn.cancel'),
  4129. type: 'info'
  4130. }).then(() => {
  4131. const loading = this.$loading({
  4132. lock: true,
  4133. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4134. spinner: 'el-icon-loading',
  4135. background: 'rgba(0, 0, 0, 0.7)'
  4136. });
  4137. this.http.post(url,{
  4138. pushDate: pushDate,
  4139. reportId: reportId
  4140. },res => {
  4141. loading.close();
  4142. if(res.code == 'ok'){
  4143. this.$message({
  4144. type: 'success',
  4145. message: res.data
  4146. });
  4147. }else{
  4148. this.$message({
  4149. type: 'error',
  4150. message: res.msg
  4151. })
  4152. }
  4153. },err => {
  4154. loading.close();
  4155. this.$message({
  4156. type: 'error',
  4157. message: err
  4158. })
  4159. })
  4160. }).catch(() => {
  4161. });
  4162. }else{
  4163. url='/report/pushReportDataToThird'
  4164. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4165. confirmButtonText: this.$t('btn.determine'),
  4166. cancelButtonText: this.$t('btn.cancel'),
  4167. type: 'info'
  4168. }).then(() => {
  4169. const loading = this.$loading({
  4170. lock: true,
  4171. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4172. spinner: 'el-icon-loading',
  4173. background: 'rgba(0, 0, 0, 0.7)'
  4174. });
  4175. this.http.post(url,{
  4176. yearMonth: this.date
  4177. },res => {
  4178. loading.close();
  4179. if(res.code == 'ok'){
  4180. this.$message({
  4181. type: 'success',
  4182. message: this.$t('tuiSongChengGong')
  4183. });
  4184. }else{
  4185. this.$message({
  4186. type: 'error',
  4187. message: res.msg
  4188. })
  4189. }
  4190. },err => {
  4191. loading.close();
  4192. this.$message({
  4193. type: 'error',
  4194. message: err
  4195. })
  4196. })
  4197. }).catch(() => {
  4198. });
  4199. }
  4200. },
  4201. showWorkTime(){
  4202. this.monthWorkTimeDialog = true;
  4203. this.searchKeyword = ''
  4204. this.WorktimeDatepickValue = this.istoMonth()
  4205. if(this.WorktimeDatepickValue.length == 0){
  4206. let newdate = new Date();
  4207. let nowdate = newdate.toLocaleDateString();
  4208. let getauto = this.getAutoWeekDate(nowdate)
  4209. let nowwd = [getauto[0],getauto[6]]
  4210. this.WorktimeDatepickValue = nowwd
  4211. }
  4212. this.showMonthWorkTime()
  4213. },
  4214. handleClick(t,e){
  4215. if (t.name == "second") {
  4216. this.showMonthNotWorkTime()
  4217. }else if(t.name == "first"){
  4218. this.showMonthWorkTime()
  4219. }else if(t.name == "third"){
  4220. this.showMonthWorkTimeReminder()
  4221. } else if (t.name == "fourth") {
  4222. this.showReportTimeLessThanCardTimeList();
  4223. }
  4224. },
  4225. //导出员工每日填报工时数
  4226. exportMembWorkHours() {
  4227. this.http.post(
  4228. "/report/exportUserDailyWorkTime",
  4229. {
  4230. // month: this.date,
  4231. startDate: this.WorktimeDatepickValue[0],
  4232. endDate: this.WorktimeDatepickValue[1],
  4233. },
  4234. (res) => {
  4235. if (res.code == "ok") {
  4236. let url = res.data;
  4237. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4238. }
  4239. },
  4240. (error) => {
  4241. this.$message({
  4242. message: error,
  4243. type: "error",
  4244. });
  4245. }
  4246. );
  4247. },
  4248. exportMembWorkHoursReminder() {
  4249. this.http.post(
  4250. "/report/exportUserDailyWorkTimeReminder",
  4251. {
  4252. // month: this.date,
  4253. startDate: this.WorktimeDatepickValue[0],
  4254. endDate: this.WorktimeDatepickValue[1],
  4255. },
  4256. (res) => {
  4257. if (res.code == "ok") {
  4258. let url = res.data;
  4259. this.downloadByA('工时异常表.xlsx', url);
  4260. }
  4261. },
  4262. (error) => {
  4263. this.$message({
  4264. message: error,
  4265. type: "error",
  4266. });
  4267. }
  4268. );
  4269. },
  4270. exportMembNotWorkHours() {
  4271. this.http.post(
  4272. "/report/exportNoReportUserList",
  4273. {
  4274. // month: this.date,
  4275. startDate: this.WorktimeDatepickValue[0],
  4276. endDate: this.WorktimeDatepickValue[1],
  4277. onlyHaveAttendance: this.onlyHaveAttendance?1:0,
  4278. noReportDeptId: this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4279. },
  4280. (res) => {
  4281. if (res.code == "ok") {
  4282. let url = res.data;
  4283. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4284. }
  4285. },
  4286. (error) => {
  4287. this.$message({
  4288. message: error,
  4289. type: "error",
  4290. });
  4291. }
  4292. );
  4293. },
  4294. downloadByA(name, url) {
  4295. const a = document.createElement("a"); // 创建a标签
  4296. a.setAttribute("download", name); // download属性
  4297. a.setAttribute("href", url); // href链接
  4298. a.click(); // 自执行点击事件
  4299. a.remove();
  4300. },
  4301. // 是否本月判断
  4302. istoMonth(){
  4303. let todate = new Date()
  4304. let tomonth = todate.getMonth() + 1
  4305. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4306. if(this.date == adate){
  4307. return []
  4308. }else{
  4309. let sedate = new Date(this.date)
  4310. let semonth = sedate.getMonth() + 1
  4311. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4312. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4313. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4314. return [sedates1, sedates2]
  4315. }
  4316. },
  4317. showMonthWorkTime() {
  4318. this.monthTotalPage = 0,
  4319. this.tbload = true
  4320. let parameter={
  4321. startDate: this.WorktimeDatepickValue[0],
  4322. endDate: this.WorktimeDatepickValue[1],
  4323. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4324. }
  4325. this.http.post(
  4326. "/report/getUserDailyWorkTime",
  4327. // "/report/getNoReportUserList",
  4328. parameter,
  4329. (res) => {
  4330. if (res.code == "ok") {
  4331. this.tbload = false;
  4332. this.pickDateArray = res.data.days.map(item => {
  4333. return {
  4334. ...item,
  4335. dateStr: item.label.split('/')[0],
  4336. weekStr: item.label.split('/')[1]
  4337. }
  4338. });
  4339. // console.log('dataarray',res.data.days);
  4340. this.monthWorkData = res.data.list;
  4341. // this.monthWorkDataS = this.monthWorkData
  4342. // this.monthWorkDataS1 = res.data.list
  4343. this.monthTotal = res.data.list.length
  4344. if (this.monthWorkData.length > 50) {
  4345. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4346. }else{
  4347. this.monthWorkDataS = this.monthWorkData
  4348. }
  4349. this.searchScreen(0)
  4350. // this.monthWorkDataS = infoList
  4351. // 判断
  4352. // if (this.monthWorkDataS1.length > 0) {
  4353. // setTimeout(() => {
  4354. // this.tableListener()
  4355. // }, 1000);
  4356. // }
  4357. this.$nextTick(function(){
  4358. this.$refs.hasworkTbl.doLayout();
  4359. });
  4360. // this.$forceUpdate()
  4361. }
  4362. },
  4363. (error) => {
  4364. this.tbload = false
  4365. this.$message({
  4366. message: error,
  4367. type: "error",
  4368. });
  4369. }
  4370. );
  4371. },
  4372. showMonthWorkTimeReminder() {
  4373. this.monthTotalPage = 0,
  4374. this.tbload = true
  4375. let parameter={}
  4376. parameter={
  4377. startDate: this.WorktimeDatepickValue[0],
  4378. endDate: this.WorktimeDatepickValue[1],
  4379. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4380. viewValue:this.isReminder?1:0
  4381. }
  4382. this.http.post(
  4383. "/report/getUserDailyWorkTimeReminder",
  4384. parameter,
  4385. (res) => {
  4386. if (res.code == "ok") {
  4387. this.tbload = false;
  4388. this.monthWorkData = res.data.list;
  4389. this.monthTotal = res.data.list.length
  4390. if (this.monthWorkData.length > 50) {
  4391. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4392. }else{
  4393. this.monthWorkDataS = this.monthWorkData
  4394. }
  4395. this.searchScreen(0)
  4396. this.$nextTick(function(){
  4397. this.$refs.hasworkTbl.doLayout();
  4398. });
  4399. }
  4400. },
  4401. (error) => {
  4402. this.tbload = false
  4403. this.$message({
  4404. message: error,
  4405. type: "error",
  4406. });
  4407. }
  4408. );
  4409. },
  4410. showMonthNotWorkTime() {
  4411. this.monthTotalPage = 0,
  4412. this.tbload = true,
  4413. this.http.post(
  4414. "/report/getNoReportUserList",
  4415. {
  4416. startDate: this.WorktimeDatepickValue[0],
  4417. endDate: this.WorktimeDatepickValue[1],
  4418. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4419. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4420. },
  4421. (res) => {
  4422. if (res.code == "ok") {
  4423. this.tbload = false
  4424. this.monthNotWorkDate = res.data;
  4425. this.monthnotTotal = res.data.length
  4426. if (this.monthNotWorkDate.length > 50) {
  4427. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4428. } else {
  4429. this.monthNotWorkDateS = this.monthNotWorkDate
  4430. }
  4431. this.searchScreen(1)
  4432. this.$nextTick(function(){
  4433. this.$refs.hasworkTbl2.doLayout();
  4434. });
  4435. }
  4436. },
  4437. (error) => {
  4438. this.tbload = false
  4439. this.$message({
  4440. message: error,
  4441. type: "error",
  4442. });
  4443. }
  4444. );
  4445. },
  4446. listScroll(){
  4447. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4448. this.isMore = true
  4449. setTimeout(()=>{
  4450. this.isMore = false
  4451. },1000)
  4452. }else {
  4453. this.isFlag = true
  4454. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4455. this.monthWorkDataS = datalist
  4456. setTimeout(()=>{
  4457. this.isFlag = false
  4458. },300)
  4459. }
  4460. },
  4461. notListScroll(){
  4462. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4463. this.isMore = true
  4464. setTimeout(()=>{
  4465. this.isMore = false
  4466. },1000)
  4467. }else {
  4468. this.isFlag = true
  4469. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4470. this.monthNotWorkDateS = datalist
  4471. // console.log('length',this.monthNotWorkDateS.length)
  4472. setTimeout(()=>{
  4473. this.isFlag = false
  4474. },300)
  4475. }
  4476. },
  4477. getFirstAndLastDay() {
  4478. // 将选定的月份转换为Date对象
  4479. var monthDate = new Date();
  4480. var year = monthDate.getFullYear();
  4481. var month = monthDate.getMonth();
  4482. // 计算起始日和结束日
  4483. var startDay = new Date(year, month, 1);
  4484. var endDay = new Date(year, month + 1, 0);
  4485. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4486. this.WorktimeDatepickValueForMonth=lastmd
  4487. },
  4488. formatDate(date) {
  4489. var year = date.getFullYear();
  4490. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4491. var day = ("0" + date.getDate()).slice(-2);
  4492. return year + "-" + month + "-" + day;
  4493. },
  4494. // 获取默认这zhou日期参数 222
  4495. getLastWeek(e){
  4496. let newdate = new Date()
  4497. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4498. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4499. if(e==1){
  4500. this.WorktimeDatepickValue = lastwd
  4501. this.showMonthWorkTime()
  4502. }else if(e==2){
  4503. this.WorktimeDatepickValue = lastwd
  4504. this.showMonthWorkTimeReminder()
  4505. }else{
  4506. this.WorktimeDatepickValue = lastwd
  4507. this.showMonthNotWorkTime()
  4508. }
  4509. },
  4510. getThisWeek(e){
  4511. let newdate = new Date();
  4512. let nowdate = newdate.toLocaleDateString();
  4513. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4514. if(e==1){
  4515. this.WorktimeDatepickValue = nowwd
  4516. this.showMonthWorkTime()
  4517. }else if(e==2){
  4518. this.WorktimeDatepickValue = nowwd
  4519. this.showMonthWorkTimeReminder()
  4520. }else{
  4521. this.WorktimeDatepickValue = nowwd
  4522. this.showMonthNotWorkTime()
  4523. }
  4524. },
  4525. getDoubleLastWeek(e){
  4526. let newdate = new Date()
  4527. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4528. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4529. if(e==1){
  4530. this.WorktimeDatepickValue = nextwd
  4531. this.showMonthWorkTime()
  4532. }else if(e==2){
  4533. this.WorktimeDatepickValue = nextwd
  4534. this.showMonthWorkTimeReminder()
  4535. }else{
  4536. this.WorktimeDatepickValue = nextwd
  4537. this.showMonthNotWorkTime()
  4538. }
  4539. },
  4540. alreadyAllDate(stime,etime){
  4541. let diffdate = new Array();
  4542. let i=0;
  4543. while(stime<=etime){
  4544. let dateArray = stime.split("-");
  4545. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4546. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4547. let stimewk = this.weekDay[date.getDay()]
  4548. 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')
  4549. 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])
  4550. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4551. let stime_ts = new Date(stime).getTime();
  4552. let next_date = stime_ts + (24*60*60*1000);
  4553. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4554. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4555. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4556. stime = next_dates_y+next_dates_m+next_dates_d;
  4557. i++;
  4558. }
  4559. return diffdate
  4560. },
  4561. getAutoWeekDate(e) {
  4562. let dateString = e;
  4563. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4564. if (dateString.match(dateStringReg)) {
  4565. let presentDate = new Date(dateString),
  4566. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4567. return Array.from(new Array(7), function (val, index) {
  4568. let formatDate = new Date(
  4569. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4570. );
  4571. return (
  4572. formatDate.getFullYear() +
  4573. "-" +
  4574. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4575. "-" +
  4576. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4577. );
  4578. });
  4579. } else {
  4580. throw new Error(
  4581. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4582. );
  4583. }
  4584. },
  4585. onProgressChange() {
  4586. this.$forceUpdate();
  4587. },
  4588. showChooseMembTree() {
  4589. this.chosenMembCount = this.participator.length;
  4590. this.chooseParticipVisible = true;
  4591. },
  4592. onTreeItemChange() {
  4593. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4594. var list = chosenList.filter(item=>item.isUser == 1);
  4595. this.chosenMembCount = list.length;
  4596. },
  4597. findUserInTree() {
  4598. if (this.filterName == '') {
  4599. this.deptMembData = this.allMembData;
  4600. } else {
  4601. var list = this.findRecursively(this.filterName, this.allMembData);
  4602. this.deptMembData = list;
  4603. }
  4604. },
  4605. findRecursively(username, list) {
  4606. var filterList = [];
  4607. for (var i=0;i<list.length; i++) {
  4608. if (list[i].isUser == 1) {
  4609. if (list[i].label.indexOf(username) >= 0) {
  4610. //匹配上了
  4611. filterList.push(list[i]);
  4612. }
  4613. } else if (list[i].children != null && list[i].children.length > 0) {
  4614. var subList = this.findRecursively(username, list[i].children);
  4615. if (subList.length > 0) {
  4616. subList.forEach(s=>filterList.push(s));
  4617. }
  4618. }
  4619. }
  4620. return filterList;
  4621. },
  4622. //确定选择参与人
  4623. chooseParticip() {
  4624. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4625. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4626. //只能选择一个人进行代填,防止任务有问题
  4627. if (this.chosenMembList.length > 1) {
  4628. this.$message({
  4629. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4630. type: "error",
  4631. });
  4632. return;
  4633. }
  4634. this.chooseParticipVisible = false;
  4635. this.workForm.userNames = '';
  4636. this.workForm.userId = [];
  4637. this.participator = [];
  4638. for (var i=0;i<this.chosenMembList.length; i++) {
  4639. this.workForm.userId.push(this.chosenMembList[i].id);
  4640. this.workForm.userNames += this.chosenMembList[i].label+',';
  4641. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4642. this.participator.push(item);
  4643. }
  4644. if (this.workForm.userNames.length > 0) {
  4645. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4646. }
  4647. if(this.user.userNameNeedTranslate == 1) {
  4648. if(this.workForm.userNames) {
  4649. this.workForm.userNames = this.workForm.userNames.split(',')
  4650. }
  4651. }
  4652. //加载该人员的可填报项目
  4653. if (this.workForm.userId.length > 0) {
  4654. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4655. }
  4656. //打通企业微信考勤的情况,获取考勤
  4657. if (this.user.timeType.showCorpwxCardtime || this.user.timeType.showDdCardtime) {
  4658. this.getTargetUserCardTime();
  4659. }
  4660. },
  4661. getTargetUserCardTime() {
  4662. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4663. let url = this.user.timeType.showCorpwxCardtime==1?'/user-corpwx-time/getUserCardTime':'/user-dingding-time/getUserCardTime';
  4664. this.http.post(url,{
  4665. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4666. },
  4667. res => {
  4668. if (res.code == "ok") {
  4669. this.$set(this.workForm,'time', res.data);
  4670. }
  4671. },
  4672. error => {
  4673. this.$message({
  4674. message: error,
  4675. type: "error"
  4676. });
  4677. }
  4678. );
  4679. }
  4680. },
  4681. notifySel(sel){
  4682. // console.log(sel);
  4683. this.notifySelList = sel
  4684. },
  4685. //微信通知人员填写
  4686. Notify(code) {
  4687. if (this.notifySelList.length == 0) return;
  4688. var ids = '';
  4689. this.notifySelList.forEach(f=>{
  4690. ids += f.id+',';
  4691. })
  4692. this.http.post('/user/pushFillReport',{
  4693. ids: ids, date: this.curDate,
  4694. code: code
  4695. },
  4696. res => {
  4697. if (res.code == "ok") {
  4698. this.$message({
  4699. message: this.$t('message.sentSuccessfully'),
  4700. type: "success"
  4701. });
  4702. }
  4703. },
  4704. error => {
  4705. this.$message({
  4706. message: error,
  4707. type: "error"
  4708. });
  4709. }
  4710. );
  4711. },
  4712. //导出人员列表
  4713. exportMemb() {
  4714. if (this.fillMembList.length == 0) return;
  4715. var ids = '';
  4716. this.fillMembList.forEach(f=>{
  4717. ids += f.id+',';
  4718. })
  4719. this.http.post('/user/exportMembList',{
  4720. ids: ids,isFill: this.isFill, date: this.curDate
  4721. },
  4722. res => {
  4723. if (res.code == "ok") {
  4724. var aTag = document.createElement('a');
  4725. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4726. aTag.href = res.data;
  4727. aTag.click();
  4728. }
  4729. },
  4730. error => {
  4731. this.$message({
  4732. message: error,
  4733. type: "error"
  4734. });
  4735. }
  4736. );
  4737. },
  4738. showMembList(fill) {
  4739. this.membListVisible = true;
  4740. if (fill == 0) {
  4741. this.fillMembList = this.unFillList;
  4742. this.isFill = false;
  4743. let leaveList = []
  4744. let unleaveList = []
  4745. for(let i in this.fillMembList){
  4746. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4747. leaveList.push(this.fillMembList[i])
  4748. }else{
  4749. unleaveList.push(this.fillMembList[i])
  4750. }
  4751. }
  4752. this.fillMembList = unleaveList
  4753. this.fillMembList_leave = leaveList
  4754. } else if(fill == 1){
  4755. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4756. this.isFill = true;
  4757. }else{
  4758. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4759. this.isFill = true;
  4760. }
  4761. },
  4762. //获取自己填写的日报状态
  4763. getReportFillStatus() {
  4764. this.http.post('/report/getReportFillStatus',{
  4765. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4766. },
  4767. res => {
  4768. if (res.code == "ok") {
  4769. this.fillStatusList = res.data;
  4770. this.allDate.forEach(d=>{
  4771. var fillInfo = null;
  4772. d.state = null;
  4773. this.fillStatusList.forEach(s=>{
  4774. var d1 = s.createDate.split('-')[2];
  4775. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4776. if (d1.indexOf('0') == 0) {
  4777. d1 = d1.substring(1,d1.length);
  4778. }
  4779. if (d1 == d2) {
  4780. d.state = s.state;
  4781. d.missReport = s.missReport;//是否漏填
  4782. d.exceedCardTime = s.exceedCardTime
  4783. }
  4784. })
  4785. })
  4786. this.$forceUpdate();
  4787. }
  4788. },
  4789. error => {
  4790. this.$message({
  4791. message: error,
  4792. type: "error"
  4793. });
  4794. }
  4795. );
  4796. },
  4797. scrollFunction () {
  4798. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4799. if (this.domObj.attachEvent) { // IE
  4800. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4801. } else if (this.domObj.addEventListener) {
  4802. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4803. }
  4804. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4805. },
  4806. mouseScroll(event) { // google 浏览器下
  4807. let detail = event.wheelDelta || event.detail
  4808. let moveForwardStep = -1
  4809. let moveBackStep = 1
  4810. let step = 0
  4811. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4812. event.preventDefault() // 阻止浏览器默认事件
  4813. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4814. },
  4815. // //左右滚动
  4816. // wheel(e){
  4817. // var a = document.getElementById("dateScroll");
  4818. // var scroll_width = 80; //滚动一下的距离
  4819. // var e = e || window.event, v;
  4820. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4821. // if(v>3||-v>3) v=-v;
  4822. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4823. // e.preventDefault(); //阻止浏览器的默认滚动
  4824. // },
  4825. showExportDialog() {
  4826. this.exportType = 0
  4827. this.exportDialog = true;
  4828. this.getCustomConfigurationItems()
  4829. },
  4830. showExportTimeDialog() {
  4831. this.exportTimeDialog = true;
  4832. },
  4833. changeAllTime() {
  4834. //总时长发生改变,自动按比例计算
  4835. if(!this.workForm.totalDuration) {
  4836. this.workForm.totalDuration = 0.5
  4837. }
  4838. this.workForm.domains.forEach(d=>{
  4839. d.workingTime = (d.progress*this.workForm.totalDuration/100).toFixed(2);
  4840. });
  4841. //计算jsTime
  4842. if (this.workForm.createDate) {
  4843. let sdate = new Date(this.workForm.createDate[0]);
  4844. let edate = new Date(this.workForm.createDate[1]);
  4845. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4846. if (days < 0) {
  4847. days = 0;
  4848. }
  4849. this.jsTime = this.workForm.totalDuration * days;
  4850. }
  4851. this.seleChn()
  4852. },
  4853. // 是否加班的单机事件
  4854. check() {
  4855. this.selected = !this.selected
  4856. this.isNew = this.selected
  4857. },
  4858. updateSubProject() {
  4859. this.$forceUpdate();
  4860. },
  4861. selectDegreeId(domain, index) {
  4862. this.http.post('/report/defaultDegree',{
  4863. projectId: domain.projectId
  4864. },
  4865. res => {
  4866. if (res.code == "ok") {
  4867. if(res.data) {
  4868. this.workForm.domains[index].degreeId = res.data.id + ''
  4869. this.$forceUpdate();
  4870. }
  4871. }
  4872. },
  4873. error => {
  4874. this.$message({
  4875. message: error,
  4876. type: "error"
  4877. });
  4878. }
  4879. );
  4880. },
  4881. //项目选中了, 加载子项目
  4882. selectProject(domain, index) {
  4883. if(!domain.projectId){
  4884. return;
  4885. }
  4886. // 默认选中上次填写的自定义维度
  4887. if(this.yonghuUser.customDegreeActive == 1) {
  4888. this.selectDegreeId(domain, index)
  4889. }
  4890. domain.projectName = this.isSubstitude?this.subFillProjectList.filter(p=>p.id == domain.projectId)[0].projectName:this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4891. domain.isPublic = this.isSubstitude?this.subFillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic:this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4892. this.http.post('/sub-project/list',{
  4893. projectId: domain.projectId,
  4894. isReport: true
  4895. },
  4896. res => {
  4897. //清空之前选中的子项目
  4898. // this.workForm.domains[index].subProjectId = 0;
  4899. if (res.code == "ok") {
  4900. this.workForm.domains[index].subProjectList = res.data;
  4901. this.workForm.domains[index].subProjectId = null;
  4902. this.$forceUpdate();
  4903. }
  4904. },
  4905. error => {
  4906. this.$message({
  4907. message: error,
  4908. type: "error"
  4909. });
  4910. }
  4911. );
  4912. //项目相关的近期任务
  4913. if (this.user.company.packageProject == 1) {
  4914. this.getRecentTaskList(domain, index);
  4915. //获取项目相关专业
  4916. if (this.user.company.packageEngineering == 1) {
  4917. this.getProjectProfessions(domain, index);
  4918. }
  4919. //获取项目下的任务分组
  4920. this.getTaskGroups(domain, index);
  4921. }
  4922. // 获取项目相关的维度
  4923. // domain.degreeId = null
  4924. this.$set(domain,'degreeId',null)
  4925. this.$set(domain,'multiDegrIdArray',null)
  4926. this.dimension(domain, index);
  4927. //获取项目审核人
  4928. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4929. this.getProjectAuditorList(domain, index);
  4930. } else {
  4931. //按分组的负责人来审核
  4932. domain.projectAuditorId = null;
  4933. domain.projectAuditorName = null;
  4934. domain.auditUserList = null;
  4935. }
  4936. if (this.reportTimeType.type == 3) {
  4937. //新增项目时,自动计算
  4938. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(2);
  4939. }
  4940. //加载昱众的工作职责
  4941. if (this.user.companyId == this.yuzhongCompId) {
  4942. this.updateResponse(domain);
  4943. }
  4944. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4945. if((reportExtraField4Name || reportExtraField5Name) && domain.groupId) {
  4946. this.getInfoByProjectId(domain, index)
  4947. }
  4948. },
  4949. getInfoByProjectId(domain, index, flag = true) {
  4950. const { projectId } = domain
  4951. const projectList = this.fillProjectList || this.subFillProjectList
  4952. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4953. this.http.post('/erpOrderInfo/getInfoByProjectIdAndGroupId',{
  4954. projectId: projectCode,
  4955. date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1],
  4956. groupId: domain.groupId
  4957. },
  4958. res => {
  4959. if (res.code == "ok") {
  4960. if(flag) {
  4961. domain.extraField4 = ''
  4962. domain.extraField5 = ''
  4963. }
  4964. domain.reportExtraField4List = res.data.orderIds || []
  4965. domain.reportExtraField5List = res.data.lines || []
  4966. this.$forceUpdate();
  4967. }
  4968. },
  4969. error => {
  4970. this.$message({
  4971. message: error,
  4972. type: "error"
  4973. });
  4974. }
  4975. );
  4976. },
  4977. getRecentTaskList(domain, index) {
  4978. //刷新任务时,清空服务
  4979. this.$set(domain, 'sapServiceId', null);
  4980. this.$set(domain, 'taskId', null);
  4981. var param = {
  4982. projectId: domain.projectId,
  4983. isSubstitude:this.isSubstitude?1:0,
  4984. };
  4985. if (domain.groupId) {
  4986. param.groupId = domain.groupId;
  4987. }
  4988. if (domain.stage) {
  4989. param.stage = domain.stage;
  4990. }
  4991. //专业版代填,获取代填员工的任务
  4992. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4993. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4994. this.$message({
  4995. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4996. type: "error"
  4997. });
  4998. return;
  4999. } else {
  5000. param.userId = this.workForm.userId[0];
  5001. }
  5002. }
  5003. this.http.post('/task/getRecentTask',param,
  5004. res => {
  5005. if (res.code == "ok") {
  5006. this.workForm.domains[index].allTaskList = res.data;
  5007. this.workForm.domains[index].taskList = res.data;
  5008. this.$forceUpdate();
  5009. }
  5010. },
  5011. error => {
  5012. this.$message({
  5013. message: error,
  5014. type: "error"
  5015. });
  5016. }
  5017. );
  5018. },
  5019. //获取项目审核人
  5020. getProjectAuditorList(domainItem, index) {
  5021. if(domainItem.projectId == '') {
  5022. return
  5023. }
  5024. domainItem.projectAuditorId = null;
  5025. domainItem.projectAuditorName = null;
  5026. var param = { projectId: domainItem.projectId};
  5027. if (this.isSubstitude) {
  5028. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  5029. param.userId = this.workForm.userId[0];
  5030. }
  5031. }
  5032. this.http.post('/project-auditor/getList',param,
  5033. res => {
  5034. if (res.code == "ok") {
  5035. domainItem.auditUserList = res.data;
  5036. if (res.data.length==0) {
  5037. this.$message({
  5038. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  5039. type: "error"
  5040. });
  5041. } else if (res.data.length==1) {
  5042. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  5043. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  5044. }
  5045. this.$forceUpdate();
  5046. }
  5047. },
  5048. error => {
  5049. this.$message({
  5050. message: error,
  5051. type: "error"
  5052. });
  5053. }
  5054. );
  5055. },
  5056. // 获取维度数据
  5057. dimension(domain, index) {
  5058. if(domain.projectId == '') {
  5059. return
  5060. }
  5061. this.http.post('/project/getDegreeList',{
  5062. projectId: domain.projectId,
  5063. },
  5064. res => {
  5065. if (res.code == "ok") {
  5066. // console.log("维度数据",res.data);
  5067. this.workForm.domains[index].wuduList = res.data
  5068. // this.workForm = this.workForm
  5069. this.$forceUpdate()
  5070. }
  5071. },
  5072. error => {
  5073. this.$message({
  5074. message: error,
  5075. type: "error"
  5076. });
  5077. }
  5078. );
  5079. },
  5080. //切换任务阶段
  5081. changeStages(domain, index) {
  5082. if (domain.stage == null || domain.stage == '') {
  5083. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  5084. } else {
  5085. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  5086. }
  5087. this.getRecentTaskList(domain, index);
  5088. this.$forceUpdate();
  5089. },
  5090. getGroupStages(domain, index, keepStage) {
  5091. if(this.user.companyId == '7536') {
  5092. const taskGroupsList = domain.taskGroups
  5093. const groupId = domain.groupId
  5094. const taskGroupRow = taskGroupsList.find(item => item.id == groupId)
  5095. if(groupId && taskGroupRow.name.indexOf('出差工时') != '-1') {
  5096. domain.extraField4 = ''
  5097. domain.extraField5 = ''
  5098. }
  5099. if(groupId) {
  5100. this.getInfoByProjectId(domain, index, true)
  5101. }
  5102. }
  5103. console.log(domain);
  5104. if(!domain.groupId){
  5105. domain.projectAuditorId = ''
  5106. domain.stages = []
  5107. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  5108. domain.taskId = ''
  5109. domain.sapServiceId = ''
  5110. }
  5111. if(this.user.timeType.reportAuditType >= 1){
  5112. domain.auditUserList = []
  5113. }
  5114. this.$forceUpdate();
  5115. return
  5116. }
  5117. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  5118. res => {
  5119. if (res.code == "ok") {
  5120. if (!keepStage) {
  5121. domain.stage = '';
  5122. }
  5123. domain.stages = res.data;
  5124. this.getRecentTaskList(domain, index);
  5125. this.$forceUpdate();
  5126. }
  5127. },
  5128. error => {
  5129. this.$message({
  5130. message: error,
  5131. type: "error"
  5132. });
  5133. });
  5134. //检查当前的项目是否需要获取分组的负责人
  5135. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  5136. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  5137. res => {
  5138. if (res.code == "ok") {
  5139. domain.getProjectAuditorList = res.data;
  5140. domain.auditUserList = res.data;
  5141. if (res.data.length==1) {
  5142. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  5143. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  5144. } else if (res.data.length==0) {
  5145. domain.projectAuditorId = null;
  5146. domain.projectAuditorName = null;
  5147. }
  5148. this.$forceUpdate();
  5149. }
  5150. },
  5151. error => {
  5152. this.$message({
  5153. message: error,
  5154. type: "error"
  5155. });
  5156. });
  5157. }
  5158. },
  5159. getProjectProfessions(domain, index) {
  5160. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  5161. res => {
  5162. if (res.code == "ok") {
  5163. this.workForm.domains[index].professionProgress = res.data;
  5164. this.$forceUpdate();
  5165. }
  5166. },
  5167. error => {
  5168. this.$message({
  5169. message: error,
  5170. type: "error"
  5171. });
  5172. });
  5173. },
  5174. //删除自己的日报
  5175. deleteReport() {
  5176. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5177. confirmButtonText: this.$t('btn.determine'),
  5178. cancelButtonText: this.$t('btn.cancel'),
  5179. type: "warning"
  5180. })
  5181. .then(() => {
  5182. this.listLoading = true;
  5183. this.http.post('/report/delete',{
  5184. userId: this.user.id,
  5185. date: this.workForm.createDate
  5186. },
  5187. res => {
  5188. this.listLoading = false;
  5189. if (res.code == "ok") {
  5190. this.$message({
  5191. message: this.$t('message.successfullyDeleted'),
  5192. type: "success"
  5193. });
  5194. this.getReportList();
  5195. this.getDepartment();
  5196. this.dialogVisible = false;
  5197. } else {
  5198. this.$message({
  5199. message: res.msg,
  5200. type: "error"
  5201. });
  5202. }
  5203. },
  5204. error => {
  5205. this.listLoading = false;
  5206. this.$message({
  5207. message: error,
  5208. type: "error"
  5209. });
  5210. }
  5211. );
  5212. })
  5213. .catch(() => {});
  5214. },
  5215. // 管理员删除日报
  5216. guanli(item) {
  5217. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5218. let param = {date: this.date + day, userId: item.id};
  5219. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5220. confirmButtonText: this.$t('btn.determine'),
  5221. cancelButtonText: this.$t('btn.cancel'),
  5222. type: "warning"
  5223. })
  5224. .then(() => {
  5225. this.listLoading = true;
  5226. this.http.post('/report/delete',param,
  5227. res => {
  5228. this.listLoading = false;
  5229. if (res.code == "ok") {
  5230. this.$message({
  5231. message: this.$t('message.successfullyDeleted'),
  5232. type: "success"
  5233. });
  5234. this.getReportList();
  5235. this.getDepartment();
  5236. this.dialogVisible = false;
  5237. } else {
  5238. this.$message({
  5239. message: res.msg,
  5240. type: "error"
  5241. });
  5242. }
  5243. },
  5244. error => {
  5245. this.listLoading = false;
  5246. this.$message({
  5247. message: error,
  5248. type: "error"
  5249. });
  5250. }
  5251. );
  5252. })
  5253. .catch(() => {});
  5254. },
  5255. selectAll() {
  5256. if (this.isAllSelect) {
  5257. var keys = [];
  5258. this.reportNames.forEach(b=>{
  5259. keys.push(b.id);
  5260. })
  5261. this.$refs.approveTree.setCheckedKeys(keys);
  5262. } else {
  5263. this.$refs.approveTree.setCheckedKeys([]);
  5264. }
  5265. },
  5266. removeEmptyNode(list) {
  5267. for (var i=0;i<list.length;i++) {
  5268. var cnt = 0;
  5269. if (list[i].membCount == 0) {
  5270. list.splice(i, 1);
  5271. i--;
  5272. } else if (list[i].children != null) {
  5273. this.removeEmptyNode(list[i].children);
  5274. }
  5275. }
  5276. },
  5277. calculateMembCount(list) {
  5278. for (var i in list) {
  5279. var cnt = 0;
  5280. if (list[i].children != null) {
  5281. this.calculateMembCount(list[i].children);
  5282. for (var m in list[i].children) {
  5283. cnt += list[i].children[m].membCount;
  5284. }
  5285. }
  5286. if (list[i].isUser == 1) {
  5287. cnt++;
  5288. this.membCount++;
  5289. }
  5290. list[i].membCount = cnt;
  5291. }
  5292. },
  5293. stateChange() {
  5294. // console.log(this.allData,'alldate');
  5295. this.membCount = 0;
  5296. if (this.selectState == -1) {
  5297. //全部状态
  5298. this.data = this.allData;
  5299. } else {
  5300. //未填报
  5301. this.seluserText = ''
  5302. var newData = JSON.parse(JSON.stringify(this.allData));
  5303. this.filterState(this.selectState, newData);
  5304. this.data = newData;
  5305. }
  5306. this.calculateMembCount(this.data);
  5307. this.data[0].membCount = this.membCount;//总人数
  5308. },
  5309. //按状态过滤部门人员
  5310. filterState(state, list) {
  5311. for (var i =0;i<list.length; i++) {
  5312. var obj = list[i];
  5313. if (obj.isUser == 1) {
  5314. var match = false;
  5315. if (state == -2) {
  5316. if (obj.state == null) {
  5317. match = true;
  5318. }
  5319. } else {
  5320. if (obj.state == state) {
  5321. match = true;
  5322. }
  5323. }
  5324. if (!match) {
  5325. list.splice(i, 1);
  5326. i--;
  5327. } else {
  5328. }
  5329. } else {
  5330. if (obj.children != null) {
  5331. this.filterState(state, obj.children);
  5332. }
  5333. }
  5334. }
  5335. },
  5336. //a按名称过滤部门人员
  5337. async seluserforText(){
  5338. const { userNameNeedTranslate } = this.user
  5339. this.membCount = 0;
  5340. var newData = JSON.parse(JSON.stringify(this.allData));
  5341. let textList = [this.seluserText]
  5342. if(userNameNeedTranslate == 1) {
  5343. this.dataLoading = true
  5344. let res = await this.postData('/user/getEmployeeList', {
  5345. keyword: this.seluserText,
  5346. cursor: '',
  5347. departmentId: -1,
  5348. pageIndex: 1,
  5349. pageSize: 1000
  5350. })
  5351. textList = res.data.records.map(item => item.name)
  5352. this.dataLoading = false
  5353. }
  5354. // return
  5355. this.seluserforTextin(this.seluserText, newData, textList)
  5356. this.data = newData;
  5357. this.calculateMembCount(this.data);
  5358. this.data[0].membCount = this.membCount;//总人数
  5359. },
  5360. seluserforTextin(text, list, textList = []){
  5361. for (var i =0;i<list.length; i++) {
  5362. var obj = list[i];
  5363. if (obj.isUser == 1) {
  5364. var match = false;
  5365. // if (obj.label.indexOf(text) != -1) {
  5366. // match = true
  5367. // }
  5368. if(textList.some(item => item.includes(obj.label))) {
  5369. match = true
  5370. }
  5371. if (!match) {
  5372. list.splice(i, 1);
  5373. i--;
  5374. } else {
  5375. }
  5376. } else {
  5377. if (obj.children != null) {
  5378. this.seluserforTextin(text, obj.children, textList);
  5379. }
  5380. }
  5381. }
  5382. },
  5383. // 当节点发生变化时
  5384. nodeChangeExpand(data) {
  5385. // 保存当前展开的节点
  5386. let flag = false
  5387. this.nodeModelData.some(item => {
  5388. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5389. flag = true
  5390. return true
  5391. }
  5392. })
  5393. if (!flag) { // 不存在则存到数组里
  5394. this.nodeModelData.push(data.id)
  5395. }
  5396. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5397. },
  5398. nodeChangeCollapse(data) {
  5399. this.nodeModelData.some((item, i) => {
  5400. if (item === data.id) {
  5401. this.nodeModelData.length = i
  5402. }
  5403. })
  5404. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5405. },
  5406. // 部门列表点击
  5407. handleNodeClick(data) {
  5408. // this.dealList = data
  5409. this.theValues(data.id, this.allData)
  5410. // this.depData = data;
  5411. var list = [];
  5412. if (data.id == -1) {
  5413. this.deptId = null;
  5414. this.targetUid = null;
  5415. list = this.data;
  5416. } else if (data.isUser == 1) {
  5417. this.deptId = null;
  5418. this.targetUid = data.id;
  5419. } else {
  5420. this.deptId = data.id;
  5421. this.targetUid = null;
  5422. list.push(data);
  5423. }
  5424. this.getReportList();
  5425. if (list.length > 0) {
  5426. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5427. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5428. }
  5429. },
  5430. exportPushLog(){
  5431. this.http.post('/sap-sync-log/export',{},
  5432. res => {
  5433. if (res.code == "ok") {
  5434. var filePath = res.data;
  5435. var fName = '推送日志.xlsx'
  5436. const a = document.createElement('a'); // 创建a标签
  5437. a.setAttribute('download', fName);// download属性
  5438. a.setAttribute('href', filePath);// href链接
  5439. a.click(); //自执行点击事件
  5440. a.remove();
  5441. } else {
  5442. this.$message({
  5443. message: res.msg,
  5444. type: "error"
  5445. });
  5446. }
  5447. },
  5448. error => {
  5449. this.$message({
  5450. message: error,
  5451. type: "error"
  5452. });
  5453. });
  5454. },
  5455. theValues(id, item) {
  5456. for(var i in item) {
  5457. if(item[i].id == id) {
  5458. this.depData = item[i]
  5459. if(id == '-1') {
  5460. this.translation = '1'
  5461. } else {
  5462. if(item[i].children) {
  5463. this.translation = '2'
  5464. } else {
  5465. this.translation = '3'
  5466. }
  5467. }
  5468. return
  5469. } else {
  5470. if(item[i].children) {
  5471. this.theValues(id, item[i].children)
  5472. }
  5473. }
  5474. }
  5475. },
  5476. //获取可以选择的代填的人员列表
  5477. getSubstitudeUserDeptList() {
  5478. if (this.deptMembData.length == 0) {
  5479. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5480. res => {
  5481. if (res.code == "ok") {
  5482. let noAllData = JSON.parse(JSON.stringify(res.data));
  5483. if (noAllData.length > 0) {
  5484. // if (noAllData[0].label == '全部人员') {
  5485. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5486. noAllData.splice(0,1);
  5487. }
  5488. }
  5489. this.setUserToDept(noAllData);
  5490. this.deptMembData = noAllData;
  5491. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5492. } else {
  5493. this.$message({
  5494. message: res.msg,
  5495. type: "error"
  5496. });
  5497. }
  5498. },
  5499. error => {
  5500. this.$message({
  5501. message: error,
  5502. type: "error"
  5503. });
  5504. });
  5505. }
  5506. },
  5507. // 获取部门列表
  5508. getDepartmentForApprove() {
  5509. this.http.post( this.port.manage.depList, {},
  5510. res => {
  5511. if (res.code == "ok") {
  5512. var list1 = JSON.parse(JSON.stringify(res.data));
  5513. this.deptOptionList = this.changeArr(list1);
  5514. } else {
  5515. this.$message({
  5516. message: res.msg,
  5517. type: "error"
  5518. });
  5519. }
  5520. },
  5521. error => {
  5522. this.$message({
  5523. message: error,
  5524. type: "error"
  5525. });
  5526. });
  5527. },
  5528. // 获取部门列表
  5529. getDepartment() {
  5530. //如果没有权限,就不需要获取
  5531. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5532. return;
  5533. }
  5534. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5535. var param = {date:this.date + day};
  5536. this.http.post("/report/getMembList", param,
  5537. res => {
  5538. if (res.code == "ok") {
  5539. if(res.data.length == 0){
  5540. return
  5541. }
  5542. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5543. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5544. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5545. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5546. // if (this.user.role > 0) {
  5547. // }
  5548. list.splice(0,0,{
  5549. id: -1,
  5550. label: this.$t('lable.allStaff'),
  5551. })
  5552. this.membCount = 0;
  5553. //设置员工到部门下面
  5554. this.setUserToDept(list);
  5555. this.data = list;
  5556. // console.log('data',this.data);
  5557. this.expandDate = [this.data[1].id]
  5558. this.allData = list;
  5559. // if (noAllData.length > 0) {
  5560. // if (noAllData[0].label == '全部人员') {
  5561. // noAllData.splice(0,1);
  5562. // }
  5563. // }
  5564. // this.setUserToDept(noAllData);
  5565. // this.deptMembData = noAllData;
  5566. this.option = this.changeArr(list1);
  5567. list[0].membCount = this.membCount;
  5568. if (this.depData.id == -1) {
  5569. this.depData.membCount = this.membCount;
  5570. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5571. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5572. } else {
  5573. if (this.depData.isUser == null) {
  5574. var dep = this.findTargetDept(this.data, this.depData.id);
  5575. var membDeptList = [];
  5576. membDeptList.push(dep);
  5577. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5578. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5579. }
  5580. }
  5581. if (this.depData.isUser == null) {
  5582. if (this.isFill) {
  5583. this.fillMembList = this.fillList;
  5584. } else {
  5585. this.fillMembList = this.unFillList;
  5586. }
  5587. }
  5588. this.leaveAllNum = 0
  5589. for(let i in this.unFillList){
  5590. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5591. this.leaveAllNum += 1
  5592. }
  5593. }
  5594. this.stateChange()
  5595. } else {
  5596. this.$message({
  5597. message: res.msg,
  5598. type: "error"
  5599. });
  5600. }
  5601. },
  5602. error => {
  5603. this.$message({
  5604. message: error,
  5605. type: "error"
  5606. });
  5607. });
  5608. this.getReportFillStatus();
  5609. },
  5610. findTargetDept(list, deptId) {
  5611. var t = null;
  5612. for (var i=0;i<list.length; i++) {
  5613. if (list[i].isUser == null && list[i].id == deptId) {
  5614. t = list[i];
  5615. break;
  5616. }
  5617. }
  5618. if (t == null) {
  5619. for (var i=0;i<list.length; i++) {
  5620. if (list[i].children != null && list[i].children.length > 0) {
  5621. t = this.findTargetDept(list[i].children, deptId);
  5622. if (t != null) {
  5623. break;
  5624. }
  5625. }
  5626. }
  5627. }
  5628. return t;
  5629. },
  5630. getUserMembListFromDeptList(list, isFill) {
  5631. var membList = [];
  5632. for (var i in list) {
  5633. var deptName = list[i].label;
  5634. if (list[i].userList != null) {
  5635. list[i].userList.forEach(element => {
  5636. if (isFill == 0) {
  5637. //获取未填的
  5638. if (element.state == null) {
  5639. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5640. membList.push(obj);
  5641. }
  5642. } else {
  5643. if (element.state != null) {
  5644. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5645. membList.push(obj);
  5646. }
  5647. }
  5648. });
  5649. }
  5650. if (list[i].children != null) {
  5651. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5652. }
  5653. }
  5654. return membList;
  5655. },
  5656. setUserToDept(list) {
  5657. for (var i in list) {
  5658. var cnt = 0;
  5659. if (list[i].children != null) {
  5660. this.setUserToDept(list[i].children);
  5661. for (var m in list[i].children) {
  5662. cnt += list[i].children[m].membCount;
  5663. }
  5664. }
  5665. if (list[i].userList != null) {
  5666. if (list[i].children == null) {
  5667. list[i].children = [];
  5668. }
  5669. list[i].userList.forEach(element => {
  5670. var obj = {
  5671. id: element.id,
  5672. label:element.name,
  5673. state:element.state,
  5674. parentId:element.departmentId,
  5675. isUser:1,
  5676. workingTime: element.workingTime,
  5677. leaveDays: element.leaveDays,
  5678. leaveTimes: element.leaveTimes
  5679. };
  5680. list[i].children.push(obj);
  5681. this.membCount++;
  5682. cnt++;
  5683. });
  5684. }
  5685. list[i].membCount = cnt;
  5686. }
  5687. },
  5688. // 修改数组
  5689. changeArr(arr) {
  5690. for (var i = 0; i < arr.length; i++) {
  5691. if(arr[i].id != -1 && arr[i].id != 0) {
  5692. if (arr[i].children != null && arr[i].children.length>0) {
  5693. arr[i].children = this.changeArr(arr[i].children);
  5694. }
  5695. arr[i].id && (arr[i].value = arr[i].id);
  5696. delete arr[i].id;
  5697. }
  5698. }
  5699. for(var i in arr) {
  5700. if(arr[i].id == -1 || arr[i].id == 0) {
  5701. arr.splice(i,1)
  5702. }
  5703. }
  5704. return arr;
  5705. },
  5706. //时间段范围设置改动,监听
  5707. onTimeTypeChange(timeType) {
  5708. this.seleChn(1)
  5709. this.showAddMore = true;
  5710. for(var i in this.workForm.domains) {
  5711. if (this.workForm.domains[i].timeType == 0) {
  5712. this.showAddMore = false;
  5713. break;
  5714. }
  5715. }
  5716. if (this.showAddMore) {
  5717. //检测数量
  5718. if (this.workForm.domains.length == 2) {
  5719. this.showAddMore = false;
  5720. } else {
  5721. this.showAddMore = true;
  5722. }
  5723. }
  5724. },
  5725. getTimeType() {
  5726. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5727. res => {
  5728. if (res.code == "ok") {
  5729. var t = res.data;
  5730. this.reportTimeType = t;
  5731. if (this.reportTimeType.type > 0) {
  5732. this.showAddMore = true;
  5733. }
  5734. //转化时间格式
  5735. if (t.allday != null) {
  5736. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5737. }
  5738. if (t.am != null) {
  5739. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5740. }
  5741. if (t.pm != null) {
  5742. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5743. }
  5744. let arr = []
  5745. for(var i in res.data.excludeTimeList) {
  5746. let obj = {
  5747. s: res.data.excludeTimeList[i].startTime,
  5748. e: res.data.excludeTimeList[i].endTime,
  5749. }
  5750. arr.push(obj)
  5751. }
  5752. this.vacationTime = arr
  5753. } else {
  5754. this.$message({
  5755. message: res.msg,
  5756. type: "error"
  5757. });
  5758. }
  5759. },
  5760. error => {
  5761. this.listLoading = false;
  5762. this.$message({
  5763. message: error,
  5764. type: "error"
  5765. });
  5766. });
  5767. },
  5768. // 改变月份 -------
  5769. changeMonthOut() {
  5770. this.getAllDate();
  5771. this.getReportList();
  5772. this.getDepartment();
  5773. },
  5774. // 选择日期
  5775. choseDate(i, item) {
  5776. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5777. return
  5778. }
  5779. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5780. this.choseDay = i;
  5781. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5782. sessionStorage.msg = this.date + day,
  5783. this.getReportList();
  5784. this.getDepartment();
  5785. this.curDate = item.date;
  5786. },
  5787. canClick(i, item){
  5788. let nowDate = new Date()
  5789. let nowDateYear = nowDate.getFullYear()
  5790. let itemYear = parseInt(this.date.split('-')[0])
  5791. let nowDateMonth = nowDate.getMonth() + 1
  5792. let itemMonth = parseInt(this.date.split('-')[1])
  5793. let nowDateDay = nowDate.getDate()
  5794. let itemDay = parseInt(item.showDate.split('.')[1])
  5795. if(nowDateYear < itemYear){
  5796. return false
  5797. }else if(nowDateYear == itemYear){
  5798. if(nowDateMonth < itemMonth){
  5799. return false
  5800. }else if(nowDateMonth == itemMonth){
  5801. if(nowDateDay < itemDay){
  5802. return false
  5803. }
  5804. }
  5805. }
  5806. },
  5807. // 获取日期列表
  5808. getAllDate(e) {
  5809. var dayArry = [];
  5810. var day = this.getCountDays();
  5811. let curMonthDay = null;
  5812. for (var k = 1; k <= day; k++) {
  5813. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5814. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5815. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5816. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5817. if(sessionStorage.msg) {
  5818. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5819. this.choseDay = k - 1;
  5820. curMonthDay = str;
  5821. }
  5822. } else {
  5823. if (new Date().getDate() == k) {
  5824. this.choseDay = k - 1;
  5825. }
  5826. }
  5827. } else {
  5828. this.choseDay = 0;
  5829. }
  5830. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5831. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5832. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5833. }
  5834. this.allDate = dayArry;
  5835. //不能超过最大日期
  5836. if (this.choseDay > day-1) {
  5837. this.choseDay = day-1;
  5838. }
  5839. if(sessionStorage.from != 1){
  5840. let nowmonth = new Date().getMonth() + 1
  5841. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5842. let nowdate = new Date().getDate()
  5843. if(nowd == this.date){
  5844. if(e && sessionStorage.msg){
  5845. }else{
  5846. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5847. }
  5848. let nowday = new Date(sessionStorage.msg).getDate()
  5849. this.choseDay = nowday - 1
  5850. let monthdate = new Date(sessionStorage.msg)
  5851. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5852. }else{
  5853. if(e && sessionStorage.msg){
  5854. }else{
  5855. sessionStorage.msg = this.date + '-01'
  5856. }
  5857. let monthdate = new Date(sessionStorage.msg)
  5858. this.choseDay = monthdate.getDate() - 1
  5859. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5860. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5861. }
  5862. }else{
  5863. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5864. }
  5865. //从消息点击跳转过来的,直接加载指定日期
  5866. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5867. this.curDate = sessionStorage.msg;
  5868. sessionStorage.from = 0;
  5869. } else {
  5870. // if (curMonthDay != null) {
  5871. // // this.curDate = curMonthDay;
  5872. // let d = new Date(sessionStorage.msg)
  5873. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5874. // } else {
  5875. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5876. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5877. // }
  5878. }
  5879. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5880. // if(!sessionStorage.msg){
  5881. // let msgday = this.choseDay + 1
  5882. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5883. // }
  5884. this.getReportFillStatus();
  5885. },
  5886. getCountDays() {
  5887. var newstr = this.date.replace(/-/g, "/");
  5888. var curDate = new Date(newstr+'/01');
  5889. var curMonth = curDate.getMonth();
  5890. curDate.setMonth(curMonth + 1);
  5891. curDate.setDate(0);
  5892. return curDate.getDate();
  5893. },
  5894. reqMore() {
  5895. if (this.hasMore) {
  5896. this.pageIndex++;
  5897. this.requestHttpReports();
  5898. }
  5899. },
  5900. //加载日报数据
  5901. requestHttpReports() {
  5902. //请求数据
  5903. this.listLoading = true;
  5904. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5905. let param = {date: this.date + day};
  5906. if (this.deptId) {
  5907. param.deptId = this.deptId;
  5908. }
  5909. if (this.targetUid) {
  5910. param.userId = this.targetUid;
  5911. }
  5912. //传页码
  5913. if (this.hasMore) {
  5914. param.pageIndex = this.pageIndex;
  5915. }
  5916. this.http.post( this.port.report.list, param,
  5917. res => {
  5918. this.listLoading = false;
  5919. if (res.code == "ok") {
  5920. //扩增
  5921. if (res.data.data.length > 0) {
  5922. this.reportList = this.reportList.concat(res.data.data);
  5923. } else if (this.pageIndex > 1){
  5924. this.$message({
  5925. message: this.$t('meiYouGengDuoShuJuLe'),
  5926. type: "info"
  5927. });
  5928. }
  5929. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5930. if(document.querySelector("#day"+this.choseDay)){
  5931. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5932. }
  5933. } else {
  5934. this.$message({
  5935. message: res.msg,
  5936. type: "error"
  5937. });
  5938. }
  5939. },
  5940. error => {
  5941. this.listLoading = false;
  5942. this.$message({
  5943. message: error,
  5944. type: "error"
  5945. });
  5946. });
  5947. },
  5948. //获取日报列表
  5949. getReportList() {
  5950. //初始化,重置数据
  5951. this.pageIndex = 0;
  5952. this.hasMore = true;
  5953. this.reportList = [];
  5954. this.requestHttpReports();
  5955. },
  5956. //刷新日报状态,用于审核后更新
  5957. refreshReportData(reportId) {
  5958. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5959. res => {
  5960. if (res.code == "ok") {
  5961. for (var m=0;m<this.reportList.length; m++) {
  5962. var d = this.reportList[m].data;
  5963. var find = d.filter(r=>r.id == reportId);
  5964. if (find.length > 0) {
  5965. find[0].state = res.data.state;
  5966. if (find[0].state == 2) {//被驳回,要可以编辑
  5967. this.reportList[m].state = 2;
  5968. }
  5969. find[0].isDeptAudit = res.data.isDeptAudit;
  5970. find[0].departmentAuditState = res.data.departmentAuditState;
  5971. find[0].projectAuditorName = res.data.projectAuditorName;
  5972. find[0].projectAuditorId = res.data.projectAuditorId;
  5973. find[0].projectAuditState = res.data.projectAuditState;
  5974. find[0].rejectUserid = res.data.rejectUserid;
  5975. find[0].rejectUsername = res.data.rejectUsername;
  5976. find[0].rejectReason = res.data.rejectReason;
  5977. this.$forceUpdate();
  5978. break;
  5979. }
  5980. }
  5981. } else {
  5982. this.$message({
  5983. message: res.msg,
  5984. type: "error"
  5985. });
  5986. }
  5987. },
  5988. error => {
  5989. this.listLoading = false;
  5990. this.$message({
  5991. message: error,
  5992. type: "error"
  5993. });
  5994. });
  5995. },
  5996. //导出员工工时统计
  5997. exportUserTime() {
  5998. this.listLoading = true;
  5999. var param = {};
  6000. if (this.exportParam.dateRange != null) {
  6001. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  6002. }
  6003. this.http.post('/department/exportDeptStatistic', param,
  6004. res => {
  6005. this.listLoading = false;
  6006. if (res.code == "ok") {
  6007. location.href = res.data;
  6008. this.exportTimeDialog = false;
  6009. } else {
  6010. this.$message({
  6011. message: res.msg,
  6012. type: "error"
  6013. });
  6014. }
  6015. },
  6016. error => {
  6017. this.listLoading = false;
  6018. this.$message({
  6019. message: error,
  6020. type: "error"
  6021. });
  6022. });
  6023. },
  6024. //导出日报
  6025. exportReport() {
  6026. this.exportingData = true;
  6027. var param = {};
  6028. if (this.exportParam.dateRange != null) {
  6029. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  6030. }
  6031. if (this.exportParam.projectId != null) {
  6032. param.projectId = this.exportParam.projectId;
  6033. }
  6034. if (this.exportParam.departmentId != null) {
  6035. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  6036. param.departmentIds = this.exportParam.departmentId.join(',')
  6037. }
  6038. if(this.exportParam.plate) {
  6039. param.plate = this.exportParam.plate
  6040. }
  6041. //物奇直接以精简模式导出
  6042. if (this.user.companyId == '1071') {
  6043. param.exportType = 1;
  6044. }
  6045. param.stateKey = this.stateKey
  6046. // param.departmentId = this.user.departmentId
  6047. this.http.post(this.port.report.export, param,
  6048. res => {
  6049. this.exportingData = false;
  6050. if (res.code == "ok") {
  6051. var filePath = res.data;
  6052. const a = document.createElement('a'); // 创建a标签
  6053. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  6054. a.setAttribute('href', filePath);// href链接
  6055. a.click(); //自执行点击事件
  6056. a.remove();
  6057. this.exportDialog = false;
  6058. } else {
  6059. this.$message({
  6060. message: res.msg,
  6061. type: "error"
  6062. });
  6063. }
  6064. },
  6065. error => {
  6066. this.exportingData = false;
  6067. this.$message({
  6068. message: error,
  6069. type: "error"
  6070. });
  6071. });
  6072. },
  6073. //导出日报审核记录
  6074. exportReportLog() {
  6075. this.exportingData = true;
  6076. var param = {};
  6077. if (this.exportReportLogParam.dateRange != null) {
  6078. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  6079. }
  6080. this.http.post('/report-log/exportReportLog', param,
  6081. res => {
  6082. this.exportingData = false;
  6083. if (res.code == "ok") {
  6084. var filePath = res.data;
  6085. const a = document.createElement('a'); // 创建a标签
  6086. a.setAttribute('download','日报审核记录.xlsx');// download属性
  6087. a.setAttribute('href', filePath);// href链接
  6088. a.click(); //自执行点击事件
  6089. a.remove();
  6090. this.exportDialog = false;
  6091. } else {
  6092. this.$message({
  6093. message: res.msg,
  6094. type: "error"
  6095. });
  6096. }
  6097. },
  6098. error => {
  6099. this.exportingData = false;
  6100. this.$message({
  6101. message: error,
  6102. type: "error"
  6103. });
  6104. });
  6105. },
  6106. restUserCardTime(item){
  6107. let param={}
  6108. param.userId=item.userId
  6109. param.createDate=item.createDate
  6110. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  6111. res => {
  6112. if (res.code == "ok") {
  6113. this.showMonthWorkTimeReminder()
  6114. } else {
  6115. this.$message({
  6116. message: res.msg,
  6117. type: "error"
  6118. });
  6119. }
  6120. },
  6121. error => {
  6122. this.$message({
  6123. message: error,
  6124. type: "error"
  6125. });
  6126. });
  6127. },
  6128. importReportLog(item){
  6129. //首先判断文件类型
  6130. let str = item.file.name.split(".");
  6131. let format = str[str.length - 1];
  6132. if (format != "xls" && format != "xlsx") {
  6133. this.$message({
  6134. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  6135. type: "error"
  6136. });
  6137. } else {
  6138. const loading = this.$loading({
  6139. lock: true,
  6140. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  6141. spinner: 'el-icon-loading',
  6142. background: 'rgba(0, 0, 0, 0.7)'
  6143. });
  6144. let formData = new FormData();
  6145. formData.append("multipartFile", item.file);
  6146. this.http.uploadFile('/report-log/importReportLogChange', formData,
  6147. res => {
  6148. this.$refs.upload.clearFiles();
  6149. loading.close();
  6150. if (res.code == "ok") {
  6151. this.$message({
  6152. message: res.msg,
  6153. type: "success"
  6154. });
  6155. } else {
  6156. this.$message({
  6157. message: res.msg,
  6158. type: "error"
  6159. });
  6160. }
  6161. },
  6162. error => {
  6163. this.$refs.upload.clearFiles();
  6164. loading.close();
  6165. this.$message({
  6166. message: error,
  6167. type: "error"
  6168. });
  6169. });
  6170. }
  6171. },
  6172. //获取项目列表
  6173. getProjectList() {
  6174. this.listLoading = true;
  6175. this.http.post( this.port.project.list, {},
  6176. res => {
  6177. this.listLoading = false;
  6178. if (res.code == "ok") {
  6179. for(var i in res.data) {
  6180. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6181. res.data[i].projectCode = ''
  6182. }
  6183. }
  6184. this.projectList = res.data;
  6185. } else {
  6186. this.$message({
  6187. message: res.msg,
  6188. type: "error"
  6189. });
  6190. }
  6191. },
  6192. error => {
  6193. this.listLoading = false;
  6194. this.$message({
  6195. message: error,
  6196. type: "error"
  6197. });
  6198. });
  6199. },
  6200. getSubUsersFillProjectList(userId) {
  6201. this.http.post( this.port.project.list, {
  6202. forReport: 1,
  6203. userId: userId
  6204. },res => {
  6205. if (res.code == "ok") {
  6206. for(var i in res.data) {
  6207. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6208. res.data[i].projectCode = ''
  6209. }
  6210. }
  6211. this.subFillProjectList = res.data;
  6212. this.getRecentlyProject(userId)
  6213. } else {
  6214. this.$message({
  6215. message: res.msg,
  6216. type: "error"
  6217. });
  6218. }
  6219. },
  6220. error => {
  6221. this.$message({
  6222. message: error,
  6223. type: "error"
  6224. });
  6225. });
  6226. },
  6227. // 获取填报日报的项目下拉列表
  6228. getFillProjectList() {
  6229. this.http.post( this.port.project.list, {
  6230. forReport: 1
  6231. },res => {
  6232. if (res.code == "ok") {
  6233. for(var i in res.data) {
  6234. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6235. res.data[i].projectCode = ''
  6236. }
  6237. }
  6238. this.fillProjectList = res.data;
  6239. this.getRecentlyProject()
  6240. } else {
  6241. this.$message({
  6242. message: res.msg,
  6243. type: "error"
  6244. });
  6245. }
  6246. },
  6247. error => {
  6248. this.$message({
  6249. message: error,
  6250. type: "error"
  6251. });
  6252. });
  6253. },
  6254. //自己填写日报时,刷新到自己的可填报日报列表
  6255. refreshToMyReportProjectList() {
  6256. this.getRecentlyProject();
  6257. },
  6258. getBasecostItemList() {
  6259. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6260. companyId: this.user.companyId
  6261. },
  6262. res => {
  6263. if (res.code == "ok") {
  6264. this.timeBasecostList = res.data;
  6265. }
  6266. });
  6267. },
  6268. getAIReport(createDate) {
  6269. this.http.post('/report/getAIReport', {},
  6270. res => {
  6271. if (res.code == "ok") {
  6272. var quanbu = 0
  6273. this.jsDay = 1
  6274. var zhi = ''
  6275. var slp = res.data
  6276. for(var i in slp) {
  6277. var sp = +slp[i].workingTime + 0
  6278. zhi = this.jsDay * sp
  6279. quanbu = +quanbu + zhi
  6280. }
  6281. this.jsTime = quanbu
  6282. var aiReportData = res.data;
  6283. this.canCancelInDialog = false
  6284. if(aiReportData.length != 0) {
  6285. var arr = [];
  6286. for(var i in aiReportData) {
  6287. arr.push({
  6288. id: null,
  6289. projectId: aiReportData[i].projectId,
  6290. workingTime: aiReportData[i].workingTime,
  6291. content: '',
  6292. progress:100,
  6293. state: 2,
  6294. timeType: aiReportData[i].timeType,
  6295. subProjectList: aiReportData[i].subProjectList,
  6296. taskList: aiReportData[i].taskList,
  6297. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6298. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6299. taskId: aiReportData[i].taskId,
  6300. startTime: aiReportData[i].startTime,
  6301. endTime: aiReportData[i].endTime,
  6302. isOvertime: 0,
  6303. progress:aiReportData[i].progress,
  6304. professionProgress: aiReportData[i].professionProgressList,
  6305. stages:aiReportData[i].stages,
  6306. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6307. pics: null,
  6308. multiWorktime: aiReportData[i].multiWorktime || 0,
  6309. worktimeList: [{}],
  6310. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6311. multiDegrIdArray: aiReportData[i].multiDegrIdList,
  6312. wuduList: aiReportData[i].degreeList,
  6313. taskGroups:aiReportData[i].taskGroups,
  6314. customData: aiReportData[i].customData,//自定义的数值
  6315. auditUserList: aiReportData[i].auditUserList,
  6316. projectAuditorId: aiReportData[i].projectAuditorId,
  6317. projectAuditorName: aiReportData[i].projectAuditorName,
  6318. overtimeHours: aiReportData[i].overtimeHours,
  6319. customText: aiReportData[i].customText,
  6320. basecostId: aiReportData[i].basecostId,
  6321. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6322. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6323. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6324. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6325. canEdit: true,
  6326. content: aiReportData[i].content
  6327. })
  6328. }
  6329. this.workForm.domains = arr;
  6330. } else {
  6331. }
  6332. this.canEdit = true;
  6333. this.originCanEdit = true;
  6334. this.seleChn()
  6335. } else {
  6336. this.$message({
  6337. message: res.msg,
  6338. type: "error"
  6339. });
  6340. }
  6341. },
  6342. error => {
  6343. this.$message({
  6344. message: error,
  6345. type: "error"
  6346. });
  6347. });
  6348. },
  6349. // 获取个人某天的日报 111111
  6350. getReport() {
  6351. this.http.post( this.port.report.getPort, {
  6352. date: this.workForm.createDate
  6353. },
  6354. res => {
  6355. if (res.code == "ok") {
  6356. var quanbu = 0
  6357. this.jsDay = 1
  6358. var zhi = ''
  6359. var slp = res.data.report
  6360. for(var i in slp) {
  6361. var sp = +slp[i].workingTime + 0
  6362. zhi = this.jsDay * sp
  6363. quanbu = +quanbu + zhi
  6364. }
  6365. this.jsTime = quanbu
  6366. var list = res.data;
  6367. this.report = list;
  6368. this.reportTimeType = this.report.timeType;
  6369. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6370. this.isWeekend = !this.report.isWorkDay;
  6371. this.canCancelInDialog = false;
  6372. this.hasWrittenReport = list.report.length != 0;
  6373. if(list.report.length != 0) {
  6374. var arr = [];
  6375. this.canEdit = false;
  6376. let candelete = true
  6377. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6378. for(var i in list.report) {
  6379. var flg = null
  6380. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6381. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6382. var filteredRespList = null
  6383. if (targetP.length > 0) {
  6384. var isPublic = targetP[0].isPublic;
  6385. 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);
  6386. }
  6387. let copyData = {
  6388. id: list.report[i].id,
  6389. projectId: list.report[i].projectId,
  6390. workingTime: list.report[i].workingTime,
  6391. content: list.report[i].content,
  6392. state: list.report[i].state,
  6393. timeType: list.report[i].timeType,
  6394. subProjectList: list.report[i].subProjectList,
  6395. taskList: list.report[i].taskList,
  6396. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6397. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6398. taskId: list.report[i].taskId,
  6399. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6400. startTime: list.report[i].startTime,
  6401. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6402. endTime: list.report[i].endTime,
  6403. isOvertime: flg,
  6404. progress:list.report[i].progress,
  6405. professionProgress: list.report[i].professionProgressList,
  6406. stages:list.report[i].stages,
  6407. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6408. pics: list.report[i].pics,
  6409. multiWorktime: list.report[i].multiWorktime,
  6410. worktimeList: list.report[i].worktimeList,
  6411. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6412. multiDegrIdArray: list.report[i].multiDegrIdList,
  6413. wuduList: list.report[i].degreeList,
  6414. taskGroups:list.report[i].taskGroups,
  6415. customData: list.report[i].customData,//自定义的数值
  6416. auditUserList: list.report[i].auditUserList,
  6417. overtimeHours: list.report[i].overtimeHours,
  6418. customText: list.report[i].customText,
  6419. basecostId: list.report[i].basecostId,
  6420. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6421. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6422. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6423. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6424. canEdit: list.report[i].state >= 2 ? true : false,
  6425. extraField1: list.report[i].extraField1,
  6426. extraField2: list.report[i].extraField2,
  6427. extraField3: list.report[i].extraField3,
  6428. extraField4: list.report[i].extraField4,
  6429. extraField5: list.report[i].extraField5,
  6430. workContentList: list.report[i].workContentList,
  6431. filteredRespList: filteredRespList,
  6432. serviceList: list.report[i].serviceList,
  6433. sapServiceId: list.report[i].sapServiceId,
  6434. reportTargetDeptId: list.report[i].deptId
  6435. }
  6436. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6437. //分组负责人审核的情况下,前端不需要显示,无需设置
  6438. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6439. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6440. }
  6441. arr.push(copyData);
  6442. if (list.report[i].state >= 2) {
  6443. this.canEdit = true;
  6444. }
  6445. if(list.report[i].state < 2){
  6446. candelete = false
  6447. }
  6448. if (list.report[i].state == 0){
  6449. this.canCancelInDialog = true
  6450. }
  6451. // 加判断
  6452. if(this.user.timeType.choseFromAlbum == 1) {
  6453. let arrList = []
  6454. for(var k in list.report[i].pics) {
  6455. let obj = {
  6456. name: k,
  6457. url: list.report[i].pics[k]
  6458. }
  6459. arrList.push(obj)
  6460. }
  6461. arr[i].imgListUrl = arrList
  6462. arr[i].imgList = list.report[i].pics
  6463. }
  6464. if((reportExtraField4Name || reportExtraField5Name) && list.report[i].state >= 2 && copyData.groupId) {
  6465. this.getInfoByProjectId(copyData, i, false)
  6466. }
  6467. }
  6468. let copyWorkForm = {
  6469. createDate: this.workForm.createDate,
  6470. domains: arr,
  6471. userNames:null,
  6472. userId:null,
  6473. time: list.time,
  6474. showRefresh: list.showRefresh
  6475. }
  6476. if(res.data.timeType.type == 3) {
  6477. const reportCalculationReportList = res.data.report || []
  6478. copyWorkForm.totalDuration = reportCalculationReportList.reduce((accumulator, current) => {
  6479. const workingTime = current.workingTime || 0;
  6480. return accumulator + workingTime;
  6481. }, 0);
  6482. }
  6483. this.workForm = {
  6484. ...copyWorkForm
  6485. }
  6486. if (candelete) this.reportCanDelete=candelete;
  6487. } else {
  6488. let copyWorkForm = {
  6489. createDate: this.workForm.createDate,
  6490. domains: [{
  6491. id: null,
  6492. projectId: "",
  6493. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(2),
  6494. content: "",
  6495. progress:100,
  6496. state: 2,
  6497. timeType:0,
  6498. multiWorktime: this.reportTimeType.multiWorktime,
  6499. worktimeList:[{}],
  6500. canEdit: true,
  6501. auditorFirst: '',
  6502. auditorSec: '',
  6503. auditorThird: '',
  6504. ccUserid: ''
  6505. }],
  6506. userId:null,
  6507. userNames:null,
  6508. time: this.report.time,
  6509. showRefresh: list.showRefresh
  6510. }
  6511. if(res.data.timeType.type == 3) {
  6512. copyWorkForm.totalDuration = res.data.timeType.allday
  6513. }
  6514. this.workForm = copyWorkForm
  6515. // businessTrips 有数据的情况下
  6516. const businessTrips = res.data.businessTrips || []
  6517. this.businessTripsArray = res.data.businessTrips || []
  6518. if(businessTrips.length > 0) {
  6519. this.workForm.domains = businessTrips.map((item, index) => {
  6520. return {
  6521. id: null,
  6522. projectId: item.projectId,
  6523. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(2),
  6524. content: "",
  6525. progress:100,
  6526. state: 2,
  6527. timeType:0,
  6528. multiWorktime: this.reportTimeType.multiWorktime,
  6529. worktimeList:[{}],
  6530. canEdit: true,
  6531. auditorFirst: '',
  6532. auditorSec: '',
  6533. auditorThird: '',
  6534. ccUserid: ''
  6535. }
  6536. })
  6537. for(let domainsIndex in this.workForm.domains) {
  6538. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6539. }
  6540. }
  6541. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6542. this.$set(this.workForm.domains[0],'isOvertime',true)
  6543. if(this.reportTimeType.type != 2){
  6544. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6545. }
  6546. }
  6547. if(this.user.timeType.type == 1) {
  6548. var shuzhi = this.user.timeType.allday + ''
  6549. // console.log('执行一次', shuzhi.indexOf('.'))
  6550. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6551. }
  6552. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6553. //默认给第一个,必填字段
  6554. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6555. }
  6556. this.canEdit = true;
  6557. }
  6558. this.originCanEdit = this.canEdit;
  6559. this.seleChn()
  6560. } else {
  6561. this.$message({
  6562. message: res.msg,
  6563. type: "error"
  6564. });
  6565. }
  6566. },
  6567. error => {
  6568. this.$message({
  6569. message: error,
  6570. type: "error"
  6571. });
  6572. });
  6573. },
  6574. guanbi() {
  6575. this.falsss = false,
  6576. this.workTimeForMinYi=0
  6577. },
  6578. // 打开日报填写
  6579. fillInReport(i, isBatch) {
  6580. this.isWeekend = false
  6581. this.reportCanDelete = false
  6582. // console.log(this.user.timeType.type, '选择时长')
  6583. if(i != 1) {
  6584. this.falsss = false
  6585. } else {
  6586. this.falsss = true
  6587. }
  6588. if (this.isSubstitude) {
  6589. this.getSubstitudeUserDeptList();
  6590. } else {
  6591. this.refreshToMyReportProjectList();
  6592. }
  6593. if(i == -1 || this.isSubstitude) {
  6594. this.isDisable = false;
  6595. } else {
  6596. this.isDisable = true;
  6597. }
  6598. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6599. this.isBatch = isBatch;
  6600. if (this.isBatch == 0 && !this.isSubstitude) {
  6601. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6602. let weekday = new Date(this.workForm.createDate).getDay()
  6603. if(this.user.companyId == 817){
  6604. if(weekday == 0){
  6605. this.isWeekend = true
  6606. }
  6607. }else{
  6608. if(weekday == 0 || weekday == 6){
  6609. this.isWeekend = true
  6610. }
  6611. }
  6612. this.getReport(i);
  6613. } else {
  6614. this.jsTime = 0
  6615. this.jsDay = 0
  6616. this.workForm = {
  6617. createDate: null,//批量填报没有日期
  6618. domains: [{
  6619. id: null,
  6620. projectId: "",
  6621. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(2),
  6622. content: "",
  6623. progress:100,
  6624. state: 2,
  6625. timeType:0,
  6626. multiWorktime: this.reportTimeType.multiWorktime,
  6627. worktimeList:[{}],
  6628. canEdit: true,
  6629. }],
  6630. }
  6631. if(this.user.timeType.type == 1) {
  6632. var shuzhi = this.user.timeType.allday + ''
  6633. // console.log('执行二次')
  6634. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6635. }
  6636. if (this.isSubstitude && (this.user.timeType.showCorpwxCardtime || this.user.timeType.showDdCardtime)) {
  6637. this.workForm.showRefresh = true;
  6638. }
  6639. if(this.user.timeType.type == 3) {
  6640. this.workForm.totalDuration = this.user.timeType.allday
  6641. }
  6642. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6643. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6644. }
  6645. this.canEdit = true;
  6646. }
  6647. if (this.isSubstitude) {
  6648. //代填情况,默认计算合计工时
  6649. this.jsDay = 1
  6650. this.seleChn();
  6651. }
  6652. this.dialogVisible = true;
  6653. },
  6654. //按周填报的弹窗口中编辑单项目相关数据
  6655. setWeekFormReportItem(reportId, i, names, row,sss) {
  6656. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6657. this.http.post('/report/getReportById', {
  6658. reportId: reportId
  6659. },
  6660. res => {
  6661. if (res.code == "ok") {
  6662. var data = res.data.report;
  6663. sss.subProjectId = data.subProjectId
  6664. sss.subProjectList = data.subProjectList;
  6665. sss.stage = data.stage
  6666. sss.subProjectList = data.subProjectList
  6667. sss.stages = data.stages
  6668. sss.taskGroups = data.taskGroups;
  6669. sss.auditUserList = data.auditUserList;
  6670. sss.degreeId = data.degreeId;
  6671. sss.customData = data.customData;
  6672. sss.wuduList = data.degreeList;
  6673. if(reportExtraField4Name || reportExtraField5Name) {
  6674. sss.extraField4 = data.extraField4 || ''
  6675. sss.extraField5 = data.extraField5 || ''
  6676. }
  6677. this.zhoBaoIdx = i
  6678. this.zhoBaoName = names
  6679. this.zhoBao = sss
  6680. this.zhis = row
  6681. if (sss.groupId) {
  6682. //最后一个参数表示是否保留stage的值,不要重置为空
  6683. this.getGroupStages(this.zhoBao, 0, true)
  6684. }
  6685. if((reportExtraField4Name || reportExtraField5Name) && sss.groupId) {
  6686. this.weekGetInfoByProjectId(sss)
  6687. }
  6688. this.$forceUpdate();
  6689. }
  6690. });
  6691. },
  6692. // 重新计算合计
  6693. fillInThePedometerOnAWeeklyBasis(index) {
  6694. const weeklyItem = this.zhoData[index] || {}
  6695. const dynamicProjectList = this.selProjectList || []
  6696. const collectionArray = dynamicProjectList.map(item => {
  6697. const name = item.projectName
  6698. return Number(weeklyItem[name].workingTime || 0)
  6699. })
  6700. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6701. this.zhoData[index].he = totalNum
  6702. },
  6703. //输入工时触发
  6704. onInputWorkTime(index) {
  6705. const weeklyItem = this.zhoData[index] || {}
  6706. },
  6707. // 按周填报里内容的填写
  6708. showWeekItemEdit(item, i, projectId,names, row) {
  6709. if (item.state == 0) {
  6710. this.$message({
  6711. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6712. type: "error"
  6713. });
  6714. return;
  6715. }
  6716. if (item.state == 1) {
  6717. this.$message({
  6718. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6719. type: "error"
  6720. });
  6721. return;
  6722. }
  6723. if(this.user.timeType.notAllowedNoAttendance == 1){
  6724. if(this.zhoData[i].corpTime){
  6725. if(this.zhoData[i].corpTime.workHours == 0){
  6726. this.$message({
  6727. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6728. type: 'error'
  6729. })
  6730. return
  6731. }
  6732. }else{
  6733. this.$message({
  6734. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6735. type: 'error'
  6736. })
  6737. return
  6738. }
  6739. }
  6740. var obj = {}
  6741. obj.projectId = projectId
  6742. this.tianxieDialogVisible = true
  6743. this.scopess = item
  6744. var sss = {}
  6745. if (item.id != null) {
  6746. sss.id = item.id;
  6747. sss.state = item.state;
  6748. } else {
  6749. sss.id = -1;
  6750. sss.state = 3;
  6751. }
  6752. sss.projectId = projectId;
  6753. sss.progress = item.progress
  6754. sss.time = item.time
  6755. sss.content = item.content;
  6756. if (sss.time == '' && this.reportTimeType.type == 2) {
  6757. //取已填时间范围中最大的一个作为开始时间
  6758. var startTime = '09:00';
  6759. var fillStartTime = '00:00';
  6760. for (var t in this.selProjectList) {
  6761. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6762. if (fillItem.time) {
  6763. if (fillItem.time[1] > fillStartTime) {
  6764. fillStartTime = fillItem.time[1];
  6765. }
  6766. }
  6767. }
  6768. if (fillStartTime == '00:00') {
  6769. fillStartTime = '09:00';
  6770. }
  6771. var fillEndMax = '18:00';
  6772. if (fillStartTime >= '18:00') {
  6773. fillEndMax = '23:59';
  6774. }
  6775. sss.time = [fillStartTime, fillEndMax];
  6776. }
  6777. sss.groupId = item.groupId
  6778. sss.stage = item.stage;
  6779. sss.workingTime = item.workingTime
  6780. sss.projectAuditorId = item.projectAuditorId;
  6781. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6782. //默认选中第一个
  6783. sss.basecostId = this.timeBasecostList[0].id;
  6784. }
  6785. var hasEdited = this.zhoData[i][names].hasEdited;
  6786. if (hasEdited) {
  6787. console.log('执行到了这个')
  6788. console.log('执行到了这个', { ...item }, obj)
  6789. sss = { ...item }
  6790. //编辑过了
  6791. sss.subProjectId = item.subProjectId
  6792. sss.stage = item.stage
  6793. sss.subProjectList = item.subProjectList
  6794. sss.stages = item.stages
  6795. sss.taskGroups = item.taskGroups;
  6796. // sss.auditUserList = obj.auditUserList ;
  6797. sss.degreeId = item.degreeId;
  6798. sss.customData = item.customData;
  6799. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6800. //只有一个审核人,自动设置上去
  6801. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6802. }
  6803. sss.wuduList = item.wuduList;
  6804. this.zhoBaoIdx = i
  6805. this.zhoBaoName = names
  6806. this.zhoBao = sss
  6807. this.zhis = row
  6808. if (sss.groupId) {
  6809. //最后一个参数表示是否保留stage的值,不要重置为空
  6810. this.getGroupStages(this.zhoBao, 0, true)
  6811. }
  6812. this.$forceUpdate();
  6813. this.getWeeklyTaskList(sss)
  6814. } else {
  6815. //第一次打开,获取数据
  6816. if (sss.id == -1) {
  6817. //新填报的
  6818. this.selectProject(obj, 0);
  6819. var that = this
  6820. setTimeout(() =>{
  6821. sss.subProjectId = that.workForm.domains[0].subProjectId
  6822. sss.subProjectList = item.subProjectList;
  6823. sss.stage = that.workForm.domains[0].stage
  6824. sss.subProjectList = that.workForm.domains[0].subProjectList
  6825. sss.stages = that.workForm.domains[0].stages
  6826. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6827. sss.auditUserList = obj.auditUserList;
  6828. sss.degreeId = item.degreeId;
  6829. sss.customData = item.customData;
  6830. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6831. //只有一个审核人,自动设置上去
  6832. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6833. }
  6834. sss.wuduList = row[0].wuduList
  6835. that.zhoBaoIdx = i
  6836. that.zhoBaoName = names
  6837. that.zhoBao = sss
  6838. that.zhis = row
  6839. if (sss.groupId) {
  6840. //最后一个参数表示是否保留stage的值,不要重置为空
  6841. this.getGroupStages(that.zhoBao, 0, false)
  6842. }
  6843. that.$forceUpdate();
  6844. this.getWeeklyTaskList(sss)
  6845. },600);
  6846. } else {
  6847. //编辑填报过的;数据库已经存在的
  6848. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6849. }
  6850. if((this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) && sss.groupId) {
  6851. setTimeout(() => {
  6852. this.weekGetInfoByProjectId(sss)
  6853. }, 1000)
  6854. }
  6855. }
  6856. },
  6857. weekGetInfoByProjectId(item) {
  6858. console.log(item, '<=== item')
  6859. const { projectId } = item
  6860. const projectList = this.fillProjectList || this.subFillProjectList
  6861. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6862. this.http.post('/erpOrderInfo/getInfoByProjectIdAndGroupId',{
  6863. projectId: projectCode,
  6864. date: this.zhoData[this.zhoBaoIdx].zhoDataTime,
  6865. groupId: item.groupId
  6866. },
  6867. res => {
  6868. if (res.code == "ok") {
  6869. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6870. this.zhoBao.reportExtraField5List = res.data.lines || []
  6871. // if((res.data.orderIds || []).length > 0) {
  6872. // this.zhoBao.extraField4 = res.data.orderIds[0]
  6873. // }
  6874. console.log(this.zhoBao, '<===== this.zhoBao')
  6875. this.$forceUpdate();
  6876. }
  6877. },
  6878. error => {
  6879. this.$message({
  6880. message: error,
  6881. type: "error"
  6882. });
  6883. });
  6884. // console.log(item)
  6885. // console.log(this.zhoBao)
  6886. },
  6887. // 按周填报里内容的填写点击确定
  6888. setWeekProItemData() {
  6889. //专业版模式下,任务分组和阶段必填
  6890. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6891. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6892. this.$message({
  6893. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6894. type: "error"
  6895. });
  6896. return;
  6897. }
  6898. }
  6899. // 检查任务分组
  6900. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6901. this.$message({
  6902. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6903. type: "error"
  6904. });
  6905. return
  6906. }
  6907. //检查子项目是否必填
  6908. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6909. this.$message({
  6910. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6911. type: "error"
  6912. });
  6913. return;
  6914. }
  6915. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6916. this.$message({
  6917. message: this.$t('message.Pleaseselectareviewer'),
  6918. type: "error"
  6919. });
  6920. return
  6921. }
  6922. if(this.user.timeType.reportAuditType == 3){
  6923. let auditTips = ''
  6924. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6925. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6926. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6927. if(auditTips){
  6928. auditTips = auditTips.substring(0,auditTips.length - 1)
  6929. this.$message({
  6930. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6931. type: 'error'
  6932. })
  6933. return
  6934. }
  6935. }
  6936. let errtips = ''
  6937. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6938. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6939. errtips += this.user.timeType.customDegreeName + '、'
  6940. }
  6941. }
  6942. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6943. errtips += this.user.timeType.customDataName + '、'
  6944. }
  6945. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6946. errtips += this.user.timeType.customTextName + '、'
  6947. }
  6948. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6949. errtips += this.$t('other.workMatters') +'、'
  6950. }
  6951. if(errtips){
  6952. errtips = errtips.substring(0,errtips.length - 1)
  6953. this.$message({
  6954. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6955. type: 'error'
  6956. })
  6957. return
  6958. }
  6959. if(this.user.companyId == '7536') {
  6960. const taskGroupsList = this.zhoBao.taskGroups
  6961. const groupId = this.zhoBao.groupId
  6962. const taskGroupRow = taskGroupsList.find(item => item.id == groupId)
  6963. const extraField4 = this.zhoBao.extraField4
  6964. const extraField5 = this.zhoBao.extraField5
  6965. if(groupId && taskGroupRow.name.indexOf('研发工时') != '-1' && (extraField4 || extraField5)) {
  6966. this.$message({
  6967. message: `选择了研发工时,请勿填写工单号和行号`,
  6968. type: "error"
  6969. });
  6970. return
  6971. }
  6972. if(taskGroupRow.name.indexOf('出差工时') != '-1' && extraField4) {
  6973. this.$message({
  6974. message: `出差项目不能关联工单`,
  6975. type: "error"
  6976. });
  6977. return
  6978. }
  6979. if(taskGroupRow.name.indexOf('入库后工时') != '-1' && extraField4) {
  6980. this.$message({
  6981. message: `入库后工时不能关联工单`,
  6982. type: "error"
  6983. });
  6984. return
  6985. }
  6986. }
  6987. this.tianxieDialogVisible = false
  6988. var zhong = this.zhoData
  6989. this.zhoBao.hasEdited = true;
  6990. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6991. this.zhoData = zhong
  6992. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6993. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6994. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6995. },
  6996. // 获取本周
  6997. getCurrentWeek() {
  6998. //今天
  6999. this.targetWeekDate = new Date();
  7000. this.initWeekFormData();
  7001. // this.jiazai()
  7002. },
  7003. // 获取上周
  7004. handleGetPrevWeek() {
  7005. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  7006. this.initWeekFormData();
  7007. // this.jiazai()
  7008. },
  7009. // 获取下周
  7010. handleGetNextvWeek() {
  7011. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  7012. this.initWeekFormData()
  7013. },
  7014. // 加载动画
  7015. jiazai() {
  7016. this.weekDataLoading = true
  7017. var that = this
  7018. setTimeout(() =>{
  7019. that.weekDataLoading = false
  7020. },1000);
  7021. },
  7022. // 转时间格式
  7023. dealdate(date) {
  7024. const dt = new Date(date)
  7025. const y = dt.getFullYear()
  7026. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  7027. const d = (dt.getDate() + '').padStart(2, '0')
  7028. return `${y}-${m}-${d}`
  7029. },
  7030. // 按周填报
  7031. fillInReportss() {
  7032. window.addEventListener('scroll', this.handleScroll, true)
  7033. // this.jiazai()
  7034. this.fillWeekDialogVisi = true;
  7035. if (this.isSubstitude) {
  7036. this.substitudeStep = 1;
  7037. this.getSubstitudeUserDeptList();
  7038. } else {
  7039. this.getCurrentWeek();
  7040. }
  7041. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  7042. //重新获取工时预警类型的预算项
  7043. this.http.post('/project-basecost-setting/getReportBasecostList', {
  7044. companyId: this.user.companyId
  7045. },
  7046. res => {
  7047. if (res.code == "ok") {
  7048. this.timeBasecostList = res.data;
  7049. }
  7050. });
  7051. }
  7052. },
  7053. fillInReportCustom() {
  7054. this.weekIndex++
  7055. this.weekParentData = {
  7056. isSubstitude: this.isSubstitude
  7057. }
  7058. this.fillWeekDialogVisiCustom = true
  7059. },
  7060. // 按周填报的项目筛选
  7061. selListFun(){
  7062. this.selProjectList = []
  7063. if(this.selCon.length){
  7064. for (let i = 0; i < this.selCon.length; i++) {
  7065. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  7066. }
  7067. this.selConShow = false ;
  7068. for (let i in this.zhoData) {
  7069. var obj = this.zhoData[i];
  7070. for(var j in this.selProjectList) {
  7071. var xinzhi = this.selProjectList[j].projectName
  7072. obj[xinzhi] = {}
  7073. obj[xinzhi].time = ''
  7074. obj[xinzhi].content = ''
  7075. obj[xinzhi].progress = 0
  7076. obj[xinzhi].workingTime = 0
  7077. }
  7078. }
  7079. this.initWeekFormData();
  7080. }else{
  7081. this.$message({
  7082. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  7083. type:'error'
  7084. })
  7085. }
  7086. },
  7087. setWeekCardTimeData(list) {
  7088. for(let i in list){
  7089. let datei = '';
  7090. if (this.user.timeType.showDdCardtime == 1) {
  7091. datei = list[i].workDate;
  7092. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  7093. datei = list[i].createDate;
  7094. } else if (this.user.timeType.syncFanwei == 1) {
  7095. datei = list[i].workDate;
  7096. }
  7097. for(let m in this.zhoData) {
  7098. if(datei == this.zhoData[m].zhoDataTime){
  7099. let item = {
  7100. startTime: list[i].startTime,
  7101. endTime: list[i].endTime,
  7102. workHours: list[i].workHours,
  7103. otTime: list[i].otTime
  7104. }
  7105. this.$set(this.zhoData[m],'corpTime',item)
  7106. }
  7107. }
  7108. }
  7109. },
  7110. getWeeklyCardTime(){ //按周填报获取考勤信息
  7111. let dateStr = []
  7112. for(let i in this.zhoData){
  7113. dateStr.push(this.zhoData[i].zhoDataTime)
  7114. }
  7115. this.http.post('/report/getWeeklyCardTime',{
  7116. dateStr: JSON.stringify(dateStr)
  7117. },res => {
  7118. if(res.code == 'ok'){
  7119. for(let i in res.data){
  7120. let datei = '';
  7121. if (this.user.timeType.showDdCardtime == 1) {
  7122. datei = res.data[i].workDate.split('-');
  7123. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  7124. datei = res.data[i].createDate.split('-');
  7125. }
  7126. for(let m in this.zhoData){
  7127. let datem = new Date(this.zhoData[m].zhoDataTime)
  7128. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  7129. let item = {
  7130. startTime: res.data[i].startTime,
  7131. endTime: res.data[i].endTime,
  7132. workHours: res.data[i].workHours
  7133. }
  7134. this.$set(this.zhoData[m],'corpTime',item)
  7135. }
  7136. }
  7137. }
  7138. }else{
  7139. this.$message({
  7140. message: res.msg,
  7141. type: 'error'
  7142. })
  7143. }
  7144. },err => {
  7145. this.$message({
  7146. message: err,
  7147. type: 'error'
  7148. })
  7149. })
  7150. },
  7151. selListqx(){
  7152. this.fillWeekDialogVisi = false
  7153. this.selProjectList = []
  7154. this.selCon = []
  7155. },
  7156. handleScroll() {
  7157. this.changdu = this.projectList.length + 1
  7158. },
  7159. // 自动选择时间点的事件
  7160. // async zhoTimes(item, i) {
  7161. // var iss = i
  7162. // if(item.time == null) {
  7163. // return
  7164. // } else {
  7165. // const zhi = this.zhoData[iss];
  7166. // let he = 0;
  7167. // const timeArr = Object.values(zhi)
  7168. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  7169. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  7170. // const data = await this.getWeekHoursByTimeRange(timeArr);
  7171. // console.log(data, 'data');
  7172. // zhi.he = `${he}h`;
  7173. // }
  7174. // },
  7175. async zhoTimes(item, index) {
  7176. const zho = this.zhoData[index];
  7177. if (!item.time) {
  7178. return;
  7179. }
  7180. const timeArr = Object.values(zho)
  7181. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  7182. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  7183. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  7184. zho.he = `${totalHours[0]}h`;
  7185. },
  7186. // 判断两个时间段是否重叠
  7187. timeOverlap(idx, dateAr) {
  7188. let zhi = 0
  7189. for (let k in dateAr) {
  7190. if (idx !== k) {
  7191. 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))) {
  7192. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  7193. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  7194. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  7195. }
  7196. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  7197. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7198. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  7199. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7200. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7201. } else {
  7202. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  7203. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  7204. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  7205. }
  7206. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  7207. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  7208. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7209. }
  7210. }
  7211. }
  7212. }
  7213. }
  7214. return zhi
  7215. },
  7216. // 计算时间
  7217. getHourMinutes(str, end) {
  7218. var he = 0
  7219. var date2 = '2021/12/12 ' + end +':00'
  7220. var date1 = '2021/12/12 ' + str +':00'
  7221. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  7222. var leave1=date3%(24*3600*1000)
  7223. var hours=Math.floor(leave1/(3600*1000))
  7224. var leave2=leave1%(3600*1000)
  7225. var minutes=Math.floor(leave2/(60*1000))
  7226. var shi = hours+'.'+ minutes
  7227. return he += +shi
  7228. },
  7229. // 自动选择事件长度的事件
  7230. zhoXuan(item, i) {
  7231. var iss = i
  7232. if(item.time == null) {
  7233. return
  7234. } else {
  7235. var zhi = this.zhoData[iss]
  7236. var he = 0
  7237. for(var i in zhi) {
  7238. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  7239. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  7240. console.log('执行')
  7241. he += +zhi[i].workingTime
  7242. }
  7243. }
  7244. zhi.he = he + 'h'
  7245. }
  7246. },
  7247. getPushWorkLogData(){
  7248. this.http.post('/sap-sync-log/list', {},
  7249. res => {
  7250. if (res.code == "ok") {
  7251. this.pushWorkTimeLogData = res.data;
  7252. } else {
  7253. this.$message({
  7254. message: res.msg,
  7255. type: "error"
  7256. });
  7257. }
  7258. },
  7259. error => {
  7260. this.$message({
  7261. message: error,
  7262. type: "error"
  7263. });
  7264. });
  7265. },
  7266. // 获取全部人员
  7267. getUsers() {
  7268. this.http.post('/user/getSimpleActiveUserList', {},
  7269. res => {
  7270. if (res.code == "ok") {
  7271. this.usersList = res.data;
  7272. } else {
  7273. this.$message({
  7274. message: res.msg,
  7275. type: "error"
  7276. });
  7277. }
  7278. },
  7279. error => {
  7280. this.$message({
  7281. message: error,
  7282. type: "error"
  7283. });
  7284. });
  7285. },
  7286. // 按时间比例
  7287. addBli(item, i) {
  7288. var iss = i
  7289. if(item.time == null) {
  7290. return
  7291. } else {
  7292. var zhi = this.zhoData[iss]
  7293. var he = 0
  7294. for(var i in zhi) {
  7295. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7296. he += +zhi[i].workingTime
  7297. }
  7298. }
  7299. zhi.he = he.toFixed(2) + 'h'
  7300. }
  7301. },
  7302. //按周填报选择的项目发生变化,需要设置列
  7303. onSelProjectChange() {
  7304. for (let i = 0; i < this.selCon.length; i++) {
  7305. var exists = false;
  7306. for (let j = 0; j < this.selProjectList.length; j++) {
  7307. if (this.selProjectList[j].id == this.selCon[i]) {
  7308. exists = true;
  7309. break;
  7310. }
  7311. }
  7312. if (!exists) {
  7313. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7314. this.selProjectList.push(newProject);
  7315. //添加新项目
  7316. for (var w in this.zhoData) {
  7317. var dayItem = this.zhoData[w];
  7318. var pName = newProject.projectName;
  7319. dayItem[pName] = {};
  7320. dayItem[pName].time = ''
  7321. dayItem[pName].content = ''
  7322. dayItem[pName].progress = 0
  7323. dayItem[pName].workingTime = 0
  7324. }
  7325. }
  7326. }
  7327. //去掉
  7328. for (let j = 0; j < this.selProjectList.length; j++) {
  7329. var exists = false;
  7330. for (let i = 0; i < this.selCon.length; i++) {
  7331. if (this.selProjectList[j].id == this.selCon[i]) {
  7332. exists = true;
  7333. break;
  7334. }
  7335. }
  7336. if (!exists) {
  7337. this.selProjectList.splice(j, 1);
  7338. j--;
  7339. }
  7340. }
  7341. this.loadFilledWeekReportItem();
  7342. //刷新表格
  7343. // this.$refs.weekTable.doLayout();
  7344. },
  7345. //根据选中的项目来刷新填写表格
  7346. loadFilledWeekReportItem() {
  7347. for (var w in this.zhoData) {
  7348. var dayItem = this.zhoData[w];
  7349. for (var i = 0; i < this.selProjectList.length; i++) {
  7350. var curColumnProject = this.selProjectList[i];
  7351. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7352. for (var t in dayItem.reportList) {
  7353. //有日报的项目,不能取消选择
  7354. for (var p in this.fillProjectList) {
  7355. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7356. }
  7357. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7358. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7359. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7360. if (this.reportTimeType.type == 2) {
  7361. //时间段模式
  7362. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7363. }
  7364. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7365. break;
  7366. }
  7367. }
  7368. // dayItem[curColumnProject.projectName] = matchReportItem;
  7369. }
  7370. }
  7371. this.$nextTick(()=>{
  7372. this.$refs.weekTable.doLayout();
  7373. });
  7374. },
  7375. initWeekFormData() {
  7376. this.weekDataLoading = true;
  7377. for (var p in this.fillProjectList) {
  7378. this.fillProjectList[p].canCancel = 1;
  7379. }
  7380. var param = {
  7381. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7382. };
  7383. if (this.isSubstitude) {
  7384. //传代填人的userId
  7385. param.targetUserId = this.workForm.userId[0];
  7386. }
  7387. this.http.post('/report/getWeeklyReportData',param,res => {
  7388. this.weekDataLoading = false;
  7389. if(res.code == 'ok'){
  7390. let projectList = res.data.projectList;
  7391. if (projectList.length > 0) {
  7392. //有选择过项目进行填报,直接选中
  7393. this.selProjectList = projectList;
  7394. this.selCon = [];
  7395. for (let i = 0; i < projectList.length; i++) {
  7396. this.selCon.push(projectList[i].id);
  7397. }
  7398. }
  7399. //设置日期
  7400. this.weekDateRange = res.data.dateList;
  7401. this.zhoData = [];
  7402. var arrst = []
  7403. for(var i in this.weekDateRange) {
  7404. var obj = {}
  7405. obj.zhoDataTime = this.weekDateRange[i].date
  7406. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7407. obj.he = this.weekDateRange[i].filledTime;
  7408. obj.canFill = this.weekDateRange[i].canFill;
  7409. // obj.filledTime = this.weekDateRange[i].filledTime;
  7410. obj.reportList = this.weekDateRange[i].reportList;
  7411. //初始化,防止渲染报错
  7412. for (var j = 0; j < this.selProjectList.length; j++) {
  7413. var pName = this.selProjectList[j].projectName
  7414. obj[pName] = {}
  7415. obj[pName].time = ''
  7416. obj[pName].content = ''
  7417. obj[pName].progress = 0
  7418. obj[pName].workingTime = 0
  7419. }
  7420. arrst.push(obj)
  7421. }
  7422. this.zhoData = arrst
  7423. this.setWeekCardTimeData(res.data.cardTimeList);
  7424. this.loadFilledWeekReportItem();
  7425. }else{
  7426. this.$message({
  7427. message: res.msg,
  7428. type: 'error'
  7429. })
  7430. }
  7431. },err => {
  7432. this.$message({
  7433. message: err,
  7434. type: 'error'
  7435. })
  7436. })
  7437. },
  7438. zhoZhi(res, i) {
  7439. var zhi = 0
  7440. for(var i in res) {
  7441. if(i != 'zhoDataTime' && i != 'he') {
  7442. zhi += +res[i]
  7443. }
  7444. }
  7445. res.he = zhi
  7446. },
  7447. zhoBtn(i) {
  7448. // this.zhoData.split(i, 1)
  7449. var arr = this.zhoData
  7450. arr.splice(i, 1)
  7451. },
  7452. zhoAddlast(){
  7453. this.selConShow = true
  7454. },
  7455. closeAddWeeklyReport(){
  7456. this.fillWeekDialogVisi = false
  7457. this.selConShow = true
  7458. this.selProjectList = []
  7459. this.selCon = []
  7460. },
  7461. checkDateWorkTime() {
  7462. //针对苏州景昱,单独的检查逻辑
  7463. if (this.user.companyId == 5978) {
  7464. //调接口,先检查工时是否存在异常
  7465. var zhi = this.zhoData;
  7466. var array = [];
  7467. for(let n in zhi){
  7468. if(zhi[n].he){
  7469. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7470. array.push(workData)
  7471. }
  7472. }
  7473. this.submitingReport = true;
  7474. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7475. res => {
  7476. this.submitingReport = false;
  7477. if (res.code == "ok") {
  7478. this.submitWeekReport(0)
  7479. } else {
  7480. this.$confirm(res.msg, this.$t('other.prompts'), {
  7481. confirmButtonText: this.$t('huLveBingTiJiao'),
  7482. cancelButtonText: this.$t('btn.cancel'),
  7483. type: 'error'
  7484. }).then(() => {
  7485. this.submitWeekReport(0)
  7486. }).catch(() => {
  7487. });
  7488. }
  7489. },
  7490. error => {
  7491. this.$message({
  7492. message: error,
  7493. type: "error"
  7494. });
  7495. });
  7496. }
  7497. },
  7498. // 提交按周填报
  7499. submitWeekReport(isDraft) {
  7500. var zhi = this.zhoData
  7501. var ll = 0
  7502. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7503. if(this.reportTimeType.type == 2) {
  7504. for(var i in zhi) {
  7505. this.dateAr = []
  7506. var alp = []
  7507. var zhis = zhi[i]
  7508. for(var j in zhis) {
  7509. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7510. let objs = {}
  7511. objs.s = zhis[j].time[0]
  7512. objs.e = zhis[j].time[1]
  7513. objs.p = j
  7514. alp.push(objs)
  7515. }
  7516. }
  7517. this.dateAr = alp
  7518. if (this.reportTimeType.timeCanOverlap == 0) {
  7519. let str = this.$t('message.Filledtimeperiodsoverlap')
  7520. if(this.dateAr.length > 0) {
  7521. const trus = this.fns();
  7522. const overlapDataTime = this.getOverlapData(alp);
  7523. if (overlapDataTime.length > 0) {
  7524. const arrList = overlapDataTime.map((item) => item.p);
  7525. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7526. }
  7527. ll += 1
  7528. if(!trus) {
  7529. this.$message({
  7530. message: str,
  7531. type: 'error'
  7532. })
  7533. return false
  7534. }
  7535. }
  7536. } else {
  7537. if(this.dateAr.length > 0) {
  7538. ll +=1 ;
  7539. }
  7540. }
  7541. }
  7542. if(ll == 0) {
  7543. this.$message({
  7544. message: this.$t('message.Pleasefillinthetime'),
  7545. type: 'error'
  7546. })
  7547. return false
  7548. }
  7549. } else if(this.reportTimeType.type == 1){
  7550. for(var i in zhi) {
  7551. var zhis = zhi[i]
  7552. for(var j in zhis) {
  7553. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7554. ll += 1
  7555. }
  7556. }
  7557. }
  7558. if(ll == 0) {
  7559. this.$message({
  7560. message: this.$t('message.Pleaseselectatime'),
  7561. type: 'error'
  7562. })
  7563. return false
  7564. }
  7565. let overcorp = ''
  7566. for(let n in zhi){
  7567. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7568. overcorp += zhi[n].zhoDataTime + ','
  7569. }
  7570. }
  7571. if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
  7572. overcorp = overcorp.substring(0,overcorp.length - 1)
  7573. this.$message({
  7574. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7575. type: 'error'
  7576. })
  7577. return
  7578. }
  7579. }
  7580. var submits = []
  7581. let formData = new FormData();
  7582. formData.append("draft", isDraft);
  7583. if(this.reportTimeType.multiWorktime == 1){
  7584. for (var i in this.zhoData) {
  7585. var zhoD = this.zhoData[i]
  7586. var flgs = false
  7587. for(var j in zhoD) {
  7588. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7589. flgs = true
  7590. // formData.append("degreeId", "-1");
  7591. formData.append("id", '-1');
  7592. if (this.isSubstitude) {
  7593. formData.append('targetUids',this.workForm.userId[0]);
  7594. }
  7595. for(var s in this.selProjectList) {
  7596. if(j == this.selProjectList[s].projectName) {
  7597. formData.append("projectId", this.selProjectList[s].id);
  7598. break;
  7599. }
  7600. }
  7601. if(this.user.timeType.reportAuditType == 3){
  7602. let audItem = {}
  7603. if(this.user.timeType.auditLevel > 0){
  7604. audItem.auditorFirst = zhoD[j].auditorFirst
  7605. }
  7606. if(this.user.timeType.auditLevel > 1){
  7607. audItem.auditorSec = zhoD[j].auditorSec
  7608. }
  7609. if(this.user.timeType.auditLevel > 2){
  7610. audItem.auditorThird = zhoD[j].auditorThird
  7611. }
  7612. if(zhoD[j].ccUserid){
  7613. audItem.ccUserid = zhoD[j].ccUserid
  7614. }
  7615. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7616. }
  7617. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7618. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7619. formData.append("reportTimeType", this.reportTimeType.type);
  7620. formData.append("endTime", '');
  7621. formData.append("startTime", '');
  7622. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7623. var lix = []
  7624. var objjs = {}
  7625. objjs.startTime = zhoD[j].time[0]
  7626. objjs.endTime = zhoD[j].time[1]
  7627. if (zhoD[j].content == null || zhoD[j].content == '') {
  7628. zhoD[j].content == '-'
  7629. }
  7630. objjs.content = zhoD[j].content
  7631. lix.push(objjs)
  7632. var zhiZhi = JSON.stringify(lix)
  7633. zhiZhi = zhiZhi.replace(/,/g,"@");
  7634. formData.append("content", zhiZhi)
  7635. formData.append("isOvertime", 0)
  7636. formData.append("professionProgress", "[]")
  7637. if (zhoD[j].groupId) {
  7638. formData.append("groupId",zhoD[j].groupId)
  7639. } else {
  7640. //解决后台groupId数组越界的问题
  7641. formData.append("groupId",0)
  7642. }
  7643. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7644. formData.append("createDate",zhoD.zhoDataTime)
  7645. if (zhoD[j].projectAuditorId) {
  7646. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7647. }
  7648. if(zhoD[j].basecostId) {
  7649. formData.append("basecostId", zhoD[j].basecostId);
  7650. } else {
  7651. formData.append("basecostId", 0);
  7652. }
  7653. if(this.user.timeType.customDegreeActive){
  7654. if (this.user.timeType.customDegreeMultiple) {
  7655. if (zhoD[j].multiDegrIdArray) {
  7656. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7657. } else {
  7658. formData.append('multiDegrId','[]')
  7659. }
  7660. } else {
  7661. if (zhoD[j].degreeId) {
  7662. formData.append('degreeId',zhoD[j].degreeId)
  7663. } else {
  7664. formData.append('degreeId','-1')
  7665. }
  7666. }
  7667. }else{
  7668. formData.append("degreeId", "-1");
  7669. }
  7670. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7671. formData.append('customData',zhoD[j].customData)
  7672. }else if(this.user.timeType.customDataActive){
  7673. formData.append('customData',0)
  7674. }
  7675. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7676. formData.append('customText',zhoD[j].customText)
  7677. }else if(this.user.timeType.customTextActive){
  7678. formData.append('customText','-')
  7679. }
  7680. if(reportExtraField4Name || reportExtraField5Name) {
  7681. formData.append('extraField4', zhoD[j].extraField4 || '')
  7682. formData.append('extraField5', zhoD[j].extraField5 || '')
  7683. }
  7684. }
  7685. }
  7686. }
  7687. } else {
  7688. for (var i in this.zhoData) {
  7689. var zhoD = this.zhoData[i]
  7690. var flgs = false
  7691. if(this.reportTimeType.type == 2) {
  7692. for(var k in this.selProjectList) {
  7693. var pItem = this.selProjectList[k];
  7694. var pName = pItem.projectName;
  7695. var j = pName;
  7696. var pid = pItem.id;
  7697. console.log('j==周报中的项目='+j);
  7698. if(zhoD[j].time && zhoD[j].time != 'null') {
  7699. flgs = true
  7700. // formData.append("degreeId", "-1");
  7701. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7702. if (this.isSubstitude) {
  7703. formData.append('targetUids',this.workForm.userId[0]);
  7704. }
  7705. formData.append("projectId", pid);
  7706. if(this.user.timeType.reportAuditType == 3){
  7707. let audItem = {}
  7708. if(this.user.timeType.auditLevel > 0){
  7709. audItem.auditorFirst = zhoD[j].auditorFirst
  7710. }
  7711. if(this.user.timeType.auditLevel > 1){
  7712. audItem.auditorSec = zhoD[j].auditorSec
  7713. }
  7714. if(this.user.timeType.auditLevel > 2){
  7715. audItem.auditorThird = zhoD[j].auditorThird
  7716. }
  7717. if(zhoD[j].ccUserid){
  7718. audItem.ccUserid = zhoD[j].ccUserid
  7719. }
  7720. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7721. }
  7722. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7723. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7724. formData.append("reportTimeType", this.reportTimeType.type);
  7725. formData.append("endTime", zhoD[j].time[1]);
  7726. formData.append("startTime", zhoD[j].time[0]);
  7727. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7728. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7729. formData.append("isOvertime", 0)
  7730. formData.append("professionProgress", "[]")
  7731. if (zhoD[j].groupId) {
  7732. formData.append("groupId",zhoD[j].groupId)
  7733. } else {
  7734. //解决后台groupId数组越界的问题
  7735. formData.append("groupId",0)
  7736. }
  7737. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7738. formData.append("createDate",zhoD.zhoDataTime)
  7739. if (zhoD[j].projectAuditorId) {
  7740. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7741. } else {
  7742. //对齐数据
  7743. formData.append("projectAuditorId",'-');
  7744. }
  7745. if(zhoD[j].basecostId) {
  7746. formData.append("basecostId", zhoD[j].basecostId);
  7747. } else {
  7748. formData.append("basecostId", 0);
  7749. }
  7750. if(this.user.timeType.customDegreeActive){
  7751. if (this.user.timeType.customDegreeMultiple) {
  7752. if (zhoD[j].multiDegrIdArray) {
  7753. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7754. } else {
  7755. formData.append("multiDegrId", "[]");
  7756. }
  7757. } else {
  7758. if (zhoD[j].degreeId) {
  7759. formData.append('degreeId',zhoD[j].degreeId)
  7760. } else {
  7761. formData.append("degreeId", "-1");
  7762. }
  7763. }
  7764. }else{
  7765. formData.append("degreeId", "-1");
  7766. }
  7767. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7768. formData.append('customData',zhoD[j].customData)
  7769. }else if(this.user.timeType.customDataActive){
  7770. formData.append('customData',0)
  7771. }
  7772. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7773. formData.append('customText',zhoD[j].customText)
  7774. }else if(this.user.timeType.customTextActive){
  7775. formData.append('customText','-')
  7776. }
  7777. if(reportExtraField4Name || reportExtraField5Name) {
  7778. formData.append('extraField4', zhoD[j].extraField4 || '')
  7779. formData.append('extraField5', zhoD[j].extraField5 || '')
  7780. }
  7781. }
  7782. }
  7783. } else {
  7784. for(var k in this.selProjectList) {
  7785. var pItem = this.selProjectList[k];
  7786. var pName = pItem.projectName;
  7787. var j = pName;
  7788. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7789. flgs = true
  7790. // formData.append("degreeId", "-1");
  7791. console.log('进入了workFpppp==='+j);
  7792. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7793. if (this.isSubstitude) {
  7794. formData.append('targetUids',this.workForm.userId[0]);
  7795. }
  7796. formData.append("projectId", pItem.id);
  7797. if(this.user.timeType.reportAuditType == 3){
  7798. let audItem = {}
  7799. if(this.user.timeType.auditLevel > 0){
  7800. audItem.auditorFirst = zhoD[j].auditorFirst
  7801. }
  7802. if(this.user.timeType.auditLevel > 1){
  7803. audItem.auditorSec = zhoD[j].auditorSec
  7804. }
  7805. if(this.user.timeType.auditLevel > 2){
  7806. audItem.auditorThird = zhoD[j].auditorThird
  7807. }
  7808. if(zhoD[j].ccUserid){
  7809. audItem.ccUserid = zhoD[j].ccUserid
  7810. }
  7811. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7812. }
  7813. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7814. // formData.append("subProjectId", zhoD[j].subProjectId);
  7815. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7816. formData.append("reportTimeType", this.reportTimeType.type);
  7817. if(this.reportTimeType.type == 1) {
  7818. formData.append("workingTime", zhoD[j].workingTime);
  7819. } else if(this.reportTimeType.type == 2) {
  7820. formData.append("endTime", zhoD[j].time[1]);
  7821. formData.append("startTime", zhoD[j].time[0]);
  7822. } else if(this.reportTimeType.type == 3) {
  7823. formData.append("progress", zhoD[j].progress);
  7824. formData.append("workingTime", zhoD[j].workingTime);
  7825. }
  7826. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7827. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7828. formData.append("isOvertime", 0)
  7829. formData.append("professionProgress", "[]")
  7830. if (zhoD[j].groupId) {
  7831. formData.append("groupId",zhoD[j].groupId)
  7832. } else {
  7833. //解决后台groupId数组越界的问题
  7834. formData.append("groupId",0)
  7835. }
  7836. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7837. formData.append("createDate",zhoD.zhoDataTime)
  7838. if (zhoD[j].projectAuditorId) {
  7839. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7840. } else {
  7841. //对齐数据
  7842. formData.append("projectAuditorId",'-')
  7843. }
  7844. if(zhoD[j].basecostId) {
  7845. formData.append("basecostId", zhoD[j].basecostId);
  7846. } else {
  7847. formData.append("basecostId", 0);
  7848. }
  7849. if(this.user.timeType.customDegreeActive){
  7850. if (this.user.timeType.customDegreeMultiple) {
  7851. if (zhoD[j].multiDegrIdArray) {
  7852. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7853. } else {
  7854. formData.append("multiDegrId", "[]");
  7855. }
  7856. } else {
  7857. if (zhoD[j].degreeId) {
  7858. formData.append('degreeId',zhoD[j].degreeId)
  7859. } else {
  7860. formData.append("degreeId", "-1");
  7861. }
  7862. }
  7863. }else{
  7864. formData.append("degreeId", "-1");
  7865. }
  7866. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7867. formData.append('customData',zhoD[j].customData)
  7868. }else if(this.user.timeType.customDataActive){
  7869. formData.append('customData',0)
  7870. }
  7871. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7872. formData.append('customText',zhoD[j].customText)
  7873. }else if(this.user.timeType.customTextActive){
  7874. formData.append('customText','-')
  7875. }
  7876. if(reportExtraField4Name || reportExtraField5Name) {
  7877. formData.append('extraField4', zhoD[j].extraField4 || '')
  7878. formData.append('extraField5', zhoD[j].extraField5 || '')
  7879. }
  7880. }
  7881. }
  7882. }
  7883. }
  7884. }
  7885. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7886. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7887. if(!next) {
  7888. this.$message({
  7889. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7890. type: 'error'
  7891. })
  7892. return
  7893. }
  7894. // 自定义维度
  7895. this.submitingReport = true;
  7896. this.http.uploadFile( this.port.report.editPort, formData,
  7897. res => {
  7898. // this.listLoading = false;
  7899. this.submitingReport = false;
  7900. if (res.code == "ok") {
  7901. this.$message({
  7902. message: this.$t('message.fillinsuccessfully'),
  7903. type: "success"
  7904. });
  7905. this.fillWeekDialogVisi = false
  7906. this.selConShow = true
  7907. this.zhoData = []
  7908. this.weekDateRange = ''
  7909. this.getReportList();
  7910. this.getDepartment();
  7911. // 关闭弹窗 并 清空
  7912. this.selProjectList = []
  7913. this.selCon = []
  7914. this.getRecentlyProject()
  7915. } else {
  7916. this.$message({
  7917. message: res.msg,
  7918. type: "error"
  7919. });
  7920. }
  7921. },
  7922. error => {
  7923. this.submitingReport = false;
  7924. this.$message({
  7925. message: error,
  7926. type: "error"
  7927. });
  7928. });
  7929. },
  7930. handleGroupAuditorData(data) {
  7931. const { reportAuditType } = this.user.timeType
  7932. if(reportAuditType != 1 && reportAuditType != 2) {
  7933. return {next: true}
  7934. }
  7935. let arrList = [];
  7936. Object.entries(data).forEach(([key, obj]) => {
  7937. Object.entries(obj).forEach(([projectName, projectData]) => {
  7938. if (projectData.workingTime && !projectData.groupId) {
  7939. arrList.push({
  7940. projectName,
  7941. date: obj.zhoDataTime,
  7942. dateText: obj.zhoDataTimeTxt
  7943. });
  7944. }
  7945. });
  7946. });
  7947. if(arrList.length > 0) {
  7948. return {
  7949. next: false,
  7950. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7951. }
  7952. } else {
  7953. return {
  7954. next: true,
  7955. error: [],
  7956. }
  7957. }
  7958. },
  7959. ChangeHourMinutestr (str) {
  7960. if (str !== "0" && str !== "" && str !== null) {
  7961. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7962. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7963. } else {
  7964. return "";
  7965. }
  7966. },
  7967. // 得到两个日期中间的日期
  7968. getdiffdate(stime,etime){
  7969. //初始化日期列表,数组
  7970. var diffdate = new Array();
  7971. var i=0;
  7972. //开始日期小于等于结束日期,并循环
  7973. while(stime<=etime){
  7974. diffdate[i] = stime;
  7975. //获取开始日期时间戳
  7976. var stime_ts = new Date(stime).getTime();
  7977. //增加一天时间戳后的日期
  7978. var next_date = stime_ts + (24*60*60*1000);
  7979. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7980. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7981. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7982. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7983. stime = next_dates_y+next_dates_m+next_dates_d;
  7984. //增加数组key
  7985. i++;
  7986. }
  7987. return diffdate;
  7988. },
  7989. // 添加模块
  7990. addDomain(i) {
  7991. var leftProgress = 10;
  7992. if (this.reportTimeType.type == 3) {
  7993. //计算已经待分配工时比例
  7994. let array = this.workForm.domains;
  7995. let totalProgress = 0;
  7996. for (var i=0;i<array.length; i++) {
  7997. totalProgress += array[i].progress;
  7998. }
  7999. if (totalProgress < 100) {
  8000. leftProgress = 100 - totalProgress;
  8001. }
  8002. }
  8003. var addItem = {
  8004. projectId: "",
  8005. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(2):(
  8006. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(2)
  8007. ),
  8008. content: "",
  8009. progress:leftProgress,
  8010. state:2,//2-表示待提交
  8011. multiWorktime: this.reportTimeType.multiWorktime,
  8012. worktimeList:[{}],
  8013. canEdit: true,
  8014. auditorFirst: '',
  8015. auditorSec: '',
  8016. auditorThird: '',
  8017. ccUserid: ''
  8018. // degreeId: '',
  8019. };
  8020. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  8021. this.$set(addItem,'isOvertime',true)
  8022. if(this.reportTimeType.type == 3){
  8023. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  8024. }
  8025. }
  8026. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  8027. //默认给第一个,必填字段
  8028. addItem.basecostId = this.timeBasecostList[0].id;
  8029. }
  8030. this.workForm.domains.push(addItem);
  8031. document.getElementById('workFormsItemBottom').scrollIntoView()
  8032. this.canEdit = true
  8033. if (this.reportTimeType.type == 0) {
  8034. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  8035. var length = this.workForm.domains.length;
  8036. if (length == 2) {
  8037. this.showAddMore = false;
  8038. }
  8039. }
  8040. this.chuji()
  8041. this.seleChn()
  8042. },
  8043. // 移除模块
  8044. delDomain(i) {
  8045. this.workForm.domains.splice(i,1)
  8046. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  8047. if (!this.originCanEdit) {
  8048. let iscan = false
  8049. for(let i in this.workForm.domains){
  8050. if(this.workForm.domains[i].canEdit){
  8051. iscan = true
  8052. }
  8053. }
  8054. this.canEdit = iscan
  8055. }
  8056. //检测当前剩下的一个,时间类型是否是全天
  8057. if (this.reportTimeType.type == 0) {
  8058. if (this.workForm.domains[0].timeType == 0) {
  8059. this.showAddMore = false;
  8060. } else {
  8061. this.showAddMore = true;
  8062. }
  8063. }
  8064. if(this.user.timeType.multiWorktime == 1) {
  8065. this.iptChangs()
  8066. } else {
  8067. this.seleChn(0)
  8068. }
  8069. },
  8070. // 改变月份
  8071. changeMonth() {
  8072. this.isWeekend = false
  8073. let date = new Date()
  8074. let nowmon = date.getMonth() + 1
  8075. let nowday = date.getDate()
  8076. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  8077. if (this.isBatch == 0) {
  8078. if(this.user.timeType.fillAhead == 0){
  8079. let date_a = new Date(this.workForm.createDate)
  8080. if(date_a.getTime() > date.getTime()){
  8081. this.workForm.createDate = nowdate
  8082. }
  8083. }
  8084. //只有按天填报才能获取当天的日报
  8085. if(!this.isSubstitude){
  8086. let weekday = new Date(this.workForm.createDate).getDay()
  8087. if(this.user.companyId == 817){
  8088. if(weekday == 0){
  8089. this.isWeekend = true
  8090. }
  8091. }else{
  8092. if(weekday == 0 || weekday == 6){
  8093. this.isWeekend = true
  8094. }
  8095. }
  8096. this.getReport()
  8097. } else {
  8098. //获取代填人员的考勤
  8099. if (this.user.timeType.showCorpwxCardtime == 1 || this.user.timeType.showDdCardtime == 1 ) {
  8100. this.getTargetUserCardTime();
  8101. }
  8102. }
  8103. }else {
  8104. if(this.user.timeType.fillAhead == 0){
  8105. let date_a = new Date(this.workForm.createDate[1])
  8106. if(date_a.getTime() > date.getTime()){
  8107. this.workForm.createDate[1] = nowdate
  8108. let sdate = new Date(this.workForm.createDate[0])
  8109. let edate = new Date(this.workForm.createDate[1])
  8110. if(sdate > edate){
  8111. this.workForm.createDate[0] = this.workForm.createDate[1]
  8112. }
  8113. }
  8114. }
  8115. }
  8116. },
  8117. // 判断时间段
  8118. fns() {
  8119. for (let k in this.dateAr) {
  8120. if (!this.judege(k)) {
  8121. return false
  8122. }
  8123. }
  8124. return true
  8125. },
  8126. judege(idx){
  8127. for (let k in this.dateAr) {
  8128. if (idx !== k) {
  8129. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  8130. return false
  8131. }
  8132. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  8133. return false
  8134. }
  8135. }
  8136. }
  8137. return true
  8138. },
  8139. getOverlapData(data) {
  8140. let overlapData = [];
  8141. for (let i = 0; i < data.length; i++) {
  8142. for (let j = i + 1; j < data.length; j++) {
  8143. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  8144. overlapData.push(data[i], data[j]);
  8145. }
  8146. }
  8147. }
  8148. return overlapData;
  8149. },
  8150. // 保存日报111111
  8151. submitReport(isDraft) {
  8152. this.isDraft = isDraft;
  8153. this.$refs.workForm.validate(valid => {
  8154. if (valid) {
  8155. if (!isDraft) {
  8156. //针对苏州景昱,单独的检查逻辑
  8157. if (this.user.companyId == 5978) {
  8158. //调接口,先检查工时是否存在异常
  8159. var totalTime = 0;
  8160. for (var t=0;t<this.workForm.domains.length; t++) {
  8161. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8162. }
  8163. var array = [];
  8164. if (this.isBatch) {
  8165. var startDate = new Date(this.workForm.createDate[0]);
  8166. var endDate = new Date(this.workForm.createDate[1]);
  8167. if (startDate > endDate) {
  8168. this.$message({
  8169. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  8170. type: "error"
  8171. });
  8172. return
  8173. } else {
  8174. while(true){
  8175. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  8176. array.push(workData);
  8177. startDate.setDate(startDate.getDate() + 1);
  8178. if (startDate > endDate) {
  8179. break;
  8180. }
  8181. }
  8182. }
  8183. } else {
  8184. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  8185. array.push(workData)
  8186. }
  8187. this.submitingReport = true;
  8188. var passUserId = this.user.id;
  8189. if (this.isSubstitude) {
  8190. passUserId = this.targetUids;
  8191. }
  8192. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  8193. res => {
  8194. this.submitingReport = false;
  8195. if (res.code == "ok") {
  8196. this.submitReportSon()
  8197. } else {
  8198. this.$confirm(res.msg, this.$t('other.prompts'), {
  8199. confirmButtonText: this.$t('huLveBingTiJiao'),
  8200. cancelButtonText: this.$t('btn.cancel'),
  8201. type: 'error'
  8202. }).then(() => {
  8203. this.submitReportSon()
  8204. }).catch(() => {
  8205. });
  8206. }
  8207. },
  8208. error => {
  8209. this.$message({
  8210. message: error,
  8211. type: "error"
  8212. });
  8213. });
  8214. } else if (this.user.companyId == 469) {
  8215. //试点,针对赛元微电子校验考勤工时
  8216. if (this.workForm.time && this.workForm.time.workHours) {
  8217. if (this.totalReportHours > this.workForm.time.workHours) {
  8218. this.$message({
  8219. message: '填报工时不得超过考勤时长',
  8220. type: "error"
  8221. });
  8222. } else if (this.totalReportHours < this.workForm.time.workHours) {
  8223. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  8224. confirmButtonText: this.$t('btn.determine'),
  8225. cancelButtonText: this.$t('btn.cancel'),
  8226. type: 'warning'
  8227. }).then(() => {
  8228. this.submitReportSon()
  8229. }).catch(() => {
  8230. });
  8231. } else {
  8232. this.submitReportSon();
  8233. }
  8234. } else {
  8235. this.$message({
  8236. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  8237. type: "error"
  8238. });
  8239. }
  8240. } else {
  8241. if(this.totalReportHours < this.user.timeType.allday){
  8242. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  8243. confirmButtonText: this.$t('btn.determine'),
  8244. cancelButtonText: this.$t('btn.cancel'),
  8245. type: 'warning'
  8246. }).then(() => {
  8247. this.submitReportSon()
  8248. }).catch(() => {
  8249. });
  8250. }else{
  8251. this.submitReportSon()
  8252. }
  8253. }
  8254. } else {
  8255. //暂存,不需要检查工时是否超过考勤
  8256. this.submitReportSon()
  8257. }
  8258. }
  8259. });
  8260. },
  8261. submitReportSon() {
  8262. this.dateAr = []
  8263. //检查重叠
  8264. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8265. let alp = []
  8266. if(this.user.timeType.multiWorktime != 1) {
  8267. for(var p in this.workForm.domains) {
  8268. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8269. let objs = {}
  8270. objs.s = this.workForm.domains[p].startTime
  8271. objs.e = this.workForm.domains[p].endTime
  8272. alp.push(objs)
  8273. }
  8274. }
  8275. this.dateAr = alp
  8276. if(this.dateAr.length > 0) {
  8277. let trus = this.fns()
  8278. if(!trus) {
  8279. this.$message({
  8280. message: this.$t('message.Filledtimeperiodsoverlap'),
  8281. type: "error"
  8282. });
  8283. return
  8284. }
  8285. }
  8286. } else {
  8287. for(var p in this.workForm.domains) {
  8288. var slll = this.workForm.domains[p]
  8289. for(var o in slll.worktimeList) {
  8290. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8291. let objs = {}
  8292. objs.s = slll.worktimeList[o].startTime
  8293. objs.e = slll.worktimeList[o].endTime
  8294. alp.push(objs)
  8295. }
  8296. }
  8297. }
  8298. this.dateAr = alp
  8299. if(this.dateAr.length > 0) {
  8300. let trus = this.fns()
  8301. if(!trus) {
  8302. this.$message({
  8303. message: this.$t('message.Filledtimeperiodsoverlap'),
  8304. type: "error"
  8305. });
  8306. return
  8307. }
  8308. }
  8309. }
  8310. }
  8311. //检查子项目
  8312. if (this.user.timeType.subProMustFill == 1) {
  8313. for(var p in this.workForm.domains) {
  8314. var oneProItem = this.workForm.domains[p]
  8315. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8316. //没有选择子项目
  8317. this.$message({
  8318. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8319. type: "error"
  8320. });
  8321. return
  8322. }
  8323. }
  8324. }
  8325. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8326. if (this.user.companyId == this.yuzhongCompId) {
  8327. for(var p in this.workForm.domains) {
  8328. var oneProItem = this.workForm.domains[p]
  8329. if (!oneProItem.extraField1) {
  8330. this.$message({
  8331. message: this.$t('jiaoSeBiTianQingJianCha'),
  8332. type: "error"
  8333. });
  8334. return
  8335. }
  8336. if (!oneProItem.extraField2) {
  8337. this.$message({
  8338. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8339. type: "error"
  8340. });
  8341. return
  8342. }
  8343. if (!oneProItem.extraField3) {
  8344. this.$message({
  8345. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8346. type: "error"
  8347. });
  8348. return
  8349. }
  8350. }
  8351. }
  8352. // return
  8353. //代填的情况,检查人员是否已经选择
  8354. if (this.isSubstitude) {
  8355. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8356. this.$message({
  8357. message: this.$t('message.pleaseselectthepersontofillin'),
  8358. type: "error"
  8359. });
  8360. return;
  8361. }
  8362. }
  8363. //检查时间,全天和上下午不能同时存在
  8364. if (this.reportTimeType.type == 0) {
  8365. var alldayNum = 0;
  8366. var amNum = 0;
  8367. var pmNum = 0;
  8368. for(var i in this.workForm.domains) {
  8369. if (this.workForm.domains[i].timeType == 0) {
  8370. alldayNum ++;
  8371. } else if (this.workForm.domains[i].timeType == 1) {
  8372. amNum++;
  8373. } else if (this.workForm.domains[i].timeType == 2) {
  8374. pmNum++;
  8375. }
  8376. }
  8377. if (alldayNum > 1) {
  8378. this.$message({
  8379. // message: "工作时间-全天,只能选择一次",
  8380. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8381. type: "error"
  8382. });
  8383. return;
  8384. }
  8385. if (amNum > 1) {
  8386. this.$message({
  8387. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8388. type: "error"
  8389. });
  8390. return;
  8391. }
  8392. if (pmNum > 1) {
  8393. this.$message({
  8394. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8395. type: "error"
  8396. });
  8397. return;
  8398. }
  8399. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8400. this.$message({
  8401. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8402. type: "error"
  8403. });
  8404. return;
  8405. }
  8406. } else if (this.reportTimeType.type == 3) {
  8407. //总百分比不能超过100%
  8408. let total = 0;
  8409. this.workForm.domains.forEach(w=>{total += w.progress});
  8410. if (total > 100) {
  8411. this.$message({
  8412. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8413. type: "error"
  8414. });
  8415. return;
  8416. } else if (total < 100) {
  8417. this.$message({
  8418. message: this.$t('message.cannotbesubmitted'),
  8419. type: "error"
  8420. });
  8421. return;
  8422. }
  8423. }
  8424. this.listLoading = true;
  8425. let formData = new FormData();
  8426. formData.append("draft", this.isDraft);
  8427. var totalTime = 0;
  8428. for (var t=0;t<this.workForm.domains.length; t++) {
  8429. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8430. }
  8431. //批量填报不校验考勤时长,交给后台校验
  8432. if (!this.isBatch) {
  8433. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0 && !(this.isSubstitude && this.user.timeType.notCheckCardtime)){
  8434. if (this.workForm.time){
  8435. if (this.workForm.time.workHours == 0){
  8436. this.$message({
  8437. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8438. type: 'error'
  8439. })
  8440. return
  8441. }
  8442. }else{
  8443. this.$message({
  8444. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8445. type: 'error'
  8446. })
  8447. return
  8448. }
  8449. }
  8450. }
  8451. //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
  8452. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
  8453. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8454. this.$message({
  8455. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8456. type: "error"
  8457. });
  8458. return;
  8459. }
  8460. }
  8461. for(var i in this.workForm.domains) {
  8462. // 检查任务/里程碑是否为必填
  8463. let taskRequired = this.user.timeType.taskRequired
  8464. if(taskRequired == 1) {
  8465. if(!this.workForm.domains[i].taskId) {
  8466. this.$message({
  8467. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8468. type: "error"
  8469. });
  8470. return
  8471. }
  8472. }
  8473. if(this.user.timeType.reportAuditType == 3){
  8474. let audItem = {}
  8475. let auditRule = ''
  8476. if(this.workForm.domains[i].id){
  8477. audItem.reportId = this.workForm.domains[i].id
  8478. }
  8479. if(this.user.timeType.auditLevel > 0){
  8480. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8481. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8482. }
  8483. if(this.user.timeType.auditLevel > 1){
  8484. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8485. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8486. }
  8487. if(this.user.timeType.auditLevel > 2){
  8488. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8489. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8490. }
  8491. if(this.workForm.domains[i].ccUserid){
  8492. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8493. }
  8494. if(auditRule){
  8495. auditRule = auditRule.substring(0,auditRule.length - 1)
  8496. this.$message({
  8497. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8498. type: 'error'
  8499. })
  8500. return
  8501. }
  8502. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8503. }
  8504. if (this.user.timeType.customDegreeActive) {
  8505. if (this.user.timeType.customDegreeMultiple) {
  8506. //多选
  8507. if (this.workForm.domains[i].multiDegrIdArray) {
  8508. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8509. degreeArray = degreeArray.replace(/,/g,"@");
  8510. formData.append("multiDegrId", degreeArray);
  8511. } else {
  8512. formData.append("multiDegrId", '[]');
  8513. }
  8514. } else {
  8515. //单选
  8516. if (this.workForm.domains[i].degreeId) {
  8517. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8518. } else {
  8519. formData.append("degreeId", -1);
  8520. }
  8521. }
  8522. } else {
  8523. formData.append("degreeId", -1);
  8524. }
  8525. if(this.workForm.domains[i].customData) {
  8526. // var sss = this.workForm.domains[i].degreeId.toString()
  8527. formData.append("customData", this.workForm.domains[i].customData);
  8528. } else {
  8529. formData.append("customData", 0);
  8530. }
  8531. if(this.workForm.domains[i].customText) {
  8532. formData.append("customText", this.workForm.domains[i].customText);
  8533. } else {
  8534. formData.append("customText", '-');
  8535. }
  8536. if (this.workForm.domains[i].id) {
  8537. formData.append("id", this.workForm.domains[i].id);
  8538. } else {
  8539. formData.append("id", -1);
  8540. }
  8541. formData.append("projectId", this.workForm.domains[i].projectId);
  8542. if (this.workForm.domains[i].subProjectId) {
  8543. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8544. } else {
  8545. formData.append("subProjectId", 0);
  8546. }
  8547. if (this.workForm.domains[i].groupId) {
  8548. formData.append("groupId", this.workForm.domains[i].groupId);
  8549. } else {
  8550. formData.append("groupId", 0);
  8551. }
  8552. if (this.workForm.domains[i].taskId) {
  8553. formData.append("taskId", this.workForm.domains[i].taskId);
  8554. } else {
  8555. formData.append("taskId", 0);
  8556. }
  8557. if (this.workForm.domains[i].taskFinish == true) {
  8558. formData.append("taskFinish", 1);
  8559. } else {
  8560. formData.append("taskFinish", 0);
  8561. }
  8562. formData.append("reportTimeType", this.reportTimeType.type);
  8563. if (this.reportTimeType.type == 0) {
  8564. formData.append("timeType", this.workForm.domains[i].timeType);
  8565. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8566. formData.append("workingTime", workingTime);
  8567. } else if (this.reportTimeType.type == 1){
  8568. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8569. } else if (this.reportTimeType.type == 2) {
  8570. formData.append("endTime", this.workForm.domains[i].endTime);
  8571. formData.append("startTime", this.workForm.domains[i].startTime);
  8572. } else if (this.reportTimeType.type == 3) {
  8573. //按比例分配
  8574. formData.append("progress", this.workForm.domains[i].progress);
  8575. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8576. }
  8577. if(this.user.timeType.choseFromAlbum == 1 ) {
  8578. console.log(this.workForm.domains[i].imgList)
  8579. if(this.workForm.domains[i].imgList) {
  8580. let imgListFor = this.workForm.domains[i].imgList
  8581. for(var b in imgListFor) {
  8582. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8583. }
  8584. console.log(imgListFor)
  8585. let m = JSON.stringify(imgListFor);
  8586. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8587. formData.append("picStr", m);
  8588. } else {
  8589. formData.append("picStr", '[]');
  8590. }
  8591. }
  8592. //处理多个时间事项
  8593. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8594. if (this.reportTimeType.multiWorktime == 1) {
  8595. //检查时间是否有重叠
  8596. var workList = this.workForm.domains[i].worktimeList;
  8597. for (var j=0;j<workList.length; j++) {
  8598. var curItem = workList[j];
  8599. //检查开始时间是否大于结束时间
  8600. if (curItem.startTime >= curItem.endTime) {
  8601. this.$message({
  8602. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8603. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8604. type: "error"
  8605. });
  8606. return;
  8607. }
  8608. //时间不可重叠
  8609. if (this.reportTimeType.timeCanOverlap == 0) {
  8610. for (var p = j+1;p<workList.length; p++) {
  8611. var jItem = workList[p];
  8612. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8613. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8614. this.$message({
  8615. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8616. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8617. type: "error"
  8618. });
  8619. return;
  8620. }
  8621. }
  8622. }
  8623. }
  8624. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8625. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8626. formData.append("content", m);
  8627. } else {
  8628. if (this.workForm.domains[i].content) {
  8629. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8630. m = m.replace(/,/g,",");
  8631. console.log(m, '需要传值的数据')
  8632. // formData.append("content", this.workForm.domains[i].content);
  8633. formData.append("content", m);
  8634. } else {
  8635. formData.append("content", '-');
  8636. }
  8637. }
  8638. if (this.isBatch == 0) {
  8639. formData.append("createDate", this.workForm.createDate);
  8640. } else {
  8641. //批量填报,时间范围
  8642. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8643. }
  8644. if(this.workForm.domains[i].isOvertime) {
  8645. formData.append("isOvertime", 1);
  8646. } else {
  8647. formData.append("isOvertime", 0);
  8648. }
  8649. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8650. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8651. } else {
  8652. formData.append("overtimeHours", 0);
  8653. }
  8654. if(this.workForm.domains[i].basecostId) {
  8655. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8656. } else {
  8657. formData.append("basecostId", 0);
  8658. }
  8659. if (this.workForm.userId != null) {
  8660. var targetUids = '';
  8661. this.workForm.userId.forEach(u=>{
  8662. targetUids += u + '@';
  8663. });
  8664. if (targetUids.length > 0) {
  8665. targetUids = targetUids.substring(0, targetUids.length -1);
  8666. formData.append("targetUids", targetUids);
  8667. }
  8668. }
  8669. //项目专业进度
  8670. if (this.workForm.domains[i].professionProgress) {
  8671. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8672. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8673. formData.append("professionProgress", m);
  8674. } else {
  8675. formData.append("professionProgress", "[]");
  8676. }
  8677. if (this.workForm.domains[i].stage) {
  8678. formData.append("stage", this.workForm.domains[i].stage);
  8679. } else {
  8680. formData.append("stage", "-");
  8681. }
  8682. if (this.workForm.domains[i].projectAuditorId) {
  8683. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8684. } else {
  8685. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8686. this.$message({
  8687. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8688. type: "error"
  8689. });
  8690. return;
  8691. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8692. //分组负责人先审核, 确定是选择了任务分组
  8693. if (this.workForm.domains[i].taskGroups.length == 0) {
  8694. this.$message({
  8695. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8696. type: "error"
  8697. });
  8698. return;
  8699. } else if (!this.workForm.domains[i].groupId) {
  8700. // console.log(this.workForm.domains[i]);
  8701. this.$message({
  8702. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8703. type: "error"
  8704. });
  8705. return;
  8706. }
  8707. }
  8708. }
  8709. if (this.user.companyId == this.yuzhongCompId) {
  8710. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8711. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8712. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8713. }
  8714. //依斯贝的服务Id
  8715. if (this.user.companyId == this.yisibeiCompId) {
  8716. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8717. }
  8718. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8719. this.$message({
  8720. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8721. type: "error"
  8722. });
  8723. return
  8724. }
  8725. if(this.user.timeType.userWithMultiDept == 1) {
  8726. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8727. }
  8728. if(this.user.timeType.reportExtraField4Name) {
  8729. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8730. }
  8731. if(this.user.timeType.reportExtraField5Name) {
  8732. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8733. }
  8734. if(this.user.companyId == 7536) {
  8735. const taskGroupsList = this.workForm.domains[i].taskGroups
  8736. const groupId = this.workForm.domains[i].groupId
  8737. const taskGroupRow = taskGroupsList.find(item => item.id == groupId)
  8738. const extraField4 = this.workForm.domains[i].extraField4
  8739. const extraField5 = this.workForm.domains[i].extraField5
  8740. const projectName = this.workForm.domains[i].projectName
  8741. if(taskGroupRow.name.indexOf('研发工时') != '-1' && (extraField4 || extraField5)) {
  8742. this.$message({
  8743. message: `【${projectName}】项目选择了研发工时,请勿填写工单号和行号`,
  8744. type: "error"
  8745. });
  8746. return
  8747. }
  8748. if(taskGroupRow.name.indexOf('出差工时') != '-1' && extraField4) {
  8749. this.$message({
  8750. message: `出差项目不能关联工单`,
  8751. type: "error"
  8752. });
  8753. return
  8754. }
  8755. if(taskGroupRow.name.indexOf('入库后工时') != '-1' && extraField4) {
  8756. this.$message({
  8757. message: `入库后工时不能关联工单`,
  8758. type: "error"
  8759. });
  8760. return
  8761. }
  8762. }
  8763. }
  8764. this.submitingReport = true;
  8765. this.http.uploadFile( this.port.report.editPort, formData,
  8766. res => {
  8767. this.listLoading = false;
  8768. this.submitingReport = false;
  8769. if (res.code == "ok") {
  8770. if(res.msg!=null){
  8771. this.$message({
  8772. dangerouslyUseHTMLString: true,
  8773. message: res.msg,
  8774. type: "warning",
  8775. showClose: true,
  8776. duration: 0
  8777. });
  8778. }else{
  8779. this.$message({
  8780. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8781. type: "success"
  8782. });
  8783. }
  8784. this.dialogVisible = false;
  8785. this.jsDay = 0
  8786. this.jsTime = 0
  8787. this.getReportList();
  8788. this.getDepartment();
  8789. this.getRecentlyProject()
  8790. } else {
  8791. this.$message({
  8792. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8793. type: "error"
  8794. });
  8795. }
  8796. },
  8797. error => {
  8798. this.listLoading = false;
  8799. this.submitingReport = false;
  8800. this.$message({
  8801. message: error,
  8802. type: "error"
  8803. });
  8804. });
  8805. },
  8806. // 判断是展示那个工时导入
  8807. imports() {
  8808. if(this.user.timeType.syncCorpwxTime == 0) {
  8809. this.importDialog = true
  8810. } else {
  8811. this.importWxDialog = true
  8812. }
  8813. },
  8814. // 跳转
  8815. junpToDeskTop(id) {
  8816. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8817. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8818. },
  8819. // 通过日报
  8820. approve(id, item) {
  8821. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8822. this.approveinData = {
  8823. id: id,
  8824. date: this.date +day,
  8825. reportIds: item.id
  8826. }
  8827. if(this.user.timeType.needEvaluate == 1){
  8828. this.$set(this.approveinData,'evaluate','')
  8829. this.approveinDialog = true
  8830. }else{
  8831. this.logining = true;
  8832. this.approveinfun()
  8833. }
  8834. },
  8835. approveinfun(){
  8836. this.http.post( this.port.report.approve, this.approveinData,
  8837. res => {
  8838. this.logining = false;
  8839. if (res.code == "ok") {
  8840. this.approveinDialog = false
  8841. this.$message({
  8842. message: this.$t('message.Reviewsucceeded'),
  8843. type: "success"
  8844. });
  8845. this.refreshReportData(this.approveinData.reportIds);
  8846. this.getDepartment();
  8847. } else {
  8848. this.$message({
  8849. message: res.msg,
  8850. type: "error"
  8851. });
  8852. }
  8853. },
  8854. error => {
  8855. this.logining = false;
  8856. this.$message({
  8857. message: error,
  8858. type: "error"
  8859. });
  8860. });
  8861. },
  8862. //撤回日报
  8863. cancel(item,e) {
  8864. // console.log('can can need',item);
  8865. this.logining = true;
  8866. var ids = '';
  8867. var data = e ? item : item.data;
  8868. data.forEach(element => {
  8869. if(element.id){
  8870. ids +=(element.id+',');
  8871. }
  8872. });
  8873. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8874. res => {
  8875. this.logining = false;
  8876. if (res.code == "ok") {
  8877. this.$message({
  8878. message:this.$t('message.Withdrawalsucceeded'),
  8879. type: "success"
  8880. });
  8881. this.getReportList();
  8882. if(e){this.getReport()}
  8883. this.getDepartment();
  8884. } else {
  8885. this.$message({
  8886. message: res.msg,
  8887. type: "error"
  8888. });
  8889. }
  8890. },
  8891. error => {
  8892. this.logining = false;
  8893. this.$message({
  8894. message: error,
  8895. type: "error"
  8896. });
  8897. });
  8898. },
  8899. showDenyDialog(id,i, item) {
  8900. this.denyReasonDialog = true;
  8901. this.isDenying = false;
  8902. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8903. var ids = item.id;
  8904. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8905. },
  8906. // 未通过日报
  8907. deny() {
  8908. this.logining = true;
  8909. this.isDenying = true;
  8910. this.http.post( this.port.report.deny, this.denyForm,
  8911. res => {
  8912. this.logining = false;
  8913. this.isDenying = false;
  8914. if (res.code == "ok") {
  8915. this.$message({
  8916. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8917. type: "success"
  8918. });
  8919. this.refreshReportData(this.denyForm.reportIds);
  8920. this.getDepartment();
  8921. this.denyReasonDialog = false;
  8922. } else {
  8923. this.$message({
  8924. message: res.msg,
  8925. type: "error"
  8926. });
  8927. }
  8928. },
  8929. error => {
  8930. this.logining = false;
  8931. this.$message({
  8932. message: error,
  8933. type: "error"
  8934. });
  8935. });
  8936. },
  8937. // 查看工时记录弹窗
  8938. toView() {
  8939. this.toViewDialogVisible = true
  8940. this.toViewloading = true
  8941. this.getToView()
  8942. },
  8943. getToView() {
  8944. this.http.post( '/report-import-log/getList', this.toViewForm,
  8945. res => {
  8946. this.toViewloading = false;
  8947. if (res.code == "ok") {
  8948. // console.log(res.data, '数据数据')
  8949. this.toViewList = res.data.records
  8950. this.toViewForm.total = res.data.total
  8951. } else {
  8952. this.toViewloading = false;
  8953. this.$message({
  8954. message: res.msg,
  8955. type: "error"
  8956. });
  8957. }
  8958. })
  8959. },
  8960. // 触发 selectCat 组件更改他的值
  8961. selectCatCli(obj) {
  8962. // console.log(obj, '看看')
  8963. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8964. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8965. },
  8966. vueCasader(obj) {
  8967. if(obj.distinction == 1 && obj.item) {
  8968. let arr = []
  8969. arr.push(obj.item.value)
  8970. this.exportParam.departmentId = arr
  8971. }
  8972. if(obj.distinction == '10' && obj) {
  8973. const { id, other } = obj
  8974. this.workForm.domains[other].reportTargetDeptId = id
  8975. }
  8976. if(obj.distinction == '14' && obj) {
  8977. let arr = []
  8978. arr.push(obj.id)
  8979. this.deptIdForHasReport = arr
  8980. this.showMonthWorkTime()
  8981. }
  8982. if(obj.distinction == '15' && obj) {
  8983. let arr = []
  8984. arr.push(obj.id)
  8985. this.deptIdForNoReport = arr
  8986. this.showMonthNotWorkTime()
  8987. }
  8988. if(obj.distinction == '16' && obj) {
  8989. let arr = []
  8990. arr.push(obj.id)
  8991. this.deptIdForReminder = arr
  8992. this.showMonthWorkTimeReminder()
  8993. }
  8994. if(obj.distinction == '17' && obj) {
  8995. let arr = []
  8996. arr.push(obj.id)
  8997. this.deptIdForHasReport = arr
  8998. this.showReportTimeLessThanCardTimeList();
  8999. }
  9000. },
  9001. //分页
  9002. handleCurrentChange(val) {
  9003. this.toViewForm.pageIndex = val;
  9004. this.getToView();
  9005. },
  9006. handleSizeChange(val) {
  9007. this.toViewForm.pageSize = val;
  9008. this.getToView();
  9009. },
  9010. getAllUsersList(){
  9011. this.http.post('/user/getSimpleActiveUserList',{
  9012. },res => {
  9013. if(res.code == 'ok'){
  9014. this.allUsersList = res.data
  9015. }else{
  9016. this.$message({
  9017. message: res.msg,
  9018. type: 'error'
  9019. })
  9020. }
  9021. },err => {
  9022. this.$message({
  9023. message: err,
  9024. type: 'error'
  9025. })
  9026. })
  9027. },
  9028. //考勤工时异常,一键驳回并提醒修改
  9029. batchRejectAndRemind(item){
  9030. this.$confirm('您确定要一键驳回异常考勤工时的日报并发送消息提醒吗?',this.$t('other.prompts'), {
  9031. confirmButtonText: this.$t('btn.determine'),
  9032. cancelButtonText: this.$t('btn.cancel'),
  9033. type: "warning"
  9034. })
  9035. .then(() => {
  9036. let parameter={
  9037. ymonth: this.notfullSelectDateMonth
  9038. }
  9039. this.remindering = true;
  9040. this.http.post('/report/rejectAbnormalReportTime',parameter,res => {
  9041. this.remindering = false;
  9042. if(res.code == 'ok'){
  9043. this.$message({
  9044. message: res.msg,
  9045. type: 'success'
  9046. });
  9047. this.notFullData = [];
  9048. this.notFullOriginList = [];
  9049. }else{
  9050. this.$message({
  9051. message: res.msg,
  9052. type: 'error'
  9053. })
  9054. }
  9055. },err => {
  9056. this.$message({
  9057. message: err,
  9058. type: 'error'
  9059. })
  9060. })
  9061. }).catch(() => {this.startDeleting = false});
  9062. },
  9063. //景昱变更提醒
  9064. changeReminder(item){
  9065. let parameter={
  9066. startDate: this.WorktimeDatepickValue[0],
  9067. endDate: this.WorktimeDatepickValue[1],
  9068. }
  9069. if(item){
  9070. parameter.createDate=item.createDate,
  9071. parameter.userId=item.userId
  9072. }
  9073. this.remindering = true;
  9074. this.http.post('/report/changeReminder',parameter,res => {
  9075. this.remindering = false;
  9076. if(res.code == 'ok'){
  9077. this.$message({
  9078. message: res.msg,
  9079. type: 'success'
  9080. })
  9081. }else{
  9082. this.$message({
  9083. message: res.msg,
  9084. type: 'error'
  9085. })
  9086. }
  9087. },err => {
  9088. this.$message({
  9089. message: err,
  9090. type: 'error'
  9091. })
  9092. })
  9093. },
  9094. //景昱取消异常
  9095. cancelReminder(item){
  9096. let parameter={}
  9097. if(item){
  9098. parameter.createDate=item.createDate,
  9099. parameter.userId=item.userId
  9100. }
  9101. this.http.post('/report/cancelReminder',parameter,res => {
  9102. if(res.code == 'ok'){
  9103. this.$message({
  9104. message: res.msg,
  9105. type: 'success'
  9106. })
  9107. }else{
  9108. this.$message({
  9109. message: res.msg,
  9110. type: 'error'
  9111. })
  9112. }
  9113. },err => {
  9114. this.$message({
  9115. message: err,
  9116. type: 'error'
  9117. })
  9118. })
  9119. this.showMonthWorkTimeReminder()
  9120. },
  9121. // 重庆物奇私人定制的按周填报弹窗关闭事件
  9122. fillWeekCustomClne() {
  9123. this.fillWeekDialogVisiCustom = false
  9124. },
  9125. fillWeekCustomClneTwo() {
  9126. this.fillWeekDialogVisiCustomTwo = false
  9127. },
  9128. fillWeekCustomSubmit() {
  9129. this.getReportList();
  9130. this.getDepartment();
  9131. this.getRecentlyProject()
  9132. },
  9133. // 待填日报姓名搜索
  9134. nameAearchSeek(flg) {
  9135. if(!this.nameAearch) {
  9136. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  9137. return
  9138. }
  9139. if(flg) {
  9140. this.enterpriseWechatgetUser()
  9141. }
  9142. },
  9143. handleThreeData(userList) {
  9144. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  9145. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  9146. },
  9147. // 过滤树节点
  9148. filterTreeNodes(treeData, filterKeywords) {
  9149. return treeData.filter((node) => {
  9150. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  9151. if (node.children && node.children.length > 0) {
  9152. node.children = this.filterTreeNodes(node.children, filterKeywords);
  9153. }
  9154. return true;
  9155. }
  9156. if (node.children && node.children.length > 0) {
  9157. node.children = this.filterTreeNodes(node.children, filterKeywords);
  9158. return node.children.length > 0;
  9159. }
  9160. return false;
  9161. });
  9162. },
  9163. // 企业微信获取人员
  9164. enterpriseWechatgetUser() {
  9165. this.deptMembDataLoading = true
  9166. this.http.post('/user/getEmployeeList',{
  9167. departmentId: -1,
  9168. pageIndex: 1,
  9169. pageSize: 100,
  9170. keyword: this.nameAearch,
  9171. status: '',
  9172. roleId: '',
  9173. cursor: '',
  9174. onlyDirect: '',
  9175. matchingType: ''
  9176. },res => {
  9177. if(res.code == 'ok'){
  9178. this.deptMembDataLoading = false
  9179. const userListName = res.data.records.map(item => item.name)
  9180. this.handleThreeData(userListName)
  9181. setTimeout(() => {
  9182. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  9183. }, 200)
  9184. }else{
  9185. this.deptMembDataLoading = false
  9186. this.$message({
  9187. message: res.msg,
  9188. type: 'error'
  9189. })
  9190. }
  9191. },err => {
  9192. this.deptMembDataLoading = false
  9193. this.$message({
  9194. message: err,
  9195. type: 'error'
  9196. })
  9197. })
  9198. },
  9199. changeTreeNodeStatus(node) {
  9200. let allZt = true
  9201. node.expanded = allZt
  9202. for (let i = 0; i < node.childNodes.length; i++) {
  9203. node.childNodes[i].expanded = allZt
  9204. if (node.childNodes[i].childNodes.length > 0) {
  9205. this.changeTreeNodeStatus(node.childNodes[i])
  9206. }
  9207. }
  9208. },
  9209. // 按周填报获取相关任务
  9210. async getWeeklyTaskList(item) {
  9211. const { projectId, groupId, stage, taskId } = item
  9212. let parms = { projectId, isSubstitude: 0 }
  9213. groupId ? parms.groupId = groupId : ''
  9214. stage ? parms.stage = stage : ''
  9215. const { data } = await this.postData('/task/getRecentTask', parms)
  9216. this.zhoBao.taskId = taskId
  9217. this.$set(this.zhoBao, 'taskList', data)
  9218. },
  9219. getCustomConfigurationItems() {
  9220. this.postData('/user-custom/getUserCustomFirstPullDown', {}).then(res => {
  9221. // this.customConfigurationRow = res.data || { subUserCustomList: [] }
  9222. const { subUserCustomList = [], plate = '' } = res.data
  9223. this.customConfigurationRow = {
  9224. ...res.data,
  9225. subUserCustomList: subUserCustomList.map(item => {
  9226. return {
  9227. ...item,
  9228. newId: `${plate}-${item.name}`
  9229. }
  9230. })
  9231. }
  9232. console.log(this.customConfigurationRow)
  9233. })
  9234. },
  9235. // 封装 post 请求
  9236. postData(url, params) {
  9237. return new Promise((resolve, reject) => {
  9238. this.http.post(url, { ...params },
  9239. res => {
  9240. resolve(res)
  9241. },
  9242. error => {
  9243. this.$message({
  9244. message: error,
  9245. type: "error"
  9246. });
  9247. reject(error)
  9248. })
  9249. })
  9250. },
  9251. // 自定义事件
  9252. selectCal(obj) {
  9253. if(obj.distinction == '1') {
  9254. this.zhoBao.projectAuditorId = obj.id
  9255. } else if(obj.distinction == '2') {
  9256. this.zhoBao.auditorFirst = obj.id
  9257. } else if(obj.distinction == '3') {
  9258. this.zhoBao.auditorSec = obj.id
  9259. } else if(obj.distinction == '4') {
  9260. this.zhoBao.auditorThird = obj.id
  9261. } else if(obj.distinction == '5') {
  9262. this.zhoBao.ccUserid = obj.id
  9263. } else if(obj.distinction == '12') {
  9264. this.usersListId = obj.id
  9265. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9266. this.searchKeyword = obj.name
  9267. } else {
  9268. this.searchKeyword = ''
  9269. }
  9270. this.searchScreen(0)
  9271. } else if(obj.distinction == '13') {
  9272. this.usersListId = obj.id
  9273. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9274. this.searchKeyword = obj.name
  9275. } else {
  9276. this.searchKeyword = ''
  9277. }
  9278. this.searchScreen(1)
  9279. } else if(obj.distinction == '15') {
  9280. this.usersListId = obj.id
  9281. this.showReportTimeLessThanCardTimeList();
  9282. }
  9283. }
  9284. },
  9285. created() {
  9286. this.getUsers()
  9287. let height = window.innerHeight;
  9288. this.tableHeight = height - 178;
  9289. const that = this;
  9290. window.onresize = function temp() {
  9291. that.tableHeight = window.innerHeight - 178;
  9292. };
  9293. this.toViewForm.companyId = this.user.companyId
  9294. this.initDrag([{
  9295. type: "LR",
  9296. domClass: {
  9297. // 中间分割线的名字
  9298. resize: "line-line",
  9299. // 左侧盒子的名字
  9300. left: "box-left",
  9301. // 右侧盒子的名字
  9302. right: "box-right",
  9303. // 父级的名字
  9304. box: "box-father",
  9305. },
  9306. otherInfo: {
  9307. // 限制左边栏最低宽度
  9308. leftWidth: 120,
  9309. },
  9310. },
  9311. {
  9312. type: "LR",
  9313. domClass: {
  9314. // 中间分割线的名字
  9315. resize: "line-second",
  9316. // 左侧盒子的名字
  9317. left: "left-laowang",
  9318. // 右侧盒子的名字
  9319. right: "box-second-father",
  9320. // 父级的名字
  9321. box: "grand",
  9322. },
  9323. otherInfo: {
  9324. // 限制左边栏最低宽度
  9325. leftWidth: 120,
  9326. },
  9327. },
  9328. ]);
  9329. }
  9330. };
  9331. </script>
  9332. <style lang="scss" scoped>
  9333. @import "../../assets/scss/handle";
  9334. .themeFontColor {
  9335. @include font_color("color");
  9336. }
  9337. .fillWeekDialogVisiCustom {
  9338. width: 100%;
  9339. height: 70vh;
  9340. }
  9341. .fillWeekCustom {
  9342. .el-dialog__body {
  9343. padding: 20px 20px !important;
  9344. }
  9345. }
  9346. .photos {
  9347. position: relative;
  9348. display: flex;
  9349. flex-wrap: wrap;
  9350. }
  9351. .photos_img {
  9352. width: 120px;
  9353. height: 120px;
  9354. margin-right: 20px;
  9355. margin-bottom: 20px;
  9356. cursor: pointer;
  9357. img {
  9358. width: 100%;
  9359. height: 100%;
  9360. }
  9361. }
  9362. .paginatis {
  9363. padding: 10px 10px;
  9364. background: #f2f2f2;
  9365. }
  9366. .waiting {
  9367. color:orange;
  9368. }
  9369. .filledReportStyle {
  9370. color:#32CD32;
  9371. }
  9372. .RejectStyle {
  9373. color:red;
  9374. }
  9375. .waitSubmitStyle{
  9376. @include font_color("color");
  9377. }
  9378. .chooseDate {
  9379. .waiting {
  9380. @include font_color("color");
  9381. }
  9382. .filledReportStyle {
  9383. @include font_color("color");
  9384. }
  9385. .RejectStyle {
  9386. @include font_color("color");
  9387. }
  9388. .waitSubmitStyle{
  9389. @include font_color("color");
  9390. }
  9391. }
  9392. .allDaily {
  9393. width:100%;
  9394. }
  9395. .report_title {
  9396. padding:10px 0;
  9397. color:#666;
  9398. }
  9399. .clearfix {
  9400. overflow-x: auto;
  9401. white-space: nowrap;
  9402. padding: 15px 0 10px 0;
  9403. // overflow-y: hidden;
  9404. .date_item {
  9405. padding: 0 3px;
  9406. cursor: pointer;
  9407. position: relative;
  9408. }
  9409. .chooseDate {
  9410. position: absolute;
  9411. bottom: -3px;
  9412. width: 37px;
  9413. height: 2px;
  9414. left: 14px;
  9415. @include background_color("background_color");
  9416. }
  9417. }
  9418. .one_daily {
  9419. i {
  9420. @include font_color("color1");
  9421. margin-right: 5px;
  9422. }
  9423. .one_daily_body {
  9424. padding: 10px 0px;
  9425. p {
  9426. margin: 0;
  9427. line-height: 30px;
  9428. }
  9429. }
  9430. ul {
  9431. padding: 0;
  9432. }
  9433. }
  9434. .checkbtn {
  9435. float: right;
  9436. margin-top: -10px;
  9437. }
  9438. .selConStyle{
  9439. margin-top:9rem;
  9440. margin-bottom:11rem;
  9441. .selConStyle_title{
  9442. height: 3rem;
  9443. text-align: center;
  9444. font-size: 17px;
  9445. }
  9446. .el-select{
  9447. margin: 0 15%;
  9448. width: 70%;
  9449. }
  9450. }
  9451. </style>
  9452. <style lang="scss">
  9453. /*去除upload组件过渡效果*/
  9454. .photos .el-upload-list__item {
  9455. transition: none !important;
  9456. }
  9457. .daily {
  9458. .el-card__body {
  9459. height: 80%;
  9460. overflow-y: auto;
  9461. }
  9462. .el-card__header {
  9463. padding: 0 20px;
  9464. }
  9465. }
  9466. .membListClass{
  9467. .el-dialog__body{
  9468. padding-top: 10px;
  9469. }
  9470. }
  9471. // .editReportDialog .el-dialog__footer{
  9472. // position: sticky;
  9473. // bottom: 0;
  9474. // background: #fff;
  9475. // height: 70px;
  9476. // z-index: 1010;
  9477. // }
  9478. .editReportDialog{
  9479. min-width: 800px;
  9480. }
  9481. .touruxiangmu{
  9482. max-width: 1000px;
  9483. }
  9484. </style>
  9485. <style scoped>
  9486. /* 项目标签的样式 */
  9487. .el-tag + .el-tag {
  9488. margin-left: 10px;
  9489. }
  9490. .button-new-tag {
  9491. margin-left: 10px;
  9492. height: 32px;
  9493. line-height: 30px;
  9494. padding-top: 0;
  9495. padding-bottom: 0;
  9496. }
  9497. .input-new-tag {
  9498. width: 90px;
  9499. margin-left: 10px;
  9500. vertical-align: bottom;
  9501. }
  9502. .selectworktime .el-table__fixed-body-wrapper{
  9503. top: 48px !important;
  9504. }
  9505. .selectworktime_export .selectworktime_export_l{
  9506. width: 650px;
  9507. float: left;
  9508. height: 42px;
  9509. }
  9510. .approvalProcessBox{
  9511. margin-left: 30px;
  9512. font-size: 14px;
  9513. line-height: 16px;
  9514. cursor: pointer;
  9515. }
  9516. .approvalProcessBox i {
  9517. margin-right: 0;
  9518. height: 16px;
  9519. width: 16px;
  9520. display: inline-block;
  9521. transform: scale(1.2);
  9522. position: relative;
  9523. top: 0.5px;
  9524. @include font_color("color");
  9525. }
  9526. .approvalProcessBox .approvalProcessClick{
  9527. cursor: pointer;
  9528. @include font_color("color");
  9529. font-size: 14px;
  9530. }
  9531. .approvalProcessBox:hover .approvalProcessClick{
  9532. color: #3485fb;
  9533. }
  9534. </style>
  9535. <style lang="scss" scoped>
  9536. .bionicClass {
  9537. -webkit-appearance: none;
  9538. background-color: #FFF;
  9539. background-image: none;
  9540. border-radius: 4px;
  9541. border: 1px solid #DCDFE6;
  9542. box-sizing: border-box;
  9543. color: #606266;
  9544. display: inline-block;
  9545. height: 40px;
  9546. line-height: 40px;
  9547. outline: 0;
  9548. padding: 0 15px;
  9549. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9550. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9551. width: 350px;
  9552. cursor: pointer;
  9553. .bionicClassText {
  9554. color: #C0C4CC;
  9555. }
  9556. }
  9557. // 加班样式
  9558. .overtime {
  9559. display: inline-block;
  9560. margin-left: 20px;
  9561. input {
  9562. display: inline-block;
  9563. margin-top: 5px;
  9564. }
  9565. }
  9566. .plus {
  9567. display: inline-block;
  9568. }
  9569. // .tages {
  9570. // float: right;
  9571. // }
  9572. .overtime {
  9573. display: inline-block;
  9574. margin-left: 30px;
  9575. }
  9576. .bloks {
  9577. display: inline-block;
  9578. width: 380px;
  9579. }
  9580. .zhiss {
  9581. display: flex;
  9582. justify-content: space-around;
  9583. align-items: center;
  9584. }
  9585. .zhoFel {
  9586. display: flex;
  9587. justify-content: space-between;
  9588. align-items: center;
  9589. }
  9590. // 左右滑动样式
  9591. .line {
  9592. width: 30px;
  9593. /* height: 500px; */
  9594. background: #f2f2f2;
  9595. cursor: w-resize;
  9596. }
  9597. .box-father {
  9598. border: 8px solid #000;
  9599. }
  9600. .line-second {
  9601. width: 10px;
  9602. /* background: red; */
  9603. }
  9604. .flex {
  9605. display: flex;
  9606. width: 100%;
  9607. }
  9608. .box-left {
  9609. flex: 0 0 400px;
  9610. /* height: 600px; */
  9611. /* background: blue; */
  9612. }
  9613. .box-right {
  9614. /* height: 600px; */
  9615. /* background: green; */
  9616. flex: 1;
  9617. }
  9618. .box-postion {
  9619. width: 200px;
  9620. /* height: 400px; */
  9621. background: #ccc;
  9622. }
  9623. .custom-tree-node {
  9624. flex: 1;
  9625. display: flex;
  9626. align-items: center;
  9627. justify-content: space-between;
  9628. font-size: 14px;
  9629. padding-right: 8px;
  9630. }
  9631. .daitianrbao {
  9632. width: 100%;
  9633. box-sizing: border-box;
  9634. height: 40px;
  9635. border-radius: 4px;
  9636. border: 1px solid #DCDFE6;
  9637. overflow: hidden;
  9638. text-overflow: ellipsis;
  9639. display: flex;
  9640. // align-items: center;
  9641. }
  9642. .daitianrbao .spnn {
  9643. display: inline-block;
  9644. box-sizing: border-box;
  9645. padding: 0 15px;
  9646. overflow: hidden;
  9647. text-overflow: ellipsis;
  9648. }
  9649. .daitianrbao .hover {
  9650. color: #DCDFE6 !important;
  9651. }
  9652. </style>