daily.vue 445 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  252. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <!-- 简陋的无报告提示 -->
  327. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </el-card>
  334. </div>
  335. <!-- 工时推送日志弹窗 -->
  336. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  337. <template>
  338. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  339. </template>
  340. <template>
  341. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  342. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  343. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  344. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  345. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  346. <el-table-column prop="result" label="推送结果" width="250">
  347. <template slot-scope="scope">
  348. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  349. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  350. </template>
  351. </el-table-column>
  352. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  353. </el-table>
  354. </template>
  355. <span slot="footer" class="dialog-footer">
  356. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  357. </span>
  358. </el-dialog>
  359. <!-- 填写日报的dialog -->
  360. <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">
  361. <div style="height: 65vh;overflow: auto;">
  362. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  363. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  364. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  365. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  366. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  367. <span class="spnn" v-if="workForm.userNames">
  368. <span v-for="(item, index) in workForm.userNames" :key="index">
  369. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  370. <span v-if="index < workForm.userNames.length - 1">,</span>
  371. </span>
  372. </span>
  373. <span class="spnn hover" v-else>
  374. {{$t('defaultText.pleaseSelectAsubstitute')}}
  375. </span>
  376. </div>
  377. </el-form-item>
  378. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  379. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  380. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  381. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  382. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  383. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  384. <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>
  385. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  386. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  387. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  388. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  389. <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>
  390. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  391. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  392. </span>
  393. <!--批量填报和批量代填不显示考勤记录-->
  394. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  395. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  396. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  397. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  398. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  399. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  400. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  401. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  402. @click="refreshAttendance(workForm.createDate)"></el-button>
  403. <!-- AI智能填报 -->
  404. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  405. </el-form-item>
  406. <!-- 000000 -->
  407. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  408. <div v-if="reportTimeType.multiWorktime==0">
  409. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  410. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  411. <el-select v-model="domain.timeType" style="width:200px;"
  412. v-if="reportTimeType.type == 0"
  413. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  414. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  415. @change="onTimeTypeChange(domain.timeType)">
  416. <el-option
  417. v-for="item in timeType"
  418. :key="item.value"
  419. :label="item.label"
  420. :value="item.value">
  421. </el-option>
  422. </el-select>
  423. <!-- 数字时长选择 -->
  424. <el-select v-model="domain.workingTime" style="width:200px;"
  425. v-if="reportTimeType.type == 1"
  426. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  427. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  428. @change="seleChn(0,domain)">
  429. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  430. </el-select>
  431. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  432. <span v-if="reportTimeType.type == 2">
  433. <!--时间范围选择 -->
  434. <el-time-picker
  435. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  436. v-model="domain.startTime"
  437. :placeholder="$t('time.startTime')"
  438. style="width:120px;"
  439. format="HH:mm"
  440. value-format="HH:mm"
  441. :picker-options="{
  442. start: '08:00',
  443. end: '23:30'
  444. }"
  445. @change="iptChang()">
  446. </el-time-picker> - <el-time-picker
  447. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  448. v-model="domain.endTime"
  449. :placeholder="$t('time.endTime')"
  450. style="width:120px;"
  451. format="HH:mm"
  452. value-format="HH:mm"
  453. :picker-options="{
  454. start: '08:00',
  455. end: '23:30',
  456. minTime: domain.startTime
  457. }"
  458. @change="iptChang()">
  459. </el-time-picker>
  460. </span>
  461. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  462. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  463. <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>
  464. </div>
  465. </el-form-item>
  466. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  467. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  468. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  469. @change="selectProject(domain, index)"
  470. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  471. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  472. <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">
  473. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  474. <span style="float: right;">{{ item.projectName }}</span>
  475. </el-option>
  476. </el-option-group>
  477. </el-select>
  478. <!--昱众不显示子项目-->
  479. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  480. <span style="margin-left:45px;">
  481. {{$t('lable.subproject')}}</span>
  482. <!--子项目 -->
  483. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  484. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  485. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  486. </el-select>
  487. </template>
  488. <template v-if="user.companyId == yuzhongCompId">
  489. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  490. <!--角色选择 -->
  491. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  492. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  493. <el-option
  494. v-for="item in roleList"
  495. :key="item.value"
  496. :label="item.label"
  497. :value="item.value">
  498. </el-option>
  499. </el-select>
  500. </template>
  501. <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%;"
  502. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  503. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  504. </el-link>
  505. <!-- <el-link type="primary" v-if="canEdit"
  506. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  507. </el-form-item>
  508. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  509. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  510. </el-form-item>
  511. <!--如果设置了工时成本预警的预算成本项-->
  512. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  513. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  514. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  515. </el-select>
  516. </el-form-item>
  517. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  518. <template slot="label">
  519. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  520. <span >{{$t('lable.taskGrouping')}}</span>
  521. </template>
  522. <!-- 任务分组 -->
  523. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  524. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  525. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  526. </el-select>
  527. <template v-if="user.companyId == yuzhongCompId">
  528. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  529. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  530. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  531. <el-option
  532. v-for="item in domain.filteredRespList"
  533. :key="item.id"
  534. :label="item.jobRespon"
  535. :value="item.id">
  536. </el-option>
  537. </el-select>
  538. </template>
  539. <template v-else><!-- 项目的阶段 -->
  540. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  541. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  542. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  543. @change="changeStages(domain, index)"
  544. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  545. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  546. </el-select>
  547. </template>
  548. </el-form-item>
  549. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  550. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  551. <template slot="label">
  552. <span style="color:#FF0000;">*</span>
  553. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  554. </template>
  555. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  556. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  557. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  558. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  559. </el-option>
  560. </el-select>
  561. <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>
  562. </el-form-item>
  563. </div>
  564. <el-form-item v-if="user.companyId == yuzhongCompId">
  565. <template slot="label">
  566. <span style="color:#FF0000;">*</span>
  567. <span >工作内容</span>
  568. </template>
  569. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  570. :disabled="(workForm.domains[index].state>=2?false:true)" >
  571. <el-option
  572. v-for="item in domain.workContentList"
  573. :key="item.id"
  574. :label="item.workContext"
  575. :value="item.id">
  576. </el-option>
  577. </el-select>
  578. </el-form-item>
  579. <!-- 111111 -->
  580. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  581. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  582. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  583. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  584. <span v-else>{{item.name}}</span>
  585. </el-option>
  586. </el-select>
  587. <template v-if="user.timeType.auditLevel > 1">
  588. <i class="el-icon-right"></i>
  589. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  590. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  591. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  592. <span v-else>{{item.name}}</span>
  593. </el-option>
  594. </el-select>
  595. </template>
  596. <template v-if="user.timeType.auditLevel > 2">
  597. <i class="el-icon-right"></i>
  598. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  599. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  600. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  601. <span v-else>{{item.name}}</span>
  602. </el-option>
  603. </el-select>
  604. </template>
  605. </el-form-item>
  606. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  607. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  608. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  609. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  610. <span v-else>{{item.name}}</span>
  611. </el-option>
  612. </el-select>
  613. </el-form-item>
  614. <!-- 相关维度/自定义维度 -->
  615. <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'">
  616. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  617. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  618. </el-option>
  619. </el-select>
  620. </el-form-item>
  621. <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'">
  622. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  623. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  624. </el-option>
  625. </el-select>
  626. </el-form-item>
  627. <!-- 相关数值 -->
  628. <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">
  629. <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>
  630. </el-form-item>
  631. <!-- 自定义文本 -->
  632. <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">
  633. <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>
  634. </el-form-item>
  635. <!--按比例填报-->
  636. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  637. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  638. <div style="width:400px;">
  639. <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>
  640. <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>
  641. </div>
  642. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  643. <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>
  644. </div>
  645. </el-form-item>
  646. <!--工程专业版本模式下, 各个专业的进度填报 -->
  647. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  648. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  649. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  650. <el-input size="mini" style="width:60px;" v-model="item.progress"
  651. @keyup.native="onProgressChange"
  652. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  653. </span>
  654. </el-form-item>
  655. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  656. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  657. <template slot="label" v-if="user.timeType.taskRequired == 1">
  658. <span style="color:#FF0000;">*</span>
  659. <span >任务</span>
  660. </template>
  661. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  662. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  663. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  664. </el-select>
  665. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  666. </el-form-item>
  667. <!--针对依斯贝的SAP服务-->
  668. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  669. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  670. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  671. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  672. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  673. </el-select>
  674. </el-form-item>
  675. <!--工作事项-->
  676. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  677. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  678. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  679. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  680. </el-form-item>
  681. <!-- 拍照上传 -->
  682. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  683. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  684. <div class="photos">
  685. <div>
  686. <el-upload
  687. list-type="picture-card"
  688. :http-request="(file) => {return addImg(file, index)}"
  689. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  690. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  691. :file-list="domain.imgListUrl" :limit="9"
  692. :disabled="workForm.domains[index].state>=2?false:true">
  693. <i class="el-icon-plus"></i>
  694. </el-upload>
  695. </div>
  696. </div>
  697. </el-form-item>
  698. </div>
  699. <!--多个工作事项填报的情况 -->
  700. <div v-if="reportTimeType.multiWorktime==1">
  701. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  702. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  703. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  704. @change="selectProject(domain, index)"
  705. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  706. <!-- <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">
  707. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  708. <span style="float: right;">{{ item.projectName }}</span>
  709. </el-option> -->
  710. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  711. <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">
  712. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  713. <span style="float: right;">{{ item.projectName }}</span>
  714. </el-option>
  715. </el-option-group>
  716. </el-select>
  717. <template v-if="user.timeType.mainProjectState != 1">
  718. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  719. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  720. <!--子项目 -->
  721. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  722. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  723. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  724. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  725. </el-select>
  726. </template>
  727. <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;"
  728. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  729. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  730. </el-link>
  731. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  732. <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>
  733. </div>
  734. <!-- <el-link type="primary" v-if="canEdit"
  735. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  736. </el-form-item>
  737. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  738. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  739. </el-form-item>
  740. <!--如果设置了工时成本预警的预算成本项-->
  741. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  742. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  743. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  744. </el-select>
  745. </el-form-item>
  746. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  747. <!-- 任务分组 -->
  748. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  749. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  750. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  751. </el-select>
  752. <!-- 项目的阶段 -->
  753. <span v-if="domain.stages != null && domain.stages.length> 0"
  754. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  755. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  756. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  757. @change="changeStages(domain, index)"
  758. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  759. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  760. </el-select>
  761. </el-form-item>
  762. <el-form-item :label="$t('other.projectAuditor')" >
  763. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  764. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  765. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  766. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  767. </el-option>
  768. </el-select>
  769. <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>
  770. </el-form-item>
  771. <!--工程专业版本模式下, 各个专业的进度填报 -->
  772. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  773. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  774. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  775. <el-input size="mini" style="width:60px;" v-model="item.progress"
  776. @keyup.native="onProgressChange"
  777. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  778. </span>
  779. </el-form-item>
  780. <!-- 相关维度 -->
  781. <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'">
  782. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  783. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  784. </el-option>
  785. </el-select>
  786. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  787. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  788. </el-option>
  789. </el-select>
  790. </el-form-item>
  791. <!-- 相关数值 -->
  792. <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">
  793. <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>
  794. </el-form-item>
  795. <!-- 自定义文本 -->
  796. <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">
  797. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  798. </el-form-item>
  799. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  800. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  801. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  802. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  803. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  804. </el-select>
  805. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  806. </el-form-item>
  807. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  808. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  809. <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>
  810. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  811. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  812. <span v-if="reportTimeType.type == 2">
  813. <!-- <span> -->
  814. <!--时间范围选择 -->
  815. <el-time-picker
  816. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  817. v-model="timeItem.startTime"
  818. :placeholder="$t('time.startTime')"
  819. style="width:120px;"
  820. format="HH:mm"
  821. value-format="HH:mm"
  822. :picker-options="{
  823. start: '00:00',
  824. end: '23:59',
  825. }"
  826. @change="iptChangs()">
  827. </el-time-picker> - <el-time-picker
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  829. v-model="timeItem.endTime"
  830. :placeholder="$t('time.endTime')"
  831. style="width:120px;"
  832. format="HH:mm"
  833. value-format="HH:mm"
  834. :picker-options="{
  835. start: '00:00',
  836. end: '23:59',
  837. minTime: timeItem.startTime
  838. }"
  839. @change="iptChangs()">
  840. </el-time-picker>
  841. </span>
  842. </el-form-item>
  843. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  844. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  845. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  846. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  847. ></el-input>
  848. </el-form-item>
  849. </div>
  850. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  851. </div>
  852. <!--照片的显示 -->
  853. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  854. <el-image v-for="(pic, index) in domain.pics" :key="index"
  855. style="width: 100px; height: 100px; margin-right:10px;"
  856. :src="pic"
  857. :preview-src-list="domain.pics">
  858. </el-image>
  859. </p>
  860. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  861. </div>
  862. <span id="workFormsItemBottom"></span>
  863. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  864. </el-form>
  865. </div>
  866. <span slot="footer" class="dialog-footer">
  867. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  868. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  869. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  870. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  871. <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>
  872. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  873. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  874. </span>
  875. </el-dialog>
  876. <!-- 按周填报 -->
  877. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  878. <!-- 按周填报-已填工时-点击 -->
  879. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  880. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  881. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  882. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  883. <el-table-column prop="state" :label="$t('state.states')">
  884. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  885. </el-table-column>
  886. <!-- <el-table-column label="操作">
  887. <template slot-scope="scope">
  888. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  889. </template>
  890. </el-table-column> -->
  891. </el-table>
  892. <span slot="footer" class="dialog-footer">
  893. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  894. </span>
  895. </el-dialog>
  896. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  897. <el-form-item style="height:30px;margin-top:-72px;">
  898. <!-- <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> -->
  899. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  900. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  901. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  902. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  903. <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>
  904. <el-option
  905. v-for="item in fillProjectList"
  906. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  907. :key="item.id"
  908. :label="item.projectName + '\u3000' + item.projectCode"
  909. :value="item.id">
  910. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  911. <span style="float: right">{{ item.projectName }}</span>
  912. </el-option>
  913. </el-select>
  914. <span style="float:right;margin-right:10px;">选择项目</span>
  915. </el-form-item>
  916. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  917. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  918. <template slot-scope="scope">
  919. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  920. </template>
  921. </el-table-column>
  922. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  923. <template slot-scope="scope">
  924. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  925. <p v-else></p>
  926. </template>
  927. </el-table-column> -->
  928. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  929. <template slot-scope="scope">
  930. <div v-if="scope.row.canFill == 1">
  931. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  932. <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>
  933. <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>
  934. <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>
  935. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  936. </div>
  937. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  938. <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>
  939. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  940. </div>
  941. </div>
  942. <div v-else >
  943. <span style="color:#999999;">不可超前填报</span>
  944. </div>
  945. </template>
  946. </el-table-column>
  947. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  948. <template slot-scope="scope">
  949. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  950. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  951. </template>
  952. </el-table-column>
  953. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  954. <template slot-scope="scope">
  955. <div class="zhiss">
  956. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  957. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  958. </div>
  959. </template>
  960. </el-table-column>
  961. </el-table>
  962. </el-form>
  963. <span slot="footer" class="dialog-footer" >
  964. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  965. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  966. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  967. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  968. </span>
  969. </el-dialog>
  970. <!-- 重庆物奇私人定制的按周填报 -->
  971. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  972. <div class="fillWeekDialogVisiCustom">
  973. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  974. </div>
  975. </el-dialog>
  976. <!-- 选择时间 -->
  977. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  978. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  979. <span slot="footer" class="dialog-footer">
  980. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  981. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  982. </span>
  983. </el-dialog>
  984. <!-- 按周填报弹窗 -->
  985. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  986. <div>
  987. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  988. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  989. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  990. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  991. </el-select>
  992. </div>
  993. <!--如果设置了工时成本预警的预算成本项-->
  994. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  995. <p>{{$t('lable.budgetSource')}}</p>
  996. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  997. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  998. </el-select>
  999. </div>
  1000. <!-- 任务分组 -->
  1001. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1002. <p>{{$t('lable.taskGrouping')}}</p>
  1003. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1004. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1005. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1006. </el-select>
  1007. </div>
  1008. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  1009. <p>{{$t('other.inputStage')}}</p>
  1010. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1011. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1012. </el-select>
  1013. </div>
  1014. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1015. <p>{{$t('other.reviewer')}}</p>
  1016. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1017. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1018. </el-select>
  1019. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1020. </div>
  1021. <template v-if="user.timeType.reportAuditType == 3">
  1022. <div class="zhoFel">
  1023. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1024. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1025. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1026. </el-select>
  1027. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1028. </div>
  1029. <div class="zhoFel">
  1030. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1031. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1032. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. <div class="zhoFel">
  1037. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1038. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1039. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1040. </el-select>
  1041. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1042. </div>
  1043. <div class="zhoFel">
  1044. <p>{{ $t('chao-song-ren') }}</p>
  1045. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1046. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1047. </el-select>
  1048. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1049. </div>
  1050. </template>
  1051. <!-- 自定义维度 -->
  1052. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1053. <p>{{user.timeType.customDegreeName}}</p>
  1054. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1055. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1056. </el-select>
  1057. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1058. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1059. </el-select>
  1060. </div>
  1061. <!-- 自定义数值 -->
  1062. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1063. <p>{{user.timeType.customDataName}}</p>
  1064. <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>
  1065. </div>
  1066. <!-- 自定义文本 -->
  1067. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1068. <p>{{user.timeType.customTextName}}</p>
  1069. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1070. </div>
  1071. <!-- 选择任务 -->
  1072. <div class="zhoFel" v-if="user.company.packageProject==1 && user.company.nonProjectSimple==0">
  1073. <p>任务 / 里程碑</p>
  1074. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1075. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1076. </el-select>
  1077. </div>
  1078. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1079. <p>{{$t('other.timeSelection')}}</p>
  1080. <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>
  1081. </div>
  1082. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1083. <p>{{$t('other.chooseDuration')}}</p>
  1084. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1085. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1086. </el-select>
  1087. </div>
  1088. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1089. <p>{{$t('lable.percentageOfTime')}}</p>
  1090. <div style="width:400px;display: flex;align-items: center;">
  1091. <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>
  1092. <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>
  1093. </div>
  1094. </div>
  1095. <div class="zhoFel">
  1096. <p>{{$t('other.workMatters')}}</p>
  1097. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1098. </div>
  1099. </div>
  1100. <span slot="footer" class="dialog-footer">
  1101. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1102. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1103. </span>
  1104. </el-dialog>
  1105. <!--导出报表条件选择 -->
  1106. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1107. <el-form ref="form3" :model="exportParam" >
  1108. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1109. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1110. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1111. </el-select>
  1112. </el-form-item>
  1113. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1114. <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>
  1115. <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>
  1116. </el-form-item>
  1117. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1118. <el-date-picker
  1119. v-model="exportParam.dateRange" :editable="false"
  1120. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1121. :range-separator="$t('other.to')"
  1122. type="daterange"
  1123. :start-placeholder="$t('time.startDate')"
  1124. :end-placeholder="$t('time.endDate')"
  1125. ></el-date-picker>
  1126. </el-form-item>
  1127. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1128. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1129. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1130. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1131. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1132. </el-select>
  1133. </el-form-item>
  1134. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1135. <div class="exportReportRadio">
  1136. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1137. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1138. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1139. <i class="el-icon-question"></i>
  1140. </el-tooltip>
  1141. </div>
  1142. </el-form-item>
  1143. </el-form>
  1144. <div slot="footer" class="dialog-footer">
  1145. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1146. </div>
  1147. </el-dialog>
  1148. <!--导出报表条件选择 -->
  1149. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1150. <el-form ref="form3" :model="exportParam" >
  1151. <el-form-item prop="range" :label="$t('time.dateRange')">
  1152. <el-date-picker
  1153. v-model="exportParam.dateRange" :editable="false"
  1154. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1155. :clearable="true"
  1156. :range-separator="$t('other.to')"
  1157. type="daterange"
  1158. :start-placeholder="$t('time.startDate')"
  1159. :end-placeholder="$t('time.endDate')"
  1160. ></el-date-picker>
  1161. </el-form-item>
  1162. </el-form>
  1163. <div slot="footer" class="dialog-footer">
  1164. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1165. </div>
  1166. </el-dialog>
  1167. <!--人员列表 -->
  1168. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1169. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1170. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1171. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1172. <el-table-column type="selection"></el-table-column>
  1173. <el-table-column prop="label" :label="$t('lable.name')" >
  1174. <template slot-scope="scope">
  1175. <span>
  1176. <!-- {{(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}} -->
  1177. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1178. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1179. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1180. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1181. </span>
  1182. <span v-else>
  1183. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1184. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1185. </span>
  1186. </span>
  1187. </template>
  1188. </el-table-column>
  1189. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1190. <template slot-scope="scope">
  1191. <div>
  1192. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1193. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1194. </div>
  1195. </template>
  1196. </el-table-column>
  1197. </el-table>
  1198. </el-tab-pane>
  1199. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1200. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1201. <el-table-column prop="label" :label="$t('lable.name')" >
  1202. <template slot-scope="scope">
  1203. <!-- <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> -->
  1204. <!-- <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> -->
  1205. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1206. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1208. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1209. </span>
  1210. <span v-else>
  1211. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1212. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1213. </span>
  1214. </template>
  1215. </el-table-column>
  1216. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1217. <template slot-scope="scope">
  1218. <div>
  1219. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1220. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1221. </div>
  1222. </template>
  1223. </el-table-column>
  1224. </el-table>
  1225. </el-tab-pane>
  1226. </el-tabs>
  1227. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1228. <el-table-column type="selection"></el-table-column>
  1229. <el-table-column prop="label" :label="$t('lable.name')" >
  1230. <template slot-scope="scope">
  1231. <div>
  1232. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1233. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1234. </div>
  1235. </template>
  1236. </el-table-column>
  1237. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1238. <template slot-scope="scope">
  1239. <div>
  1240. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1241. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1242. </div>
  1243. </template>
  1244. </el-table-column>
  1245. </el-table>
  1246. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1247. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1248. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1249. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1250. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1251. </div>
  1252. </el-dialog>
  1253. <!-- 按部门选择人员 -->
  1254. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1255. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1256. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1257. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1258. </el-input>
  1259. <div class="tree" style="height:400px">
  1260. <el-scrollbar style="height:100%">
  1261. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1262. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1263. highlight-current :filter-node-method="filterNode">
  1264. <span class="custom-tree-node" slot-scope="{ node }">
  1265. <span v-if="user.userNameNeedTranslate == '1'">
  1266. <span v-if="node.data.children">
  1267. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1268. </span>
  1269. <span v-else>
  1270. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1271. </span>
  1272. </span>
  1273. <span v-if="user.userNameNeedTranslate != '1'">
  1274. {{ node.label }}
  1275. </span>
  1276. <!-- {{ node.label }} -->
  1277. </span>
  1278. </el-tree>
  1279. </el-scrollbar>
  1280. </div>
  1281. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1282. <div slot="footer" class="dialog-footer">
  1283. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1284. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1285. </div>
  1286. </el-dialog>
  1287. <el-dialog
  1288. v-if="monthWorkTimeDialog"
  1289. :visible.sync="monthWorkTimeDialog"
  1290. :close-on-click-modal="false"
  1291. customClass="customWidth selectworktime"
  1292. width="1200px"
  1293. title=""
  1294. >
  1295. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1296. <el-tabs v-model="activeName" @tab-click="handleClick">
  1297. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1298. <div class="selectworktime_export" style="margin-top:10px;">
  1299. <div class="selectworktime_export_l">
  1300. <el-date-picker
  1301. class="selecteworktime_datapick"
  1302. v-model="WorktimeDatepickValue"
  1303. value-format="yyyy-MM-dd"
  1304. type="daterange"
  1305. align="right"
  1306. unlink-panels
  1307. :range-separator="$t('other.to')"
  1308. :start-placeholder="$t('time.startDate')"
  1309. :end-placeholder="$t('time.endDate')"
  1310. :default-time="['12:00:00', '12:00:00']"
  1311. size="small"
  1312. popper-class="selecteorktime_datapick_popper"
  1313. @change="showMonthWorkTime()"
  1314. >
  1315. </el-date-picker>
  1316. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1317. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1318. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1319. <!-- 222 -->
  1320. </div>
  1321. <div>
  1322. <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">
  1323. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1324. </el-input>
  1325. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1326. </div>
  1327. <el-link
  1328. type="primary"
  1329. style="float: right; vertical-align: middle;height:32px"
  1330. @click="exportMembWorkHours()"
  1331. >{{$t('export.exportData')}}</el-link
  1332. >
  1333. </div>
  1334. <el-table ref="hasworkTbl"
  1335. :data="monthWorkDataS"
  1336. v-el-table-infinite-scroll="listScroll"
  1337. border
  1338. :height="500"
  1339. highlight-current-row
  1340. style="width: 100%"
  1341. v-loading="tbload"
  1342. :lazy="true"
  1343. >
  1344. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1345. <template slot-scope="scope">
  1346. {{ scope.$index + 1 }}
  1347. </template>
  1348. </el-table-column>
  1349. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1350. <template slot-scope="scope">
  1351. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1352. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1353. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1354. <!-- {{scope.row.name}} -->
  1355. </span>
  1356. </template>
  1357. </el-table-column>
  1358. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1359. <template slot-scope="scope">
  1360. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1361. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1362. </template>
  1363. </el-table-column>
  1364. <el-table-column
  1365. min-width="105"
  1366. v-for="(item, index) in pickDateArray"
  1367. :key="index"
  1368. :label="item.label"
  1369. align="center"
  1370. >
  1371. <template slot-scope="scope">
  1372. <div
  1373. style="color: red"
  1374. v-if="
  1375. scope.row.worktimeList.filter(
  1376. (w) =>
  1377. w.createDate==item.date
  1378. ).length > 0 &&
  1379. scope.row.worktimeList.filter(
  1380. (w) =>w.createDate==item.date
  1381. )[0].workingTime < reportTimeType.allday
  1382. "
  1383. >
  1384. {{
  1385. scope.row.worktimeList.filter(
  1386. (w) =>w.createDate==item.date
  1387. )[0].workingTime.toFixed(1)
  1388. }}
  1389. </div>
  1390. <div
  1391. style="color: #20a0ff"
  1392. v-if="
  1393. scope.row.worktimeList.filter(
  1394. (w) =>w.createDate==item.date
  1395. ).length > 0 &&
  1396. scope.row.worktimeList.filter(
  1397. (w) =>w.createDate==item.date
  1398. )[0].workingTime > reportTimeType.allday
  1399. "
  1400. >
  1401. {{
  1402. scope.row.worktimeList.filter(
  1403. (w) =>w.createDate==item.date
  1404. )[0].workingTime.toFixed(1)
  1405. }}
  1406. </div>
  1407. <div
  1408. v-if="
  1409. scope.row.worktimeList.filter(
  1410. (w) =>w.createDate==item.date
  1411. ).length > 0 &&
  1412. scope.row.worktimeList.filter(
  1413. (w) =>w.createDate==item.date
  1414. )[0].workingTime == reportTimeType.allday
  1415. "
  1416. >
  1417. {{
  1418. scope.row.worktimeList.filter(
  1419. (w) =>w.createDate==item.date
  1420. )[0].workingTime
  1421. }}
  1422. </div>
  1423. <div
  1424. v-if="
  1425. scope.row.worktimeList.filter(
  1426. (w) =>w.createDate==item.date
  1427. ).length == 0
  1428. "
  1429. >
  1430. 0
  1431. </div>
  1432. <div
  1433. v-if="
  1434. scope.row.worktimeList.filter(
  1435. (w) =>w.createDate==item.date
  1436. ).length > 0 &&
  1437. typeof scope.row.worktimeList.filter(
  1438. (w) =>w.createDate==item.date
  1439. )[0].workingTime == 'string'
  1440. "
  1441. >
  1442. {{
  1443. scope.row.worktimeList.filter(
  1444. (w) =>w.createDate==item.date
  1445. )[0].workingTime
  1446. }}
  1447. </div>
  1448. </template>
  1449. </el-table-column>
  1450. </el-table>
  1451. <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>
  1452. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1453. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1454. <label style="font-size: 16px">员工每日已填报工时数</label>
  1455. <el-link
  1456. type="primary"
  1457. style="float: right; margin-right: 60px"
  1458. @click="exportMembWorkHours()"
  1459. >导出已填报数据</el-link
  1460. > -->
  1461. <!-- <el-button >导出</el-button> -->
  1462. <!-- </div> -->
  1463. </el-tab-pane>
  1464. <el-tab-pane label="未提交人员列表" name="second" >
  1465. <div class="selectworktime_export" style="margin-top:10px">
  1466. <div class="selectworktime_export_l">
  1467. <el-date-picker
  1468. class="selecteworktime_datapick"
  1469. v-model="WorktimeDatepickValue"
  1470. value-format="yyyy-MM-dd"
  1471. type="daterange"
  1472. align="right"
  1473. unlink-panels
  1474. :range-separator="$t('other.to')"
  1475. :start-placeholder="$t('time.startDate')"
  1476. :end-placeholder="$t('time.endDate')"
  1477. :default-time="['12:00:00', '12:00:00']"
  1478. size="small"
  1479. popper-class="selecteorktime_datapick_popper"
  1480. @change="showMonthNotWorkTime()"
  1481. >
  1482. </el-date-picker>
  1483. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1484. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1485. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1486. </div>
  1487. <div>
  1488. <div style="margin-top:10px;">
  1489. <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>
  1490. <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>
  1491. <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">
  1492. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1493. </el-input>
  1494. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1495. <el-link
  1496. type="primary"
  1497. style="float: right; vertical-align: middle;height:32px"
  1498. @click="exportMembNotWorkHours()"
  1499. >{{$t('export.exportData')}}</el-link
  1500. >
  1501. </div>
  1502. </div>
  1503. </div>
  1504. <el-table
  1505. ref="hasworkTbl2"
  1506. :data="monthNotWorkDateS"
  1507. v-el-table-infinite-scroll="notListScroll"
  1508. border
  1509. :height="500"
  1510. highlight-current-row
  1511. style="width: 100%"
  1512. v-loading="tbload"
  1513. lazy
  1514. >
  1515. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1516. <template slot-scope="scope">
  1517. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1518. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1519. </template>
  1520. </el-table-column>
  1521. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1522. <template slot-scope="scope">
  1523. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1524. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1525. </template>
  1526. </el-table-column>
  1527. <el-table-column
  1528. min-width="200"
  1529. :label="$t('weekDay.date')"
  1530. align="center"
  1531. prop="createDate"
  1532. >
  1533. </el-table-column>
  1534. <el-table-column
  1535. min-width="200"
  1536. :label="$t('state.states')"
  1537. align="center"
  1538. prop="status"
  1539. />
  1540. <el-table-column
  1541. min-width="200"
  1542. :label="$t('other.attendanceData')"
  1543. prop="cardTime"
  1544. align="center"
  1545. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1546. </el-table>
  1547. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1548. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1549. </el-tab-pane>
  1550. </el-tabs>
  1551. </el-dialog>
  1552. <!--驳回弹出框 -->
  1553. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1554. <div>
  1555. <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')" />
  1556. </div>
  1557. <div slot="footer" class="dialog-footer">
  1558. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1559. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1560. </div>
  1561. </el-dialog>
  1562. <!-- 通过弹出框 -->
  1563. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1564. <div>
  1565. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1566. </div>
  1567. <div slot="footer" class="dialog-footer">
  1568. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1569. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1570. </div>
  1571. </el-dialog>
  1572. <!--批量导入日报 -->
  1573. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1574. <p>1. {{$t('other.download')}}
  1575. <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>
  1576. </p>
  1577. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1578. <p style="display: flex;justify-content: center;">
  1579. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1580. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1581. </el-upload>
  1582. </p>
  1583. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1584. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1585. </div>
  1586. </el-dialog>
  1587. <!-- 工时导入记录弹窗 -->
  1588. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1589. <div style="height: 452px">
  1590. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1591. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1592. <el-table-column prop="userName" :label="$t('other.operator')">
  1593. <template slot-scope="scope">
  1594. <div>
  1595. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1596. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1597. </div>
  1598. </template>
  1599. </el-table-column>
  1600. <el-table-column prop="datel" :label="$t('other.document')">
  1601. <template slot-scope="scope">
  1602. <div>
  1603. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1604. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1605. </div>
  1606. </template>
  1607. </el-table-column>
  1608. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1609. <template slot-scope="scope">
  1610. <div>
  1611. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1612. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1613. </div>
  1614. </template>
  1615. </el-table-column>
  1616. </el-table>
  1617. <el-col :span="24" class="paginatis">
  1618. <el-pagination
  1619. @size-change="handleSizeChange"
  1620. @current-change="handleCurrentChange"
  1621. :page-sizes="[20 , 50 , 80 , 100]"
  1622. :page-size="20"
  1623. layout="total, sizes, prev, pager, next"
  1624. :total="toViewForm.total"
  1625. style="float:right;"
  1626. ></el-pagination>
  1627. </el-col>
  1628. </div>
  1629. </el-dialog>
  1630. <!--基于企业微信考勤数据的工时导入 -->
  1631. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1632. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1633. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1634. </el-step>
  1635. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1636. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1637. </el-steps>
  1638. <div v-if="active==0" style="padding:30px;height:360px;">
  1639. <div style="margin-top:50px;margin-left:280px;">
  1640. <el-date-picker
  1641. v-model="importWxParam.date" :editable="false"
  1642. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1643. :clearable="true"
  1644. :range-separator="$t('other.to')"
  1645. type="daterange"
  1646. :start-placeholder="$t('time.startDate')"
  1647. :end-placeholder="$t('time.endDate')"
  1648. @change="loadCheckInData"
  1649. ></el-date-picker>
  1650. </div>
  1651. </div>
  1652. <div v-if="active==1" style="padding:10px;">
  1653. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1654. style="width: 100%;margin-top:5px;" >
  1655. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1656. <template slot-scope="scope">
  1657. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1658. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1659. </template>
  1660. </el-table-column>
  1661. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1662. </el-table-column>
  1663. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1664. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1665. <template slot-scope="scope">
  1666. <div>
  1667. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1668. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1669. </div>
  1670. </template>
  1671. </el-table-column>
  1672. <el-table-column prop="departmentName" label="部门" >
  1673. <template slot-scope="scope">
  1674. <div>
  1675. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1676. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1677. </div>
  1678. </template>
  1679. </el-table-column>
  1680. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1681. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1682. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1683. <template slot-scope="scope">
  1684. {{scope.row.workHours.toFixed(1)}}h
  1685. </template>
  1686. </el-table-column>
  1687. </el-table>
  1688. </div>
  1689. <div v-if="active==2" >
  1690. <p style="display: flex;justify-content: center;height:390px;">
  1691. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1692. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1693. </el-upload>
  1694. </p>
  1695. </div>
  1696. <div slot="title">
  1697. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1698. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1699. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1700. <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>
  1701. <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>
  1702. <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>
  1703. </div>
  1704. <span slot="footer">
  1705. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1706. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1707. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1708. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1709. </span>
  1710. </el-dialog>
  1711. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1712. <p style="display: flex;justify-content: center;height:100px;">
  1713. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1714. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1715. </el-upload>
  1716. </p>
  1717. </el-dialog>
  1718. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1719. <div>
  1720. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1721. v-model="deleteReportParam.date" :editable="false"
  1722. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1723. :clearable="true"
  1724. :range-separator="$t('other.to')"
  1725. type="daterange"
  1726. :start-placeholder="$t('time.startDate')"
  1727. :end-placeholder="$t('time.endDate')"
  1728. ></el-date-picker>
  1729. </div>
  1730. <div style="margin-top:10px;">
  1731. <span>请选择部门:</span>
  1732. <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>
  1733. <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>
  1734. </div>
  1735. <div style="margin-top:10px;">
  1736. <span>请选择员工:</span>
  1737. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1738. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1739. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1740. <span v-else>{{item.name}}</span>
  1741. </el-option>
  1742. </el-select>
  1743. </div>
  1744. <span slot="footer">
  1745. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1746. </span>
  1747. </el-dialog>
  1748. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1749. <div>
  1750. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1751. v-model="deleteReportParam.date" :editable="false"
  1752. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1753. :clearable="true"
  1754. :range-separator="$t('other.to')"
  1755. type="daterange"
  1756. :start-placeholder="$t('time.startDate')"
  1757. :end-placeholder="$t('time.endDate')"
  1758. ></el-date-picker>
  1759. </div>
  1760. <div style="margin-top:15px;">
  1761. <span>选择部门:</span>
  1762. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1763. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1764. size="small" v-if="user.userNameNeedTranslate != 1"
  1765. ></el-cascader>
  1766. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1767. </div>
  1768. <span slot="footer">
  1769. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1770. </span>
  1771. </el-dialog>
  1772. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1773. <div>
  1774. <span>选择时间:</span><el-date-picker
  1775. v-model="modImportTime"
  1776. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1777. :clearable="true"
  1778. type="datetime"
  1779. ></el-date-picker>
  1780. <span>选择导入人员:</span><el-select
  1781. v-model="modImportUserId"
  1782. >
  1783. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1784. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1785. <span v-else>{{item.name}}</span>
  1786. </el-option>
  1787. </el-select>
  1788. </div>
  1789. <span slot="footer">
  1790. <el-button @click="confirmChangeModTime" >确认</el-button>
  1791. </span>
  1792. </el-dialog>
  1793. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1794. <div>
  1795. <span>请选择年月:</span>
  1796. <el-date-picker
  1797. v-model="ratioYmonth" :editable="false"
  1798. format="yyyyMM" value-format="yyyyMM"
  1799. type="month"
  1800. ></el-date-picker>
  1801. </div>
  1802. <span slot="footer">
  1803. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1804. </span>
  1805. </el-dialog>
  1806. <!--工时批量代填 -->
  1807. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1808. <div>
  1809. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1810. v-model="importWxParam.date" :editable="false"
  1811. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1812. :clearable="true"
  1813. :range-separator="$t('other.to')"
  1814. type="daterange"
  1815. :start-placeholder="$t('time.startDate')"
  1816. :end-placeholder="$t('time.endDate')"
  1817. @change="loadCheckInData"
  1818. ></el-date-picker>
  1819. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1820. </div>
  1821. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1822. :key="timeStamp"
  1823. style="width: 100%;margin-top:5px;" ref="tab">
  1824. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1825. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1826. <template slot-scope="scope">
  1827. <div>
  1828. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1829. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1830. </div>
  1831. </template>
  1832. </el-table-column>
  1833. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1834. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1835. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1836. <template slot-scope="scope">
  1837. {{scope.row.workHours.toFixed(1)}}h
  1838. </template>
  1839. </el-table-column>
  1840. <!--项目名称列表 -->
  1841. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1842. <template slot-scope="scope">
  1843. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1844. </template>
  1845. </el-table-column>
  1846. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1847. <template slot-scope="scope">
  1848. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1849. </template>
  1850. </el-table-column>
  1851. </el-table>
  1852. </el-dialog>
  1853. <!--基于企业微信考勤数据的工时导入 -->
  1854. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1855. <div style="padding-bottom:10px;">
  1856. <p>{{importResultMsg}}</p>
  1857. </div>
  1858. <!-- <span slot="footer" class="dialog-footer">
  1859. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1860. </span> -->
  1861. </el-dialog>
  1862. <!-- 审核流程展示 -->
  1863. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1864. <div style="padding:20px 40px 20px 0">
  1865. <el-timeline :reverse="false">
  1866. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1867. <!-- {{item.msg}} -->
  1868. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1869. <span v-if="user.userNameNeedTranslate == 1">
  1870. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1871. <span>{{item.msgCon.two}}</span>
  1872. </span>
  1873. </el-timeline-item>
  1874. </el-timeline>
  1875. </div>
  1876. </el-dialog>
  1877. </section>
  1878. </template>
  1879. <script>
  1880. // 左右滑动
  1881. import dragMixin from "@/common/js/tensile.js";
  1882. import util from "../../common/js/util";
  1883. // 自定义select组件
  1884. import selectCat from "@/components/select.vue"
  1885. // 引入自定义级联组件
  1886. import vueCascader from "@/components/cascader.vue"
  1887. // 重庆物奇定制组件
  1888. import WeeklyCustomization from "./weeklyCustomization.vue"
  1889. import { mapMutations } from 'vuex'
  1890. let _that = this
  1891. export default {
  1892. mixins: [dragMixin],
  1893. components: {
  1894. selectCat,
  1895. vueCascader,
  1896. WeeklyCustomization
  1897. },
  1898. data() {
  1899. return {
  1900. exportType: 0,
  1901. exportingData: false,
  1902. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1903. jobResponseList:[],
  1904. yisibeiCompId: 3092,
  1905. yuzhongCompId: 3385,
  1906. mingyiName : '成都明夷电子科技有限公司',
  1907. // mingyiName : '明夷',
  1908. modItemDataId: null,
  1909. modImportTime: null,
  1910. modImportUserId: null,
  1911. showModImportTimeDialog: false,
  1912. showBatchSimpleApproveReport: false,
  1913. startDeleting: false,
  1914. showBatchDeleteReport: false,
  1915. deleteReportParam: {date:null, userIds:[]},
  1916. isDenying: false,
  1917. targetWeekDate: null,//填写周报中的周日期
  1918. importCardTimeVisi: false,
  1919. startRatioExporting: false,
  1920. exportUserRatio: false,
  1921. ratioYmonth:null,
  1922. hasWrittenReport: false,
  1923. today:null,
  1924. syncTimeLoading: false,
  1925. seluserText: '',
  1926. translation: '1', // 1、文字, 2、部门, 3、人员
  1927. exportLoad: false,
  1928. getPickerOptions: {
  1929. disabledDate: (time) => {
  1930. var date = new Date();
  1931. var year = date.getFullYear();
  1932. var month = date.getMonth() + 1;
  1933. if (month >= 1 && month <= 9) {
  1934. month = "0" + month;
  1935. }
  1936. var currentdate = year.toString() + month.toString();
  1937. var timeyear = time.getFullYear();
  1938. var timemonth = time.getMonth() + 1;
  1939. if (timemonth >= 1 && timemonth <= 9) {
  1940. timemonth = "0" + timemonth;
  1941. }
  1942. var timedate = timeyear.toString() + timemonth.toString();
  1943. if(this.user.timeType.fillAhead == 0){
  1944. return currentdate < timedate;
  1945. }else{
  1946. return false
  1947. }
  1948. }
  1949. },
  1950. alalal: '8.0',
  1951. timeBasecostList:null,
  1952. tbload: false,
  1953. exportTimeDialog: false,
  1954. searchKeyword: '',
  1955. monthWorkDataS: [],
  1956. monthNotWorkDateS: [],
  1957. pickDateArray:[],
  1958. WorktimeDatepickValue: [],
  1959. activeName:"first",
  1960. isLeave: 0,
  1961. submitingReport: false,
  1962. importResultMsg:null,
  1963. showImportResult:false,
  1964. importingData: false,
  1965. isDraft: 0,
  1966. timeStamp: 0,
  1967. projectColumns:[],
  1968. checkinLoading:false,
  1969. importWxParam:{date:null,},
  1970. active:0,
  1971. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1972. importWxDialog:false,
  1973. importDialog:false,
  1974. denyForm:null,
  1975. denyReasonDialog:false,
  1976. monthWorkTimeDialog: false,
  1977. isSubstitude:false,
  1978. isFill:false,
  1979. unFillList:[],
  1980. fillList:[],
  1981. fillMembList:[],
  1982. fillMembList_leave: [],
  1983. membListVisible: false,
  1984. isBatch:0,//是否是批量填报
  1985. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1986. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1987. 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')],
  1988. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1989. fillStatusList: [],
  1990. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1991. exportDialog:false,
  1992. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1993. subProjectList:[],
  1994. canEdit: true,
  1995. originCanEdit: true,
  1996. 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],
  1997. selectTime:null,
  1998. reportTimeType:{},
  1999. curDate:'',
  2000. isAllSelect: false,
  2001. approveDialogVisible:false,
  2002. deptId:null,
  2003. targetUid: null,
  2004. membCount:0,
  2005. selectState:"-1",
  2006. user: JSON.parse(sessionStorage.getItem("user")),
  2007. allUsersList: [],
  2008. showAddMore:false,
  2009. allDate: [],
  2010. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2011. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2012. choseDay: 0,
  2013. tableHeight: 0,
  2014. listLoading: false,
  2015. projectList: [], //项目列表
  2016. fillProjectList: [],
  2017. reportList: [], //日报列表
  2018. reportNames:[], //批量审批列表
  2019. selCon:[], //筛选条件
  2020. selProjectList:[], //筛选后项目列表
  2021. selConShow: true,
  2022. usersList: [], // 全部人员列表
  2023. usersListId: '', // 选中的人员id
  2024. dialogVisible: false, //项目弹窗
  2025. report: '',
  2026. workForm: {
  2027. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2028. domains: [{
  2029. id: null,
  2030. projectId: "",
  2031. workingTime: "",
  2032. timeType:0,
  2033. content: "",
  2034. state: 2,
  2035. multiWorktime:0,
  2036. worktimeList:[],
  2037. degreeId: null,
  2038. auditUserList: [],
  2039. }],
  2040. },
  2041. workRules: {
  2042. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2043. },
  2044. chooseParticipVisible: false,
  2045. logining: false,
  2046. isDisable: false,
  2047. timeType:[],
  2048. deptMembData: [
  2049. ],
  2050. //部门人员树状结构
  2051. data: [
  2052. {
  2053. id: -1,
  2054. label: this.$t('lable.allStaff'),
  2055. membCount:0
  2056. },
  2057. {
  2058. id: 0,
  2059. label: this.$t('lable.unassigned'),
  2060. }
  2061. ],
  2062. allData:{},
  2063. batchShowData:{},
  2064. option: [],
  2065. deptOptionList: [],
  2066. depData: {
  2067. id: -1,
  2068. label: this.$t('lable.allStaff'),
  2069. },
  2070. defaultProps: {
  2071. children: 'children',
  2072. label: 'label'
  2073. },
  2074. isNew: false,
  2075. selected: false,
  2076. valuet: new Date(),
  2077. domObj: null,
  2078. participator:[],
  2079. chosenMembCount:0,
  2080. jsDay: 0,
  2081. jsTime: 0,
  2082. falsss: false,
  2083. weidu: [],
  2084. weiduList: [],
  2085. yonghuUser: [],
  2086. dateAr: [],
  2087. batchSubFillDialog: false,
  2088. isSubstiS: false,
  2089. fillWeekDialogVisi: false,
  2090. fillWeekDialogVisiCustom: false,
  2091. zhoData: [],
  2092. weekDateRange: [],
  2093. btnZho: false,
  2094. weekDataLoading: false,
  2095. changdu: 6,
  2096. tianxieDialogVisible: false,
  2097. scopess: {},
  2098. zhoBao: {
  2099. time: '',
  2100. workingTime: '',
  2101. progress: '',
  2102. con: '',
  2103. subProjectId: '',
  2104. stage: '',
  2105. subProjectList: [],
  2106. stages: [],
  2107. },
  2108. zhoBaoIdx: '',
  2109. zhoBaoName: '',
  2110. zhis: {},
  2111. dealList: [],
  2112. toViewDialogVisible: false,
  2113. toViewList: [],
  2114. toViewloading: true,
  2115. toViewForm: {
  2116. pageIndex: '1',
  2117. pageSize: '20',
  2118. total: 0,
  2119. },
  2120. toViewloadings: false,
  2121. tabPositionss: 'top',
  2122. monthTotal: 0,
  2123. monthTotalPage: 0,
  2124. monthTotalLages: 20,
  2125. monthWorkData: [],
  2126. monthNotWorkDate: [],
  2127. monthWorkDataS1: [],
  2128. monthnotTotal: 0,
  2129. monthnotTotalPage: 0,
  2130. monthnotTotalLages: 20,
  2131. monthNotWorkDateS1: [],
  2132. deptMembDataText: '',
  2133. isFlag: false,
  2134. isMore: false,
  2135. stateKey: '0',
  2136. expandDate: [],
  2137. notifySelList:[],
  2138. departmentList: [],
  2139. approvalProcessDialog: false,
  2140. approvalProcessData: [],
  2141. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2142. 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')],
  2143. isWeekend: false,
  2144. canCancelInDialog: false,
  2145. approveinData: {},
  2146. approveinDialog: false,
  2147. reportCanDelete: false,
  2148. weeklyFilledTimeDialog: false,
  2149. weeklyFilledTimeList: [],
  2150. weeklyFilledTimeLoading: false,
  2151. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2152. weeklyFilledTimeCanDelete: false,
  2153. weeklyFilledTimeDate: null,
  2154. leaveAllNum: 0,
  2155. dataLoading: false,
  2156. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2157. vacationTime: {},
  2158. integrationProjectList: [],
  2159. totalReportHours: 0, // 合计的工时
  2160. workTimeForMinYi:0,
  2161. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2162. weekIndex: 1,
  2163. weekParentData: {},
  2164. deptIdForNoReport:[],
  2165. nameAearch: '', // 企业微信姓名搜索
  2166. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2167. deptMembDataLoading: false,
  2168. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2169. {
  2170. id: 4811,
  2171. // id: 10,
  2172. name: '陕西柘中建设工程有限公司'
  2173. }
  2174. ],
  2175. pushWorkTimeLogDig:false,
  2176. pushWorkTimeLogData:[],
  2177. };
  2178. },
  2179. watch: {
  2180. deptMembDataText(val) {
  2181. this.$refs.chooseMembTree.filter(val);
  2182. }
  2183. },
  2184. filters: {
  2185. // 过滤
  2186. amounts(value) {
  2187. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2188. return 0
  2189. }
  2190. var zhi = +value + 0
  2191. return zhi.toFixed(1)
  2192. },
  2193. // zhoData
  2194. zhoData(value, arr) {
  2195. var dateArray = value.split("-");
  2196. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2197. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2198. // console.log(arr[date.getDay()])
  2199. // return "周" + "日一二三四五六".charAt(date.getDay());
  2200. return arr[date.getDay()]
  2201. },
  2202. // 过滤数字
  2203. numbers(value) {
  2204. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2205. return 0
  2206. }
  2207. return value
  2208. },
  2209. },
  2210. computed: {},
  2211. mounted() {
  2212. var now = new Date();
  2213. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2214. this.today = t;
  2215. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2216. this.exportParam.dateRange = [startStr,t];
  2217. this.getAllDate(1);
  2218. this.getReportList();
  2219. this.getProjectList();
  2220. this.getFillProjectList();
  2221. this.getTimeType();
  2222. this.getDepartment();
  2223. this.scrollFunction()
  2224. this.userssHu();
  2225. if(this.user.timeType.reportAuditType == 3){
  2226. this.getAllUsersList()
  2227. }
  2228. if (this.user.company.packageProject == 1) {
  2229. this.getBasecostItemList();
  2230. }
  2231. if(this.user.timeType.lockWorktime){
  2232. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2233. }
  2234. //设置了下限
  2235. if (this.user.timeType.minReportTime) {
  2236. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2237. }
  2238. const that = this
  2239. if(this.user.userNameNeedTranslate == 1) {
  2240. that.dataLoading = that.$store.state.dataLoading
  2241. this.upDataLoading()
  2242. setTimeout(()=>{
  2243. that.dataLoading = that.$store.state.dataLoading
  2244. }, 1000)
  2245. }
  2246. if (this.user.companyId == this.yuzhongCompId) {
  2247. this.getJobResponList();
  2248. }
  2249. },
  2250. methods: {
  2251. ...mapMutations(['upDataLoading']),
  2252. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2253. isCustomization(userInfo, permissionArray) {
  2254. const { companyId } = userInfo
  2255. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2256. return isReportPictureRequired
  2257. },
  2258. //任务被选中
  2259. onTaskSelected(domainItem) {
  2260. //取服务
  2261. if (domainItem.taskId) {
  2262. var that = this;
  2263. var param = {taskId:domainItem.taskId};
  2264. if (this.isSubstitude) {
  2265. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2266. param.userId = this.workForm.userId[0];
  2267. }
  2268. }
  2269. this.http.post('/task/getMyTaskService',param, res => {
  2270. if (res.code == "ok") {
  2271. // domainItem.workContentList = res.data;
  2272. that.$set(domainItem, 'sapServiceId', null);
  2273. that.$set(domainItem, 'serviceList', res.data);
  2274. } else {
  2275. this.$message({
  2276. message: res.msg,
  2277. type: "error"
  2278. });
  2279. }
  2280. },error => {
  2281. this.$message({
  2282. message: error,
  2283. type: "error"
  2284. });
  2285. }
  2286. );
  2287. } else {
  2288. //清空服务
  2289. }
  2290. },
  2291. onBatchTimeChange() {
  2292. //反向计算每日工作时长
  2293. if (this.workForm.createDate) {
  2294. let sdate = new Date(this.workForm.createDate[0]);
  2295. let edate = new Date(this.workForm.createDate[1]);
  2296. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2297. console.log('days===', days)
  2298. if (days < 0) {
  2299. return;
  2300. }
  2301. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2302. //总时长发生改变,自动按比例计算
  2303. this.workForm.domains.forEach(d=>{
  2304. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2305. });
  2306. }
  2307. },
  2308. //更新工作内容列表
  2309. updateJobContent(domainItem) {
  2310. var that = this;
  2311. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2312. if (res.code == "ok") {
  2313. // domainItem.workContentList = res.data;
  2314. that.$set(domainItem, 'extraField3', null);
  2315. that.$set(domainItem, 'workContentList', res.data);
  2316. } else {
  2317. this.$message({
  2318. message: res.msg,
  2319. type: "error"
  2320. });
  2321. }
  2322. },error => {
  2323. this.$message({
  2324. message: error,
  2325. type: "error"
  2326. });
  2327. }
  2328. );
  2329. },
  2330. updateResponse(domainItem) {
  2331. var that = this;
  2332. var selectPid = domainItem.projectId;
  2333. domainItem.extraField2 = null;
  2334. domainItem.extraField3 = null;
  2335. if (selectPid && domainItem.extraField1) {
  2336. //是否非项目
  2337. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2338. console.log('==========','isPublic=='+isPublic);
  2339. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2340. console.log(filteredRespList);
  2341. domainItem.filteredRespList = filteredRespList;
  2342. }
  2343. },
  2344. getJobResponList() {
  2345. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2346. if (res.code == "ok") {
  2347. this.jobResponseList = res.data;
  2348. } else {
  2349. this.$message({
  2350. message: res.msg,
  2351. type: "error"
  2352. });
  2353. }
  2354. },error => {
  2355. this.$message({
  2356. message: error,
  2357. type: "error"
  2358. });
  2359. }
  2360. );
  2361. },
  2362. openModImportTime(row) {
  2363. this.showModImportTimeDialog = true;
  2364. this.modItemDataId = row.id;
  2365. },
  2366. delImportTime(row) {
  2367. let rowId = row.id;
  2368. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2369. confirmButtonText: this.$t('btn.determine'),
  2370. cancelButtonText: this.$t('btn.cancel'),
  2371. type: "warning"
  2372. })
  2373. .then(() => {
  2374. this.http.post('/report-import-log/delete',{
  2375. id: rowId
  2376. },res => {
  2377. if (res.code == "ok") {
  2378. this.$message({
  2379. message: '删除成功',
  2380. type: "success"
  2381. });
  2382. this.getToView();
  2383. } else {
  2384. this.$message({
  2385. message: res.msg,
  2386. type: "error"
  2387. });
  2388. }
  2389. },error => {
  2390. this.$message({
  2391. message: error,
  2392. type: "error"
  2393. });
  2394. }
  2395. );
  2396. }).catch(() => {this.startDeleting = false});
  2397. },
  2398. confirmChangeModTime() {
  2399. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2400. this.$message({
  2401. message: '请选择时间',
  2402. type: "error"
  2403. });
  2404. return;
  2405. }
  2406. this.http.post('/report-import-log/changeTime',{
  2407. modLogDateTime: this.modImportTime,
  2408. modImportUserId: this.modImportUserId,
  2409. id: this.modItemDataId
  2410. },res => {
  2411. if (res.code == "ok") {
  2412. this.$message({
  2413. message: '修改成功',
  2414. type: "success"
  2415. });
  2416. this.getToView();
  2417. this.showModImportTimeDialog = false;
  2418. } else {
  2419. this.$message({
  2420. message: res.msg,
  2421. type: "error"
  2422. });
  2423. }
  2424. },error => {
  2425. this.$message({
  2426. message: error,
  2427. type: "error"
  2428. });
  2429. }
  2430. );
  2431. },
  2432. confirmBatchApproveReport() {
  2433. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2434. this.$message({
  2435. message: '请选择日期范围',
  2436. type: "error"
  2437. });
  2438. return;
  2439. }
  2440. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2441. confirmButtonText: this.$t('btn.determine'),
  2442. cancelButtonText: this.$t('btn.cancel'),
  2443. type: "warning"
  2444. })
  2445. .then(() => {
  2446. this.startDeleting = true;
  2447. let obj = {
  2448. startDate: this.deleteReportParam.date[0],
  2449. endDate: this.deleteReportParam.date[1]
  2450. }
  2451. if(this.deleteReportParam.departmentId) {
  2452. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2453. } else {
  2454. obj.departmentId = null
  2455. }
  2456. this.http.post('/report/batchApproveByDate',obj,res => {
  2457. if (res.code == "ok") {
  2458. this.$message({
  2459. message: '审核通过',
  2460. type: "success"
  2461. });
  2462. this.getReportList();
  2463. this.getDepartment();
  2464. this.startDeleting = false;
  2465. } else {
  2466. this.$message({
  2467. message: res.msg,
  2468. type: "error"
  2469. });
  2470. }
  2471. },error => {
  2472. this.$message({
  2473. message: error,
  2474. type: "error"
  2475. });
  2476. }
  2477. );
  2478. }).catch(() => {this.startDeleting = false});
  2479. },
  2480. confirmBatchDelReport() {
  2481. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2482. this.$message({
  2483. message: '请选择部门或人员',
  2484. type: "error"
  2485. });
  2486. return;
  2487. }
  2488. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2489. this.$message({
  2490. message: '请选择日期范围',
  2491. type: "error"
  2492. });
  2493. return;
  2494. }
  2495. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2496. confirmButtonText: this.$t('btn.determine'),
  2497. cancelButtonText: this.$t('btn.cancel'),
  2498. type: "warning"
  2499. })
  2500. .then(() => {
  2501. this.startDeleting = true;
  2502. this.http.post('/report/batchDelete',{
  2503. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2504. startDate: this.deleteReportParam.date[0],
  2505. endDate: this.deleteReportParam.date[1],
  2506. deptId: this.deleteReportParam.deptId[0]
  2507. },res => {
  2508. if (res.code == "ok") {
  2509. this.$message({
  2510. message: this.$t('message.successfullyDeleted'),
  2511. type: "success"
  2512. });
  2513. this.getReportList();
  2514. this.getDepartment();
  2515. this.startDeleting = false;
  2516. } else {
  2517. this.$message({
  2518. message: res.msg,
  2519. type: "error"
  2520. });
  2521. }
  2522. },error => {
  2523. this.$message({
  2524. message: error,
  2525. type: "error"
  2526. });
  2527. }
  2528. );
  2529. }).catch(() => {this.startDeleting = false});
  2530. },
  2531. getRecentlyProject() {
  2532. this.http.post('/project/nearProject',{},res => {
  2533. if(res.code == 'ok'){
  2534. let topObj = {
  2535. label: '最近选择项目',
  2536. peojectList: res.data
  2537. }
  2538. let botomObj = {
  2539. label: '全部项目',
  2540. peojectList: this.fillProjectList
  2541. }
  2542. //最近项目如果在fillProjectList中不存在,需要移除
  2543. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2544. this.integrationProjectList = [topObj, botomObj]
  2545. }else {
  2546. this.$message({
  2547. message: res.msg,
  2548. type: 'error'
  2549. })
  2550. }
  2551. },err => {
  2552. this.$message({
  2553. message: err,
  2554. type: 'error'
  2555. })
  2556. })
  2557. },
  2558. handlePictureCardPreview(file, index) {
  2559. console.log(file, index)
  2560. let arr = []
  2561. let imgArr = this.workForm.domains[index].imgListUrl
  2562. for(var i in imgArr) {
  2563. arr.push(imgArr[i].url)
  2564. }
  2565. console.log(arr, '图片数据')
  2566. const $viewer = this.$viewerApi({
  2567. images: arr
  2568. });
  2569. },
  2570. // 图片上传
  2571. addImg(e, index) {
  2572. console.log(e, '数据')
  2573. let formData = new FormData()
  2574. formData.append('multipartFile', e.file)
  2575. this.http.uploadFile('/common/uploadFile', formData,
  2576. res => {
  2577. if (res.code == "ok") {
  2578. this.$message({
  2579. message: this.$t('uploadedsuccessfully'),
  2580. type: "success"
  2581. });
  2582. if(!this.workForm.domains[index].imgList) {
  2583. this.workForm.domains[index].imgList = []
  2584. this.workForm.domains[index].imgListUrl = []
  2585. }
  2586. this.workForm.domains[index].imgList.push(res.data)
  2587. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2588. } else {
  2589. this.$message({message: res.msg,type: "error"});
  2590. }
  2591. console.log(this.workForm.domains[index])
  2592. },
  2593. error => {this.$message({message: error,type: "error"});
  2594. });
  2595. },
  2596. // 删除图片
  2597. delImg(file,fileList, index) {
  2598. console.log(file, fileList)
  2599. let idx = 0
  2600. for(let i in fileList) {
  2601. if(fileList[i].uid == file.uid) {
  2602. idx = i
  2603. }
  2604. }
  2605. this.workForm.domains[index].imgList.splice(idx, 1)
  2606. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2607. console.log(this.workForm.domains[index])
  2608. },
  2609. test(){
  2610. console.log('test',this.workForm.domains);
  2611. },
  2612. getHour(s1, s2) {
  2613. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2614. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2615. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2616. var ms = s2.getTime() - s1.getTime();
  2617. if (ms < 0) return 0;
  2618. let ma = ms / 1000 / 60 / 60
  2619. return ma; //小时
  2620. },
  2621. refreshWXCardTime(workdate) {
  2622. if (!workdate) return;
  2623. this.syncTimeLoading = true;
  2624. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2625. date: workdate,
  2626. },res => {
  2627. this.syncTimeLoading = false;
  2628. if(res.code == 'ok'){
  2629. this.workForm.time = res.data.time;
  2630. }else {
  2631. this.$message({
  2632. message: res.msg,
  2633. type: 'error'
  2634. })
  2635. }
  2636. },err => {
  2637. this.syncTimeLoading = false;
  2638. this.$message({
  2639. message: err,
  2640. type: 'error'
  2641. })
  2642. })
  2643. },
  2644. refreshAttendance(workdate) {
  2645. if (!workdate) return;
  2646. this.syncTimeLoading = true;
  2647. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2648. startDate: workdate[0],
  2649. endDate: workdate[1]
  2650. },res => {
  2651. this.syncTimeLoading = false;
  2652. if(res.code == 'ok'){
  2653. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2654. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2655. this.totalReportHours = this.workTimeForMinYi;
  2656. }else {
  2657. this.$message({
  2658. message: res.msg,
  2659. type: 'error'
  2660. })
  2661. }
  2662. },err => {
  2663. this.syncTimeLoading = false;
  2664. this.$message({
  2665. message: err,
  2666. type: 'error'
  2667. })
  2668. })
  2669. },
  2670. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2671. this.weeklyFilledTimeDialog = true
  2672. this.weeklyFilledTimeLoading = true
  2673. this.weeklyFilledTimeDate = parameterDate
  2674. this.http.post('/report/getReportList',{
  2675. date: parameterDate,
  2676. userId: this.user.id
  2677. },res => {
  2678. this.weeklyFilledTimeLoading = false
  2679. if(res.code == 'ok'){
  2680. this.weeklyFilledTimeList = res.data[0].data
  2681. let candelete = true
  2682. for(let i in this.weeklyFilledTimeList){
  2683. if(this.weeklyFilledTimeList[i].state < 2){
  2684. candelete = false
  2685. }
  2686. }
  2687. this.weeklyFilledTimeCanDelete = candelete
  2688. }else {
  2689. this.$message({
  2690. message: res.msg,
  2691. type: 'error'
  2692. })
  2693. }
  2694. },err => {
  2695. this.weeklyFilledTimeLoading = false
  2696. this.$message({
  2697. message: err,
  2698. type: 'error'
  2699. })
  2700. })
  2701. },
  2702. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2703. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2704. confirmButtonText: this.$t('btn.determine'),
  2705. cancelButtonText: this.$t('btn.cancel'),
  2706. type: "warning"
  2707. })
  2708. .then(() => {
  2709. this.http.post('/report/delete',{
  2710. userId: this.user.id,
  2711. date: this.weeklyFilledTimeDate
  2712. },res => {
  2713. if (res.code == "ok") {
  2714. this.$message({
  2715. message: this.$t('message.successfullyDeleted'),
  2716. type: "success"
  2717. });
  2718. this.getWeeklyWorkTime()
  2719. this.getReportList();
  2720. this.getDepartment();
  2721. this.weeklyFilledTimeDialog = false;
  2722. } else {
  2723. this.$message({
  2724. message: res.msg,
  2725. type: "error"
  2726. });
  2727. }
  2728. },error => {
  2729. this.$message({
  2730. message: error,
  2731. type: "error"
  2732. });
  2733. }
  2734. );
  2735. }).catch(() => {});
  2736. },
  2737. getApprovalProcess(item){
  2738. // console.log('this.date',this.choseDate);
  2739. this.http.post('/report-log/get',{
  2740. creatorId: item.id,
  2741. createDate: sessionStorage.msg
  2742. },res => {
  2743. if(res.code == 'ok'){
  2744. this.approvalProcessDialog = true
  2745. if(this.user.userNameNeedTranslate == 1) {
  2746. for(var i in res.data) {
  2747. let obj = {
  2748. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2749. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2750. }
  2751. res.data[i].msgCon = obj
  2752. }
  2753. }
  2754. this.approvalProcessData = res.data
  2755. console.log(this.approvalProcessData, '数据卡看')
  2756. }else{
  2757. this.$message({
  2758. message: res.msg,
  2759. type: 'error'
  2760. })
  2761. }
  2762. },err => {
  2763. this.$message({
  2764. message: err,
  2765. type: 'error'
  2766. })
  2767. })
  2768. },
  2769. filterNode(value, data) {
  2770. if (!value) return true;
  2771. return data.label.indexOf(value) !== -1;
  2772. },
  2773. triggerCalculateOT(index) {
  2774. var str = this.workForm.domains[index].overtimeHours + ''
  2775. if(str.indexOf('.') != '-1') {
  2776. var s = str.split('.')[0]
  2777. var st = str.split('.')[1]
  2778. var sts = st.split('')
  2779. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2780. }
  2781. },
  2782. searchScreen(e){
  2783. if(e){
  2784. this.monthNotWorkDateS1 = []
  2785. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2786. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2787. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2788. }
  2789. }
  2790. if (this.monthNotWorkDateS1.length > 50) {
  2791. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2792. }else{
  2793. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2794. }
  2795. // if (this.monthNotWorkDateS1.length > 0) {
  2796. // setTimeout(() => {
  2797. // this.tableListenernot()
  2798. // }, 1000);
  2799. // }
  2800. }else{
  2801. this.monthWorkDataS1 = []
  2802. for (let i = 0; i < this.monthWorkData.length; i++) {
  2803. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2804. this.monthWorkDataS1.push(this.monthWorkData[i])
  2805. }
  2806. }
  2807. if (this.monthWorkDataS1.length > 50) {
  2808. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2809. }else{
  2810. this.monthWorkDataS = this.monthWorkDataS1
  2811. }
  2812. // if (this.monthWorkDataS1.length > 0) {
  2813. // setTimeout(() => {
  2814. // this.tableListener()
  2815. // }, 1000);
  2816. // }
  2817. }
  2818. },
  2819. addUpload(data) {
  2820. // var zhi = data.fileName.split('.')[0]
  2821. // var sss = zhi + '.xlsx'
  2822. // return
  2823. var filePath = '/upload/' + data.serverName;
  2824. const a = document.createElement('a'); // 创建a标签
  2825. a.setAttribute('download', data.fileName);// download属性
  2826. a.setAttribute('href', filePath);// href链接
  2827. a.click(); //自执行点击事件
  2828. a.remove();
  2829. },
  2830. restrictNumber(targetId) {
  2831. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2832. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2833. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2834. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2835. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2836. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2837. inpu.value = parseFloat(inpu.value);
  2838. }
  2839. },
  2840. //获取项目下的任务分组
  2841. getTaskGroups(domain, index) {
  2842. domain.groupId=null;
  2843. this.http.post('/task-group/listMyJoinGroup',{
  2844. projectId: domain.projectId,
  2845. isSubstitude: this.isSubstitude ? 1 : 0
  2846. },
  2847. res => {
  2848. if (res.code == "ok") {
  2849. this.workForm.domains[index].taskGroups = res.data;
  2850. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2851. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2852. // this.getGroupStages(domain, index);
  2853. // }
  2854. this.$forceUpdate();
  2855. }
  2856. },
  2857. error => {
  2858. this.$message({
  2859. message: error,
  2860. type: "error"
  2861. });
  2862. }
  2863. );
  2864. },
  2865. //下载填报工时占比报表
  2866. downloadProjectRatio() {
  2867. this.exportUserRatio = true;
  2868. // let now = new Date();
  2869. // let month = now.getMonth();//默认看上个月的
  2870. // let monthStr = month<10? ('0'+month): month;
  2871. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2872. const today = new Date();
  2873. const year = today.getFullYear();
  2874. const month = today.getMonth() + 1;
  2875. let lastMonthYear, lastMonth;
  2876. if (month === 1) {
  2877. lastMonthYear = year - 1;
  2878. lastMonth = 12;
  2879. } else {
  2880. lastMonthYear = year;
  2881. lastMonth = month - 1;
  2882. }
  2883. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2884. console.log('赋值 ==>', this.ratioYmonth)
  2885. },
  2886. confirmDownloadRatio() {
  2887. this.startRatioExporting = true;
  2888. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2889. ymonth: this.ratioYmonth
  2890. },
  2891. res => {
  2892. if (res.code == "ok") {
  2893. this.startRatioExporting = false;
  2894. var filePath = res.data;
  2895. const a = document.createElement('a'); // 创建a标签
  2896. var data = filePath.split("/");
  2897. a.setAttribute('download', data[data.length-1]);// download属性
  2898. a.setAttribute('href', filePath);// href链接
  2899. a.click(); //自执行点击事件
  2900. a.remove();
  2901. } else {
  2902. this.startRatioExporting = false;
  2903. this.$message({
  2904. message: res.msg,
  2905. type: "error"
  2906. });
  2907. }
  2908. },
  2909. error => {
  2910. this.checkinLoading = false;
  2911. this.$message({
  2912. message: error,
  2913. type: "error"
  2914. });
  2915. }
  2916. );
  2917. },
  2918. //下载带企业微信考勤数据的工时统计模板
  2919. downloadCheckInExcel() {
  2920. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2921. startDate: this.importWxParam.date[0],
  2922. endDate: this.importWxParam.date[1],
  2923. },
  2924. res => {
  2925. if (res.code == "ok") {
  2926. var filePath = res.data;
  2927. const a = document.createElement('a'); // 创建a标签
  2928. var data = filePath.split("/");
  2929. a.setAttribute('download', data[data.length-1]);// download属性
  2930. a.setAttribute('href', filePath);// href链接
  2931. a.click(); //自执行点击事件
  2932. a.remove();
  2933. } else {
  2934. this.$message({
  2935. message: res.msg,
  2936. type: "error"
  2937. });
  2938. }
  2939. },
  2940. error => {
  2941. this.checkinLoading = false;
  2942. this.$message({
  2943. message: error,
  2944. type: "error"
  2945. });
  2946. }
  2947. );
  2948. },
  2949. pre() {
  2950. if (this.active == 0) return;
  2951. this.active--;
  2952. },
  2953. next() {
  2954. this.active++;
  2955. },
  2956. triggerTotalTime(index) {
  2957. var item = this.checkinList[index];
  2958. var total = 0.0;
  2959. for (var i=0;i<this.projectColumns.length; i++) {
  2960. var key = this.projectColumns[i];
  2961. if (item[key] != null && item[key] != '') {
  2962. total += parseFloat(item[key]);
  2963. }
  2964. }
  2965. item.totalFillTime = total;
  2966. },
  2967. //提交批量代填的数据
  2968. submitBatchSubFillData() {
  2969. var data = JSON.stringify(this.checkinList);
  2970. this.http.post('/user-corpwx-time/submitProjectTime',{
  2971. json: data,
  2972. projectColumns: JSON.stringify(this.projectColumns)
  2973. },
  2974. res => {
  2975. if (res.code == "ok") {
  2976. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2977. this.importWxDialog = false;
  2978. }
  2979. },
  2980. error => {
  2981. this.checkinLoading = false;
  2982. this.$message({
  2983. message: error,
  2984. type: "error"
  2985. });
  2986. }
  2987. );
  2988. },
  2989. loadCheckInData() {
  2990. if (this.importWxParam.date == null) {
  2991. this.checkinList = [];
  2992. return;
  2993. }
  2994. this.checkinLoading = true;
  2995. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2996. startDate: this.importWxParam.date[0],
  2997. endDate: this.importWxParam.date[1],
  2998. },
  2999. res => {
  3000. if (res.code == "ok") {
  3001. this.checkinLoading = false;
  3002. this.checkinList = res.data.list;
  3003. this.projectColumns = res.data.projects;
  3004. // 自定义表格会导致表格错乱,需重新计算表格
  3005. this.$nextTick(()=>{
  3006. this.$refs.tab.doLayout()
  3007. })
  3008. }
  3009. },
  3010. error => {
  3011. this.checkinLoading = false;
  3012. this.$message({
  3013. message: error,
  3014. type: "error"
  3015. });
  3016. }
  3017. );
  3018. },
  3019. importCardTime(item) {
  3020. //首先判断文件类型
  3021. let str = item.file.name.split(".");
  3022. let format = str[str.length - 1];
  3023. if (format != "xls" && format != "xlsx") {
  3024. this.$message({
  3025. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3026. type: "error"
  3027. });
  3028. } else {
  3029. this.importingData = true;
  3030. let formData = new FormData();
  3031. formData.append("multipartFile", item.file);
  3032. formData.append("companyId", this.user.companyId);
  3033. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3034. res => {
  3035. this.$refs.uploadCardTime.clearFiles();
  3036. this.importingData = false;
  3037. if (res.code == "ok") {
  3038. //换成弹出框,以免有人等了半天回来啥也没看到
  3039. this.$message({
  3040. message: '导入考勤时长成功',
  3041. type: "success"
  3042. });
  3043. } else {
  3044. this.$message({
  3045. message: res.msg,
  3046. type: "error"
  3047. });
  3048. }
  3049. },
  3050. error => {
  3051. this.$refs.upload.clearFiles();
  3052. this.listLoading = false;
  3053. this.$message({
  3054. message: error,
  3055. type: "error"
  3056. });
  3057. });
  3058. }
  3059. },
  3060. batchImportWxData(item) {
  3061. //首先判断文件类型
  3062. let str = item.file.name.split(".");
  3063. let format = str[str.length - 1];
  3064. if (format != "xls" && format != "xlsx") {
  3065. this.$message({
  3066. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3067. type: "error"
  3068. });
  3069. } else {
  3070. this.importingData = true;
  3071. let formData = new FormData();
  3072. formData.append("file", item.file);
  3073. formData.append("companyId", this.user.companyId);
  3074. formData.append("withCheckIn", 1);
  3075. this.http.uploadFile('/report/importData', formData,
  3076. res => {
  3077. this.$refs.upload.clearFiles();
  3078. this.showImportResult = true;
  3079. this.importingData = false;
  3080. if (res.code == "ok") {
  3081. //换成弹出框,以免有人等了半天回来啥也没看到
  3082. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3083. this.getReportList();
  3084. this.importWxDialog = false;
  3085. } else {
  3086. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3087. }
  3088. },
  3089. error => {
  3090. this.$refs.upload.clearFiles();
  3091. this.listLoading = false;
  3092. this.$message({
  3093. message: error,
  3094. type: "error"
  3095. });
  3096. });
  3097. }
  3098. },
  3099. batchImportData(item) {
  3100. //首先判断文件类型
  3101. let str = item.file.name.split(".");
  3102. let format = str[str.length - 1];
  3103. if (format != "xls" && format != "xlsx") {
  3104. this.$message({
  3105. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3106. type: "error"
  3107. });
  3108. } else {
  3109. this.importingData = true;
  3110. let formData = new FormData();
  3111. formData.append("file", item.file);
  3112. formData.append("companyId", this.user.companyId);
  3113. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3114. this.http.uploadFile(url, formData,
  3115. res => {
  3116. this.$refs.upload.clearFiles();
  3117. this.importingData = false;
  3118. this.showImportResult = true;
  3119. if (res.code == "ok") {
  3120. //换成弹出框,以免有人等了半天回来啥也没看到
  3121. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3122. this.getReportList();
  3123. this.importWXDialog = false;
  3124. } else {
  3125. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3126. }
  3127. },
  3128. error => {
  3129. this.$refs.upload.clearFiles();
  3130. this.importingData = false;
  3131. this.$message({
  3132. message: error,
  3133. type: "error"
  3134. });
  3135. });
  3136. }
  3137. },
  3138. userssHu() {
  3139. this.http.post('/time-type/getCompanyTimeSetting',{
  3140. companyId: this.user.companyId
  3141. },
  3142. res => {
  3143. if (res.code == "ok") {
  3144. this.yonghuUser = res.data
  3145. }
  3146. },
  3147. error => {
  3148. this.$message({
  3149. message: error,
  3150. type: "error"
  3151. });
  3152. }
  3153. );
  3154. },
  3155. iptBlur(i) {
  3156. if(this.isBatch == 0) {
  3157. return
  3158. }
  3159. var reqParam = {
  3160. startDate: this.workForm.createDate[0],
  3161. endDate: this.workForm.createDate[1]
  3162. };
  3163. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3164. reqParam.userId = this.workForm.userId[0];
  3165. }
  3166. this.http.post('/report/getWorkDays',reqParam,
  3167. res => {
  3168. if (res.code == "ok") {
  3169. this.jsDay = res.data
  3170. this.chuji(i)
  3171. } else {
  3172. this.$message({
  3173. message: res.msg,
  3174. type: "error"
  3175. });
  3176. }
  3177. },
  3178. error => {
  3179. this.$message({
  3180. message: error,
  3181. type: "error"
  3182. });
  3183. }
  3184. );
  3185. //明夷硬编码获取
  3186. if (this.user.company.companyName == this.mingyiName) {
  3187. this.getWorkTimeForMinYi();
  3188. }
  3189. },
  3190. getWorkTimeForMinYi(){
  3191. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3192. startDate: this.workForm.createDate[0],
  3193. endDate: this.workForm.createDate[1]
  3194. },
  3195. res => {
  3196. if (res.code == "ok") {
  3197. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3198. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3199. this.totalReportHours = this.workTimeForMinYi;
  3200. } else {
  3201. this.$message({
  3202. message: res.msg,
  3203. type: "error"
  3204. });
  3205. this.workForm.createDate = [];
  3206. }
  3207. },
  3208. error => {
  3209. this.$message({
  3210. message: error,
  3211. type: "error"
  3212. });
  3213. }
  3214. );
  3215. },
  3216. chuji(i) {
  3217. if(i == 0) {
  3218. this.seleChn(1)
  3219. } else if(i == 1) {
  3220. this.seleChn(0)
  3221. } else if(i == 2) {
  3222. if(this.workForm.domains[0].multiWorktime > 0) {
  3223. this.iptChangs()
  3224. } else {
  3225. this.iptChang()
  3226. }
  3227. } else if(i == 3) {
  3228. this.seleChn(0)
  3229. }
  3230. },
  3231. seleChn(e,domain) {
  3232. if(e == 1) {
  3233. for(var i in this.workForm.domains) {
  3234. if(this.workForm.domains[i].timeType == 0) {
  3235. this.workForm.domains[i].workingTime = 8
  3236. } else {
  3237. this.workForm.domains[i].workingTime = 4
  3238. }
  3239. }
  3240. }
  3241. var quanbu = 0
  3242. var spl = this.workForm.domains
  3243. var zhi = ''
  3244. for(var i in spl) {
  3245. var sp = +spl[i].workingTime + 0
  3246. zhi = this.jsDay * sp
  3247. quanbu = +quanbu + zhi
  3248. }
  3249. this.jsTime = quanbu
  3250. this.totalReportHours = quanbu
  3251. let worktime = this.jsTime
  3252. // 自动计算加班时长
  3253. if(this.isBatch != 0){
  3254. worktime = this.jsTime / this.jsDay
  3255. }
  3256. if(this.user.timeType.fillOvertime && domain){
  3257. let isover = false
  3258. let alltime = 0
  3259. let allover = 0 //此处alltime同上面的worktime
  3260. for(let d in spl){
  3261. if(spl[d].isOvertime){
  3262. isover = true
  3263. allover += spl[d].overtimeHours*1
  3264. }
  3265. alltime += spl[d].workingTime*1
  3266. }
  3267. if(domain.overtimeHours){
  3268. allover = allover - domain.overtimeHours
  3269. }
  3270. if(worktime*1 > this.user.timeType.allday){
  3271. if(isover){
  3272. if(alltime > (allover + this.user.timeType.allday)){
  3273. this.$set(domain,'isOvertime',true)
  3274. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3275. }else{
  3276. this.$set(domain,'isOvertime',false)
  3277. this.$set(domain,'overtimeHours',null)
  3278. if(alltime < (allover + this.user.timeType.allday)){
  3279. let overtime = allover + this.user.timeType.allday - alltime
  3280. for(let pi in spl){
  3281. if(spl[pi].overtimeHours){
  3282. if((overtime - spl[pi].overtimeHours*1) > 0){
  3283. overtime = overtime - spl[pi].overtimeHours*1
  3284. this.$set(spl[pi],'isOvertime',false)
  3285. this.$set(spl[pi],'overtimeHours',null)
  3286. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3287. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3288. break
  3289. }else{
  3290. this.$set(spl[pi],'isOvertime',false)
  3291. this.$set(spl[pi],'overtimeHours',null)
  3292. break
  3293. }
  3294. }
  3295. }
  3296. }
  3297. }
  3298. }else{
  3299. this.$set(domain,'isOvertime',true)
  3300. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3301. }
  3302. }else{
  3303. for(let di in spl){
  3304. this.$set(spl[di],'isOvertime',false)
  3305. this.$set(spl[di],'overtimeHours',null)
  3306. }
  3307. }
  3308. }
  3309. },
  3310. iptChang() {
  3311. var sl = this.workForm.domains
  3312. let timeArr = []
  3313. for(var i in sl) {
  3314. if(sl[i].startTime && sl[i].endTime) {
  3315. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3316. }
  3317. }
  3318. this.getTimeHours(timeArr)
  3319. // for(let j in arrNum) {
  3320. // this.timeJsonStr += arrNum[j]
  3321. // if(flg) {
  3322. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3323. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3324. // }
  3325. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3326. // flg = true
  3327. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3328. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3329. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3330. // }
  3331. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3332. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3333. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3334. // }
  3335. // }
  3336. },
  3337. iptChangs() {
  3338. var sl = this.workForm.domains
  3339. let timeArr = []
  3340. for(var i in sl) {
  3341. for(var j in sl[i].worktimeList){
  3342. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3343. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3344. }
  3345. }
  3346. }
  3347. this.getTimeHours(timeArr)
  3348. },
  3349. // 调用接口或去数据
  3350. getTimeHours(arr) {
  3351. this.http.post('/report/getHoursByTimeRange',{
  3352. timeJsonStr: JSON.stringify(arr)
  3353. },res => {
  3354. if(res.code === 'ok') {
  3355. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3356. } else {
  3357. this.$message({
  3358. message: res.msg,
  3359. type: 'error'
  3360. })
  3361. }
  3362. },err => {
  3363. this.$message({
  3364. message: err,
  3365. type: 'error'
  3366. })
  3367. })
  3368. },
  3369. // 按周填报调用接口计算时间
  3370. async getWeekHoursByTimeRange(timeRange) {
  3371. const url = '/report/getHoursByTimeRange';
  3372. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3373. var that = this;
  3374. return new Promise((resolve, reject) => {
  3375. this.http.post(url, data, function(res) {
  3376. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3377. }, function(err) {
  3378. reject(err);
  3379. });
  3380. });
  3381. },
  3382. removeTimeItem(item, index) {
  3383. item.worktimeList.splice(index, 1);
  3384. this.iptChangs()
  3385. },
  3386. //添加工时
  3387. addNewWorktime(index, item) {
  3388. if(item.worktimeList == null ) {
  3389. item.worktimeList = []
  3390. }
  3391. item.worktimeList.push({});
  3392. },
  3393. //复制项目
  3394. copyProject(index) {
  3395. var leftProgress = 10;
  3396. if (this.reportTimeType.type == 3) {
  3397. //计算已经待分配工时比例
  3398. let array = this.workForm.domains;
  3399. let totalProgress = 0;
  3400. for (var i=0;i<array.length; i++) {
  3401. totalProgress += array[i].progress;
  3402. }
  3403. if (totalProgress < 100) {
  3404. leftProgress = 100 - totalProgress;
  3405. }
  3406. }
  3407. var newIndex = index+1;
  3408. var itemDomain = {
  3409. projectId: this.workForm.domains[index].projectId,
  3410. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3411. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3412. ),
  3413. content: "",
  3414. progress:leftProgress,
  3415. state:2,//2-表示待提交
  3416. };
  3417. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3418. if (this.reportTimeType.type == 0) {
  3419. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3420. var length = this.workForm.domains.length;
  3421. if (length == 2) {
  3422. this.showAddMore = false;
  3423. }
  3424. }
  3425. this.selectProject(itemDomain, newIndex);
  3426. },
  3427. pushWorkTime(reportId){
  3428. let url=''
  3429. if(this.user.timeType.syncSap == 1){
  3430. url='/report/pushProjectReportToSap'
  3431. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3432. var pushDate = this.date + day;
  3433. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3434. confirmButtonText: '确定',
  3435. cancelButtonText: '取消',
  3436. type: 'info'
  3437. }).then(() => {
  3438. const loading = this.$loading({
  3439. lock: true,
  3440. text: '正在推送中,请耐心等待。',
  3441. spinner: 'el-icon-loading',
  3442. background: 'rgba(0, 0, 0, 0.7)'
  3443. });
  3444. this.http.post(url,{
  3445. pushDate: pushDate,
  3446. reportId: reportId
  3447. },res => {
  3448. loading.close();
  3449. if(res.code == 'ok'){
  3450. this.$message({
  3451. type: 'success',
  3452. message: res.data
  3453. });
  3454. }else{
  3455. this.$message({
  3456. type: 'error',
  3457. message: res.msg
  3458. })
  3459. }
  3460. },err => {
  3461. loading.close();
  3462. this.$message({
  3463. type: 'error',
  3464. message: err
  3465. })
  3466. })
  3467. }).catch(() => {
  3468. });
  3469. }else{
  3470. url='/report/pushReportDataToThird'
  3471. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3472. confirmButtonText: '确定',
  3473. cancelButtonText: '取消',
  3474. type: 'info'
  3475. }).then(() => {
  3476. const loading = this.$loading({
  3477. lock: true,
  3478. text: '正在推送中,请耐心等待。',
  3479. spinner: 'el-icon-loading',
  3480. background: 'rgba(0, 0, 0, 0.7)'
  3481. });
  3482. this.http.post(url,{
  3483. yearMonth: this.date
  3484. },res => {
  3485. loading.close();
  3486. if(res.code == 'ok'){
  3487. this.$message({
  3488. type: 'success',
  3489. message: '推送成功!'
  3490. });
  3491. }else{
  3492. this.$message({
  3493. type: 'error',
  3494. message: res.msg
  3495. })
  3496. }
  3497. },err => {
  3498. loading.close();
  3499. this.$message({
  3500. type: 'error',
  3501. message: err
  3502. })
  3503. })
  3504. }).catch(() => {
  3505. });
  3506. }
  3507. },
  3508. showWorkTime(){
  3509. this.monthWorkTimeDialog = true;
  3510. this.searchKeyword = ''
  3511. this.WorktimeDatepickValue = this.istoMonth()
  3512. if(this.WorktimeDatepickValue.length == 0){
  3513. let newdate = new Date();
  3514. let nowdate = newdate.toLocaleDateString();
  3515. let getauto = this.getAutoWeekDate(nowdate)
  3516. let nowwd = [getauto[0],getauto[6]]
  3517. this.WorktimeDatepickValue = nowwd
  3518. }
  3519. this.showMonthWorkTime()
  3520. },
  3521. handleClick(t,e){
  3522. if (t.name == "first") {
  3523. this.showMonthWorkTime()
  3524. }else{
  3525. this.showMonthNotWorkTime()
  3526. }
  3527. },
  3528. //导出员工每日填报工时数
  3529. exportMembWorkHours() {
  3530. this.http.post(
  3531. "/report/exportUserDailyWorkTime",
  3532. {
  3533. // month: this.date,
  3534. startDate: this.WorktimeDatepickValue[0],
  3535. endDate: this.WorktimeDatepickValue[1],
  3536. },
  3537. (res) => {
  3538. if (res.code == "ok") {
  3539. let url = res.data;
  3540. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3541. }
  3542. },
  3543. (error) => {
  3544. this.$message({
  3545. message: error,
  3546. type: "error",
  3547. });
  3548. }
  3549. );
  3550. },
  3551. exportMembNotWorkHours() {
  3552. this.http.post(
  3553. "/report/exportNoReportUserList",
  3554. {
  3555. // month: this.date,
  3556. startDate: this.WorktimeDatepickValue[0],
  3557. endDate: this.WorktimeDatepickValue[1],
  3558. },
  3559. (res) => {
  3560. if (res.code == "ok") {
  3561. let url = res.data;
  3562. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3563. }
  3564. },
  3565. (error) => {
  3566. this.$message({
  3567. message: error,
  3568. type: "error",
  3569. });
  3570. }
  3571. );
  3572. },
  3573. downloadByA(name, url) {
  3574. const a = document.createElement("a"); // 创建a标签
  3575. a.setAttribute("download", name); // download属性
  3576. a.setAttribute("href", url); // href链接
  3577. a.click(); // 自执行点击事件
  3578. a.remove();
  3579. },
  3580. // 是否本月判断
  3581. istoMonth(){
  3582. let todate = new Date()
  3583. let tomonth = todate.getMonth() + 1
  3584. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3585. if(this.date == adate){
  3586. return []
  3587. }else{
  3588. let sedate = new Date(this.date)
  3589. let semonth = sedate.getMonth() + 1
  3590. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3591. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3592. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3593. return [sedates1, sedates2]
  3594. }
  3595. },
  3596. showMonthWorkTime() {
  3597. this.monthTotalPage = 0,
  3598. this.tbload = true
  3599. this.http.post(
  3600. "/report/getUserDailyWorkTime",
  3601. // "/report/getNoReportUserList",
  3602. {
  3603. // month: this.date,
  3604. startDate: this.WorktimeDatepickValue[0],
  3605. endDate: this.WorktimeDatepickValue[1],
  3606. },
  3607. (res) => {
  3608. if (res.code == "ok") {
  3609. this.tbload = false;
  3610. this.pickDateArray = res.data.days;
  3611. // console.log('dataarray',res.data.days);
  3612. this.monthWorkData = res.data.list;
  3613. // this.monthWorkDataS = this.monthWorkData
  3614. // this.monthWorkDataS1 = res.data.list
  3615. this.monthTotal = res.data.list.length
  3616. if (this.monthWorkData.length > 50) {
  3617. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3618. }else{
  3619. this.monthWorkDataS = this.monthWorkData
  3620. }
  3621. this.searchScreen(0)
  3622. // this.monthWorkDataS = infoList
  3623. // 判断
  3624. // if (this.monthWorkDataS1.length > 0) {
  3625. // setTimeout(() => {
  3626. // this.tableListener()
  3627. // }, 1000);
  3628. // }
  3629. this.$nextTick(function(){
  3630. this.$refs.hasworkTbl.doLayout();
  3631. });
  3632. // this.$forceUpdate()
  3633. }
  3634. },
  3635. (error) => {
  3636. this.tbload = false
  3637. this.$message({
  3638. message: error,
  3639. type: "error",
  3640. });
  3641. }
  3642. );
  3643. },
  3644. // tableListener(){
  3645. // let that = this;
  3646. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3647. // // 添加scroll监听事件
  3648. // dom.addEventListener("scroll", function () {
  3649. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3650. // if (scrollDistance < 2) {
  3651. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3652. // that.monthTotalPage++; //当前页数自增
  3653. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3654. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3655. // var infoList = arrList.splice(
  3656. // that.monthTotalPage * that.monthTotalLages,
  3657. // that.monthTotalLages
  3658. // );
  3659. // // 数据添加
  3660. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3661. // }
  3662. // }
  3663. // })
  3664. // },
  3665. showMonthNotWorkTime() {
  3666. this.monthTotalPage = 0,
  3667. this.tbload = true,
  3668. this.http.post(
  3669. "/report/getNoReportUserList",
  3670. {
  3671. startDate: this.WorktimeDatepickValue[0],
  3672. endDate: this.WorktimeDatepickValue[1],
  3673. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3674. },
  3675. (res) => {
  3676. if (res.code == "ok") {
  3677. this.tbload = false
  3678. this.monthNotWorkDate = res.data;
  3679. // this.monthNotWorkDateS1 = res.data
  3680. this.monthnotTotal = res.data.length
  3681. // 2222111
  3682. if (this.monthNotWorkDate.length > 50) {
  3683. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3684. } else {
  3685. this.monthNotWorkDateS = this.monthNotWorkDate
  3686. }
  3687. this.searchScreen(1)
  3688. // 判断
  3689. // if (this.monthnotworkDateS1.length > 0) {
  3690. // setTimeout(() => {
  3691. // this.tableListenernot()
  3692. // }, 1000);
  3693. // }
  3694. this.$nextTick(function(){
  3695. this.$refs.hasworkTbl2.doLayout();
  3696. });
  3697. }
  3698. },
  3699. (error) => {
  3700. this.tbload = false
  3701. this.$message({
  3702. message: error,
  3703. type: "error",
  3704. });
  3705. }
  3706. );
  3707. },
  3708. // tableListenernot(){
  3709. // let that = this;
  3710. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3711. // dom.addEventListener("scroll", function () {
  3712. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3713. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3714. // if (scrollDistance2 < 2) {
  3715. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3716. // that.monthnotTotalPage++; //当前页数自增
  3717. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3718. // var infoList = arrList.splice(
  3719. // that.monthnotTotalPage * that.monthnotTotalLages,
  3720. // that.monthnotTotalLages
  3721. // );
  3722. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3723. // }
  3724. // }
  3725. // })
  3726. // },
  3727. listScroll(){
  3728. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3729. this.isMore = true
  3730. setTimeout(()=>{
  3731. this.isMore = false
  3732. },1000)
  3733. }else {
  3734. this.isFlag = true
  3735. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3736. this.monthWorkDataS = datalist
  3737. setTimeout(()=>{
  3738. this.isFlag = false
  3739. },300)
  3740. }
  3741. },
  3742. notListScroll(){
  3743. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3744. this.isMore = true
  3745. setTimeout(()=>{
  3746. this.isMore = false
  3747. },1000)
  3748. }else {
  3749. this.isFlag = true
  3750. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3751. this.monthNotWorkDateS = datalist
  3752. // console.log('length',this.monthNotWorkDateS.length)
  3753. setTimeout(()=>{
  3754. this.isFlag = false
  3755. },300)
  3756. }
  3757. },
  3758. // 获取默认这zhou日期参数 222
  3759. getLastWeek(e){
  3760. let newdate = new Date()
  3761. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3762. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3763. if(e){
  3764. this.WorktimeDatepickValue = lastwd
  3765. this.showMonthWorkTime()
  3766. }else{
  3767. this.WorktimeDatepickValue = lastwd
  3768. this.showMonthNotWorkTime()
  3769. }
  3770. },
  3771. getThisWeek(e){
  3772. let newdate = new Date();
  3773. let nowdate = newdate.toLocaleDateString();
  3774. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3775. if(e){
  3776. this.WorktimeDatepickValue = nowwd
  3777. this.showMonthWorkTime()
  3778. }else{
  3779. this.WorktimeDatepickValue = nowwd
  3780. this.showMonthNotWorkTime()
  3781. }
  3782. },
  3783. getDoubleLastWeek(e){
  3784. let newdate = new Date()
  3785. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3786. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3787. if(e){
  3788. this.WorktimeDatepickValue = nextwd
  3789. this.showMonthWorkTime()
  3790. }else{
  3791. this.WorktimeDatepickValue = nextwd
  3792. this.showMonthNotWorkTime()
  3793. }
  3794. },
  3795. alreadyAllDate(stime,etime){
  3796. let diffdate = new Array();
  3797. let i=0;
  3798. while(stime<=etime){
  3799. let dateArray = stime.split("-");
  3800. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3801. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3802. let stimewk = this.weekDay[date.getDay()]
  3803. 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')
  3804. 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])
  3805. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3806. let stime_ts = new Date(stime).getTime();
  3807. let next_date = stime_ts + (24*60*60*1000);
  3808. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3809. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3810. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3811. stime = next_dates_y+next_dates_m+next_dates_d;
  3812. i++;
  3813. }
  3814. return diffdate
  3815. },
  3816. getAutoWeekDate(e) {
  3817. let dateString = e;
  3818. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3819. if (dateString.match(dateStringReg)) {
  3820. let presentDate = new Date(dateString),
  3821. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3822. return Array.from(new Array(7), function (val, index) {
  3823. let formatDate = new Date(
  3824. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3825. );
  3826. return (
  3827. formatDate.getFullYear() +
  3828. "-" +
  3829. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3830. "-" +
  3831. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3832. );
  3833. });
  3834. } else {
  3835. throw new Error(
  3836. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3837. );
  3838. }
  3839. },
  3840. onProgressChange() {
  3841. this.$forceUpdate();
  3842. },
  3843. showChooseMembTree() {
  3844. this.chosenMembCount = this.participator.length;
  3845. this.chooseParticipVisible = true;
  3846. },
  3847. onTreeItemChange() {
  3848. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3849. var list = chosenList.filter(item=>item.isUser == 1);
  3850. this.chosenMembCount = list.length;
  3851. },
  3852. findUserInTree() {
  3853. if (this.filterName == '') {
  3854. this.deptMembData = this.allMembData;
  3855. } else {
  3856. var list = this.findRecursively(this.filterName, this.allMembData);
  3857. this.deptMembData = list;
  3858. }
  3859. },
  3860. findRecursively(username, list) {
  3861. var filterList = [];
  3862. for (var i=0;i<list.length; i++) {
  3863. if (list[i].isUser == 1) {
  3864. if (list[i].label.indexOf(username) >= 0) {
  3865. //匹配上了
  3866. filterList.push(list[i]);
  3867. }
  3868. } else if (list[i].children != null && list[i].children.length > 0) {
  3869. var subList = this.findRecursively(username, list[i].children);
  3870. if (subList.length > 0) {
  3871. subList.forEach(s=>filterList.push(s));
  3872. }
  3873. }
  3874. }
  3875. return filterList;
  3876. },
  3877. //确定选择参与人
  3878. chooseParticip() {
  3879. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3880. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3881. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3882. if (this.user.company.packageProject == 1) {
  3883. if (this.chosenMembList.length > 1) {
  3884. this.$message({
  3885. message: '每次仅支持代填一个人',
  3886. type: "error",
  3887. });
  3888. return;
  3889. }
  3890. }
  3891. this.chooseParticipVisible = false;
  3892. this.workForm.userNames = '';
  3893. this.workForm.userId = [];
  3894. this.participator = [];
  3895. for (var i=0;i<this.chosenMembList.length; i++) {
  3896. this.workForm.userId.push(this.chosenMembList[i].id);
  3897. this.workForm.userNames += this.chosenMembList[i].label+',';
  3898. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3899. this.participator.push(item);
  3900. }
  3901. if (this.workForm.userNames.length > 0) {
  3902. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3903. }
  3904. if(this.user.userNameNeedTranslate == 1) {
  3905. if(this.workForm.userNames) {
  3906. this.workForm.userNames = this.workForm.userNames.split(',')
  3907. }
  3908. }
  3909. },
  3910. notifySel(sel){
  3911. // console.log(sel);
  3912. this.notifySelList = sel
  3913. },
  3914. //微信通知人员填写
  3915. Notify(code) {
  3916. if (this.notifySelList.length == 0) return;
  3917. var ids = '';
  3918. this.notifySelList.forEach(f=>{
  3919. ids += f.id+',';
  3920. })
  3921. this.http.post('/user/pushFillReport',{
  3922. ids: ids, date: this.curDate,
  3923. code: code
  3924. },
  3925. res => {
  3926. if (res.code == "ok") {
  3927. this.$message({
  3928. message: this.$t('message.sentSuccessfully'),
  3929. type: "success"
  3930. });
  3931. }
  3932. },
  3933. error => {
  3934. this.$message({
  3935. message: error,
  3936. type: "error"
  3937. });
  3938. }
  3939. );
  3940. },
  3941. //导出人员列表
  3942. exportMemb() {
  3943. if (this.fillMembList.length == 0) return;
  3944. var ids = '';
  3945. this.fillMembList.forEach(f=>{
  3946. ids += f.id+',';
  3947. })
  3948. this.http.post('/user/exportMembList',{
  3949. ids: ids,isFill: this.isFill, date: this.curDate
  3950. },
  3951. res => {
  3952. if (res.code == "ok") {
  3953. var aTag = document.createElement('a');
  3954. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3955. aTag.href = res.data;
  3956. aTag.click();
  3957. }
  3958. },
  3959. error => {
  3960. this.$message({
  3961. message: error,
  3962. type: "error"
  3963. });
  3964. }
  3965. );
  3966. },
  3967. showMembList(fill) {
  3968. this.membListVisible = true;
  3969. if (fill == 0) {
  3970. this.fillMembList = this.unFillList;
  3971. this.isFill = false;
  3972. let leaveList = []
  3973. let unleaveList = []
  3974. for(let i in this.fillMembList){
  3975. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3976. leaveList.push(this.fillMembList[i])
  3977. }else{
  3978. unleaveList.push(this.fillMembList[i])
  3979. }
  3980. }
  3981. this.fillMembList = unleaveList
  3982. this.fillMembList_leave = leaveList
  3983. } else if(fill == 1){
  3984. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3985. this.isFill = true;
  3986. }else{
  3987. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3988. this.isFill = true;
  3989. }
  3990. },
  3991. //获取自己填写的日报状态
  3992. getReportFillStatus() {
  3993. this.http.post('/report/getReportFillStatus',{
  3994. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3995. },
  3996. res => {
  3997. if (res.code == "ok") {
  3998. this.fillStatusList = res.data;
  3999. this.allDate.forEach(d=>{
  4000. var fillInfo = null;
  4001. d.state = null;
  4002. this.fillStatusList.forEach(s=>{
  4003. // console.log(d)
  4004. var d1 = s.createDate.split('-')[2];
  4005. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4006. // console.log(d2, '我被执行了')
  4007. if (d1.indexOf('0') == 0) {
  4008. d1 = d1.substring(1,d1.length);
  4009. }
  4010. if (d1 == d2) {
  4011. d.state = s.state;
  4012. }
  4013. })
  4014. })
  4015. this.$forceUpdate();
  4016. }
  4017. },
  4018. error => {
  4019. this.$message({
  4020. message: error,
  4021. type: "error"
  4022. });
  4023. }
  4024. );
  4025. },
  4026. scrollFunction () {
  4027. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4028. if (this.domObj.attachEvent) { // IE
  4029. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4030. } else if (this.domObj.addEventListener) {
  4031. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4032. }
  4033. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4034. },
  4035. mouseScroll(event) { // google 浏览器下
  4036. let detail = event.wheelDelta || event.detail
  4037. let moveForwardStep = -1
  4038. let moveBackStep = 1
  4039. let step = 0
  4040. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4041. event.preventDefault() // 阻止浏览器默认事件
  4042. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4043. },
  4044. // //左右滚动
  4045. // wheel(e){
  4046. // var a = document.getElementById("dateScroll");
  4047. // var scroll_width = 80; //滚动一下的距离
  4048. // var e = e || window.event, v;
  4049. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4050. // if(v>3||-v>3) v=-v;
  4051. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4052. // e.preventDefault(); //阻止浏览器的默认滚动
  4053. // },
  4054. showExportDialog() {
  4055. this.exportType = 0
  4056. this.exportDialog = true;
  4057. },
  4058. showExportTimeDialog() {
  4059. this.exportTimeDialog = true;
  4060. },
  4061. changeAllTime() {
  4062. //总时长发生改变,自动按比例计算
  4063. this.workForm.domains.forEach(d=>{
  4064. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4065. });
  4066. //计算jsTime
  4067. if (this.workForm.createDate) {
  4068. let sdate = new Date(this.workForm.createDate[0]);
  4069. let edate = new Date(this.workForm.createDate[1]);
  4070. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4071. console.log('days===', days)
  4072. if (days < 0) {
  4073. days = 0;
  4074. }
  4075. this.jsTime = this.reportTimeType.allday * days;
  4076. }
  4077. },
  4078. // 是否加班的单机事件
  4079. check() {
  4080. this.selected = !this.selected
  4081. this.isNew = this.selected
  4082. },
  4083. updateSubProject() {
  4084. this.$forceUpdate();
  4085. },
  4086. selectDegreeId(domain, index) {
  4087. this.http.post('/report/defaultDegree',{
  4088. projectId: domain.projectId
  4089. },
  4090. res => {
  4091. if (res.code == "ok") {
  4092. if(res.data) {
  4093. this.workForm.domains[index].degreeId = res.data.id + ''
  4094. this.$forceUpdate();
  4095. }
  4096. }
  4097. },
  4098. error => {
  4099. this.$message({
  4100. message: error,
  4101. type: "error"
  4102. });
  4103. }
  4104. );
  4105. },
  4106. //项目选中了, 加载子项目
  4107. selectProject(domain, index) {
  4108. if(!domain.projectId){
  4109. return;
  4110. }
  4111. // 默认选中上次填写的自定义维度
  4112. if(this.yonghuUser.customDegreeActive == 1) {
  4113. this.selectDegreeId(domain, index)
  4114. }
  4115. // console.log('projectId===',domain.projectId);
  4116. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4117. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4118. this.http.post('/sub-project/list',{
  4119. projectId: domain.projectId,
  4120. isReport: true
  4121. },
  4122. res => {
  4123. //清空之前选中的子项目
  4124. // this.workForm.domains[index].subProjectId = 0;
  4125. if (res.code == "ok") {
  4126. this.workForm.domains[index].subProjectList = res.data;
  4127. this.workForm.domains[index].subProjectId = null;
  4128. this.$forceUpdate();
  4129. }
  4130. },
  4131. error => {
  4132. this.$message({
  4133. message: error,
  4134. type: "error"
  4135. });
  4136. }
  4137. );
  4138. //项目相关的近期任务
  4139. if (this.user.company.packageProject == 1) {
  4140. this.getRecentTaskList(domain, index);
  4141. //获取项目相关专业
  4142. if (this.user.company.packageEngineering == 1) {
  4143. this.getProjectProfessions(domain, index);
  4144. }
  4145. //获取项目下的任务分组
  4146. this.getTaskGroups(domain, index);
  4147. }
  4148. // 获取项目相关的维度
  4149. // domain.degreeId = null
  4150. this.$set(domain,'degreeId',null)
  4151. this.$set(domain,'multiDegrIdArray',null)
  4152. this.dimension(domain, index);
  4153. //获取项目审核人
  4154. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4155. this.getProjectAuditorList(domain, index);
  4156. } else {
  4157. //按分组的负责人来审核
  4158. domain.projectAuditorId = null;
  4159. domain.projectAuditorName = null;
  4160. domain.auditUserList = null;
  4161. }
  4162. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4163. if (this.reportTimeType.type == 3) {
  4164. //新增项目时,自动计算
  4165. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4166. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4167. }
  4168. //加载昱众的工作职责
  4169. if (this.user.companyId == this.yuzhongCompId) {
  4170. this.updateResponse(domain);
  4171. }
  4172. },
  4173. getRecentTaskList(domain, index) {
  4174. //刷新任务时,清空服务
  4175. this.$set(domain, 'sapServiceId', null);
  4176. this.$set(domain, 'taskId', null);
  4177. var param = {
  4178. projectId: domain.projectId,
  4179. isSubstitude:this.isSubstitude?1:0,
  4180. };
  4181. if (domain.groupId) {
  4182. param.groupId = domain.groupId;
  4183. }
  4184. if (domain.stage) {
  4185. param.stage = domain.stage;
  4186. }
  4187. //专业版代填,获取代填员工的任务
  4188. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4189. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4190. this.$message({
  4191. message: '请选择代填的员工',
  4192. type: "error"
  4193. });
  4194. return;
  4195. } else {
  4196. param.userId = this.workForm.userId[0];
  4197. }
  4198. }
  4199. this.http.post('/task/getRecentTask',param,
  4200. res => {
  4201. if (res.code == "ok") {
  4202. this.workForm.domains[index].allTaskList = res.data;
  4203. this.workForm.domains[index].taskList = res.data;
  4204. this.$forceUpdate();
  4205. }
  4206. },
  4207. error => {
  4208. this.$message({
  4209. message: error,
  4210. type: "error"
  4211. });
  4212. }
  4213. );
  4214. },
  4215. //获取项目审核人
  4216. getProjectAuditorList(domainItem, index) {
  4217. if(domainItem.projectId == '') {
  4218. return
  4219. }
  4220. domainItem.projectAuditorId = null;
  4221. domainItem.projectAuditorName = null;
  4222. this.http.post('/project-auditor/getList',{
  4223. projectId: domainItem.projectId,
  4224. },
  4225. res => {
  4226. if (res.code == "ok") {
  4227. domainItem.auditUserList = res.data;
  4228. if (res.data.length==0) {
  4229. this.$message({
  4230. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4231. type: "error"
  4232. });
  4233. } else if (res.data.length==1) {
  4234. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4235. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4236. }
  4237. this.$forceUpdate();
  4238. }
  4239. },
  4240. error => {
  4241. this.$message({
  4242. message: error,
  4243. type: "error"
  4244. });
  4245. }
  4246. );
  4247. },
  4248. // 获取维度数据
  4249. dimension(domain, index) {
  4250. if(domain.projectId == '') {
  4251. return
  4252. }
  4253. this.http.post('/project/getDegreeList',{
  4254. projectId: domain.projectId,
  4255. },
  4256. res => {
  4257. if (res.code == "ok") {
  4258. // console.log("维度数据",res.data);
  4259. this.workForm.domains[index].wuduList = res.data
  4260. // this.workForm = this.workForm
  4261. this.$forceUpdate()
  4262. }
  4263. },
  4264. error => {
  4265. this.$message({
  4266. message: error,
  4267. type: "error"
  4268. });
  4269. }
  4270. );
  4271. },
  4272. //切换任务阶段
  4273. changeStages(domain, index) {
  4274. if (domain.stage == null || domain.stage == '') {
  4275. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4276. } else {
  4277. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4278. }
  4279. this.getRecentTaskList(domain, index);
  4280. this.$forceUpdate();
  4281. },
  4282. getGroupStages(domain, index, keepStage) {
  4283. // console.log(domain);
  4284. if(!domain.groupId){
  4285. domain.projectAuditorId = ''
  4286. domain.stages = []
  4287. if(this.user.timeType.reportAuditType >= 1){
  4288. domain.auditUserList = []
  4289. }
  4290. this.$forceUpdate();
  4291. return
  4292. }
  4293. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4294. res => {
  4295. if (res.code == "ok") {
  4296. if (!keepStage) {
  4297. domain.stage = '';
  4298. }
  4299. domain.stages = res.data;
  4300. this.getRecentTaskList(domain, index);
  4301. this.$forceUpdate();
  4302. }
  4303. },
  4304. error => {
  4305. this.$message({
  4306. message: error,
  4307. type: "error"
  4308. });
  4309. });
  4310. //检查当前的项目是否需要获取分组的负责人
  4311. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4312. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4313. res => {
  4314. if (res.code == "ok") {
  4315. domain.getProjectAuditorList = res.data;
  4316. domain.auditUserList = res.data;
  4317. if (res.data.length==1) {
  4318. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4319. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4320. } else if (res.data.length==0) {
  4321. domain.projectAuditorId = null;
  4322. domain.projectAuditorName = null;
  4323. }
  4324. this.$forceUpdate();
  4325. }
  4326. },
  4327. error => {
  4328. this.$message({
  4329. message: error,
  4330. type: "error"
  4331. });
  4332. });
  4333. }
  4334. },
  4335. getProjectProfessions(domain, index) {
  4336. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4337. res => {
  4338. if (res.code == "ok") {
  4339. this.workForm.domains[index].professionProgress = res.data;
  4340. this.$forceUpdate();
  4341. }
  4342. },
  4343. error => {
  4344. this.$message({
  4345. message: error,
  4346. type: "error"
  4347. });
  4348. });
  4349. },
  4350. //删除自己的日报
  4351. deleteReport() {
  4352. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4353. confirmButtonText: this.$t('btn.determine'),
  4354. cancelButtonText: this.$t('btn.cancel'),
  4355. type: "warning"
  4356. })
  4357. .then(() => {
  4358. this.listLoading = true;
  4359. this.http.post('/report/delete',{
  4360. userId: this.user.id,
  4361. date: this.workForm.createDate
  4362. },
  4363. res => {
  4364. this.listLoading = false;
  4365. if (res.code == "ok") {
  4366. this.$message({
  4367. message: this.$t('message.successfullyDeleted'),
  4368. type: "success"
  4369. });
  4370. this.getReportList();
  4371. this.getDepartment();
  4372. this.dialogVisible = false;
  4373. } else {
  4374. this.$message({
  4375. message: res.msg,
  4376. type: "error"
  4377. });
  4378. }
  4379. },
  4380. error => {
  4381. this.listLoading = false;
  4382. this.$message({
  4383. message: error,
  4384. type: "error"
  4385. });
  4386. }
  4387. );
  4388. })
  4389. .catch(() => {});
  4390. },
  4391. // 管理员删除日报
  4392. guanli(item) {
  4393. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4394. let param = {date: this.date + day, userId: item.id};
  4395. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4396. confirmButtonText: this.$t('btn.determine'),
  4397. cancelButtonText: this.$t('btn.cancel'),
  4398. type: "warning"
  4399. })
  4400. .then(() => {
  4401. this.listLoading = true;
  4402. this.http.post('/report/delete',param,
  4403. res => {
  4404. this.listLoading = false;
  4405. if (res.code == "ok") {
  4406. this.$message({
  4407. message: this.$t('message.successfullyDeleted'),
  4408. type: "success"
  4409. });
  4410. this.getReportList();
  4411. this.getDepartment();
  4412. this.dialogVisible = false;
  4413. } else {
  4414. this.$message({
  4415. message: res.msg,
  4416. type: "error"
  4417. });
  4418. }
  4419. },
  4420. error => {
  4421. this.listLoading = false;
  4422. this.$message({
  4423. message: error,
  4424. type: "error"
  4425. });
  4426. }
  4427. );
  4428. })
  4429. .catch(() => {});
  4430. },
  4431. selectAll() {
  4432. if (this.isAllSelect) {
  4433. var keys = [];
  4434. this.reportNames.forEach(b=>{
  4435. keys.push(b.id);
  4436. })
  4437. this.$refs.approveTree.setCheckedKeys(keys);
  4438. } else {
  4439. this.$refs.approveTree.setCheckedKeys([]);
  4440. }
  4441. },
  4442. removeEmptyNode(list) {
  4443. for (var i=0;i<list.length;i++) {
  4444. var cnt = 0;
  4445. if (list[i].membCount == 0) {
  4446. list.splice(i, 1);
  4447. i--;
  4448. } else if (list[i].children != null) {
  4449. this.removeEmptyNode(list[i].children);
  4450. }
  4451. }
  4452. },
  4453. calculateMembCount(list) {
  4454. for (var i in list) {
  4455. var cnt = 0;
  4456. if (list[i].children != null) {
  4457. this.calculateMembCount(list[i].children);
  4458. for (var m in list[i].children) {
  4459. cnt += list[i].children[m].membCount;
  4460. }
  4461. }
  4462. if (list[i].isUser == 1) {
  4463. cnt++;
  4464. this.membCount++;
  4465. }
  4466. list[i].membCount = cnt;
  4467. }
  4468. },
  4469. stateChange() {
  4470. // console.log(this.allData,'alldate');
  4471. this.membCount = 0;
  4472. if (this.selectState == -1) {
  4473. //全部状态
  4474. this.data = this.allData;
  4475. } else {
  4476. //未填报
  4477. this.seluserText = ''
  4478. var newData = JSON.parse(JSON.stringify(this.allData));
  4479. this.filterState(this.selectState, newData);
  4480. this.data = newData;
  4481. }
  4482. this.calculateMembCount(this.data);
  4483. this.data[0].membCount = this.membCount;//总人数
  4484. },
  4485. //按状态过滤部门人员
  4486. filterState(state, list) {
  4487. for (var i =0;i<list.length; i++) {
  4488. var obj = list[i];
  4489. if (obj.isUser == 1) {
  4490. var match = false;
  4491. if (state == -2) {
  4492. if (obj.state == null) {
  4493. match = true;
  4494. }
  4495. } else {
  4496. if (obj.state == state) {
  4497. match = true;
  4498. }
  4499. }
  4500. if (!match) {
  4501. list.splice(i, 1);
  4502. i--;
  4503. } else {
  4504. }
  4505. } else {
  4506. if (obj.children != null) {
  4507. this.filterState(state, obj.children);
  4508. }
  4509. }
  4510. }
  4511. },
  4512. //a按名称过滤部门人员
  4513. async seluserforText(){
  4514. const { userNameNeedTranslate } = this.user
  4515. this.membCount = 0;
  4516. var newData = JSON.parse(JSON.stringify(this.allData));
  4517. let textList = [this.seluserText]
  4518. if(userNameNeedTranslate == 1) {
  4519. this.dataLoading = true
  4520. let res = await this.postData('/user/getEmployeeList', {
  4521. keyword: this.seluserText,
  4522. cursor: '',
  4523. departmentId: -1,
  4524. pageIndex: 1,
  4525. pageSize: 1000
  4526. })
  4527. textList = res.data.records.map(item => item.name)
  4528. this.dataLoading = false
  4529. }
  4530. // return
  4531. console.log(textList, '<=== textList')
  4532. this.seluserforTextin(this.seluserText, newData, textList)
  4533. console.log(newData, 'Data')
  4534. this.data = newData;
  4535. this.calculateMembCount(this.data);
  4536. this.data[0].membCount = this.membCount;//总人数
  4537. },
  4538. seluserforTextin(text, list, textList = []){
  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 (obj.label.indexOf(text) != -1) {
  4544. // match = true
  4545. // }
  4546. if(textList.some(item => item.includes(obj.label))) {
  4547. match = true
  4548. }
  4549. if (!match) {
  4550. list.splice(i, 1);
  4551. i--;
  4552. } else {
  4553. }
  4554. } else {
  4555. if (obj.children != null) {
  4556. this.seluserforTextin(text, obj.children, textList);
  4557. }
  4558. }
  4559. }
  4560. },
  4561. // 当节点发生变化时
  4562. nodeChangeExpand(data) {
  4563. // 保存当前展开的节点
  4564. let flag = false
  4565. this.nodeModelData.some(item => {
  4566. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4567. flag = true
  4568. return true
  4569. }
  4570. })
  4571. if (!flag) { // 不存在则存到数组里
  4572. this.nodeModelData.push(data.id)
  4573. }
  4574. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4575. },
  4576. nodeChangeCollapse(data) {
  4577. console.log(this.nodeModelData)
  4578. this.nodeModelData.some((item, i) => {
  4579. if (item === data.id) {
  4580. this.nodeModelData.length = i
  4581. }
  4582. })
  4583. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4584. },
  4585. // 部门列表点击
  4586. handleNodeClick(data) {
  4587. // this.dealList = data
  4588. this.theValues(data.id, this.allData)
  4589. // this.depData = data;
  4590. var list = [];
  4591. if (data.id == -1) {
  4592. this.deptId = null;
  4593. this.targetUid = null;
  4594. list = this.data;
  4595. } else if (data.isUser == 1) {
  4596. this.deptId = null;
  4597. this.targetUid = data.id;
  4598. } else {
  4599. this.deptId = data.id;
  4600. this.targetUid = null;
  4601. list.push(data);
  4602. }
  4603. this.getReportList();
  4604. if (list.length > 0) {
  4605. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4606. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4607. }
  4608. },
  4609. exportPushLog(){
  4610. this.http.post('/sap-sync-log/export',{},
  4611. res => {
  4612. if (res.code == "ok") {
  4613. var filePath = res.data;
  4614. var fName = '推送日志.xlsx'
  4615. const a = document.createElement('a'); // 创建a标签
  4616. a.setAttribute('download', fName);// download属性
  4617. a.setAttribute('href', filePath);// href链接
  4618. a.click(); //自执行点击事件
  4619. a.remove();
  4620. } else {
  4621. this.$message({
  4622. message: res.msg,
  4623. type: "error"
  4624. });
  4625. }
  4626. },
  4627. error => {
  4628. this.$message({
  4629. message: error,
  4630. type: "error"
  4631. });
  4632. });
  4633. },
  4634. theValues(id, item) {
  4635. for(var i in item) {
  4636. if(item[i].id == id) {
  4637. this.depData = item[i]
  4638. if(id == '-1') {
  4639. this.translation = '1'
  4640. } else {
  4641. if(item[i].children) {
  4642. this.translation = '2'
  4643. } else {
  4644. this.translation = '3'
  4645. }
  4646. }
  4647. return
  4648. } else {
  4649. if(item[i].children) {
  4650. this.theValues(id, item[i].children)
  4651. }
  4652. }
  4653. }
  4654. },
  4655. //获取可以选择的代填的人员列表
  4656. getSubstitudeUserDeptList() {
  4657. if (this.deptMembData.length == 0) {
  4658. this.http.post("/department/listMyMembs", {},
  4659. res => {
  4660. if (res.code == "ok") {
  4661. let noAllData = JSON.parse(JSON.stringify(res.data));
  4662. if (noAllData.length > 0) {
  4663. // if (noAllData[0].label == '全部人员') {
  4664. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4665. noAllData.splice(0,1);
  4666. }
  4667. }
  4668. this.setUserToDept(noAllData);
  4669. this.deptMembData = noAllData;
  4670. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4671. console.log(this.deptMembData, '代填人员数据')
  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. },
  4687. // 获取部门列表
  4688. getDepartmentForApprove() {
  4689. this.http.post( this.port.manage.depList, {},
  4690. res => {
  4691. if (res.code == "ok") {
  4692. var list1 = JSON.parse(JSON.stringify(res.data));
  4693. this.deptOptionList = this.changeArr(list1);
  4694. console.log(this.deptOptionList, '部门')
  4695. } else {
  4696. this.$message({
  4697. message: res.msg,
  4698. type: "error"
  4699. });
  4700. }
  4701. },
  4702. error => {
  4703. this.$message({
  4704. message: error,
  4705. type: "error"
  4706. });
  4707. });
  4708. },
  4709. // 获取部门列表
  4710. getDepartment() {
  4711. //如果没有权限,就不需要获取
  4712. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4713. return;
  4714. }
  4715. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4716. var param = {date:this.date + day};
  4717. this.http.post("/report/getMembList", param,
  4718. res => {
  4719. if (res.code == "ok") {
  4720. if(res.data.length == 0){
  4721. return
  4722. }
  4723. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4724. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4725. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4726. // if (this.user.role > 0) {
  4727. // }
  4728. list.splice(0,0,{
  4729. id: -1,
  4730. label: this.$t('lable.allStaff'),
  4731. })
  4732. this.membCount = 0;
  4733. //设置员工到部门下面
  4734. this.setUserToDept(list);
  4735. this.data = list;
  4736. // console.log('data',this.data);
  4737. this.expandDate = [this.data[1].id]
  4738. this.allData = list;
  4739. // if (noAllData.length > 0) {
  4740. // if (noAllData[0].label == '全部人员') {
  4741. // noAllData.splice(0,1);
  4742. // }
  4743. // }
  4744. // this.setUserToDept(noAllData);
  4745. // this.deptMembData = noAllData;
  4746. this.option = this.changeArr(list1);
  4747. list[0].membCount = this.membCount;
  4748. if (this.depData.id == -1) {
  4749. this.depData.membCount = this.membCount;
  4750. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4751. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4752. } else {
  4753. if (this.depData.isUser == null) {
  4754. var dep = this.findTargetDept(this.data, this.depData.id);
  4755. var membDeptList = [];
  4756. membDeptList.push(dep);
  4757. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4758. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4759. }
  4760. }
  4761. if (this.depData.isUser == null) {
  4762. if (this.isFill) {
  4763. this.fillMembList = this.fillList;
  4764. } else {
  4765. this.fillMembList = this.unFillList;
  4766. }
  4767. }
  4768. this.leaveAllNum = 0
  4769. for(let i in this.unFillList){
  4770. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4771. this.leaveAllNum += 1
  4772. }
  4773. }
  4774. this.stateChange()
  4775. } else {
  4776. this.$message({
  4777. message: res.msg,
  4778. type: "error"
  4779. });
  4780. }
  4781. },
  4782. error => {
  4783. this.$message({
  4784. message: error,
  4785. type: "error"
  4786. });
  4787. });
  4788. this.getReportFillStatus();
  4789. },
  4790. findTargetDept(list, deptId) {
  4791. var t = null;
  4792. for (var i=0;i<list.length; i++) {
  4793. if (list[i].isUser == null && list[i].id == deptId) {
  4794. t = list[i];
  4795. break;
  4796. }
  4797. }
  4798. if (t == null) {
  4799. for (var i=0;i<list.length; i++) {
  4800. if (list[i].children != null && list[i].children.length > 0) {
  4801. t = this.findTargetDept(list[i].children, deptId);
  4802. if (t != null) {
  4803. break;
  4804. }
  4805. }
  4806. }
  4807. }
  4808. return t;
  4809. },
  4810. getUserMembListFromDeptList(list, isFill) {
  4811. var membList = [];
  4812. for (var i in list) {
  4813. var deptName = list[i].label;
  4814. if (list[i].userList != null) {
  4815. list[i].userList.forEach(element => {
  4816. if (isFill == 0) {
  4817. //获取未填的
  4818. if (element.state == null) {
  4819. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4820. membList.push(obj);
  4821. }
  4822. } else {
  4823. if (element.state != null) {
  4824. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4825. membList.push(obj);
  4826. }
  4827. }
  4828. });
  4829. }
  4830. if (list[i].children != null) {
  4831. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4832. }
  4833. }
  4834. return membList;
  4835. },
  4836. setUserToDept(list) {
  4837. for (var i in list) {
  4838. var cnt = 0;
  4839. if (list[i].children != null) {
  4840. this.setUserToDept(list[i].children);
  4841. for (var m in list[i].children) {
  4842. cnt += list[i].children[m].membCount;
  4843. }
  4844. }
  4845. if (list[i].userList != null) {
  4846. if (list[i].children == null) {
  4847. list[i].children = [];
  4848. }
  4849. list[i].userList.forEach(element => {
  4850. var obj = {
  4851. id: element.id,
  4852. label:element.name,
  4853. state:element.state,
  4854. parentId:element.departmentId,
  4855. isUser:1,
  4856. workingTime: element.workingTime,
  4857. leaveDays: element.leaveDays,
  4858. leaveTimes: element.leaveTimes
  4859. };
  4860. list[i].children.push(obj);
  4861. this.membCount++;
  4862. cnt++;
  4863. });
  4864. }
  4865. list[i].membCount = cnt;
  4866. }
  4867. },
  4868. // 修改数组
  4869. changeArr(arr) {
  4870. for (var i = 0; i < arr.length; i++) {
  4871. if(arr[i].id != -1 && arr[i].id != 0) {
  4872. if (arr[i].children != null && arr[i].children.length>0) {
  4873. arr[i].children = this.changeArr(arr[i].children);
  4874. }
  4875. arr[i].id && (arr[i].value = arr[i].id);
  4876. delete arr[i].id;
  4877. }
  4878. }
  4879. for(var i in arr) {
  4880. if(arr[i].id == -1 || arr[i].id == 0) {
  4881. arr.splice(i,1)
  4882. }
  4883. }
  4884. return arr;
  4885. },
  4886. //时间段范围设置改动,监听
  4887. onTimeTypeChange(timeType) {
  4888. this.seleChn(1)
  4889. this.showAddMore = true;
  4890. for(var i in this.workForm.domains) {
  4891. if (this.workForm.domains[i].timeType == 0) {
  4892. this.showAddMore = false;
  4893. break;
  4894. }
  4895. }
  4896. if (this.showAddMore) {
  4897. //检测数量
  4898. if (this.workForm.domains.length == 2) {
  4899. this.showAddMore = false;
  4900. } else {
  4901. this.showAddMore = true;
  4902. }
  4903. }
  4904. },
  4905. getTimeType() {
  4906. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4907. res => {
  4908. if (res.code == "ok") {
  4909. var t = res.data;
  4910. this.reportTimeType = t;
  4911. if (this.reportTimeType.type > 0) {
  4912. this.showAddMore = true;
  4913. }
  4914. //转化时间格式
  4915. if (t.allday != null) {
  4916. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4917. }
  4918. if (t.am != null) {
  4919. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4920. }
  4921. if (t.pm != null) {
  4922. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4923. }
  4924. let arr = []
  4925. for(var i in res.data.excludeTimeList) {
  4926. let obj = {
  4927. s: res.data.excludeTimeList[i].startTime,
  4928. e: res.data.excludeTimeList[i].endTime,
  4929. }
  4930. arr.push(obj)
  4931. }
  4932. this.vacationTime = arr
  4933. } else {
  4934. this.$message({
  4935. message: res.msg,
  4936. type: "error"
  4937. });
  4938. }
  4939. },
  4940. error => {
  4941. this.listLoading = false;
  4942. this.$message({
  4943. message: error,
  4944. type: "error"
  4945. });
  4946. });
  4947. },
  4948. // 改变月份 -------
  4949. changeMonthOut() {
  4950. this.getAllDate();
  4951. this.getReportList();
  4952. this.getDepartment();
  4953. },
  4954. // 选择日期
  4955. choseDate(i, item) {
  4956. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4957. return
  4958. }
  4959. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4960. this.choseDay = i;
  4961. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4962. sessionStorage.msg = this.date + day,
  4963. this.getReportList();
  4964. this.getDepartment();
  4965. this.curDate = item.date;
  4966. },
  4967. canClick(i, item){
  4968. let nowDate = new Date()
  4969. let nowDateYear = nowDate.getFullYear()
  4970. let itemYear = parseInt(this.date.split('-')[0])
  4971. let nowDateMonth = nowDate.getMonth() + 1
  4972. let itemMonth = parseInt(this.date.split('-')[1])
  4973. let nowDateDay = nowDate.getDate()
  4974. let itemDay = parseInt(item.showDate.split('.')[1])
  4975. if(nowDateYear < itemYear){
  4976. return false
  4977. }else if(nowDateYear == itemYear){
  4978. if(nowDateMonth < itemMonth){
  4979. return false
  4980. }else if(nowDateMonth == itemMonth){
  4981. if(nowDateDay < itemDay){
  4982. return false
  4983. }
  4984. }
  4985. }
  4986. },
  4987. // 获取日期列表
  4988. getAllDate(e) {
  4989. var dayArry = [];
  4990. var day = this.getCountDays();
  4991. let curMonthDay = null;
  4992. for (var k = 1; k <= day; k++) {
  4993. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4994. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4995. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4996. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4997. if(sessionStorage.msg) {
  4998. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4999. this.choseDay = k - 1;
  5000. curMonthDay = str;
  5001. }
  5002. } else {
  5003. if (new Date().getDate() == k) {
  5004. this.choseDay = k - 1;
  5005. }
  5006. }
  5007. } else {
  5008. this.choseDay = 0;
  5009. }
  5010. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5011. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5012. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5013. }
  5014. this.allDate = dayArry;
  5015. //不能超过最大日期
  5016. if (this.choseDay > day-1) {
  5017. this.choseDay = day-1;
  5018. }
  5019. if(sessionStorage.from != 1){
  5020. let nowmonth = new Date().getMonth() + 1
  5021. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5022. let nowdate = new Date().getDate()
  5023. if(nowd == this.date){
  5024. if(e && sessionStorage.msg){
  5025. }else{
  5026. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5027. }
  5028. let nowday = new Date(sessionStorage.msg).getDate()
  5029. this.choseDay = nowday - 1
  5030. let monthdate = new Date(sessionStorage.msg)
  5031. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5032. }else{
  5033. if(e && sessionStorage.msg){
  5034. }else{
  5035. sessionStorage.msg = this.date + '-01'
  5036. }
  5037. let monthdate = new Date(sessionStorage.msg)
  5038. this.choseDay = monthdate.getDate() - 1
  5039. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5040. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5041. }
  5042. }else{
  5043. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5044. }
  5045. //从消息点击跳转过来的,直接加载指定日期
  5046. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5047. this.curDate = sessionStorage.msg;
  5048. sessionStorage.from = 0;
  5049. } else {
  5050. // if (curMonthDay != null) {
  5051. // // this.curDate = curMonthDay;
  5052. // let d = new Date(sessionStorage.msg)
  5053. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5054. // } else {
  5055. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5056. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5057. // }
  5058. }
  5059. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5060. // if(!sessionStorage.msg){
  5061. // let msgday = this.choseDay + 1
  5062. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5063. // }
  5064. this.getReportFillStatus();
  5065. },
  5066. getCountDays() {
  5067. var newstr = this.date.replace(/-/g, "/");
  5068. var curDate = new Date(newstr+'/01');
  5069. var curMonth = curDate.getMonth();
  5070. curDate.setMonth(curMonth + 1);
  5071. curDate.setDate(0);
  5072. return curDate.getDate();
  5073. },
  5074. //获取日报列表
  5075. getReportList() {
  5076. this.listLoading = true;
  5077. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5078. let param = {date: this.date + day};
  5079. if (this.deptId) {
  5080. param.deptId = this.deptId;
  5081. }
  5082. if (this.targetUid) {
  5083. param.userId = this.targetUid;
  5084. }
  5085. this.http.post( this.port.report.list, param,
  5086. res => {
  5087. this.listLoading = false;
  5088. if (res.code == "ok") {
  5089. this.reportList = res.data;
  5090. if(document.querySelector("#day"+this.choseDay)){
  5091. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5092. }
  5093. } else {
  5094. this.$message({
  5095. message: res.msg,
  5096. type: "error"
  5097. });
  5098. }
  5099. },
  5100. error => {
  5101. this.listLoading = false;
  5102. this.$message({
  5103. message: error,
  5104. type: "error"
  5105. });
  5106. });
  5107. },
  5108. // 处理数据
  5109. // dealWith() {
  5110. // var tianxie = 0
  5111. // var weixtianxie = 0
  5112. // if(this.selectState == -1) {
  5113. // } else {
  5114. // var arr = []
  5115. // for (var i in this.reportList) {
  5116. // arr.push(this.reportList[i].id)
  5117. // }
  5118. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  5119. // }
  5120. // },
  5121. // getDealWith(item, tx, wtx, arr) {
  5122. // for(var i in item) {
  5123. // if(item[i].children) {
  5124. // this.getDealWith(item[i].children, tx, wtx, arr)
  5125. // } else {
  5126. // if(arr.indexOf(item[i].id) != '-1') {
  5127. // tx = +tx + 1
  5128. // }
  5129. // }
  5130. // }
  5131. // },
  5132. //导出员工工时统计
  5133. exportUserTime() {
  5134. this.listLoading = true;
  5135. var param = {};
  5136. if (this.exportParam.dateRange != null) {
  5137. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5138. }
  5139. this.http.post('/department/exportDeptStatistic', param,
  5140. res => {
  5141. this.listLoading = false;
  5142. if (res.code == "ok") {
  5143. location.href = res.data;
  5144. this.exportTimeDialog = false;
  5145. } else {
  5146. this.$message({
  5147. message: res.msg,
  5148. type: "error"
  5149. });
  5150. }
  5151. },
  5152. error => {
  5153. this.listLoading = false;
  5154. this.$message({
  5155. message: error,
  5156. type: "error"
  5157. });
  5158. });
  5159. },
  5160. //导出日报
  5161. exportReport() {
  5162. this.exportingData = true;
  5163. var param = {};
  5164. if (this.exportParam.dateRange != null) {
  5165. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5166. }
  5167. if (this.exportParam.projectId != null) {
  5168. param.projectId = this.exportParam.projectId;
  5169. }
  5170. if (this.exportParam.departmentId != null) {
  5171. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5172. }
  5173. param.stateKey = this.stateKey
  5174. // param.departmentId = this.user.departmentId
  5175. console.log(param, '《=== 导出传的参数')
  5176. this.http.post( this.port.report.export, param,
  5177. res => {
  5178. this.exportingData = false;
  5179. if (res.code == "ok") {
  5180. location.href = res.data;
  5181. this.exportDialog = false;
  5182. } else {
  5183. this.$message({
  5184. message: res.msg,
  5185. type: "error"
  5186. });
  5187. }
  5188. },
  5189. error => {
  5190. this.exportingData = false;
  5191. this.$message({
  5192. message: error,
  5193. type: "error"
  5194. });
  5195. });
  5196. },
  5197. //获取项目列表
  5198. getProjectList() {
  5199. this.listLoading = true;
  5200. this.http.post( this.port.project.list, {},
  5201. res => {
  5202. this.listLoading = false;
  5203. if (res.code == "ok") {
  5204. for(var i in res.data) {
  5205. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5206. res.data[i].projectCode = ''
  5207. }
  5208. }
  5209. this.projectList = res.data;
  5210. console.log("项目列表",this.projectList);
  5211. } else {
  5212. this.$message({
  5213. message: res.msg,
  5214. type: "error"
  5215. });
  5216. }
  5217. },
  5218. error => {
  5219. this.listLoading = false;
  5220. this.$message({
  5221. message: error,
  5222. type: "error"
  5223. });
  5224. });
  5225. },
  5226. // 获取填报日报的项目下拉列表
  5227. getFillProjectList() {
  5228. this.http.post( this.port.project.list, {
  5229. forReport: 1
  5230. },res => {
  5231. if (res.code == "ok") {
  5232. for(var i in res.data) {
  5233. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5234. res.data[i].projectCode = ''
  5235. }
  5236. }
  5237. this.fillProjectList = res.data;
  5238. this.getRecentlyProject()
  5239. } else {
  5240. this.$message({
  5241. message: res.msg,
  5242. type: "error"
  5243. });
  5244. }
  5245. },
  5246. error => {
  5247. this.$message({
  5248. message: error,
  5249. type: "error"
  5250. });
  5251. });
  5252. },
  5253. getBasecostItemList() {
  5254. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5255. companyId: this.user.companyId
  5256. },
  5257. res => {
  5258. if (res.code == "ok") {
  5259. this.timeBasecostList = res.data;
  5260. }
  5261. });
  5262. },
  5263. getAIReport(createDate) {
  5264. this.http.post('/report/getAIReport', {},
  5265. res => {
  5266. if (res.code == "ok") {
  5267. var quanbu = 0
  5268. this.jsDay = 1
  5269. var zhi = ''
  5270. var slp = res.data
  5271. for(var i in slp) {
  5272. var sp = +slp[i].workingTime + 0
  5273. zhi = this.jsDay * sp
  5274. quanbu = +quanbu + zhi
  5275. }
  5276. this.jsTime = quanbu
  5277. var aiReportData = res.data;
  5278. this.canCancelInDialog = false
  5279. if(aiReportData.length != 0) {
  5280. var arr = [];
  5281. for(var i in aiReportData) {
  5282. arr.push({
  5283. id: null,
  5284. projectId: aiReportData[i].projectId,
  5285. workingTime: aiReportData[i].workingTime,
  5286. content: '',
  5287. progress:100,
  5288. state: 2,
  5289. timeType: aiReportData[i].timeType,
  5290. subProjectList: aiReportData[i].subProjectList,
  5291. taskList: aiReportData[i].taskList,
  5292. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5293. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5294. taskId: aiReportData[i].taskId,
  5295. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5296. startTime: aiReportData[i].startTime,
  5297. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5298. endTime: aiReportData[i].endTime,
  5299. isOvertime: 0,
  5300. progress:aiReportData[i].progress,
  5301. professionProgress: aiReportData[i].professionProgressList,
  5302. stages:aiReportData[i].stages,
  5303. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5304. pics: null,
  5305. multiWorktime: aiReportData[i].multiWorktime,
  5306. worktimeList: [{}],
  5307. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5308. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5309. wuduList: aiReportData[i].degreeList,
  5310. taskGroups:aiReportData[i].taskGroups,
  5311. customData: aiReportData[i].customData,//自定义的数值
  5312. auditUserList: aiReportData[i].auditUserList,
  5313. projectAuditorId: aiReportData[i].projectAuditorId,
  5314. projectAuditorName: aiReportData[i].projectAuditorName,
  5315. overtimeHours: aiReportData[i].overtimeHours,
  5316. customText: aiReportData[i].customText,
  5317. basecostId: aiReportData[i].basecostId,
  5318. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5319. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5320. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5321. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5322. canEdit: true
  5323. })
  5324. }
  5325. this.workForm.domains = arr;
  5326. } else {
  5327. }
  5328. this.canEdit = true;
  5329. this.originCanEdit = true;
  5330. this.seleChn()
  5331. } else {
  5332. this.$message({
  5333. message: res.msg,
  5334. type: "error"
  5335. });
  5336. }
  5337. },
  5338. error => {
  5339. this.$message({
  5340. message: error,
  5341. type: "error"
  5342. });
  5343. });
  5344. },
  5345. // 获取个人某天的日报 111111
  5346. getReport() {
  5347. this.http.post( this.port.report.getPort, {
  5348. date: this.workForm.createDate
  5349. },
  5350. res => {
  5351. if (res.code == "ok") {
  5352. var quanbu = 0
  5353. this.jsDay = 1
  5354. var zhi = ''
  5355. var slp = res.data.report
  5356. for(var i in slp) {
  5357. var sp = +slp[i].workingTime + 0
  5358. zhi = this.jsDay * sp
  5359. quanbu = +quanbu + zhi
  5360. }
  5361. this.jsTime = quanbu
  5362. var list = res.data;
  5363. this.report = list;
  5364. this.reportTimeType = this.report.timeType;
  5365. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5366. this.isWeekend = !this.report.isWorkDay;
  5367. this.canCancelInDialog = false;
  5368. this.hasWrittenReport = list.report.length != 0;
  5369. if(list.report.length != 0) {
  5370. var arr = [];
  5371. this.canEdit = false;
  5372. let candelete = true
  5373. for(var i in list.report) {
  5374. var flg = null
  5375. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5376. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5377. var filteredRespList = null
  5378. if (targetP.length > 0) {
  5379. var isPublic = targetP[0].isPublic;
  5380. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5381. }
  5382. arr.push({
  5383. id: list.report[i].id,
  5384. projectId: list.report[i].projectId,
  5385. workingTime: list.report[i].workingTime,
  5386. content: list.report[i].content,
  5387. state: list.report[i].state,
  5388. timeType: list.report[i].timeType,
  5389. subProjectList: list.report[i].subProjectList,
  5390. taskList: list.report[i].taskList,
  5391. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5392. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5393. taskId: list.report[i].taskId,
  5394. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5395. startTime: list.report[i].startTime,
  5396. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5397. endTime: list.report[i].endTime,
  5398. isOvertime: flg,
  5399. progress:list.report[i].progress,
  5400. professionProgress: list.report[i].professionProgressList,
  5401. stages:list.report[i].stages,
  5402. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5403. pics: list.report[i].pics,
  5404. multiWorktime: list.report[i].multiWorktime,
  5405. worktimeList: list.report[i].worktimeList,
  5406. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5407. multiDegrIdArray: list.report[i].multiDegrIdList,
  5408. wuduList: list.report[i].degreeList,
  5409. taskGroups:list.report[i].taskGroups,
  5410. customData: list.report[i].customData,//自定义的数值
  5411. auditUserList: list.report[i].auditUserList,
  5412. projectAuditorId: list.report[i].projectAuditorId,
  5413. projectAuditorName: list.report[i].projectAuditorName,
  5414. overtimeHours: list.report[i].overtimeHours,
  5415. customText: list.report[i].customText,
  5416. basecostId: list.report[i].basecostId,
  5417. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5418. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5419. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5420. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5421. canEdit: list.report[i].state >= 2 ? true : false,
  5422. extraField1: list.report[i].extraField1,
  5423. extraField2: list.report[i].extraField2,
  5424. extraField3: list.report[i].extraField3,
  5425. workContentList: list.report[i].workContentList,
  5426. filteredRespList: filteredRespList,
  5427. serviceList: list.report[i].serviceList,
  5428. sapServiceId: list.report[i].sapServiceId,
  5429. })
  5430. if (list.report[i].state >= 2) {
  5431. this.canEdit = true;
  5432. }
  5433. if(list.report[i].state < 2){
  5434. candelete = false
  5435. }
  5436. if (list.report[i].state == 0){
  5437. this.canCancelInDialog = true
  5438. }
  5439. // 加判断
  5440. if(this.user.timeType.choseFromAlbum == 1) {
  5441. let arrList = []
  5442. for(var k in list.report[i].pics) {
  5443. let obj = {
  5444. name: k,
  5445. url: list.report[i].pics[k]
  5446. }
  5447. arrList.push(obj)
  5448. }
  5449. arr[i].imgListUrl = arrList
  5450. arr[i].imgList = list.report[i].pics
  5451. }
  5452. }
  5453. this.reportCanDelete = candelete
  5454. this.workForm = {
  5455. createDate: this.workForm.createDate,
  5456. domains: arr,
  5457. userNames:null,
  5458. userId:null,
  5459. time: list.time
  5460. }
  5461. console.log('workForm', this.workForm)
  5462. } else {
  5463. this.workForm = {
  5464. createDate: this.workForm.createDate,
  5465. domains: [{
  5466. id: null,
  5467. projectId: "",
  5468. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5469. content: "",
  5470. progress:100,
  5471. state: 2,
  5472. timeType:0,
  5473. multiWorktime: this.reportTimeType.multiWorktime,
  5474. worktimeList:[{}],
  5475. canEdit: true,
  5476. auditorFirst: '',
  5477. auditorSec: '',
  5478. auditorThird: '',
  5479. ccUserid: ''
  5480. }],
  5481. userId:null,
  5482. userNames:null,
  5483. time: this.report.time
  5484. }
  5485. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5486. this.$set(this.workForm.domains[0],'isOvertime',true)
  5487. if(this.reportTimeType.type != 2){
  5488. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5489. }
  5490. }
  5491. if(this.user.timeType.type == 1) {
  5492. var shuzhi = this.user.timeType.allday + ''
  5493. // console.log('执行一次', shuzhi.indexOf('.'))
  5494. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5495. }
  5496. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5497. //默认给第一个,必填字段
  5498. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5499. }
  5500. this.canEdit = true;
  5501. }
  5502. this.originCanEdit = this.canEdit;
  5503. this.seleChn()
  5504. } else {
  5505. this.$message({
  5506. message: res.msg,
  5507. type: "error"
  5508. });
  5509. }
  5510. },
  5511. error => {
  5512. this.$message({
  5513. message: error,
  5514. type: "error"
  5515. });
  5516. });
  5517. },
  5518. guanbi() {
  5519. this.falsss = false,
  5520. this.workTimeForMinYi=0
  5521. },
  5522. // 打开日报填写
  5523. fillInReport(i, isBatch) {
  5524. this.isWeekend = false
  5525. this.reportCanDelete = false
  5526. // console.log(this.user.timeType.type, '选择时长')
  5527. if(i != 1) {
  5528. this.falsss = false
  5529. } else {
  5530. this.falsss = true
  5531. }
  5532. if (this.isSubstitude) {
  5533. this.getSubstitudeUserDeptList();
  5534. }
  5535. if(i == -1 || this.isSubstitude) {
  5536. this.isDisable = false;
  5537. } else {
  5538. this.isDisable = true;
  5539. }
  5540. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5541. this.isBatch = isBatch;
  5542. if (this.isBatch == 0 && !this.isSubstitude) {
  5543. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5544. let weekday = new Date(this.workForm.createDate).getDay()
  5545. if(this.user.companyId == 817){
  5546. if(weekday == 0){
  5547. this.isWeekend = true
  5548. }
  5549. }else{
  5550. if(weekday == 0 || weekday == 6){
  5551. this.isWeekend = true
  5552. }
  5553. }
  5554. this.getReport(i);
  5555. } else {
  5556. // console.log('执行到了这里')
  5557. this.jsTime = 0
  5558. this.jsDay = 0
  5559. this.workForm = {
  5560. createDate: null,//批量填报没有日期
  5561. domains: [{
  5562. id: null,
  5563. projectId: "",
  5564. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5565. content: "",
  5566. progress:100,
  5567. state: 2,
  5568. timeType:0,
  5569. multiWorktime: this.reportTimeType.multiWorktime,
  5570. worktimeList:[{}],
  5571. canEdit: true,
  5572. }],
  5573. }
  5574. if(this.user.timeType.type == 1) {
  5575. var shuzhi = this.user.timeType.allday + ''
  5576. // console.log('执行二次')
  5577. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5578. }
  5579. // console.log(this.workForm)
  5580. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5581. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5582. }
  5583. this.canEdit = true;
  5584. }
  5585. this.dialogVisible = true;
  5586. },
  5587. //按周填报的弹窗口中编辑单项目相关数据
  5588. setWeekFormReportItem(reportId, i, names, row,sss) {
  5589. console.log(sss)
  5590. this.http.post('/report/getReportById', {
  5591. reportId: reportId
  5592. },
  5593. res => {
  5594. if (res.code == "ok") {
  5595. var data = res.data.report;
  5596. sss.subProjectId = data.subProjectId
  5597. sss.subProjectList = data.subProjectList;
  5598. sss.stage = data.stage
  5599. sss.subProjectList = data.subProjectList
  5600. sss.stages = data.stages
  5601. sss.taskGroups = data.taskGroups;
  5602. sss.auditUserList = data.auditUserList;
  5603. sss.degreeId = data.degreeId;
  5604. sss.customData = data.customData;
  5605. sss.wuduList = data.degreeList;
  5606. this.zhoBaoIdx = i
  5607. this.zhoBaoName = names
  5608. this.zhoBao = sss
  5609. this.zhis = row
  5610. if (sss.groupId) {
  5611. //最后一个参数表示是否保留stage的值,不要重置为空
  5612. this.getGroupStages(this.zhoBao, 0, true)
  5613. }
  5614. this.$forceUpdate();
  5615. }
  5616. });
  5617. },
  5618. // 按周填报里内容的填写
  5619. tianxies(item, i, names, row) {
  5620. if (item.state == 0) {
  5621. this.$message({
  5622. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5623. type: "error"
  5624. });
  5625. return;
  5626. }
  5627. if (item.state == 1) {
  5628. this.$message({
  5629. message: '已通过状态不可修改',
  5630. type: "error"
  5631. });
  5632. return;
  5633. }
  5634. if(this.user.timeType.notAllowedNoAttendance == 1){
  5635. if(this.zhoData[i].corpTime){
  5636. if(this.zhoData[i].corpTime.workHours == 0){
  5637. this.$message({
  5638. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5639. type: 'error'
  5640. })
  5641. return
  5642. }
  5643. }else{
  5644. this.$message({
  5645. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5646. type: 'error'
  5647. })
  5648. return
  5649. }
  5650. }
  5651. var idd = ''
  5652. var obj = {}
  5653. for(var l in this.projectList) {
  5654. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5655. }
  5656. obj.projectId = idd
  5657. this.tianxieDialogVisible = true
  5658. this.scopess = item
  5659. console.log(item, '《==== 当前的对象')
  5660. var sss = {}
  5661. if (item.id != null) {
  5662. sss.id = item.id;
  5663. sss.state = item.state;
  5664. } else {
  5665. sss.id = -1;
  5666. sss.state = 3;
  5667. }
  5668. sss.projectId = idd;
  5669. sss.progress = item.progress
  5670. sss.time = item.time
  5671. sss.content = item.content;
  5672. console.log('333', sss.content)
  5673. if (sss.time == '' && this.reportTimeType.type == 2) {
  5674. //取已填时间范围中最大的一个作为开始时间
  5675. var startTime = '09:00';
  5676. var fillStartTime = '00:00';
  5677. for (var t in this.selProjectList) {
  5678. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5679. if (fillItem.time) {
  5680. if (fillItem.time[1] > fillStartTime) {
  5681. fillStartTime = fillItem.time[1];
  5682. }
  5683. }
  5684. }
  5685. if (fillStartTime == '00:00') {
  5686. fillStartTime = '09:00';
  5687. }
  5688. var fillEndMax = '18:00';
  5689. if (fillStartTime >= '18:00') {
  5690. fillEndMax = '23:59';
  5691. }
  5692. sss.time = [fillStartTime, fillEndMax];
  5693. }
  5694. sss.groupId = item.groupId
  5695. sss.stage = item.stage;
  5696. sss.workingTime = item.workingTime
  5697. sss.projectAuditorId = item.projectAuditorId;
  5698. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5699. //默认选中第一个
  5700. sss.basecostId = this.timeBasecostList[0].id;
  5701. }
  5702. var hasEdited = this.zhoData[i][names].hasEdited;
  5703. if (hasEdited) {
  5704. sss = { ...item }
  5705. //编辑过了
  5706. sss.subProjectId = item.subProjectId
  5707. sss.stage = item.stage
  5708. sss.subProjectList = item.subProjectList
  5709. sss.stages = item.stages
  5710. sss.taskGroups = item.taskGroups;
  5711. console.log(sss.taskGroups, '33333');
  5712. sss.auditUserList = obj.auditUserList;
  5713. sss.degreeId = item.degreeId;
  5714. sss.customData = item.customData;
  5715. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5716. //只有一个审核人,自动设置上去
  5717. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5718. }
  5719. sss.wuduList = item.wuduList;
  5720. this.zhoBaoIdx = i
  5721. this.zhoBaoName = names
  5722. this.zhoBao = sss
  5723. this.zhis = row
  5724. if (sss.groupId) {
  5725. //最后一个参数表示是否保留stage的值,不要重置为空
  5726. this.getGroupStages(this.zhoBao, 0, true)
  5727. }
  5728. this.$forceUpdate();
  5729. this.getWeeklyTaskList(sss)
  5730. console.log('最后的周报 ===>', this.zhoBao)
  5731. } else {
  5732. //第一次打开,获取数据
  5733. if (sss.id == -1) {
  5734. //新填报的
  5735. this.selectProject(obj, 0);
  5736. var that = this
  5737. setTimeout(() =>{
  5738. sss.subProjectId = that.workForm.domains[0].subProjectId
  5739. sss.subProjectList = item.subProjectList;
  5740. sss.stage = that.workForm.domains[0].stage
  5741. sss.subProjectList = that.workForm.domains[0].subProjectList
  5742. sss.stages = that.workForm.domains[0].stages
  5743. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5744. sss.auditUserList = obj.auditUserList;
  5745. sss.degreeId = item.degreeId;
  5746. sss.customData = item.customData;
  5747. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5748. //只有一个审核人,自动设置上去
  5749. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5750. }
  5751. sss.wuduList = row[0].wuduList
  5752. that.zhoBaoIdx = i
  5753. that.zhoBaoName = names
  5754. that.zhoBao = sss
  5755. that.zhis = row
  5756. if (sss.groupId) {
  5757. //最后一个参数表示是否保留stage的值,不要重置为空
  5758. this.getGroupStages(that.zhoBao, 0, false)
  5759. }
  5760. that.$forceUpdate();
  5761. this.getWeeklyTaskList(sss)
  5762. },600);
  5763. } else {
  5764. //编辑填报过的;数据库已经存在的
  5765. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5766. }
  5767. }
  5768. },
  5769. // 按周填报里内容的填写点击确定
  5770. setWeekProItemData() {
  5771. //专业版模式下,任务分组和阶段必填
  5772. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5773. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5774. this.$message({
  5775. message: '任务分组和阶段必填,请检查',
  5776. type: "error"
  5777. });
  5778. return;
  5779. }
  5780. }
  5781. //检查子项目是否必填
  5782. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5783. this.$message({
  5784. message: '子项目必填,请检查',
  5785. type: "error"
  5786. });
  5787. return;
  5788. }
  5789. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5790. this.$message({
  5791. message: this.$t('message.Pleaseselectareviewer'),
  5792. type: "error"
  5793. });
  5794. return
  5795. }
  5796. if(this.user.timeType.reportAuditType == 3){
  5797. let auditTips = ''
  5798. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5799. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5800. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5801. if(auditTips){
  5802. auditTips = auditTips.substring(0,auditTips.length - 1)
  5803. this.$message({
  5804. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5805. type: 'error'
  5806. })
  5807. return
  5808. }
  5809. }
  5810. let errtips = ''
  5811. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5812. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5813. errtips += this.user.timeType.customDegreeName + '、'
  5814. }
  5815. }
  5816. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5817. errtips += this.user.timeType.customDataName + '、'
  5818. }
  5819. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5820. errtips += this.user.timeType.customTextName + '、'
  5821. }
  5822. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5823. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5824. }
  5825. if(errtips){
  5826. errtips = errtips.substring(0,errtips.length - 1)
  5827. this.$message({
  5828. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5829. type: 'error'
  5830. })
  5831. return
  5832. }
  5833. this.tianxieDialogVisible = false
  5834. var zhong = this.zhoData
  5835. this.zhoBao.hasEdited = true;
  5836. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5837. this.zhoData = zhong
  5838. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5839. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5840. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5841. },
  5842. // 获取本周
  5843. getCurrentWeek() {
  5844. //今天
  5845. this.targetWeekDate = new Date();
  5846. this.initWeekFormData();
  5847. // this.jiazai()
  5848. },
  5849. // 获取上周
  5850. handleGetPrevWeek() {
  5851. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5852. this.initWeekFormData();
  5853. // this.jiazai()
  5854. },
  5855. // 获取下周
  5856. handleGetNextvWeek() {
  5857. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5858. this.initWeekFormData()
  5859. },
  5860. // 加载动画
  5861. jiazai() {
  5862. this.weekDataLoading = true
  5863. var that = this
  5864. setTimeout(() =>{
  5865. that.weekDataLoading = false
  5866. },1000);
  5867. },
  5868. // 转时间格式
  5869. dealdate(date) {
  5870. const dt = new Date(date)
  5871. const y = dt.getFullYear()
  5872. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5873. const d = (dt.getDate() + '').padStart(2, '0')
  5874. return `${y}-${m}-${d}`
  5875. },
  5876. // 按周填报
  5877. fillInReportss() {
  5878. window.addEventListener('scroll', this.handleScroll, true)
  5879. // this.jiazai()
  5880. this.fillWeekDialogVisi = true
  5881. this.getCurrentWeek();
  5882. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5883. //重新获取工时预警类型的预算项
  5884. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5885. companyId: this.user.companyId
  5886. },
  5887. res => {
  5888. if (res.code == "ok") {
  5889. this.timeBasecostList = res.data;
  5890. }
  5891. });
  5892. }
  5893. },
  5894. fillInReportCustom() {
  5895. this.weekIndex++
  5896. this.weekParentData = {
  5897. isSubstitude: this.isSubstitude
  5898. }
  5899. this.fillWeekDialogVisiCustom = true
  5900. },
  5901. // 按周填报的项目筛选
  5902. selListFun(){
  5903. this.selProjectList = []
  5904. if(this.selCon.length){
  5905. for (let i = 0; i < this.selCon.length; i++) {
  5906. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5907. }
  5908. this.selConShow = false ;
  5909. for (let i in this.zhoData) {
  5910. var obj = this.zhoData[i];
  5911. for(var j in this.selProjectList) {
  5912. var xinzhi = this.selProjectList[j].projectName
  5913. obj[xinzhi] = {}
  5914. obj[xinzhi].time = ''
  5915. obj[xinzhi].content = ''
  5916. obj[xinzhi].progress = 0
  5917. obj[xinzhi].workingTime = 0
  5918. }
  5919. }
  5920. this.initWeekFormData();
  5921. }else{
  5922. this.$message({
  5923. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5924. type:'error'
  5925. })
  5926. }
  5927. },
  5928. setWeekCardTimeData(list) {
  5929. for(let i in list){
  5930. let datei = '';
  5931. if (this.user.timeType.showDdCardtime == 1) {
  5932. datei = list[i].workDate;
  5933. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5934. datei = list[i].createDate;
  5935. } else if (this.user.timeType.syncFanwei == 1) {
  5936. datei = list[i].workDate;
  5937. }
  5938. for(let m in this.zhoData) {
  5939. if(datei == this.zhoData[m].zhoDataTime){
  5940. let item = {
  5941. startTime: list[i].startTime,
  5942. endTime: list[i].endTime,
  5943. workHours: list[i].workHours
  5944. }
  5945. this.$set(this.zhoData[m],'corpTime',item)
  5946. }
  5947. }
  5948. }
  5949. },
  5950. getWeeklyCardTime(){ //按周填报获取考勤信息
  5951. let dateStr = []
  5952. for(let i in this.zhoData){
  5953. dateStr.push(this.zhoData[i].zhoDataTime)
  5954. }
  5955. this.http.post('/report/getWeeklyCardTime',{
  5956. dateStr: JSON.stringify(dateStr)
  5957. },res => {
  5958. if(res.code == 'ok'){
  5959. for(let i in res.data){
  5960. let datei = '';
  5961. if (this.user.timeType.showDdCardtime == 1) {
  5962. datei = res.data[i].workDate.split('-');
  5963. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5964. datei = res.data[i].createDate.split('-');
  5965. }
  5966. for(let m in this.zhoData){
  5967. let datem = new Date(this.zhoData[m].zhoDataTime)
  5968. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5969. let item = {
  5970. startTime: res.data[i].startTime,
  5971. endTime: res.data[i].endTime,
  5972. workHours: res.data[i].workHours
  5973. }
  5974. this.$set(this.zhoData[m],'corpTime',item)
  5975. }
  5976. }
  5977. }
  5978. }else{
  5979. this.$message({
  5980. message: res.msg,
  5981. type: 'error'
  5982. })
  5983. }
  5984. },err => {
  5985. this.$message({
  5986. message: err,
  5987. type: 'error'
  5988. })
  5989. })
  5990. },
  5991. selListqx(){
  5992. this.fillWeekDialogVisi = false
  5993. this.selProjectList = []
  5994. this.selCon = []
  5995. },
  5996. handleScroll() {
  5997. this.changdu = this.projectList.length + 1
  5998. },
  5999. // 自动选择时间点的事件
  6000. // async zhoTimes(item, i) {
  6001. // var iss = i
  6002. // if(item.time == null) {
  6003. // return
  6004. // } else {
  6005. // const zhi = this.zhoData[iss];
  6006. // let he = 0;
  6007. // const timeArr = Object.values(zhi)
  6008. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6009. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6010. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6011. // console.log(data, 'data');
  6012. // zhi.he = `${he}h`;
  6013. // }
  6014. // },
  6015. async zhoTimes(item, index) {
  6016. const zho = this.zhoData[index];
  6017. if (!item.time) {
  6018. return;
  6019. }
  6020. const timeArr = Object.values(zho)
  6021. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6022. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6023. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6024. zho.he = `${totalHours[0]}h`;
  6025. },
  6026. // 判断两个时间段是否重叠
  6027. timeOverlap(idx, dateAr) {
  6028. let zhi = 0
  6029. for (let k in dateAr) {
  6030. if (idx !== k) {
  6031. 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))) {
  6032. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6033. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6034. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6035. }
  6036. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6037. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6038. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6039. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6040. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6041. } else {
  6042. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6043. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6044. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6045. }
  6046. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6047. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6048. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6049. }
  6050. }
  6051. }
  6052. }
  6053. }
  6054. return zhi
  6055. },
  6056. // 计算时间
  6057. getHourMinutes(str, end) {
  6058. var he = 0
  6059. var date2 = '2021/12/12 ' + end +':00'
  6060. var date1 = '2021/12/12 ' + str +':00'
  6061. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6062. var leave1=date3%(24*3600*1000)
  6063. var hours=Math.floor(leave1/(3600*1000))
  6064. var leave2=leave1%(3600*1000)
  6065. var minutes=Math.floor(leave2/(60*1000))
  6066. var shi = hours+'.'+ minutes
  6067. return he += +shi
  6068. },
  6069. // 自动选择事件长度的事件
  6070. zhoXuan(item, i) {
  6071. var iss = i
  6072. if(item.time == null) {
  6073. return
  6074. } else {
  6075. var zhi = this.zhoData[iss]
  6076. var he = 0
  6077. for(var i in zhi) {
  6078. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6079. he += +zhi[i].workingTime
  6080. }
  6081. }
  6082. zhi.he = he + 'h'
  6083. }
  6084. },
  6085. getPushWorkLogData(){
  6086. this.http.post('/sap-sync-log/list', {},
  6087. res => {
  6088. if (res.code == "ok") {
  6089. this.pushWorkTimeLogData = res.data;
  6090. } else {
  6091. this.$message({
  6092. message: res.msg,
  6093. type: "error"
  6094. });
  6095. }
  6096. },
  6097. error => {
  6098. this.$message({
  6099. message: error,
  6100. type: "error"
  6101. });
  6102. });
  6103. },
  6104. // 获取全部人员
  6105. getUsers() {
  6106. this.http.post('/user/getSimpleActiveUserList', {},
  6107. res => {
  6108. if (res.code == "ok") {
  6109. this.usersList = res.data;
  6110. } else {
  6111. this.$message({
  6112. message: res.msg,
  6113. type: "error"
  6114. });
  6115. }
  6116. },
  6117. error => {
  6118. this.$message({
  6119. message: error,
  6120. type: "error"
  6121. });
  6122. });
  6123. },
  6124. // 按时间比例
  6125. addBli(item, i) {
  6126. var iss = i
  6127. if(item.time == null) {
  6128. return
  6129. } else {
  6130. var zhi = this.zhoData[iss]
  6131. var he = 0
  6132. for(var i in zhi) {
  6133. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6134. he += +zhi[i].workingTime
  6135. }
  6136. }
  6137. zhi.he = he.toFixed(1) + 'h'
  6138. }
  6139. },
  6140. //按周填报选择的项目发生变化,需要设置列
  6141. onSelProjectChange() {
  6142. for (let i = 0; i < this.selCon.length; i++) {
  6143. var exists = false;
  6144. for (let j = 0; j < this.selProjectList.length; j++) {
  6145. if (this.selProjectList[j].id == this.selCon[i]) {
  6146. exists = true;
  6147. break;
  6148. }
  6149. }
  6150. if (!exists) {
  6151. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6152. this.selProjectList.push(newProject);
  6153. //添加新项目
  6154. for (var w in this.zhoData) {
  6155. var dayItem = this.zhoData[w];
  6156. var pName = newProject.projectName;
  6157. dayItem[pName] = {};
  6158. dayItem[pName].time = ''
  6159. dayItem[pName].content = ''
  6160. dayItem[pName].progress = 0
  6161. dayItem[pName].workingTime = 0
  6162. }
  6163. }
  6164. }
  6165. //去掉
  6166. for (let j = 0; j < this.selProjectList.length; j++) {
  6167. var exists = false;
  6168. for (let i = 0; i < this.selCon.length; i++) {
  6169. if (this.selProjectList[j].id == this.selCon[i]) {
  6170. exists = true;
  6171. break;
  6172. }
  6173. }
  6174. if (!exists) {
  6175. this.selProjectList.splice(j, 1);
  6176. j--;
  6177. }
  6178. }
  6179. this.loadFilledWeekReportItem();
  6180. //刷新表格
  6181. // this.$refs.weekTable.doLayout();
  6182. },
  6183. //根据选中的项目来刷新填写表格
  6184. loadFilledWeekReportItem() {
  6185. for (var w in this.zhoData) {
  6186. var dayItem = this.zhoData[w];
  6187. for (var i = 0; i < this.selProjectList.length; i++) {
  6188. var curColumnProject = this.selProjectList[i];
  6189. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6190. for (var t in dayItem.reportList) {
  6191. //有日报的项目,不能取消选择
  6192. for (var p in this.fillProjectList) {
  6193. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6194. }
  6195. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6196. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6197. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6198. if (this.reportTimeType.type == 2) {
  6199. //时间段模式
  6200. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6201. }
  6202. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6203. break;
  6204. }
  6205. }
  6206. // dayItem[curColumnProject.projectName] = matchReportItem;
  6207. }
  6208. }
  6209. this.$nextTick(()=>{
  6210. this.$refs.weekTable.doLayout();
  6211. });
  6212. },
  6213. initWeekFormData() {
  6214. this.weekDataLoading = true;
  6215. for (var p in this.fillProjectList) {
  6216. this.fillProjectList[p].canCancel = 1;
  6217. }
  6218. this.http.post('/report/getWeeklyReportData',{
  6219. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6220. },res => {
  6221. this.weekDataLoading = false;
  6222. if(res.code == 'ok'){
  6223. let projectList = res.data.projectList;
  6224. if (projectList.length > 0) {
  6225. //有选择过项目进行填报,直接选中
  6226. this.selProjectList = projectList;
  6227. this.selCon = [];
  6228. for (let i = 0; i < projectList.length; i++) {
  6229. this.selCon.push(projectList[i].id);
  6230. }
  6231. }
  6232. //设置日期
  6233. this.weekDateRange = res.data.dateList;
  6234. this.zhoData = [];
  6235. var arrst = []
  6236. for(var i in this.weekDateRange) {
  6237. var obj = {}
  6238. obj.zhoDataTime = this.weekDateRange[i].date
  6239. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6240. obj.he = this.weekDateRange[i].filledTime;
  6241. obj.canFill = this.weekDateRange[i].canFill;
  6242. // obj.filledTime = this.weekDateRange[i].filledTime;
  6243. obj.reportList = this.weekDateRange[i].reportList;
  6244. //初始化,防止渲染报错
  6245. for (var j = 0; j < this.selProjectList.length; j++) {
  6246. var pName = this.selProjectList[j].projectName
  6247. obj[pName] = {}
  6248. obj[pName].time = ''
  6249. obj[pName].content = ''
  6250. obj[pName].progress = 0
  6251. obj[pName].workingTime = 0
  6252. }
  6253. arrst.push(obj)
  6254. }
  6255. this.zhoData = arrst
  6256. this.setWeekCardTimeData(res.data.cardTimeList);
  6257. this.loadFilledWeekReportItem();
  6258. }else{
  6259. this.$message({
  6260. message: res.msg,
  6261. type: 'error'
  6262. })
  6263. }
  6264. },err => {
  6265. this.$message({
  6266. message: err,
  6267. type: 'error'
  6268. })
  6269. })
  6270. },
  6271. zhoZhi(res, i) {
  6272. var zhi = 0
  6273. for(var i in res) {
  6274. if(i != 'zhoDataTime' && i != 'he') {
  6275. zhi += +res[i]
  6276. }
  6277. }
  6278. res.he = zhi
  6279. },
  6280. zhoBtn(i) {
  6281. // this.zhoData.split(i, 1)
  6282. var arr = this.zhoData
  6283. arr.splice(i, 1)
  6284. },
  6285. zhoAddlast(){
  6286. this.selConShow = true
  6287. },
  6288. closeAddWeeklyReport(){
  6289. this.fillWeekDialogVisi = false
  6290. this.selConShow = true
  6291. this.selProjectList = []
  6292. this.selCon = []
  6293. },
  6294. // 提交按周填报
  6295. submitWeekReport(isDraft) {
  6296. var zhi = this.zhoData
  6297. var ll = 0
  6298. if(this.reportTimeType.type == 2) {
  6299. for(var i in zhi) {
  6300. this.dateAr = []
  6301. var alp = []
  6302. var zhis = zhi[i]
  6303. console.log(zhis)
  6304. for(var j in zhis) {
  6305. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6306. let objs = {}
  6307. objs.s = zhis[j].time[0]
  6308. objs.e = zhis[j].time[1]
  6309. objs.p = j
  6310. alp.push(objs)
  6311. }
  6312. }
  6313. console.log(alp)
  6314. this.dateAr = alp
  6315. if (this.reportTimeType.timeCanOverlap == 0) {
  6316. let str = this.$t('message.Filledtimeperiodsoverlap')
  6317. if(this.dateAr.length > 0) {
  6318. const trus = this.fns();
  6319. const overlapDataTime = this.getOverlapData(alp);
  6320. if (overlapDataTime.length > 0) {
  6321. const arrList = overlapDataTime.map((item) => item.p);
  6322. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6323. }
  6324. ll += 1
  6325. if(!trus) {
  6326. this.$message({
  6327. message: str,
  6328. type: 'error'
  6329. })
  6330. return false
  6331. }
  6332. }
  6333. } else {
  6334. if(this.dateAr.length > 0) {
  6335. ll +=1 ;
  6336. }
  6337. }
  6338. }
  6339. if(ll == 0) {
  6340. this.$message({
  6341. message: this.$t('message.Pleasefillinthetime'),
  6342. type: 'error'
  6343. })
  6344. return false
  6345. }
  6346. } else if(this.reportTimeType.type == 1){
  6347. for(var i in zhi) {
  6348. var zhis = zhi[i]
  6349. for(var j in zhis) {
  6350. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6351. ll += 1
  6352. }
  6353. }
  6354. }
  6355. if(ll == 0) {
  6356. this.$message({
  6357. message: this.$t('message.Pleaseselectatime'),
  6358. type: 'error'
  6359. })
  6360. return false
  6361. }
  6362. let overcorp = ''
  6363. for(let n in zhi){
  6364. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6365. overcorp += zhi[n].zhoDataTime + ','
  6366. }
  6367. }
  6368. if(overcorp != ''){
  6369. overcorp = overcorp.substring(0,overcorp.length - 1)
  6370. this.$message({
  6371. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6372. type: 'error'
  6373. })
  6374. return
  6375. }
  6376. }
  6377. var submits = []
  6378. let formData = new FormData();
  6379. formData.append("draft", isDraft);
  6380. if(this.reportTimeType.multiWorktime == 1){
  6381. for (var i in this.zhoData) {
  6382. var zhoD = this.zhoData[i]
  6383. var flgs = false
  6384. for(var j in zhoD) {
  6385. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6386. flgs = true
  6387. // formData.append("degreeId", "-1");
  6388. formData.append("id", '-1');
  6389. for(var s in this.projectList) {
  6390. if(j == this.projectList[s].projectName) {
  6391. formData.append("projectId", this.projectList[s].id);
  6392. }
  6393. }
  6394. if(this.user.timeType.reportAuditType == 3){
  6395. let audItem = {}
  6396. if(this.user.timeType.auditLevel > 0){
  6397. audItem.auditorFirst = zhoD[j].auditorFirst
  6398. }
  6399. if(this.user.timeType.auditLevel > 1){
  6400. audItem.auditorSec = zhoD[j].auditorSec
  6401. }
  6402. if(this.user.timeType.auditLevel > 2){
  6403. audItem.auditorThird = zhoD[j].auditorThird
  6404. }
  6405. if(zhoD[j].ccUserid){
  6406. audItem.ccUserid = zhoD[j].ccUserid
  6407. }
  6408. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6409. }
  6410. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6411. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6412. formData.append("reportTimeType", this.reportTimeType.type);
  6413. formData.append("endTime", '');
  6414. formData.append("startTime", '');
  6415. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6416. var lix = []
  6417. var objjs = {}
  6418. objjs.startTime = zhoD[j].time[0]
  6419. objjs.endTime = zhoD[j].time[1]
  6420. if (zhoD[j].content == null || zhoD[j].content == '') {
  6421. zhoD[j].content == '-'
  6422. }
  6423. objjs.content = zhoD[j].content
  6424. lix.push(objjs)
  6425. var zhiZhi = JSON.stringify(lix)
  6426. zhiZhi = zhiZhi.replace(/,/g,"@");
  6427. formData.append("content", zhiZhi)
  6428. formData.append("isOvertime", 0)
  6429. formData.append("professionProgress", "[]")
  6430. if (zhoD[j].groupId) {
  6431. formData.append("groupId",zhoD[j].groupId)
  6432. } else {
  6433. //解决后台groupId数组越界的问题
  6434. formData.append("groupId",0)
  6435. }
  6436. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6437. formData.append("createDate",zhoD.zhoDataTime)
  6438. if (zhoD[j].projectAuditorId) {
  6439. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6440. }
  6441. if(zhoD[j].basecostId) {
  6442. formData.append("basecostId", zhoD[j].basecostId);
  6443. } else {
  6444. formData.append("basecostId", 0);
  6445. }
  6446. if(this.user.timeType.customDegreeActive){
  6447. if (this.user.timeType.customDegreeMultiple) {
  6448. if (zhoD[j].multiDegrIdArray) {
  6449. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6450. } else {
  6451. formData.append('multiDegrId','[]')
  6452. }
  6453. } else {
  6454. if (zhoD[j].degreeId) {
  6455. formData.append('degreeId',zhoD[j].degreeId)
  6456. } else {
  6457. formData.append('degreeId','-1')
  6458. }
  6459. }
  6460. }else{
  6461. formData.append("degreeId", "-1");
  6462. }
  6463. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6464. formData.append('customData',zhoD[j].customData)
  6465. }else if(this.user.timeType.customDataActive){
  6466. formData.append('customData',0)
  6467. }
  6468. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6469. formData.append('customText',zhoD[j].customText)
  6470. }else if(this.user.timeType.customTextActive){
  6471. formData.append('customText','-')
  6472. }
  6473. }
  6474. }
  6475. }
  6476. } else {
  6477. for (var i in this.zhoData) {
  6478. var zhoD = this.zhoData[i]
  6479. var flgs = false
  6480. if(this.reportTimeType.type == 2) {
  6481. for(var k in this.selProjectList) {
  6482. var pItem = this.selProjectList[k];
  6483. var pName = pItem.projectName;
  6484. var j = pName;
  6485. console.log('j==周报中的项目='+j);
  6486. if(zhoD[j].time && zhoD[j].time != 'null') {
  6487. flgs = true
  6488. // formData.append("degreeId", "-1");
  6489. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6490. for(var s in this.projectList) {
  6491. if(j == this.projectList[s].projectName) {
  6492. formData.append("projectId", this.projectList[s].id);
  6493. }
  6494. }
  6495. if(this.user.timeType.reportAuditType == 3){
  6496. let audItem = {}
  6497. if(this.user.timeType.auditLevel > 0){
  6498. audItem.auditorFirst = zhoD[j].auditorFirst
  6499. }
  6500. if(this.user.timeType.auditLevel > 1){
  6501. audItem.auditorSec = zhoD[j].auditorSec
  6502. }
  6503. if(this.user.timeType.auditLevel > 2){
  6504. audItem.auditorThird = zhoD[j].auditorThird
  6505. }
  6506. if(zhoD[j].ccUserid){
  6507. audItem.ccUserid = zhoD[j].ccUserid
  6508. }
  6509. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6510. }
  6511. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6512. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6513. formData.append("reportTimeType", this.reportTimeType.type);
  6514. formData.append("endTime", zhoD[j].time[1]);
  6515. formData.append("startTime", zhoD[j].time[0]);
  6516. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6517. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6518. formData.append("isOvertime", 0)
  6519. formData.append("professionProgress", "[]")
  6520. if (zhoD[j].groupId) {
  6521. formData.append("groupId",zhoD[j].groupId)
  6522. } else {
  6523. //解决后台groupId数组越界的问题
  6524. formData.append("groupId",0)
  6525. }
  6526. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6527. formData.append("createDate",zhoD.zhoDataTime)
  6528. if (zhoD[j].projectAuditorId) {
  6529. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6530. }
  6531. if(zhoD[j].basecostId) {
  6532. formData.append("basecostId", zhoD[j].basecostId);
  6533. } else {
  6534. formData.append("basecostId", 0);
  6535. }
  6536. if(this.user.timeType.customDegreeActive){
  6537. if (this.user.timeType.customDegreeMultiple) {
  6538. if (zhoD[j].multiDegrIdArray) {
  6539. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6540. } else {
  6541. formData.append("multiDegrId", "[]");
  6542. }
  6543. } else {
  6544. if (zhoD[j].degreeId) {
  6545. formData.append('degreeId',zhoD[j].degreeId)
  6546. } else {
  6547. formData.append("degreeId", "-1");
  6548. }
  6549. }
  6550. }else{
  6551. formData.append("degreeId", "-1");
  6552. }
  6553. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6554. formData.append('customData',zhoD[j].customData)
  6555. }else if(this.user.timeType.customDataActive){
  6556. formData.append('customData',0)
  6557. }
  6558. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6559. formData.append('customText',zhoD[j].customText)
  6560. }else if(this.user.timeType.customTextActive){
  6561. formData.append('customText','-')
  6562. }
  6563. }
  6564. }
  6565. } else {
  6566. for(var k in this.selProjectList) {
  6567. var pItem = this.selProjectList[k];
  6568. var pName = pItem.projectName;
  6569. var j = pName;
  6570. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6571. flgs = true
  6572. // formData.append("degreeId", "-1");
  6573. console.log('进入了workFpppp==='+j);
  6574. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6575. for(var s in this.projectList) {
  6576. if(j == this.projectList[s].projectName) {
  6577. formData.append("projectId", this.projectList[s].id);
  6578. }
  6579. }
  6580. if(this.user.timeType.reportAuditType == 3){
  6581. let audItem = {}
  6582. if(this.user.timeType.auditLevel > 0){
  6583. audItem.auditorFirst = zhoD[j].auditorFirst
  6584. }
  6585. if(this.user.timeType.auditLevel > 1){
  6586. audItem.auditorSec = zhoD[j].auditorSec
  6587. }
  6588. if(this.user.timeType.auditLevel > 2){
  6589. audItem.auditorThird = zhoD[j].auditorThird
  6590. }
  6591. if(zhoD[j].ccUserid){
  6592. audItem.ccUserid = zhoD[j].ccUserid
  6593. }
  6594. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6595. }
  6596. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6597. // formData.append("subProjectId", zhoD[j].subProjectId);
  6598. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6599. formData.append("reportTimeType", this.reportTimeType.type);
  6600. if(this.reportTimeType.type == 1) {
  6601. formData.append("workingTime", zhoD[j].workingTime);
  6602. } else if(this.reportTimeType.type == 2) {
  6603. formData.append("endTime", zhoD[j].time[1]);
  6604. formData.append("startTime", zhoD[j].time[0]);
  6605. } else if(this.reportTimeType.type == 3) {
  6606. formData.append("progress", zhoD[j].progress);
  6607. formData.append("workingTime", zhoD[j].workingTime);
  6608. }
  6609. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6610. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6611. formData.append("isOvertime", 0)
  6612. formData.append("professionProgress", "[]")
  6613. if (zhoD[j].groupId) {
  6614. formData.append("groupId",zhoD[j].groupId)
  6615. } else {
  6616. //解决后台groupId数组越界的问题
  6617. formData.append("groupId",0)
  6618. }
  6619. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6620. formData.append("createDate",zhoD.zhoDataTime)
  6621. if (zhoD[j].projectAuditorId) {
  6622. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6623. }
  6624. if(zhoD[j].basecostId) {
  6625. formData.append("basecostId", zhoD[j].basecostId);
  6626. } else {
  6627. formData.append("basecostId", 0);
  6628. }
  6629. if(this.user.timeType.customDegreeActive){
  6630. if (this.user.timeType.customDegreeMultiple) {
  6631. if (zhoD[j].multiDegrIdArray) {
  6632. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6633. } else {
  6634. formData.append("multiDegrId", "[]");
  6635. }
  6636. } else {
  6637. if (zhoD[j].degreeId) {
  6638. formData.append('degreeId',zhoD[j].degreeId)
  6639. } else {
  6640. formData.append("degreeId", "-1");
  6641. }
  6642. }
  6643. }else{
  6644. formData.append("degreeId", "-1");
  6645. }
  6646. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6647. formData.append('customData',zhoD[j].customData)
  6648. }else if(this.user.timeType.customDataActive){
  6649. formData.append('customData',0)
  6650. }
  6651. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6652. formData.append('customText',zhoD[j].customText)
  6653. }else if(this.user.timeType.customTextActive){
  6654. formData.append('customText','-')
  6655. }
  6656. }
  6657. }
  6658. }
  6659. }
  6660. }
  6661. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6662. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6663. if(!next) {
  6664. this.$message({
  6665. message: `【${error.join('、')}】请填写任务分组`,
  6666. type: 'error'
  6667. })
  6668. return
  6669. }
  6670. // 自定义维度
  6671. this.submitingReport = true;
  6672. this.http.uploadFile( this.port.report.editPort, formData,
  6673. res => {
  6674. // this.listLoading = false;
  6675. this.submitingReport = false;
  6676. if (res.code == "ok") {
  6677. this.$message({
  6678. message: this.$t('message.fillinsuccessfully'),
  6679. type: "success"
  6680. });
  6681. this.fillWeekDialogVisi = false
  6682. this.selConShow = true
  6683. this.zhoData = []
  6684. this.weekDateRange = ''
  6685. this.getReportList();
  6686. this.getDepartment();
  6687. // 关闭弹窗 并 清空
  6688. this.selProjectList = []
  6689. this.selCon = []
  6690. this.getRecentlyProject()
  6691. } else {
  6692. this.$message({
  6693. message: res.msg,
  6694. type: "error"
  6695. });
  6696. }
  6697. },
  6698. error => {
  6699. this.submitingReport = false;
  6700. this.$message({
  6701. message: error,
  6702. type: "error"
  6703. });
  6704. });
  6705. },
  6706. handleGroupAuditorData(data) {
  6707. const { reportAuditType } = this.user.timeType
  6708. if(reportAuditType != 1 && reportAuditType != 2) {
  6709. return {next: true}
  6710. }
  6711. let arrList = [];
  6712. Object.entries(data).forEach(([key, obj]) => {
  6713. Object.entries(obj).forEach(([projectName, projectData]) => {
  6714. if (projectData.workingTime && !projectData.groupId) {
  6715. arrList.push({
  6716. projectName,
  6717. date: obj.zhoDataTime,
  6718. dateText: obj.zhoDataTimeTxt
  6719. });
  6720. }
  6721. });
  6722. });
  6723. if(arrList.length > 0) {
  6724. return {
  6725. next: false,
  6726. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6727. }
  6728. } else {
  6729. return {
  6730. next: true,
  6731. error: [],
  6732. }
  6733. }
  6734. },
  6735. ChangeHourMinutestr (str) {
  6736. if (str !== "0" && str !== "" && str !== null) {
  6737. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6738. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6739. } else {
  6740. return "";
  6741. }
  6742. },
  6743. // 得到两个日期中间的日期
  6744. getdiffdate(stime,etime){
  6745. //初始化日期列表,数组
  6746. var diffdate = new Array();
  6747. var i=0;
  6748. //开始日期小于等于结束日期,并循环
  6749. while(stime<=etime){
  6750. diffdate[i] = stime;
  6751. //获取开始日期时间戳
  6752. var stime_ts = new Date(stime).getTime();
  6753. //增加一天时间戳后的日期
  6754. var next_date = stime_ts + (24*60*60*1000);
  6755. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6756. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6757. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6758. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6759. stime = next_dates_y+next_dates_m+next_dates_d;
  6760. //增加数组key
  6761. i++;
  6762. }
  6763. return diffdate;
  6764. },
  6765. // 添加模块
  6766. addDomain(i) {
  6767. var leftProgress = 10;
  6768. if (this.reportTimeType.type == 3) {
  6769. //计算已经待分配工时比例
  6770. let array = this.workForm.domains;
  6771. let totalProgress = 0;
  6772. for (var i=0;i<array.length; i++) {
  6773. totalProgress += array[i].progress;
  6774. }
  6775. if (totalProgress < 100) {
  6776. leftProgress = 100 - totalProgress;
  6777. }
  6778. }
  6779. var addItem = {
  6780. projectId: "",
  6781. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6782. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6783. ),
  6784. content: "",
  6785. progress:leftProgress,
  6786. state:2,//2-表示待提交
  6787. multiWorktime: this.reportTimeType.multiWorktime,
  6788. worktimeList:[{}],
  6789. canEdit: true,
  6790. auditorFirst: '',
  6791. auditorSec: '',
  6792. auditorThird: '',
  6793. ccUserid: ''
  6794. // degreeId: '',
  6795. };
  6796. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6797. this.$set(addItem,'isOvertime',true)
  6798. if(this.reportTimeType.type == 3){
  6799. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6800. }
  6801. }
  6802. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6803. //默认给第一个,必填字段
  6804. addItem.basecostId = this.timeBasecostList[0].id;
  6805. }
  6806. this.workForm.domains.push(addItem);
  6807. document.getElementById('workFormsItemBottom').scrollIntoView()
  6808. this.canEdit = true
  6809. if (this.reportTimeType.type == 0) {
  6810. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6811. var length = this.workForm.domains.length;
  6812. if (length == 2) {
  6813. this.showAddMore = false;
  6814. }
  6815. }
  6816. this.chuji()
  6817. this.seleChn()
  6818. },
  6819. // 移除模块
  6820. delDomain(i) {
  6821. this.workForm.domains.splice(i,1)
  6822. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6823. if (!this.originCanEdit) {
  6824. let iscan = false
  6825. for(let i in this.workForm.domains){
  6826. if(this.workForm.domains[i].canEdit){
  6827. iscan = true
  6828. }
  6829. }
  6830. this.canEdit = iscan
  6831. }
  6832. //检测当前剩下的一个,时间类型是否是全天
  6833. if (this.reportTimeType.type == 0) {
  6834. if (this.workForm.domains[0].timeType == 0) {
  6835. this.showAddMore = false;
  6836. } else {
  6837. this.showAddMore = true;
  6838. }
  6839. }
  6840. if(this.user.timeType.multiWorktime == 1) {
  6841. this.iptChangs()
  6842. } else {
  6843. this.seleChn(0)
  6844. }
  6845. },
  6846. // 改变月份
  6847. changeMonth() {
  6848. this.isWeekend = false
  6849. let date = new Date()
  6850. let nowmon = date.getMonth() + 1
  6851. let nowday = date.getDate()
  6852. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6853. if (this.isBatch == 0) {
  6854. if(this.user.timeType.fillAhead == 0){
  6855. let date_a = new Date(this.workForm.createDate)
  6856. if(date_a.getTime() > date.getTime()){
  6857. this.workForm.createDate = nowdate
  6858. }
  6859. }
  6860. //只有按天填报才能获取当天的日报
  6861. if(!this.isSubstitude){
  6862. let weekday = new Date(this.workForm.createDate).getDay()
  6863. if(this.user.companyId == 817){
  6864. if(weekday == 0){
  6865. this.isWeekend = true
  6866. }
  6867. }else{
  6868. if(weekday == 0 || weekday == 6){
  6869. this.isWeekend = true
  6870. }
  6871. }
  6872. this.getReport()
  6873. }
  6874. }else {
  6875. if(this.user.timeType.fillAhead == 0){
  6876. let date_a = new Date(this.workForm.createDate[1])
  6877. if(date_a.getTime() > date.getTime()){
  6878. this.workForm.createDate[1] = nowdate
  6879. let sdate = new Date(this.workForm.createDate[0])
  6880. let edate = new Date(this.workForm.createDate[1])
  6881. if(sdate > edate){
  6882. this.workForm.createDate[0] = this.workForm.createDate[1]
  6883. }
  6884. }
  6885. }
  6886. }
  6887. },
  6888. // 判断时间段
  6889. fns() {
  6890. for (let k in this.dateAr) {
  6891. if (!this.judege(k)) {
  6892. return false
  6893. }
  6894. }
  6895. return true
  6896. },
  6897. judege(idx){
  6898. for (let k in this.dateAr) {
  6899. if (idx !== k) {
  6900. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6901. return false
  6902. }
  6903. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6904. return false
  6905. }
  6906. }
  6907. }
  6908. return true
  6909. },
  6910. getOverlapData(data) {
  6911. let overlapData = [];
  6912. for (let i = 0; i < data.length; i++) {
  6913. for (let j = i + 1; j < data.length; j++) {
  6914. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6915. overlapData.push(data[i], data[j]);
  6916. }
  6917. }
  6918. }
  6919. return overlapData;
  6920. },
  6921. // 保存日报111111
  6922. submitReport(isDraft) {
  6923. this.isDraft = isDraft;
  6924. this.$refs.workForm.validate(valid => {
  6925. if (valid) {
  6926. if(this.totalReportHours < this.user.timeType.allday){
  6927. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6928. confirmButtonText: '确定',
  6929. cancelButtonText: '取消',
  6930. type: 'warning'
  6931. }).then(() => {
  6932. this.submitReportSon()
  6933. }).catch(() => {
  6934. });
  6935. }else{
  6936. this.submitReportSon()
  6937. }
  6938. }
  6939. });
  6940. },
  6941. submitReportSon() {
  6942. this.dateAr = []
  6943. //检查重叠
  6944. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6945. let alp = []
  6946. if(this.user.timeType.multiWorktime != 1) {
  6947. for(var p in this.workForm.domains) {
  6948. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6949. let objs = {}
  6950. objs.s = this.workForm.domains[p].startTime
  6951. objs.e = this.workForm.domains[p].endTime
  6952. alp.push(objs)
  6953. }
  6954. }
  6955. this.dateAr = alp
  6956. if(this.dateAr.length > 0) {
  6957. let trus = this.fns()
  6958. if(!trus) {
  6959. this.$message({
  6960. message: this.$t('message.Filledtimeperiodsoverlap'),
  6961. type: "error"
  6962. });
  6963. return
  6964. }
  6965. }
  6966. } else {
  6967. for(var p in this.workForm.domains) {
  6968. var slll = this.workForm.domains[p]
  6969. for(var o in slll.worktimeList) {
  6970. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6971. let objs = {}
  6972. objs.s = slll.worktimeList[o].startTime
  6973. objs.e = slll.worktimeList[o].endTime
  6974. alp.push(objs)
  6975. }
  6976. }
  6977. }
  6978. this.dateAr = alp
  6979. if(this.dateAr.length > 0) {
  6980. let trus = this.fns()
  6981. if(!trus) {
  6982. this.$message({
  6983. message: this.$t('message.Filledtimeperiodsoverlap'),
  6984. type: "error"
  6985. });
  6986. return
  6987. }
  6988. }
  6989. }
  6990. }
  6991. //检查子项目
  6992. if (this.user.timeType.subProMustFill == 1) {
  6993. for(var p in this.workForm.domains) {
  6994. var oneProItem = this.workForm.domains[p]
  6995. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6996. //没有选择子项目
  6997. this.$message({
  6998. message: '子项目必填,请检查',
  6999. type: "error"
  7000. });
  7001. return
  7002. }
  7003. }
  7004. }
  7005. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7006. if (this.user.companyId == this.yuzhongCompId) {
  7007. for(var p in this.workForm.domains) {
  7008. var oneProItem = this.workForm.domains[p]
  7009. if (!oneProItem.extraField1) {
  7010. this.$message({
  7011. message: '角色必填,请检查',
  7012. type: "error"
  7013. });
  7014. return
  7015. }
  7016. if (!oneProItem.extraField2) {
  7017. this.$message({
  7018. message: '工作职责必填,请检查',
  7019. type: "error"
  7020. });
  7021. return
  7022. }
  7023. if (!oneProItem.extraField3) {
  7024. this.$message({
  7025. message: '工作内容必填,请检查',
  7026. type: "error"
  7027. });
  7028. return
  7029. }
  7030. }
  7031. }
  7032. // return
  7033. //代填的情况,检查人员是否已经选择
  7034. if (this.isSubstitude) {
  7035. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7036. this.$message({
  7037. message: this.$t('message.pleaseselectthepersontofillin'),
  7038. type: "error"
  7039. });
  7040. return;
  7041. }
  7042. }
  7043. //检查时间,全天和上下午不能同时存在
  7044. if (this.reportTimeType.type == 0) {
  7045. var alldayNum = 0;
  7046. var amNum = 0;
  7047. var pmNum = 0;
  7048. for(var i in this.workForm.domains) {
  7049. if (this.workForm.domains[i].timeType == 0) {
  7050. alldayNum ++;
  7051. } else if (this.workForm.domains[i].timeType == 1) {
  7052. amNum++;
  7053. } else if (this.workForm.domains[i].timeType == 2) {
  7054. pmNum++;
  7055. }
  7056. }
  7057. if (alldayNum > 1) {
  7058. this.$message({
  7059. // message: "工作时间-全天,只能选择一次",
  7060. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7061. type: "error"
  7062. });
  7063. return;
  7064. }
  7065. if (amNum > 1) {
  7066. this.$message({
  7067. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7068. type: "error"
  7069. });
  7070. return;
  7071. }
  7072. if (pmNum > 1) {
  7073. this.$message({
  7074. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7075. type: "error"
  7076. });
  7077. return;
  7078. }
  7079. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7080. this.$message({
  7081. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7082. type: "error"
  7083. });
  7084. return;
  7085. }
  7086. } else if (this.reportTimeType.type == 3) {
  7087. //总百分比不能超过100%
  7088. let total = 0;
  7089. this.workForm.domains.forEach(w=>{total += w.progress});
  7090. if (total > 100) {
  7091. this.$message({
  7092. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7093. type: "error"
  7094. });
  7095. return;
  7096. } else if (total < 100) {
  7097. this.$message({
  7098. message: this.$t('message.cannotbesubmitted'),
  7099. type: "error"
  7100. });
  7101. return;
  7102. }
  7103. }
  7104. this.listLoading = true;
  7105. let formData = new FormData();
  7106. formData.append("draft", this.isDraft);
  7107. var totalTime = 0;
  7108. for (var t=0;t<this.workForm.domains.length; t++) {
  7109. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7110. }
  7111. //批量填报不校验考勤时长,交给后台校验
  7112. if (!this.isBatch) {
  7113. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7114. if (this.workForm.time){
  7115. if (this.workForm.time.workHours == 0){
  7116. this.$message({
  7117. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7118. type: 'error'
  7119. })
  7120. return
  7121. }
  7122. }else{
  7123. this.$message({
  7124. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7125. type: 'error'
  7126. })
  7127. return
  7128. }
  7129. }
  7130. }
  7131. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7132. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7133. this.$message({
  7134. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7135. type: "error"
  7136. });
  7137. return;
  7138. }
  7139. }
  7140. for(var i in this.workForm.domains) {
  7141. // 检查任务/里程碑是否为必填
  7142. let taskRequired = this.user.timeType.taskRequired
  7143. if(taskRequired == 1) {
  7144. if(!this.workForm.domains[i].taskId) {
  7145. this.$message({
  7146. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7147. type: "error"
  7148. });
  7149. return
  7150. }
  7151. }
  7152. if(this.user.timeType.reportAuditType == 3){
  7153. let audItem = {}
  7154. let auditRule = ''
  7155. if(this.workForm.domains[i].id){
  7156. audItem.reportId = this.workForm.domains[i].id
  7157. }
  7158. if(this.user.timeType.auditLevel > 0){
  7159. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7160. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7161. }
  7162. if(this.user.timeType.auditLevel > 1){
  7163. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7164. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7165. }
  7166. if(this.user.timeType.auditLevel > 2){
  7167. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7168. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7169. }
  7170. if(this.workForm.domains[i].ccUserid){
  7171. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7172. }
  7173. if(auditRule){
  7174. auditRule = auditRule.substring(0,auditRule.length - 1)
  7175. this.$message({
  7176. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7177. type: 'error'
  7178. })
  7179. return
  7180. }
  7181. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7182. }
  7183. if (this.user.timeType.customDegreeActive) {
  7184. if (this.user.timeType.customDegreeMultiple) {
  7185. //多选
  7186. if (this.workForm.domains[i].multiDegrIdArray) {
  7187. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7188. degreeArray = degreeArray.replace(/,/g,"@");
  7189. formData.append("multiDegrId", degreeArray);
  7190. } else {
  7191. formData.append("multiDegrId", '[]');
  7192. }
  7193. } else {
  7194. //单选
  7195. if (this.workForm.domains[i].degreeId) {
  7196. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7197. } else {
  7198. formData.append("degreeId", -1);
  7199. }
  7200. }
  7201. } else {
  7202. formData.append("degreeId", -1);
  7203. }
  7204. if(this.workForm.domains[i].customData) {
  7205. // var sss = this.workForm.domains[i].degreeId.toString()
  7206. formData.append("customData", this.workForm.domains[i].customData);
  7207. } else {
  7208. formData.append("customData", 0);
  7209. }
  7210. if(this.workForm.domains[i].customText) {
  7211. formData.append("customText", this.workForm.domains[i].customText);
  7212. } else {
  7213. formData.append("customText", '-');
  7214. }
  7215. if (this.workForm.domains[i].id) {
  7216. formData.append("id", this.workForm.domains[i].id);
  7217. } else {
  7218. formData.append("id", -1);
  7219. }
  7220. formData.append("projectId", this.workForm.domains[i].projectId);
  7221. if (this.workForm.domains[i].subProjectId) {
  7222. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7223. } else {
  7224. formData.append("subProjectId", 0);
  7225. }
  7226. if (this.workForm.domains[i].groupId) {
  7227. formData.append("groupId", this.workForm.domains[i].groupId);
  7228. } else {
  7229. formData.append("groupId", 0);
  7230. }
  7231. if (this.workForm.domains[i].taskId) {
  7232. formData.append("taskId", this.workForm.domains[i].taskId);
  7233. } else {
  7234. formData.append("taskId", 0);
  7235. }
  7236. if (this.workForm.domains[i].taskFinish == true) {
  7237. formData.append("taskFinish", 1);
  7238. } else {
  7239. formData.append("taskFinish", 0);
  7240. }
  7241. formData.append("reportTimeType", this.reportTimeType.type);
  7242. if (this.reportTimeType.type == 0) {
  7243. formData.append("timeType", this.workForm.domains[i].timeType);
  7244. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7245. formData.append("workingTime", workingTime);
  7246. } else if (this.reportTimeType.type == 1){
  7247. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7248. } else if (this.reportTimeType.type == 2) {
  7249. formData.append("endTime", this.workForm.domains[i].endTime);
  7250. formData.append("startTime", this.workForm.domains[i].startTime);
  7251. } else if (this.reportTimeType.type == 3) {
  7252. //按比例分配
  7253. formData.append("progress", this.workForm.domains[i].progress);
  7254. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7255. }
  7256. if(this.user.timeType.choseFromAlbum == 1 ) {
  7257. console.log(this.workForm.domains[i].imgList)
  7258. if(this.workForm.domains[i].imgList) {
  7259. let imgListFor = this.workForm.domains[i].imgList
  7260. for(var b in imgListFor) {
  7261. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7262. }
  7263. console.log(imgListFor)
  7264. let m = JSON.stringify(imgListFor);
  7265. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7266. formData.append("picStr", m);
  7267. } else {
  7268. formData.append("picStr", '[]');
  7269. }
  7270. }
  7271. //处理多个时间事项
  7272. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7273. if (this.reportTimeType.multiWorktime == 1) {
  7274. //检查时间是否有重叠
  7275. var workList = this.workForm.domains[i].worktimeList;
  7276. for (var j=0;j<workList.length; j++) {
  7277. var curItem = workList[j];
  7278. //检查开始时间是否大于结束时间
  7279. if (curItem.startTime >= curItem.endTime) {
  7280. this.$message({
  7281. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7282. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7283. type: "error"
  7284. });
  7285. return;
  7286. }
  7287. //时间不可重叠
  7288. if (this.reportTimeType.timeCanOverlap == 0) {
  7289. for (var p = j+1;p<workList.length; p++) {
  7290. var jItem = workList[p];
  7291. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7292. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7293. this.$message({
  7294. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7295. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7296. type: "error"
  7297. });
  7298. return;
  7299. }
  7300. }
  7301. }
  7302. }
  7303. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7304. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7305. formData.append("content", m);
  7306. } else {
  7307. if (this.workForm.domains[i].content) {
  7308. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7309. m = m.replace(/,/g,",");
  7310. console.log(m, '需要传值的数据')
  7311. // formData.append("content", this.workForm.domains[i].content);
  7312. formData.append("content", m);
  7313. } else {
  7314. formData.append("content", '-');
  7315. }
  7316. }
  7317. if (this.isBatch == 0) {
  7318. formData.append("createDate", this.workForm.createDate);
  7319. } else {
  7320. //批量填报,时间范围
  7321. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7322. }
  7323. if(this.workForm.domains[i].isOvertime) {
  7324. formData.append("isOvertime", 1);
  7325. } else {
  7326. formData.append("isOvertime", 0);
  7327. }
  7328. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7329. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7330. } else {
  7331. formData.append("overtimeHours", 0);
  7332. }
  7333. if(this.workForm.domains[i].basecostId) {
  7334. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7335. } else {
  7336. formData.append("basecostId", 0);
  7337. }
  7338. if (this.workForm.userId != null) {
  7339. var targetUids = '';
  7340. this.workForm.userId.forEach(u=>{
  7341. targetUids += u + '@';
  7342. });
  7343. if (targetUids.length > 0) {
  7344. targetUids = targetUids.substring(0, targetUids.length -1);
  7345. formData.append("targetUids", targetUids);
  7346. }
  7347. }
  7348. //项目专业进度
  7349. if (this.workForm.domains[i].professionProgress) {
  7350. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7351. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7352. formData.append("professionProgress", m);
  7353. } else {
  7354. formData.append("professionProgress", "[]");
  7355. }
  7356. if (this.workForm.domains[i].stage) {
  7357. formData.append("stage", this.workForm.domains[i].stage);
  7358. } else {
  7359. formData.append("stage", "-");
  7360. }
  7361. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7362. if (this.workForm.domains[i].projectAuditorId) {
  7363. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7364. } else {
  7365. // console.log('执行到了这里')
  7366. // console.log(this.user.timeType.reportAuditType)
  7367. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7368. this.$message({
  7369. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7370. type: "error"
  7371. });
  7372. return;
  7373. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7374. //分组负责人先审核, 确定是选择了任务分组
  7375. if (this.workForm.domains[i].taskGroups.length == 0) {
  7376. this.$message({
  7377. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7378. type: "error"
  7379. });
  7380. } else if (!this.workForm.domains[i].groupId) {
  7381. // console.log(this.workForm.domains[i]);
  7382. this.$message({
  7383. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7384. type: "error"
  7385. });
  7386. } else {
  7387. this.$message({
  7388. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7389. type: "error"
  7390. });
  7391. }
  7392. return;
  7393. }
  7394. }
  7395. if (this.user.companyId == this.yuzhongCompId) {
  7396. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7397. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7398. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7399. }
  7400. //依斯贝的服务Id
  7401. if (this.user.companyId == this.yisibeiCompId) {
  7402. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7403. }
  7404. }
  7405. this.submitingReport = true;
  7406. this.http.uploadFile( this.port.report.editPort, formData,
  7407. res => {
  7408. this.listLoading = false;
  7409. this.submitingReport = false;
  7410. if (res.code == "ok") {
  7411. if(res.msg!=null){
  7412. this.$message({
  7413. dangerouslyUseHTMLString: true,
  7414. message: res.msg,
  7415. type: "warning",
  7416. showClose: true,
  7417. duration: 0
  7418. });
  7419. }else{
  7420. this.$message({
  7421. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7422. type: "success"
  7423. });
  7424. }
  7425. this.dialogVisible = false;
  7426. this.jsDay = 0
  7427. this.jsTime = 0
  7428. this.getReportList();
  7429. this.getDepartment();
  7430. this.getRecentlyProject()
  7431. } else {
  7432. this.$message({
  7433. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7434. type: "error"
  7435. });
  7436. }
  7437. },
  7438. error => {
  7439. this.listLoading = false;
  7440. this.submitingReport = false;
  7441. this.$message({
  7442. message: error,
  7443. type: "error"
  7444. });
  7445. });
  7446. },
  7447. // 判断是展示那个工时导入
  7448. imports() {
  7449. if(this.user.timeType.syncCorpwxTime == 0) {
  7450. this.importDialog = true
  7451. } else {
  7452. this.importWxDialog = true
  7453. }
  7454. },
  7455. // 跳转
  7456. junpToDeskTop(id) {
  7457. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7458. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7459. },
  7460. // 通过日报
  7461. approve(id, item) {
  7462. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7463. this.approveinData = {
  7464. id: id,
  7465. date: this.date +day,
  7466. reportIds: item.id
  7467. }
  7468. if(this.user.timeType.needEvaluate == 1){
  7469. this.$set(this.approveinData,'evaluate','')
  7470. this.approveinDialog = true
  7471. }else{
  7472. this.logining = true;
  7473. this.approveinfun()
  7474. }
  7475. },
  7476. approveinfun(){
  7477. this.http.post( this.port.report.approve, this.approveinData,
  7478. res => {
  7479. this.logining = false;
  7480. if (res.code == "ok") {
  7481. this.approveinDialog = false
  7482. this.$message({
  7483. message: this.$t('message.Reviewsucceeded'),
  7484. type: "success"
  7485. });
  7486. this.getReportList();
  7487. this.getDepartment();
  7488. } else {
  7489. this.$message({
  7490. message: res.msg,
  7491. type: "error"
  7492. });
  7493. }
  7494. },
  7495. error => {
  7496. this.logining = false;
  7497. this.$message({
  7498. message: error,
  7499. type: "error"
  7500. });
  7501. });
  7502. },
  7503. //撤回日报
  7504. cancel(item,e) {
  7505. // console.log('can can need',item);
  7506. this.logining = true;
  7507. var ids = '';
  7508. var data = e ? item : item.data;
  7509. data.forEach(element => {
  7510. if(element.id){
  7511. ids +=(element.id+',');
  7512. }
  7513. });
  7514. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7515. res => {
  7516. this.logining = false;
  7517. if (res.code == "ok") {
  7518. this.$message({
  7519. message:this.$t('message.Withdrawalsucceeded'),
  7520. type: "success"
  7521. });
  7522. this.getReportList();
  7523. if(e){this.getReport()}
  7524. this.getDepartment();
  7525. } else {
  7526. this.$message({
  7527. message: res.msg,
  7528. type: "error"
  7529. });
  7530. }
  7531. },
  7532. error => {
  7533. this.logining = false;
  7534. this.$message({
  7535. message: error,
  7536. type: "error"
  7537. });
  7538. });
  7539. },
  7540. showDenyDialog(id,i, item) {
  7541. this.denyReasonDialog = true;
  7542. this.isDenying = false;
  7543. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7544. var ids = item.id;
  7545. // var data = item.data;
  7546. // data.forEach(element => {
  7547. // ids +=(element.id+',');
  7548. // });
  7549. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7550. },
  7551. // 未通过日报
  7552. deny() {
  7553. this.logining = true;
  7554. this.isDenying = true;
  7555. this.http.post( this.port.report.deny, this.denyForm,
  7556. res => {
  7557. this.logining = false;
  7558. this.isDenying = false;
  7559. if (res.code == "ok") {
  7560. this.$message({
  7561. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7562. type: "success"
  7563. });
  7564. this.getReportList();
  7565. this.getDepartment();
  7566. this.denyReasonDialog = false;
  7567. } else {
  7568. this.$message({
  7569. message: res.msg,
  7570. type: "error"
  7571. });
  7572. }
  7573. },
  7574. error => {
  7575. this.logining = false;
  7576. this.$message({
  7577. message: error,
  7578. type: "error"
  7579. });
  7580. });
  7581. },
  7582. // 查看工时记录弹窗
  7583. toView() {
  7584. this.toViewDialogVisible = true
  7585. this.toViewloading = true
  7586. this.getToView()
  7587. },
  7588. getToView() {
  7589. this.http.post( '/report-import-log/getList', this.toViewForm,
  7590. res => {
  7591. this.toViewloading = false;
  7592. if (res.code == "ok") {
  7593. // console.log(res.data, '数据数据')
  7594. this.toViewList = res.data.records
  7595. this.toViewForm.total = res.data.total
  7596. } else {
  7597. this.toViewloading = false;
  7598. this.$message({
  7599. message: res.msg,
  7600. type: "error"
  7601. });
  7602. }
  7603. })
  7604. },
  7605. // 触发 selectCat 组件更改他的值
  7606. selectCatCli(obj) {
  7607. // console.log(obj, '看看')
  7608. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7609. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7610. },
  7611. vueCasader(obj) {
  7612. // console.log(obj, '看看值')
  7613. if(obj.distinction == 1 && obj.item) {
  7614. let arr = []
  7615. arr.push(obj.item.id)
  7616. this.exportParam.departmentId = arr
  7617. }
  7618. },
  7619. //分页
  7620. handleCurrentChange(val) {
  7621. this.toViewForm.pageIndex = val;
  7622. this.getToView();
  7623. },
  7624. handleSizeChange(val) {
  7625. this.toViewForm.pageSize = val;
  7626. this.getToView();
  7627. },
  7628. getAllUsersList(){
  7629. this.http.post('/user/getSimpleActiveUserList',{
  7630. },res => {
  7631. if(res.code == 'ok'){
  7632. this.allUsersList = res.data
  7633. }else{
  7634. this.$message({
  7635. message: res.msg,
  7636. type: 'error'
  7637. })
  7638. }
  7639. },err => {
  7640. this.$message({
  7641. message: err,
  7642. type: 'error'
  7643. })
  7644. })
  7645. },
  7646. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7647. fillWeekCustomClne() {
  7648. this.fillWeekDialogVisiCustom = false
  7649. },
  7650. fillWeekCustomSubmit() {
  7651. this.getReportList();
  7652. this.getDepartment();
  7653. this.getRecentlyProject()
  7654. },
  7655. // 待填日报姓名搜索
  7656. nameAearchSeek(flg) {
  7657. if(!this.nameAearch) {
  7658. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7659. return
  7660. }
  7661. if(flg) {
  7662. this.enterpriseWechatgetUser()
  7663. }
  7664. },
  7665. handleThreeData(userList) {
  7666. console.log(userList, '人员数据')
  7667. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7668. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7669. },
  7670. // 过滤树节点
  7671. filterTreeNodes(treeData, filterKeywords) {
  7672. return treeData.filter((node) => {
  7673. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7674. if (node.children && node.children.length > 0) {
  7675. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7676. }
  7677. return true;
  7678. }
  7679. if (node.children && node.children.length > 0) {
  7680. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7681. return node.children.length > 0;
  7682. }
  7683. return false;
  7684. });
  7685. },
  7686. // 企业微信获取人员
  7687. enterpriseWechatgetUser() {
  7688. this.deptMembDataLoading = true
  7689. this.http.post('/user/getEmployeeList',{
  7690. departmentId: -1,
  7691. pageIndex: 1,
  7692. pageSize: 100,
  7693. keyword: this.nameAearch,
  7694. status: '',
  7695. roleId: '',
  7696. cursor: '',
  7697. onlyDirect: '',
  7698. matchingType: ''
  7699. },res => {
  7700. if(res.code == 'ok'){
  7701. this.deptMembDataLoading = false
  7702. const userListName = res.data.records.map(item => item.name)
  7703. this.handleThreeData(userListName)
  7704. }else{
  7705. this.deptMembDataLoading = false
  7706. this.$message({
  7707. message: res.msg,
  7708. type: 'error'
  7709. })
  7710. }
  7711. },err => {
  7712. this.deptMembDataLoading = false
  7713. this.$message({
  7714. message: err,
  7715. type: 'error'
  7716. })
  7717. })
  7718. },
  7719. // 按周填报获取相关任务
  7720. async getWeeklyTaskList(item) {
  7721. console.log(item, '<=== 数据')
  7722. const { projectId, groupId, stage, taskId } = item
  7723. console.log(projectId, groupId, stage)
  7724. let parms = { projectId, isSubstitude: 0 }
  7725. groupId ? parms.groupId = groupId : ''
  7726. stage ? parms.stage = stage : ''
  7727. const { data } = await this.postData('/task/getRecentTask', parms)
  7728. this.zhoBao.taskId = taskId
  7729. this.$set(this.zhoBao, 'taskList', data)
  7730. console.log(this.zhoBao)
  7731. },
  7732. // 封装 post 请求
  7733. postData(url, params) {
  7734. return new Promise((resolve, reject) => {
  7735. this.http.post(url, { ...params },
  7736. res => {
  7737. resolve(res)
  7738. },
  7739. error => {
  7740. this.$message({
  7741. message: error,
  7742. type: "error"
  7743. });
  7744. reject(error)
  7745. })
  7746. })
  7747. },
  7748. // 自定义事件
  7749. selectCal(obj) {
  7750. console.log(obj, '传数据来源')
  7751. if(obj.distinction == '1') {
  7752. this.zhoBao.projectAuditorId = obj.id
  7753. } else if(obj.distinction == '2') {
  7754. this.zhoBao.auditorFirst = obj.id
  7755. } else if(obj.distinction == '3') {
  7756. this.zhoBao.auditorSec = obj.id
  7757. } else if(obj.distinction == '4') {
  7758. this.zhoBao.auditorThird = obj.id
  7759. } else if(obj.distinction == '5') {
  7760. this.zhoBao.ccUserid = obj.id
  7761. } else if(obj.distinction == '12') {
  7762. this.usersListId = obj.id
  7763. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7764. this.searchKeyword = obj.name
  7765. } else {
  7766. this.searchKeyword = ''
  7767. }
  7768. this.searchScreen(0)
  7769. } else if(obj.distinction == '13') {
  7770. this.usersListId = obj.id
  7771. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7772. this.searchKeyword = obj.name
  7773. } else {
  7774. this.searchKeyword = ''
  7775. }
  7776. this.searchScreen(1)
  7777. }
  7778. }
  7779. },
  7780. created() {
  7781. this.getUsers()
  7782. let height = window.innerHeight;
  7783. this.tableHeight = height - 178;
  7784. const that = this;
  7785. window.onresize = function temp() {
  7786. that.tableHeight = window.innerHeight - 178;
  7787. };
  7788. this.toViewForm.companyId = this.user.companyId
  7789. this.initDrag([{
  7790. type: "LR",
  7791. domClass: {
  7792. // 中间分割线的名字
  7793. resize: "line-line",
  7794. // 左侧盒子的名字
  7795. left: "box-left",
  7796. // 右侧盒子的名字
  7797. right: "box-right",
  7798. // 父级的名字
  7799. box: "box-father",
  7800. },
  7801. otherInfo: {
  7802. // 限制左边栏最低宽度
  7803. leftWidth: 120,
  7804. },
  7805. },
  7806. {
  7807. type: "LR",
  7808. domClass: {
  7809. // 中间分割线的名字
  7810. resize: "line-second",
  7811. // 左侧盒子的名字
  7812. left: "left-laowang",
  7813. // 右侧盒子的名字
  7814. right: "box-second-father",
  7815. // 父级的名字
  7816. box: "grand",
  7817. },
  7818. otherInfo: {
  7819. // 限制左边栏最低宽度
  7820. leftWidth: 120,
  7821. },
  7822. },
  7823. ]);
  7824. }
  7825. };
  7826. </script>
  7827. <style lang="scss" scoped>
  7828. .fillWeekDialogVisiCustom {
  7829. width: 100%;
  7830. height: 70vh;
  7831. }
  7832. .fillWeekCustom {
  7833. .el-dialog__body {
  7834. padding: 20px 20px !important;
  7835. }
  7836. }
  7837. .photos {
  7838. position: relative;
  7839. display: flex;
  7840. flex-wrap: wrap;
  7841. }
  7842. .photos_img {
  7843. width: 120px;
  7844. height: 120px;
  7845. margin-right: 20px;
  7846. margin-bottom: 20px;
  7847. cursor: pointer;
  7848. img {
  7849. width: 100%;
  7850. height: 100%;
  7851. }
  7852. }
  7853. .paginatis {
  7854. padding: 10px 10px;
  7855. background: #f2f2f2;
  7856. }
  7857. .waiting {
  7858. color:orange;
  7859. }
  7860. .filledReportStyle {
  7861. color:#32CD32;
  7862. }
  7863. .RejectStyle {
  7864. color:red;
  7865. }
  7866. .waitSubmitStyle{
  7867. color: #409eff;
  7868. }
  7869. .chooseDate {
  7870. .waiting {
  7871. color: #20a0ff;
  7872. }
  7873. .filledReportStyle {
  7874. color:#20a0ff;
  7875. }
  7876. .RejectStyle {
  7877. color: #20a0ff;
  7878. }
  7879. .waitSubmitStyle{
  7880. color: #20a0ff;
  7881. }
  7882. }
  7883. .allDaily {
  7884. width:100%;
  7885. }
  7886. .report_title {
  7887. padding:10px 0;
  7888. color:#666;
  7889. }
  7890. .clearfix {
  7891. overflow-x: auto;
  7892. white-space: nowrap;
  7893. padding: 15px 0 10px 0;
  7894. // overflow-y: hidden;
  7895. .date_item {
  7896. padding: 0 3px;
  7897. cursor: pointer;
  7898. position: relative;
  7899. }
  7900. .chooseDate {
  7901. position: absolute;
  7902. bottom: -3px;
  7903. width: 37px;
  7904. height: 2px;
  7905. left: 14px;
  7906. background: #20a0ff;
  7907. }
  7908. }
  7909. .one_daily {
  7910. i {
  7911. color: #9ed0ff;
  7912. margin-right: 5px;
  7913. }
  7914. .one_daily_body {
  7915. padding: 10px 0px;
  7916. p {
  7917. margin: 0;
  7918. line-height: 30px;
  7919. }
  7920. }
  7921. ul {
  7922. padding: 0;
  7923. }
  7924. }
  7925. .checkbtn {
  7926. float: right;
  7927. margin-top: -10px;
  7928. }
  7929. .selConStyle{
  7930. margin-top:9rem;
  7931. margin-bottom:11rem;
  7932. .selConStyle_title{
  7933. height: 3rem;
  7934. text-align: center;
  7935. font-size: 17px;
  7936. }
  7937. .el-select{
  7938. margin: 0 15%;
  7939. width: 70%;
  7940. }
  7941. }
  7942. </style>
  7943. <style lang="scss">
  7944. /*去除upload组件过渡效果*/
  7945. .photos .el-upload-list__item {
  7946. transition: none !important;
  7947. }
  7948. .daily {
  7949. .el-card__body {
  7950. height: 80%;
  7951. overflow-y: auto;
  7952. }
  7953. .el-card__header {
  7954. padding: 0 20px;
  7955. }
  7956. }
  7957. .membListClass{
  7958. .el-dialog__body{
  7959. padding-top: 10px;
  7960. }
  7961. }
  7962. // .editReportDialog .el-dialog__footer{
  7963. // position: sticky;
  7964. // bottom: 0;
  7965. // background: #fff;
  7966. // height: 70px;
  7967. // z-index: 1010;
  7968. // }
  7969. .editReportDialog{
  7970. min-width: 800px;
  7971. }
  7972. .touruxiangmu{
  7973. max-width: 1000px;
  7974. }
  7975. </style>
  7976. <style scoped>
  7977. /* 项目标签的样式 */
  7978. .el-tag + .el-tag {
  7979. margin-left: 10px;
  7980. }
  7981. .button-new-tag {
  7982. margin-left: 10px;
  7983. height: 32px;
  7984. line-height: 30px;
  7985. padding-top: 0;
  7986. padding-bottom: 0;
  7987. }
  7988. .input-new-tag {
  7989. width: 90px;
  7990. margin-left: 10px;
  7991. vertical-align: bottom;
  7992. }
  7993. .selectworktime .el-table__fixed-body-wrapper{
  7994. top: 48px !important;
  7995. }
  7996. .selectworktime_export .selectworktime_export_l{
  7997. width: 650px;
  7998. float: left;
  7999. height: 42px;
  8000. }
  8001. .approvalProcessBox{
  8002. margin-left: 30px;
  8003. font-size: 14px;
  8004. line-height: 16px;
  8005. cursor: pointer;
  8006. }
  8007. .approvalProcessBox i {
  8008. margin-right: 0;
  8009. height: 16px;
  8010. width: 16px;
  8011. display: inline-block;
  8012. transform: scale(1.2);
  8013. position: relative;
  8014. top: 0.5px;
  8015. color: #409eff;
  8016. }
  8017. .approvalProcessBox .approvalProcessClick{
  8018. cursor: pointer;
  8019. color: #409eff;
  8020. font-size: 14px;
  8021. }
  8022. .approvalProcessBox:hover .approvalProcessClick{
  8023. color: #3485fb;
  8024. }
  8025. </style>
  8026. <style lang="scss" scoped>
  8027. // 加班样式
  8028. .overtime {
  8029. display: inline-block;
  8030. margin-left: 20px;
  8031. input {
  8032. display: inline-block;
  8033. margin-top: 5px;
  8034. }
  8035. }
  8036. .plus {
  8037. display: inline-block;
  8038. }
  8039. // .tages {
  8040. // float: right;
  8041. // }
  8042. .overtime {
  8043. display: inline-block;
  8044. margin-left: 30px;
  8045. }
  8046. .bloks {
  8047. display: inline-block;
  8048. width: 380px;
  8049. }
  8050. .zhiss {
  8051. display: flex;
  8052. justify-content: space-around;
  8053. align-items: center;
  8054. }
  8055. .zhoFel {
  8056. display: flex;
  8057. justify-content: space-between;
  8058. align-items: center;
  8059. }
  8060. // 左右滑动样式
  8061. .line {
  8062. width: 30px;
  8063. /* height: 500px; */
  8064. background: #f2f2f2;
  8065. cursor: w-resize;
  8066. }
  8067. .box-father {
  8068. border: 8px solid #000;
  8069. }
  8070. .line-second {
  8071. width: 10px;
  8072. /* background: red; */
  8073. }
  8074. .flex {
  8075. display: flex;
  8076. width: 100%;
  8077. }
  8078. .box-left {
  8079. flex: 0 0 400px;
  8080. /* height: 600px; */
  8081. /* background: blue; */
  8082. }
  8083. .box-right {
  8084. /* height: 600px; */
  8085. /* background: green; */
  8086. flex: 1;
  8087. }
  8088. .box-postion {
  8089. width: 200px;
  8090. /* height: 400px; */
  8091. background: #ccc;
  8092. }
  8093. .custom-tree-node {
  8094. flex: 1;
  8095. display: flex;
  8096. align-items: center;
  8097. justify-content: space-between;
  8098. font-size: 14px;
  8099. padding-right: 8px;
  8100. }
  8101. .daitianrbao {
  8102. width: 100%;
  8103. box-sizing: border-box;
  8104. height: 40px;
  8105. border-radius: 4px;
  8106. border: 1px solid #DCDFE6;
  8107. overflow: hidden;
  8108. text-overflow: ellipsis;
  8109. display: flex;
  8110. // align-items: center;
  8111. }
  8112. .daitianrbao .spnn {
  8113. display: inline-block;
  8114. box-sizing: border-box;
  8115. padding: 0 15px;
  8116. overflow: hidden;
  8117. text-overflow: ellipsis;
  8118. }
  8119. .daitianrbao .hover {
  8120. color: #DCDFE6 !important;
  8121. }
  8122. </style>