daily.vue 450 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. <!-- <el-tooltip v-if="index == choseDay" effect="dark" content="填报时长超过北森考勤时长" placement="top-start">
  22. <i class="el-icon-warning" style="color:red;"></i>
  23. </el-tooltip> -->
  24. </div>
  25. </div>
  26. </span>
  27. </div>
  28. </div>
  29. <div style="display:flex;">
  30. <div class="grand flex">
  31. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  32. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  33. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  34. </div> -->
  35. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  36. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  37. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  38. </el-input>
  39. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  40. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  41. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  42. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  43. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  44. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  45. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  46. </el-select>
  47. </div>
  48. <div>
  49. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  50. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <!-- <span>{{ node.label }}</span> -->
  53. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  54. <span v-if="user.userNameNeedTranslate == '1'">
  55. <span v-if="node.data.children">
  56. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  57. </span>
  58. <span v-else>
  59. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  60. </span>
  61. </span>
  62. <span v-if="user.userNameNeedTranslate != '1'">
  63. {{ node.label }}
  64. </span>
  65. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  66. </span>
  67. <div style="position: absolute;right: 15px;">
  68. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  69. <!-- 未填报 -->
  70. {{$t('state.DidNotFillIn')}}
  71. </span>
  72. <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'">
  73. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  74. {{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)')}}
  75. </span>
  76. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  77. <!-- 待审核 -->
  78. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  79. </span>
  80. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  81. <!-- 已通过 -->
  82. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  83. </span>
  84. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  85. <!-- 未通过 -->
  86. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  87. </span>
  88. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  89. <!-- 待提交 -->
  90. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  91. </span>
  92. </div>
  93. </span>
  94. </el-tree>
  95. </div>
  96. </div>
  97. </div>
  98. <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">
  99. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  100. -
  101. -
  102. -
  103. </div>
  104. </div>
  105. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  106. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  107. <div class="allDaily" style="float:left;flex-grow:1">
  108. <!--系统管理员和部门负责人 -->
  109. <div class="report_title" style="display:flex;justify-content: space-between;">
  110. <span>
  111. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  112. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  113. <!-- {{depData != null ?depData.label:""}} -->
  114. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  116. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  117. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  118. <span v-if="targetUid == null">
  119. <!-- - 已提交 -->
  120. -{{$t('state.hasBeenSubmitted')}}
  121. <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')}},
  122. <!-- 待提交 -->
  123. {{$t('state.waitingsubmit')}}
  124. <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')}},
  125. <!-- 漏填 -->
  126. <!-- {{$t('state.missFillReport')}} -->
  127. 未填
  128. <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')}}
  129. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  130. </span>
  131. </span>
  132. </span>
  133. <span style="float:right;">
  134. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  135. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  136. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  137. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  138. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  139. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  140. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  141. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  142. <!--部门负责人给个导出工时的功能 -->
  143. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  144. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  146. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  147. </span>
  148. </div>
  149. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  150. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  151. <i class="fa fa-circle"></i>
  152. <!-- {{item1.name}} -->
  153. <span v-if="user.userNameNeedTranslate == '1'">
  154. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  155. </span>
  156. <span v-if="user.userNameNeedTranslate != '1'">
  157. {{item1.name}}
  158. </span>
  159. <span style="margin-left:30px;">
  160. <span style="margin-right:20px;">
  161. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  162. <!-- 工作总时长: -->
  163. {{$t('other.totalWorkingHours')}}
  164. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  165. <span >{{item1.reportTime | amounts}}</span>h
  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 && item1.summary != null" style="margin-left:20px;">
  182. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. </div>
  184. <div class="one_daily_body">
  185. <el-timeline>
  186. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  187. <el-card shadow="never">
  188. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  189. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  190. <span v-if="user.company.packageEngineering == 0">
  191. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  192. <span v-if="item2.isDeptAudit==0">
  193. <span v-if="item2.projectAuditState==0">
  194. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  195. <span v-if="item2.projectAuditorName != null">(
  196. <!-- {{item2.projectAuditorName}} -->
  197. <span v-if="user.userNameNeedTranslate == '1'">
  198. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  199. </span>
  200. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  201. )</span>
  202. <!-- 审核 --> {{$t('other.audit')}}
  203. </span>
  204. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  205. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  206. <span v-if="item2.projectAuditorName != null">(
  207. <!-- {{item2.projectAuditorName}} -->
  208. <span v-if="user.userNameNeedTranslate == '1'">
  209. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  210. </span>
  211. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  212. )</span>
  213. <!-- 审核通过 --> {{$t('state.approved')}}
  214. </span>
  215. </span>
  216. <span v-else-if="item2.isDeptAudit==1">
  217. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  218. ({{$t('other.await')}}
  219. <span v-if="user.userNameNeedTranslate == '1'">
  220. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  221. </span>
  222. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  223. {{$t('other.audit')}})
  224. </span>
  225. ]</span>
  226. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  227. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  228. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  229. </span>
  230. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  232. </span>
  233. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  234. <span v-if="user.company.packageEngineering == 1">
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  238. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  239. (
  240. <span v-if="user.userNameNeedTranslate != 1">
  241. {{item2.projectAuditorName}}
  242. </span>
  243. <span v-if="user.userNameNeedTranslate == 1">
  244. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  245. </span>
  246. )
  247. </span>{{$t('other.audit')}} ]</span>
  248. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  249. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  251. </span>
  252. <!--每个项目上单独审核 -->
  253. <span style="float:right;">
  254. <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>
  255. <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"
  256. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</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="danger" :loading="logining"
  258. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  259. <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"
  260. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  261. <!--自己可以撤回待审核状态的报告 -->
  262. <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>
  263. </span>
  264. </p>
  265. <p v-if="user.companyId == yuzhongCompId">
  266. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  267. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  268. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  269. <!--任务分组和阶段 -->
  270. <p v-if="item2.groupId != 0">
  271. {{$t('other.taskGroup')}}:{{item2.groupName}}
  272. <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>
  273. </p>
  274. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  275. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  276. <!-- 自定义日报文本 -->
  277. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  278. <p v-if="user.company.packageEngineering == 1">
  279. {{$t('other.professionalProgress')}}:
  280. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  281. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  282. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhetongguo"></i>
  286. </el-tooltip>
  287. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  288. <i class="iconfont firerock-iconshenhebohui"></i>
  289. </el-tooltip>
  290. </span>
  291. </p>
  292. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  293. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  294. </p>
  295. <div v-if="item2.multiWorktime==0">
  296. <p style="display: inline-block;">{{$t('time.duration')}}:
  297. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  298. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  299. {{item2.time.toFixed(1)}}h
  300. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  301. </p>
  302. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  303. </div>
  304. <div v-if="item2.multiWorktime==1" >
  305. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  306. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  307. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  308. <p style="display: inline-block;">{{$t('time.duration')}}:
  309. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  310. {{timeItem.time.toFixed(1)}}h
  311. </p>
  312. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  313. </div>
  314. </div>
  315. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  316. <!--照片的显示 -->
  317. <p v-if="item2.pics != null && item2.pics.length > 0">
  318. <el-image v-for="(pic, index) in item2.pics" :key="index"
  319. style="width: 100px; height: 100px; margin-right:10px;"
  320. :src="pic"
  321. :preview-src-list="item2.pics">
  322. </el-image>
  323. </p>
  324. </el-card>
  325. </el-timeline-item>
  326. </el-timeline>
  327. </div>
  328. </div>
  329. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  330. <!-- 简陋的无报告提示 -->
  331. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </el-card>
  338. </div>
  339. <!-- 工时推送日志弹窗 -->
  340. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  341. <template>
  342. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  343. </template>
  344. <template>
  345. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  346. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  347. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  348. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  349. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  350. <el-table-column prop="result" label="推送结果" width="250">
  351. <template slot-scope="scope">
  352. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  353. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  357. </el-table>
  358. </template>
  359. <span slot="footer" class="dialog-footer">
  360. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  361. </span>
  362. </el-dialog>
  363. <!-- 填写日报的dialog -->
  364. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  365. <div style="height: 65vh;overflow: auto;">
  366. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  367. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  368. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  369. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  370. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  371. <span class="spnn" v-if="workForm.userNames">
  372. <span v-for="(item, index) in workForm.userNames" :key="index">
  373. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  374. <span v-if="index < workForm.userNames.length - 1">,</span>
  375. </span>
  376. </span>
  377. <span class="spnn hover" v-else>
  378. {{$t('defaultText.pleaseSelectAsubstitute')}}
  379. </span>
  380. </div>
  381. </el-form-item>
  382. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  383. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  384. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  385. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  386. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  387. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  388. <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>
  389. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  390. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  391. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  392. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  393. <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>
  394. <!-- AI智能填报 -->
  395. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  396. </el-form-item>
  397. <!--考勤时长显示-->
  398. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.time || user.companyId == 5978">
  399. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  400. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  401. </span>
  402. <!--批量填报和批量代填不显示考勤记录-->
  403. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  404. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  405. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  406. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  407. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  408. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  409. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  410. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  411. @click="refreshAttendance(workForm.createDate)"></el-button>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  414. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  415. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  416. </el-form-item>
  417. <!-- 000000 -->
  418. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  419. <div v-if="reportTimeType.multiWorktime==0">
  420. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  421. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  422. <el-select v-model="domain.timeType" style="width:200px;"
  423. v-if="reportTimeType.type == 0"
  424. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. @change="onTimeTypeChange(domain.timeType)">
  427. <el-option
  428. v-for="item in timeType"
  429. :key="item.value"
  430. :label="item.label"
  431. :value="item.value">
  432. </el-option>
  433. </el-select>
  434. <!-- 数字时长选择 -->
  435. <el-select v-model="domain.workingTime" style="width:200px;"
  436. v-if="reportTimeType.type == 1"
  437. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  438. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  439. @change="seleChn(0,domain)">
  440. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  441. </el-select>
  442. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  443. <span v-if="reportTimeType.type == 2">
  444. <!--时间范围选择 -->
  445. <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.startTime"
  448. :placeholder="$t('time.startTime')"
  449. style="width:120px;"
  450. format="HH:mm"
  451. value-format="HH:mm"
  452. :picker-options="{
  453. start: '08:00',
  454. end: '23:30'
  455. }"
  456. @change="iptChang()">
  457. </el-time-picker> - <el-time-picker
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  459. v-model="domain.endTime"
  460. :placeholder="$t('time.endTime')"
  461. style="width:120px;"
  462. format="HH:mm"
  463. value-format="HH:mm"
  464. :picker-options="{
  465. start: '08:00',
  466. end: '23:30',
  467. minTime: domain.startTime
  468. }"
  469. @change="iptChang()">
  470. </el-time-picker>
  471. </span>
  472. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  473. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  474. <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>
  475. </div>
  476. </el-form-item>
  477. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  478. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  479. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  480. @change="selectProject(domain, index)"
  481. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  482. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  483. <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">
  484. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  485. <span style="float: right;">{{ item.projectName }}</span>
  486. </el-option>
  487. </el-option-group>
  488. </el-select>
  489. <!--昱众不显示子项目-->
  490. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  491. <span style="margin-left:45px;">
  492. {{$t('lable.subproject')}}</span>
  493. <!--子项目 -->
  494. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  495. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  496. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  497. </el-select>
  498. </template>
  499. <template v-if="user.companyId == yuzhongCompId">
  500. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  501. <!--角色选择 -->
  502. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  503. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  504. <el-option
  505. v-for="item in roleList"
  506. :key="item.value"
  507. :label="item.label"
  508. :value="item.value">
  509. </el-option>
  510. </el-select>
  511. </template>
  512. <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%;"
  513. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  514. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  515. </el-link>
  516. <!-- <el-link type="primary" v-if="canEdit"
  517. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  518. </el-form-item>
  519. <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">
  520. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  521. </el-form-item>
  522. <!--如果设置了工时成本预警的预算成本项-->
  523. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  524. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  525. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  526. </el-select>
  527. </el-form-item>
  528. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  529. <template slot="label">
  530. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  531. <span >{{$t('lable.taskGrouping')}}</span>
  532. </template>
  533. <!-- 任务分组 -->
  534. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  535. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  536. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  537. </el-select>
  538. <template v-if="user.companyId == yuzhongCompId">
  539. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  540. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  541. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  542. <el-option
  543. v-for="item in domain.filteredRespList"
  544. :key="item.id"
  545. :label="item.jobRespon"
  546. :value="item.id">
  547. </el-option>
  548. </el-select>
  549. </template>
  550. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  551. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  552. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  553. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  554. @change="changeStages(domain, index)"
  555. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  556. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  557. </el-select>
  558. </template>
  559. </el-form-item>
  560. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  561. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  562. <template slot="label">
  563. <span style="color:#FF0000;">*</span>
  564. <span >{{$t('other.projectAuditor')}}</span>
  565. </template>
  566. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  567. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  568. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  569. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  570. </el-option>
  571. </el-select>
  572. <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>
  573. </el-form-item>
  574. </div>
  575. <el-form-item v-if="user.companyId == yuzhongCompId">
  576. <template slot="label">
  577. <span style="color:#FF0000;">*</span>
  578. <span >工作内容</span>
  579. </template>
  580. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  581. :disabled="(workForm.domains[index].state>=2?false:true)" >
  582. <el-option
  583. v-for="item in domain.workContentList"
  584. :key="item.id"
  585. :label="item.workContext"
  586. :value="item.id">
  587. </el-option>
  588. </el-select>
  589. </el-form-item>
  590. <!-- 111111 -->
  591. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  592. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  593. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  594. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  595. <span v-else>{{item.name}}</span>
  596. </el-option>
  597. </el-select>
  598. <template v-if="user.timeType.auditLevel > 1">
  599. <i class="el-icon-right"></i>
  600. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  601. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  602. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  603. <span v-else>{{item.name}}</span>
  604. </el-option>
  605. </el-select>
  606. </template>
  607. <template v-if="user.timeType.auditLevel > 2">
  608. <i class="el-icon-right"></i>
  609. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  610. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  611. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  612. <span v-else>{{item.name}}</span>
  613. </el-option>
  614. </el-select>
  615. </template>
  616. </el-form-item>
  617. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  618. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  619. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  620. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  621. <span v-else>{{item.name}}</span>
  622. </el-option>
  623. </el-select>
  624. </el-form-item>
  625. <!-- 相关维度/自定义维度 -->
  626. <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'">
  627. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  628. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  629. </el-option>
  630. </el-select>
  631. </el-form-item>
  632. <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'">
  633. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  634. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  635. </el-option>
  636. </el-select>
  637. </el-form-item>
  638. <!-- 相关数值 -->
  639. <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">
  640. <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>
  641. </el-form-item>
  642. <!-- 自定义文本 -->
  643. <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">
  644. <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>
  645. </el-form-item>
  646. <!--按比例填报-->
  647. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  648. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  649. <div style="width:400px;">
  650. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  651. <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>
  652. </div>
  653. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  654. <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>
  655. </div>
  656. </el-form-item>
  657. <!--工程专业版本模式下, 各个专业的进度填报 -->
  658. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  659. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  660. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  661. <el-input size="mini" style="width:60px;" v-model="item.progress"
  662. @keyup.native="onProgressChange"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  664. </span>
  665. </el-form-item>
  666. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  667. <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))" >
  668. <template slot="label" v-if="user.timeType.taskRequired == 1">
  669. <span style="color:#FF0000;">*</span>
  670. <span >任务</span>
  671. </template>
  672. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  673. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  674. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  675. </el-select>
  676. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  677. </el-form-item>
  678. <!--针对依斯贝的SAP服务-->
  679. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  680. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  681. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  682. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  683. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  684. </el-select>
  685. </el-form-item>
  686. <!--工作事项-->
  687. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  688. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  689. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  690. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  691. </el-form-item>
  692. <!-- 拍照上传 -->
  693. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  694. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  695. <div class="photos">
  696. <div>
  697. <el-upload
  698. list-type="picture-card"
  699. :http-request="(file) => {return addImg(file, index)}"
  700. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  701. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  702. :file-list="domain.imgListUrl" :limit="9"
  703. :disabled="workForm.domains[index].state>=2?false:true">
  704. <i class="el-icon-plus"></i>
  705. </el-upload>
  706. </div>
  707. </div>
  708. </el-form-item>
  709. </div>
  710. <!--多个工作事项填报的情况 -->
  711. <div v-if="reportTimeType.multiWorktime==1">
  712. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  713. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  714. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  715. @change="selectProject(domain, index)"
  716. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  717. <!-- <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  718. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  719. <span style="float: right;">{{ item.projectName }}</span>
  720. </el-option> -->
  721. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  722. <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">
  723. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  724. <span style="float: right;">{{ item.projectName }}</span>
  725. </el-option>
  726. </el-option-group>
  727. </el-select>
  728. <template v-if="user.timeType.mainProjectState != 1">
  729. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  730. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  731. <!--子项目 -->
  732. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  733. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  734. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  735. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  736. </el-select>
  737. </template>
  738. <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;"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  740. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  741. </el-link>
  742. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  743. <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>
  744. </div>
  745. <!-- <el-link type="primary" v-if="canEdit"
  746. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  747. </el-form-item>
  748. <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">
  749. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  750. </el-form-item>
  751. <!--如果设置了工时成本预警的预算成本项-->
  752. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  753. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  754. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  755. </el-select>
  756. </el-form-item>
  757. <el-form-item v-if="user.company.packageProject == 1">
  758. <template slot="label">
  759. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  760. <span >{{$t('lable.taskGrouping')}}</span>
  761. </template>
  762. <!-- 任务分组 -->
  763. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  764. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  765. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  766. </el-select>
  767. <!-- 项目的阶段 -->
  768. <span v-if="domain.stages != null && domain.stages.length> 0"
  769. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  770. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  771. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  772. @change="changeStages(domain, index)"
  773. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  774. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  775. </el-select>
  776. </el-form-item>
  777. <el-form-item :label="$t('other.projectAuditor')" >
  778. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  779. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  780. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  781. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  782. </el-option>
  783. </el-select>
  784. <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>
  785. </el-form-item>
  786. <!--工程专业版本模式下, 各个专业的进度填报 -->
  787. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  788. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  789. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  790. <el-input size="mini" style="width:60px;" v-model="item.progress"
  791. @keyup.native="onProgressChange"
  792. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  793. </span>
  794. </el-form-item>
  795. <!-- 相关维度 -->
  796. <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'">
  797. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  798. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  799. </el-option>
  800. </el-select>
  801. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  802. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  803. </el-option>
  804. </el-select>
  805. </el-form-item>
  806. <!-- 相关数值 -->
  807. <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">
  808. <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>
  809. </el-form-item>
  810. <!-- 自定义文本 -->
  811. <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">
  812. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  813. </el-form-item>
  814. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  815. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  816. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  818. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  819. </el-select>
  820. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  821. </el-form-item>
  822. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  823. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  824. <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>
  825. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  826. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  827. <span v-if="reportTimeType.type == 2">
  828. <!-- <span> -->
  829. <!--时间范围选择 -->
  830. <el-time-picker
  831. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  832. v-model="timeItem.startTime"
  833. :placeholder="$t('time.startTime')"
  834. style="width:120px;"
  835. format="HH:mm"
  836. value-format="HH:mm"
  837. :picker-options="{
  838. start: '00:00',
  839. end: '23:59',
  840. }"
  841. @change="iptChangs()">
  842. </el-time-picker> - <el-time-picker
  843. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  844. v-model="timeItem.endTime"
  845. :placeholder="$t('time.endTime')"
  846. style="width:120px;"
  847. format="HH:mm"
  848. value-format="HH:mm"
  849. :picker-options="{
  850. start: '00:00',
  851. end: '23:59',
  852. minTime: timeItem.startTime
  853. }"
  854. @change="iptChangs()">
  855. </el-time-picker>
  856. </span>
  857. </el-form-item>
  858. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  859. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  860. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  861. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  862. ></el-input>
  863. </el-form-item>
  864. </div>
  865. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  866. </div>
  867. <!--照片的显示 -->
  868. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  869. <el-image v-for="(pic, index) in domain.pics" :key="index"
  870. style="width: 100px; height: 100px; margin-right:10px;"
  871. :src="pic"
  872. :preview-src-list="domain.pics">
  873. </el-image>
  874. </p>
  875. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  876. </div>
  877. <span id="workFormsItemBottom"></span>
  878. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  879. </el-form>
  880. </div>
  881. <span slot="footer" class="dialog-footer">
  882. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  883. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  884. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  885. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  886. <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>
  887. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  888. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  889. </span>
  890. </el-dialog>
  891. <!-- 按周填报 -->
  892. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  893. <!-- 按周填报-已填工时-点击 -->
  894. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  895. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  896. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  897. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  898. <el-table-column prop="state" :label="$t('state.states')">
  899. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  900. </el-table-column>
  901. <!-- <el-table-column label="操作">
  902. <template slot-scope="scope">
  903. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  904. </template>
  905. </el-table-column> -->
  906. </el-table>
  907. <span slot="footer" class="dialog-footer">
  908. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  909. </span>
  910. </el-dialog>
  911. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  912. <el-form-item style="height:30px;margin-top:-72px;">
  913. <!-- <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> -->
  914. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  915. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  916. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  917. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  918. <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>
  919. <el-option
  920. v-for="item in fillProjectList"
  921. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  922. :key="item.id"
  923. :label="item.projectName + '\u3000' + item.projectCode"
  924. :value="item.id">
  925. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  926. <span style="float: right">{{ item.projectName }}</span>
  927. </el-option>
  928. </el-select>
  929. <span style="float:right;margin-right:10px;">选择项目</span>
  930. </el-form-item>
  931. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  932. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  933. <template slot-scope="scope">
  934. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  935. </template>
  936. </el-table-column>
  937. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  938. <template slot-scope="scope">
  939. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  940. <p v-else></p>
  941. </template>
  942. </el-table-column> -->
  943. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  944. <template slot-scope="scope">
  945. <div v-if="scope.row.canFill == 1">
  946. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  947. <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>
  948. <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>
  949. <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>
  950. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  951. </div>
  952. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  953. <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>
  954. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  955. </div>
  956. </div>
  957. <div v-else >
  958. <span style="color:#999999;">不可超前填报</span>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  963. <template slot-scope="scope">
  964. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  965. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  966. </template>
  967. </el-table-column>
  968. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  969. <template slot-scope="scope">
  970. <div class="zhiss">
  971. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  972. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  973. </div>
  974. </template>
  975. </el-table-column>
  976. </el-table>
  977. </el-form>
  978. <span slot="footer" class="dialog-footer" >
  979. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  980. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  981. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  982. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 重庆物奇私人定制的按周填报 -->
  986. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  987. <div class="fillWeekDialogVisiCustom">
  988. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  989. </div>
  990. </el-dialog>
  991. <!-- 选择时间 -->
  992. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  993. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  994. <span slot="footer" class="dialog-footer">
  995. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  996. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  997. </span>
  998. </el-dialog>
  999. <!-- 按周填报弹窗 -->
  1000. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1001. <div>
  1002. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1003. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1004. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1005. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1006. </el-select>
  1007. </div>
  1008. <!--如果设置了工时成本预警的预算成本项-->
  1009. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1010. <p>{{$t('lable.budgetSource')}}</p>
  1011. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1012. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <!-- 任务分组 -->
  1016. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1017. <p>{{$t('lable.taskGrouping')}}</p>
  1018. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1019. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1020. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1021. </el-select>
  1022. </div>
  1023. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1024. <p>{{$t('other.inputStage')}}</p>
  1025. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1026. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1027. </el-select>
  1028. </div>
  1029. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1030. <p>{{$t('other.reviewer')}}</p>
  1031. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1032. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. <template v-if="user.timeType.reportAuditType == 3">
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1046. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. <div class="zhoFel">
  1052. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1053. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1054. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1055. </el-select>
  1056. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1057. </div>
  1058. <div class="zhoFel">
  1059. <p>{{ $t('chao-song-ren') }}</p>
  1060. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1061. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. </template>
  1066. <!-- 自定义维度 -->
  1067. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1068. <p>{{user.timeType.customDegreeName}}</p>
  1069. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1070. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1071. </el-select>
  1072. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1073. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1074. </el-select>
  1075. </div>
  1076. <!-- 自定义数值 -->
  1077. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1078. <p>{{user.timeType.customDataName}}</p>
  1079. <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>
  1080. </div>
  1081. <!-- 自定义文本 -->
  1082. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1083. <p>{{user.timeType.customTextName}}</p>
  1084. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1085. </div>
  1086. <!-- 选择任务 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1088. <p>任务 / 里程碑</p>
  1089. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1090. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1091. </el-select>
  1092. </div>
  1093. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1094. <p>{{$t('other.timeSelection')}}</p>
  1095. <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>
  1096. </div>
  1097. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1098. <p>{{$t('other.chooseDuration')}}</p>
  1099. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1100. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1101. </el-select>
  1102. </div>
  1103. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1104. <p>{{$t('lable.percentageOfTime')}}</p>
  1105. <div style="width:400px;display: flex;align-items: center;">
  1106. <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>
  1107. <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>
  1108. </div>
  1109. </div>
  1110. <div class="zhoFel">
  1111. <p>{{$t('other.workMatters')}}</p>
  1112. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1113. </div>
  1114. </div>
  1115. <span slot="footer" class="dialog-footer">
  1116. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1117. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1118. </span>
  1119. </el-dialog>
  1120. <!--导出报表条件选择 -->
  1121. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1122. <el-form ref="form3" :model="exportParam" >
  1123. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1124. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1125. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1126. </el-select>
  1127. </el-form-item>
  1128. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1129. <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>
  1130. <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>
  1131. </el-form-item>
  1132. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1133. <el-date-picker
  1134. v-model="exportParam.dateRange" :editable="false"
  1135. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1136. :range-separator="$t('other.to')"
  1137. type="daterange"
  1138. :start-placeholder="$t('time.startDate')"
  1139. :end-placeholder="$t('time.endDate')"
  1140. ></el-date-picker>
  1141. </el-form-item>
  1142. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1143. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1144. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1145. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1146. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1147. </el-select>
  1148. </el-form-item>
  1149. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1150. <div class="exportReportRadio">
  1151. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1152. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1153. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1154. <i class="el-icon-question"></i>
  1155. </el-tooltip>
  1156. </div>
  1157. </el-form-item>
  1158. </el-form>
  1159. <div slot="footer" class="dialog-footer">
  1160. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1161. </div>
  1162. </el-dialog>
  1163. <!--导出报表条件选择 -->
  1164. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1165. <el-form ref="form3" :model="exportParam" >
  1166. <el-form-item prop="range" :label="$t('time.dateRange')">
  1167. <el-date-picker
  1168. v-model="exportParam.dateRange" :editable="false"
  1169. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1170. :clearable="true"
  1171. :range-separator="$t('other.to')"
  1172. type="daterange"
  1173. :start-placeholder="$t('time.startDate')"
  1174. :end-placeholder="$t('time.endDate')"
  1175. ></el-date-picker>
  1176. </el-form-item>
  1177. </el-form>
  1178. <div slot="footer" class="dialog-footer">
  1179. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1180. </div>
  1181. </el-dialog>
  1182. <!--人员列表 -->
  1183. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1184. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1185. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1186. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1187. <el-table-column type="selection"></el-table-column>
  1188. <el-table-column prop="label" :label="$t('lable.name')" >
  1189. <template slot-scope="scope">
  1190. <span>
  1191. <!-- {{(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}} -->
  1192. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1193. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1194. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1195. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1196. </span>
  1197. <span v-else>
  1198. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1199. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1200. </span>
  1201. </span>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1205. <template slot-scope="scope">
  1206. <div>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1209. </div>
  1210. </template>
  1211. </el-table-column>
  1212. </el-table>
  1213. </el-tab-pane>
  1214. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1215. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1216. <el-table-column prop="label" :label="$t('lable.name')" >
  1217. <template slot-scope="scope">
  1218. <!-- <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> -->
  1219. <!-- <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> -->
  1220. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1222. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1223. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1224. </span>
  1225. <span v-else>
  1226. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1227. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1228. </span>
  1229. </template>
  1230. </el-table-column>
  1231. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1232. <template slot-scope="scope">
  1233. <div>
  1234. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1236. </div>
  1237. </template>
  1238. </el-table-column>
  1239. </el-table>
  1240. </el-tab-pane>
  1241. </el-tabs>
  1242. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1243. <el-table-column type="selection"></el-table-column>
  1244. <el-table-column prop="label" :label="$t('lable.name')" >
  1245. <template slot-scope="scope">
  1246. <div>
  1247. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1248. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1249. </div>
  1250. </template>
  1251. </el-table-column>
  1252. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1253. <template slot-scope="scope">
  1254. <div>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1257. </div>
  1258. </template>
  1259. </el-table-column>
  1260. </el-table>
  1261. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1262. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1263. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1264. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1265. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1266. </div>
  1267. </el-dialog>
  1268. <!-- 按部门选择人员 -->
  1269. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1270. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1271. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1272. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1273. </el-input>
  1274. <div class="tree" style="height:400px">
  1275. <el-scrollbar style="height:100%">
  1276. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1277. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1278. highlight-current :filter-node-method="filterNode">
  1279. <span class="custom-tree-node" slot-scope="{ node }">
  1280. <span v-if="user.userNameNeedTranslate == '1'">
  1281. <span v-if="node.data.children">
  1282. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1283. </span>
  1284. <span v-else>
  1285. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1286. </span>
  1287. </span>
  1288. <span v-if="user.userNameNeedTranslate != '1'">
  1289. {{ node.label }}
  1290. </span>
  1291. <!-- {{ node.label }} -->
  1292. </span>
  1293. </el-tree>
  1294. </el-scrollbar>
  1295. </div>
  1296. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1297. <div slot="footer" class="dialog-footer">
  1298. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1299. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1300. </div>
  1301. </el-dialog>
  1302. <el-dialog
  1303. v-if="monthWorkTimeDialog"
  1304. :visible.sync="monthWorkTimeDialog"
  1305. :close-on-click-modal="false"
  1306. customClass="customWidth selectworktime"
  1307. width="1200px"
  1308. title=""
  1309. >
  1310. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1311. <el-tabs v-model="activeName" @tab-click="handleClick">
  1312. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1313. <div class="selectworktime_export" style="margin-top:10px;">
  1314. <div class="selectworktime_export_l">
  1315. <el-date-picker
  1316. class="selecteworktime_datapick"
  1317. v-model="WorktimeDatepickValue"
  1318. value-format="yyyy-MM-dd"
  1319. type="daterange"
  1320. align="right"
  1321. unlink-panels
  1322. :range-separator="$t('other.to')"
  1323. :start-placeholder="$t('time.startDate')"
  1324. :end-placeholder="$t('time.endDate')"
  1325. :default-time="['12:00:00', '12:00:00']"
  1326. size="small"
  1327. popper-class="selecteorktime_datapick_popper"
  1328. @change="showMonthWorkTime()"
  1329. >
  1330. </el-date-picker>
  1331. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1332. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1333. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1334. <!-- 222 -->
  1335. </div>
  1336. <div>
  1337. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1338. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1339. </el-input>
  1340. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1341. </div>
  1342. <div style="float: right; vertical-align: middle;height:32px">
  1343. <el-link
  1344. v-if="user.companyId==5978"
  1345. type="primary"
  1346. @click="changeReminder()"
  1347. >{{'变更提醒'}}</el-link
  1348. >
  1349. <el-link
  1350. type="primary"
  1351. @click="exportMembWorkHours()"
  1352. >{{$t('export.exportData')}}</el-link
  1353. >
  1354. </div>
  1355. </div>
  1356. <el-table ref="hasworkTbl"
  1357. :data="monthWorkDataS"
  1358. v-el-table-infinite-scroll="listScroll"
  1359. border
  1360. :height="500"
  1361. highlight-current-row
  1362. style="width: 100%"
  1363. v-loading="tbload"
  1364. :lazy="true"
  1365. >
  1366. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1367. <template slot-scope="scope">
  1368. {{ scope.$index + 1 }}
  1369. </template>
  1370. </el-table-column>
  1371. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1372. <template slot-scope="scope">
  1373. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1374. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1375. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1376. <!-- {{scope.row.name}} -->
  1377. </span>
  1378. </template>
  1379. </el-table-column>
  1380. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1381. <template slot-scope="scope">
  1382. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1383. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1384. </template>
  1385. </el-table-column>
  1386. <el-table-column
  1387. min-width="105"
  1388. v-for="(item, index) in pickDateArray"
  1389. :key="index"
  1390. :label="item.label"
  1391. align="center"
  1392. >
  1393. <template slot-scope="scope">
  1394. <div
  1395. style="color: red"
  1396. v-if="
  1397. scope.row.worktimeList.filter(
  1398. (w) =>
  1399. w.createDate==item.date
  1400. ).length > 0 &&
  1401. scope.row.worktimeList.filter(
  1402. (w) =>w.createDate==item.date
  1403. )[0].workingTime < reportTimeType.allday
  1404. "
  1405. >
  1406. {{
  1407. scope.row.worktimeList.filter(
  1408. (w) =>w.createDate==item.date
  1409. )[0].workingTime.toFixed(1)
  1410. }}
  1411. </div>
  1412. <div
  1413. style="color: #20a0ff"
  1414. v-if="
  1415. scope.row.worktimeList.filter(
  1416. (w) =>w.createDate==item.date
  1417. ).length > 0 &&
  1418. scope.row.worktimeList.filter(
  1419. (w) =>w.createDate==item.date
  1420. )[0].workingTime > reportTimeType.allday
  1421. "
  1422. >
  1423. {{
  1424. scope.row.worktimeList.filter(
  1425. (w) =>w.createDate==item.date
  1426. )[0].workingTime.toFixed(1)
  1427. }}
  1428. </div>
  1429. <div
  1430. v-if="
  1431. scope.row.worktimeList.filter(
  1432. (w) =>w.createDate==item.date
  1433. ).length > 0 &&
  1434. scope.row.worktimeList.filter(
  1435. (w) =>w.createDate==item.date
  1436. )[0].workingTime == reportTimeType.allday
  1437. "
  1438. >
  1439. {{
  1440. scope.row.worktimeList.filter(
  1441. (w) =>w.createDate==item.date
  1442. )[0].workingTime
  1443. }}
  1444. </div>
  1445. <div
  1446. v-if="
  1447. scope.row.worktimeList.filter(
  1448. (w) =>w.createDate==item.date
  1449. ).length == 0
  1450. "
  1451. >
  1452. 0
  1453. </div>
  1454. <div
  1455. v-if="
  1456. scope.row.worktimeList.filter(
  1457. (w) =>w.createDate==item.date
  1458. ).length > 0 &&
  1459. typeof scope.row.worktimeList.filter(
  1460. (w) =>w.createDate==item.date
  1461. )[0].workingTime == 'string'
  1462. "
  1463. >
  1464. {{
  1465. scope.row.worktimeList.filter(
  1466. (w) =>w.createDate==item.date
  1467. )[0].workingTime
  1468. }}
  1469. </div>
  1470. </template>
  1471. </el-table-column>
  1472. </el-table>
  1473. <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>
  1474. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1475. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1476. <label style="font-size: 16px">员工每日已填报工时数</label>
  1477. <el-link
  1478. type="primary"
  1479. style="float: right; margin-right: 60px"
  1480. @click="exportMembWorkHours()"
  1481. >导出已填报数据</el-link
  1482. > -->
  1483. <!-- <el-button >导出</el-button> -->
  1484. <!-- </div> -->
  1485. </el-tab-pane>
  1486. <el-tab-pane label="未提交人员列表" name="second" >
  1487. <div class="selectworktime_export" style="margin-top:10px">
  1488. <div class="selectworktime_export_l">
  1489. <el-date-picker
  1490. class="selecteworktime_datapick"
  1491. v-model="WorktimeDatepickValue"
  1492. value-format="yyyy-MM-dd"
  1493. type="daterange"
  1494. align="right"
  1495. unlink-panels
  1496. :range-separator="$t('other.to')"
  1497. :start-placeholder="$t('time.startDate')"
  1498. :end-placeholder="$t('time.endDate')"
  1499. :default-time="['12:00:00', '12:00:00']"
  1500. size="small"
  1501. popper-class="selecteorktime_datapick_popper"
  1502. @change="showMonthNotWorkTime()"
  1503. >
  1504. </el-date-picker>
  1505. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1506. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1507. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1508. </div>
  1509. <div>
  1510. <div style="margin-top:10px;">
  1511. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1512. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1513. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1514. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1515. </el-input>
  1516. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1517. <el-link
  1518. type="primary"
  1519. style="float: right; vertical-align: middle;height:32px"
  1520. @click="exportMembNotWorkHours()"
  1521. >{{$t('export.exportData')}}</el-link
  1522. >
  1523. </div>
  1524. </div>
  1525. </div>
  1526. <el-table
  1527. ref="hasworkTbl2"
  1528. :data="monthNotWorkDateS"
  1529. v-el-table-infinite-scroll="notListScroll"
  1530. border
  1531. :height="500"
  1532. highlight-current-row
  1533. style="width: 100%"
  1534. v-loading="tbload"
  1535. lazy
  1536. >
  1537. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1538. <template slot-scope="scope">
  1539. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1540. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1541. </template>
  1542. </el-table-column>
  1543. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1544. <template slot-scope="scope">
  1545. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1546. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1547. </template>
  1548. </el-table-column>
  1549. <el-table-column
  1550. min-width="200"
  1551. :label="$t('weekDay.date')"
  1552. align="center"
  1553. prop="createDate"
  1554. >
  1555. </el-table-column>
  1556. <el-table-column
  1557. min-width="200"
  1558. :label="$t('state.states')"
  1559. align="center"
  1560. prop="status"
  1561. />
  1562. <el-table-column
  1563. min-width="200"
  1564. :label="$t('other.attendanceData')"
  1565. prop="cardTime"
  1566. align="center"
  1567. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1568. </el-table>
  1569. <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>
  1570. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1571. </el-tab-pane>
  1572. </el-tabs>
  1573. </el-dialog>
  1574. <!--驳回弹出框 -->
  1575. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1576. <div>
  1577. <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')" />
  1578. </div>
  1579. <div slot="footer" class="dialog-footer">
  1580. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1581. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1582. </div>
  1583. </el-dialog>
  1584. <!-- 通过弹出框 -->
  1585. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1586. <div>
  1587. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1588. </div>
  1589. <div slot="footer" class="dialog-footer">
  1590. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1591. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1592. </div>
  1593. </el-dialog>
  1594. <!--批量导入日报 -->
  1595. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1596. <p>1. {{$t('other.download')}}
  1597. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1598. </p>
  1599. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1600. <p style="display: flex;justify-content: center;">
  1601. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1602. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1603. </el-upload>
  1604. </p>
  1605. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1606. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1607. </div>
  1608. </el-dialog>
  1609. <!-- 工时导入记录弹窗 -->
  1610. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1611. <div style="height: 452px">
  1612. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1613. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1614. <el-table-column prop="userName" :label="$t('other.operator')">
  1615. <template slot-scope="scope">
  1616. <div>
  1617. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1618. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1619. </div>
  1620. </template>
  1621. </el-table-column>
  1622. <el-table-column prop="datel" :label="$t('other.document')">
  1623. <template slot-scope="scope">
  1624. <div>
  1625. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1626. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1627. </div>
  1628. </template>
  1629. </el-table-column>
  1630. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1631. <template slot-scope="scope">
  1632. <div>
  1633. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1634. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1635. </div>
  1636. </template>
  1637. </el-table-column>
  1638. </el-table>
  1639. <el-col :span="24" class="paginatis">
  1640. <el-pagination
  1641. @size-change="handleSizeChange"
  1642. @current-change="handleCurrentChange"
  1643. :page-sizes="[20 , 50 , 80 , 100]"
  1644. :page-size="20"
  1645. layout="total, sizes, prev, pager, next"
  1646. :total="toViewForm.total"
  1647. style="float:right;"
  1648. ></el-pagination>
  1649. </el-col>
  1650. </div>
  1651. </el-dialog>
  1652. <!--基于企业微信考勤数据的工时导入 -->
  1653. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1654. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1655. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1656. </el-step>
  1657. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1658. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1659. </el-steps>
  1660. <div v-if="active==0" style="padding:30px;height:360px;">
  1661. <div style="margin-top:50px;margin-left:280px;">
  1662. <el-date-picker
  1663. v-model="importWxParam.date" :editable="false"
  1664. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1665. :clearable="true"
  1666. :range-separator="$t('other.to')"
  1667. type="daterange"
  1668. :start-placeholder="$t('time.startDate')"
  1669. :end-placeholder="$t('time.endDate')"
  1670. @change="loadCheckInData"
  1671. ></el-date-picker>
  1672. </div>
  1673. </div>
  1674. <div v-if="active==1" style="padding:10px;">
  1675. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1676. style="width: 100%;margin-top:5px;" >
  1677. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1678. <template slot-scope="scope">
  1679. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1680. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1681. </template>
  1682. </el-table-column>
  1683. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1684. </el-table-column>
  1685. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1686. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1687. <template slot-scope="scope">
  1688. <div>
  1689. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1690. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1691. </div>
  1692. </template>
  1693. </el-table-column>
  1694. <el-table-column prop="departmentName" label="部门" >
  1695. <template slot-scope="scope">
  1696. <div>
  1697. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1698. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1699. </div>
  1700. </template>
  1701. </el-table-column>
  1702. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1703. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1704. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1705. <template slot-scope="scope">
  1706. {{scope.row.workHours.toFixed(1)}}h
  1707. </template>
  1708. </el-table-column>
  1709. </el-table>
  1710. </div>
  1711. <div v-if="active==2" >
  1712. <p style="display: flex;justify-content: center;height:390px;">
  1713. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1714. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1715. </el-upload>
  1716. </p>
  1717. </div>
  1718. <div slot="title">
  1719. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1720. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1721. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1722. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1723. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1724. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1725. </div>
  1726. <span slot="footer">
  1727. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1728. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1729. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1730. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1731. </span>
  1732. </el-dialog>
  1733. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1734. <p style="display: flex;justify-content: center;height:100px;">
  1735. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1736. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1737. </el-upload>
  1738. </p>
  1739. </el-dialog>
  1740. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1741. <div>
  1742. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1743. v-model="deleteReportParam.date" :editable="false"
  1744. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1745. :clearable="true"
  1746. :range-separator="$t('other.to')"
  1747. type="daterange"
  1748. :start-placeholder="$t('time.startDate')"
  1749. :end-placeholder="$t('time.endDate')"
  1750. ></el-date-picker>
  1751. </div>
  1752. <div style="margin-top:10px;">
  1753. <span>请选择部门:</span>
  1754. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1755. <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>
  1756. </div>
  1757. <div style="margin-top:10px;">
  1758. <span>请选择员工:</span>
  1759. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1760. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1761. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1762. <span v-else>{{item.name}}</span>
  1763. </el-option>
  1764. </el-select>
  1765. </div>
  1766. <span slot="footer">
  1767. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1768. </span>
  1769. </el-dialog>
  1770. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1771. <div>
  1772. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1773. v-model="deleteReportParam.date" :editable="false"
  1774. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1775. :clearable="true"
  1776. :range-separator="$t('other.to')"
  1777. type="daterange"
  1778. :start-placeholder="$t('time.startDate')"
  1779. :end-placeholder="$t('time.endDate')"
  1780. ></el-date-picker>
  1781. </div>
  1782. <div style="margin-top:15px;">
  1783. <span>选择部门:</span>
  1784. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1785. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1786. size="small" v-if="user.userNameNeedTranslate != 1"
  1787. ></el-cascader>
  1788. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1789. </div>
  1790. <span slot="footer">
  1791. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1792. </span>
  1793. </el-dialog>
  1794. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1795. <div>
  1796. <span>选择时间:</span><el-date-picker
  1797. v-model="modImportTime"
  1798. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1799. :clearable="true"
  1800. type="datetime"
  1801. ></el-date-picker>
  1802. <span>选择导入人员:</span><el-select
  1803. v-model="modImportUserId"
  1804. >
  1805. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1806. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1807. <span v-else>{{item.name}}</span>
  1808. </el-option>
  1809. </el-select>
  1810. </div>
  1811. <span slot="footer">
  1812. <el-button @click="confirmChangeModTime" >确认</el-button>
  1813. </span>
  1814. </el-dialog>
  1815. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1816. <div>
  1817. <span>请选择年月:</span>
  1818. <el-date-picker
  1819. v-model="ratioYmonth" :editable="false"
  1820. format="yyyyMM" value-format="yyyyMM"
  1821. type="month"
  1822. ></el-date-picker>
  1823. </div>
  1824. <span slot="footer">
  1825. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1826. </span>
  1827. </el-dialog>
  1828. <!--工时批量代填 -->
  1829. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1830. <div>
  1831. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1832. v-model="importWxParam.date" :editable="false"
  1833. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1834. :clearable="true"
  1835. :range-separator="$t('other.to')"
  1836. type="daterange"
  1837. :start-placeholder="$t('time.startDate')"
  1838. :end-placeholder="$t('time.endDate')"
  1839. @change="loadCheckInData"
  1840. ></el-date-picker>
  1841. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1842. </div>
  1843. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1844. :key="timeStamp"
  1845. style="width: 100%;margin-top:5px;" ref="tab">
  1846. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1847. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1848. <template slot-scope="scope">
  1849. <div>
  1850. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1851. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1852. </div>
  1853. </template>
  1854. </el-table-column>
  1855. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1856. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1857. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1858. <template slot-scope="scope">
  1859. {{scope.row.workHours.toFixed(1)}}h
  1860. </template>
  1861. </el-table-column>
  1862. <!--项目名称列表 -->
  1863. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1864. <template slot-scope="scope">
  1865. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1866. </template>
  1867. </el-table-column>
  1868. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1869. <template slot-scope="scope">
  1870. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1871. </template>
  1872. </el-table-column>
  1873. </el-table>
  1874. </el-dialog>
  1875. <!--基于企业微信考勤数据的工时导入 -->
  1876. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1877. <div style="padding-bottom:10px;">
  1878. <p>{{importResultMsg}}</p>
  1879. </div>
  1880. <!-- <span slot="footer" class="dialog-footer">
  1881. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1882. </span> -->
  1883. </el-dialog>
  1884. <!-- 审核流程展示 -->
  1885. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1886. <div style="padding:20px 40px 20px 0">
  1887. <el-timeline :reverse="false">
  1888. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1889. <!-- {{item.msg}} -->
  1890. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1891. <span v-if="user.userNameNeedTranslate == 1">
  1892. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1893. <span>{{item.msgCon.two}}</span>
  1894. </span>
  1895. </el-timeline-item>
  1896. </el-timeline>
  1897. </div>
  1898. </el-dialog>
  1899. </section>
  1900. </template>
  1901. <script>
  1902. // 左右滑动
  1903. import dragMixin from "@/common/js/tensile.js";
  1904. import util from "../../common/js/util";
  1905. // 自定义select组件
  1906. import selectCat from "@/components/select.vue"
  1907. // 引入自定义级联组件
  1908. import vueCascader from "@/components/cascader.vue"
  1909. // 重庆物奇定制组件
  1910. import WeeklyCustomization from "./weeklyCustomization.vue"
  1911. import { mapMutations } from 'vuex'
  1912. let _that = this
  1913. export default {
  1914. mixins: [dragMixin],
  1915. components: {
  1916. selectCat,
  1917. vueCascader,
  1918. WeeklyCustomization
  1919. },
  1920. data() {
  1921. return {
  1922. pageIndex: 0,
  1923. hasMore: true,
  1924. exportType: 0,
  1925. exportingData: false,
  1926. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1927. jobResponseList:[],
  1928. yisibeiCompId: 3092,
  1929. yuzhongCompId: 3385,
  1930. mingyiName : '成都明夷电子科技有限公司',
  1931. // mingyiName : '明夷',
  1932. modItemDataId: null,
  1933. modImportTime: null,
  1934. modImportUserId: null,
  1935. showModImportTimeDialog: false,
  1936. showBatchSimpleApproveReport: false,
  1937. startDeleting: false,
  1938. showBatchDeleteReport: false,
  1939. deleteReportParam: {date:null, userIds:[]},
  1940. isDenying: false,
  1941. targetWeekDate: null,//填写周报中的周日期
  1942. importCardTimeVisi: false,
  1943. startRatioExporting: false,
  1944. exportUserRatio: false,
  1945. ratioYmonth:null,
  1946. hasWrittenReport: false,
  1947. today:null,
  1948. syncTimeLoading: false,
  1949. seluserText: '',
  1950. translation: '1', // 1、文字, 2、部门, 3、人员
  1951. exportLoad: false,
  1952. getPickerOptions: {
  1953. disabledDate: (time) => {
  1954. var date = new Date();
  1955. var year = date.getFullYear();
  1956. var month = date.getMonth() + 1;
  1957. if (month >= 1 && month <= 9) {
  1958. month = "0" + month;
  1959. }
  1960. var currentdate = year.toString() + month.toString();
  1961. var timeyear = time.getFullYear();
  1962. var timemonth = time.getMonth() + 1;
  1963. if (timemonth >= 1 && timemonth <= 9) {
  1964. timemonth = "0" + timemonth;
  1965. }
  1966. var timedate = timeyear.toString() + timemonth.toString();
  1967. if(this.user.timeType.fillAhead == 0){
  1968. return currentdate < timedate;
  1969. }else{
  1970. return false
  1971. }
  1972. }
  1973. },
  1974. alalal: '8.0',
  1975. timeBasecostList:null,
  1976. tbload: false,
  1977. exportTimeDialog: false,
  1978. searchKeyword: '',
  1979. monthWorkDataS: [],
  1980. monthNotWorkDateS: [],
  1981. pickDateArray:[],
  1982. WorktimeDatepickValue: [],
  1983. activeName:"first",
  1984. isLeave: 0,
  1985. submitingReport: false,
  1986. importResultMsg:null,
  1987. showImportResult:false,
  1988. importingData: false,
  1989. isDraft: 0,
  1990. timeStamp: 0,
  1991. projectColumns:[],
  1992. checkinLoading:false,
  1993. importWxParam:{date:null,},
  1994. active:0,
  1995. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1996. importWxDialog:false,
  1997. importDialog:false,
  1998. denyForm:null,
  1999. denyReasonDialog:false,
  2000. monthWorkTimeDialog: false,
  2001. isSubstitude:false,
  2002. isFill:false,
  2003. unFillList:[],
  2004. fillList:[],
  2005. fillMembList:[],
  2006. fillMembList_leave: [],
  2007. membListVisible: false,
  2008. isBatch:0,//是否是批量填报
  2009. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2010. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2011. 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')],
  2012. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2013. fillStatusList: [],
  2014. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2015. exportDialog:false,
  2016. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2017. subProjectList:[],
  2018. canEdit: true,
  2019. originCanEdit: true,
  2020. 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],
  2021. selectTime:null,
  2022. reportTimeType:{},
  2023. curDate:'',
  2024. isAllSelect: false,
  2025. approveDialogVisible:false,
  2026. deptId:null,
  2027. targetUid: null,
  2028. membCount:0,
  2029. selectState:"-1",
  2030. user: JSON.parse(sessionStorage.getItem("user")),
  2031. allUsersList: [],
  2032. showAddMore:false,
  2033. allDate: [],
  2034. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2035. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2036. choseDay: 0,
  2037. tableHeight: 0,
  2038. listLoading: false,
  2039. projectList: [], //项目列表
  2040. fillProjectList: [],
  2041. reportList: [], //日报列表
  2042. reportNames:[], //批量审批列表
  2043. selCon:[], //筛选条件
  2044. selProjectList:[], //筛选后项目列表
  2045. selConShow: true,
  2046. usersList: [], // 全部人员列表
  2047. usersListId: '', // 选中的人员id
  2048. dialogVisible: false, //项目弹窗
  2049. report: '',
  2050. workForm: {
  2051. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2052. domains: [{
  2053. id: null,
  2054. projectId: "",
  2055. workingTime: "",
  2056. timeType:0,
  2057. content: "",
  2058. state: 2,
  2059. multiWorktime:0,
  2060. worktimeList:[],
  2061. degreeId: null,
  2062. auditUserList: [],
  2063. }],
  2064. },
  2065. workRules: {
  2066. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2067. },
  2068. chooseParticipVisible: false,
  2069. logining: false,
  2070. isDisable: false,
  2071. timeType:[],
  2072. deptMembData: [
  2073. ],
  2074. //部门人员树状结构
  2075. data: [
  2076. {
  2077. id: -1,
  2078. label: this.$t('lable.allStaff'),
  2079. membCount:0
  2080. },
  2081. {
  2082. id: 0,
  2083. label: this.$t('lable.unassigned'),
  2084. }
  2085. ],
  2086. allData:{},
  2087. batchShowData:{},
  2088. option: [],
  2089. deptOptionList: [],
  2090. depData: {
  2091. id: -1,
  2092. label: this.$t('lable.allStaff'),
  2093. },
  2094. defaultProps: {
  2095. children: 'children',
  2096. label: 'label'
  2097. },
  2098. isNew: false,
  2099. selected: false,
  2100. valuet: new Date(),
  2101. domObj: null,
  2102. participator:[],
  2103. chosenMembCount:0,
  2104. jsDay: 0,
  2105. jsTime: 0,
  2106. falsss: false,
  2107. weidu: [],
  2108. weiduList: [],
  2109. yonghuUser: [],
  2110. dateAr: [],
  2111. batchSubFillDialog: false,
  2112. isSubstiS: false,
  2113. fillWeekDialogVisi: false,
  2114. fillWeekDialogVisiCustom: false,
  2115. zhoData: [],
  2116. weekDateRange: [],
  2117. btnZho: false,
  2118. weekDataLoading: false,
  2119. changdu: 6,
  2120. tianxieDialogVisible: false,
  2121. scopess: {},
  2122. zhoBao: {
  2123. time: '',
  2124. workingTime: '',
  2125. progress: '',
  2126. con: '',
  2127. subProjectId: '',
  2128. stage: '',
  2129. subProjectList: [],
  2130. stages: [],
  2131. },
  2132. zhoBaoIdx: '',
  2133. zhoBaoName: '',
  2134. zhis: {},
  2135. dealList: [],
  2136. toViewDialogVisible: false,
  2137. toViewList: [],
  2138. toViewloading: true,
  2139. toViewForm: {
  2140. pageIndex: '1',
  2141. pageSize: '20',
  2142. total: 0,
  2143. },
  2144. toViewloadings: false,
  2145. tabPositionss: 'top',
  2146. monthTotal: 0,
  2147. monthTotalPage: 0,
  2148. monthTotalLages: 20,
  2149. monthWorkData: [],
  2150. monthNotWorkDate: [],
  2151. monthWorkDataS1: [],
  2152. monthnotTotal: 0,
  2153. monthnotTotalPage: 0,
  2154. monthnotTotalLages: 20,
  2155. monthNotWorkDateS1: [],
  2156. deptMembDataText: '',
  2157. isFlag: false,
  2158. isMore: false,
  2159. stateKey: '0',
  2160. expandDate: [],
  2161. notifySelList:[],
  2162. departmentList: [],
  2163. approvalProcessDialog: false,
  2164. approvalProcessData: [],
  2165. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2166. 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')],
  2167. isWeekend: false,
  2168. canCancelInDialog: false,
  2169. approveinData: {},
  2170. approveinDialog: false,
  2171. reportCanDelete: false,
  2172. weeklyFilledTimeDialog: false,
  2173. weeklyFilledTimeList: [],
  2174. weeklyFilledTimeLoading: false,
  2175. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2176. weeklyFilledTimeCanDelete: false,
  2177. weeklyFilledTimeDate: null,
  2178. leaveAllNum: 0,
  2179. dataLoading: false,
  2180. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2181. vacationTime: {},
  2182. integrationProjectList: [],
  2183. totalReportHours: 0, // 合计的工时
  2184. workTimeForMinYi:0,
  2185. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2186. weekIndex: 1,
  2187. weekParentData: {},
  2188. deptIdForNoReport:[],
  2189. nameAearch: '', // 企业微信姓名搜索
  2190. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2191. deptMembDataLoading: false,
  2192. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2193. {
  2194. id: 4811,
  2195. // id: 10,
  2196. name: '陕西柘中建设工程有限公司'
  2197. }
  2198. ],
  2199. pushWorkTimeLogDig:false,
  2200. pushWorkTimeLogData:[],
  2201. };
  2202. },
  2203. watch: {
  2204. deptMembDataText(val) {
  2205. this.$refs.chooseMembTree.filter(val);
  2206. }
  2207. },
  2208. filters: {
  2209. // 过滤
  2210. amounts(value) {
  2211. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2212. return 0
  2213. }
  2214. var zhi = +value + 0
  2215. return zhi.toFixed(1)
  2216. },
  2217. // zhoData
  2218. zhoData(value, arr) {
  2219. var dateArray = value.split("-");
  2220. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2221. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2222. // console.log(arr[date.getDay()])
  2223. // return "周" + "日一二三四五六".charAt(date.getDay());
  2224. return arr[date.getDay()]
  2225. },
  2226. // 过滤数字
  2227. numbers(value) {
  2228. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2229. return 0
  2230. }
  2231. return value
  2232. },
  2233. },
  2234. computed: {},
  2235. mounted() {
  2236. var now = new Date();
  2237. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2238. this.today = t;
  2239. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2240. this.exportParam.dateRange = [startStr,t];
  2241. this.getAllDate(1);
  2242. this.getReportList();
  2243. this.getProjectList();
  2244. this.getFillProjectList();
  2245. this.getTimeType();
  2246. this.getDepartment();
  2247. this.scrollFunction()
  2248. this.userssHu();
  2249. if(this.user.timeType.reportAuditType == 3){
  2250. this.getAllUsersList()
  2251. }
  2252. if (this.user.company.packageProject == 1) {
  2253. this.getBasecostItemList();
  2254. }
  2255. if(this.user.timeType.lockWorktime){
  2256. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2257. }
  2258. //设置了下限
  2259. if (this.user.timeType.minReportTime) {
  2260. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2261. }
  2262. const that = this
  2263. if(this.user.userNameNeedTranslate == 1) {
  2264. that.dataLoading = that.$store.state.dataLoading
  2265. this.upDataLoading()
  2266. setTimeout(()=>{
  2267. that.dataLoading = that.$store.state.dataLoading
  2268. }, 1000)
  2269. }
  2270. if (this.user.companyId == this.yuzhongCompId) {
  2271. this.getJobResponList();
  2272. }
  2273. },
  2274. methods: {
  2275. ...mapMutations(['upDataLoading']),
  2276. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2277. isCustomization(userInfo, permissionArray) {
  2278. const { companyId } = userInfo
  2279. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2280. return isReportPictureRequired
  2281. },
  2282. //任务被选中
  2283. onTaskSelected(domainItem) {
  2284. //取服务
  2285. if (domainItem.taskId) {
  2286. var that = this;
  2287. var param = {taskId:domainItem.taskId};
  2288. if (this.isSubstitude) {
  2289. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2290. param.userId = this.workForm.userId[0];
  2291. }
  2292. }
  2293. this.http.post('/task/getMyTaskService',param, res => {
  2294. if (res.code == "ok") {
  2295. // domainItem.workContentList = res.data;
  2296. that.$set(domainItem, 'sapServiceId', null);
  2297. that.$set(domainItem, 'serviceList', res.data);
  2298. } else {
  2299. this.$message({
  2300. message: res.msg,
  2301. type: "error"
  2302. });
  2303. }
  2304. },error => {
  2305. this.$message({
  2306. message: error,
  2307. type: "error"
  2308. });
  2309. }
  2310. );
  2311. } else {
  2312. //清空服务
  2313. }
  2314. },
  2315. onBatchTimeChange() {
  2316. //反向计算每日工作时长
  2317. if (this.workForm.createDate) {
  2318. let sdate = new Date(this.workForm.createDate[0]);
  2319. let edate = new Date(this.workForm.createDate[1]);
  2320. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2321. console.log('days===', days)
  2322. if (days < 0) {
  2323. return;
  2324. }
  2325. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2326. //总时长发生改变,自动按比例计算
  2327. this.workForm.domains.forEach(d=>{
  2328. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2329. });
  2330. }
  2331. },
  2332. //更新工作内容列表
  2333. updateJobContent(domainItem) {
  2334. var that = this;
  2335. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2336. if (res.code == "ok") {
  2337. // domainItem.workContentList = res.data;
  2338. that.$set(domainItem, 'extraField3', null);
  2339. that.$set(domainItem, 'workContentList', res.data);
  2340. } else {
  2341. this.$message({
  2342. message: res.msg,
  2343. type: "error"
  2344. });
  2345. }
  2346. },error => {
  2347. this.$message({
  2348. message: error,
  2349. type: "error"
  2350. });
  2351. }
  2352. );
  2353. },
  2354. updateResponse(domainItem) {
  2355. var that = this;
  2356. var selectPid = domainItem.projectId;
  2357. domainItem.extraField2 = null;
  2358. domainItem.extraField3 = null;
  2359. if (selectPid && domainItem.extraField1) {
  2360. //是否非项目
  2361. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2362. console.log('==========','isPublic=='+isPublic);
  2363. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2364. console.log(filteredRespList);
  2365. domainItem.filteredRespList = filteredRespList;
  2366. }
  2367. },
  2368. getJobResponList() {
  2369. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2370. if (res.code == "ok") {
  2371. this.jobResponseList = res.data;
  2372. } else {
  2373. this.$message({
  2374. message: res.msg,
  2375. type: "error"
  2376. });
  2377. }
  2378. },error => {
  2379. this.$message({
  2380. message: error,
  2381. type: "error"
  2382. });
  2383. }
  2384. );
  2385. },
  2386. openModImportTime(row) {
  2387. this.showModImportTimeDialog = true;
  2388. this.modItemDataId = row.id;
  2389. },
  2390. delImportTime(row) {
  2391. let rowId = row.id;
  2392. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2393. confirmButtonText: this.$t('btn.determine'),
  2394. cancelButtonText: this.$t('btn.cancel'),
  2395. type: "warning"
  2396. })
  2397. .then(() => {
  2398. this.http.post('/report-import-log/delete',{
  2399. id: rowId
  2400. },res => {
  2401. if (res.code == "ok") {
  2402. this.$message({
  2403. message: '删除成功',
  2404. type: "success"
  2405. });
  2406. this.getToView();
  2407. } else {
  2408. this.$message({
  2409. message: res.msg,
  2410. type: "error"
  2411. });
  2412. }
  2413. },error => {
  2414. this.$message({
  2415. message: error,
  2416. type: "error"
  2417. });
  2418. }
  2419. );
  2420. }).catch(() => {this.startDeleting = false});
  2421. },
  2422. confirmChangeModTime() {
  2423. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2424. this.$message({
  2425. message: '请选择时间',
  2426. type: "error"
  2427. });
  2428. return;
  2429. }
  2430. this.http.post('/report-import-log/changeTime',{
  2431. modLogDateTime: this.modImportTime,
  2432. modImportUserId: this.modImportUserId,
  2433. id: this.modItemDataId
  2434. },res => {
  2435. if (res.code == "ok") {
  2436. this.$message({
  2437. message: '修改成功',
  2438. type: "success"
  2439. });
  2440. this.getToView();
  2441. this.showModImportTimeDialog = false;
  2442. } else {
  2443. this.$message({
  2444. message: res.msg,
  2445. type: "error"
  2446. });
  2447. }
  2448. },error => {
  2449. this.$message({
  2450. message: error,
  2451. type: "error"
  2452. });
  2453. }
  2454. );
  2455. },
  2456. confirmBatchApproveReport() {
  2457. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2458. this.$message({
  2459. message: '请选择日期范围',
  2460. type: "error"
  2461. });
  2462. return;
  2463. }
  2464. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2465. confirmButtonText: this.$t('btn.determine'),
  2466. cancelButtonText: this.$t('btn.cancel'),
  2467. type: "warning"
  2468. })
  2469. .then(() => {
  2470. this.startDeleting = true;
  2471. let obj = {
  2472. startDate: this.deleteReportParam.date[0],
  2473. endDate: this.deleteReportParam.date[1]
  2474. }
  2475. if(this.deleteReportParam.departmentId) {
  2476. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2477. } else {
  2478. obj.departmentId = null
  2479. }
  2480. this.http.post('/report/batchApproveByDate',obj,res => {
  2481. if (res.code == "ok") {
  2482. this.$message({
  2483. message: '审核通过',
  2484. type: "success"
  2485. });
  2486. this.getReportList();
  2487. this.getDepartment();
  2488. this.startDeleting = false;
  2489. } else {
  2490. this.$message({
  2491. message: res.msg,
  2492. type: "error"
  2493. });
  2494. }
  2495. },error => {
  2496. this.$message({
  2497. message: error,
  2498. type: "error"
  2499. });
  2500. }
  2501. );
  2502. }).catch(() => {this.startDeleting = false});
  2503. },
  2504. confirmBatchDelReport() {
  2505. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2506. this.$message({
  2507. message: '请选择部门或人员',
  2508. type: "error"
  2509. });
  2510. return;
  2511. }
  2512. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2513. this.$message({
  2514. message: '请选择日期范围',
  2515. type: "error"
  2516. });
  2517. return;
  2518. }
  2519. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2520. confirmButtonText: this.$t('btn.determine'),
  2521. cancelButtonText: this.$t('btn.cancel'),
  2522. type: "warning"
  2523. })
  2524. .then(() => {
  2525. this.startDeleting = true;
  2526. this.http.post('/report/batchDelete',{
  2527. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2528. startDate: this.deleteReportParam.date[0],
  2529. endDate: this.deleteReportParam.date[1],
  2530. deptId: this.deleteReportParam.deptId[0]
  2531. },res => {
  2532. if (res.code == "ok") {
  2533. this.$message({
  2534. message: this.$t('message.successfullyDeleted'),
  2535. type: "success"
  2536. });
  2537. this.getReportList();
  2538. this.getDepartment();
  2539. this.startDeleting = false;
  2540. } else {
  2541. this.$message({
  2542. message: res.msg,
  2543. type: "error"
  2544. });
  2545. }
  2546. },error => {
  2547. this.$message({
  2548. message: error,
  2549. type: "error"
  2550. });
  2551. }
  2552. );
  2553. }).catch(() => {this.startDeleting = false});
  2554. },
  2555. getRecentlyProject() {
  2556. this.http.post('/project/nearProject',{},res => {
  2557. if(res.code == 'ok'){
  2558. let topObj = {
  2559. label: '最近选择项目',
  2560. peojectList: res.data
  2561. }
  2562. let botomObj = {
  2563. label: '全部项目',
  2564. peojectList: this.fillProjectList
  2565. }
  2566. //最近项目如果在fillProjectList中不存在,需要移除
  2567. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2568. this.integrationProjectList = [topObj, botomObj]
  2569. }else {
  2570. this.$message({
  2571. message: res.msg,
  2572. type: 'error'
  2573. })
  2574. }
  2575. },err => {
  2576. this.$message({
  2577. message: err,
  2578. type: 'error'
  2579. })
  2580. })
  2581. },
  2582. handlePictureCardPreview(file, index) {
  2583. console.log(file, index)
  2584. let arr = []
  2585. let imgArr = this.workForm.domains[index].imgListUrl
  2586. for(var i in imgArr) {
  2587. arr.push(imgArr[i].url)
  2588. }
  2589. console.log(arr, '图片数据')
  2590. const $viewer = this.$viewerApi({
  2591. images: arr
  2592. });
  2593. },
  2594. // 图片上传
  2595. addImg(e, index) {
  2596. console.log(e, '数据')
  2597. let formData = new FormData()
  2598. formData.append('multipartFile', e.file)
  2599. this.http.uploadFile('/common/uploadFile', formData,
  2600. res => {
  2601. if (res.code == "ok") {
  2602. this.$message({
  2603. message: this.$t('uploadedsuccessfully'),
  2604. type: "success"
  2605. });
  2606. if(!this.workForm.domains[index].imgList) {
  2607. this.workForm.domains[index].imgList = []
  2608. this.workForm.domains[index].imgListUrl = []
  2609. }
  2610. this.workForm.domains[index].imgList.push(res.data)
  2611. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2612. } else {
  2613. this.$message({message: res.msg,type: "error"});
  2614. }
  2615. console.log(this.workForm.domains[index])
  2616. },
  2617. error => {this.$message({message: error,type: "error"});
  2618. });
  2619. },
  2620. // 删除图片
  2621. delImg(file,fileList, index) {
  2622. console.log(file, fileList)
  2623. let idx = 0
  2624. for(let i in fileList) {
  2625. if(fileList[i].uid == file.uid) {
  2626. idx = i
  2627. }
  2628. }
  2629. this.workForm.domains[index].imgList.splice(idx, 1)
  2630. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2631. console.log(this.workForm.domains[index])
  2632. },
  2633. test(){
  2634. console.log('test',this.workForm.domains);
  2635. },
  2636. getHour(s1, s2) {
  2637. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2638. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2639. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2640. var ms = s2.getTime() - s1.getTime();
  2641. if (ms < 0) return 0;
  2642. let ma = ms / 1000 / 60 / 60
  2643. return ma; //小时
  2644. },
  2645. refreshWXCardTime(workdate) {
  2646. if (!workdate) return;
  2647. this.syncTimeLoading = true;
  2648. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2649. date: workdate,
  2650. },res => {
  2651. this.syncTimeLoading = false;
  2652. if(res.code == 'ok'){
  2653. this.workForm.time = res.data.time;
  2654. }else {
  2655. this.$message({
  2656. message: res.msg,
  2657. type: 'error'
  2658. })
  2659. }
  2660. },err => {
  2661. this.syncTimeLoading = false;
  2662. this.$message({
  2663. message: err,
  2664. type: 'error'
  2665. })
  2666. })
  2667. },
  2668. refreshAttendance(workdate) {
  2669. if (!workdate) return;
  2670. this.syncTimeLoading = true;
  2671. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2672. startDate: workdate[0],
  2673. endDate: workdate[1]
  2674. },res => {
  2675. this.syncTimeLoading = false;
  2676. if(res.code == 'ok'){
  2677. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2678. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2679. this.totalReportHours = this.workTimeForMinYi;
  2680. }else {
  2681. this.$message({
  2682. message: res.msg,
  2683. type: 'error'
  2684. })
  2685. }
  2686. },err => {
  2687. this.syncTimeLoading = false;
  2688. this.$message({
  2689. message: err,
  2690. type: 'error'
  2691. })
  2692. })
  2693. },
  2694. refreshBeiSengAttendance(workdate) {
  2695. if (!workdate) return;
  2696. this.syncTimeLoading = true;
  2697. this.http.post('/user-with-beisen/syncAttendanceFromBeisen',{
  2698. startDate: workdate,
  2699. endDate: workdate
  2700. },res => {
  2701. this.syncTimeLoading = false;
  2702. if(res.code == 'ok'){
  2703. this.workForm.time = res.data;
  2704. }else {
  2705. this.$message({
  2706. message: res.msg,
  2707. type: 'error'
  2708. })
  2709. }
  2710. },err => {
  2711. this.syncTimeLoading = false;
  2712. this.$message({
  2713. message: err,
  2714. type: 'error'
  2715. })
  2716. })
  2717. },
  2718. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2719. this.weeklyFilledTimeDialog = true
  2720. this.weeklyFilledTimeLoading = true
  2721. this.weeklyFilledTimeDate = parameterDate
  2722. this.http.post('/report/getReportList',{
  2723. date: parameterDate,
  2724. userId: this.user.id
  2725. },res => {
  2726. this.weeklyFilledTimeLoading = false
  2727. if(res.code == 'ok'){
  2728. this.weeklyFilledTimeList = res.data[0].data
  2729. let candelete = true
  2730. for(let i in this.weeklyFilledTimeList){
  2731. if(this.weeklyFilledTimeList[i].state < 2){
  2732. candelete = false
  2733. }
  2734. }
  2735. this.weeklyFilledTimeCanDelete = candelete
  2736. }else {
  2737. this.$message({
  2738. message: res.msg,
  2739. type: 'error'
  2740. })
  2741. }
  2742. },err => {
  2743. this.weeklyFilledTimeLoading = false
  2744. this.$message({
  2745. message: err,
  2746. type: 'error'
  2747. })
  2748. })
  2749. },
  2750. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2751. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2752. confirmButtonText: this.$t('btn.determine'),
  2753. cancelButtonText: this.$t('btn.cancel'),
  2754. type: "warning"
  2755. })
  2756. .then(() => {
  2757. this.http.post('/report/delete',{
  2758. userId: this.user.id,
  2759. date: this.weeklyFilledTimeDate
  2760. },res => {
  2761. if (res.code == "ok") {
  2762. this.$message({
  2763. message: this.$t('message.successfullyDeleted'),
  2764. type: "success"
  2765. });
  2766. this.getWeeklyWorkTime()
  2767. this.getReportList();
  2768. this.getDepartment();
  2769. this.weeklyFilledTimeDialog = false;
  2770. } else {
  2771. this.$message({
  2772. message: res.msg,
  2773. type: "error"
  2774. });
  2775. }
  2776. },error => {
  2777. this.$message({
  2778. message: error,
  2779. type: "error"
  2780. });
  2781. }
  2782. );
  2783. }).catch(() => {});
  2784. },
  2785. getApprovalProcess(item){
  2786. // console.log('this.date',this.choseDate);
  2787. this.http.post('/report-log/get',{
  2788. creatorId: item.id,
  2789. createDate: sessionStorage.msg
  2790. },res => {
  2791. if(res.code == 'ok'){
  2792. this.approvalProcessDialog = true
  2793. if(this.user.userNameNeedTranslate == 1) {
  2794. for(var i in res.data) {
  2795. let obj = {
  2796. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2797. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2798. }
  2799. res.data[i].msgCon = obj
  2800. }
  2801. }
  2802. this.approvalProcessData = res.data
  2803. console.log(this.approvalProcessData, '数据卡看')
  2804. }else{
  2805. this.$message({
  2806. message: res.msg,
  2807. type: 'error'
  2808. })
  2809. }
  2810. },err => {
  2811. this.$message({
  2812. message: err,
  2813. type: 'error'
  2814. })
  2815. })
  2816. },
  2817. filterNode(value, data) {
  2818. if (!value) return true;
  2819. return data.label.indexOf(value) !== -1;
  2820. },
  2821. triggerCalculateOT(index) {
  2822. var str = this.workForm.domains[index].overtimeHours + ''
  2823. if(str.indexOf('.') != '-1') {
  2824. var s = str.split('.')[0]
  2825. var st = str.split('.')[1]
  2826. var sts = st.split('')
  2827. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2828. }
  2829. },
  2830. searchScreen(e){
  2831. if(e){
  2832. this.monthNotWorkDateS1 = []
  2833. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2834. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2835. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2836. }
  2837. }
  2838. if (this.monthNotWorkDateS1.length > 50) {
  2839. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2840. }else{
  2841. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2842. }
  2843. // if (this.monthNotWorkDateS1.length > 0) {
  2844. // setTimeout(() => {
  2845. // this.tableListenernot()
  2846. // }, 1000);
  2847. // }
  2848. }else{
  2849. this.monthWorkDataS1 = []
  2850. for (let i = 0; i < this.monthWorkData.length; i++) {
  2851. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2852. this.monthWorkDataS1.push(this.monthWorkData[i])
  2853. }
  2854. }
  2855. if (this.monthWorkDataS1.length > 50) {
  2856. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2857. }else{
  2858. this.monthWorkDataS = this.monthWorkDataS1
  2859. }
  2860. // if (this.monthWorkDataS1.length > 0) {
  2861. // setTimeout(() => {
  2862. // this.tableListener()
  2863. // }, 1000);
  2864. // }
  2865. }
  2866. },
  2867. addUpload(data) {
  2868. // var zhi = data.fileName.split('.')[0]
  2869. // var sss = zhi + '.xlsx'
  2870. // return
  2871. var filePath = '/upload/' + data.serverName;
  2872. const a = document.createElement('a'); // 创建a标签
  2873. a.setAttribute('download', data.fileName);// download属性
  2874. a.setAttribute('href', filePath);// href链接
  2875. a.click(); //自执行点击事件
  2876. a.remove();
  2877. },
  2878. restrictNumber(targetId) {
  2879. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2880. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2881. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2882. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2883. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2884. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2885. inpu.value = parseFloat(inpu.value);
  2886. }
  2887. },
  2888. //获取项目下的任务分组
  2889. getTaskGroups(domain, index) {
  2890. domain.groupId=null;
  2891. this.http.post('/task-group/listMyJoinGroup',{
  2892. projectId: domain.projectId,
  2893. isSubstitude: this.isSubstitude ? 1 : 0
  2894. },
  2895. res => {
  2896. if (res.code == "ok") {
  2897. this.workForm.domains[index].taskGroups = res.data;
  2898. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2899. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2900. // this.getGroupStages(domain, index);
  2901. // }
  2902. this.$forceUpdate();
  2903. }
  2904. },
  2905. error => {
  2906. this.$message({
  2907. message: error,
  2908. type: "error"
  2909. });
  2910. }
  2911. );
  2912. },
  2913. //下载填报工时占比报表
  2914. downloadProjectRatio() {
  2915. this.exportUserRatio = true;
  2916. // let now = new Date();
  2917. // let month = now.getMonth();//默认看上个月的
  2918. // let monthStr = month<10? ('0'+month): month;
  2919. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2920. const today = new Date();
  2921. const year = today.getFullYear();
  2922. const month = today.getMonth() + 1;
  2923. let lastMonthYear, lastMonth;
  2924. if (month === 1) {
  2925. lastMonthYear = year - 1;
  2926. lastMonth = 12;
  2927. } else {
  2928. lastMonthYear = year;
  2929. lastMonth = month - 1;
  2930. }
  2931. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2932. console.log('赋值 ==>', this.ratioYmonth)
  2933. },
  2934. confirmDownloadRatio() {
  2935. this.startRatioExporting = true;
  2936. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2937. ymonth: this.ratioYmonth
  2938. },
  2939. res => {
  2940. if (res.code == "ok") {
  2941. this.startRatioExporting = false;
  2942. var filePath = res.data;
  2943. const a = document.createElement('a'); // 创建a标签
  2944. var data = filePath.split("/");
  2945. a.setAttribute('download', data[data.length-1]);// download属性
  2946. a.setAttribute('href', filePath);// href链接
  2947. a.click(); //自执行点击事件
  2948. a.remove();
  2949. } else {
  2950. this.startRatioExporting = false;
  2951. this.$message({
  2952. message: res.msg,
  2953. type: "error"
  2954. });
  2955. }
  2956. },
  2957. error => {
  2958. this.checkinLoading = false;
  2959. this.$message({
  2960. message: error,
  2961. type: "error"
  2962. });
  2963. }
  2964. );
  2965. },
  2966. //下载带企业微信考勤数据的工时统计模板
  2967. downloadCheckInExcel() {
  2968. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2969. startDate: this.importWxParam.date[0],
  2970. endDate: this.importWxParam.date[1],
  2971. },
  2972. res => {
  2973. if (res.code == "ok") {
  2974. var filePath = res.data;
  2975. const a = document.createElement('a'); // 创建a标签
  2976. var data = filePath.split("/");
  2977. a.setAttribute('download', data[data.length-1]);// download属性
  2978. a.setAttribute('href', filePath);// href链接
  2979. a.click(); //自执行点击事件
  2980. a.remove();
  2981. } else {
  2982. this.$message({
  2983. message: res.msg,
  2984. type: "error"
  2985. });
  2986. }
  2987. },
  2988. error => {
  2989. this.checkinLoading = false;
  2990. this.$message({
  2991. message: error,
  2992. type: "error"
  2993. });
  2994. }
  2995. );
  2996. },
  2997. pre() {
  2998. if (this.active == 0) return;
  2999. this.active--;
  3000. },
  3001. next() {
  3002. this.active++;
  3003. },
  3004. triggerTotalTime(index) {
  3005. var item = this.checkinList[index];
  3006. var total = 0.0;
  3007. for (var i=0;i<this.projectColumns.length; i++) {
  3008. var key = this.projectColumns[i];
  3009. if (item[key] != null && item[key] != '') {
  3010. total += parseFloat(item[key]);
  3011. }
  3012. }
  3013. item.totalFillTime = total;
  3014. },
  3015. //提交批量代填的数据
  3016. submitBatchSubFillData() {
  3017. var data = JSON.stringify(this.checkinList);
  3018. this.http.post('/user-corpwx-time/submitProjectTime',{
  3019. json: data,
  3020. projectColumns: JSON.stringify(this.projectColumns)
  3021. },
  3022. res => {
  3023. if (res.code == "ok") {
  3024. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3025. this.importWxDialog = false;
  3026. }
  3027. },
  3028. error => {
  3029. this.checkinLoading = false;
  3030. this.$message({
  3031. message: error,
  3032. type: "error"
  3033. });
  3034. }
  3035. );
  3036. },
  3037. loadCheckInData() {
  3038. if (this.importWxParam.date == null) {
  3039. this.checkinList = [];
  3040. return;
  3041. }
  3042. this.checkinLoading = true;
  3043. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3044. startDate: this.importWxParam.date[0],
  3045. endDate: this.importWxParam.date[1],
  3046. },
  3047. res => {
  3048. if (res.code == "ok") {
  3049. this.checkinLoading = false;
  3050. this.checkinList = res.data.list;
  3051. this.projectColumns = res.data.projects;
  3052. // 自定义表格会导致表格错乱,需重新计算表格
  3053. this.$nextTick(()=>{
  3054. this.$refs.tab.doLayout()
  3055. })
  3056. }
  3057. },
  3058. error => {
  3059. this.checkinLoading = false;
  3060. this.$message({
  3061. message: error,
  3062. type: "error"
  3063. });
  3064. }
  3065. );
  3066. },
  3067. importCardTime(item) {
  3068. //首先判断文件类型
  3069. let str = item.file.name.split(".");
  3070. let format = str[str.length - 1];
  3071. if (format != "xls" && format != "xlsx") {
  3072. this.$message({
  3073. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3074. type: "error"
  3075. });
  3076. } else {
  3077. this.importingData = true;
  3078. let formData = new FormData();
  3079. formData.append("multipartFile", item.file);
  3080. formData.append("companyId", this.user.companyId);
  3081. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3082. res => {
  3083. this.$refs.uploadCardTime.clearFiles();
  3084. this.importingData = false;
  3085. if (res.code == "ok") {
  3086. //换成弹出框,以免有人等了半天回来啥也没看到
  3087. this.$message({
  3088. message: '导入考勤时长成功',
  3089. type: "success"
  3090. });
  3091. } else {
  3092. this.$message({
  3093. message: res.msg,
  3094. type: "error"
  3095. });
  3096. }
  3097. },
  3098. error => {
  3099. this.$refs.upload.clearFiles();
  3100. this.listLoading = false;
  3101. this.$message({
  3102. message: error,
  3103. type: "error"
  3104. });
  3105. });
  3106. }
  3107. },
  3108. batchImportWxData(item) {
  3109. //首先判断文件类型
  3110. let str = item.file.name.split(".");
  3111. let format = str[str.length - 1];
  3112. if (format != "xls" && format != "xlsx") {
  3113. this.$message({
  3114. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3115. type: "error"
  3116. });
  3117. } else {
  3118. this.importingData = true;
  3119. let formData = new FormData();
  3120. formData.append("file", item.file);
  3121. formData.append("companyId", this.user.companyId);
  3122. formData.append("withCheckIn", 1);
  3123. this.http.uploadFile('/report/importData', formData,
  3124. res => {
  3125. this.$refs.upload.clearFiles();
  3126. this.showImportResult = true;
  3127. this.importingData = false;
  3128. if (res.code == "ok") {
  3129. //换成弹出框,以免有人等了半天回来啥也没看到
  3130. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3131. this.getReportList();
  3132. this.importWxDialog = false;
  3133. } else {
  3134. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3135. }
  3136. },
  3137. error => {
  3138. this.$refs.upload.clearFiles();
  3139. this.listLoading = false;
  3140. this.$message({
  3141. message: error,
  3142. type: "error"
  3143. });
  3144. });
  3145. }
  3146. },
  3147. batchImportData(item) {
  3148. //首先判断文件类型
  3149. let str = item.file.name.split(".");
  3150. let format = str[str.length - 1];
  3151. if (format != "xls" && format != "xlsx") {
  3152. this.$message({
  3153. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3154. type: "error"
  3155. });
  3156. } else {
  3157. this.importingData = true;
  3158. let formData = new FormData();
  3159. formData.append("file", item.file);
  3160. formData.append("companyId", this.user.companyId);
  3161. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3162. this.http.uploadFile(url, formData,
  3163. res => {
  3164. this.$refs.upload.clearFiles();
  3165. this.importingData = false;
  3166. this.showImportResult = true;
  3167. if (res.code == "ok") {
  3168. //换成弹出框,以免有人等了半天回来啥也没看到
  3169. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3170. this.getReportList();
  3171. this.importWXDialog = false;
  3172. } else {
  3173. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3174. }
  3175. },
  3176. error => {
  3177. this.$refs.upload.clearFiles();
  3178. this.importingData = false;
  3179. this.$message({
  3180. message: error,
  3181. type: "error"
  3182. });
  3183. });
  3184. }
  3185. },
  3186. userssHu() {
  3187. this.http.post('/time-type/getCompanyTimeSetting',{
  3188. companyId: this.user.companyId
  3189. },
  3190. res => {
  3191. if (res.code == "ok") {
  3192. this.yonghuUser = res.data
  3193. }
  3194. },
  3195. error => {
  3196. this.$message({
  3197. message: error,
  3198. type: "error"
  3199. });
  3200. }
  3201. );
  3202. },
  3203. iptBlur(i) {
  3204. if(this.isBatch == 0) {
  3205. return
  3206. }
  3207. var reqParam = {
  3208. startDate: this.workForm.createDate[0],
  3209. endDate: this.workForm.createDate[1]
  3210. };
  3211. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3212. reqParam.userId = this.workForm.userId[0];
  3213. }
  3214. this.http.post('/report/getWorkDays',reqParam,
  3215. res => {
  3216. if (res.code == "ok") {
  3217. this.jsDay = res.data
  3218. this.chuji(i)
  3219. } else {
  3220. this.$message({
  3221. message: res.msg,
  3222. type: "error"
  3223. });
  3224. }
  3225. },
  3226. error => {
  3227. this.$message({
  3228. message: error,
  3229. type: "error"
  3230. });
  3231. }
  3232. );
  3233. //明夷硬编码获取
  3234. if (this.user.company.companyName == this.mingyiName) {
  3235. this.getWorkTimeForMinYi();
  3236. }
  3237. },
  3238. getWorkTimeForMinYi(){
  3239. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3240. startDate: this.workForm.createDate[0],
  3241. endDate: this.workForm.createDate[1]
  3242. },
  3243. res => {
  3244. if (res.code == "ok") {
  3245. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3246. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3247. this.totalReportHours = this.workTimeForMinYi;
  3248. } else {
  3249. this.$message({
  3250. message: res.msg,
  3251. type: "error"
  3252. });
  3253. this.workForm.createDate = [];
  3254. }
  3255. },
  3256. error => {
  3257. this.$message({
  3258. message: error,
  3259. type: "error"
  3260. });
  3261. }
  3262. );
  3263. },
  3264. chuji(i) {
  3265. if(i == 0) {
  3266. this.seleChn(1)
  3267. } else if(i == 1) {
  3268. this.seleChn(0)
  3269. } else if(i == 2) {
  3270. if(this.workForm.domains[0].multiWorktime > 0) {
  3271. this.iptChangs()
  3272. } else {
  3273. this.iptChang()
  3274. }
  3275. } else if(i == 3) {
  3276. this.seleChn(0)
  3277. }
  3278. },
  3279. seleChn(e,domain) {
  3280. if(e == 1) {
  3281. for(var i in this.workForm.domains) {
  3282. if(this.workForm.domains[i].timeType == 0) {
  3283. this.workForm.domains[i].workingTime = 8
  3284. } else {
  3285. this.workForm.domains[i].workingTime = 4
  3286. }
  3287. }
  3288. }
  3289. var quanbu = 0
  3290. var spl = this.workForm.domains
  3291. var zhi = ''
  3292. for(var i in spl) {
  3293. var sp = +spl[i].workingTime + 0
  3294. zhi = this.jsDay * sp
  3295. quanbu = +quanbu + zhi
  3296. }
  3297. this.jsTime = quanbu
  3298. this.totalReportHours = quanbu
  3299. let worktime = this.jsTime
  3300. // 自动计算加班时长
  3301. if(this.isBatch != 0){
  3302. worktime = this.jsTime / this.jsDay
  3303. }
  3304. if(this.user.timeType.fillOvertime && domain){
  3305. let isover = false
  3306. let alltime = 0
  3307. let allover = 0 //此处alltime同上面的worktime
  3308. for(let d in spl){
  3309. if(spl[d].isOvertime){
  3310. isover = true
  3311. allover += spl[d].overtimeHours*1
  3312. }
  3313. alltime += spl[d].workingTime*1
  3314. }
  3315. if(domain.overtimeHours){
  3316. allover = allover - domain.overtimeHours
  3317. }
  3318. if(worktime*1 > this.user.timeType.allday){
  3319. if(isover){
  3320. if(alltime > (allover + this.user.timeType.allday)){
  3321. this.$set(domain,'isOvertime',true)
  3322. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3323. }else{
  3324. this.$set(domain,'isOvertime',false)
  3325. this.$set(domain,'overtimeHours',null)
  3326. if(alltime < (allover + this.user.timeType.allday)){
  3327. let overtime = allover + this.user.timeType.allday - alltime
  3328. for(let pi in spl){
  3329. if(spl[pi].overtimeHours){
  3330. if((overtime - spl[pi].overtimeHours*1) > 0){
  3331. overtime = overtime - spl[pi].overtimeHours*1
  3332. this.$set(spl[pi],'isOvertime',false)
  3333. this.$set(spl[pi],'overtimeHours',null)
  3334. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3335. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3336. break
  3337. }else{
  3338. this.$set(spl[pi],'isOvertime',false)
  3339. this.$set(spl[pi],'overtimeHours',null)
  3340. break
  3341. }
  3342. }
  3343. }
  3344. }
  3345. }
  3346. }else{
  3347. this.$set(domain,'isOvertime',true)
  3348. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3349. }
  3350. }else{
  3351. for(let di in spl){
  3352. this.$set(spl[di],'isOvertime',false)
  3353. this.$set(spl[di],'overtimeHours',null)
  3354. }
  3355. }
  3356. }
  3357. },
  3358. iptChang() {
  3359. var sl = this.workForm.domains
  3360. let timeArr = []
  3361. for(var i in sl) {
  3362. if(sl[i].startTime && sl[i].endTime) {
  3363. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3364. }
  3365. }
  3366. this.getTimeHours(timeArr)
  3367. // for(let j in arrNum) {
  3368. // this.timeJsonStr += arrNum[j]
  3369. // if(flg) {
  3370. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3371. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3372. // }
  3373. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3374. // flg = true
  3375. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3376. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3377. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3378. // }
  3379. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3380. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3381. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3382. // }
  3383. // }
  3384. },
  3385. iptChangs() {
  3386. var sl = this.workForm.domains
  3387. let timeArr = []
  3388. for(var i in sl) {
  3389. for(var j in sl[i].worktimeList){
  3390. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3391. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3392. }
  3393. }
  3394. }
  3395. this.getTimeHours(timeArr)
  3396. },
  3397. // 调用接口或去数据
  3398. getTimeHours(arr) {
  3399. this.http.post('/report/getHoursByTimeRange',{
  3400. timeJsonStr: JSON.stringify(arr)
  3401. },res => {
  3402. if(res.code === 'ok') {
  3403. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3404. } else {
  3405. this.$message({
  3406. message: res.msg,
  3407. type: 'error'
  3408. })
  3409. }
  3410. },err => {
  3411. this.$message({
  3412. message: err,
  3413. type: 'error'
  3414. })
  3415. })
  3416. },
  3417. // 按周填报调用接口计算时间
  3418. async getWeekHoursByTimeRange(timeRange) {
  3419. const url = '/report/getHoursByTimeRange';
  3420. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3421. var that = this;
  3422. return new Promise((resolve, reject) => {
  3423. this.http.post(url, data, function(res) {
  3424. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3425. }, function(err) {
  3426. reject(err);
  3427. });
  3428. });
  3429. },
  3430. removeTimeItem(item, index) {
  3431. item.worktimeList.splice(index, 1);
  3432. this.iptChangs()
  3433. },
  3434. //添加工时
  3435. addNewWorktime(index, item) {
  3436. if(item.worktimeList == null ) {
  3437. item.worktimeList = []
  3438. }
  3439. item.worktimeList.push({});
  3440. },
  3441. //复制项目
  3442. copyProject(index) {
  3443. var leftProgress = 10;
  3444. if (this.reportTimeType.type == 3) {
  3445. //计算已经待分配工时比例
  3446. let array = this.workForm.domains;
  3447. let totalProgress = 0;
  3448. for (var i=0;i<array.length; i++) {
  3449. totalProgress += array[i].progress;
  3450. }
  3451. if (totalProgress < 100) {
  3452. leftProgress = 100 - totalProgress;
  3453. }
  3454. }
  3455. var newIndex = index+1;
  3456. var itemDomain = {
  3457. projectId: this.workForm.domains[index].projectId,
  3458. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3459. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3460. ),
  3461. content: "",
  3462. progress:leftProgress,
  3463. state:2,//2-表示待提交
  3464. };
  3465. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3466. if (this.reportTimeType.type == 0) {
  3467. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3468. var length = this.workForm.domains.length;
  3469. if (length == 2) {
  3470. this.showAddMore = false;
  3471. }
  3472. }
  3473. this.selectProject(itemDomain, newIndex);
  3474. },
  3475. pushWorkTime(reportId){
  3476. let url=''
  3477. if(this.user.timeType.syncSap == 1){
  3478. url='/report/pushProjectReportToSap'
  3479. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3480. var pushDate = this.date + day;
  3481. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3482. confirmButtonText: '确定',
  3483. cancelButtonText: '取消',
  3484. type: 'info'
  3485. }).then(() => {
  3486. const loading = this.$loading({
  3487. lock: true,
  3488. text: '正在推送中,请耐心等待。',
  3489. spinner: 'el-icon-loading',
  3490. background: 'rgba(0, 0, 0, 0.7)'
  3491. });
  3492. this.http.post(url,{
  3493. pushDate: pushDate,
  3494. reportId: reportId
  3495. },res => {
  3496. loading.close();
  3497. if(res.code == 'ok'){
  3498. this.$message({
  3499. type: 'success',
  3500. message: res.data
  3501. });
  3502. }else{
  3503. this.$message({
  3504. type: 'error',
  3505. message: res.msg
  3506. })
  3507. }
  3508. },err => {
  3509. loading.close();
  3510. this.$message({
  3511. type: 'error',
  3512. message: err
  3513. })
  3514. })
  3515. }).catch(() => {
  3516. });
  3517. }else{
  3518. url='/report/pushReportDataToThird'
  3519. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3520. confirmButtonText: '确定',
  3521. cancelButtonText: '取消',
  3522. type: 'info'
  3523. }).then(() => {
  3524. const loading = this.$loading({
  3525. lock: true,
  3526. text: '正在推送中,请耐心等待。',
  3527. spinner: 'el-icon-loading',
  3528. background: 'rgba(0, 0, 0, 0.7)'
  3529. });
  3530. this.http.post(url,{
  3531. yearMonth: this.date
  3532. },res => {
  3533. loading.close();
  3534. if(res.code == 'ok'){
  3535. this.$message({
  3536. type: 'success',
  3537. message: '推送成功!'
  3538. });
  3539. }else{
  3540. this.$message({
  3541. type: 'error',
  3542. message: res.msg
  3543. })
  3544. }
  3545. },err => {
  3546. loading.close();
  3547. this.$message({
  3548. type: 'error',
  3549. message: err
  3550. })
  3551. })
  3552. }).catch(() => {
  3553. });
  3554. }
  3555. },
  3556. showWorkTime(){
  3557. this.monthWorkTimeDialog = true;
  3558. this.searchKeyword = ''
  3559. this.WorktimeDatepickValue = this.istoMonth()
  3560. if(this.WorktimeDatepickValue.length == 0){
  3561. let newdate = new Date();
  3562. let nowdate = newdate.toLocaleDateString();
  3563. let getauto = this.getAutoWeekDate(nowdate)
  3564. let nowwd = [getauto[0],getauto[6]]
  3565. this.WorktimeDatepickValue = nowwd
  3566. }
  3567. this.showMonthWorkTime()
  3568. },
  3569. handleClick(t,e){
  3570. if (t.name == "first") {
  3571. this.showMonthWorkTime()
  3572. }else{
  3573. this.showMonthNotWorkTime()
  3574. }
  3575. },
  3576. //导出员工每日填报工时数
  3577. exportMembWorkHours() {
  3578. this.http.post(
  3579. "/report/exportUserDailyWorkTime",
  3580. {
  3581. // month: this.date,
  3582. startDate: this.WorktimeDatepickValue[0],
  3583. endDate: this.WorktimeDatepickValue[1],
  3584. },
  3585. (res) => {
  3586. if (res.code == "ok") {
  3587. let url = res.data;
  3588. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3589. }
  3590. },
  3591. (error) => {
  3592. this.$message({
  3593. message: error,
  3594. type: "error",
  3595. });
  3596. }
  3597. );
  3598. },
  3599. exportMembNotWorkHours() {
  3600. this.http.post(
  3601. "/report/exportNoReportUserList",
  3602. {
  3603. // month: this.date,
  3604. startDate: this.WorktimeDatepickValue[0],
  3605. endDate: this.WorktimeDatepickValue[1],
  3606. },
  3607. (res) => {
  3608. if (res.code == "ok") {
  3609. let url = res.data;
  3610. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3611. }
  3612. },
  3613. (error) => {
  3614. this.$message({
  3615. message: error,
  3616. type: "error",
  3617. });
  3618. }
  3619. );
  3620. },
  3621. downloadByA(name, url) {
  3622. const a = document.createElement("a"); // 创建a标签
  3623. a.setAttribute("download", name); // download属性
  3624. a.setAttribute("href", url); // href链接
  3625. a.click(); // 自执行点击事件
  3626. a.remove();
  3627. },
  3628. // 是否本月判断
  3629. istoMonth(){
  3630. let todate = new Date()
  3631. let tomonth = todate.getMonth() + 1
  3632. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3633. if(this.date == adate){
  3634. return []
  3635. }else{
  3636. let sedate = new Date(this.date)
  3637. let semonth = sedate.getMonth() + 1
  3638. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3639. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3640. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3641. return [sedates1, sedates2]
  3642. }
  3643. },
  3644. showMonthWorkTime() {
  3645. this.monthTotalPage = 0,
  3646. this.tbload = true
  3647. this.http.post(
  3648. "/report/getUserDailyWorkTime",
  3649. // "/report/getNoReportUserList",
  3650. {
  3651. // month: this.date,
  3652. startDate: this.WorktimeDatepickValue[0],
  3653. endDate: this.WorktimeDatepickValue[1],
  3654. },
  3655. (res) => {
  3656. if (res.code == "ok") {
  3657. this.tbload = false;
  3658. this.pickDateArray = res.data.days;
  3659. // console.log('dataarray',res.data.days);
  3660. this.monthWorkData = res.data.list;
  3661. // this.monthWorkDataS = this.monthWorkData
  3662. // this.monthWorkDataS1 = res.data.list
  3663. this.monthTotal = res.data.list.length
  3664. if (this.monthWorkData.length > 50) {
  3665. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3666. }else{
  3667. this.monthWorkDataS = this.monthWorkData
  3668. }
  3669. this.searchScreen(0)
  3670. // this.monthWorkDataS = infoList
  3671. // 判断
  3672. // if (this.monthWorkDataS1.length > 0) {
  3673. // setTimeout(() => {
  3674. // this.tableListener()
  3675. // }, 1000);
  3676. // }
  3677. this.$nextTick(function(){
  3678. this.$refs.hasworkTbl.doLayout();
  3679. });
  3680. // this.$forceUpdate()
  3681. }
  3682. },
  3683. (error) => {
  3684. this.tbload = false
  3685. this.$message({
  3686. message: error,
  3687. type: "error",
  3688. });
  3689. }
  3690. );
  3691. },
  3692. // tableListener(){
  3693. // let that = this;
  3694. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3695. // // 添加scroll监听事件
  3696. // dom.addEventListener("scroll", function () {
  3697. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3698. // if (scrollDistance < 2) {
  3699. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3700. // that.monthTotalPage++; //当前页数自增
  3701. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3702. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3703. // var infoList = arrList.splice(
  3704. // that.monthTotalPage * that.monthTotalLages,
  3705. // that.monthTotalLages
  3706. // );
  3707. // // 数据添加
  3708. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3709. // }
  3710. // }
  3711. // })
  3712. // },
  3713. showMonthNotWorkTime() {
  3714. this.monthTotalPage = 0,
  3715. this.tbload = true,
  3716. this.http.post(
  3717. "/report/getNoReportUserList",
  3718. {
  3719. startDate: this.WorktimeDatepickValue[0],
  3720. endDate: this.WorktimeDatepickValue[1],
  3721. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3722. },
  3723. (res) => {
  3724. if (res.code == "ok") {
  3725. this.tbload = false
  3726. this.monthNotWorkDate = res.data;
  3727. // this.monthNotWorkDateS1 = res.data
  3728. this.monthnotTotal = res.data.length
  3729. // 2222111
  3730. if (this.monthNotWorkDate.length > 50) {
  3731. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3732. } else {
  3733. this.monthNotWorkDateS = this.monthNotWorkDate
  3734. }
  3735. this.searchScreen(1)
  3736. // 判断
  3737. // if (this.monthnotworkDateS1.length > 0) {
  3738. // setTimeout(() => {
  3739. // this.tableListenernot()
  3740. // }, 1000);
  3741. // }
  3742. this.$nextTick(function(){
  3743. this.$refs.hasworkTbl2.doLayout();
  3744. });
  3745. }
  3746. },
  3747. (error) => {
  3748. this.tbload = false
  3749. this.$message({
  3750. message: error,
  3751. type: "error",
  3752. });
  3753. }
  3754. );
  3755. },
  3756. // tableListenernot(){
  3757. // let that = this;
  3758. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3759. // dom.addEventListener("scroll", function () {
  3760. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3761. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3762. // if (scrollDistance2 < 2) {
  3763. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3764. // that.monthnotTotalPage++; //当前页数自增
  3765. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3766. // var infoList = arrList.splice(
  3767. // that.monthnotTotalPage * that.monthnotTotalLages,
  3768. // that.monthnotTotalLages
  3769. // );
  3770. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3771. // }
  3772. // }
  3773. // })
  3774. // },
  3775. listScroll(){
  3776. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3777. this.isMore = true
  3778. setTimeout(()=>{
  3779. this.isMore = false
  3780. },1000)
  3781. }else {
  3782. this.isFlag = true
  3783. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3784. this.monthWorkDataS = datalist
  3785. setTimeout(()=>{
  3786. this.isFlag = false
  3787. },300)
  3788. }
  3789. },
  3790. notListScroll(){
  3791. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3792. this.isMore = true
  3793. setTimeout(()=>{
  3794. this.isMore = false
  3795. },1000)
  3796. }else {
  3797. this.isFlag = true
  3798. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3799. this.monthNotWorkDateS = datalist
  3800. // console.log('length',this.monthNotWorkDateS.length)
  3801. setTimeout(()=>{
  3802. this.isFlag = false
  3803. },300)
  3804. }
  3805. },
  3806. // 获取默认这zhou日期参数 222
  3807. getLastWeek(e){
  3808. let newdate = new Date()
  3809. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3810. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3811. if(e){
  3812. this.WorktimeDatepickValue = lastwd
  3813. this.showMonthWorkTime()
  3814. }else{
  3815. this.WorktimeDatepickValue = lastwd
  3816. this.showMonthNotWorkTime()
  3817. }
  3818. },
  3819. getThisWeek(e){
  3820. let newdate = new Date();
  3821. let nowdate = newdate.toLocaleDateString();
  3822. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3823. if(e){
  3824. this.WorktimeDatepickValue = nowwd
  3825. this.showMonthWorkTime()
  3826. }else{
  3827. this.WorktimeDatepickValue = nowwd
  3828. this.showMonthNotWorkTime()
  3829. }
  3830. },
  3831. getDoubleLastWeek(e){
  3832. let newdate = new Date()
  3833. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3834. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3835. if(e){
  3836. this.WorktimeDatepickValue = nextwd
  3837. this.showMonthWorkTime()
  3838. }else{
  3839. this.WorktimeDatepickValue = nextwd
  3840. this.showMonthNotWorkTime()
  3841. }
  3842. },
  3843. alreadyAllDate(stime,etime){
  3844. let diffdate = new Array();
  3845. let i=0;
  3846. while(stime<=etime){
  3847. let dateArray = stime.split("-");
  3848. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3849. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3850. let stimewk = this.weekDay[date.getDay()]
  3851. 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')
  3852. 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])
  3853. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3854. let stime_ts = new Date(stime).getTime();
  3855. let next_date = stime_ts + (24*60*60*1000);
  3856. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3857. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3858. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3859. stime = next_dates_y+next_dates_m+next_dates_d;
  3860. i++;
  3861. }
  3862. return diffdate
  3863. },
  3864. getAutoWeekDate(e) {
  3865. let dateString = e;
  3866. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3867. if (dateString.match(dateStringReg)) {
  3868. let presentDate = new Date(dateString),
  3869. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3870. return Array.from(new Array(7), function (val, index) {
  3871. let formatDate = new Date(
  3872. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3873. );
  3874. return (
  3875. formatDate.getFullYear() +
  3876. "-" +
  3877. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3878. "-" +
  3879. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3880. );
  3881. });
  3882. } else {
  3883. throw new Error(
  3884. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3885. );
  3886. }
  3887. },
  3888. onProgressChange() {
  3889. this.$forceUpdate();
  3890. },
  3891. showChooseMembTree() {
  3892. this.chosenMembCount = this.participator.length;
  3893. this.chooseParticipVisible = true;
  3894. },
  3895. onTreeItemChange() {
  3896. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3897. var list = chosenList.filter(item=>item.isUser == 1);
  3898. this.chosenMembCount = list.length;
  3899. },
  3900. findUserInTree() {
  3901. if (this.filterName == '') {
  3902. this.deptMembData = this.allMembData;
  3903. } else {
  3904. var list = this.findRecursively(this.filterName, this.allMembData);
  3905. this.deptMembData = list;
  3906. }
  3907. },
  3908. findRecursively(username, list) {
  3909. var filterList = [];
  3910. for (var i=0;i<list.length; i++) {
  3911. if (list[i].isUser == 1) {
  3912. if (list[i].label.indexOf(username) >= 0) {
  3913. //匹配上了
  3914. filterList.push(list[i]);
  3915. }
  3916. } else if (list[i].children != null && list[i].children.length > 0) {
  3917. var subList = this.findRecursively(username, list[i].children);
  3918. if (subList.length > 0) {
  3919. subList.forEach(s=>filterList.push(s));
  3920. }
  3921. }
  3922. }
  3923. return filterList;
  3924. },
  3925. //确定选择参与人
  3926. chooseParticip() {
  3927. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3928. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3929. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3930. if (this.user.company.packageProject == 1) {
  3931. if (this.chosenMembList.length > 1) {
  3932. this.$message({
  3933. message: '每次仅支持代填一个人',
  3934. type: "error",
  3935. });
  3936. return;
  3937. }
  3938. }
  3939. this.chooseParticipVisible = false;
  3940. this.workForm.userNames = '';
  3941. this.workForm.userId = [];
  3942. this.participator = [];
  3943. for (var i=0;i<this.chosenMembList.length; i++) {
  3944. this.workForm.userId.push(this.chosenMembList[i].id);
  3945. this.workForm.userNames += this.chosenMembList[i].label+',';
  3946. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3947. this.participator.push(item);
  3948. }
  3949. if (this.workForm.userNames.length > 0) {
  3950. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3951. }
  3952. if(this.user.userNameNeedTranslate == 1) {
  3953. if(this.workForm.userNames) {
  3954. this.workForm.userNames = this.workForm.userNames.split(',')
  3955. }
  3956. }
  3957. },
  3958. notifySel(sel){
  3959. // console.log(sel);
  3960. this.notifySelList = sel
  3961. },
  3962. //微信通知人员填写
  3963. Notify(code) {
  3964. if (this.notifySelList.length == 0) return;
  3965. var ids = '';
  3966. this.notifySelList.forEach(f=>{
  3967. ids += f.id+',';
  3968. })
  3969. this.http.post('/user/pushFillReport',{
  3970. ids: ids, date: this.curDate,
  3971. code: code
  3972. },
  3973. res => {
  3974. if (res.code == "ok") {
  3975. this.$message({
  3976. message: this.$t('message.sentSuccessfully'),
  3977. type: "success"
  3978. });
  3979. }
  3980. },
  3981. error => {
  3982. this.$message({
  3983. message: error,
  3984. type: "error"
  3985. });
  3986. }
  3987. );
  3988. },
  3989. //导出人员列表
  3990. exportMemb() {
  3991. if (this.fillMembList.length == 0) return;
  3992. var ids = '';
  3993. this.fillMembList.forEach(f=>{
  3994. ids += f.id+',';
  3995. })
  3996. this.http.post('/user/exportMembList',{
  3997. ids: ids,isFill: this.isFill, date: this.curDate
  3998. },
  3999. res => {
  4000. if (res.code == "ok") {
  4001. var aTag = document.createElement('a');
  4002. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4003. aTag.href = res.data;
  4004. aTag.click();
  4005. }
  4006. },
  4007. error => {
  4008. this.$message({
  4009. message: error,
  4010. type: "error"
  4011. });
  4012. }
  4013. );
  4014. },
  4015. showMembList(fill) {
  4016. this.membListVisible = true;
  4017. if (fill == 0) {
  4018. this.fillMembList = this.unFillList;
  4019. this.isFill = false;
  4020. let leaveList = []
  4021. let unleaveList = []
  4022. for(let i in this.fillMembList){
  4023. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4024. leaveList.push(this.fillMembList[i])
  4025. }else{
  4026. unleaveList.push(this.fillMembList[i])
  4027. }
  4028. }
  4029. this.fillMembList = unleaveList
  4030. this.fillMembList_leave = leaveList
  4031. } else if(fill == 1){
  4032. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4033. this.isFill = true;
  4034. }else{
  4035. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4036. this.isFill = true;
  4037. }
  4038. },
  4039. //获取自己填写的日报状态
  4040. getReportFillStatus() {
  4041. this.http.post('/report/getReportFillStatus',{
  4042. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4043. },
  4044. res => {
  4045. if (res.code == "ok") {
  4046. this.fillStatusList = res.data;
  4047. this.allDate.forEach(d=>{
  4048. var fillInfo = null;
  4049. d.state = null;
  4050. this.fillStatusList.forEach(s=>{
  4051. // console.log(d)
  4052. var d1 = s.createDate.split('-')[2];
  4053. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4054. // console.log(d2, '我被执行了')
  4055. if (d1.indexOf('0') == 0) {
  4056. d1 = d1.substring(1,d1.length);
  4057. }
  4058. if (d1 == d2) {
  4059. d.state = s.state;
  4060. }
  4061. })
  4062. })
  4063. this.$forceUpdate();
  4064. }
  4065. },
  4066. error => {
  4067. this.$message({
  4068. message: error,
  4069. type: "error"
  4070. });
  4071. }
  4072. );
  4073. },
  4074. scrollFunction () {
  4075. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4076. if (this.domObj.attachEvent) { // IE
  4077. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4078. } else if (this.domObj.addEventListener) {
  4079. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4080. }
  4081. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4082. },
  4083. mouseScroll(event) { // google 浏览器下
  4084. let detail = event.wheelDelta || event.detail
  4085. let moveForwardStep = -1
  4086. let moveBackStep = 1
  4087. let step = 0
  4088. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4089. event.preventDefault() // 阻止浏览器默认事件
  4090. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4091. },
  4092. // //左右滚动
  4093. // wheel(e){
  4094. // var a = document.getElementById("dateScroll");
  4095. // var scroll_width = 80; //滚动一下的距离
  4096. // var e = e || window.event, v;
  4097. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4098. // if(v>3||-v>3) v=-v;
  4099. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4100. // e.preventDefault(); //阻止浏览器的默认滚动
  4101. // },
  4102. showExportDialog() {
  4103. this.exportType = 0
  4104. this.exportDialog = true;
  4105. },
  4106. showExportTimeDialog() {
  4107. this.exportTimeDialog = true;
  4108. },
  4109. changeAllTime() {
  4110. //总时长发生改变,自动按比例计算
  4111. this.workForm.domains.forEach(d=>{
  4112. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4113. });
  4114. //计算jsTime
  4115. if (this.workForm.createDate) {
  4116. let sdate = new Date(this.workForm.createDate[0]);
  4117. let edate = new Date(this.workForm.createDate[1]);
  4118. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4119. console.log('days===', days)
  4120. if (days < 0) {
  4121. days = 0;
  4122. }
  4123. this.jsTime = this.reportTimeType.allday * days;
  4124. }
  4125. },
  4126. // 是否加班的单机事件
  4127. check() {
  4128. this.selected = !this.selected
  4129. this.isNew = this.selected
  4130. },
  4131. updateSubProject() {
  4132. this.$forceUpdate();
  4133. },
  4134. selectDegreeId(domain, index) {
  4135. this.http.post('/report/defaultDegree',{
  4136. projectId: domain.projectId
  4137. },
  4138. res => {
  4139. if (res.code == "ok") {
  4140. if(res.data) {
  4141. this.workForm.domains[index].degreeId = res.data.id + ''
  4142. this.$forceUpdate();
  4143. }
  4144. }
  4145. },
  4146. error => {
  4147. this.$message({
  4148. message: error,
  4149. type: "error"
  4150. });
  4151. }
  4152. );
  4153. },
  4154. //项目选中了, 加载子项目
  4155. selectProject(domain, index) {
  4156. if(!domain.projectId){
  4157. return;
  4158. }
  4159. // 默认选中上次填写的自定义维度
  4160. if(this.yonghuUser.customDegreeActive == 1) {
  4161. this.selectDegreeId(domain, index)
  4162. }
  4163. // console.log('projectId===',domain.projectId);
  4164. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4165. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4166. this.http.post('/sub-project/list',{
  4167. projectId: domain.projectId,
  4168. isReport: true
  4169. },
  4170. res => {
  4171. //清空之前选中的子项目
  4172. // this.workForm.domains[index].subProjectId = 0;
  4173. if (res.code == "ok") {
  4174. this.workForm.domains[index].subProjectList = res.data;
  4175. this.workForm.domains[index].subProjectId = null;
  4176. this.$forceUpdate();
  4177. }
  4178. },
  4179. error => {
  4180. this.$message({
  4181. message: error,
  4182. type: "error"
  4183. });
  4184. }
  4185. );
  4186. //项目相关的近期任务
  4187. if (this.user.company.packageProject == 1) {
  4188. this.getRecentTaskList(domain, index);
  4189. //获取项目相关专业
  4190. if (this.user.company.packageEngineering == 1) {
  4191. this.getProjectProfessions(domain, index);
  4192. }
  4193. //获取项目下的任务分组
  4194. this.getTaskGroups(domain, index);
  4195. }
  4196. // 获取项目相关的维度
  4197. // domain.degreeId = null
  4198. this.$set(domain,'degreeId',null)
  4199. this.$set(domain,'multiDegrIdArray',null)
  4200. this.dimension(domain, index);
  4201. //获取项目审核人
  4202. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4203. this.getProjectAuditorList(domain, index);
  4204. } else {
  4205. //按分组的负责人来审核
  4206. domain.projectAuditorId = null;
  4207. domain.projectAuditorName = null;
  4208. domain.auditUserList = null;
  4209. }
  4210. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4211. if (this.reportTimeType.type == 3) {
  4212. //新增项目时,自动计算
  4213. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4214. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4215. }
  4216. //加载昱众的工作职责
  4217. if (this.user.companyId == this.yuzhongCompId) {
  4218. this.updateResponse(domain);
  4219. }
  4220. },
  4221. getRecentTaskList(domain, index) {
  4222. //刷新任务时,清空服务
  4223. this.$set(domain, 'sapServiceId', null);
  4224. this.$set(domain, 'taskId', null);
  4225. var param = {
  4226. projectId: domain.projectId,
  4227. isSubstitude:this.isSubstitude?1:0,
  4228. };
  4229. if (domain.groupId) {
  4230. param.groupId = domain.groupId;
  4231. }
  4232. if (domain.stage) {
  4233. param.stage = domain.stage;
  4234. }
  4235. //专业版代填,获取代填员工的任务
  4236. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4237. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4238. this.$message({
  4239. message: '请选择代填的员工',
  4240. type: "error"
  4241. });
  4242. return;
  4243. } else {
  4244. param.userId = this.workForm.userId[0];
  4245. }
  4246. }
  4247. this.http.post('/task/getRecentTask',param,
  4248. res => {
  4249. if (res.code == "ok") {
  4250. this.workForm.domains[index].allTaskList = res.data;
  4251. this.workForm.domains[index].taskList = res.data;
  4252. this.$forceUpdate();
  4253. }
  4254. },
  4255. error => {
  4256. this.$message({
  4257. message: error,
  4258. type: "error"
  4259. });
  4260. }
  4261. );
  4262. },
  4263. //获取项目审核人
  4264. getProjectAuditorList(domainItem, index) {
  4265. if(domainItem.projectId == '') {
  4266. return
  4267. }
  4268. domainItem.projectAuditorId = null;
  4269. domainItem.projectAuditorName = null;
  4270. this.http.post('/project-auditor/getList',{
  4271. projectId: domainItem.projectId,
  4272. },
  4273. res => {
  4274. if (res.code == "ok") {
  4275. domainItem.auditUserList = res.data;
  4276. if (res.data.length==0) {
  4277. this.$message({
  4278. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4279. type: "error"
  4280. });
  4281. } else if (res.data.length==1) {
  4282. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4283. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4284. }
  4285. this.$forceUpdate();
  4286. }
  4287. },
  4288. error => {
  4289. this.$message({
  4290. message: error,
  4291. type: "error"
  4292. });
  4293. }
  4294. );
  4295. },
  4296. // 获取维度数据
  4297. dimension(domain, index) {
  4298. if(domain.projectId == '') {
  4299. return
  4300. }
  4301. this.http.post('/project/getDegreeList',{
  4302. projectId: domain.projectId,
  4303. },
  4304. res => {
  4305. if (res.code == "ok") {
  4306. // console.log("维度数据",res.data);
  4307. this.workForm.domains[index].wuduList = res.data
  4308. // this.workForm = this.workForm
  4309. this.$forceUpdate()
  4310. }
  4311. },
  4312. error => {
  4313. this.$message({
  4314. message: error,
  4315. type: "error"
  4316. });
  4317. }
  4318. );
  4319. },
  4320. //切换任务阶段
  4321. changeStages(domain, index) {
  4322. if (domain.stage == null || domain.stage == '') {
  4323. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4324. } else {
  4325. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4326. }
  4327. this.getRecentTaskList(domain, index);
  4328. this.$forceUpdate();
  4329. },
  4330. getGroupStages(domain, index, keepStage) {
  4331. // console.log(domain);
  4332. if(!domain.groupId){
  4333. domain.projectAuditorId = ''
  4334. domain.stages = []
  4335. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4336. domain.taskId = ''
  4337. domain.sapServiceId = ''
  4338. }
  4339. if(this.user.timeType.reportAuditType >= 1){
  4340. domain.auditUserList = []
  4341. }
  4342. this.$forceUpdate();
  4343. return
  4344. }
  4345. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4346. res => {
  4347. if (res.code == "ok") {
  4348. if (!keepStage) {
  4349. domain.stage = '';
  4350. }
  4351. domain.stages = res.data;
  4352. this.getRecentTaskList(domain, index);
  4353. this.$forceUpdate();
  4354. }
  4355. },
  4356. error => {
  4357. this.$message({
  4358. message: error,
  4359. type: "error"
  4360. });
  4361. });
  4362. //检查当前的项目是否需要获取分组的负责人
  4363. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4364. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4365. res => {
  4366. if (res.code == "ok") {
  4367. domain.getProjectAuditorList = res.data;
  4368. domain.auditUserList = res.data;
  4369. if (res.data.length==1) {
  4370. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4371. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4372. } else if (res.data.length==0) {
  4373. domain.projectAuditorId = null;
  4374. domain.projectAuditorName = null;
  4375. }
  4376. this.$forceUpdate();
  4377. }
  4378. },
  4379. error => {
  4380. this.$message({
  4381. message: error,
  4382. type: "error"
  4383. });
  4384. });
  4385. }
  4386. },
  4387. getProjectProfessions(domain, index) {
  4388. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4389. res => {
  4390. if (res.code == "ok") {
  4391. this.workForm.domains[index].professionProgress = res.data;
  4392. this.$forceUpdate();
  4393. }
  4394. },
  4395. error => {
  4396. this.$message({
  4397. message: error,
  4398. type: "error"
  4399. });
  4400. });
  4401. },
  4402. //删除自己的日报
  4403. deleteReport() {
  4404. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4405. confirmButtonText: this.$t('btn.determine'),
  4406. cancelButtonText: this.$t('btn.cancel'),
  4407. type: "warning"
  4408. })
  4409. .then(() => {
  4410. this.listLoading = true;
  4411. this.http.post('/report/delete',{
  4412. userId: this.user.id,
  4413. date: this.workForm.createDate
  4414. },
  4415. res => {
  4416. this.listLoading = false;
  4417. if (res.code == "ok") {
  4418. this.$message({
  4419. message: this.$t('message.successfullyDeleted'),
  4420. type: "success"
  4421. });
  4422. this.getReportList();
  4423. this.getDepartment();
  4424. this.dialogVisible = false;
  4425. } else {
  4426. this.$message({
  4427. message: res.msg,
  4428. type: "error"
  4429. });
  4430. }
  4431. },
  4432. error => {
  4433. this.listLoading = false;
  4434. this.$message({
  4435. message: error,
  4436. type: "error"
  4437. });
  4438. }
  4439. );
  4440. })
  4441. .catch(() => {});
  4442. },
  4443. // 管理员删除日报
  4444. guanli(item) {
  4445. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4446. let param = {date: this.date + day, userId: item.id};
  4447. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4448. confirmButtonText: this.$t('btn.determine'),
  4449. cancelButtonText: this.$t('btn.cancel'),
  4450. type: "warning"
  4451. })
  4452. .then(() => {
  4453. this.listLoading = true;
  4454. this.http.post('/report/delete',param,
  4455. res => {
  4456. this.listLoading = false;
  4457. if (res.code == "ok") {
  4458. this.$message({
  4459. message: this.$t('message.successfullyDeleted'),
  4460. type: "success"
  4461. });
  4462. this.getReportList();
  4463. this.getDepartment();
  4464. this.dialogVisible = false;
  4465. } else {
  4466. this.$message({
  4467. message: res.msg,
  4468. type: "error"
  4469. });
  4470. }
  4471. },
  4472. error => {
  4473. this.listLoading = false;
  4474. this.$message({
  4475. message: error,
  4476. type: "error"
  4477. });
  4478. }
  4479. );
  4480. })
  4481. .catch(() => {});
  4482. },
  4483. selectAll() {
  4484. if (this.isAllSelect) {
  4485. var keys = [];
  4486. this.reportNames.forEach(b=>{
  4487. keys.push(b.id);
  4488. })
  4489. this.$refs.approveTree.setCheckedKeys(keys);
  4490. } else {
  4491. this.$refs.approveTree.setCheckedKeys([]);
  4492. }
  4493. },
  4494. removeEmptyNode(list) {
  4495. for (var i=0;i<list.length;i++) {
  4496. var cnt = 0;
  4497. if (list[i].membCount == 0) {
  4498. list.splice(i, 1);
  4499. i--;
  4500. } else if (list[i].children != null) {
  4501. this.removeEmptyNode(list[i].children);
  4502. }
  4503. }
  4504. },
  4505. calculateMembCount(list) {
  4506. for (var i in list) {
  4507. var cnt = 0;
  4508. if (list[i].children != null) {
  4509. this.calculateMembCount(list[i].children);
  4510. for (var m in list[i].children) {
  4511. cnt += list[i].children[m].membCount;
  4512. }
  4513. }
  4514. if (list[i].isUser == 1) {
  4515. cnt++;
  4516. this.membCount++;
  4517. }
  4518. list[i].membCount = cnt;
  4519. }
  4520. },
  4521. stateChange() {
  4522. // console.log(this.allData,'alldate');
  4523. this.membCount = 0;
  4524. if (this.selectState == -1) {
  4525. //全部状态
  4526. this.data = this.allData;
  4527. } else {
  4528. //未填报
  4529. this.seluserText = ''
  4530. var newData = JSON.parse(JSON.stringify(this.allData));
  4531. this.filterState(this.selectState, newData);
  4532. this.data = newData;
  4533. }
  4534. this.calculateMembCount(this.data);
  4535. this.data[0].membCount = this.membCount;//总人数
  4536. },
  4537. //按状态过滤部门人员
  4538. filterState(state, list) {
  4539. for (var i =0;i<list.length; i++) {
  4540. var obj = list[i];
  4541. if (obj.isUser == 1) {
  4542. var match = false;
  4543. if (state == -2) {
  4544. if (obj.state == null) {
  4545. match = true;
  4546. }
  4547. } else {
  4548. if (obj.state == state) {
  4549. match = true;
  4550. }
  4551. }
  4552. if (!match) {
  4553. list.splice(i, 1);
  4554. i--;
  4555. } else {
  4556. }
  4557. } else {
  4558. if (obj.children != null) {
  4559. this.filterState(state, obj.children);
  4560. }
  4561. }
  4562. }
  4563. },
  4564. //a按名称过滤部门人员
  4565. async seluserforText(){
  4566. const { userNameNeedTranslate } = this.user
  4567. this.membCount = 0;
  4568. var newData = JSON.parse(JSON.stringify(this.allData));
  4569. let textList = [this.seluserText]
  4570. if(userNameNeedTranslate == 1) {
  4571. this.dataLoading = true
  4572. let res = await this.postData('/user/getEmployeeList', {
  4573. keyword: this.seluserText,
  4574. cursor: '',
  4575. departmentId: -1,
  4576. pageIndex: 1,
  4577. pageSize: 1000
  4578. })
  4579. textList = res.data.records.map(item => item.name)
  4580. this.dataLoading = false
  4581. }
  4582. // return
  4583. console.log(textList, '<=== textList')
  4584. this.seluserforTextin(this.seluserText, newData, textList)
  4585. console.log(newData, 'Data')
  4586. this.data = newData;
  4587. this.calculateMembCount(this.data);
  4588. this.data[0].membCount = this.membCount;//总人数
  4589. },
  4590. seluserforTextin(text, list, textList = []){
  4591. for (var i =0;i<list.length; i++) {
  4592. var obj = list[i];
  4593. if (obj.isUser == 1) {
  4594. var match = false;
  4595. // if (obj.label.indexOf(text) != -1) {
  4596. // match = true
  4597. // }
  4598. if(textList.some(item => item.includes(obj.label))) {
  4599. match = true
  4600. }
  4601. if (!match) {
  4602. list.splice(i, 1);
  4603. i--;
  4604. } else {
  4605. }
  4606. } else {
  4607. if (obj.children != null) {
  4608. this.seluserforTextin(text, obj.children, textList);
  4609. }
  4610. }
  4611. }
  4612. },
  4613. // 当节点发生变化时
  4614. nodeChangeExpand(data) {
  4615. // 保存当前展开的节点
  4616. let flag = false
  4617. this.nodeModelData.some(item => {
  4618. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4619. flag = true
  4620. return true
  4621. }
  4622. })
  4623. if (!flag) { // 不存在则存到数组里
  4624. this.nodeModelData.push(data.id)
  4625. }
  4626. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4627. },
  4628. nodeChangeCollapse(data) {
  4629. console.log(this.nodeModelData)
  4630. this.nodeModelData.some((item, i) => {
  4631. if (item === data.id) {
  4632. this.nodeModelData.length = i
  4633. }
  4634. })
  4635. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4636. },
  4637. // 部门列表点击
  4638. handleNodeClick(data) {
  4639. // this.dealList = data
  4640. this.theValues(data.id, this.allData)
  4641. // this.depData = data;
  4642. var list = [];
  4643. if (data.id == -1) {
  4644. this.deptId = null;
  4645. this.targetUid = null;
  4646. list = this.data;
  4647. } else if (data.isUser == 1) {
  4648. this.deptId = null;
  4649. this.targetUid = data.id;
  4650. } else {
  4651. this.deptId = data.id;
  4652. this.targetUid = null;
  4653. list.push(data);
  4654. }
  4655. this.getReportList();
  4656. if (list.length > 0) {
  4657. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4658. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4659. }
  4660. },
  4661. exportPushLog(){
  4662. this.http.post('/sap-sync-log/export',{},
  4663. res => {
  4664. if (res.code == "ok") {
  4665. var filePath = res.data;
  4666. var fName = '推送日志.xlsx'
  4667. const a = document.createElement('a'); // 创建a标签
  4668. a.setAttribute('download', fName);// download属性
  4669. a.setAttribute('href', filePath);// href链接
  4670. a.click(); //自执行点击事件
  4671. a.remove();
  4672. } else {
  4673. this.$message({
  4674. message: res.msg,
  4675. type: "error"
  4676. });
  4677. }
  4678. },
  4679. error => {
  4680. this.$message({
  4681. message: error,
  4682. type: "error"
  4683. });
  4684. });
  4685. },
  4686. theValues(id, item) {
  4687. for(var i in item) {
  4688. if(item[i].id == id) {
  4689. this.depData = item[i]
  4690. if(id == '-1') {
  4691. this.translation = '1'
  4692. } else {
  4693. if(item[i].children) {
  4694. this.translation = '2'
  4695. } else {
  4696. this.translation = '3'
  4697. }
  4698. }
  4699. return
  4700. } else {
  4701. if(item[i].children) {
  4702. this.theValues(id, item[i].children)
  4703. }
  4704. }
  4705. }
  4706. },
  4707. //获取可以选择的代填的人员列表
  4708. getSubstitudeUserDeptList() {
  4709. if (this.deptMembData.length == 0) {
  4710. this.http.post("/department/listMyMembs", {},
  4711. res => {
  4712. if (res.code == "ok") {
  4713. let noAllData = JSON.parse(JSON.stringify(res.data));
  4714. if (noAllData.length > 0) {
  4715. // if (noAllData[0].label == '全部人员') {
  4716. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4717. noAllData.splice(0,1);
  4718. }
  4719. }
  4720. this.setUserToDept(noAllData);
  4721. this.deptMembData = noAllData;
  4722. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4723. console.log(this.deptMembData, '代填人员数据')
  4724. } else {
  4725. this.$message({
  4726. message: res.msg,
  4727. type: "error"
  4728. });
  4729. }
  4730. },
  4731. error => {
  4732. this.$message({
  4733. message: error,
  4734. type: "error"
  4735. });
  4736. });
  4737. }
  4738. },
  4739. // 获取部门列表
  4740. getDepartmentForApprove() {
  4741. this.http.post( this.port.manage.depList, {},
  4742. res => {
  4743. if (res.code == "ok") {
  4744. var list1 = JSON.parse(JSON.stringify(res.data));
  4745. this.deptOptionList = this.changeArr(list1);
  4746. console.log(this.deptOptionList, '部门')
  4747. } else {
  4748. this.$message({
  4749. message: res.msg,
  4750. type: "error"
  4751. });
  4752. }
  4753. },
  4754. error => {
  4755. this.$message({
  4756. message: error,
  4757. type: "error"
  4758. });
  4759. });
  4760. },
  4761. // 获取部门列表
  4762. getDepartment() {
  4763. //如果没有权限,就不需要获取
  4764. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4765. return;
  4766. }
  4767. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4768. var param = {date:this.date + day};
  4769. this.http.post("/report/getMembList", param,
  4770. res => {
  4771. if (res.code == "ok") {
  4772. if(res.data.length == 0){
  4773. return
  4774. }
  4775. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4776. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4777. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4778. // if (this.user.role > 0) {
  4779. // }
  4780. list.splice(0,0,{
  4781. id: -1,
  4782. label: this.$t('lable.allStaff'),
  4783. })
  4784. this.membCount = 0;
  4785. //设置员工到部门下面
  4786. this.setUserToDept(list);
  4787. this.data = list;
  4788. // console.log('data',this.data);
  4789. this.expandDate = [this.data[1].id]
  4790. this.allData = list;
  4791. // if (noAllData.length > 0) {
  4792. // if (noAllData[0].label == '全部人员') {
  4793. // noAllData.splice(0,1);
  4794. // }
  4795. // }
  4796. // this.setUserToDept(noAllData);
  4797. // this.deptMembData = noAllData;
  4798. this.option = this.changeArr(list1);
  4799. list[0].membCount = this.membCount;
  4800. if (this.depData.id == -1) {
  4801. this.depData.membCount = this.membCount;
  4802. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4803. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4804. } else {
  4805. if (this.depData.isUser == null) {
  4806. var dep = this.findTargetDept(this.data, this.depData.id);
  4807. var membDeptList = [];
  4808. membDeptList.push(dep);
  4809. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4810. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4811. }
  4812. }
  4813. if (this.depData.isUser == null) {
  4814. if (this.isFill) {
  4815. this.fillMembList = this.fillList;
  4816. } else {
  4817. this.fillMembList = this.unFillList;
  4818. }
  4819. }
  4820. this.leaveAllNum = 0
  4821. for(let i in this.unFillList){
  4822. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4823. this.leaveAllNum += 1
  4824. }
  4825. }
  4826. this.stateChange()
  4827. } else {
  4828. this.$message({
  4829. message: res.msg,
  4830. type: "error"
  4831. });
  4832. }
  4833. },
  4834. error => {
  4835. this.$message({
  4836. message: error,
  4837. type: "error"
  4838. });
  4839. });
  4840. this.getReportFillStatus();
  4841. },
  4842. findTargetDept(list, deptId) {
  4843. var t = null;
  4844. for (var i=0;i<list.length; i++) {
  4845. if (list[i].isUser == null && list[i].id == deptId) {
  4846. t = list[i];
  4847. break;
  4848. }
  4849. }
  4850. if (t == null) {
  4851. for (var i=0;i<list.length; i++) {
  4852. if (list[i].children != null && list[i].children.length > 0) {
  4853. t = this.findTargetDept(list[i].children, deptId);
  4854. if (t != null) {
  4855. break;
  4856. }
  4857. }
  4858. }
  4859. }
  4860. return t;
  4861. },
  4862. getUserMembListFromDeptList(list, isFill) {
  4863. var membList = [];
  4864. for (var i in list) {
  4865. var deptName = list[i].label;
  4866. if (list[i].userList != null) {
  4867. list[i].userList.forEach(element => {
  4868. if (isFill == 0) {
  4869. //获取未填的
  4870. if (element.state == null) {
  4871. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4872. membList.push(obj);
  4873. }
  4874. } else {
  4875. if (element.state != null) {
  4876. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4877. membList.push(obj);
  4878. }
  4879. }
  4880. });
  4881. }
  4882. if (list[i].children != null) {
  4883. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4884. }
  4885. }
  4886. return membList;
  4887. },
  4888. setUserToDept(list) {
  4889. for (var i in list) {
  4890. var cnt = 0;
  4891. if (list[i].children != null) {
  4892. this.setUserToDept(list[i].children);
  4893. for (var m in list[i].children) {
  4894. cnt += list[i].children[m].membCount;
  4895. }
  4896. }
  4897. if (list[i].userList != null) {
  4898. if (list[i].children == null) {
  4899. list[i].children = [];
  4900. }
  4901. list[i].userList.forEach(element => {
  4902. var obj = {
  4903. id: element.id,
  4904. label:element.name,
  4905. state:element.state,
  4906. parentId:element.departmentId,
  4907. isUser:1,
  4908. workingTime: element.workingTime,
  4909. leaveDays: element.leaveDays,
  4910. leaveTimes: element.leaveTimes
  4911. };
  4912. list[i].children.push(obj);
  4913. this.membCount++;
  4914. cnt++;
  4915. });
  4916. }
  4917. list[i].membCount = cnt;
  4918. }
  4919. },
  4920. // 修改数组
  4921. changeArr(arr) {
  4922. for (var i = 0; i < arr.length; i++) {
  4923. if(arr[i].id != -1 && arr[i].id != 0) {
  4924. if (arr[i].children != null && arr[i].children.length>0) {
  4925. arr[i].children = this.changeArr(arr[i].children);
  4926. }
  4927. arr[i].id && (arr[i].value = arr[i].id);
  4928. delete arr[i].id;
  4929. }
  4930. }
  4931. for(var i in arr) {
  4932. if(arr[i].id == -1 || arr[i].id == 0) {
  4933. arr.splice(i,1)
  4934. }
  4935. }
  4936. return arr;
  4937. },
  4938. //时间段范围设置改动,监听
  4939. onTimeTypeChange(timeType) {
  4940. this.seleChn(1)
  4941. this.showAddMore = true;
  4942. for(var i in this.workForm.domains) {
  4943. if (this.workForm.domains[i].timeType == 0) {
  4944. this.showAddMore = false;
  4945. break;
  4946. }
  4947. }
  4948. if (this.showAddMore) {
  4949. //检测数量
  4950. if (this.workForm.domains.length == 2) {
  4951. this.showAddMore = false;
  4952. } else {
  4953. this.showAddMore = true;
  4954. }
  4955. }
  4956. },
  4957. getTimeType() {
  4958. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4959. res => {
  4960. if (res.code == "ok") {
  4961. var t = res.data;
  4962. this.reportTimeType = t;
  4963. if (this.reportTimeType.type > 0) {
  4964. this.showAddMore = true;
  4965. }
  4966. //转化时间格式
  4967. if (t.allday != null) {
  4968. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4969. }
  4970. if (t.am != null) {
  4971. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4972. }
  4973. if (t.pm != null) {
  4974. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4975. }
  4976. let arr = []
  4977. for(var i in res.data.excludeTimeList) {
  4978. let obj = {
  4979. s: res.data.excludeTimeList[i].startTime,
  4980. e: res.data.excludeTimeList[i].endTime,
  4981. }
  4982. arr.push(obj)
  4983. }
  4984. this.vacationTime = arr
  4985. } else {
  4986. this.$message({
  4987. message: res.msg,
  4988. type: "error"
  4989. });
  4990. }
  4991. },
  4992. error => {
  4993. this.listLoading = false;
  4994. this.$message({
  4995. message: error,
  4996. type: "error"
  4997. });
  4998. });
  4999. },
  5000. // 改变月份 -------
  5001. changeMonthOut() {
  5002. this.getAllDate();
  5003. this.getReportList();
  5004. this.getDepartment();
  5005. },
  5006. // 选择日期
  5007. choseDate(i, item) {
  5008. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5009. return
  5010. }
  5011. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5012. this.choseDay = i;
  5013. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5014. sessionStorage.msg = this.date + day,
  5015. this.getReportList();
  5016. this.getDepartment();
  5017. this.curDate = item.date;
  5018. },
  5019. canClick(i, item){
  5020. let nowDate = new Date()
  5021. let nowDateYear = nowDate.getFullYear()
  5022. let itemYear = parseInt(this.date.split('-')[0])
  5023. let nowDateMonth = nowDate.getMonth() + 1
  5024. let itemMonth = parseInt(this.date.split('-')[1])
  5025. let nowDateDay = nowDate.getDate()
  5026. let itemDay = parseInt(item.showDate.split('.')[1])
  5027. if(nowDateYear < itemYear){
  5028. return false
  5029. }else if(nowDateYear == itemYear){
  5030. if(nowDateMonth < itemMonth){
  5031. return false
  5032. }else if(nowDateMonth == itemMonth){
  5033. if(nowDateDay < itemDay){
  5034. return false
  5035. }
  5036. }
  5037. }
  5038. },
  5039. // 获取日期列表
  5040. getAllDate(e) {
  5041. var dayArry = [];
  5042. var day = this.getCountDays();
  5043. let curMonthDay = null;
  5044. for (var k = 1; k <= day; k++) {
  5045. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5046. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5047. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5048. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5049. if(sessionStorage.msg) {
  5050. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5051. this.choseDay = k - 1;
  5052. curMonthDay = str;
  5053. }
  5054. } else {
  5055. if (new Date().getDate() == k) {
  5056. this.choseDay = k - 1;
  5057. }
  5058. }
  5059. } else {
  5060. this.choseDay = 0;
  5061. }
  5062. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5063. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5064. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5065. }
  5066. this.allDate = dayArry;
  5067. //不能超过最大日期
  5068. if (this.choseDay > day-1) {
  5069. this.choseDay = day-1;
  5070. }
  5071. if(sessionStorage.from != 1){
  5072. let nowmonth = new Date().getMonth() + 1
  5073. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5074. let nowdate = new Date().getDate()
  5075. if(nowd == this.date){
  5076. if(e && sessionStorage.msg){
  5077. }else{
  5078. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5079. }
  5080. let nowday = new Date(sessionStorage.msg).getDate()
  5081. this.choseDay = nowday - 1
  5082. let monthdate = new Date(sessionStorage.msg)
  5083. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5084. }else{
  5085. if(e && sessionStorage.msg){
  5086. }else{
  5087. sessionStorage.msg = this.date + '-01'
  5088. }
  5089. let monthdate = new Date(sessionStorage.msg)
  5090. this.choseDay = monthdate.getDate() - 1
  5091. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5092. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5093. }
  5094. }else{
  5095. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5096. }
  5097. //从消息点击跳转过来的,直接加载指定日期
  5098. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5099. this.curDate = sessionStorage.msg;
  5100. sessionStorage.from = 0;
  5101. } else {
  5102. // if (curMonthDay != null) {
  5103. // // this.curDate = curMonthDay;
  5104. // let d = new Date(sessionStorage.msg)
  5105. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5106. // } else {
  5107. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5108. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5109. // }
  5110. }
  5111. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5112. // if(!sessionStorage.msg){
  5113. // let msgday = this.choseDay + 1
  5114. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5115. // }
  5116. this.getReportFillStatus();
  5117. },
  5118. getCountDays() {
  5119. var newstr = this.date.replace(/-/g, "/");
  5120. var curDate = new Date(newstr+'/01');
  5121. var curMonth = curDate.getMonth();
  5122. curDate.setMonth(curMonth + 1);
  5123. curDate.setDate(0);
  5124. return curDate.getDate();
  5125. },
  5126. reqMore() {
  5127. if (this.hasMore) {
  5128. this.pageIndex++;
  5129. this.requestHttpReports();
  5130. }
  5131. },
  5132. //加载日报数据
  5133. requestHttpReports() {
  5134. //请求数据
  5135. this.listLoading = true;
  5136. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5137. let param = {date: this.date + day};
  5138. if (this.deptId) {
  5139. param.deptId = this.deptId;
  5140. }
  5141. if (this.targetUid) {
  5142. param.userId = this.targetUid;
  5143. }
  5144. //传页码
  5145. if (this.hasMore) {
  5146. param.pageIndex = this.pageIndex;
  5147. }
  5148. this.http.post( this.port.report.list, param,
  5149. res => {
  5150. this.listLoading = false;
  5151. if (res.code == "ok") {
  5152. //扩增
  5153. this.reportList = this.reportList.concat(res.data.data);
  5154. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5155. if(document.querySelector("#day"+this.choseDay)){
  5156. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5157. }
  5158. } else {
  5159. this.$message({
  5160. message: res.msg,
  5161. type: "error"
  5162. });
  5163. }
  5164. },
  5165. error => {
  5166. this.listLoading = false;
  5167. this.$message({
  5168. message: error,
  5169. type: "error"
  5170. });
  5171. });
  5172. },
  5173. //获取日报列表
  5174. getReportList() {
  5175. //初始化,重置数据
  5176. this.pageIndex = 0;
  5177. this.hasMore = true;
  5178. this.reportList = [];
  5179. this.requestHttpReports();
  5180. },
  5181. //刷新日报状态,用于审核后更新
  5182. refreshReportData(reportId) {
  5183. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5184. res => {
  5185. if (res.code == "ok") {
  5186. for (var m=0;m<this.reportList.length; m++) {
  5187. var d = this.reportList[m].data;
  5188. var find = d.filter(r=>r.id == reportId);
  5189. if (find.length > 0) {
  5190. find[0].state = res.data.state;
  5191. if (find[0].state == 2) {//被驳回,要可以编辑
  5192. this.reportList[m].state = 2;
  5193. }
  5194. find[0].isDeptAudit = res.data.isDeptAudit;
  5195. find[0].departmentAuditState = res.data.departmentAuditState;
  5196. find[0].projectAuditorName = res.data.projectAuditorName;
  5197. find[0].projectAuditorId = res.data.projectAuditorId;
  5198. find[0].projectAuditState = res.data.projectAuditState;
  5199. find[0].rejectUserid = res.data.rejectUserid;
  5200. find[0].rejectUsername = res.data.rejectUsername;
  5201. find[0].rejectReason = res.data.rejectReason;
  5202. this.$forceUpdate();
  5203. break;
  5204. }
  5205. }
  5206. } else {
  5207. this.$message({
  5208. message: res.msg,
  5209. type: "error"
  5210. });
  5211. }
  5212. },
  5213. error => {
  5214. this.listLoading = false;
  5215. this.$message({
  5216. message: error,
  5217. type: "error"
  5218. });
  5219. });
  5220. },
  5221. //导出员工工时统计
  5222. exportUserTime() {
  5223. this.listLoading = true;
  5224. var param = {};
  5225. if (this.exportParam.dateRange != null) {
  5226. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5227. }
  5228. this.http.post('/department/exportDeptStatistic', param,
  5229. res => {
  5230. this.listLoading = false;
  5231. if (res.code == "ok") {
  5232. location.href = res.data;
  5233. this.exportTimeDialog = false;
  5234. } else {
  5235. this.$message({
  5236. message: res.msg,
  5237. type: "error"
  5238. });
  5239. }
  5240. },
  5241. error => {
  5242. this.listLoading = false;
  5243. this.$message({
  5244. message: error,
  5245. type: "error"
  5246. });
  5247. });
  5248. },
  5249. //导出日报
  5250. exportReport() {
  5251. this.exportingData = true;
  5252. var param = {};
  5253. if (this.exportParam.dateRange != null) {
  5254. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5255. }
  5256. if (this.exportParam.projectId != null) {
  5257. param.projectId = this.exportParam.projectId;
  5258. }
  5259. if (this.exportParam.departmentId != null) {
  5260. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5261. }
  5262. param.stateKey = this.stateKey
  5263. // param.departmentId = this.user.departmentId
  5264. console.log(param, '《=== 导出传的参数');
  5265. console.log('开始调用exportReport接口');
  5266. this.http.post(this.port.report.export, param,
  5267. res => {
  5268. this.exportingData = false;
  5269. if (res.code == "ok") {
  5270. location.href = res.data;
  5271. this.exportDialog = false;
  5272. } else {
  5273. this.$message({
  5274. message: res.msg,
  5275. type: "error"
  5276. });
  5277. }
  5278. },
  5279. error => {
  5280. this.exportingData = false;
  5281. this.$message({
  5282. message: error,
  5283. type: "error"
  5284. });
  5285. });
  5286. },
  5287. //获取项目列表
  5288. getProjectList() {
  5289. this.listLoading = true;
  5290. this.http.post( this.port.project.list, {},
  5291. res => {
  5292. this.listLoading = false;
  5293. if (res.code == "ok") {
  5294. for(var i in res.data) {
  5295. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5296. res.data[i].projectCode = ''
  5297. }
  5298. }
  5299. this.projectList = res.data;
  5300. console.log("项目列表",this.projectList);
  5301. } else {
  5302. this.$message({
  5303. message: res.msg,
  5304. type: "error"
  5305. });
  5306. }
  5307. },
  5308. error => {
  5309. this.listLoading = false;
  5310. this.$message({
  5311. message: error,
  5312. type: "error"
  5313. });
  5314. });
  5315. },
  5316. // 获取填报日报的项目下拉列表
  5317. getFillProjectList() {
  5318. this.http.post( this.port.project.list, {
  5319. forReport: 1
  5320. },res => {
  5321. if (res.code == "ok") {
  5322. for(var i in res.data) {
  5323. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5324. res.data[i].projectCode = ''
  5325. }
  5326. }
  5327. this.fillProjectList = res.data;
  5328. this.getRecentlyProject()
  5329. } else {
  5330. this.$message({
  5331. message: res.msg,
  5332. type: "error"
  5333. });
  5334. }
  5335. },
  5336. error => {
  5337. this.$message({
  5338. message: error,
  5339. type: "error"
  5340. });
  5341. });
  5342. },
  5343. getBasecostItemList() {
  5344. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5345. companyId: this.user.companyId
  5346. },
  5347. res => {
  5348. if (res.code == "ok") {
  5349. this.timeBasecostList = res.data;
  5350. }
  5351. });
  5352. },
  5353. getAIReport(createDate) {
  5354. this.http.post('/report/getAIReport', {},
  5355. res => {
  5356. if (res.code == "ok") {
  5357. var quanbu = 0
  5358. this.jsDay = 1
  5359. var zhi = ''
  5360. var slp = res.data
  5361. for(var i in slp) {
  5362. var sp = +slp[i].workingTime + 0
  5363. zhi = this.jsDay * sp
  5364. quanbu = +quanbu + zhi
  5365. }
  5366. this.jsTime = quanbu
  5367. var aiReportData = res.data;
  5368. this.canCancelInDialog = false
  5369. if(aiReportData.length != 0) {
  5370. var arr = [];
  5371. for(var i in aiReportData) {
  5372. arr.push({
  5373. id: null,
  5374. projectId: aiReportData[i].projectId,
  5375. workingTime: aiReportData[i].workingTime,
  5376. content: '',
  5377. progress:100,
  5378. state: 2,
  5379. timeType: aiReportData[i].timeType,
  5380. subProjectList: aiReportData[i].subProjectList,
  5381. taskList: aiReportData[i].taskList,
  5382. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5383. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5384. taskId: aiReportData[i].taskId,
  5385. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5386. startTime: aiReportData[i].startTime,
  5387. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5388. endTime: aiReportData[i].endTime,
  5389. isOvertime: 0,
  5390. progress:aiReportData[i].progress,
  5391. professionProgress: aiReportData[i].professionProgressList,
  5392. stages:aiReportData[i].stages,
  5393. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5394. pics: null,
  5395. multiWorktime: aiReportData[i].multiWorktime,
  5396. worktimeList: [{}],
  5397. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5398. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5399. wuduList: aiReportData[i].degreeList,
  5400. taskGroups:aiReportData[i].taskGroups,
  5401. customData: aiReportData[i].customData,//自定义的数值
  5402. auditUserList: aiReportData[i].auditUserList,
  5403. projectAuditorId: aiReportData[i].projectAuditorId,
  5404. projectAuditorName: aiReportData[i].projectAuditorName,
  5405. overtimeHours: aiReportData[i].overtimeHours,
  5406. customText: aiReportData[i].customText,
  5407. basecostId: aiReportData[i].basecostId,
  5408. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5409. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5410. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5411. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5412. canEdit: true
  5413. })
  5414. }
  5415. this.workForm.domains = arr;
  5416. } else {
  5417. }
  5418. this.canEdit = true;
  5419. this.originCanEdit = true;
  5420. this.seleChn()
  5421. } else {
  5422. this.$message({
  5423. message: res.msg,
  5424. type: "error"
  5425. });
  5426. }
  5427. },
  5428. error => {
  5429. this.$message({
  5430. message: error,
  5431. type: "error"
  5432. });
  5433. });
  5434. },
  5435. // 获取个人某天的日报 111111
  5436. getReport() {
  5437. this.http.post( this.port.report.getPort, {
  5438. date: this.workForm.createDate
  5439. },
  5440. res => {
  5441. if (res.code == "ok") {
  5442. var quanbu = 0
  5443. this.jsDay = 1
  5444. var zhi = ''
  5445. var slp = res.data.report
  5446. for(var i in slp) {
  5447. var sp = +slp[i].workingTime + 0
  5448. zhi = this.jsDay * sp
  5449. quanbu = +quanbu + zhi
  5450. }
  5451. this.jsTime = quanbu
  5452. var list = res.data;
  5453. this.report = list;
  5454. this.reportTimeType = this.report.timeType;
  5455. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5456. this.isWeekend = !this.report.isWorkDay;
  5457. this.canCancelInDialog = false;
  5458. this.hasWrittenReport = list.report.length != 0;
  5459. if(list.report.length != 0) {
  5460. var arr = [];
  5461. this.canEdit = false;
  5462. let candelete = true
  5463. for(var i in list.report) {
  5464. var flg = null
  5465. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5466. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5467. var filteredRespList = null
  5468. if (targetP.length > 0) {
  5469. var isPublic = targetP[0].isPublic;
  5470. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5471. }
  5472. arr.push({
  5473. id: list.report[i].id,
  5474. projectId: list.report[i].projectId,
  5475. workingTime: list.report[i].workingTime,
  5476. content: list.report[i].content,
  5477. state: list.report[i].state,
  5478. timeType: list.report[i].timeType,
  5479. subProjectList: list.report[i].subProjectList,
  5480. taskList: list.report[i].taskList,
  5481. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5482. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5483. taskId: list.report[i].taskId,
  5484. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5485. startTime: list.report[i].startTime,
  5486. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5487. endTime: list.report[i].endTime,
  5488. isOvertime: flg,
  5489. progress:list.report[i].progress,
  5490. professionProgress: list.report[i].professionProgressList,
  5491. stages:list.report[i].stages,
  5492. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5493. pics: list.report[i].pics,
  5494. multiWorktime: list.report[i].multiWorktime,
  5495. worktimeList: list.report[i].worktimeList,
  5496. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5497. multiDegrIdArray: list.report[i].multiDegrIdList,
  5498. wuduList: list.report[i].degreeList,
  5499. taskGroups:list.report[i].taskGroups,
  5500. customData: list.report[i].customData,//自定义的数值
  5501. auditUserList: list.report[i].auditUserList,
  5502. projectAuditorId: list.report[i].projectAuditorId,
  5503. projectAuditorName: list.report[i].projectAuditorName,
  5504. overtimeHours: list.report[i].overtimeHours,
  5505. customText: list.report[i].customText,
  5506. basecostId: list.report[i].basecostId,
  5507. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5508. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5509. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5510. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5511. canEdit: list.report[i].state >= 2 ? true : false,
  5512. extraField1: list.report[i].extraField1,
  5513. extraField2: list.report[i].extraField2,
  5514. extraField3: list.report[i].extraField3,
  5515. workContentList: list.report[i].workContentList,
  5516. filteredRespList: filteredRespList,
  5517. serviceList: list.report[i].serviceList,
  5518. sapServiceId: list.report[i].sapServiceId,
  5519. })
  5520. if (list.report[i].state >= 2) {
  5521. this.canEdit = true;
  5522. }
  5523. if(list.report[i].state < 2){
  5524. candelete = false
  5525. }
  5526. if (list.report[i].state == 0){
  5527. this.canCancelInDialog = true
  5528. }
  5529. // 加判断
  5530. if(this.user.timeType.choseFromAlbum == 1) {
  5531. let arrList = []
  5532. for(var k in list.report[i].pics) {
  5533. let obj = {
  5534. name: k,
  5535. url: list.report[i].pics[k]
  5536. }
  5537. arrList.push(obj)
  5538. }
  5539. arr[i].imgListUrl = arrList
  5540. arr[i].imgList = list.report[i].pics
  5541. }
  5542. }
  5543. this.reportCanDelete = candelete
  5544. this.workForm = {
  5545. createDate: this.workForm.createDate,
  5546. domains: arr,
  5547. userNames:null,
  5548. userId:null,
  5549. time: list.time
  5550. }
  5551. console.log('workForm', this.workForm)
  5552. } else {
  5553. this.workForm = {
  5554. createDate: this.workForm.createDate,
  5555. domains: [{
  5556. id: null,
  5557. projectId: "",
  5558. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5559. content: "",
  5560. progress:100,
  5561. state: 2,
  5562. timeType:0,
  5563. multiWorktime: this.reportTimeType.multiWorktime,
  5564. worktimeList:[{}],
  5565. canEdit: true,
  5566. auditorFirst: '',
  5567. auditorSec: '',
  5568. auditorThird: '',
  5569. ccUserid: ''
  5570. }],
  5571. userId:null,
  5572. userNames:null,
  5573. time: this.report.time
  5574. }
  5575. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5576. this.$set(this.workForm.domains[0],'isOvertime',true)
  5577. if(this.reportTimeType.type != 2){
  5578. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5579. }
  5580. }
  5581. if(this.user.timeType.type == 1) {
  5582. var shuzhi = this.user.timeType.allday + ''
  5583. // console.log('执行一次', shuzhi.indexOf('.'))
  5584. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5585. }
  5586. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5587. //默认给第一个,必填字段
  5588. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5589. }
  5590. this.canEdit = true;
  5591. }
  5592. this.originCanEdit = this.canEdit;
  5593. this.seleChn()
  5594. } else {
  5595. this.$message({
  5596. message: res.msg,
  5597. type: "error"
  5598. });
  5599. }
  5600. },
  5601. error => {
  5602. this.$message({
  5603. message: error,
  5604. type: "error"
  5605. });
  5606. });
  5607. },
  5608. guanbi() {
  5609. this.falsss = false,
  5610. this.workTimeForMinYi=0
  5611. },
  5612. // 打开日报填写
  5613. fillInReport(i, isBatch) {
  5614. this.isWeekend = false
  5615. this.reportCanDelete = false
  5616. // console.log(this.user.timeType.type, '选择时长')
  5617. if(i != 1) {
  5618. this.falsss = false
  5619. } else {
  5620. this.falsss = true
  5621. }
  5622. if (this.isSubstitude) {
  5623. this.getSubstitudeUserDeptList();
  5624. }
  5625. if(i == -1 || this.isSubstitude) {
  5626. this.isDisable = false;
  5627. } else {
  5628. this.isDisable = true;
  5629. }
  5630. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5631. this.isBatch = isBatch;
  5632. if (this.isBatch == 0 && !this.isSubstitude) {
  5633. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5634. let weekday = new Date(this.workForm.createDate).getDay()
  5635. if(this.user.companyId == 817){
  5636. if(weekday == 0){
  5637. this.isWeekend = true
  5638. }
  5639. }else{
  5640. if(weekday == 0 || weekday == 6){
  5641. this.isWeekend = true
  5642. }
  5643. }
  5644. this.getReport(i);
  5645. } else {
  5646. // console.log('执行到了这里')
  5647. this.jsTime = 0
  5648. this.jsDay = 0
  5649. this.workForm = {
  5650. createDate: null,//批量填报没有日期
  5651. domains: [{
  5652. id: null,
  5653. projectId: "",
  5654. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5655. content: "",
  5656. progress:100,
  5657. state: 2,
  5658. timeType:0,
  5659. multiWorktime: this.reportTimeType.multiWorktime,
  5660. worktimeList:[{}],
  5661. canEdit: true,
  5662. }],
  5663. }
  5664. if(this.user.timeType.type == 1) {
  5665. var shuzhi = this.user.timeType.allday + ''
  5666. // console.log('执行二次')
  5667. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5668. }
  5669. // console.log(this.workForm)
  5670. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5671. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5672. }
  5673. this.canEdit = true;
  5674. }
  5675. this.dialogVisible = true;
  5676. },
  5677. //按周填报的弹窗口中编辑单项目相关数据
  5678. setWeekFormReportItem(reportId, i, names, row,sss) {
  5679. console.log(sss)
  5680. this.http.post('/report/getReportById', {
  5681. reportId: reportId
  5682. },
  5683. res => {
  5684. if (res.code == "ok") {
  5685. var data = res.data.report;
  5686. sss.subProjectId = data.subProjectId
  5687. sss.subProjectList = data.subProjectList;
  5688. sss.stage = data.stage
  5689. sss.subProjectList = data.subProjectList
  5690. sss.stages = data.stages
  5691. sss.taskGroups = data.taskGroups;
  5692. sss.auditUserList = data.auditUserList;
  5693. sss.degreeId = data.degreeId;
  5694. sss.customData = data.customData;
  5695. sss.wuduList = data.degreeList;
  5696. this.zhoBaoIdx = i
  5697. this.zhoBaoName = names
  5698. this.zhoBao = sss
  5699. this.zhis = row
  5700. if (sss.groupId) {
  5701. //最后一个参数表示是否保留stage的值,不要重置为空
  5702. this.getGroupStages(this.zhoBao, 0, true)
  5703. }
  5704. this.$forceUpdate();
  5705. }
  5706. });
  5707. },
  5708. // 按周填报里内容的填写
  5709. tianxies(item, i, names, row) {
  5710. if (item.state == 0) {
  5711. this.$message({
  5712. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5713. type: "error"
  5714. });
  5715. return;
  5716. }
  5717. if (item.state == 1) {
  5718. this.$message({
  5719. message: '已通过状态不可修改',
  5720. type: "error"
  5721. });
  5722. return;
  5723. }
  5724. if(this.user.timeType.notAllowedNoAttendance == 1){
  5725. if(this.zhoData[i].corpTime){
  5726. if(this.zhoData[i].corpTime.workHours == 0){
  5727. this.$message({
  5728. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5729. type: 'error'
  5730. })
  5731. return
  5732. }
  5733. }else{
  5734. this.$message({
  5735. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5736. type: 'error'
  5737. })
  5738. return
  5739. }
  5740. }
  5741. var idd = ''
  5742. var obj = {}
  5743. for(var l in this.projectList) {
  5744. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5745. }
  5746. obj.projectId = idd
  5747. this.tianxieDialogVisible = true
  5748. this.scopess = item
  5749. console.log(item, '《==== 当前的对象')
  5750. var sss = {}
  5751. if (item.id != null) {
  5752. sss.id = item.id;
  5753. sss.state = item.state;
  5754. } else {
  5755. sss.id = -1;
  5756. sss.state = 3;
  5757. }
  5758. sss.projectId = idd;
  5759. sss.progress = item.progress
  5760. sss.time = item.time
  5761. sss.content = item.content;
  5762. console.log('333', sss.content)
  5763. if (sss.time == '' && this.reportTimeType.type == 2) {
  5764. //取已填时间范围中最大的一个作为开始时间
  5765. var startTime = '09:00';
  5766. var fillStartTime = '00:00';
  5767. for (var t in this.selProjectList) {
  5768. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5769. if (fillItem.time) {
  5770. if (fillItem.time[1] > fillStartTime) {
  5771. fillStartTime = fillItem.time[1];
  5772. }
  5773. }
  5774. }
  5775. if (fillStartTime == '00:00') {
  5776. fillStartTime = '09:00';
  5777. }
  5778. var fillEndMax = '18:00';
  5779. if (fillStartTime >= '18:00') {
  5780. fillEndMax = '23:59';
  5781. }
  5782. sss.time = [fillStartTime, fillEndMax];
  5783. }
  5784. sss.groupId = item.groupId
  5785. sss.stage = item.stage;
  5786. sss.workingTime = item.workingTime
  5787. sss.projectAuditorId = item.projectAuditorId;
  5788. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5789. //默认选中第一个
  5790. sss.basecostId = this.timeBasecostList[0].id;
  5791. }
  5792. var hasEdited = this.zhoData[i][names].hasEdited;
  5793. if (hasEdited) {
  5794. sss = { ...item }
  5795. //编辑过了
  5796. sss.subProjectId = item.subProjectId
  5797. sss.stage = item.stage
  5798. sss.subProjectList = item.subProjectList
  5799. sss.stages = item.stages
  5800. sss.taskGroups = item.taskGroups;
  5801. console.log(sss.taskGroups, '33333');
  5802. sss.auditUserList = obj.auditUserList;
  5803. sss.degreeId = item.degreeId;
  5804. sss.customData = item.customData;
  5805. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5806. //只有一个审核人,自动设置上去
  5807. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5808. }
  5809. sss.wuduList = item.wuduList;
  5810. this.zhoBaoIdx = i
  5811. this.zhoBaoName = names
  5812. this.zhoBao = sss
  5813. this.zhis = row
  5814. if (sss.groupId) {
  5815. //最后一个参数表示是否保留stage的值,不要重置为空
  5816. this.getGroupStages(this.zhoBao, 0, true)
  5817. }
  5818. this.$forceUpdate();
  5819. this.getWeeklyTaskList(sss)
  5820. console.log('最后的周报 ===>', this.zhoBao)
  5821. } else {
  5822. //第一次打开,获取数据
  5823. if (sss.id == -1) {
  5824. //新填报的
  5825. this.selectProject(obj, 0);
  5826. var that = this
  5827. setTimeout(() =>{
  5828. sss.subProjectId = that.workForm.domains[0].subProjectId
  5829. sss.subProjectList = item.subProjectList;
  5830. sss.stage = that.workForm.domains[0].stage
  5831. sss.subProjectList = that.workForm.domains[0].subProjectList
  5832. sss.stages = that.workForm.domains[0].stages
  5833. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5834. sss.auditUserList = obj.auditUserList;
  5835. sss.degreeId = item.degreeId;
  5836. sss.customData = item.customData;
  5837. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5838. //只有一个审核人,自动设置上去
  5839. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5840. }
  5841. sss.wuduList = row[0].wuduList
  5842. that.zhoBaoIdx = i
  5843. that.zhoBaoName = names
  5844. that.zhoBao = sss
  5845. that.zhis = row
  5846. if (sss.groupId) {
  5847. //最后一个参数表示是否保留stage的值,不要重置为空
  5848. this.getGroupStages(that.zhoBao, 0, false)
  5849. }
  5850. that.$forceUpdate();
  5851. this.getWeeklyTaskList(sss)
  5852. },600);
  5853. } else {
  5854. //编辑填报过的;数据库已经存在的
  5855. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5856. }
  5857. }
  5858. },
  5859. // 按周填报里内容的填写点击确定
  5860. setWeekProItemData() {
  5861. //专业版模式下,任务分组和阶段必填
  5862. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5863. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5864. this.$message({
  5865. message: '任务分组和阶段必填,请检查',
  5866. type: "error"
  5867. });
  5868. return;
  5869. }
  5870. }
  5871. // 检查任务分组
  5872. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  5873. this.$message({
  5874. message: '任务分组必填,请检查',
  5875. type: "error"
  5876. });
  5877. return
  5878. }
  5879. //检查子项目是否必填
  5880. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5881. this.$message({
  5882. message: '子项目必填,请检查',
  5883. type: "error"
  5884. });
  5885. return;
  5886. }
  5887. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5888. this.$message({
  5889. message: this.$t('message.Pleaseselectareviewer'),
  5890. type: "error"
  5891. });
  5892. return
  5893. }
  5894. if(this.user.timeType.reportAuditType == 3){
  5895. let auditTips = ''
  5896. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5897. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5898. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5899. if(auditTips){
  5900. auditTips = auditTips.substring(0,auditTips.length - 1)
  5901. this.$message({
  5902. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5903. type: 'error'
  5904. })
  5905. return
  5906. }
  5907. }
  5908. let errtips = ''
  5909. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5910. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5911. errtips += this.user.timeType.customDegreeName + '、'
  5912. }
  5913. }
  5914. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5915. errtips += this.user.timeType.customDataName + '、'
  5916. }
  5917. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5918. errtips += this.user.timeType.customTextName + '、'
  5919. }
  5920. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5921. errtips += this.$t('other.workMatters') +'、'
  5922. }
  5923. if(errtips){
  5924. errtips = errtips.substring(0,errtips.length - 1)
  5925. this.$message({
  5926. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5927. type: 'error'
  5928. })
  5929. return
  5930. }
  5931. this.tianxieDialogVisible = false
  5932. var zhong = this.zhoData
  5933. this.zhoBao.hasEdited = true;
  5934. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5935. this.zhoData = zhong
  5936. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5937. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5938. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5939. },
  5940. // 获取本周
  5941. getCurrentWeek() {
  5942. //今天
  5943. this.targetWeekDate = new Date();
  5944. this.initWeekFormData();
  5945. // this.jiazai()
  5946. },
  5947. // 获取上周
  5948. handleGetPrevWeek() {
  5949. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5950. this.initWeekFormData();
  5951. // this.jiazai()
  5952. },
  5953. // 获取下周
  5954. handleGetNextvWeek() {
  5955. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5956. this.initWeekFormData()
  5957. },
  5958. // 加载动画
  5959. jiazai() {
  5960. this.weekDataLoading = true
  5961. var that = this
  5962. setTimeout(() =>{
  5963. that.weekDataLoading = false
  5964. },1000);
  5965. },
  5966. // 转时间格式
  5967. dealdate(date) {
  5968. const dt = new Date(date)
  5969. const y = dt.getFullYear()
  5970. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5971. const d = (dt.getDate() + '').padStart(2, '0')
  5972. return `${y}-${m}-${d}`
  5973. },
  5974. // 按周填报
  5975. fillInReportss() {
  5976. window.addEventListener('scroll', this.handleScroll, true)
  5977. // this.jiazai()
  5978. this.fillWeekDialogVisi = true
  5979. this.getCurrentWeek();
  5980. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5981. //重新获取工时预警类型的预算项
  5982. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5983. companyId: this.user.companyId
  5984. },
  5985. res => {
  5986. if (res.code == "ok") {
  5987. this.timeBasecostList = res.data;
  5988. }
  5989. });
  5990. }
  5991. },
  5992. fillInReportCustom() {
  5993. this.weekIndex++
  5994. this.weekParentData = {
  5995. isSubstitude: this.isSubstitude
  5996. }
  5997. this.fillWeekDialogVisiCustom = true
  5998. },
  5999. // 按周填报的项目筛选
  6000. selListFun(){
  6001. this.selProjectList = []
  6002. if(this.selCon.length){
  6003. for (let i = 0; i < this.selCon.length; i++) {
  6004. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6005. }
  6006. this.selConShow = false ;
  6007. for (let i in this.zhoData) {
  6008. var obj = this.zhoData[i];
  6009. for(var j in this.selProjectList) {
  6010. var xinzhi = this.selProjectList[j].projectName
  6011. obj[xinzhi] = {}
  6012. obj[xinzhi].time = ''
  6013. obj[xinzhi].content = ''
  6014. obj[xinzhi].progress = 0
  6015. obj[xinzhi].workingTime = 0
  6016. }
  6017. }
  6018. this.initWeekFormData();
  6019. }else{
  6020. this.$message({
  6021. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6022. type:'error'
  6023. })
  6024. }
  6025. },
  6026. setWeekCardTimeData(list) {
  6027. for(let i in list){
  6028. let datei = '';
  6029. if (this.user.timeType.showDdCardtime == 1) {
  6030. datei = list[i].workDate;
  6031. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6032. datei = list[i].createDate;
  6033. } else if (this.user.timeType.syncFanwei == 1) {
  6034. datei = list[i].workDate;
  6035. }
  6036. for(let m in this.zhoData) {
  6037. if(datei == this.zhoData[m].zhoDataTime){
  6038. let item = {
  6039. startTime: list[i].startTime,
  6040. endTime: list[i].endTime,
  6041. workHours: list[i].workHours
  6042. }
  6043. this.$set(this.zhoData[m],'corpTime',item)
  6044. }
  6045. }
  6046. }
  6047. },
  6048. getWeeklyCardTime(){ //按周填报获取考勤信息
  6049. let dateStr = []
  6050. for(let i in this.zhoData){
  6051. dateStr.push(this.zhoData[i].zhoDataTime)
  6052. }
  6053. this.http.post('/report/getWeeklyCardTime',{
  6054. dateStr: JSON.stringify(dateStr)
  6055. },res => {
  6056. if(res.code == 'ok'){
  6057. for(let i in res.data){
  6058. let datei = '';
  6059. if (this.user.timeType.showDdCardtime == 1) {
  6060. datei = res.data[i].workDate.split('-');
  6061. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6062. datei = res.data[i].createDate.split('-');
  6063. }
  6064. for(let m in this.zhoData){
  6065. let datem = new Date(this.zhoData[m].zhoDataTime)
  6066. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6067. let item = {
  6068. startTime: res.data[i].startTime,
  6069. endTime: res.data[i].endTime,
  6070. workHours: res.data[i].workHours
  6071. }
  6072. this.$set(this.zhoData[m],'corpTime',item)
  6073. }
  6074. }
  6075. }
  6076. }else{
  6077. this.$message({
  6078. message: res.msg,
  6079. type: 'error'
  6080. })
  6081. }
  6082. },err => {
  6083. this.$message({
  6084. message: err,
  6085. type: 'error'
  6086. })
  6087. })
  6088. },
  6089. selListqx(){
  6090. this.fillWeekDialogVisi = false
  6091. this.selProjectList = []
  6092. this.selCon = []
  6093. },
  6094. handleScroll() {
  6095. this.changdu = this.projectList.length + 1
  6096. },
  6097. // 自动选择时间点的事件
  6098. // async zhoTimes(item, i) {
  6099. // var iss = i
  6100. // if(item.time == null) {
  6101. // return
  6102. // } else {
  6103. // const zhi = this.zhoData[iss];
  6104. // let he = 0;
  6105. // const timeArr = Object.values(zhi)
  6106. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6107. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6108. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6109. // console.log(data, 'data');
  6110. // zhi.he = `${he}h`;
  6111. // }
  6112. // },
  6113. async zhoTimes(item, index) {
  6114. const zho = this.zhoData[index];
  6115. if (!item.time) {
  6116. return;
  6117. }
  6118. const timeArr = Object.values(zho)
  6119. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6120. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6121. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6122. zho.he = `${totalHours[0]}h`;
  6123. },
  6124. // 判断两个时间段是否重叠
  6125. timeOverlap(idx, dateAr) {
  6126. let zhi = 0
  6127. for (let k in dateAr) {
  6128. if (idx !== k) {
  6129. 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))) {
  6130. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6131. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6132. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6133. }
  6134. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6135. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6136. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6137. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6138. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6139. } else {
  6140. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6141. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6142. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6143. }
  6144. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6145. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6146. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6147. }
  6148. }
  6149. }
  6150. }
  6151. }
  6152. return zhi
  6153. },
  6154. // 计算时间
  6155. getHourMinutes(str, end) {
  6156. var he = 0
  6157. var date2 = '2021/12/12 ' + end +':00'
  6158. var date1 = '2021/12/12 ' + str +':00'
  6159. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6160. var leave1=date3%(24*3600*1000)
  6161. var hours=Math.floor(leave1/(3600*1000))
  6162. var leave2=leave1%(3600*1000)
  6163. var minutes=Math.floor(leave2/(60*1000))
  6164. var shi = hours+'.'+ minutes
  6165. return he += +shi
  6166. },
  6167. // 自动选择事件长度的事件
  6168. zhoXuan(item, i) {
  6169. var iss = i
  6170. if(item.time == null) {
  6171. return
  6172. } else {
  6173. var zhi = this.zhoData[iss]
  6174. var he = 0
  6175. for(var i in zhi) {
  6176. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6177. he += +zhi[i].workingTime
  6178. }
  6179. }
  6180. zhi.he = he + 'h'
  6181. }
  6182. },
  6183. getPushWorkLogData(){
  6184. this.http.post('/sap-sync-log/list', {},
  6185. res => {
  6186. if (res.code == "ok") {
  6187. this.pushWorkTimeLogData = res.data;
  6188. } else {
  6189. this.$message({
  6190. message: res.msg,
  6191. type: "error"
  6192. });
  6193. }
  6194. },
  6195. error => {
  6196. this.$message({
  6197. message: error,
  6198. type: "error"
  6199. });
  6200. });
  6201. },
  6202. // 获取全部人员
  6203. getUsers() {
  6204. this.http.post('/user/getSimpleActiveUserList', {},
  6205. res => {
  6206. if (res.code == "ok") {
  6207. this.usersList = res.data;
  6208. } else {
  6209. this.$message({
  6210. message: res.msg,
  6211. type: "error"
  6212. });
  6213. }
  6214. },
  6215. error => {
  6216. this.$message({
  6217. message: error,
  6218. type: "error"
  6219. });
  6220. });
  6221. },
  6222. // 按时间比例
  6223. addBli(item, i) {
  6224. var iss = i
  6225. if(item.time == null) {
  6226. return
  6227. } else {
  6228. var zhi = this.zhoData[iss]
  6229. var he = 0
  6230. for(var i in zhi) {
  6231. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6232. he += +zhi[i].workingTime
  6233. }
  6234. }
  6235. zhi.he = he.toFixed(1) + 'h'
  6236. }
  6237. },
  6238. //按周填报选择的项目发生变化,需要设置列
  6239. onSelProjectChange() {
  6240. for (let i = 0; i < this.selCon.length; i++) {
  6241. var exists = false;
  6242. for (let j = 0; j < this.selProjectList.length; j++) {
  6243. if (this.selProjectList[j].id == this.selCon[i]) {
  6244. exists = true;
  6245. break;
  6246. }
  6247. }
  6248. if (!exists) {
  6249. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6250. this.selProjectList.push(newProject);
  6251. //添加新项目
  6252. for (var w in this.zhoData) {
  6253. var dayItem = this.zhoData[w];
  6254. var pName = newProject.projectName;
  6255. dayItem[pName] = {};
  6256. dayItem[pName].time = ''
  6257. dayItem[pName].content = ''
  6258. dayItem[pName].progress = 0
  6259. dayItem[pName].workingTime = 0
  6260. }
  6261. }
  6262. }
  6263. //去掉
  6264. for (let j = 0; j < this.selProjectList.length; j++) {
  6265. var exists = false;
  6266. for (let i = 0; i < this.selCon.length; i++) {
  6267. if (this.selProjectList[j].id == this.selCon[i]) {
  6268. exists = true;
  6269. break;
  6270. }
  6271. }
  6272. if (!exists) {
  6273. this.selProjectList.splice(j, 1);
  6274. j--;
  6275. }
  6276. }
  6277. this.loadFilledWeekReportItem();
  6278. //刷新表格
  6279. // this.$refs.weekTable.doLayout();
  6280. },
  6281. //根据选中的项目来刷新填写表格
  6282. loadFilledWeekReportItem() {
  6283. for (var w in this.zhoData) {
  6284. var dayItem = this.zhoData[w];
  6285. for (var i = 0; i < this.selProjectList.length; i++) {
  6286. var curColumnProject = this.selProjectList[i];
  6287. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6288. for (var t in dayItem.reportList) {
  6289. //有日报的项目,不能取消选择
  6290. for (var p in this.fillProjectList) {
  6291. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6292. }
  6293. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6294. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6295. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6296. if (this.reportTimeType.type == 2) {
  6297. //时间段模式
  6298. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6299. }
  6300. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6301. break;
  6302. }
  6303. }
  6304. // dayItem[curColumnProject.projectName] = matchReportItem;
  6305. }
  6306. }
  6307. this.$nextTick(()=>{
  6308. this.$refs.weekTable.doLayout();
  6309. });
  6310. },
  6311. initWeekFormData() {
  6312. this.weekDataLoading = true;
  6313. for (var p in this.fillProjectList) {
  6314. this.fillProjectList[p].canCancel = 1;
  6315. }
  6316. this.http.post('/report/getWeeklyReportData',{
  6317. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6318. },res => {
  6319. this.weekDataLoading = false;
  6320. if(res.code == 'ok'){
  6321. let projectList = res.data.projectList;
  6322. if (projectList.length > 0) {
  6323. //有选择过项目进行填报,直接选中
  6324. this.selProjectList = projectList;
  6325. this.selCon = [];
  6326. for (let i = 0; i < projectList.length; i++) {
  6327. this.selCon.push(projectList[i].id);
  6328. }
  6329. }
  6330. //设置日期
  6331. this.weekDateRange = res.data.dateList;
  6332. this.zhoData = [];
  6333. var arrst = []
  6334. for(var i in this.weekDateRange) {
  6335. var obj = {}
  6336. obj.zhoDataTime = this.weekDateRange[i].date
  6337. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6338. obj.he = this.weekDateRange[i].filledTime;
  6339. obj.canFill = this.weekDateRange[i].canFill;
  6340. // obj.filledTime = this.weekDateRange[i].filledTime;
  6341. obj.reportList = this.weekDateRange[i].reportList;
  6342. //初始化,防止渲染报错
  6343. for (var j = 0; j < this.selProjectList.length; j++) {
  6344. var pName = this.selProjectList[j].projectName
  6345. obj[pName] = {}
  6346. obj[pName].time = ''
  6347. obj[pName].content = ''
  6348. obj[pName].progress = 0
  6349. obj[pName].workingTime = 0
  6350. }
  6351. arrst.push(obj)
  6352. }
  6353. this.zhoData = arrst
  6354. this.setWeekCardTimeData(res.data.cardTimeList);
  6355. this.loadFilledWeekReportItem();
  6356. }else{
  6357. this.$message({
  6358. message: res.msg,
  6359. type: 'error'
  6360. })
  6361. }
  6362. },err => {
  6363. this.$message({
  6364. message: err,
  6365. type: 'error'
  6366. })
  6367. })
  6368. },
  6369. zhoZhi(res, i) {
  6370. var zhi = 0
  6371. for(var i in res) {
  6372. if(i != 'zhoDataTime' && i != 'he') {
  6373. zhi += +res[i]
  6374. }
  6375. }
  6376. res.he = zhi
  6377. },
  6378. zhoBtn(i) {
  6379. // this.zhoData.split(i, 1)
  6380. var arr = this.zhoData
  6381. arr.splice(i, 1)
  6382. },
  6383. zhoAddlast(){
  6384. this.selConShow = true
  6385. },
  6386. closeAddWeeklyReport(){
  6387. this.fillWeekDialogVisi = false
  6388. this.selConShow = true
  6389. this.selProjectList = []
  6390. this.selCon = []
  6391. },
  6392. // 提交按周填报
  6393. submitWeekReport(isDraft) {
  6394. var zhi = this.zhoData
  6395. var ll = 0
  6396. if(this.reportTimeType.type == 2) {
  6397. for(var i in zhi) {
  6398. this.dateAr = []
  6399. var alp = []
  6400. var zhis = zhi[i]
  6401. console.log(zhis)
  6402. for(var j in zhis) {
  6403. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6404. let objs = {}
  6405. objs.s = zhis[j].time[0]
  6406. objs.e = zhis[j].time[1]
  6407. objs.p = j
  6408. alp.push(objs)
  6409. }
  6410. }
  6411. console.log(alp)
  6412. this.dateAr = alp
  6413. if (this.reportTimeType.timeCanOverlap == 0) {
  6414. let str = this.$t('message.Filledtimeperiodsoverlap')
  6415. if(this.dateAr.length > 0) {
  6416. const trus = this.fns();
  6417. const overlapDataTime = this.getOverlapData(alp);
  6418. if (overlapDataTime.length > 0) {
  6419. const arrList = overlapDataTime.map((item) => item.p);
  6420. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6421. }
  6422. ll += 1
  6423. if(!trus) {
  6424. this.$message({
  6425. message: str,
  6426. type: 'error'
  6427. })
  6428. return false
  6429. }
  6430. }
  6431. } else {
  6432. if(this.dateAr.length > 0) {
  6433. ll +=1 ;
  6434. }
  6435. }
  6436. }
  6437. if(ll == 0) {
  6438. this.$message({
  6439. message: this.$t('message.Pleasefillinthetime'),
  6440. type: 'error'
  6441. })
  6442. return false
  6443. }
  6444. } else if(this.reportTimeType.type == 1){
  6445. for(var i in zhi) {
  6446. var zhis = zhi[i]
  6447. for(var j in zhis) {
  6448. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6449. ll += 1
  6450. }
  6451. }
  6452. }
  6453. if(ll == 0) {
  6454. this.$message({
  6455. message: this.$t('message.Pleaseselectatime'),
  6456. type: 'error'
  6457. })
  6458. return false
  6459. }
  6460. let overcorp = ''
  6461. for(let n in zhi){
  6462. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6463. overcorp += zhi[n].zhoDataTime + ','
  6464. }
  6465. }
  6466. if(overcorp != ''){
  6467. overcorp = overcorp.substring(0,overcorp.length - 1)
  6468. this.$message({
  6469. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6470. type: 'error'
  6471. })
  6472. return
  6473. }
  6474. }
  6475. var submits = []
  6476. let formData = new FormData();
  6477. formData.append("draft", isDraft);
  6478. if(this.reportTimeType.multiWorktime == 1){
  6479. for (var i in this.zhoData) {
  6480. var zhoD = this.zhoData[i]
  6481. var flgs = false
  6482. for(var j in zhoD) {
  6483. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6484. flgs = true
  6485. // formData.append("degreeId", "-1");
  6486. formData.append("id", '-1');
  6487. for(var s in this.projectList) {
  6488. if(j == this.projectList[s].projectName) {
  6489. formData.append("projectId", this.projectList[s].id);
  6490. }
  6491. }
  6492. if(this.user.timeType.reportAuditType == 3){
  6493. let audItem = {}
  6494. if(this.user.timeType.auditLevel > 0){
  6495. audItem.auditorFirst = zhoD[j].auditorFirst
  6496. }
  6497. if(this.user.timeType.auditLevel > 1){
  6498. audItem.auditorSec = zhoD[j].auditorSec
  6499. }
  6500. if(this.user.timeType.auditLevel > 2){
  6501. audItem.auditorThird = zhoD[j].auditorThird
  6502. }
  6503. if(zhoD[j].ccUserid){
  6504. audItem.ccUserid = zhoD[j].ccUserid
  6505. }
  6506. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6507. }
  6508. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6509. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6510. formData.append("reportTimeType", this.reportTimeType.type);
  6511. formData.append("endTime", '');
  6512. formData.append("startTime", '');
  6513. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6514. var lix = []
  6515. var objjs = {}
  6516. objjs.startTime = zhoD[j].time[0]
  6517. objjs.endTime = zhoD[j].time[1]
  6518. if (zhoD[j].content == null || zhoD[j].content == '') {
  6519. zhoD[j].content == '-'
  6520. }
  6521. objjs.content = zhoD[j].content
  6522. lix.push(objjs)
  6523. var zhiZhi = JSON.stringify(lix)
  6524. zhiZhi = zhiZhi.replace(/,/g,"@");
  6525. formData.append("content", zhiZhi)
  6526. formData.append("isOvertime", 0)
  6527. formData.append("professionProgress", "[]")
  6528. if (zhoD[j].groupId) {
  6529. formData.append("groupId",zhoD[j].groupId)
  6530. } else {
  6531. //解决后台groupId数组越界的问题
  6532. formData.append("groupId",0)
  6533. }
  6534. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6535. formData.append("createDate",zhoD.zhoDataTime)
  6536. if (zhoD[j].projectAuditorId) {
  6537. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6538. }
  6539. if(zhoD[j].basecostId) {
  6540. formData.append("basecostId", zhoD[j].basecostId);
  6541. } else {
  6542. formData.append("basecostId", 0);
  6543. }
  6544. if(this.user.timeType.customDegreeActive){
  6545. if (this.user.timeType.customDegreeMultiple) {
  6546. if (zhoD[j].multiDegrIdArray) {
  6547. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6548. } else {
  6549. formData.append('multiDegrId','[]')
  6550. }
  6551. } else {
  6552. if (zhoD[j].degreeId) {
  6553. formData.append('degreeId',zhoD[j].degreeId)
  6554. } else {
  6555. formData.append('degreeId','-1')
  6556. }
  6557. }
  6558. }else{
  6559. formData.append("degreeId", "-1");
  6560. }
  6561. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6562. formData.append('customData',zhoD[j].customData)
  6563. }else if(this.user.timeType.customDataActive){
  6564. formData.append('customData',0)
  6565. }
  6566. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6567. formData.append('customText',zhoD[j].customText)
  6568. }else if(this.user.timeType.customTextActive){
  6569. formData.append('customText','-')
  6570. }
  6571. }
  6572. }
  6573. }
  6574. } else {
  6575. for (var i in this.zhoData) {
  6576. var zhoD = this.zhoData[i]
  6577. var flgs = false
  6578. if(this.reportTimeType.type == 2) {
  6579. for(var k in this.selProjectList) {
  6580. var pItem = this.selProjectList[k];
  6581. var pName = pItem.projectName;
  6582. var j = pName;
  6583. console.log('j==周报中的项目='+j);
  6584. if(zhoD[j].time && zhoD[j].time != 'null') {
  6585. flgs = true
  6586. // formData.append("degreeId", "-1");
  6587. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6588. for(var s in this.projectList) {
  6589. if(j == this.projectList[s].projectName) {
  6590. formData.append("projectId", this.projectList[s].id);
  6591. }
  6592. }
  6593. if(this.user.timeType.reportAuditType == 3){
  6594. let audItem = {}
  6595. if(this.user.timeType.auditLevel > 0){
  6596. audItem.auditorFirst = zhoD[j].auditorFirst
  6597. }
  6598. if(this.user.timeType.auditLevel > 1){
  6599. audItem.auditorSec = zhoD[j].auditorSec
  6600. }
  6601. if(this.user.timeType.auditLevel > 2){
  6602. audItem.auditorThird = zhoD[j].auditorThird
  6603. }
  6604. if(zhoD[j].ccUserid){
  6605. audItem.ccUserid = zhoD[j].ccUserid
  6606. }
  6607. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6608. }
  6609. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6610. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6611. formData.append("reportTimeType", this.reportTimeType.type);
  6612. formData.append("endTime", zhoD[j].time[1]);
  6613. formData.append("startTime", zhoD[j].time[0]);
  6614. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6615. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6616. formData.append("isOvertime", 0)
  6617. formData.append("professionProgress", "[]")
  6618. if (zhoD[j].groupId) {
  6619. formData.append("groupId",zhoD[j].groupId)
  6620. } else {
  6621. //解决后台groupId数组越界的问题
  6622. formData.append("groupId",0)
  6623. }
  6624. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6625. formData.append("createDate",zhoD.zhoDataTime)
  6626. if (zhoD[j].projectAuditorId) {
  6627. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6628. }
  6629. if(zhoD[j].basecostId) {
  6630. formData.append("basecostId", zhoD[j].basecostId);
  6631. } else {
  6632. formData.append("basecostId", 0);
  6633. }
  6634. if(this.user.timeType.customDegreeActive){
  6635. if (this.user.timeType.customDegreeMultiple) {
  6636. if (zhoD[j].multiDegrIdArray) {
  6637. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6638. } else {
  6639. formData.append("multiDegrId", "[]");
  6640. }
  6641. } else {
  6642. if (zhoD[j].degreeId) {
  6643. formData.append('degreeId',zhoD[j].degreeId)
  6644. } else {
  6645. formData.append("degreeId", "-1");
  6646. }
  6647. }
  6648. }else{
  6649. formData.append("degreeId", "-1");
  6650. }
  6651. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6652. formData.append('customData',zhoD[j].customData)
  6653. }else if(this.user.timeType.customDataActive){
  6654. formData.append('customData',0)
  6655. }
  6656. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6657. formData.append('customText',zhoD[j].customText)
  6658. }else if(this.user.timeType.customTextActive){
  6659. formData.append('customText','-')
  6660. }
  6661. }
  6662. }
  6663. } else {
  6664. for(var k in this.selProjectList) {
  6665. var pItem = this.selProjectList[k];
  6666. var pName = pItem.projectName;
  6667. var j = pName;
  6668. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6669. flgs = true
  6670. // formData.append("degreeId", "-1");
  6671. console.log('进入了workFpppp==='+j);
  6672. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6673. for(var s in this.projectList) {
  6674. if(j == this.projectList[s].projectName) {
  6675. formData.append("projectId", this.projectList[s].id);
  6676. }
  6677. }
  6678. if(this.user.timeType.reportAuditType == 3){
  6679. let audItem = {}
  6680. if(this.user.timeType.auditLevel > 0){
  6681. audItem.auditorFirst = zhoD[j].auditorFirst
  6682. }
  6683. if(this.user.timeType.auditLevel > 1){
  6684. audItem.auditorSec = zhoD[j].auditorSec
  6685. }
  6686. if(this.user.timeType.auditLevel > 2){
  6687. audItem.auditorThird = zhoD[j].auditorThird
  6688. }
  6689. if(zhoD[j].ccUserid){
  6690. audItem.ccUserid = zhoD[j].ccUserid
  6691. }
  6692. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6693. }
  6694. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6695. // formData.append("subProjectId", zhoD[j].subProjectId);
  6696. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6697. formData.append("reportTimeType", this.reportTimeType.type);
  6698. if(this.reportTimeType.type == 1) {
  6699. formData.append("workingTime", zhoD[j].workingTime);
  6700. } else if(this.reportTimeType.type == 2) {
  6701. formData.append("endTime", zhoD[j].time[1]);
  6702. formData.append("startTime", zhoD[j].time[0]);
  6703. } else if(this.reportTimeType.type == 3) {
  6704. formData.append("progress", zhoD[j].progress);
  6705. formData.append("workingTime", zhoD[j].workingTime);
  6706. }
  6707. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6708. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6709. formData.append("isOvertime", 0)
  6710. formData.append("professionProgress", "[]")
  6711. if (zhoD[j].groupId) {
  6712. formData.append("groupId",zhoD[j].groupId)
  6713. } else {
  6714. //解决后台groupId数组越界的问题
  6715. formData.append("groupId",0)
  6716. }
  6717. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6718. formData.append("createDate",zhoD.zhoDataTime)
  6719. if (zhoD[j].projectAuditorId) {
  6720. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6721. }
  6722. if(zhoD[j].basecostId) {
  6723. formData.append("basecostId", zhoD[j].basecostId);
  6724. } else {
  6725. formData.append("basecostId", 0);
  6726. }
  6727. if(this.user.timeType.customDegreeActive){
  6728. if (this.user.timeType.customDegreeMultiple) {
  6729. if (zhoD[j].multiDegrIdArray) {
  6730. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6731. } else {
  6732. formData.append("multiDegrId", "[]");
  6733. }
  6734. } else {
  6735. if (zhoD[j].degreeId) {
  6736. formData.append('degreeId',zhoD[j].degreeId)
  6737. } else {
  6738. formData.append("degreeId", "-1");
  6739. }
  6740. }
  6741. }else{
  6742. formData.append("degreeId", "-1");
  6743. }
  6744. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6745. formData.append('customData',zhoD[j].customData)
  6746. }else if(this.user.timeType.customDataActive){
  6747. formData.append('customData',0)
  6748. }
  6749. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6750. formData.append('customText',zhoD[j].customText)
  6751. }else if(this.user.timeType.customTextActive){
  6752. formData.append('customText','-')
  6753. }
  6754. }
  6755. }
  6756. }
  6757. }
  6758. }
  6759. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6760. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6761. if(!next) {
  6762. this.$message({
  6763. message: `【${error.join('、')}】请填写任务分组`,
  6764. type: 'error'
  6765. })
  6766. return
  6767. }
  6768. // 自定义维度
  6769. this.submitingReport = true;
  6770. this.http.uploadFile( this.port.report.editPort, formData,
  6771. res => {
  6772. // this.listLoading = false;
  6773. this.submitingReport = false;
  6774. if (res.code == "ok") {
  6775. this.$message({
  6776. message: this.$t('message.fillinsuccessfully'),
  6777. type: "success"
  6778. });
  6779. this.fillWeekDialogVisi = false
  6780. this.selConShow = true
  6781. this.zhoData = []
  6782. this.weekDateRange = ''
  6783. this.getReportList();
  6784. this.getDepartment();
  6785. // 关闭弹窗 并 清空
  6786. this.selProjectList = []
  6787. this.selCon = []
  6788. this.getRecentlyProject()
  6789. } else {
  6790. this.$message({
  6791. message: res.msg,
  6792. type: "error"
  6793. });
  6794. }
  6795. },
  6796. error => {
  6797. this.submitingReport = false;
  6798. this.$message({
  6799. message: error,
  6800. type: "error"
  6801. });
  6802. });
  6803. },
  6804. handleGroupAuditorData(data) {
  6805. const { reportAuditType } = this.user.timeType
  6806. if(reportAuditType != 1 && reportAuditType != 2) {
  6807. return {next: true}
  6808. }
  6809. let arrList = [];
  6810. Object.entries(data).forEach(([key, obj]) => {
  6811. Object.entries(obj).forEach(([projectName, projectData]) => {
  6812. if (projectData.workingTime && !projectData.groupId) {
  6813. arrList.push({
  6814. projectName,
  6815. date: obj.zhoDataTime,
  6816. dateText: obj.zhoDataTimeTxt
  6817. });
  6818. }
  6819. });
  6820. });
  6821. if(arrList.length > 0) {
  6822. return {
  6823. next: false,
  6824. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6825. }
  6826. } else {
  6827. return {
  6828. next: true,
  6829. error: [],
  6830. }
  6831. }
  6832. },
  6833. ChangeHourMinutestr (str) {
  6834. if (str !== "0" && str !== "" && str !== null) {
  6835. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6836. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6837. } else {
  6838. return "";
  6839. }
  6840. },
  6841. // 得到两个日期中间的日期
  6842. getdiffdate(stime,etime){
  6843. //初始化日期列表,数组
  6844. var diffdate = new Array();
  6845. var i=0;
  6846. //开始日期小于等于结束日期,并循环
  6847. while(stime<=etime){
  6848. diffdate[i] = stime;
  6849. //获取开始日期时间戳
  6850. var stime_ts = new Date(stime).getTime();
  6851. //增加一天时间戳后的日期
  6852. var next_date = stime_ts + (24*60*60*1000);
  6853. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6854. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6855. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6856. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6857. stime = next_dates_y+next_dates_m+next_dates_d;
  6858. //增加数组key
  6859. i++;
  6860. }
  6861. return diffdate;
  6862. },
  6863. // 添加模块
  6864. addDomain(i) {
  6865. var leftProgress = 10;
  6866. if (this.reportTimeType.type == 3) {
  6867. //计算已经待分配工时比例
  6868. let array = this.workForm.domains;
  6869. let totalProgress = 0;
  6870. for (var i=0;i<array.length; i++) {
  6871. totalProgress += array[i].progress;
  6872. }
  6873. if (totalProgress < 100) {
  6874. leftProgress = 100 - totalProgress;
  6875. }
  6876. }
  6877. var addItem = {
  6878. projectId: "",
  6879. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6880. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6881. ),
  6882. content: "",
  6883. progress:leftProgress,
  6884. state:2,//2-表示待提交
  6885. multiWorktime: this.reportTimeType.multiWorktime,
  6886. worktimeList:[{}],
  6887. canEdit: true,
  6888. auditorFirst: '',
  6889. auditorSec: '',
  6890. auditorThird: '',
  6891. ccUserid: ''
  6892. // degreeId: '',
  6893. };
  6894. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6895. this.$set(addItem,'isOvertime',true)
  6896. if(this.reportTimeType.type == 3){
  6897. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6898. }
  6899. }
  6900. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6901. //默认给第一个,必填字段
  6902. addItem.basecostId = this.timeBasecostList[0].id;
  6903. }
  6904. this.workForm.domains.push(addItem);
  6905. document.getElementById('workFormsItemBottom').scrollIntoView()
  6906. this.canEdit = true
  6907. if (this.reportTimeType.type == 0) {
  6908. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6909. var length = this.workForm.domains.length;
  6910. if (length == 2) {
  6911. this.showAddMore = false;
  6912. }
  6913. }
  6914. this.chuji()
  6915. this.seleChn()
  6916. },
  6917. // 移除模块
  6918. delDomain(i) {
  6919. this.workForm.domains.splice(i,1)
  6920. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6921. if (!this.originCanEdit) {
  6922. let iscan = false
  6923. for(let i in this.workForm.domains){
  6924. if(this.workForm.domains[i].canEdit){
  6925. iscan = true
  6926. }
  6927. }
  6928. this.canEdit = iscan
  6929. }
  6930. //检测当前剩下的一个,时间类型是否是全天
  6931. if (this.reportTimeType.type == 0) {
  6932. if (this.workForm.domains[0].timeType == 0) {
  6933. this.showAddMore = false;
  6934. } else {
  6935. this.showAddMore = true;
  6936. }
  6937. }
  6938. if(this.user.timeType.multiWorktime == 1) {
  6939. this.iptChangs()
  6940. } else {
  6941. this.seleChn(0)
  6942. }
  6943. },
  6944. // 改变月份
  6945. changeMonth() {
  6946. this.isWeekend = false
  6947. let date = new Date()
  6948. let nowmon = date.getMonth() + 1
  6949. let nowday = date.getDate()
  6950. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6951. if (this.isBatch == 0) {
  6952. if(this.user.timeType.fillAhead == 0){
  6953. let date_a = new Date(this.workForm.createDate)
  6954. if(date_a.getTime() > date.getTime()){
  6955. this.workForm.createDate = nowdate
  6956. }
  6957. }
  6958. //只有按天填报才能获取当天的日报
  6959. if(!this.isSubstitude){
  6960. let weekday = new Date(this.workForm.createDate).getDay()
  6961. if(this.user.companyId == 817){
  6962. if(weekday == 0){
  6963. this.isWeekend = true
  6964. }
  6965. }else{
  6966. if(weekday == 0 || weekday == 6){
  6967. this.isWeekend = true
  6968. }
  6969. }
  6970. this.getReport()
  6971. }
  6972. }else {
  6973. if(this.user.timeType.fillAhead == 0){
  6974. let date_a = new Date(this.workForm.createDate[1])
  6975. if(date_a.getTime() > date.getTime()){
  6976. this.workForm.createDate[1] = nowdate
  6977. let sdate = new Date(this.workForm.createDate[0])
  6978. let edate = new Date(this.workForm.createDate[1])
  6979. if(sdate > edate){
  6980. this.workForm.createDate[0] = this.workForm.createDate[1]
  6981. }
  6982. }
  6983. }
  6984. }
  6985. },
  6986. // 判断时间段
  6987. fns() {
  6988. for (let k in this.dateAr) {
  6989. if (!this.judege(k)) {
  6990. return false
  6991. }
  6992. }
  6993. return true
  6994. },
  6995. judege(idx){
  6996. for (let k in this.dateAr) {
  6997. if (idx !== k) {
  6998. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6999. return false
  7000. }
  7001. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7002. return false
  7003. }
  7004. }
  7005. }
  7006. return true
  7007. },
  7008. getOverlapData(data) {
  7009. let overlapData = [];
  7010. for (let i = 0; i < data.length; i++) {
  7011. for (let j = i + 1; j < data.length; j++) {
  7012. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7013. overlapData.push(data[i], data[j]);
  7014. }
  7015. }
  7016. }
  7017. return overlapData;
  7018. },
  7019. // 保存日报111111
  7020. submitReport(isDraft) {
  7021. this.isDraft = isDraft;
  7022. this.$refs.workForm.validate(valid => {
  7023. if (valid) {
  7024. if(this.totalReportHours < this.user.timeType.allday){
  7025. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7026. confirmButtonText: '确定',
  7027. cancelButtonText: '取消',
  7028. type: 'warning'
  7029. }).then(() => {
  7030. this.submitReportSon()
  7031. }).catch(() => {
  7032. });
  7033. }else{
  7034. this.submitReportSon()
  7035. }
  7036. }
  7037. });
  7038. },
  7039. submitReportSon() {
  7040. this.dateAr = []
  7041. //检查重叠
  7042. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7043. let alp = []
  7044. if(this.user.timeType.multiWorktime != 1) {
  7045. for(var p in this.workForm.domains) {
  7046. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7047. let objs = {}
  7048. objs.s = this.workForm.domains[p].startTime
  7049. objs.e = this.workForm.domains[p].endTime
  7050. alp.push(objs)
  7051. }
  7052. }
  7053. this.dateAr = alp
  7054. if(this.dateAr.length > 0) {
  7055. let trus = this.fns()
  7056. if(!trus) {
  7057. this.$message({
  7058. message: this.$t('message.Filledtimeperiodsoverlap'),
  7059. type: "error"
  7060. });
  7061. return
  7062. }
  7063. }
  7064. } else {
  7065. for(var p in this.workForm.domains) {
  7066. var slll = this.workForm.domains[p]
  7067. for(var o in slll.worktimeList) {
  7068. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7069. let objs = {}
  7070. objs.s = slll.worktimeList[o].startTime
  7071. objs.e = slll.worktimeList[o].endTime
  7072. alp.push(objs)
  7073. }
  7074. }
  7075. }
  7076. this.dateAr = alp
  7077. if(this.dateAr.length > 0) {
  7078. let trus = this.fns()
  7079. if(!trus) {
  7080. this.$message({
  7081. message: this.$t('message.Filledtimeperiodsoverlap'),
  7082. type: "error"
  7083. });
  7084. return
  7085. }
  7086. }
  7087. }
  7088. }
  7089. //检查子项目
  7090. if (this.user.timeType.subProMustFill == 1) {
  7091. for(var p in this.workForm.domains) {
  7092. var oneProItem = this.workForm.domains[p]
  7093. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7094. //没有选择子项目
  7095. this.$message({
  7096. message: '子项目必填,请检查',
  7097. type: "error"
  7098. });
  7099. return
  7100. }
  7101. }
  7102. }
  7103. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7104. if (this.user.companyId == this.yuzhongCompId) {
  7105. for(var p in this.workForm.domains) {
  7106. var oneProItem = this.workForm.domains[p]
  7107. if (!oneProItem.extraField1) {
  7108. this.$message({
  7109. message: '角色必填,请检查',
  7110. type: "error"
  7111. });
  7112. return
  7113. }
  7114. if (!oneProItem.extraField2) {
  7115. this.$message({
  7116. message: '工作职责必填,请检查',
  7117. type: "error"
  7118. });
  7119. return
  7120. }
  7121. if (!oneProItem.extraField3) {
  7122. this.$message({
  7123. message: '工作内容必填,请检查',
  7124. type: "error"
  7125. });
  7126. return
  7127. }
  7128. }
  7129. }
  7130. // return
  7131. //代填的情况,检查人员是否已经选择
  7132. if (this.isSubstitude) {
  7133. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7134. this.$message({
  7135. message: this.$t('message.pleaseselectthepersontofillin'),
  7136. type: "error"
  7137. });
  7138. return;
  7139. }
  7140. }
  7141. //检查时间,全天和上下午不能同时存在
  7142. if (this.reportTimeType.type == 0) {
  7143. var alldayNum = 0;
  7144. var amNum = 0;
  7145. var pmNum = 0;
  7146. for(var i in this.workForm.domains) {
  7147. if (this.workForm.domains[i].timeType == 0) {
  7148. alldayNum ++;
  7149. } else if (this.workForm.domains[i].timeType == 1) {
  7150. amNum++;
  7151. } else if (this.workForm.domains[i].timeType == 2) {
  7152. pmNum++;
  7153. }
  7154. }
  7155. if (alldayNum > 1) {
  7156. this.$message({
  7157. // message: "工作时间-全天,只能选择一次",
  7158. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7159. type: "error"
  7160. });
  7161. return;
  7162. }
  7163. if (amNum > 1) {
  7164. this.$message({
  7165. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7166. type: "error"
  7167. });
  7168. return;
  7169. }
  7170. if (pmNum > 1) {
  7171. this.$message({
  7172. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7173. type: "error"
  7174. });
  7175. return;
  7176. }
  7177. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7178. this.$message({
  7179. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7180. type: "error"
  7181. });
  7182. return;
  7183. }
  7184. } else if (this.reportTimeType.type == 3) {
  7185. //总百分比不能超过100%
  7186. let total = 0;
  7187. this.workForm.domains.forEach(w=>{total += w.progress});
  7188. if (total > 100) {
  7189. this.$message({
  7190. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7191. type: "error"
  7192. });
  7193. return;
  7194. } else if (total < 100) {
  7195. this.$message({
  7196. message: this.$t('message.cannotbesubmitted'),
  7197. type: "error"
  7198. });
  7199. return;
  7200. }
  7201. }
  7202. this.listLoading = true;
  7203. let formData = new FormData();
  7204. formData.append("draft", this.isDraft);
  7205. var totalTime = 0;
  7206. for (var t=0;t<this.workForm.domains.length; t++) {
  7207. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7208. }
  7209. //批量填报不校验考勤时长,交给后台校验
  7210. if (!this.isBatch) {
  7211. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7212. if (this.workForm.time){
  7213. if (this.workForm.time.workHours == 0){
  7214. this.$message({
  7215. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7216. type: 'error'
  7217. })
  7218. return
  7219. }
  7220. }else{
  7221. this.$message({
  7222. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7223. type: 'error'
  7224. })
  7225. return
  7226. }
  7227. }
  7228. }
  7229. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7230. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7231. this.$message({
  7232. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7233. type: "error"
  7234. });
  7235. return;
  7236. }
  7237. }
  7238. for(var i in this.workForm.domains) {
  7239. // 检查任务/里程碑是否为必填
  7240. let taskRequired = this.user.timeType.taskRequired
  7241. if(taskRequired == 1) {
  7242. if(!this.workForm.domains[i].taskId) {
  7243. this.$message({
  7244. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7245. type: "error"
  7246. });
  7247. return
  7248. }
  7249. }
  7250. if(this.user.timeType.reportAuditType == 3){
  7251. let audItem = {}
  7252. let auditRule = ''
  7253. if(this.workForm.domains[i].id){
  7254. audItem.reportId = this.workForm.domains[i].id
  7255. }
  7256. if(this.user.timeType.auditLevel > 0){
  7257. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7258. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7259. }
  7260. if(this.user.timeType.auditLevel > 1){
  7261. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7262. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7263. }
  7264. if(this.user.timeType.auditLevel > 2){
  7265. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7266. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7267. }
  7268. if(this.workForm.domains[i].ccUserid){
  7269. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7270. }
  7271. if(auditRule){
  7272. auditRule = auditRule.substring(0,auditRule.length - 1)
  7273. this.$message({
  7274. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7275. type: 'error'
  7276. })
  7277. return
  7278. }
  7279. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7280. }
  7281. if (this.user.timeType.customDegreeActive) {
  7282. if (this.user.timeType.customDegreeMultiple) {
  7283. //多选
  7284. if (this.workForm.domains[i].multiDegrIdArray) {
  7285. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7286. degreeArray = degreeArray.replace(/,/g,"@");
  7287. formData.append("multiDegrId", degreeArray);
  7288. } else {
  7289. formData.append("multiDegrId", '[]');
  7290. }
  7291. } else {
  7292. //单选
  7293. if (this.workForm.domains[i].degreeId) {
  7294. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7295. } else {
  7296. formData.append("degreeId", -1);
  7297. }
  7298. }
  7299. } else {
  7300. formData.append("degreeId", -1);
  7301. }
  7302. if(this.workForm.domains[i].customData) {
  7303. // var sss = this.workForm.domains[i].degreeId.toString()
  7304. formData.append("customData", this.workForm.domains[i].customData);
  7305. } else {
  7306. formData.append("customData", 0);
  7307. }
  7308. if(this.workForm.domains[i].customText) {
  7309. formData.append("customText", this.workForm.domains[i].customText);
  7310. } else {
  7311. formData.append("customText", '-');
  7312. }
  7313. if (this.workForm.domains[i].id) {
  7314. formData.append("id", this.workForm.domains[i].id);
  7315. } else {
  7316. formData.append("id", -1);
  7317. }
  7318. formData.append("projectId", this.workForm.domains[i].projectId);
  7319. if (this.workForm.domains[i].subProjectId) {
  7320. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7321. } else {
  7322. formData.append("subProjectId", 0);
  7323. }
  7324. if (this.workForm.domains[i].groupId) {
  7325. formData.append("groupId", this.workForm.domains[i].groupId);
  7326. } else {
  7327. formData.append("groupId", 0);
  7328. }
  7329. if (this.workForm.domains[i].taskId) {
  7330. formData.append("taskId", this.workForm.domains[i].taskId);
  7331. } else {
  7332. formData.append("taskId", 0);
  7333. }
  7334. if (this.workForm.domains[i].taskFinish == true) {
  7335. formData.append("taskFinish", 1);
  7336. } else {
  7337. formData.append("taskFinish", 0);
  7338. }
  7339. formData.append("reportTimeType", this.reportTimeType.type);
  7340. if (this.reportTimeType.type == 0) {
  7341. formData.append("timeType", this.workForm.domains[i].timeType);
  7342. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7343. formData.append("workingTime", workingTime);
  7344. } else if (this.reportTimeType.type == 1){
  7345. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7346. } else if (this.reportTimeType.type == 2) {
  7347. formData.append("endTime", this.workForm.domains[i].endTime);
  7348. formData.append("startTime", this.workForm.domains[i].startTime);
  7349. } else if (this.reportTimeType.type == 3) {
  7350. //按比例分配
  7351. formData.append("progress", this.workForm.domains[i].progress);
  7352. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7353. }
  7354. if(this.user.timeType.choseFromAlbum == 1 ) {
  7355. console.log(this.workForm.domains[i].imgList)
  7356. if(this.workForm.domains[i].imgList) {
  7357. let imgListFor = this.workForm.domains[i].imgList
  7358. for(var b in imgListFor) {
  7359. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7360. }
  7361. console.log(imgListFor)
  7362. let m = JSON.stringify(imgListFor);
  7363. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7364. formData.append("picStr", m);
  7365. } else {
  7366. formData.append("picStr", '[]');
  7367. }
  7368. }
  7369. //处理多个时间事项
  7370. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7371. if (this.reportTimeType.multiWorktime == 1) {
  7372. //检查时间是否有重叠
  7373. var workList = this.workForm.domains[i].worktimeList;
  7374. for (var j=0;j<workList.length; j++) {
  7375. var curItem = workList[j];
  7376. //检查开始时间是否大于结束时间
  7377. if (curItem.startTime >= curItem.endTime) {
  7378. this.$message({
  7379. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7380. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7381. type: "error"
  7382. });
  7383. return;
  7384. }
  7385. //时间不可重叠
  7386. if (this.reportTimeType.timeCanOverlap == 0) {
  7387. for (var p = j+1;p<workList.length; p++) {
  7388. var jItem = workList[p];
  7389. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7390. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7391. this.$message({
  7392. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7393. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7394. type: "error"
  7395. });
  7396. return;
  7397. }
  7398. }
  7399. }
  7400. }
  7401. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7402. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7403. formData.append("content", m);
  7404. } else {
  7405. if (this.workForm.domains[i].content) {
  7406. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7407. m = m.replace(/,/g,",");
  7408. console.log(m, '需要传值的数据')
  7409. // formData.append("content", this.workForm.domains[i].content);
  7410. formData.append("content", m);
  7411. } else {
  7412. formData.append("content", '-');
  7413. }
  7414. }
  7415. if (this.isBatch == 0) {
  7416. formData.append("createDate", this.workForm.createDate);
  7417. } else {
  7418. //批量填报,时间范围
  7419. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7420. }
  7421. if(this.workForm.domains[i].isOvertime) {
  7422. formData.append("isOvertime", 1);
  7423. } else {
  7424. formData.append("isOvertime", 0);
  7425. }
  7426. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7427. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7428. } else {
  7429. formData.append("overtimeHours", 0);
  7430. }
  7431. if(this.workForm.domains[i].basecostId) {
  7432. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7433. } else {
  7434. formData.append("basecostId", 0);
  7435. }
  7436. if (this.workForm.userId != null) {
  7437. var targetUids = '';
  7438. this.workForm.userId.forEach(u=>{
  7439. targetUids += u + '@';
  7440. });
  7441. if (targetUids.length > 0) {
  7442. targetUids = targetUids.substring(0, targetUids.length -1);
  7443. formData.append("targetUids", targetUids);
  7444. }
  7445. }
  7446. //项目专业进度
  7447. if (this.workForm.domains[i].professionProgress) {
  7448. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7449. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7450. formData.append("professionProgress", m);
  7451. } else {
  7452. formData.append("professionProgress", "[]");
  7453. }
  7454. if (this.workForm.domains[i].stage) {
  7455. formData.append("stage", this.workForm.domains[i].stage);
  7456. } else {
  7457. formData.append("stage", "-");
  7458. }
  7459. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7460. if (this.workForm.domains[i].projectAuditorId) {
  7461. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7462. } else {
  7463. // console.log('执行到了这里')
  7464. // console.log(this.user.timeType.reportAuditType)
  7465. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7466. this.$message({
  7467. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7468. type: "error"
  7469. });
  7470. return;
  7471. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7472. //分组负责人先审核, 确定是选择了任务分组
  7473. if (this.workForm.domains[i].taskGroups.length == 0) {
  7474. this.$message({
  7475. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7476. type: "error"
  7477. });
  7478. } else if (!this.workForm.domains[i].groupId) {
  7479. // console.log(this.workForm.domains[i]);
  7480. this.$message({
  7481. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7482. type: "error"
  7483. });
  7484. } else {
  7485. this.$message({
  7486. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7487. type: "error"
  7488. });
  7489. }
  7490. return;
  7491. }
  7492. }
  7493. if (this.user.companyId == this.yuzhongCompId) {
  7494. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7495. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7496. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7497. }
  7498. //依斯贝的服务Id
  7499. if (this.user.companyId == this.yisibeiCompId) {
  7500. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7501. }
  7502. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7503. this.$message({
  7504. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7505. type: "error"
  7506. });
  7507. return
  7508. }
  7509. }
  7510. this.submitingReport = true;
  7511. this.http.uploadFile( this.port.report.editPort, formData,
  7512. res => {
  7513. this.listLoading = false;
  7514. this.submitingReport = false;
  7515. if (res.code == "ok") {
  7516. if(res.msg!=null){
  7517. this.$message({
  7518. dangerouslyUseHTMLString: true,
  7519. message: res.msg,
  7520. type: "warning",
  7521. showClose: true,
  7522. duration: 0
  7523. });
  7524. }else{
  7525. this.$message({
  7526. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7527. type: "success"
  7528. });
  7529. }
  7530. this.dialogVisible = false;
  7531. this.jsDay = 0
  7532. this.jsTime = 0
  7533. this.getReportList();
  7534. this.getDepartment();
  7535. this.getRecentlyProject()
  7536. } else {
  7537. this.$message({
  7538. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7539. type: "error"
  7540. });
  7541. }
  7542. },
  7543. error => {
  7544. this.listLoading = false;
  7545. this.submitingReport = false;
  7546. this.$message({
  7547. message: error,
  7548. type: "error"
  7549. });
  7550. });
  7551. },
  7552. // 判断是展示那个工时导入
  7553. imports() {
  7554. if(this.user.timeType.syncCorpwxTime == 0) {
  7555. this.importDialog = true
  7556. } else {
  7557. this.importWxDialog = true
  7558. }
  7559. },
  7560. // 跳转
  7561. junpToDeskTop(id) {
  7562. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7563. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7564. },
  7565. // 通过日报
  7566. approve(id, item) {
  7567. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7568. this.approveinData = {
  7569. id: id,
  7570. date: this.date +day,
  7571. reportIds: item.id
  7572. }
  7573. if(this.user.timeType.needEvaluate == 1){
  7574. this.$set(this.approveinData,'evaluate','')
  7575. this.approveinDialog = true
  7576. }else{
  7577. this.logining = true;
  7578. this.approveinfun()
  7579. }
  7580. },
  7581. approveinfun(){
  7582. this.http.post( this.port.report.approve, this.approveinData,
  7583. res => {
  7584. this.logining = false;
  7585. if (res.code == "ok") {
  7586. this.approveinDialog = false
  7587. this.$message({
  7588. message: this.$t('message.Reviewsucceeded'),
  7589. type: "success"
  7590. });
  7591. this.refreshReportData(this.approveinData.reportIds);
  7592. this.getDepartment();
  7593. } else {
  7594. this.$message({
  7595. message: res.msg,
  7596. type: "error"
  7597. });
  7598. }
  7599. },
  7600. error => {
  7601. this.logining = false;
  7602. this.$message({
  7603. message: error,
  7604. type: "error"
  7605. });
  7606. });
  7607. },
  7608. //撤回日报
  7609. cancel(item,e) {
  7610. // console.log('can can need',item);
  7611. this.logining = true;
  7612. var ids = '';
  7613. var data = e ? item : item.data;
  7614. data.forEach(element => {
  7615. if(element.id){
  7616. ids +=(element.id+',');
  7617. }
  7618. });
  7619. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7620. res => {
  7621. this.logining = false;
  7622. if (res.code == "ok") {
  7623. this.$message({
  7624. message:this.$t('message.Withdrawalsucceeded'),
  7625. type: "success"
  7626. });
  7627. this.getReportList();
  7628. if(e){this.getReport()}
  7629. this.getDepartment();
  7630. } else {
  7631. this.$message({
  7632. message: res.msg,
  7633. type: "error"
  7634. });
  7635. }
  7636. },
  7637. error => {
  7638. this.logining = false;
  7639. this.$message({
  7640. message: error,
  7641. type: "error"
  7642. });
  7643. });
  7644. },
  7645. showDenyDialog(id,i, item) {
  7646. this.denyReasonDialog = true;
  7647. this.isDenying = false;
  7648. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7649. var ids = item.id;
  7650. // var data = item.data;
  7651. // data.forEach(element => {
  7652. // ids +=(element.id+',');
  7653. // });
  7654. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7655. },
  7656. // 未通过日报
  7657. deny() {
  7658. this.logining = true;
  7659. this.isDenying = true;
  7660. this.http.post( this.port.report.deny, this.denyForm,
  7661. res => {
  7662. this.logining = false;
  7663. this.isDenying = false;
  7664. if (res.code == "ok") {
  7665. this.$message({
  7666. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7667. type: "success"
  7668. });
  7669. this.refreshReportData(this.denyForm.reportIds);
  7670. this.getDepartment();
  7671. this.denyReasonDialog = false;
  7672. } else {
  7673. this.$message({
  7674. message: res.msg,
  7675. type: "error"
  7676. });
  7677. }
  7678. },
  7679. error => {
  7680. this.logining = false;
  7681. this.$message({
  7682. message: error,
  7683. type: "error"
  7684. });
  7685. });
  7686. },
  7687. // 查看工时记录弹窗
  7688. toView() {
  7689. this.toViewDialogVisible = true
  7690. this.toViewloading = true
  7691. this.getToView()
  7692. },
  7693. getToView() {
  7694. this.http.post( '/report-import-log/getList', this.toViewForm,
  7695. res => {
  7696. this.toViewloading = false;
  7697. if (res.code == "ok") {
  7698. // console.log(res.data, '数据数据')
  7699. this.toViewList = res.data.records
  7700. this.toViewForm.total = res.data.total
  7701. } else {
  7702. this.toViewloading = false;
  7703. this.$message({
  7704. message: res.msg,
  7705. type: "error"
  7706. });
  7707. }
  7708. })
  7709. },
  7710. // 触发 selectCat 组件更改他的值
  7711. selectCatCli(obj) {
  7712. // console.log(obj, '看看')
  7713. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7714. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7715. },
  7716. vueCasader(obj) {
  7717. console.log(obj, '看看值')
  7718. if(obj.distinction == 1 && obj.item) {
  7719. let arr = []
  7720. arr.push(obj.item.value)
  7721. this.exportParam.departmentId = arr
  7722. }
  7723. },
  7724. //分页
  7725. handleCurrentChange(val) {
  7726. this.toViewForm.pageIndex = val;
  7727. this.getToView();
  7728. },
  7729. handleSizeChange(val) {
  7730. this.toViewForm.pageSize = val;
  7731. this.getToView();
  7732. },
  7733. getAllUsersList(){
  7734. this.http.post('/user/getSimpleActiveUserList',{
  7735. },res => {
  7736. if(res.code == 'ok'){
  7737. this.allUsersList = res.data
  7738. }else{
  7739. this.$message({
  7740. message: res.msg,
  7741. type: 'error'
  7742. })
  7743. }
  7744. },err => {
  7745. this.$message({
  7746. message: err,
  7747. type: 'error'
  7748. })
  7749. })
  7750. },
  7751. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7752. fillWeekCustomClne() {
  7753. this.fillWeekDialogVisiCustom = false
  7754. },
  7755. fillWeekCustomSubmit() {
  7756. this.getReportList();
  7757. this.getDepartment();
  7758. this.getRecentlyProject()
  7759. },
  7760. // 待填日报姓名搜索
  7761. nameAearchSeek(flg) {
  7762. if(!this.nameAearch) {
  7763. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7764. return
  7765. }
  7766. if(flg) {
  7767. this.enterpriseWechatgetUser()
  7768. }
  7769. },
  7770. handleThreeData(userList) {
  7771. console.log(userList, '人员数据')
  7772. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7773. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7774. },
  7775. // 过滤树节点
  7776. filterTreeNodes(treeData, filterKeywords) {
  7777. return treeData.filter((node) => {
  7778. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7779. if (node.children && node.children.length > 0) {
  7780. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7781. }
  7782. return true;
  7783. }
  7784. if (node.children && node.children.length > 0) {
  7785. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7786. return node.children.length > 0;
  7787. }
  7788. return false;
  7789. });
  7790. },
  7791. // 企业微信获取人员
  7792. enterpriseWechatgetUser() {
  7793. this.deptMembDataLoading = true
  7794. this.http.post('/user/getEmployeeList',{
  7795. departmentId: -1,
  7796. pageIndex: 1,
  7797. pageSize: 100,
  7798. keyword: this.nameAearch,
  7799. status: '',
  7800. roleId: '',
  7801. cursor: '',
  7802. onlyDirect: '',
  7803. matchingType: ''
  7804. },res => {
  7805. if(res.code == 'ok'){
  7806. this.deptMembDataLoading = false
  7807. const userListName = res.data.records.map(item => item.name)
  7808. this.handleThreeData(userListName)
  7809. }else{
  7810. this.deptMembDataLoading = false
  7811. this.$message({
  7812. message: res.msg,
  7813. type: 'error'
  7814. })
  7815. }
  7816. },err => {
  7817. this.deptMembDataLoading = false
  7818. this.$message({
  7819. message: err,
  7820. type: 'error'
  7821. })
  7822. })
  7823. },
  7824. // 按周填报获取相关任务
  7825. async getWeeklyTaskList(item) {
  7826. console.log(item, '<=== 数据')
  7827. const { projectId, groupId, stage, taskId } = item
  7828. console.log(projectId, groupId, stage)
  7829. let parms = { projectId, isSubstitude: 0 }
  7830. groupId ? parms.groupId = groupId : ''
  7831. stage ? parms.stage = stage : ''
  7832. const { data } = await this.postData('/task/getRecentTask', parms)
  7833. this.zhoBao.taskId = taskId
  7834. this.$set(this.zhoBao, 'taskList', data)
  7835. console.log(this.zhoBao)
  7836. },
  7837. // 封装 post 请求
  7838. postData(url, params) {
  7839. return new Promise((resolve, reject) => {
  7840. this.http.post(url, { ...params },
  7841. res => {
  7842. resolve(res)
  7843. },
  7844. error => {
  7845. this.$message({
  7846. message: error,
  7847. type: "error"
  7848. });
  7849. reject(error)
  7850. })
  7851. })
  7852. },
  7853. // 自定义事件
  7854. selectCal(obj) {
  7855. console.log(obj, '传数据来源')
  7856. if(obj.distinction == '1') {
  7857. this.zhoBao.projectAuditorId = obj.id
  7858. } else if(obj.distinction == '2') {
  7859. this.zhoBao.auditorFirst = obj.id
  7860. } else if(obj.distinction == '3') {
  7861. this.zhoBao.auditorSec = obj.id
  7862. } else if(obj.distinction == '4') {
  7863. this.zhoBao.auditorThird = obj.id
  7864. } else if(obj.distinction == '5') {
  7865. this.zhoBao.ccUserid = obj.id
  7866. } else if(obj.distinction == '12') {
  7867. this.usersListId = obj.id
  7868. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7869. this.searchKeyword = obj.name
  7870. } else {
  7871. this.searchKeyword = ''
  7872. }
  7873. this.searchScreen(0)
  7874. } else if(obj.distinction == '13') {
  7875. this.usersListId = obj.id
  7876. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7877. this.searchKeyword = obj.name
  7878. } else {
  7879. this.searchKeyword = ''
  7880. }
  7881. this.searchScreen(1)
  7882. }
  7883. }
  7884. },
  7885. created() {
  7886. this.getUsers()
  7887. let height = window.innerHeight;
  7888. this.tableHeight = height - 178;
  7889. const that = this;
  7890. window.onresize = function temp() {
  7891. that.tableHeight = window.innerHeight - 178;
  7892. };
  7893. this.toViewForm.companyId = this.user.companyId
  7894. this.initDrag([{
  7895. type: "LR",
  7896. domClass: {
  7897. // 中间分割线的名字
  7898. resize: "line-line",
  7899. // 左侧盒子的名字
  7900. left: "box-left",
  7901. // 右侧盒子的名字
  7902. right: "box-right",
  7903. // 父级的名字
  7904. box: "box-father",
  7905. },
  7906. otherInfo: {
  7907. // 限制左边栏最低宽度
  7908. leftWidth: 120,
  7909. },
  7910. },
  7911. {
  7912. type: "LR",
  7913. domClass: {
  7914. // 中间分割线的名字
  7915. resize: "line-second",
  7916. // 左侧盒子的名字
  7917. left: "left-laowang",
  7918. // 右侧盒子的名字
  7919. right: "box-second-father",
  7920. // 父级的名字
  7921. box: "grand",
  7922. },
  7923. otherInfo: {
  7924. // 限制左边栏最低宽度
  7925. leftWidth: 120,
  7926. },
  7927. },
  7928. ]);
  7929. }
  7930. };
  7931. </script>
  7932. <style lang="scss" scoped>
  7933. .fillWeekDialogVisiCustom {
  7934. width: 100%;
  7935. height: 70vh;
  7936. }
  7937. .fillWeekCustom {
  7938. .el-dialog__body {
  7939. padding: 20px 20px !important;
  7940. }
  7941. }
  7942. .photos {
  7943. position: relative;
  7944. display: flex;
  7945. flex-wrap: wrap;
  7946. }
  7947. .photos_img {
  7948. width: 120px;
  7949. height: 120px;
  7950. margin-right: 20px;
  7951. margin-bottom: 20px;
  7952. cursor: pointer;
  7953. img {
  7954. width: 100%;
  7955. height: 100%;
  7956. }
  7957. }
  7958. .paginatis {
  7959. padding: 10px 10px;
  7960. background: #f2f2f2;
  7961. }
  7962. .waiting {
  7963. color:orange;
  7964. }
  7965. .filledReportStyle {
  7966. color:#32CD32;
  7967. }
  7968. .RejectStyle {
  7969. color:red;
  7970. }
  7971. .waitSubmitStyle{
  7972. color: #409eff;
  7973. }
  7974. .chooseDate {
  7975. .waiting {
  7976. color: #20a0ff;
  7977. }
  7978. .filledReportStyle {
  7979. color:#20a0ff;
  7980. }
  7981. .RejectStyle {
  7982. color: #20a0ff;
  7983. }
  7984. .waitSubmitStyle{
  7985. color: #20a0ff;
  7986. }
  7987. }
  7988. .allDaily {
  7989. width:100%;
  7990. }
  7991. .report_title {
  7992. padding:10px 0;
  7993. color:#666;
  7994. }
  7995. .clearfix {
  7996. overflow-x: auto;
  7997. white-space: nowrap;
  7998. padding: 15px 0 10px 0;
  7999. // overflow-y: hidden;
  8000. .date_item {
  8001. padding: 0 3px;
  8002. cursor: pointer;
  8003. position: relative;
  8004. }
  8005. .chooseDate {
  8006. position: absolute;
  8007. bottom: -3px;
  8008. width: 37px;
  8009. height: 2px;
  8010. left: 14px;
  8011. background: #20a0ff;
  8012. }
  8013. }
  8014. .one_daily {
  8015. i {
  8016. color: #9ed0ff;
  8017. margin-right: 5px;
  8018. }
  8019. .one_daily_body {
  8020. padding: 10px 0px;
  8021. p {
  8022. margin: 0;
  8023. line-height: 30px;
  8024. }
  8025. }
  8026. ul {
  8027. padding: 0;
  8028. }
  8029. }
  8030. .checkbtn {
  8031. float: right;
  8032. margin-top: -10px;
  8033. }
  8034. .selConStyle{
  8035. margin-top:9rem;
  8036. margin-bottom:11rem;
  8037. .selConStyle_title{
  8038. height: 3rem;
  8039. text-align: center;
  8040. font-size: 17px;
  8041. }
  8042. .el-select{
  8043. margin: 0 15%;
  8044. width: 70%;
  8045. }
  8046. }
  8047. </style>
  8048. <style lang="scss">
  8049. /*去除upload组件过渡效果*/
  8050. .photos .el-upload-list__item {
  8051. transition: none !important;
  8052. }
  8053. .daily {
  8054. .el-card__body {
  8055. height: 80%;
  8056. overflow-y: auto;
  8057. }
  8058. .el-card__header {
  8059. padding: 0 20px;
  8060. }
  8061. }
  8062. .membListClass{
  8063. .el-dialog__body{
  8064. padding-top: 10px;
  8065. }
  8066. }
  8067. // .editReportDialog .el-dialog__footer{
  8068. // position: sticky;
  8069. // bottom: 0;
  8070. // background: #fff;
  8071. // height: 70px;
  8072. // z-index: 1010;
  8073. // }
  8074. .editReportDialog{
  8075. min-width: 800px;
  8076. }
  8077. .touruxiangmu{
  8078. max-width: 1000px;
  8079. }
  8080. </style>
  8081. <style scoped>
  8082. /* 项目标签的样式 */
  8083. .el-tag + .el-tag {
  8084. margin-left: 10px;
  8085. }
  8086. .button-new-tag {
  8087. margin-left: 10px;
  8088. height: 32px;
  8089. line-height: 30px;
  8090. padding-top: 0;
  8091. padding-bottom: 0;
  8092. }
  8093. .input-new-tag {
  8094. width: 90px;
  8095. margin-left: 10px;
  8096. vertical-align: bottom;
  8097. }
  8098. .selectworktime .el-table__fixed-body-wrapper{
  8099. top: 48px !important;
  8100. }
  8101. .selectworktime_export .selectworktime_export_l{
  8102. width: 650px;
  8103. float: left;
  8104. height: 42px;
  8105. }
  8106. .approvalProcessBox{
  8107. margin-left: 30px;
  8108. font-size: 14px;
  8109. line-height: 16px;
  8110. cursor: pointer;
  8111. }
  8112. .approvalProcessBox i {
  8113. margin-right: 0;
  8114. height: 16px;
  8115. width: 16px;
  8116. display: inline-block;
  8117. transform: scale(1.2);
  8118. position: relative;
  8119. top: 0.5px;
  8120. color: #409eff;
  8121. }
  8122. .approvalProcessBox .approvalProcessClick{
  8123. cursor: pointer;
  8124. color: #409eff;
  8125. font-size: 14px;
  8126. }
  8127. .approvalProcessBox:hover .approvalProcessClick{
  8128. color: #3485fb;
  8129. }
  8130. </style>
  8131. <style lang="scss" scoped>
  8132. // 加班样式
  8133. .overtime {
  8134. display: inline-block;
  8135. margin-left: 20px;
  8136. input {
  8137. display: inline-block;
  8138. margin-top: 5px;
  8139. }
  8140. }
  8141. .plus {
  8142. display: inline-block;
  8143. }
  8144. // .tages {
  8145. // float: right;
  8146. // }
  8147. .overtime {
  8148. display: inline-block;
  8149. margin-left: 30px;
  8150. }
  8151. .bloks {
  8152. display: inline-block;
  8153. width: 380px;
  8154. }
  8155. .zhiss {
  8156. display: flex;
  8157. justify-content: space-around;
  8158. align-items: center;
  8159. }
  8160. .zhoFel {
  8161. display: flex;
  8162. justify-content: space-between;
  8163. align-items: center;
  8164. }
  8165. // 左右滑动样式
  8166. .line {
  8167. width: 30px;
  8168. /* height: 500px; */
  8169. background: #f2f2f2;
  8170. cursor: w-resize;
  8171. }
  8172. .box-father {
  8173. border: 8px solid #000;
  8174. }
  8175. .line-second {
  8176. width: 10px;
  8177. /* background: red; */
  8178. }
  8179. .flex {
  8180. display: flex;
  8181. width: 100%;
  8182. }
  8183. .box-left {
  8184. flex: 0 0 400px;
  8185. /* height: 600px; */
  8186. /* background: blue; */
  8187. }
  8188. .box-right {
  8189. /* height: 600px; */
  8190. /* background: green; */
  8191. flex: 1;
  8192. }
  8193. .box-postion {
  8194. width: 200px;
  8195. /* height: 400px; */
  8196. background: #ccc;
  8197. }
  8198. .custom-tree-node {
  8199. flex: 1;
  8200. display: flex;
  8201. align-items: center;
  8202. justify-content: space-between;
  8203. font-size: 14px;
  8204. padding-right: 8px;
  8205. }
  8206. .daitianrbao {
  8207. width: 100%;
  8208. box-sizing: border-box;
  8209. height: 40px;
  8210. border-radius: 4px;
  8211. border: 1px solid #DCDFE6;
  8212. overflow: hidden;
  8213. text-overflow: ellipsis;
  8214. display: flex;
  8215. // align-items: center;
  8216. }
  8217. .daitianrbao .spnn {
  8218. display: inline-block;
  8219. box-sizing: border-box;
  8220. padding: 0 15px;
  8221. overflow: hidden;
  8222. text-overflow: ellipsis;
  8223. }
  8224. .daitianrbao .hover {
  8225. color: #DCDFE6 !important;
  8226. }
  8227. </style>