daily.vue 498 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  178. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  182. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. </div>
  184. <div class="one_daily_body">
  185. <el-timeline>
  186. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  187. <el-card shadow="never">
  188. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  189. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  190. <span v-if="user.company.packageEngineering == 0">
  191. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  192. <span v-if="user.timeType.reportAuditType == 7" >
  193. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  194. <span v-if="item2.deptAuditorName">、</span>
  195. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  196. </span>
  197. <span v-else>
  198. <span v-if="item2.isDeptAudit==0">
  199. <span v-if="item2.projectAuditState==0">
  200. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.auditorDeptName?item2.auditorDeptName:"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  201. <span v-if="item2.projectAuditorName != null">(
  202. <!-- {{item2.projectAuditorName}} -->
  203. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  204. )</span>
  205. <!-- 审核 --> {{$t('other.audit')}}
  206. </span>
  207. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  208. <!-- 项目审核人 --> {{user.companyId == 469?(item2.auditorDeptName?item2.auditorDeptName:"待部门主管"):$t('other.projectAuditor')}}
  209. <span v-if="item2.projectAuditorName != null">(
  210. <!-- {{item2.projectAuditorName}} -->
  211. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  212. )</span>
  213. <!-- 审核通过 --> {{$t('state.approved')}}
  214. </span>
  215. </span>
  216. <span v-else-if="item2.isDeptAudit==1">
  217. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  218. ({{$t('other.await')}}
  219. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  220. {{$t('other.audit')}})
  221. </span>
  222. </span>
  223. ]</span>
  224. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  225. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  226. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  227. </span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  229. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  230. </span>
  231. <!-- <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> -->
  232. <span v-if="user.company.packageEngineering == 1">
  233. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  234. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  235. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  237. (
  238. <!-- <span v-if="user.userNameNeedTranslate != 1">
  239. {{item2.projectAuditorName}}
  240. </span>
  241. <span v-if="user.userNameNeedTranslate == 1">
  242. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  243. </span> -->
  244. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  245. )
  246. </span>{{$t('other.audit')}} ]</span>
  247. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  248. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  249. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  250. </span>
  251. <!--每个项目上单独审核 -->
  252. <span style="float:right;">
  253. <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>
  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="primary" :loading="logining"
  255. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  256. <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"
  257. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  258. <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"
  259. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  260. <!--自己可以撤回待审核状态的报告 -->
  261. <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>
  262. </span>
  263. </p>
  264. <p v-if="user.companyId == yuzhongCompId">
  265. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  266. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  267. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  268. <!--任务分组和阶段 -->
  269. <p v-if="item2.groupId != 0">
  270. {{$t('other.taskGroup')}}:{{item2.groupName}}
  271. <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>
  272. </p>
  273. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  274. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  275. <!-- 自定义日报文本 -->
  276. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  277. <p v-if="user.company.packageEngineering == 1">
  278. {{$t('other.professionalProgress')}}:
  279. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  280. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  281. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  282. </el-tooltip>
  283. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  284. <i class="iconfont firerock-iconshenhetongguo"></i>
  285. </el-tooltip>
  286. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  287. <i class="iconfont firerock-iconshenhebohui"></i>
  288. </el-tooltip>
  289. </span>
  290. </p>
  291. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  292. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  293. </p>
  294. <div v-if="item2.multiWorktime==0">
  295. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  296. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  297. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  298. {{item2.time.toFixed(1)}}h
  299. <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>
  300. </p>
  301. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  302. <span style="margin-right:10px;">{{item2.progress}}%</span>
  303. </p>
  304. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  305. </div>
  306. <div v-if="item2.multiWorktime==1" >
  307. <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>
  308. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  309. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  310. <p style="display: inline-block;">{{$t('time.duration')}}:
  311. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  312. {{timeItem.time.toFixed(1)}}h
  313. </p>
  314. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  315. </div>
  316. </div>
  317. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  318. <!--照片的显示 -->
  319. <p v-if="item2.pics != null && item2.pics.length > 0">
  320. <el-image v-for="(pic, index) in item2.pics" :key="index"
  321. style="width: 100px; height: 100px; margin-right:10px;"
  322. :src="pic"
  323. :preview-src-list="item2.pics">
  324. </el-image>
  325. </p>
  326. </el-card>
  327. </el-timeline-item>
  328. </el-timeline>
  329. </div>
  330. </div>
  331. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  332. <!-- 简陋的无报告提示 -->
  333. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  334. </div>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. </el-card>
  340. </div>
  341. <!-- 工时推送日志弹窗 -->
  342. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  343. <template>
  344. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  345. </template>
  346. <template>
  347. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  348. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  349. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  350. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  351. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  352. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  353. <template slot-scope="scope">
  354. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  355. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  356. </template>
  357. </el-table-column>
  358. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  359. </el-table>
  360. </template>
  361. <span slot="footer" class="dialog-footer">
  362. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  363. </span>
  364. </el-dialog>
  365. <!-- 填写日报的dialog -->
  366. <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">
  367. <div style="height: 65vh;overflow: auto;">
  368. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  369. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  370. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  371. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  372. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  373. <span class="spnn" v-if="workForm.userNames">
  374. <span v-for="(item, index) in workForm.userNames" :key="index">
  375. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  376. <span v-if="index < workForm.userNames.length - 1">,</span>
  377. </span>
  378. </span>
  379. <span class="spnn hover" v-else>
  380. {{$t('defaultText.pleaseSelectAsubstitute')}}
  381. </span>
  382. </div>
  383. </el-form-item>
  384. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  385. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  386. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  387. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  388. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  389. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  390. <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>
  391. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  392. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  393. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  394. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  395. <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>
  396. <!-- AI智能填报 -->
  397. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  398. </el-form-item>
  399. <!--考勤时长显示-->
  400. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  401. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  402. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  403. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  404. </span>
  405. <!--批量填报和批量代填不显示考勤记录-->
  406. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  407. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  408. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  409. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  410. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  411. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  414. @click="refreshAttendance(workForm.createDate)"></el-button>
  415. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  416. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  417. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  418. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  419. </el-form-item>
  420. <!-- 000000 -->
  421. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  422. <div v-if="reportTimeType.multiWorktime==0">
  423. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  424. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  425. <el-select v-model="domain.timeType" style="width:200px;"
  426. v-if="reportTimeType.type == 0"
  427. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  428. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  429. @change="onTimeTypeChange(domain.timeType)">
  430. <el-option
  431. v-for="item in timeType"
  432. :key="item.value"
  433. :label="item.label"
  434. :value="item.value">
  435. </el-option>
  436. </el-select>
  437. <!-- 数字时长选择 -->
  438. <el-select v-model="domain.workingTime" style="width:200px;"
  439. v-if="reportTimeType.type == 1"
  440. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  441. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  442. @change="seleChn(0,domain)">
  443. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  444. </el-select>
  445. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  446. <span v-if="reportTimeType.type == 2">
  447. <!--时间范围选择 -->
  448. <el-time-picker
  449. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  450. v-model="domain.startTime"
  451. :placeholder="$t('time.startTime')"
  452. style="width:120px;"
  453. format="HH:mm"
  454. value-format="HH:mm"
  455. :picker-options="{
  456. start: '08:00',
  457. end: '23:30'
  458. }"
  459. @change="iptChang()">
  460. </el-time-picker> - <el-time-picker
  461. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  462. v-model="domain.endTime"
  463. :placeholder="$t('time.endTime')"
  464. style="width:120px;"
  465. format="HH:mm"
  466. value-format="HH:mm"
  467. :picker-options="{
  468. start: '08:00',
  469. end: '23:30',
  470. minTime: domain.startTime
  471. }"
  472. @change="iptChang()">
  473. </el-time-picker>
  474. </span>
  475. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  476. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  477. <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>
  478. </div>
  479. </el-form-item>
  480. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  481. :prop="'domains.' + index + '.reportTargetDeptId'"
  482. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  483. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  484. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  485. <span style="float: left">
  486. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  487. </span>
  488. </el-option>
  489. </el-select>
  490. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  491. </el-form-item>
  492. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  493. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  494. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  495. @change="selectProject(domain, index)"
  496. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  497. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  498. <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">
  499. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  500. <span style="float: right;">{{ item.projectName }}</span>
  501. </el-option>
  502. </el-option-group>
  503. </el-select>
  504. <!--昱众不显示子项目-->
  505. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  506. <span style="margin-left:45px;">
  507. {{$t('lable.subproject')}}</span>
  508. <!--子项目 -->
  509. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  510. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  511. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  512. </el-select>
  513. </template>
  514. <template v-if="user.companyId == yuzhongCompId">
  515. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  516. <!--角色选择 -->
  517. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  518. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  519. <el-option
  520. v-for="item in roleList"
  521. :key="item.value"
  522. :label="item.label"
  523. :value="item.value">
  524. </el-option>
  525. </el-select>
  526. </template>
  527. <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%;"
  528. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  529. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  530. </el-link>
  531. <!-- <el-link type="primary" v-if="canEdit"
  532. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  533. </el-form-item>
  534. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  535. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  536. </el-form-item>
  537. <!--如果设置了工时成本预警的预算成本项-->
  538. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  539. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  540. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  541. </el-select>
  542. </el-form-item>
  543. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  544. <template slot="label">
  545. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  546. <span >{{$t('lable.taskGrouping')}}</span>
  547. </template>
  548. <!-- 任务分组 -->
  549. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  550. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  551. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  552. </el-select>
  553. <template v-if="user.companyId == yuzhongCompId">
  554. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  555. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  556. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  557. <el-option
  558. v-for="item in domain.filteredRespList"
  559. :key="item.id"
  560. :label="item.jobRespon"
  561. :value="item.id">
  562. </el-option>
  563. </el-select>
  564. </template>
  565. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  566. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  567. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  568. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  569. @change="changeStages(domain, index)"
  570. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  571. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  572. </el-select>
  573. </template>
  574. </el-form-item>
  575. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
  576. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  577. <template slot="label">
  578. <span style="color:#FF0000;">*</span>
  579. <span >{{$t('other.projectAuditor')}}</span>
  580. </template>
  581. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  582. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  583. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  584. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  585. </el-option>
  586. </el-select>
  587. <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>
  588. </el-form-item>
  589. </div>
  590. <el-form-item v-if="user.companyId == yuzhongCompId">
  591. <template slot="label">
  592. <span style="color:#FF0000;">*</span>
  593. <span >{{ $t('gongZuoNeiRong') }}</span>
  594. </template>
  595. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  596. :disabled="(workForm.domains[index].state>=2?false:true)" >
  597. <el-option
  598. v-for="item in domain.workContentList"
  599. :key="item.id"
  600. :label="item.workContext"
  601. :value="item.id">
  602. </el-option>
  603. </el-select>
  604. </el-form-item>
  605. <!-- 111111 -->
  606. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  607. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :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"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  610. <span v-else>{{item.name}}</span>
  611. </el-option>
  612. </el-select>
  613. <template v-if="user.timeType.auditLevel > 1">
  614. <i class="el-icon-right"></i>
  615. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  616. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  617. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  618. <span v-else>{{item.name}}</span>
  619. </el-option>
  620. </el-select>
  621. </template>
  622. <template v-if="user.timeType.auditLevel > 2">
  623. <i class="el-icon-right"></i>
  624. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  625. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  626. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  627. <span v-else>{{item.name}}</span>
  628. </el-option>
  629. </el-select>
  630. </template>
  631. </el-form-item>
  632. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  633. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  634. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  635. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  636. <span v-else>{{item.name}}</span>
  637. </el-option>
  638. </el-select>
  639. </el-form-item>
  640. <!-- 相关维度/自定义维度 -->
  641. <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'">
  642. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  643. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  644. </el-option>
  645. </el-select>
  646. </el-form-item>
  647. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  648. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  649. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  650. </el-option>
  651. </el-select>
  652. </el-form-item>
  653. <!-- 相关数值 -->
  654. <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">
  655. <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>
  656. </el-form-item>
  657. <!-- 自定义文本 -->
  658. <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">
  659. <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>
  660. </el-form-item>
  661. <!--按比例填报-->
  662. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  663. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  664. <div style="width:400px;">
  665. <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>
  666. <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>
  667. </div>
  668. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  669. <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>
  670. </div>
  671. </el-form-item>
  672. <!--工程专业版本模式下, 各个专业的进度填报 -->
  673. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  674. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  675. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  676. <el-input size="mini" style="width:60px;" v-model="item.progress"
  677. @keyup.native="onProgressChange"
  678. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  679. </span>
  680. </el-form-item>
  681. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  682. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  683. <template slot="label" v-if="user.timeType.taskRequired == 1">
  684. <span style="color:#FF0000;">*</span>
  685. <span >{{ $t('other.task') }}</span>
  686. </template>
  687. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  688. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  689. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  690. </el-select>
  691. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  692. </el-form-item>
  693. <!--针对依斯贝的SAP服务-->
  694. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  695. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  696. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  697. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  698. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  699. </el-select>
  700. </el-form-item>
  701. <!--工作事项-->
  702. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  703. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  704. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  705. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  706. </el-form-item>
  707. <!-- 拍照上传 -->
  708. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  709. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  710. <div class="photos">
  711. <div>
  712. <el-upload
  713. list-type="picture-card"
  714. :http-request="(file) => {return addImg(file, index)}"
  715. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  716. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  717. :file-list="domain.imgListUrl" :limit="9"
  718. :disabled="workForm.domains[index].state>=2?false:true">
  719. <i class="el-icon-plus"></i>
  720. </el-upload>
  721. </div>
  722. </div>
  723. </el-form-item>
  724. </div>
  725. <!--多个工作事项填报的情况 -->
  726. <div v-if="reportTimeType.multiWorktime==1">
  727. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  728. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  729. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  730. @change="selectProject(domain, index)"
  731. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  732. <!-- <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">
  733. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  734. <span style="float: right;">{{ item.projectName }}</span>
  735. </el-option> -->
  736. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  737. <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">
  738. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  739. <span style="float: right;">{{ item.projectName }}</span>
  740. </el-option>
  741. </el-option-group>
  742. </el-select>
  743. <template v-if="user.timeType.mainProjectState != 1">
  744. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  745. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  746. <!--子项目 -->
  747. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  748. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  749. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  750. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  751. </el-select>
  752. </template>
  753. <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;"
  754. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  755. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  756. </el-link>
  757. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  758. <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>
  759. </div>
  760. <!-- <el-link type="primary" v-if="canEdit"
  761. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  762. </el-form-item>
  763. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  764. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  765. </el-form-item>
  766. <!--如果设置了工时成本预警的预算成本项-->
  767. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  768. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  769. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  770. </el-select>
  771. </el-form-item>
  772. <el-form-item v-if="user.company.packageProject == 1">
  773. <template slot="label">
  774. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  775. <span >{{$t('lable.taskGrouping')}}</span>
  776. </template>
  777. <!-- 任务分组 -->
  778. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  779. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  780. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  781. </el-select>
  782. <!-- 项目的阶段 -->
  783. <span v-if="domain.stages != null && domain.stages.length> 0"
  784. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  785. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  786. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  787. @change="changeStages(domain, index)"
  788. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  789. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  790. </el-select>
  791. </el-form-item>
  792. <el-form-item :label="$t('other.projectAuditor')" >
  793. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  794. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  795. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  796. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  797. </el-option>
  798. </el-select>
  799. <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>
  800. </el-form-item>
  801. <!--工程专业版本模式下, 各个专业的进度填报 -->
  802. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  803. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  804. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  805. <el-input size="mini" style="width:60px;" v-model="item.progress"
  806. @keyup.native="onProgressChange"
  807. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  808. </span>
  809. </el-form-item>
  810. <!-- 相关维度 -->
  811. <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'">
  812. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  813. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  814. </el-option>
  815. </el-select>
  816. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  817. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  818. </el-option>
  819. </el-select>
  820. </el-form-item>
  821. <!-- 相关数值 -->
  822. <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">
  823. <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>
  824. </el-form-item>
  825. <!-- 自定义文本 -->
  826. <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">
  827. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  828. </el-form-item>
  829. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  830. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  831. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  832. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  833. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  834. </el-select>
  835. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  836. </el-form-item>
  837. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  838. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  839. <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>
  840. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  841. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  842. <span v-if="reportTimeType.type == 2">
  843. <!-- <span> -->
  844. <!--时间范围选择 -->
  845. <el-time-picker
  846. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  847. v-model="timeItem.startTime"
  848. :placeholder="$t('time.startTime')"
  849. style="width:120px;"
  850. format="HH:mm"
  851. value-format="HH:mm"
  852. :picker-options="{
  853. start: '00:00',
  854. end: '23:59',
  855. }"
  856. @change="iptChangs()">
  857. </el-time-picker> - <el-time-picker
  858. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  859. v-model="timeItem.endTime"
  860. :placeholder="$t('time.endTime')"
  861. style="width:120px;"
  862. format="HH:mm"
  863. value-format="HH:mm"
  864. :picker-options="{
  865. start: '00:00',
  866. end: '23:59',
  867. minTime: timeItem.startTime
  868. }"
  869. @change="iptChangs()">
  870. </el-time-picker>
  871. </span>
  872. </el-form-item>
  873. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  874. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  875. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  876. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  877. ></el-input>
  878. </el-form-item>
  879. </div>
  880. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  881. </div>
  882. <!--照片的显示 -->
  883. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  884. <el-image v-for="(pic, index) in domain.pics" :key="index"
  885. style="width: 100px; height: 100px; margin-right:10px;"
  886. :src="pic"
  887. :preview-src-list="domain.pics">
  888. </el-image>
  889. </p>
  890. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  891. </div>
  892. <span id="workFormsItemBottom"></span>
  893. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  894. </el-form>
  895. </div>
  896. <span slot="footer" class="dialog-footer">
  897. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  898. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  899. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  900. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  901. <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>
  902. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  903. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  904. </span>
  905. </el-dialog>
  906. <!-- 按周填报 -->
  907. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  908. <!-- 按周填报-已填工时-点击 -->
  909. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  910. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  911. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  912. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  913. <el-table-column prop="state" :label="$t('state.states')">
  914. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  915. </el-table-column>
  916. </el-table>
  917. <span slot="footer" class="dialog-footer">
  918. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  919. </span>
  920. </el-dialog>
  921. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  922. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  923. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  924. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  925. <span class="spnn" v-if="workForm.userNames">
  926. <span v-for="(item, index) in workForm.userNames" :key="index">
  927. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  928. <span v-if="index < workForm.userNames.length - 1">,</span>
  929. </span>
  930. </span>
  931. <span class="spnn hover" v-else>
  932. {{$t('defaultText.pleaseSelectAsubstitute')}}
  933. </span>
  934. </div>
  935. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  936. </div>
  937. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  938. <el-form-item style="height:30px;margin-top:-72px;">
  939. <!-- <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> -->
  940. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  941. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  942. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  943. <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>
  944. <el-option
  945. v-for="item in fillProjectList"
  946. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  947. :key="item.id"
  948. :label="item.projectName + '\u3000' + item.projectCode"
  949. :value="item.id">
  950. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  951. <span style="float: right">{{ item.projectName }}</span>
  952. </el-option>
  953. </el-select>
  954. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  955. </el-form-item>
  956. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  957. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  958. <template slot-scope="scope">
  959. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  960. </template>
  961. </el-table-column>
  962. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  963. <template slot-scope="scope">
  964. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  965. <p v-else></p>
  966. </template>
  967. </el-table-column> -->
  968. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  969. <template slot-scope="scope">
  970. <div v-if="scope.row.canFill == 1">
  971. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  972. <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>
  973. <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>
  974. <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>
  975. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  976. </div>
  977. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  978. <el-button v-if="scope.row[item.projectName] != 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>
  979. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  980. </div>
  981. </div>
  982. <div v-else >
  983. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  984. </div>
  985. </template>
  986. </el-table-column>
  987. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  988. <template slot-scope="scope">
  989. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  990. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  991. </span>
  992. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  993. </template>
  994. </el-table-column>
  995. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  996. <template slot-scope="scope">
  997. <div class="zhiss">
  998. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  999. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1000. </div>
  1001. </template>
  1002. </el-table-column>
  1003. </el-table>
  1004. </el-form>
  1005. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1006. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1007. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1008. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1009. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1010. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1011. <!--针对景昱,先检查工时是否存在异常-->
  1012. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1013. </span>
  1014. </el-dialog>
  1015. <!-- 重庆物奇私人定制的按周填报 -->
  1016. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1017. <div class="fillWeekDialogVisiCustom">
  1018. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1019. </div>
  1020. </el-dialog>
  1021. <!-- enableNewWeeklyfill==2 -->
  1022. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1023. <div class="fillWeekDialogVisiCustom">
  1024. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1025. </div>
  1026. </el-dialog>
  1027. <!-- 选择时间 -->
  1028. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1029. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1030. <span slot="footer" class="dialog-footer">
  1031. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1032. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1033. </span>
  1034. </el-dialog>
  1035. <!-- 按周填报弹窗 -->
  1036. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1037. <div>
  1038. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1039. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1040. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1041. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1042. </el-select>
  1043. </div>
  1044. <!--如果设置了工时成本预警的预算成本项-->
  1045. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1046. <p>{{$t('lable.budgetSource')}}</p>
  1047. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1048. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1049. </el-select>
  1050. </div>
  1051. <!-- 任务分组 -->
  1052. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1053. <p>{{$t('lable.taskGrouping')}}</p>
  1054. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1055. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1056. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. </div>
  1059. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1060. <p>{{$t('other.inputStage')}}</p>
  1061. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1062. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1063. </el-select>
  1064. </div>
  1065. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1066. <p>{{$t('other.reviewer')}}</p>
  1067. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1068. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1069. </el-select>
  1070. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1071. </div>
  1072. <template v-if="user.timeType.reportAuditType == 3">
  1073. <div class="zhoFel">
  1074. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1075. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1076. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1077. </el-select>
  1078. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1079. </div>
  1080. <div class="zhoFel">
  1081. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1082. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1083. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1084. </el-select>
  1085. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1086. </div>
  1087. <div class="zhoFel">
  1088. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1089. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1090. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1091. </el-select>
  1092. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1093. </div>
  1094. <div class="zhoFel">
  1095. <p>{{ $t('chao-song-ren') }}</p>
  1096. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1097. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1098. </el-select>
  1099. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1100. </div>
  1101. </template>
  1102. <!-- 自定义维度 -->
  1103. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1104. <p>{{user.timeType.customDegreeName}}</p>
  1105. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1106. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1107. </el-select>
  1108. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1109. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1110. </el-select>
  1111. </div>
  1112. <!-- 自定义数值 -->
  1113. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1114. <p>{{user.timeType.customDataName}}</p>
  1115. <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>
  1116. </div>
  1117. <!-- 自定义文本 -->
  1118. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1119. <p>{{user.timeType.customTextName}}</p>
  1120. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1121. </div>
  1122. <!-- 选择任务 -->
  1123. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1124. <p>{{ $t('renWuLiChengBei') }}</p>
  1125. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1126. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1127. </el-select>
  1128. </div>
  1129. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1130. <p>{{$t('other.timeSelection')}}</p>
  1131. <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>
  1132. </div>
  1133. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1134. <p>{{$t('other.chooseDuration')}}</p>
  1135. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1136. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1137. </el-select>
  1138. </div>
  1139. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1140. <p>{{$t('lable.percentageOfTime')}}</p>
  1141. <div style="width:400px;display: flex;align-items: center;">
  1142. <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>
  1143. <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>
  1144. </div>
  1145. </div>
  1146. <div class="zhoFel">
  1147. <p>{{$t('other.workMatters')}}</p>
  1148. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1149. </div>
  1150. </div>
  1151. <span slot="footer" class="dialog-footer">
  1152. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1153. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1154. </span>
  1155. </el-dialog>
  1156. <!--导出报表条件选择 -->
  1157. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1158. <el-form ref="form3" :model="exportParam" >
  1159. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1160. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1161. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1162. </el-select>
  1163. </el-form-item>
  1164. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1165. <!-- <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>
  1166. <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> -->
  1167. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1168. </el-form-item>
  1169. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1170. <el-date-picker
  1171. v-model="exportParam.dateRange" :editable="false"
  1172. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1173. :range-separator="$t('other.to')"
  1174. type="daterange"
  1175. :start-placeholder="$t('time.startDate')"
  1176. :end-placeholder="$t('time.endDate')"
  1177. ></el-date-picker>
  1178. </el-form-item>
  1179. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1180. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1181. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1182. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1183. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1184. </el-select>
  1185. </el-form-item>
  1186. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1187. <div class="exportReportRadio">
  1188. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1189. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1190. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1191. <i class="el-icon-question"></i>
  1192. </el-tooltip>
  1193. </div>
  1194. </el-form-item>
  1195. </el-form>
  1196. <div slot="footer" class="dialog-footer">
  1197. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1198. </div>
  1199. </el-dialog>
  1200. <!--导出报表条件选择 -->
  1201. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1202. <el-form ref="form3" :model="exportParam" >
  1203. <el-form-item prop="range" :label="$t('time.dateRange')">
  1204. <el-date-picker
  1205. v-model="exportParam.dateRange" :editable="false"
  1206. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1207. :clearable="true"
  1208. :range-separator="$t('other.to')"
  1209. type="daterange"
  1210. :start-placeholder="$t('time.startDate')"
  1211. :end-placeholder="$t('time.endDate')"
  1212. ></el-date-picker>
  1213. </el-form-item>
  1214. </el-form>
  1215. <div slot="footer" class="dialog-footer">
  1216. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1217. </div>
  1218. </el-dialog>
  1219. <!--人员列表 -->
  1220. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1221. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1222. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1223. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1224. <el-table-column type="selection"></el-table-column>
  1225. <el-table-column prop="label" :label="$t('lable.name')" >
  1226. <template slot-scope="scope">
  1227. <span>
  1228. <!-- {{(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}} -->
  1229. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1230. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1231. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1232. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1233. </span>
  1234. <span v-else>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1236. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1237. </span>
  1238. </span>
  1239. </template>
  1240. </el-table-column>
  1241. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1242. <template slot-scope="scope">
  1243. <div>
  1244. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1245. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1246. </div>
  1247. </template>
  1248. </el-table-column>
  1249. </el-table>
  1250. </el-tab-pane>
  1251. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1252. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1253. <el-table-column prop="label" :label="$t('lable.name')" >
  1254. <template slot-scope="scope">
  1255. <!-- <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> -->
  1256. <!-- <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> -->
  1257. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1258. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1259. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1260. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1261. </span>
  1262. <span v-else>
  1263. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1264. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1265. </span>
  1266. </template>
  1267. </el-table-column>
  1268. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1269. <template slot-scope="scope">
  1270. <div>
  1271. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1272. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1273. </div>
  1274. </template>
  1275. </el-table-column>
  1276. </el-table>
  1277. </el-tab-pane>
  1278. </el-tabs>
  1279. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1280. <el-table-column type="selection"></el-table-column>
  1281. <el-table-column prop="label" :label="$t('lable.name')" >
  1282. <template slot-scope="scope">
  1283. <div>
  1284. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1285. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1286. </div>
  1287. </template>
  1288. </el-table-column>
  1289. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1290. <template slot-scope="scope">
  1291. <div>
  1292. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1293. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1294. </div>
  1295. </template>
  1296. </el-table-column>
  1297. </el-table>
  1298. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1299. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1300. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1301. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1302. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1303. </div>
  1304. </el-dialog>
  1305. <!-- 日报审核修改 -->
  1306. <el-dialog
  1307. :title="$t('riBaoShenHeXiuGai')"
  1308. :visible.sync="reportLogCheckDialog"
  1309. width="30%"
  1310. :before-close="handleClose">
  1311. <el-form ref="form3" :model="exportReportLogParam" >
  1312. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1313. <el-date-picker
  1314. v-model="exportReportLogParam.dateRange" :editable="false"
  1315. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1316. :range-separator="$t('other.to')"
  1317. type="daterange"
  1318. :start-placeholder="$t('time.startDate')"
  1319. :end-placeholder="$t('time.endDate')"
  1320. ></el-date-picker>
  1321. </el-form-item>
  1322. </el-form>
  1323. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1324. <br>
  1325. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1326. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1327. <span slot="footer" class="dialog-footer">
  1328. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1329. </span>
  1330. </el-dialog>
  1331. <!-- 按部门选择人员 -->
  1332. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1333. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1334. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1335. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1336. </el-input>
  1337. <div class="tree" style="height:400px">
  1338. <el-scrollbar style="height:100%">
  1339. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1340. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1341. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1342. <span class="custom-tree-node" slot-scope="{ node }">
  1343. <span v-if="user.userNameNeedTranslate == '1'">
  1344. <span v-if="node.data.children">
  1345. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1346. </span>
  1347. <span v-else>
  1348. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1349. </span>
  1350. </span>
  1351. <span v-if="user.userNameNeedTranslate != '1'">
  1352. {{ node.label }}
  1353. </span>
  1354. <!-- {{ node.label }} -->
  1355. </span>
  1356. </el-tree>
  1357. </el-scrollbar>
  1358. </div>
  1359. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1360. <div slot="footer" class="dialog-footer">
  1361. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1362. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1363. </div>
  1364. </el-dialog>
  1365. <el-dialog
  1366. v-if="monthWorkTimeDialog"
  1367. :visible.sync="monthWorkTimeDialog"
  1368. :close-on-click-modal="false"
  1369. customClass="customWidth selectworktime"
  1370. width="92%"
  1371. top="60px"
  1372. >
  1373. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1374. <el-tabs v-model="activeName" @tab-click="handleClick">
  1375. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1376. <div class="selectworktime_export" style="margin-top:10px;">
  1377. <div class="selectworktime_export_l">
  1378. <el-date-picker
  1379. class="selecteworktime_datapick"
  1380. v-model="WorktimeDatepickValue"
  1381. value-format="yyyy-MM-dd"
  1382. type="daterange"
  1383. align="right"
  1384. unlink-panels
  1385. :range-separator="$t('other.to')"
  1386. :start-placeholder="$t('time.startDate')"
  1387. :end-placeholder="$t('time.endDate')"
  1388. :default-time="['12:00:00', '12:00:00']"
  1389. size="small"
  1390. popper-class="selecteorktime_datapick_popper"
  1391. @change="showMonthWorkTime()"
  1392. >
  1393. </el-date-picker>
  1394. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1395. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1396. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1397. <!-- 222 -->
  1398. </div>
  1399. <div>
  1400. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1401. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1402. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1403. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1404. </el-input>
  1405. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1406. </div>
  1407. <div style="float: left; height:32px; padding-top:10px;">
  1408. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1409. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1410. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1411. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1412. </div>
  1413. <div style="float: right; vertical-align: middle;height:32px">
  1414. <el-link
  1415. type="primary"
  1416. @click="exportMembWorkHours()"
  1417. >{{$t('export.exportData')}}</el-link
  1418. >
  1419. </div>
  1420. </div>
  1421. <el-table ref="hasworkTbl"
  1422. :data="monthWorkDataS"
  1423. v-el-table-infinite-scroll="listScroll"
  1424. border
  1425. :height="'70vh'"
  1426. highlight-current-row
  1427. style="width: 100%"
  1428. v-loading="tbload"
  1429. :lazy="true"
  1430. :cell-style="hasworkTblCellStyle"
  1431. >
  1432. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1433. <template slot-scope="scope">
  1434. {{ scope.$index + 1 }}
  1435. </template>
  1436. </el-table-column>
  1437. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1438. <template slot-scope="scope">
  1439. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1440. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1441. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1442. <!-- {{scope.row.name}} -->
  1443. </span>
  1444. </template>
  1445. </el-table-column>
  1446. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1447. <template slot-scope="scope">
  1448. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1449. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1450. </template>
  1451. </el-table-column>
  1452. <el-table-column
  1453. min-width="60"
  1454. v-for="(item, index) in pickDateArray"
  1455. :key="index"
  1456. :label="item"
  1457. align="center"
  1458. >
  1459. <template slot="header" slot-scope="scope">
  1460. <div>{{ scope.column.label.dateStr }}</div>
  1461. <div>{{ scope.column.label.weekStr }}</div>
  1462. </template>
  1463. <template slot-scope="scope">
  1464. <div
  1465. v-if="
  1466. scope.row.worktimeList.filter(
  1467. (w) =>
  1468. w.createDate==item.date
  1469. ).length > 0 &&
  1470. scope.row.worktimeList.filter(
  1471. (w) =>w.createDate==item.date
  1472. )[0].workingTime < reportTimeType.allday
  1473. "
  1474. >
  1475. {{
  1476. scope.row.worktimeList.filter(
  1477. (w) =>w.createDate==item.date
  1478. )[0].workingTime.toFixed(1)
  1479. }}
  1480. </div>
  1481. <div
  1482. v-if="
  1483. scope.row.worktimeList.filter(
  1484. (w) =>w.createDate==item.date
  1485. ).length > 0 &&
  1486. scope.row.worktimeList.filter(
  1487. (w) =>w.createDate==item.date
  1488. )[0].workingTime > reportTimeType.allday
  1489. "
  1490. >
  1491. {{
  1492. scope.row.worktimeList.filter(
  1493. (w) =>w.createDate==item.date
  1494. )[0].workingTime.toFixed(1)
  1495. }}
  1496. </div>
  1497. <div
  1498. v-if="
  1499. scope.row.worktimeList.filter(
  1500. (w) =>w.createDate==item.date
  1501. ).length > 0 &&
  1502. scope.row.worktimeList.filter(
  1503. (w) =>w.createDate==item.date
  1504. )[0].workingTime == reportTimeType.allday
  1505. "
  1506. >
  1507. {{
  1508. scope.row.worktimeList.filter(
  1509. (w) =>w.createDate==item.date
  1510. )[0].workingTime
  1511. }}
  1512. </div>
  1513. <div
  1514. v-if="
  1515. scope.row.worktimeList.filter(
  1516. (w) =>w.createDate==item.date
  1517. ).length == 0
  1518. "
  1519. >
  1520. 0
  1521. </div>
  1522. <div
  1523. v-if="
  1524. scope.row.worktimeList.filter(
  1525. (w) =>w.createDate==item.date
  1526. ).length > 0 &&
  1527. typeof scope.row.worktimeList.filter(
  1528. (w) =>w.createDate==item.date
  1529. )[0].workingTime == 'string'
  1530. "
  1531. >
  1532. {{
  1533. scope.row.worktimeList.filter(
  1534. (w) =>w.createDate==item.date
  1535. )[0].workingTime
  1536. }}
  1537. </div>
  1538. </template>
  1539. </el-table-column>
  1540. </el-table>
  1541. <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>
  1542. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1543. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1544. <label style="font-size: 16px">员工每日已填报工时数</label>
  1545. <el-link
  1546. type="primary"
  1547. style="float: right; margin-right: 60px"
  1548. @click="exportMembWorkHours()"
  1549. >导出已填报数据</el-link
  1550. > -->
  1551. <!-- <el-button >导出</el-button> -->
  1552. <!-- </div> -->
  1553. </el-tab-pane>
  1554. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1555. <div class="selectworktime_export" style="margin-top:10px">
  1556. <div class="selectworktime_export_l">
  1557. <el-date-picker
  1558. class="selecteworktime_datapick"
  1559. v-model="WorktimeDatepickValue"
  1560. value-format="yyyy-MM-dd"
  1561. type="daterange"
  1562. align="right"
  1563. unlink-panels
  1564. :range-separator="$t('other.to')"
  1565. :start-placeholder="$t('time.startDate')"
  1566. :end-placeholder="$t('time.endDate')"
  1567. :default-time="['12:00:00', '12:00:00']"
  1568. size="small"
  1569. popper-class="selecteorktime_datapick_popper"
  1570. @change="showMonthNotWorkTime()"
  1571. >
  1572. </el-date-picker>
  1573. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1574. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1575. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1576. </div>
  1577. <div>
  1578. <div style="margin-top:10px;">
  1579. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1580. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1581. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1582. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1583. </el-input>
  1584. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1585. <el-link
  1586. type="primary"
  1587. style="float: right; vertical-align: middle;height:32px"
  1588. @click="exportMembNotWorkHours()"
  1589. >{{$t('export.exportData')}}</el-link
  1590. >
  1591. </div>
  1592. </div>
  1593. </div>
  1594. <el-table
  1595. ref="hasworkTbl2"
  1596. :data="monthNotWorkDateS"
  1597. v-el-table-infinite-scroll="notListScroll"
  1598. border
  1599. :height="'70vh'"
  1600. highlight-current-row
  1601. style="width: 100%"
  1602. v-loading="tbload"
  1603. lazy
  1604. >
  1605. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1606. <template slot-scope="scope">
  1607. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1608. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1609. </template>
  1610. </el-table-column>
  1611. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1612. <template slot-scope="scope">
  1613. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1614. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1615. </template>
  1616. </el-table-column>
  1617. <el-table-column
  1618. min-width="200"
  1619. :label="$t('weekDay.date')"
  1620. align="center"
  1621. prop="createDate"
  1622. >
  1623. </el-table-column>
  1624. <el-table-column
  1625. min-width="200"
  1626. :label="$t('state.states')"
  1627. align="center"
  1628. prop="status"
  1629. />
  1630. <el-table-column
  1631. min-width="200"
  1632. :label="$t('other.attendanceData')"
  1633. prop="cardTime"
  1634. align="center"
  1635. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1636. </el-table>
  1637. <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>
  1638. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1639. </el-tab-pane>
  1640. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1">
  1641. <div class="selectworktime_export" style="margin-top:10px">
  1642. <div class="selectworktime_export_l">
  1643. <el-date-picker
  1644. class="selecteworktime_datapick"
  1645. v-model="notfullSelectDateMonth"
  1646. value-format="yyyy-MM"
  1647. type="month"
  1648. align="right"
  1649. unlink-panels
  1650. size="small"
  1651. popper-class="selecteorktime_datapick_popper"
  1652. @change="showReportTimeLessThanCardTimeList()"
  1653. >
  1654. </el-date-picker>
  1655. </div>
  1656. <div>
  1657. <div style="margin-top:10px;">
  1658. <!-- <el-link
  1659. type="primary"
  1660. style="float: right; vertical-align: middle;height:32px"
  1661. @click="exportMembNotWorkHours()"
  1662. >{{$t('export.exportData')}}</el-link> -->
  1663. </div>
  1664. </div>
  1665. </div>
  1666. <el-table
  1667. ref="hasworkTbl4"
  1668. :data="notFullData"
  1669. border
  1670. :height="'70vh'"
  1671. highlight-current-row
  1672. style="width: 100%"
  1673. v-loading="tbload"
  1674. lazy
  1675. >
  1676. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1677. <template slot-scope="scope">
  1678. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1679. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1680. </template>
  1681. </el-table-column>
  1682. <el-table-column
  1683. min-width="200"
  1684. :label="$t('weekDay.date')"
  1685. align="center"
  1686. prop="createDate"
  1687. >
  1688. </el-table-column>
  1689. <el-table-column
  1690. min-width="200"
  1691. :label="$t('fillReportTime')"
  1692. align="center"
  1693. prop="reportTime"
  1694. />
  1695. <el-table-column
  1696. min-width="200"
  1697. :label="$t('workAttendance')"
  1698. prop="workHours"
  1699. align="center"></el-table-column>
  1700. </el-table>
  1701. </el-tab-pane>
  1702. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1703. <div class="selectworktime_export" style="margin-top:10px;">
  1704. <div class="selectworktime_export_l">
  1705. <el-date-picker
  1706. class="selecteworktime_datapick"
  1707. v-model="WorktimeDatepickValue"
  1708. value-format="yyyy-MM-dd"
  1709. type="daterange"
  1710. align="right"
  1711. unlink-panels
  1712. :range-separator="$t('other.to')"
  1713. :start-placeholder="$t('time.startDate')"
  1714. :end-placeholder="$t('time.endDate')"
  1715. :default-time="['12:00:00', '12:00:00']"
  1716. size="small"
  1717. popper-class="selecteorktime_datapick_popper"
  1718. @change="showMonthWorkTimeReminder()"
  1719. >
  1720. </el-date-picker>
  1721. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1722. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1723. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1724. </div>
  1725. <div>
  1726. <div style="margin-top:10px;">
  1727. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1728. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1729. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1730. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1731. </el-input>
  1732. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1733. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1734. </div>
  1735. </div>
  1736. <div style="float: right; vertical-align: middle;height:32px">
  1737. <el-link
  1738. type="primary"
  1739. @click="changeReminder()"
  1740. >{{ $t('bianGengTiXing') }}</el-link
  1741. >
  1742. <el-link
  1743. type="primary"
  1744. @click="exportMembWorkHoursReminder()"
  1745. >{{$t('export.exportData')}}</el-link
  1746. >
  1747. </div>
  1748. </div>
  1749. <el-table ref="hasworkTbl"
  1750. :data="monthWorkDataS"
  1751. v-el-table-infinite-scroll="listScroll"
  1752. border
  1753. :height="'70vh'"
  1754. highlight-current-row
  1755. style="width: 100%"
  1756. v-loading="tbload"
  1757. :lazy="true"
  1758. >
  1759. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1760. <template slot-scope="scope">
  1761. {{ scope.row.createDate}}
  1762. </template>
  1763. </el-table-column>
  1764. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1765. <template slot-scope="scope">
  1766. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1767. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1768. <!-- {{scope.row.name}} -->
  1769. </template>
  1770. </el-table-column>
  1771. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1772. <template slot-scope="scope">
  1773. {{scope.row.invokeValue}}
  1774. </template>
  1775. </el-table-column>
  1776. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1777. <template slot-scope="scope">
  1778. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1779. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1780. </template>
  1781. </el-table-column>
  1782. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1783. <template slot-scope="scope">
  1784. {{ scope.row.workingTime}}
  1785. </template>
  1786. </el-table-column>
  1787. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1788. <template slot-scope="scope">
  1789. {{ scope.row.cardTime}}
  1790. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1791. </template>
  1792. </el-table-column>
  1793. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1794. <template slot-scope="scope">
  1795. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1796. </template>
  1797. </el-table-column>
  1798. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1799. <template slot-scope="scope">
  1800. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1801. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1802. </template>
  1803. </el-table-column>
  1804. </el-table>
  1805. <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>
  1806. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1807. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1808. <label style="font-size: 16px">员工每日已填报工时数</label>
  1809. <el-link
  1810. type="primary"
  1811. style="float: right; margin-right: 60px"
  1812. @click="exportMembWorkHours()"
  1813. >导出已填报数据</el-link
  1814. > -->
  1815. <!-- <el-button >导出</el-button> -->
  1816. <!-- </div> -->
  1817. </el-tab-pane>
  1818. </el-tabs>
  1819. </el-dialog>
  1820. <!--驳回弹出框 -->
  1821. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1822. <div>
  1823. <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')" />
  1824. </div>
  1825. <div slot="footer" class="dialog-footer">
  1826. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1827. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1828. </div>
  1829. </el-dialog>
  1830. <!-- 通过弹出框 -->
  1831. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1832. <div>
  1833. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1834. </div>
  1835. <div slot="footer" class="dialog-footer">
  1836. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1837. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1838. </div>
  1839. </el-dialog>
  1840. <!--批量导入日报 -->
  1841. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1842. <p>1. {{$t('other.download')}}
  1843. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1844. </p>
  1845. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1846. <p style="display: flex;justify-content: center;">
  1847. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1848. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1849. </el-upload>
  1850. </p>
  1851. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1852. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1853. </div>
  1854. </el-dialog>
  1855. <!-- 工时导入记录弹窗 -->
  1856. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1857. <div style="height: 452px">
  1858. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1859. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1860. <el-table-column prop="userName" :label="$t('other.operator')">
  1861. <template slot-scope="scope">
  1862. <div>
  1863. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1864. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1865. </div>
  1866. </template>
  1867. </el-table-column>
  1868. <el-table-column prop="datel" :label="$t('other.document')">
  1869. <template slot-scope="scope">
  1870. <div>
  1871. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1872. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1873. </div>
  1874. </template>
  1875. </el-table-column>
  1876. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1877. <template slot-scope="scope">
  1878. <div>
  1879. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1880. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1881. </div>
  1882. </template>
  1883. </el-table-column>
  1884. </el-table>
  1885. <el-col :span="24" class="paginatis">
  1886. <el-pagination
  1887. @size-change="handleSizeChange"
  1888. @current-change="handleCurrentChange"
  1889. :page-sizes="[20 , 50 , 80 , 100]"
  1890. :page-size="20"
  1891. layout="total, sizes, prev, pager, next"
  1892. :total="toViewForm.total"
  1893. style="float:right;"
  1894. ></el-pagination>
  1895. </el-col>
  1896. </div>
  1897. </el-dialog>
  1898. <!--基于企业微信考勤数据的工时导入 -->
  1899. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1900. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1901. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1902. </el-step>
  1903. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1904. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1905. </el-steps>
  1906. <div v-if="active==0" style="padding:30px;height:360px;">
  1907. <div style="margin-top:50px;margin-left:280px;">
  1908. <el-date-picker
  1909. v-model="importWxParam.date" :editable="false"
  1910. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1911. :clearable="true"
  1912. :range-separator="$t('other.to')"
  1913. type="daterange"
  1914. :start-placeholder="$t('time.startDate')"
  1915. :end-placeholder="$t('time.endDate')"
  1916. @change="loadCheckInData"
  1917. ></el-date-picker>
  1918. </div>
  1919. </div>
  1920. <div v-if="active==1" style="padding:10px;">
  1921. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1922. style="width: 100%;margin-top:5px;" >
  1923. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1924. <template slot-scope="scope">
  1925. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1926. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1927. </template>
  1928. </el-table-column>
  1929. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1930. </el-table-column>
  1931. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1932. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1933. <template slot-scope="scope">
  1934. <div>
  1935. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1936. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1937. </div>
  1938. </template>
  1939. </el-table-column>
  1940. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1941. <template slot-scope="scope">
  1942. <div>
  1943. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1944. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1945. </div>
  1946. </template>
  1947. </el-table-column>
  1948. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1949. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1950. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1951. <template slot-scope="scope">
  1952. {{scope.row.workHours.toFixed(1)}}h
  1953. </template>
  1954. </el-table-column>
  1955. </el-table>
  1956. </div>
  1957. <div v-if="active==2" >
  1958. <p style="display: flex;justify-content: center;height:390px;">
  1959. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1960. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1961. </el-upload>
  1962. </p>
  1963. </div>
  1964. <div slot="title">
  1965. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1966. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1967. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1968. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  1969. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  1970. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  1971. </div>
  1972. <span slot="footer">
  1973. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1974. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1975. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  1976. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1977. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1978. </span>
  1979. </el-dialog>
  1980. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1981. <p style="display: flex;justify-content: center;height:100px;">
  1982. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1983. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1984. </el-upload>
  1985. </p>
  1986. </el-dialog>
  1987. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1988. <div>
  1989. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1990. v-model="deleteReportParam.date" :editable="false"
  1991. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1992. :clearable="true"
  1993. :range-separator="$t('other.to')"
  1994. type="daterange"
  1995. :start-placeholder="$t('time.startDate')"
  1996. :end-placeholder="$t('time.endDate')"
  1997. ></el-date-picker>
  1998. </div>
  1999. <div style="margin-top:10px;">
  2000. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2001. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  2002. <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>
  2003. </div>
  2004. <div style="margin-top:10px;">
  2005. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2006. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2007. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2008. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2009. <span v-else>{{item.name}}</span>
  2010. </el-option>
  2011. </el-select>
  2012. </div>
  2013. <span slot="footer">
  2014. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2015. </span>
  2016. </el-dialog>
  2017. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2018. <div>
  2019. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2020. v-model="deleteReportParam.date" :editable="false"
  2021. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2022. :clearable="true"
  2023. :range-separator="$t('other.to')"
  2024. type="daterange"
  2025. :start-placeholder="$t('time.startDate')"
  2026. :end-placeholder="$t('time.endDate')"
  2027. ></el-date-picker>
  2028. </div>
  2029. <div style="margin-top:15px;">
  2030. <span>{{ $t('other.selectdepartment') }}:</span>
  2031. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2032. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2033. size="small" v-if="user.userNameNeedTranslate != 1"
  2034. ></el-cascader>
  2035. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2036. </div>
  2037. <span slot="footer">
  2038. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2039. </span>
  2040. </el-dialog>
  2041. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2042. <div>
  2043. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2044. v-model="modImportTime"
  2045. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2046. :clearable="true"
  2047. type="datetime"
  2048. ></el-date-picker>
  2049. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2050. v-model="modImportUserId"
  2051. >
  2052. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2053. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2054. <span v-else>{{item.name}}</span>
  2055. </el-option>
  2056. </el-select>
  2057. </div>
  2058. <span slot="footer">
  2059. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2060. </span>
  2061. </el-dialog>
  2062. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2063. <div>
  2064. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2065. <el-date-picker
  2066. v-model="ratioYmonth" :editable="false"
  2067. format="yyyyMM" value-format="yyyyMM"
  2068. type="month"
  2069. ></el-date-picker>
  2070. </div>
  2071. <span slot="footer">
  2072. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2073. </span>
  2074. </el-dialog>
  2075. <!--工时批量代填 -->
  2076. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2077. <div>
  2078. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2079. v-model="importWxParam.date" :editable="false"
  2080. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2081. :clearable="true"
  2082. :range-separator="$t('other.to')"
  2083. type="daterange"
  2084. :start-placeholder="$t('time.startDate')"
  2085. :end-placeholder="$t('time.endDate')"
  2086. @change="loadCheckInData"
  2087. ></el-date-picker>
  2088. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2089. </div>
  2090. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2091. :key="timeStamp"
  2092. style="width: 100%;margin-top:5px;" ref="tab">
  2093. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2094. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2095. <template slot-scope="scope">
  2096. <div>
  2097. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2098. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2099. </div>
  2100. </template>
  2101. </el-table-column>
  2102. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2103. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2104. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2105. <template slot-scope="scope">
  2106. {{scope.row.workHours.toFixed(1)}}h
  2107. </template>
  2108. </el-table-column>
  2109. <!--项目名称列表 -->
  2110. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2111. <template slot-scope="scope">
  2112. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2113. </template>
  2114. </el-table-column>
  2115. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2116. <template slot-scope="scope">
  2117. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2118. </template>
  2119. </el-table-column>
  2120. </el-table>
  2121. </el-dialog>
  2122. <!--基于企业微信考勤数据的工时导入 -->
  2123. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2124. <div style="padding-bottom:10px;">
  2125. <p>{{importResultMsg}}</p>
  2126. </div>
  2127. <!-- <span slot="footer" class="dialog-footer">
  2128. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2129. </span> -->
  2130. </el-dialog>
  2131. <!-- 审核流程展示 -->
  2132. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2133. <div style="padding:20px 40px 20px 0">
  2134. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2135. <el-step title="待提交"></el-step>
  2136. <el-step title="员工提交"></el-step>
  2137. <el-step title="审核通过"></el-step>
  2138. </el-steps>
  2139. <el-divider v-if="user.companyId == 7544"></el-divider>
  2140. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2141. <el-timeline :reverse="false" style="margin-top:10px;">
  2142. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2143. <!-- {{item.msg}} -->
  2144. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2145. <span v-if="user.userNameNeedTranslate == 1">
  2146. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2147. <span>{{item.msgCon.two}}</span>
  2148. </span>
  2149. </el-timeline-item>
  2150. </el-timeline>
  2151. </div>
  2152. </el-dialog>
  2153. <!-- 威派格定制 -->
  2154. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2155. </section>
  2156. </template>
  2157. <script>
  2158. // 左右滑动
  2159. import dragMixin from "@/common/js/tensile.js";
  2160. import util from "../../common/js/util";
  2161. // 自定义select组件
  2162. import selectCat from "@/components/select.vue"
  2163. // 引入自定义级联组件
  2164. import vueCascader from "@/components/cascader.vue"
  2165. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2166. // 重庆物奇定制组件
  2167. import WeeklyCustomization from "./weeklyCustomization.vue"
  2168. // 威派格定制转移工时
  2169. import TransferWorkingHours from "./transferWorkingHours.vue"
  2170. // 新的按周填报
  2171. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2172. import { mapMutations } from 'vuex'
  2173. let _that = this
  2174. export default {
  2175. mixins: [dragMixin],
  2176. components: {
  2177. selectCat,
  2178. vueCascader,
  2179. WeeklyCustomization,
  2180. vueMultipleDept,
  2181. TransferWorkingHours,
  2182. NewWeeklyCustomization
  2183. },
  2184. data() {
  2185. return {
  2186. subFillProjectList:[],
  2187. curAuditNode: 1,
  2188. refreshingTime: false,
  2189. substitudeStep: 1,
  2190. showHidden: false,
  2191. pageIndex: 0,
  2192. hasMore: true,
  2193. exportType: 0,
  2194. exportingData: false,
  2195. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2196. jobResponseList:[],
  2197. yisibeiCompId: 3092,
  2198. yuzhongCompId: 3385,
  2199. mingyiName : '成都明夷电子科技有限公司',
  2200. // mingyiName : '明夷',
  2201. modItemDataId: null,
  2202. modImportTime: null,
  2203. modImportUserId: null,
  2204. showModImportTimeDialog: false,
  2205. showBatchSimpleApproveReport: false,
  2206. startDeleting: false,
  2207. showBatchDeleteReport: false,
  2208. deleteReportParam: {date:null, userIds:[]},
  2209. isDenying: false,
  2210. targetWeekDate: null,//填写周报中的周日期
  2211. importCardTimeVisi: false,
  2212. startRatioExporting: false,
  2213. exportUserRatio: false,
  2214. ratioYmonth:null,
  2215. hasWrittenReport: false,
  2216. today:null,
  2217. syncTimeLoading: false,
  2218. seluserText: '',
  2219. translation: '1', // 1、文字, 2、部门, 3、人员
  2220. exportLoad: false,
  2221. getPickerOptions: {
  2222. disabledDate: (time) => {
  2223. var date = new Date();
  2224. var year = date.getFullYear();
  2225. var month = date.getMonth() + 1;
  2226. if (month >= 1 && month <= 9) {
  2227. month = "0" + month;
  2228. }
  2229. var currentdate = year.toString() + month.toString();
  2230. var timeyear = time.getFullYear();
  2231. var timemonth = time.getMonth() + 1;
  2232. if (timemonth >= 1 && timemonth <= 9) {
  2233. timemonth = "0" + timemonth;
  2234. }
  2235. var timedate = timeyear.toString() + timemonth.toString();
  2236. if(this.user.timeType.fillAhead == 0){
  2237. return currentdate < timedate;
  2238. }else{
  2239. return false
  2240. }
  2241. }
  2242. },
  2243. alalal: '8.0',
  2244. timeBasecostList:null,
  2245. tbload: false,
  2246. exportTimeDialog: false,
  2247. searchKeyword: '',
  2248. monthWorkDataS: [],
  2249. monthNotWorkDateS: [],
  2250. pickDateArray:[],
  2251. WorktimeDatepickValue: [],
  2252. activeName:"first",
  2253. isLeave: 0,
  2254. submitingReport: false,
  2255. importResultMsg:null,
  2256. showImportResult:false,
  2257. importingData: false,
  2258. isDraft: 0,
  2259. timeStamp: 0,
  2260. projectColumns:[],
  2261. checkinLoading:false,
  2262. importWxParam:{date:null,},
  2263. active:0,
  2264. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2265. importWxDialog:false,
  2266. importDialog:false,
  2267. denyForm:null,
  2268. denyReasonDialog:false,
  2269. monthWorkTimeDialog: false,
  2270. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2271. isSubstitude:false,
  2272. isFill:false,
  2273. unFillList:[],
  2274. fillList:[],
  2275. fillMembList:[],
  2276. fillMembList_leave: [],
  2277. membListVisible: false,
  2278. isBatch:0,//是否是批量填报
  2279. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2280. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2281. 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')],
  2282. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2283. fillStatusList: [],
  2284. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2285. exportReportLogParam:{dateRange:[]},
  2286. exportDialog:false,
  2287. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2288. subProjectList:[],
  2289. canEdit: true,
  2290. originCanEdit: true,
  2291. 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],
  2292. selectTime:null,
  2293. reportTimeType:{},
  2294. curDate:'',
  2295. isAllSelect: false,
  2296. approveDialogVisible:false,
  2297. deptId:null,
  2298. targetUid: null,
  2299. membCount:0,
  2300. selectState:"-1",
  2301. user: JSON.parse(sessionStorage.getItem("user")),
  2302. allUsersList: [],
  2303. showAddMore:false,
  2304. allDate: [],
  2305. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2306. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2307. choseDay: 0,
  2308. tableHeight: 0,
  2309. listLoading: false,
  2310. projectList: [], //项目列表
  2311. fillProjectList: [],
  2312. reportList: [], //日报列表
  2313. reportNames:[], //批量审批列表
  2314. selCon:[], //筛选条件
  2315. selProjectList:[], //筛选后项目列表
  2316. selConShow: true,
  2317. usersList: [], // 全部人员列表
  2318. usersListId: '', // 选中的人员id
  2319. dialogVisible: false, //项目弹窗
  2320. report: '',
  2321. workForm: {
  2322. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2323. domains: [{
  2324. id: null,
  2325. projectId: "",
  2326. workingTime: "",
  2327. timeType:0,
  2328. content: "",
  2329. state: 2,
  2330. multiWorktime:0,
  2331. worktimeList:[],
  2332. degreeId: null,
  2333. auditUserList: [],
  2334. }],
  2335. showRefresh: false,
  2336. },
  2337. workRules: {
  2338. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2339. },
  2340. chooseParticipVisible: false,
  2341. logining: false,
  2342. isDisable: false,
  2343. timeType:[],
  2344. deptMembData: [
  2345. ],
  2346. //部门人员树状结构
  2347. data: [
  2348. {
  2349. id: -1,
  2350. label: this.$t('lable.allStaff'),
  2351. membCount:0
  2352. },
  2353. {
  2354. id: 0,
  2355. label: this.$t('lable.unassigned'),
  2356. }
  2357. ],
  2358. allData:{},
  2359. batchShowData:{},
  2360. option: [],
  2361. deptOptionList: [],
  2362. depData: {
  2363. id: -1,
  2364. label: this.$t('lable.allStaff'),
  2365. },
  2366. defaultProps: {
  2367. children: 'children',
  2368. label: 'label'
  2369. },
  2370. isNew: false,
  2371. selected: false,
  2372. valuet: new Date(),
  2373. domObj: null,
  2374. participator:[],
  2375. chosenMembCount:0,
  2376. jsDay: 0,
  2377. jsTime: 0,
  2378. falsss: false,
  2379. weidu: [],
  2380. weiduList: [],
  2381. yonghuUser: [],
  2382. dateAr: [],
  2383. batchSubFillDialog: false,
  2384. isSubstiS: false,
  2385. fillWeekDialogVisi: false,
  2386. fillWeekDialogVisiCustom: false,
  2387. fillWeekDialogVisiCustomTwo: false,
  2388. zhoData: [],
  2389. weekDateRange: [],
  2390. btnZho: false,
  2391. weekDataLoading: false,
  2392. changdu: 6,
  2393. tianxieDialogVisible: false,
  2394. scopess: {},
  2395. zhoBao: {
  2396. time: '',
  2397. workingTime: '',
  2398. progress: '',
  2399. con: '',
  2400. subProjectId: '',
  2401. stage: '',
  2402. subProjectList: [],
  2403. stages: [],
  2404. },
  2405. zhoBaoIdx: '',
  2406. zhoBaoName: '',
  2407. zhis: {},
  2408. dealList: [],
  2409. toViewDialogVisible: false,
  2410. toViewList: [],
  2411. toViewloading: true,
  2412. toViewForm: {
  2413. pageIndex: '1',
  2414. pageSize: '20',
  2415. total: 0,
  2416. },
  2417. toViewloadings: false,
  2418. tabPositionss: 'top',
  2419. monthTotal: 0,
  2420. monthTotalPage: 0,
  2421. monthTotalLages: 20,
  2422. monthWorkData: [],
  2423. monthNotWorkDate: [],
  2424. monthWorkDataS1: [],
  2425. monthnotTotal: 0,
  2426. monthnotTotalPage: 0,
  2427. monthnotTotalLages: 20,
  2428. monthNotWorkDateS1: [],
  2429. deptMembDataText: '',
  2430. isFlag: false,
  2431. isMore: false,
  2432. stateKey: '0',
  2433. expandDate: [],
  2434. notifySelList:[],
  2435. departmentList: [],
  2436. trandepartmentList:[],
  2437. approvalProcessDialog: false,
  2438. approvalProcessData: [],
  2439. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2440. 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')],
  2441. isWeekend: false,
  2442. canCancelInDialog: false,
  2443. approveinData: {},
  2444. approveinDialog: false,
  2445. reportCanDelete: false,
  2446. weeklyFilledTimeDialog: false,
  2447. weeklyFilledTimeList: [],
  2448. weeklyFilledTimeLoading: false,
  2449. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2450. weeklyFilledTimeCanDelete: false,
  2451. weeklyFilledTimeDate: null,
  2452. leaveAllNum: 0,
  2453. dataLoading: false,
  2454. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2455. vacationTime: {},
  2456. integrationProjectList: [],
  2457. totalReportHours: 0, // 合计的工时
  2458. workTimeForMinYi:0,
  2459. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2460. weekIndex: 1,
  2461. weekParentData: {},
  2462. deptIdForNoReport:[],
  2463. deptIdForReminder:[],
  2464. nameAearch: '', // 企业微信姓名搜索
  2465. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2466. deptMembDataLoading: false,
  2467. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2468. {
  2469. id: 4811,
  2470. // id: 10,
  2471. name: '陕西柘中建设工程有限公司'
  2472. }
  2473. ],
  2474. pushWorkTimeLogDig:false,
  2475. pushWorkTimeLogData:[],
  2476. userReportDeptList: [],
  2477. isReminder:true,
  2478. reportLogCheckDialog:false,
  2479. deptIdForHasReport:[],
  2480. transferWorkingHoursVisable: false
  2481. };
  2482. },
  2483. watch: {
  2484. deptMembDataText(val) {
  2485. this.$refs.chooseMembTree.filter(val);
  2486. }
  2487. },
  2488. filters: {
  2489. // 过滤
  2490. amounts(value) {
  2491. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2492. return 0
  2493. }
  2494. var zhi = +value + 0
  2495. return zhi.toFixed(1)
  2496. },
  2497. // zhoData
  2498. zhoData(value, arr) {
  2499. var dateArray = value.split("-");
  2500. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2501. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2502. // console.log(arr[date.getDay()])
  2503. // return "周" + "日一二三四五六".charAt(date.getDay());
  2504. return arr[date.getDay()]
  2505. },
  2506. // 过滤数字
  2507. numbers(value) {
  2508. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2509. return 0
  2510. }
  2511. return value
  2512. },
  2513. },
  2514. computed: {},
  2515. mounted() {
  2516. var now = new Date();
  2517. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2518. this.today = t;
  2519. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2520. this.exportParam.dateRange = [startStr,t];
  2521. this.exportReportLogParam.dateRange = [startStr,t];
  2522. this.getAllDate(1);
  2523. this.getReportList();
  2524. this.getProjectList();
  2525. this.getFillProjectList();
  2526. this.getTimeType();
  2527. this.getDepartment();
  2528. this.scrollFunction()
  2529. this.userssHu();
  2530. this.getFirstAndLastDay()
  2531. if(this.user.timeType.reportAuditType == 3){
  2532. this.getAllUsersList()
  2533. }
  2534. if (this.user.company.packageProject == 1) {
  2535. this.getBasecostItemList();
  2536. }
  2537. if(this.user.timeType.userWithMultiDept == 1) {
  2538. this.getDeptMembData();
  2539. }
  2540. if(this.user.timeType.lockWorktime){
  2541. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2542. }
  2543. //设置了下限
  2544. if (this.user.timeType.minReportTime) {
  2545. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2546. }
  2547. const that = this
  2548. if(this.user.userNameNeedTranslate == 1) {
  2549. that.dataLoading = that.$store.state.dataLoading
  2550. this.upDataLoading()
  2551. setTimeout(()=>{
  2552. that.dataLoading = that.$store.state.dataLoading
  2553. }, 1000)
  2554. }
  2555. if (this.user.companyId == this.yuzhongCompId) {
  2556. this.getJobResponList();
  2557. }
  2558. },
  2559. methods: {
  2560. ...mapMutations(['upDataLoading']),
  2561. // 已填工时情况表设置背景色
  2562. hasworkTblCellStyle({ columnIndex, row, column }) {
  2563. if(columnIndex > 2) {
  2564. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2565. const worktimeList = row.worktimeList || []
  2566. const times = this.reportTimeType.allday
  2567. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2568. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2569. const missReport = filterData[0] && filterData[0].missReport;
  2570. const state = filterData[0] && filterData[0].state
  2571. if (missReport) {
  2572. return "backgroundColor: red"
  2573. } else {
  2574. if (state == 0 || state == -1) {
  2575. return "backgroundColor: orange"
  2576. } else if (state == 1) {
  2577. //审核通过
  2578. return "backgroundColor: #32CD32"
  2579. } else if (state == 2) {
  2580. return "backgroundColor: red"
  2581. } else {
  2582. return "backgroundColor: #E0E0E0"
  2583. }
  2584. }
  2585. }
  2586. },
  2587. showReportTimeLessThanCardTimeList() {
  2588. this.monthTotalPage = 0,
  2589. this.tbload = true,
  2590. this.http.post(
  2591. "/report/getReportTimeLessThanCardTimeList",
  2592. {
  2593. date: this.notfullSelectDateMonth
  2594. },
  2595. (res) => {
  2596. if (res.code == "ok") {
  2597. this.tbload = false
  2598. this.notFullData = res.data;
  2599. }
  2600. },
  2601. (error) => {
  2602. this.tbload = false
  2603. this.$message({
  2604. message: error,
  2605. type: "error",
  2606. });
  2607. }
  2608. );
  2609. },
  2610. //按选择的日期范围刷新考勤
  2611. refreshWXCardTimeByRange() {
  2612. this.refreshingTime = true;
  2613. this.http.post('/wxcorp/getUserCheckInDayData',{
  2614. companyId: this.user.companyId,
  2615. userId: this.user.id,
  2616. startDate: this.importWxParam.date[0],
  2617. endDate: this.importWxParam.date[1],
  2618. },res => {
  2619. this.refreshingTime = false;
  2620. if(res.code == 'ok'){
  2621. this.loadCheckInData();
  2622. }else {
  2623. this.$message({
  2624. message: res.msg,
  2625. type: 'error'
  2626. })
  2627. }
  2628. },err => {
  2629. this.syncTimeLoading = false;
  2630. this.$message({
  2631. message: err,
  2632. type: 'error'
  2633. })
  2634. })
  2635. },
  2636. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2637. isCustomization(userInfo, permissionArray) {
  2638. const { companyId } = userInfo
  2639. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2640. return isReportPictureRequired
  2641. },
  2642. showHiddenFunction() {
  2643. this.showHidden = true;
  2644. },
  2645. // 获取如何信息选的可填写部门
  2646. getDeptMembData() {
  2647. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2648. if (res.code == "ok") {
  2649. let lists = res.data.userReportDeptList || []
  2650. const optimizedList = lists.map(item => ({
  2651. ...item,
  2652. label: item.departmentName,
  2653. value: item.departmentId,
  2654. }));
  2655. this.$set(this, 'userReportDeptList', optimizedList || []);
  2656. } else {
  2657. this.$message({
  2658. message: res.msg,
  2659. type: "error"
  2660. });
  2661. }
  2662. },error => { });
  2663. },
  2664. //任务被选中
  2665. onTaskSelected(domainItem) {
  2666. //取服务
  2667. if (domainItem.taskId) {
  2668. var that = this;
  2669. var param = {taskId:domainItem.taskId};
  2670. if (this.isSubstitude) {
  2671. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2672. param.userId = this.workForm.userId[0];
  2673. }
  2674. }
  2675. this.http.post('/task/getMyTaskService',param, res => {
  2676. if (res.code == "ok") {
  2677. // domainItem.workContentList = res.data;
  2678. that.$set(domainItem, 'sapServiceId', null);
  2679. that.$set(domainItem, 'serviceList', res.data);
  2680. } else {
  2681. this.$message({
  2682. message: res.msg,
  2683. type: "error"
  2684. });
  2685. }
  2686. },error => {
  2687. this.$message({
  2688. message: error,
  2689. type: "error"
  2690. });
  2691. }
  2692. );
  2693. } else {
  2694. //清空服务
  2695. }
  2696. },
  2697. onBatchTimeChange() {
  2698. //反向计算每日工作时长
  2699. if (this.workForm.createDate) {
  2700. let sdate = new Date(this.workForm.createDate[0]);
  2701. let edate = new Date(this.workForm.createDate[1]);
  2702. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2703. console.log('days===', days)
  2704. if (days < 0) {
  2705. return;
  2706. }
  2707. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2708. //总时长发生改变,自动按比例计算
  2709. this.workForm.domains.forEach(d=>{
  2710. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2711. });
  2712. }
  2713. },
  2714. //更新工作内容列表
  2715. updateJobContent(domainItem) {
  2716. var that = this;
  2717. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2718. if (res.code == "ok") {
  2719. // domainItem.workContentList = res.data;
  2720. that.$set(domainItem, 'extraField3', null);
  2721. that.$set(domainItem, 'workContentList', res.data);
  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. },
  2736. updateResponse(domainItem) {
  2737. var that = this;
  2738. var selectPid = domainItem.projectId;
  2739. domainItem.extraField2 = null;
  2740. domainItem.extraField3 = null;
  2741. if (selectPid && domainItem.extraField1) {
  2742. //是否非项目
  2743. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2744. console.log('==========','isPublic=='+isPublic);
  2745. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2746. console.log(filteredRespList);
  2747. domainItem.filteredRespList = filteredRespList;
  2748. }
  2749. },
  2750. getJobResponList() {
  2751. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2752. if (res.code == "ok") {
  2753. this.jobResponseList = res.data;
  2754. } else {
  2755. this.$message({
  2756. message: res.msg,
  2757. type: "error"
  2758. });
  2759. }
  2760. },error => {
  2761. this.$message({
  2762. message: error,
  2763. type: "error"
  2764. });
  2765. }
  2766. );
  2767. },
  2768. openModImportTime(row) {
  2769. this.showModImportTimeDialog = true;
  2770. this.modItemDataId = row.id;
  2771. },
  2772. delImportTime(row) {
  2773. let rowId = row.id;
  2774. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2775. confirmButtonText: this.$t('btn.determine'),
  2776. cancelButtonText: this.$t('btn.cancel'),
  2777. type: "warning"
  2778. })
  2779. .then(() => {
  2780. this.http.post('/report-import-log/delete',{
  2781. id: rowId
  2782. },res => {
  2783. if (res.code == "ok") {
  2784. this.$message({
  2785. message: this.$t('message.successfullyDeleted'),
  2786. type: "success"
  2787. });
  2788. this.getToView();
  2789. } else {
  2790. this.$message({
  2791. message: res.msg,
  2792. type: "error"
  2793. });
  2794. }
  2795. },error => {
  2796. this.$message({
  2797. message: error,
  2798. type: "error"
  2799. });
  2800. }
  2801. );
  2802. }).catch(() => {this.startDeleting = false});
  2803. },
  2804. confirmChangeModTime() {
  2805. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2806. this.$message({
  2807. message: this.$t('message.Pleaseselectatime'),
  2808. type: "error"
  2809. });
  2810. return;
  2811. }
  2812. this.http.post('/report-import-log/changeTime',{
  2813. modLogDateTime: this.modImportTime,
  2814. modImportUserId: this.modImportUserId,
  2815. id: this.modItemDataId
  2816. },res => {
  2817. if (res.code == "ok") {
  2818. this.$message({
  2819. message: this.$t('message.modifyTheSuccess'),
  2820. type: "success"
  2821. });
  2822. this.getToView();
  2823. this.showModImportTimeDialog = false;
  2824. } else {
  2825. this.$message({
  2826. message: res.msg,
  2827. type: "error"
  2828. });
  2829. }
  2830. },error => {
  2831. this.$message({
  2832. message: error,
  2833. type: "error"
  2834. });
  2835. }
  2836. );
  2837. },
  2838. confirmBatchApproveReport() {
  2839. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2840. this.$message({
  2841. message: this.$t('qingXuanZeRiQiFanWei'),
  2842. type: "error"
  2843. });
  2844. return;
  2845. }
  2846. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2847. confirmButtonText: this.$t('btn.determine'),
  2848. cancelButtonText: this.$t('btn.cancel'),
  2849. type: "warning"
  2850. })
  2851. .then(() => {
  2852. this.startDeleting = true;
  2853. let obj = {
  2854. startDate: this.deleteReportParam.date[0],
  2855. endDate: this.deleteReportParam.date[1]
  2856. }
  2857. if(this.deleteReportParam.departmentId) {
  2858. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2859. } else {
  2860. obj.departmentId = null
  2861. }
  2862. this.http.post('/report/batchApproveByDate',obj,res => {
  2863. if (res.code == "ok") {
  2864. this.$message({
  2865. message: this.$t('state.approved'),
  2866. type: "success"
  2867. });
  2868. this.getReportList();
  2869. this.getDepartment();
  2870. this.startDeleting = false;
  2871. } else {
  2872. this.$message({
  2873. message: res.msg,
  2874. type: "error"
  2875. });
  2876. }
  2877. },error => {
  2878. this.$message({
  2879. message: error,
  2880. type: "error"
  2881. });
  2882. }
  2883. );
  2884. }).catch(() => {this.startDeleting = false});
  2885. },
  2886. confirmBatchDelReport() {
  2887. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2888. this.$message({
  2889. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2890. type: "error"
  2891. });
  2892. return;
  2893. }
  2894. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2895. this.$message({
  2896. message: this.$t('qingXuanZeRiQiFanWei'),
  2897. type: "error"
  2898. });
  2899. return;
  2900. }
  2901. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2902. confirmButtonText: this.$t('btn.determine'),
  2903. cancelButtonText: this.$t('btn.cancel'),
  2904. type: "warning"
  2905. })
  2906. .then(() => {
  2907. this.startDeleting = true;
  2908. this.http.post('/report/batchDelete',{
  2909. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2910. startDate: this.deleteReportParam.date[0],
  2911. endDate: this.deleteReportParam.date[1],
  2912. deptId: this.deleteReportParam.deptId[0]
  2913. },res => {
  2914. if (res.code == "ok") {
  2915. this.$message({
  2916. message: this.$t('message.successfullyDeleted'),
  2917. type: "success"
  2918. });
  2919. this.getReportList();
  2920. this.getDepartment();
  2921. this.startDeleting = false;
  2922. } else {
  2923. this.$message({
  2924. message: res.msg,
  2925. type: "error"
  2926. });
  2927. }
  2928. },error => {
  2929. this.$message({
  2930. message: error,
  2931. type: "error"
  2932. });
  2933. }
  2934. );
  2935. }).catch(() => {this.startDeleting = false});
  2936. },
  2937. getRecentlyProject(userId) {
  2938. this.http.post('/project/nearProject',{userId: userId},res => {
  2939. if(res.code == 'ok'){
  2940. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  2941. let topObj = {
  2942. label: this.$t('zuiJinXuanZeXiangMu'),
  2943. peojectList: res.data
  2944. }
  2945. let botomObj = {
  2946. label: this.$t('other.allProject'),
  2947. peojectList: bottomList
  2948. }
  2949. //最近项目如果在fillProjectList中不存在,需要移除
  2950. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  2951. this.integrationProjectList = [topObj, botomObj]
  2952. }else {
  2953. this.$message({
  2954. message: res.msg,
  2955. type: 'error'
  2956. })
  2957. }
  2958. },err => {
  2959. this.$message({
  2960. message: err,
  2961. type: 'error'
  2962. })
  2963. })
  2964. },
  2965. handlePictureCardPreview(file, index) {
  2966. console.log(file, index)
  2967. let arr = []
  2968. let imgArr = this.workForm.domains[index].imgListUrl
  2969. for(var i in imgArr) {
  2970. arr.push(imgArr[i].url)
  2971. }
  2972. console.log(arr, '图片数据')
  2973. const $viewer = this.$viewerApi({
  2974. images: arr
  2975. });
  2976. },
  2977. // 图片上传
  2978. addImg(e, index) {
  2979. console.log(e, '数据')
  2980. let formData = new FormData()
  2981. formData.append('multipartFile', e.file)
  2982. this.http.uploadFile('/common/uploadFile', formData,
  2983. res => {
  2984. if (res.code == "ok") {
  2985. this.$message({
  2986. message: this.$t('uploadedsuccessfully'),
  2987. type: "success"
  2988. });
  2989. if(!this.workForm.domains[index].imgList) {
  2990. this.workForm.domains[index].imgList = []
  2991. this.workForm.domains[index].imgListUrl = []
  2992. }
  2993. this.workForm.domains[index].imgList.push(res.data)
  2994. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2995. } else {
  2996. this.$message({message: res.msg,type: "error"});
  2997. }
  2998. console.log(this.workForm.domains[index])
  2999. },
  3000. error => {this.$message({message: error,type: "error"});
  3001. });
  3002. },
  3003. // 删除图片
  3004. delImg(file,fileList, index) {
  3005. console.log(file, fileList)
  3006. let idx = 0
  3007. for(let i in fileList) {
  3008. if(fileList[i].uid == file.uid) {
  3009. idx = i
  3010. }
  3011. }
  3012. this.workForm.domains[index].imgList.splice(idx, 1)
  3013. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3014. console.log(this.workForm.domains[index])
  3015. },
  3016. test(){
  3017. console.log('test',this.workForm.domains);
  3018. },
  3019. getHour(s1, s2) {
  3020. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3021. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3022. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3023. var ms = s2.getTime() - s1.getTime();
  3024. if (ms < 0) return 0;
  3025. let ma = ms / 1000 / 60 / 60
  3026. return ma; //小时
  3027. },
  3028. refreshWXCardTime(workdate) {
  3029. if (!workdate) return;
  3030. this.syncTimeLoading = true;
  3031. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3032. date: workdate,
  3033. },res => {
  3034. this.syncTimeLoading = false;
  3035. if(res.code == 'ok'){
  3036. this.workForm.time = res.data.time;
  3037. }else {
  3038. this.$message({
  3039. message: res.msg,
  3040. type: 'error'
  3041. })
  3042. }
  3043. },err => {
  3044. this.syncTimeLoading = false;
  3045. this.$message({
  3046. message: err,
  3047. type: 'error'
  3048. })
  3049. })
  3050. },
  3051. refreshAttendance(workdate) {
  3052. if (!workdate) return;
  3053. this.syncTimeLoading = true;
  3054. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3055. startDate: workdate[0],
  3056. endDate: workdate[1]
  3057. },res => {
  3058. this.syncTimeLoading = false;
  3059. if(res.code == 'ok'){
  3060. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3061. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3062. this.totalReportHours = this.workTimeForMinYi;
  3063. }else {
  3064. this.$message({
  3065. message: res.msg,
  3066. type: 'error'
  3067. })
  3068. }
  3069. },err => {
  3070. this.syncTimeLoading = false;
  3071. this.$message({
  3072. message: err,
  3073. type: 'error'
  3074. })
  3075. })
  3076. },
  3077. refreshBeiSengAttendance(workdate) {
  3078. if (!workdate) return;
  3079. this.syncTimeLoading = true;
  3080. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3081. createDate: workdate
  3082. },res => {
  3083. this.syncTimeLoading = false;
  3084. if(res.code == 'ok'){
  3085. this.workForm.time = res.data;
  3086. }else {
  3087. this.$message({
  3088. message: res.msg,
  3089. type: 'error'
  3090. })
  3091. }
  3092. },err => {
  3093. this.syncTimeLoading = false;
  3094. this.$message({
  3095. message: err,
  3096. type: 'error'
  3097. })
  3098. })
  3099. },
  3100. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3101. this.weeklyFilledTimeDialog = true
  3102. this.weeklyFilledTimeLoading = true
  3103. this.weeklyFilledTimeDate = parameterDate
  3104. this.http.post('/report/getReportList',{
  3105. date: parameterDate,
  3106. userId: this.user.id
  3107. },res => {
  3108. this.weeklyFilledTimeLoading = false
  3109. if(res.code == 'ok'){
  3110. this.weeklyFilledTimeList = res.data[0].data
  3111. let candelete = true
  3112. for(let i in this.weeklyFilledTimeList){
  3113. if(this.weeklyFilledTimeList[i].state < 2){
  3114. candelete = false
  3115. }
  3116. }
  3117. this.weeklyFilledTimeCanDelete = candelete
  3118. }else {
  3119. this.$message({
  3120. message: res.msg,
  3121. type: 'error'
  3122. })
  3123. }
  3124. },err => {
  3125. this.weeklyFilledTimeLoading = false
  3126. this.$message({
  3127. message: err,
  3128. type: 'error'
  3129. })
  3130. })
  3131. },
  3132. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3133. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3134. confirmButtonText: this.$t('btn.determine'),
  3135. cancelButtonText: this.$t('btn.cancel'),
  3136. type: "warning"
  3137. })
  3138. .then(() => {
  3139. this.http.post('/report/delete',{
  3140. userId: this.user.id,
  3141. date: this.weeklyFilledTimeDate
  3142. },res => {
  3143. if (res.code == "ok") {
  3144. this.$message({
  3145. message: this.$t('message.successfullyDeleted'),
  3146. type: "success"
  3147. });
  3148. this.getWeeklyWorkTime()
  3149. this.getReportList();
  3150. this.getDepartment();
  3151. this.weeklyFilledTimeDialog = false;
  3152. } else {
  3153. this.$message({
  3154. message: res.msg,
  3155. type: "error"
  3156. });
  3157. }
  3158. },error => {
  3159. this.$message({
  3160. message: error,
  3161. type: "error"
  3162. });
  3163. }
  3164. );
  3165. }).catch(() => {});
  3166. },
  3167. getApprovalProcess(item){
  3168. // console.log('this.date',this.choseDate);
  3169. this.http.post('/report-log/get',{
  3170. creatorId: item.id,
  3171. createDate: sessionStorage.msg
  3172. },res => {
  3173. if(res.code == 'ok'){
  3174. this.approvalProcessDialog = true
  3175. if(this.user.userNameNeedTranslate == 1) {
  3176. for(var i in res.data) {
  3177. let obj = {
  3178. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3179. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3180. }
  3181. res.data[i].msgCon = obj
  3182. }
  3183. }
  3184. this.approvalProcessData = res.data
  3185. console.log(this.approvalProcessData, '数据卡看')
  3186. }else{
  3187. this.$message({
  3188. message: res.msg,
  3189. type: 'error'
  3190. })
  3191. }
  3192. },err => {
  3193. this.$message({
  3194. message: err,
  3195. type: 'error'
  3196. })
  3197. })
  3198. //获取审批节点状态
  3199. if (this.user.companyId == 7544) {
  3200. this.http.post('/report/getCurAuditNode',{
  3201. userId: item.id,
  3202. date: sessionStorage.msg
  3203. },res => {
  3204. if(res.code == 'ok'){
  3205. this.curAuditNode = res.data
  3206. }else{
  3207. }
  3208. },err => {
  3209. this.$message({
  3210. message: err,
  3211. type: 'error'
  3212. })
  3213. })
  3214. }
  3215. },
  3216. filterNode(value, data) {
  3217. if (!value) return true;
  3218. return data.label.indexOf(value) !== -1;
  3219. },
  3220. triggerCalculateOT(index) {
  3221. var str = this.workForm.domains[index].overtimeHours + ''
  3222. if(str.indexOf('.') != '-1') {
  3223. var s = str.split('.')[0]
  3224. var st = str.split('.')[1]
  3225. var sts = st.split('')
  3226. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3227. }
  3228. },
  3229. searchScreen(e){
  3230. if(e){
  3231. this.monthNotWorkDateS1 = []
  3232. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3233. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3234. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3235. }
  3236. }
  3237. if (this.monthNotWorkDateS1.length > 50) {
  3238. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3239. }else{
  3240. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3241. }
  3242. // if (this.monthNotWorkDateS1.length > 0) {
  3243. // setTimeout(() => {
  3244. // this.tableListenernot()
  3245. // }, 1000);
  3246. // }
  3247. }else{
  3248. this.monthWorkDataS1 = []
  3249. for (let i = 0; i < this.monthWorkData.length; i++) {
  3250. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3251. this.monthWorkDataS1.push(this.monthWorkData[i])
  3252. }
  3253. }
  3254. if (this.monthWorkDataS1.length > 50) {
  3255. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3256. }else{
  3257. this.monthWorkDataS = this.monthWorkDataS1
  3258. }
  3259. // if (this.monthWorkDataS1.length > 0) {
  3260. // setTimeout(() => {
  3261. // this.tableListener()
  3262. // }, 1000);
  3263. // }
  3264. }
  3265. },
  3266. addUpload(data) {
  3267. // var zhi = data.fileName.split('.')[0]
  3268. // var sss = zhi + '.xlsx'
  3269. // return
  3270. var filePath = '/upload/' + data.serverName;
  3271. const a = document.createElement('a'); // 创建a标签
  3272. a.setAttribute('download', data.fileName);// download属性
  3273. a.setAttribute('href', filePath);// href链接
  3274. a.click(); //自执行点击事件
  3275. a.remove();
  3276. },
  3277. restrictNumber(targetId) {
  3278. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3279. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3280. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3281. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3282. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3283. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3284. inpu.value = parseFloat(inpu.value);
  3285. }
  3286. },
  3287. //获取项目下的任务分组
  3288. getTaskGroups(domain, index) {
  3289. domain.groupId=null;
  3290. this.http.post('/task-group/listMyJoinGroup',{
  3291. projectId: domain.projectId,
  3292. isSubstitude: this.isSubstitude ? 1 : 0
  3293. },
  3294. res => {
  3295. if (res.code == "ok") {
  3296. this.workForm.domains[index].taskGroups = res.data;
  3297. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3298. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3299. // this.getGroupStages(domain, index);
  3300. // }
  3301. this.$forceUpdate();
  3302. }
  3303. },
  3304. error => {
  3305. this.$message({
  3306. message: error,
  3307. type: "error"
  3308. });
  3309. }
  3310. );
  3311. },
  3312. //下载填报工时占比报表
  3313. downloadProjectRatio() {
  3314. this.exportUserRatio = true;
  3315. // let now = new Date();
  3316. // let month = now.getMonth();//默认看上个月的
  3317. // let monthStr = month<10? ('0'+month): month;
  3318. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3319. const today = new Date();
  3320. const year = today.getFullYear();
  3321. const month = today.getMonth() + 1;
  3322. let lastMonthYear, lastMonth;
  3323. if (month === 1) {
  3324. lastMonthYear = year - 1;
  3325. lastMonth = 12;
  3326. } else {
  3327. lastMonthYear = year;
  3328. lastMonth = month - 1;
  3329. }
  3330. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3331. console.log('赋值 ==>', this.ratioYmonth)
  3332. },
  3333. confirmDownloadRatio() {
  3334. this.startRatioExporting = true;
  3335. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3336. ymonth: this.ratioYmonth
  3337. },
  3338. res => {
  3339. if (res.code == "ok") {
  3340. this.startRatioExporting = false;
  3341. var filePath = res.data;
  3342. const a = document.createElement('a'); // 创建a标签
  3343. var data = filePath.split("/");
  3344. a.setAttribute('download', data[data.length-1]);// download属性
  3345. a.setAttribute('href', filePath);// href链接
  3346. a.click(); //自执行点击事件
  3347. a.remove();
  3348. } else {
  3349. this.startRatioExporting = false;
  3350. this.$message({
  3351. message: res.msg,
  3352. type: "error"
  3353. });
  3354. }
  3355. },
  3356. error => {
  3357. this.checkinLoading = false;
  3358. this.$message({
  3359. message: error,
  3360. type: "error"
  3361. });
  3362. }
  3363. );
  3364. },
  3365. //下载带企业微信考勤数据的工时统计模板
  3366. downloadCheckInExcel() {
  3367. var param = {
  3368. startDate: this.importWxParam.date[0],
  3369. endDate: this.importWxParam.date[1],
  3370. };
  3371. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3372. param.onlySelfData = false;
  3373. }
  3374. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3375. res => {
  3376. if (res.code == "ok") {
  3377. var filePath = res.data;
  3378. const a = document.createElement('a'); // 创建a标签
  3379. var data = filePath.split("/");
  3380. a.setAttribute('download', data[data.length-1]);// download属性
  3381. a.setAttribute('href', filePath);// href链接
  3382. a.click(); //自执行点击事件
  3383. a.remove();
  3384. } else {
  3385. this.$message({
  3386. message: res.msg,
  3387. type: "error"
  3388. });
  3389. }
  3390. },
  3391. error => {
  3392. this.checkinLoading = false;
  3393. this.$message({
  3394. message: error,
  3395. type: "error"
  3396. });
  3397. }
  3398. );
  3399. },
  3400. pre() {
  3401. if (this.active == 0) return;
  3402. this.active--;
  3403. },
  3404. next() {
  3405. this.active++;
  3406. },
  3407. triggerTotalTime(index) {
  3408. var item = this.checkinList[index];
  3409. var total = 0.0;
  3410. for (var i=0;i<this.projectColumns.length; i++) {
  3411. var key = this.projectColumns[i];
  3412. if (item[key] != null && item[key] != '') {
  3413. total += parseFloat(item[key]);
  3414. }
  3415. }
  3416. item.totalFillTime = total;
  3417. },
  3418. //提交批量代填的数据
  3419. submitBatchSubFillData() {
  3420. var data = JSON.stringify(this.checkinList);
  3421. this.http.post('/user-corpwx-time/submitProjectTime',{
  3422. json: data,
  3423. projectColumns: JSON.stringify(this.projectColumns)
  3424. },
  3425. res => {
  3426. if (res.code == "ok") {
  3427. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3428. this.importWxDialog = false;
  3429. }
  3430. },
  3431. error => {
  3432. this.checkinLoading = false;
  3433. this.$message({
  3434. message: error,
  3435. type: "error"
  3436. });
  3437. }
  3438. );
  3439. },
  3440. loadCheckInData() {
  3441. if (this.importWxParam.date == null) {
  3442. this.checkinList = [];
  3443. return;
  3444. }
  3445. this.checkinLoading = true;
  3446. this.http.post('/user-corpwx-time/getMyData',{
  3447. startDate: this.importWxParam.date[0],
  3448. endDate: this.importWxParam.date[1],
  3449. },
  3450. res => {
  3451. if (res.code == "ok") {
  3452. this.checkinLoading = false;
  3453. this.checkinList = res.data.list;
  3454. this.projectColumns = res.data.projects;
  3455. // 自定义表格会导致表格错乱,需重新计算表格
  3456. this.$nextTick(()=>{
  3457. this.$refs.tab.doLayout()
  3458. })
  3459. }
  3460. },
  3461. error => {
  3462. this.checkinLoading = false;
  3463. this.$message({
  3464. message: error,
  3465. type: "error"
  3466. });
  3467. }
  3468. );
  3469. },
  3470. importCardTime(item) {
  3471. //首先判断文件类型
  3472. let str = item.file.name.split(".");
  3473. let format = str[str.length - 1];
  3474. if (format != "xls" && format != "xlsx") {
  3475. this.$message({
  3476. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3477. type: "error"
  3478. });
  3479. } else {
  3480. this.importingData = true;
  3481. let formData = new FormData();
  3482. formData.append("multipartFile", item.file);
  3483. formData.append("companyId", this.user.companyId);
  3484. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3485. res => {
  3486. this.$refs.uploadCardTime.clearFiles();
  3487. this.importingData = false;
  3488. if (res.code == "ok") {
  3489. //换成弹出框,以免有人等了半天回来啥也没看到
  3490. this.$message({
  3491. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3492. type: "success"
  3493. });
  3494. } else {
  3495. this.$message({
  3496. message: res.msg,
  3497. type: "error"
  3498. });
  3499. }
  3500. },
  3501. error => {
  3502. this.$refs.upload.clearFiles();
  3503. this.listLoading = false;
  3504. this.$message({
  3505. message: error,
  3506. type: "error"
  3507. });
  3508. });
  3509. }
  3510. },
  3511. batchImportWxData(item) {
  3512. //首先判断文件类型
  3513. let str = item.file.name.split(".");
  3514. let format = str[str.length - 1];
  3515. if (format != "xls" && format != "xlsx") {
  3516. this.$message({
  3517. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3518. type: "error"
  3519. });
  3520. } else {
  3521. this.importingData = true;
  3522. let formData = new FormData();
  3523. formData.append("file", item.file);
  3524. formData.append("companyId", this.user.companyId);
  3525. formData.append("withCheckIn", 1);
  3526. this.http.uploadFile('/report/importData', formData,
  3527. res => {
  3528. this.$refs.upload.clearFiles();
  3529. this.showImportResult = true;
  3530. this.importingData = false;
  3531. if (res.code == "ok") {
  3532. //换成弹出框,以免有人等了半天回来啥也没看到
  3533. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3534. this.getReportList();
  3535. this.importWxDialog = false;
  3536. } else {
  3537. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3538. }
  3539. },
  3540. error => {
  3541. this.$refs.upload.clearFiles();
  3542. this.listLoading = false;
  3543. this.$message({
  3544. message: error,
  3545. type: "error"
  3546. });
  3547. });
  3548. }
  3549. },
  3550. batchImportData(item) {
  3551. //首先判断文件类型
  3552. let str = item.file.name.split(".");
  3553. let format = str[str.length - 1];
  3554. if (format != "xls" && format != "xlsx") {
  3555. this.$message({
  3556. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3557. type: "error"
  3558. });
  3559. } else {
  3560. this.importingData = true;
  3561. let formData = new FormData();
  3562. formData.append("file", item.file);
  3563. formData.append("companyId", this.user.companyId);
  3564. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3565. this.http.uploadFile(url, formData,
  3566. res => {
  3567. this.$refs.upload.clearFiles();
  3568. this.importingData = false;
  3569. this.showImportResult = true;
  3570. if (res.code == "ok") {
  3571. //换成弹出框,以免有人等了半天回来啥也没看到
  3572. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3573. this.getReportList();
  3574. this.importWXDialog = false;
  3575. } else {
  3576. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3577. }
  3578. },
  3579. error => {
  3580. this.$refs.upload.clearFiles();
  3581. this.importingData = false;
  3582. this.$message({
  3583. message: error,
  3584. type: "error"
  3585. });
  3586. });
  3587. }
  3588. },
  3589. userssHu() {
  3590. this.http.post('/time-type/getCompanyTimeSetting',{
  3591. companyId: this.user.companyId
  3592. },
  3593. res => {
  3594. if (res.code == "ok") {
  3595. this.yonghuUser = res.data
  3596. }
  3597. },
  3598. error => {
  3599. this.$message({
  3600. message: error,
  3601. type: "error"
  3602. });
  3603. }
  3604. );
  3605. },
  3606. iptBlur(i) {
  3607. if(this.isBatch == 0) {
  3608. return
  3609. }
  3610. var reqParam = {
  3611. startDate: this.workForm.createDate[0],
  3612. endDate: this.workForm.createDate[1]
  3613. };
  3614. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3615. reqParam.userId = this.workForm.userId[0];
  3616. }
  3617. this.http.post('/report/getWorkDays',reqParam,
  3618. res => {
  3619. if (res.code == "ok") {
  3620. this.jsDay = res.data
  3621. this.chuji(i)
  3622. } else {
  3623. this.$message({
  3624. message: res.msg,
  3625. type: "error"
  3626. });
  3627. }
  3628. },
  3629. error => {
  3630. this.$message({
  3631. message: error,
  3632. type: "error"
  3633. });
  3634. }
  3635. );
  3636. //明夷硬编码获取
  3637. if (this.user.company.companyName == this.mingyiName) {
  3638. this.getWorkTimeForMinYi();
  3639. }
  3640. },
  3641. getWorkTimeForMinYi(){
  3642. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3643. startDate: this.workForm.createDate[0],
  3644. endDate: this.workForm.createDate[1]
  3645. },
  3646. res => {
  3647. if (res.code == "ok") {
  3648. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3649. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3650. this.totalReportHours = this.workTimeForMinYi;
  3651. } else {
  3652. this.$message({
  3653. message: res.msg,
  3654. type: "error"
  3655. });
  3656. this.workForm.createDate = [];
  3657. }
  3658. },
  3659. error => {
  3660. this.$message({
  3661. message: error,
  3662. type: "error"
  3663. });
  3664. }
  3665. );
  3666. },
  3667. chuji(i) {
  3668. if(i == 0) {
  3669. this.seleChn(1)
  3670. } else if(i == 1) {
  3671. this.seleChn(0)
  3672. } else if(i == 2) {
  3673. if(this.workForm.domains[0].multiWorktime > 0) {
  3674. this.iptChangs()
  3675. } else {
  3676. this.iptChang()
  3677. }
  3678. } else if(i == 3) {
  3679. this.seleChn(0)
  3680. }
  3681. },
  3682. seleChn(e,domain) {
  3683. if(e == 1) {
  3684. for(var i in this.workForm.domains) {
  3685. if(this.workForm.domains[i].timeType == 0) {
  3686. this.workForm.domains[i].workingTime = 8
  3687. } else {
  3688. this.workForm.domains[i].workingTime = 4
  3689. }
  3690. }
  3691. }
  3692. var quanbu = 0
  3693. var spl = this.workForm.domains
  3694. var zhi = ''
  3695. for(var i in spl) {
  3696. var sp = +spl[i].workingTime + 0
  3697. zhi = this.jsDay * sp
  3698. quanbu = +quanbu + zhi
  3699. }
  3700. this.jsTime = quanbu
  3701. this.totalReportHours = quanbu
  3702. let worktime = this.jsTime
  3703. // 自动计算加班时长
  3704. if(this.isBatch != 0){
  3705. worktime = this.jsTime / this.jsDay
  3706. }
  3707. if(this.user.timeType.fillOvertime && domain){
  3708. let isover = false
  3709. let alltime = 0
  3710. let allover = 0 //此处alltime同上面的worktime
  3711. for(let d in spl){
  3712. if(spl[d].isOvertime){
  3713. isover = true
  3714. allover += spl[d].overtimeHours*1
  3715. }
  3716. alltime += spl[d].workingTime*1
  3717. }
  3718. if(domain.overtimeHours){
  3719. allover = allover - domain.overtimeHours
  3720. }
  3721. if(worktime*1 > this.user.timeType.allday){
  3722. if(isover){
  3723. if(alltime > (allover + this.user.timeType.allday)){
  3724. this.$set(domain,'isOvertime',true)
  3725. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3726. }else{
  3727. this.$set(domain,'isOvertime',false)
  3728. this.$set(domain,'overtimeHours',null)
  3729. if(alltime < (allover + this.user.timeType.allday)){
  3730. let overtime = allover + this.user.timeType.allday - alltime
  3731. for(let pi in spl){
  3732. if(spl[pi].overtimeHours){
  3733. if((overtime - spl[pi].overtimeHours*1) > 0){
  3734. overtime = overtime - spl[pi].overtimeHours*1
  3735. this.$set(spl[pi],'isOvertime',false)
  3736. this.$set(spl[pi],'overtimeHours',null)
  3737. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3738. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3739. break
  3740. }else{
  3741. this.$set(spl[pi],'isOvertime',false)
  3742. this.$set(spl[pi],'overtimeHours',null)
  3743. break
  3744. }
  3745. }
  3746. }
  3747. }
  3748. }
  3749. }else{
  3750. this.$set(domain,'isOvertime',true)
  3751. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3752. }
  3753. }else{
  3754. for(let di in spl){
  3755. this.$set(spl[di],'isOvertime',false)
  3756. this.$set(spl[di],'overtimeHours',null)
  3757. }
  3758. }
  3759. }
  3760. },
  3761. iptChang() {
  3762. var sl = this.workForm.domains
  3763. let timeArr = []
  3764. for(var i in sl) {
  3765. if(sl[i].startTime && sl[i].endTime) {
  3766. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3767. }
  3768. }
  3769. this.getTimeHours(timeArr)
  3770. // for(let j in arrNum) {
  3771. // this.timeJsonStr += arrNum[j]
  3772. // if(flg) {
  3773. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3774. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3775. // }
  3776. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3777. // flg = true
  3778. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3779. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3780. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3781. // }
  3782. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3783. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3784. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3785. // }
  3786. // }
  3787. },
  3788. iptChangs() {
  3789. var sl = this.workForm.domains
  3790. let timeArr = []
  3791. for(var i in sl) {
  3792. for(var j in sl[i].worktimeList){
  3793. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3794. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3795. }
  3796. }
  3797. }
  3798. this.getTimeHours(timeArr)
  3799. },
  3800. // 调用接口或去数据
  3801. getTimeHours(arr) {
  3802. this.http.post('/report/getHoursByTimeRange',{
  3803. timeJsonStr: JSON.stringify(arr)
  3804. },res => {
  3805. if(res.code === 'ok') {
  3806. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3807. } else {
  3808. this.$message({
  3809. message: res.msg,
  3810. type: 'error'
  3811. })
  3812. }
  3813. },err => {
  3814. this.$message({
  3815. message: err,
  3816. type: 'error'
  3817. })
  3818. })
  3819. },
  3820. // 按周填报调用接口计算时间
  3821. async getWeekHoursByTimeRange(timeRange) {
  3822. const url = '/report/getHoursByTimeRange';
  3823. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3824. var that = this;
  3825. return new Promise((resolve, reject) => {
  3826. this.http.post(url, data, function(res) {
  3827. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3828. }, function(err) {
  3829. reject(err);
  3830. });
  3831. });
  3832. },
  3833. removeTimeItem(item, index) {
  3834. item.worktimeList.splice(index, 1);
  3835. this.iptChangs()
  3836. },
  3837. //添加工时
  3838. addNewWorktime(index, item) {
  3839. if(item.worktimeList == null ) {
  3840. item.worktimeList = []
  3841. }
  3842. item.worktimeList.push({});
  3843. },
  3844. //复制项目
  3845. copyProject(index) {
  3846. var leftProgress = 10;
  3847. if (this.reportTimeType.type == 3) {
  3848. //计算已经待分配工时比例
  3849. let array = this.workForm.domains;
  3850. let totalProgress = 0;
  3851. for (var i=0;i<array.length; i++) {
  3852. totalProgress += array[i].progress;
  3853. }
  3854. if (totalProgress < 100) {
  3855. leftProgress = 100 - totalProgress;
  3856. }
  3857. }
  3858. var newIndex = index+1;
  3859. var itemDomain = {
  3860. projectId: this.workForm.domains[index].projectId,
  3861. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3862. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3863. ),
  3864. content: "",
  3865. progress:leftProgress,
  3866. state:2,//2-表示待提交
  3867. };
  3868. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3869. if (this.reportTimeType.type == 0) {
  3870. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3871. var length = this.workForm.domains.length;
  3872. if (length == 2) {
  3873. this.showAddMore = false;
  3874. }
  3875. }
  3876. this.selectProject(itemDomain, newIndex);
  3877. },
  3878. pushWorkTime(reportId){
  3879. let url=''
  3880. if(this.user.timeType.syncSap == 1){
  3881. url='/report/pushProjectReportToSap'
  3882. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3883. var pushDate = this.date + day;
  3884. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3885. confirmButtonText: this.$t('btn.determine'),
  3886. cancelButtonText: this.$t('btn.cancel'),
  3887. type: 'info'
  3888. }).then(() => {
  3889. const loading = this.$loading({
  3890. lock: true,
  3891. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3892. spinner: 'el-icon-loading',
  3893. background: 'rgba(0, 0, 0, 0.7)'
  3894. });
  3895. this.http.post(url,{
  3896. pushDate: pushDate,
  3897. reportId: reportId
  3898. },res => {
  3899. loading.close();
  3900. if(res.code == 'ok'){
  3901. this.$message({
  3902. type: 'success',
  3903. message: res.data
  3904. });
  3905. }else{
  3906. this.$message({
  3907. type: 'error',
  3908. message: res.msg
  3909. })
  3910. }
  3911. },err => {
  3912. loading.close();
  3913. this.$message({
  3914. type: 'error',
  3915. message: err
  3916. })
  3917. })
  3918. }).catch(() => {
  3919. });
  3920. }else{
  3921. url='/report/pushReportDataToThird'
  3922. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3923. confirmButtonText: this.$t('btn.determine'),
  3924. cancelButtonText: this.$t('btn.cancel'),
  3925. type: 'info'
  3926. }).then(() => {
  3927. const loading = this.$loading({
  3928. lock: true,
  3929. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3930. spinner: 'el-icon-loading',
  3931. background: 'rgba(0, 0, 0, 0.7)'
  3932. });
  3933. this.http.post(url,{
  3934. yearMonth: this.date
  3935. },res => {
  3936. loading.close();
  3937. if(res.code == 'ok'){
  3938. this.$message({
  3939. type: 'success',
  3940. message: this.$t('tuiSongChengGong')
  3941. });
  3942. }else{
  3943. this.$message({
  3944. type: 'error',
  3945. message: res.msg
  3946. })
  3947. }
  3948. },err => {
  3949. loading.close();
  3950. this.$message({
  3951. type: 'error',
  3952. message: err
  3953. })
  3954. })
  3955. }).catch(() => {
  3956. });
  3957. }
  3958. },
  3959. showWorkTime(){
  3960. this.monthWorkTimeDialog = true;
  3961. this.searchKeyword = ''
  3962. this.WorktimeDatepickValue = this.istoMonth()
  3963. if(this.WorktimeDatepickValue.length == 0){
  3964. let newdate = new Date();
  3965. let nowdate = newdate.toLocaleDateString();
  3966. let getauto = this.getAutoWeekDate(nowdate)
  3967. let nowwd = [getauto[0],getauto[6]]
  3968. this.WorktimeDatepickValue = nowwd
  3969. }
  3970. this.showMonthWorkTime()
  3971. },
  3972. handleClick(t,e){
  3973. if (t.name == "second") {
  3974. this.showMonthNotWorkTime()
  3975. }else if(t.name == "first"){
  3976. this.showMonthWorkTime()
  3977. }else if(t.name == "third"){
  3978. this.showMonthWorkTimeReminder()
  3979. } else if (t.name == "fourth") {
  3980. this.showReportTimeLessThanCardTimeList();
  3981. }
  3982. },
  3983. //导出员工每日填报工时数
  3984. exportMembWorkHours() {
  3985. this.http.post(
  3986. "/report/exportUserDailyWorkTime",
  3987. {
  3988. // month: this.date,
  3989. startDate: this.WorktimeDatepickValue[0],
  3990. endDate: this.WorktimeDatepickValue[1],
  3991. },
  3992. (res) => {
  3993. if (res.code == "ok") {
  3994. let url = res.data;
  3995. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3996. }
  3997. },
  3998. (error) => {
  3999. this.$message({
  4000. message: error,
  4001. type: "error",
  4002. });
  4003. }
  4004. );
  4005. },
  4006. exportMembWorkHoursReminder() {
  4007. this.http.post(
  4008. "/report/exportUserDailyWorkTimeReminder",
  4009. {
  4010. // month: this.date,
  4011. startDate: this.WorktimeDatepickValue[0],
  4012. endDate: this.WorktimeDatepickValue[1],
  4013. },
  4014. (res) => {
  4015. if (res.code == "ok") {
  4016. let url = res.data;
  4017. this.downloadByA('工时异常表.xlsx', url);
  4018. }
  4019. },
  4020. (error) => {
  4021. this.$message({
  4022. message: error,
  4023. type: "error",
  4024. });
  4025. }
  4026. );
  4027. },
  4028. exportMembNotWorkHours() {
  4029. this.http.post(
  4030. "/report/exportNoReportUserList",
  4031. {
  4032. // month: this.date,
  4033. startDate: this.WorktimeDatepickValue[0],
  4034. endDate: this.WorktimeDatepickValue[1],
  4035. },
  4036. (res) => {
  4037. if (res.code == "ok") {
  4038. let url = res.data;
  4039. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4040. }
  4041. },
  4042. (error) => {
  4043. this.$message({
  4044. message: error,
  4045. type: "error",
  4046. });
  4047. }
  4048. );
  4049. },
  4050. downloadByA(name, url) {
  4051. const a = document.createElement("a"); // 创建a标签
  4052. a.setAttribute("download", name); // download属性
  4053. a.setAttribute("href", url); // href链接
  4054. a.click(); // 自执行点击事件
  4055. a.remove();
  4056. },
  4057. // 是否本月判断
  4058. istoMonth(){
  4059. let todate = new Date()
  4060. let tomonth = todate.getMonth() + 1
  4061. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4062. if(this.date == adate){
  4063. return []
  4064. }else{
  4065. let sedate = new Date(this.date)
  4066. let semonth = sedate.getMonth() + 1
  4067. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4068. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4069. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4070. return [sedates1, sedates2]
  4071. }
  4072. },
  4073. showMonthWorkTime() {
  4074. this.monthTotalPage = 0,
  4075. this.tbload = true
  4076. let parameter={
  4077. startDate: this.WorktimeDatepickValue[0],
  4078. endDate: this.WorktimeDatepickValue[1],
  4079. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4080. }
  4081. this.http.post(
  4082. "/report/getUserDailyWorkTime",
  4083. // "/report/getNoReportUserList",
  4084. parameter,
  4085. (res) => {
  4086. if (res.code == "ok") {
  4087. this.tbload = false;
  4088. this.pickDateArray = res.data.days.map(item => {
  4089. return {
  4090. ...item,
  4091. dateStr: item.label.split('/')[0],
  4092. weekStr: item.label.split('/')[1]
  4093. }
  4094. });
  4095. // console.log('dataarray',res.data.days);
  4096. this.monthWorkData = res.data.list;
  4097. // this.monthWorkDataS = this.monthWorkData
  4098. // this.monthWorkDataS1 = res.data.list
  4099. this.monthTotal = res.data.list.length
  4100. if (this.monthWorkData.length > 50) {
  4101. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4102. }else{
  4103. this.monthWorkDataS = this.monthWorkData
  4104. }
  4105. this.searchScreen(0)
  4106. // this.monthWorkDataS = infoList
  4107. // 判断
  4108. // if (this.monthWorkDataS1.length > 0) {
  4109. // setTimeout(() => {
  4110. // this.tableListener()
  4111. // }, 1000);
  4112. // }
  4113. this.$nextTick(function(){
  4114. this.$refs.hasworkTbl.doLayout();
  4115. });
  4116. // this.$forceUpdate()
  4117. }
  4118. },
  4119. (error) => {
  4120. this.tbload = false
  4121. this.$message({
  4122. message: error,
  4123. type: "error",
  4124. });
  4125. }
  4126. );
  4127. },
  4128. showMonthWorkTimeReminder() {
  4129. this.monthTotalPage = 0,
  4130. this.tbload = true
  4131. let parameter={}
  4132. parameter={
  4133. startDate: this.WorktimeDatepickValue[0],
  4134. endDate: this.WorktimeDatepickValue[1],
  4135. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4136. viewValue:this.isReminder?1:0
  4137. }
  4138. this.http.post(
  4139. "/report/getUserDailyWorkTimeReminder",
  4140. parameter,
  4141. (res) => {
  4142. if (res.code == "ok") {
  4143. this.tbload = false;
  4144. this.monthWorkData = res.data.list;
  4145. this.monthTotal = res.data.list.length
  4146. if (this.monthWorkData.length > 50) {
  4147. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4148. }else{
  4149. this.monthWorkDataS = this.monthWorkData
  4150. }
  4151. this.searchScreen(0)
  4152. this.$nextTick(function(){
  4153. this.$refs.hasworkTbl.doLayout();
  4154. });
  4155. }
  4156. },
  4157. (error) => {
  4158. this.tbload = false
  4159. this.$message({
  4160. message: error,
  4161. type: "error",
  4162. });
  4163. }
  4164. );
  4165. },
  4166. // tableListener(){
  4167. // let that = this;
  4168. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4169. // // 添加scroll监听事件
  4170. // dom.addEventListener("scroll", function () {
  4171. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4172. // if (scrollDistance < 2) {
  4173. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4174. // that.monthTotalPage++; //当前页数自增
  4175. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4176. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4177. // var infoList = arrList.splice(
  4178. // that.monthTotalPage * that.monthTotalLages,
  4179. // that.monthTotalLages
  4180. // );
  4181. // // 数据添加
  4182. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4183. // }
  4184. // }
  4185. // })
  4186. // },
  4187. showMonthNotWorkTime() {
  4188. this.monthTotalPage = 0,
  4189. this.tbload = true,
  4190. this.http.post(
  4191. "/report/getNoReportUserList",
  4192. {
  4193. startDate: this.WorktimeDatepickValue[0],
  4194. endDate: this.WorktimeDatepickValue[1],
  4195. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4196. },
  4197. (res) => {
  4198. if (res.code == "ok") {
  4199. this.tbload = false
  4200. this.monthNotWorkDate = res.data;
  4201. // this.monthNotWorkDateS1 = res.data
  4202. this.monthnotTotal = res.data.length
  4203. // 2222111
  4204. if (this.monthNotWorkDate.length > 50) {
  4205. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4206. } else {
  4207. this.monthNotWorkDateS = this.monthNotWorkDate
  4208. }
  4209. this.searchScreen(1)
  4210. // 判断
  4211. // if (this.monthnotworkDateS1.length > 0) {
  4212. // setTimeout(() => {
  4213. // this.tableListenernot()
  4214. // }, 1000);
  4215. // }
  4216. this.$nextTick(function(){
  4217. this.$refs.hasworkTbl2.doLayout();
  4218. });
  4219. }
  4220. },
  4221. (error) => {
  4222. this.tbload = false
  4223. this.$message({
  4224. message: error,
  4225. type: "error",
  4226. });
  4227. }
  4228. );
  4229. },
  4230. // tableListenernot(){
  4231. // let that = this;
  4232. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4233. // dom.addEventListener("scroll", function () {
  4234. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4235. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4236. // if (scrollDistance2 < 2) {
  4237. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4238. // that.monthnotTotalPage++; //当前页数自增
  4239. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4240. // var infoList = arrList.splice(
  4241. // that.monthnotTotalPage * that.monthnotTotalLages,
  4242. // that.monthnotTotalLages
  4243. // );
  4244. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4245. // }
  4246. // }
  4247. // })
  4248. // },
  4249. listScroll(){
  4250. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4251. this.isMore = true
  4252. setTimeout(()=>{
  4253. this.isMore = false
  4254. },1000)
  4255. }else {
  4256. this.isFlag = true
  4257. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4258. this.monthWorkDataS = datalist
  4259. setTimeout(()=>{
  4260. this.isFlag = false
  4261. },300)
  4262. }
  4263. },
  4264. notListScroll(){
  4265. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4266. this.isMore = true
  4267. setTimeout(()=>{
  4268. this.isMore = false
  4269. },1000)
  4270. }else {
  4271. this.isFlag = true
  4272. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4273. this.monthNotWorkDateS = datalist
  4274. // console.log('length',this.monthNotWorkDateS.length)
  4275. setTimeout(()=>{
  4276. this.isFlag = false
  4277. },300)
  4278. }
  4279. },
  4280. getFirstAndLastDay() {
  4281. // 将选定的月份转换为Date对象
  4282. var monthDate = new Date();
  4283. var year = monthDate.getFullYear();
  4284. var month = monthDate.getMonth();
  4285. // 计算起始日和结束日
  4286. var startDay = new Date(year, month, 1);
  4287. var endDay = new Date(year, month + 1, 0);
  4288. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4289. this.WorktimeDatepickValueForMonth=lastmd
  4290. },
  4291. formatDate(date) {
  4292. var year = date.getFullYear();
  4293. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4294. var day = ("0" + date.getDate()).slice(-2);
  4295. return year + "-" + month + "-" + day;
  4296. },
  4297. // 获取默认这zhou日期参数 222
  4298. getLastWeek(e){
  4299. let newdate = new Date()
  4300. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4301. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4302. if(e==1){
  4303. this.WorktimeDatepickValue = lastwd
  4304. this.showMonthWorkTime()
  4305. }else if(e==2){
  4306. this.WorktimeDatepickValue = lastwd
  4307. this.showMonthWorkTimeReminder()
  4308. }else{
  4309. this.WorktimeDatepickValue = lastwd
  4310. this.showMonthNotWorkTime()
  4311. }
  4312. },
  4313. getThisWeek(e){
  4314. let newdate = new Date();
  4315. let nowdate = newdate.toLocaleDateString();
  4316. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4317. if(e==1){
  4318. this.WorktimeDatepickValue = nowwd
  4319. this.showMonthWorkTime()
  4320. }else if(e==2){
  4321. this.WorktimeDatepickValue = nowwd
  4322. this.showMonthWorkTimeReminder()
  4323. }else{
  4324. this.WorktimeDatepickValue = nowwd
  4325. this.showMonthNotWorkTime()
  4326. }
  4327. },
  4328. getDoubleLastWeek(e){
  4329. let newdate = new Date()
  4330. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4331. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4332. if(e==1){
  4333. this.WorktimeDatepickValue = nextwd
  4334. this.showMonthWorkTime()
  4335. }else if(e==2){
  4336. this.WorktimeDatepickValue = nextwd
  4337. this.showMonthWorkTimeReminder()
  4338. }else{
  4339. this.WorktimeDatepickValue = nextwd
  4340. this.showMonthNotWorkTime()
  4341. }
  4342. },
  4343. alreadyAllDate(stime,etime){
  4344. let diffdate = new Array();
  4345. let i=0;
  4346. while(stime<=etime){
  4347. let dateArray = stime.split("-");
  4348. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4349. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4350. let stimewk = this.weekDay[date.getDay()]
  4351. 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')
  4352. 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])
  4353. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4354. let stime_ts = new Date(stime).getTime();
  4355. let next_date = stime_ts + (24*60*60*1000);
  4356. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4357. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4358. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4359. stime = next_dates_y+next_dates_m+next_dates_d;
  4360. i++;
  4361. }
  4362. return diffdate
  4363. },
  4364. getAutoWeekDate(e) {
  4365. let dateString = e;
  4366. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4367. if (dateString.match(dateStringReg)) {
  4368. let presentDate = new Date(dateString),
  4369. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4370. return Array.from(new Array(7), function (val, index) {
  4371. let formatDate = new Date(
  4372. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4373. );
  4374. return (
  4375. formatDate.getFullYear() +
  4376. "-" +
  4377. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4378. "-" +
  4379. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4380. );
  4381. });
  4382. } else {
  4383. throw new Error(
  4384. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4385. );
  4386. }
  4387. },
  4388. onProgressChange() {
  4389. this.$forceUpdate();
  4390. },
  4391. showChooseMembTree() {
  4392. this.chosenMembCount = this.participator.length;
  4393. this.chooseParticipVisible = true;
  4394. },
  4395. onTreeItemChange() {
  4396. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4397. var list = chosenList.filter(item=>item.isUser == 1);
  4398. this.chosenMembCount = list.length;
  4399. },
  4400. findUserInTree() {
  4401. if (this.filterName == '') {
  4402. this.deptMembData = this.allMembData;
  4403. } else {
  4404. var list = this.findRecursively(this.filterName, this.allMembData);
  4405. this.deptMembData = list;
  4406. }
  4407. },
  4408. findRecursively(username, list) {
  4409. var filterList = [];
  4410. for (var i=0;i<list.length; i++) {
  4411. if (list[i].isUser == 1) {
  4412. if (list[i].label.indexOf(username) >= 0) {
  4413. //匹配上了
  4414. filterList.push(list[i]);
  4415. }
  4416. } else if (list[i].children != null && list[i].children.length > 0) {
  4417. var subList = this.findRecursively(username, list[i].children);
  4418. if (subList.length > 0) {
  4419. subList.forEach(s=>filterList.push(s));
  4420. }
  4421. }
  4422. }
  4423. return filterList;
  4424. },
  4425. //确定选择参与人
  4426. chooseParticip() {
  4427. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4428. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4429. //只能选择一个人进行代填,防止任务有问题
  4430. if (this.chosenMembList.length > 1) {
  4431. this.$message({
  4432. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4433. type: "error",
  4434. });
  4435. return;
  4436. }
  4437. this.chooseParticipVisible = false;
  4438. this.workForm.userNames = '';
  4439. this.workForm.userId = [];
  4440. this.participator = [];
  4441. for (var i=0;i<this.chosenMembList.length; i++) {
  4442. this.workForm.userId.push(this.chosenMembList[i].id);
  4443. this.workForm.userNames += this.chosenMembList[i].label+',';
  4444. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4445. this.participator.push(item);
  4446. }
  4447. if (this.workForm.userNames.length > 0) {
  4448. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4449. }
  4450. if(this.user.userNameNeedTranslate == 1) {
  4451. if(this.workForm.userNames) {
  4452. this.workForm.userNames = this.workForm.userNames.split(',')
  4453. }
  4454. }
  4455. //加载该人员的可填报项目
  4456. if (this.workForm.userId.length > 0) {
  4457. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4458. }
  4459. },
  4460. notifySel(sel){
  4461. // console.log(sel);
  4462. this.notifySelList = sel
  4463. },
  4464. //微信通知人员填写
  4465. Notify(code) {
  4466. if (this.notifySelList.length == 0) return;
  4467. var ids = '';
  4468. this.notifySelList.forEach(f=>{
  4469. ids += f.id+',';
  4470. })
  4471. this.http.post('/user/pushFillReport',{
  4472. ids: ids, date: this.curDate,
  4473. code: code
  4474. },
  4475. res => {
  4476. if (res.code == "ok") {
  4477. this.$message({
  4478. message: this.$t('message.sentSuccessfully'),
  4479. type: "success"
  4480. });
  4481. }
  4482. },
  4483. error => {
  4484. this.$message({
  4485. message: error,
  4486. type: "error"
  4487. });
  4488. }
  4489. );
  4490. },
  4491. //导出人员列表
  4492. exportMemb() {
  4493. if (this.fillMembList.length == 0) return;
  4494. var ids = '';
  4495. this.fillMembList.forEach(f=>{
  4496. ids += f.id+',';
  4497. })
  4498. this.http.post('/user/exportMembList',{
  4499. ids: ids,isFill: this.isFill, date: this.curDate
  4500. },
  4501. res => {
  4502. if (res.code == "ok") {
  4503. var aTag = document.createElement('a');
  4504. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4505. aTag.href = res.data;
  4506. aTag.click();
  4507. }
  4508. },
  4509. error => {
  4510. this.$message({
  4511. message: error,
  4512. type: "error"
  4513. });
  4514. }
  4515. );
  4516. },
  4517. showMembList(fill) {
  4518. this.membListVisible = true;
  4519. if (fill == 0) {
  4520. this.fillMembList = this.unFillList;
  4521. this.isFill = false;
  4522. let leaveList = []
  4523. let unleaveList = []
  4524. for(let i in this.fillMembList){
  4525. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4526. leaveList.push(this.fillMembList[i])
  4527. }else{
  4528. unleaveList.push(this.fillMembList[i])
  4529. }
  4530. }
  4531. this.fillMembList = unleaveList
  4532. this.fillMembList_leave = leaveList
  4533. } else if(fill == 1){
  4534. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4535. this.isFill = true;
  4536. }else{
  4537. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4538. this.isFill = true;
  4539. }
  4540. },
  4541. //获取自己填写的日报状态
  4542. getReportFillStatus() {
  4543. this.http.post('/report/getReportFillStatus',{
  4544. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4545. },
  4546. res => {
  4547. if (res.code == "ok") {
  4548. this.fillStatusList = res.data;
  4549. this.allDate.forEach(d=>{
  4550. var fillInfo = null;
  4551. d.state = null;
  4552. this.fillStatusList.forEach(s=>{
  4553. var d1 = s.createDate.split('-')[2];
  4554. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4555. if (d1.indexOf('0') == 0) {
  4556. d1 = d1.substring(1,d1.length);
  4557. }
  4558. if (d1 == d2) {
  4559. d.state = s.state;
  4560. d.missReport = s.missReport;//是否漏填
  4561. d.exceedCardTime = s.exceedCardTime
  4562. }
  4563. })
  4564. })
  4565. this.$forceUpdate();
  4566. }
  4567. },
  4568. error => {
  4569. this.$message({
  4570. message: error,
  4571. type: "error"
  4572. });
  4573. }
  4574. );
  4575. },
  4576. scrollFunction () {
  4577. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4578. if (this.domObj.attachEvent) { // IE
  4579. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4580. } else if (this.domObj.addEventListener) {
  4581. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4582. }
  4583. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4584. },
  4585. mouseScroll(event) { // google 浏览器下
  4586. let detail = event.wheelDelta || event.detail
  4587. let moveForwardStep = -1
  4588. let moveBackStep = 1
  4589. let step = 0
  4590. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4591. event.preventDefault() // 阻止浏览器默认事件
  4592. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4593. },
  4594. // //左右滚动
  4595. // wheel(e){
  4596. // var a = document.getElementById("dateScroll");
  4597. // var scroll_width = 80; //滚动一下的距离
  4598. // var e = e || window.event, v;
  4599. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4600. // if(v>3||-v>3) v=-v;
  4601. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4602. // e.preventDefault(); //阻止浏览器的默认滚动
  4603. // },
  4604. showExportDialog() {
  4605. this.exportType = 0
  4606. this.exportDialog = true;
  4607. },
  4608. showExportTimeDialog() {
  4609. this.exportTimeDialog = true;
  4610. },
  4611. changeAllTime() {
  4612. //总时长发生改变,自动按比例计算
  4613. this.workForm.domains.forEach(d=>{
  4614. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4615. });
  4616. //计算jsTime
  4617. if (this.workForm.createDate) {
  4618. let sdate = new Date(this.workForm.createDate[0]);
  4619. let edate = new Date(this.workForm.createDate[1]);
  4620. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4621. console.log('days===', days)
  4622. if (days < 0) {
  4623. days = 0;
  4624. }
  4625. this.jsTime = this.reportTimeType.allday * days;
  4626. }
  4627. },
  4628. // 是否加班的单机事件
  4629. check() {
  4630. this.selected = !this.selected
  4631. this.isNew = this.selected
  4632. },
  4633. updateSubProject() {
  4634. this.$forceUpdate();
  4635. },
  4636. selectDegreeId(domain, index) {
  4637. this.http.post('/report/defaultDegree',{
  4638. projectId: domain.projectId
  4639. },
  4640. res => {
  4641. if (res.code == "ok") {
  4642. if(res.data) {
  4643. this.workForm.domains[index].degreeId = res.data.id + ''
  4644. this.$forceUpdate();
  4645. }
  4646. }
  4647. },
  4648. error => {
  4649. this.$message({
  4650. message: error,
  4651. type: "error"
  4652. });
  4653. }
  4654. );
  4655. },
  4656. //项目选中了, 加载子项目
  4657. selectProject(domain, index) {
  4658. if(!domain.projectId){
  4659. return;
  4660. }
  4661. // 默认选中上次填写的自定义维度
  4662. if(this.yonghuUser.customDegreeActive == 1) {
  4663. this.selectDegreeId(domain, index)
  4664. }
  4665. // console.log('projectId===',domain.projectId);
  4666. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4667. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4668. this.http.post('/sub-project/list',{
  4669. projectId: domain.projectId,
  4670. isReport: true
  4671. },
  4672. res => {
  4673. //清空之前选中的子项目
  4674. // this.workForm.domains[index].subProjectId = 0;
  4675. if (res.code == "ok") {
  4676. this.workForm.domains[index].subProjectList = res.data;
  4677. this.workForm.domains[index].subProjectId = null;
  4678. this.$forceUpdate();
  4679. }
  4680. },
  4681. error => {
  4682. this.$message({
  4683. message: error,
  4684. type: "error"
  4685. });
  4686. }
  4687. );
  4688. //项目相关的近期任务
  4689. if (this.user.company.packageProject == 1) {
  4690. this.getRecentTaskList(domain, index);
  4691. //获取项目相关专业
  4692. if (this.user.company.packageEngineering == 1) {
  4693. this.getProjectProfessions(domain, index);
  4694. }
  4695. //获取项目下的任务分组
  4696. this.getTaskGroups(domain, index);
  4697. }
  4698. // 获取项目相关的维度
  4699. // domain.degreeId = null
  4700. this.$set(domain,'degreeId',null)
  4701. this.$set(domain,'multiDegrIdArray',null)
  4702. this.dimension(domain, index);
  4703. //获取项目审核人
  4704. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4705. this.getProjectAuditorList(domain, index);
  4706. } else {
  4707. //按分组的负责人来审核
  4708. domain.projectAuditorId = null;
  4709. domain.projectAuditorName = null;
  4710. domain.auditUserList = null;
  4711. }
  4712. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4713. if (this.reportTimeType.type == 3) {
  4714. //新增项目时,自动计算
  4715. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4716. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4717. }
  4718. //加载昱众的工作职责
  4719. if (this.user.companyId == this.yuzhongCompId) {
  4720. this.updateResponse(domain);
  4721. }
  4722. },
  4723. getRecentTaskList(domain, index) {
  4724. //刷新任务时,清空服务
  4725. this.$set(domain, 'sapServiceId', null);
  4726. this.$set(domain, 'taskId', null);
  4727. var param = {
  4728. projectId: domain.projectId,
  4729. isSubstitude:this.isSubstitude?1:0,
  4730. };
  4731. if (domain.groupId) {
  4732. param.groupId = domain.groupId;
  4733. }
  4734. if (domain.stage) {
  4735. param.stage = domain.stage;
  4736. }
  4737. //专业版代填,获取代填员工的任务
  4738. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4739. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4740. this.$message({
  4741. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4742. type: "error"
  4743. });
  4744. return;
  4745. } else {
  4746. param.userId = this.workForm.userId[0];
  4747. }
  4748. }
  4749. this.http.post('/task/getRecentTask',param,
  4750. res => {
  4751. if (res.code == "ok") {
  4752. this.workForm.domains[index].allTaskList = res.data;
  4753. this.workForm.domains[index].taskList = res.data;
  4754. this.$forceUpdate();
  4755. }
  4756. },
  4757. error => {
  4758. this.$message({
  4759. message: error,
  4760. type: "error"
  4761. });
  4762. }
  4763. );
  4764. },
  4765. //获取项目审核人
  4766. getProjectAuditorList(domainItem, index) {
  4767. if(domainItem.projectId == '') {
  4768. return
  4769. }
  4770. domainItem.projectAuditorId = null;
  4771. domainItem.projectAuditorName = null;
  4772. this.http.post('/project-auditor/getList',{
  4773. projectId: domainItem.projectId,
  4774. },
  4775. res => {
  4776. if (res.code == "ok") {
  4777. domainItem.auditUserList = res.data;
  4778. if (res.data.length==0) {
  4779. this.$message({
  4780. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4781. type: "error"
  4782. });
  4783. } else if (res.data.length==1) {
  4784. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4785. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4786. }
  4787. this.$forceUpdate();
  4788. }
  4789. },
  4790. error => {
  4791. this.$message({
  4792. message: error,
  4793. type: "error"
  4794. });
  4795. }
  4796. );
  4797. },
  4798. // 获取维度数据
  4799. dimension(domain, index) {
  4800. if(domain.projectId == '') {
  4801. return
  4802. }
  4803. this.http.post('/project/getDegreeList',{
  4804. projectId: domain.projectId,
  4805. },
  4806. res => {
  4807. if (res.code == "ok") {
  4808. // console.log("维度数据",res.data);
  4809. this.workForm.domains[index].wuduList = res.data
  4810. // this.workForm = this.workForm
  4811. this.$forceUpdate()
  4812. }
  4813. },
  4814. error => {
  4815. this.$message({
  4816. message: error,
  4817. type: "error"
  4818. });
  4819. }
  4820. );
  4821. },
  4822. //切换任务阶段
  4823. changeStages(domain, index) {
  4824. if (domain.stage == null || domain.stage == '') {
  4825. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4826. } else {
  4827. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4828. }
  4829. this.getRecentTaskList(domain, index);
  4830. this.$forceUpdate();
  4831. },
  4832. getGroupStages(domain, index, keepStage) {
  4833. // console.log(domain);
  4834. if(!domain.groupId){
  4835. domain.projectAuditorId = ''
  4836. domain.stages = []
  4837. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4838. domain.taskId = ''
  4839. domain.sapServiceId = ''
  4840. }
  4841. if(this.user.timeType.reportAuditType >= 1){
  4842. domain.auditUserList = []
  4843. }
  4844. this.$forceUpdate();
  4845. return
  4846. }
  4847. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4848. res => {
  4849. if (res.code == "ok") {
  4850. if (!keepStage) {
  4851. domain.stage = '';
  4852. }
  4853. domain.stages = res.data;
  4854. this.getRecentTaskList(domain, index);
  4855. this.$forceUpdate();
  4856. }
  4857. },
  4858. error => {
  4859. this.$message({
  4860. message: error,
  4861. type: "error"
  4862. });
  4863. });
  4864. //检查当前的项目是否需要获取分组的负责人
  4865. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4866. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4867. res => {
  4868. if (res.code == "ok") {
  4869. domain.getProjectAuditorList = res.data;
  4870. domain.auditUserList = res.data;
  4871. if (res.data.length==1) {
  4872. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4873. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4874. } else if (res.data.length==0) {
  4875. domain.projectAuditorId = null;
  4876. domain.projectAuditorName = null;
  4877. }
  4878. this.$forceUpdate();
  4879. }
  4880. },
  4881. error => {
  4882. this.$message({
  4883. message: error,
  4884. type: "error"
  4885. });
  4886. });
  4887. }
  4888. },
  4889. getProjectProfessions(domain, index) {
  4890. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4891. res => {
  4892. if (res.code == "ok") {
  4893. this.workForm.domains[index].professionProgress = res.data;
  4894. this.$forceUpdate();
  4895. }
  4896. },
  4897. error => {
  4898. this.$message({
  4899. message: error,
  4900. type: "error"
  4901. });
  4902. });
  4903. },
  4904. //删除自己的日报
  4905. deleteReport() {
  4906. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4907. confirmButtonText: this.$t('btn.determine'),
  4908. cancelButtonText: this.$t('btn.cancel'),
  4909. type: "warning"
  4910. })
  4911. .then(() => {
  4912. this.listLoading = true;
  4913. this.http.post('/report/delete',{
  4914. userId: this.user.id,
  4915. date: this.workForm.createDate
  4916. },
  4917. res => {
  4918. this.listLoading = false;
  4919. if (res.code == "ok") {
  4920. this.$message({
  4921. message: this.$t('message.successfullyDeleted'),
  4922. type: "success"
  4923. });
  4924. this.getReportList();
  4925. this.getDepartment();
  4926. this.dialogVisible = false;
  4927. } else {
  4928. this.$message({
  4929. message: res.msg,
  4930. type: "error"
  4931. });
  4932. }
  4933. },
  4934. error => {
  4935. this.listLoading = false;
  4936. this.$message({
  4937. message: error,
  4938. type: "error"
  4939. });
  4940. }
  4941. );
  4942. })
  4943. .catch(() => {});
  4944. },
  4945. // 管理员删除日报
  4946. guanli(item) {
  4947. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4948. let param = {date: this.date + day, userId: item.id};
  4949. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4950. confirmButtonText: this.$t('btn.determine'),
  4951. cancelButtonText: this.$t('btn.cancel'),
  4952. type: "warning"
  4953. })
  4954. .then(() => {
  4955. this.listLoading = true;
  4956. this.http.post('/report/delete',param,
  4957. res => {
  4958. this.listLoading = false;
  4959. if (res.code == "ok") {
  4960. this.$message({
  4961. message: this.$t('message.successfullyDeleted'),
  4962. type: "success"
  4963. });
  4964. this.getReportList();
  4965. this.getDepartment();
  4966. this.dialogVisible = false;
  4967. } else {
  4968. this.$message({
  4969. message: res.msg,
  4970. type: "error"
  4971. });
  4972. }
  4973. },
  4974. error => {
  4975. this.listLoading = false;
  4976. this.$message({
  4977. message: error,
  4978. type: "error"
  4979. });
  4980. }
  4981. );
  4982. })
  4983. .catch(() => {});
  4984. },
  4985. selectAll() {
  4986. if (this.isAllSelect) {
  4987. var keys = [];
  4988. this.reportNames.forEach(b=>{
  4989. keys.push(b.id);
  4990. })
  4991. this.$refs.approveTree.setCheckedKeys(keys);
  4992. } else {
  4993. this.$refs.approveTree.setCheckedKeys([]);
  4994. }
  4995. },
  4996. removeEmptyNode(list) {
  4997. for (var i=0;i<list.length;i++) {
  4998. var cnt = 0;
  4999. if (list[i].membCount == 0) {
  5000. list.splice(i, 1);
  5001. i--;
  5002. } else if (list[i].children != null) {
  5003. this.removeEmptyNode(list[i].children);
  5004. }
  5005. }
  5006. },
  5007. calculateMembCount(list) {
  5008. for (var i in list) {
  5009. var cnt = 0;
  5010. if (list[i].children != null) {
  5011. this.calculateMembCount(list[i].children);
  5012. for (var m in list[i].children) {
  5013. cnt += list[i].children[m].membCount;
  5014. }
  5015. }
  5016. if (list[i].isUser == 1) {
  5017. cnt++;
  5018. this.membCount++;
  5019. }
  5020. list[i].membCount = cnt;
  5021. }
  5022. },
  5023. stateChange() {
  5024. // console.log(this.allData,'alldate');
  5025. this.membCount = 0;
  5026. if (this.selectState == -1) {
  5027. //全部状态
  5028. this.data = this.allData;
  5029. } else {
  5030. //未填报
  5031. this.seluserText = ''
  5032. var newData = JSON.parse(JSON.stringify(this.allData));
  5033. this.filterState(this.selectState, newData);
  5034. this.data = newData;
  5035. }
  5036. this.calculateMembCount(this.data);
  5037. this.data[0].membCount = this.membCount;//总人数
  5038. },
  5039. //按状态过滤部门人员
  5040. filterState(state, list) {
  5041. for (var i =0;i<list.length; i++) {
  5042. var obj = list[i];
  5043. if (obj.isUser == 1) {
  5044. var match = false;
  5045. if (state == -2) {
  5046. if (obj.state == null) {
  5047. match = true;
  5048. }
  5049. } else {
  5050. if (obj.state == state) {
  5051. match = true;
  5052. }
  5053. }
  5054. if (!match) {
  5055. list.splice(i, 1);
  5056. i--;
  5057. } else {
  5058. }
  5059. } else {
  5060. if (obj.children != null) {
  5061. this.filterState(state, obj.children);
  5062. }
  5063. }
  5064. }
  5065. },
  5066. //a按名称过滤部门人员
  5067. async seluserforText(){
  5068. const { userNameNeedTranslate } = this.user
  5069. this.membCount = 0;
  5070. var newData = JSON.parse(JSON.stringify(this.allData));
  5071. let textList = [this.seluserText]
  5072. if(userNameNeedTranslate == 1) {
  5073. this.dataLoading = true
  5074. let res = await this.postData('/user/getEmployeeList', {
  5075. keyword: this.seluserText,
  5076. cursor: '',
  5077. departmentId: -1,
  5078. pageIndex: 1,
  5079. pageSize: 1000
  5080. })
  5081. textList = res.data.records.map(item => item.name)
  5082. this.dataLoading = false
  5083. }
  5084. // return
  5085. console.log(textList, '<=== textList')
  5086. this.seluserforTextin(this.seluserText, newData, textList)
  5087. console.log(newData, 'Data')
  5088. this.data = newData;
  5089. this.calculateMembCount(this.data);
  5090. this.data[0].membCount = this.membCount;//总人数
  5091. },
  5092. seluserforTextin(text, list, textList = []){
  5093. for (var i =0;i<list.length; i++) {
  5094. var obj = list[i];
  5095. if (obj.isUser == 1) {
  5096. var match = false;
  5097. // if (obj.label.indexOf(text) != -1) {
  5098. // match = true
  5099. // }
  5100. if(textList.some(item => item.includes(obj.label))) {
  5101. match = true
  5102. }
  5103. if (!match) {
  5104. list.splice(i, 1);
  5105. i--;
  5106. } else {
  5107. }
  5108. } else {
  5109. if (obj.children != null) {
  5110. this.seluserforTextin(text, obj.children, textList);
  5111. }
  5112. }
  5113. }
  5114. },
  5115. // 当节点发生变化时
  5116. nodeChangeExpand(data) {
  5117. // 保存当前展开的节点
  5118. let flag = false
  5119. this.nodeModelData.some(item => {
  5120. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5121. flag = true
  5122. return true
  5123. }
  5124. })
  5125. if (!flag) { // 不存在则存到数组里
  5126. this.nodeModelData.push(data.id)
  5127. }
  5128. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5129. },
  5130. nodeChangeCollapse(data) {
  5131. console.log(this.nodeModelData)
  5132. this.nodeModelData.some((item, i) => {
  5133. if (item === data.id) {
  5134. this.nodeModelData.length = i
  5135. }
  5136. })
  5137. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5138. },
  5139. // 部门列表点击
  5140. handleNodeClick(data) {
  5141. // this.dealList = data
  5142. this.theValues(data.id, this.allData)
  5143. // this.depData = data;
  5144. var list = [];
  5145. if (data.id == -1) {
  5146. this.deptId = null;
  5147. this.targetUid = null;
  5148. list = this.data;
  5149. } else if (data.isUser == 1) {
  5150. this.deptId = null;
  5151. this.targetUid = data.id;
  5152. } else {
  5153. this.deptId = data.id;
  5154. this.targetUid = null;
  5155. list.push(data);
  5156. }
  5157. this.getReportList();
  5158. if (list.length > 0) {
  5159. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5160. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5161. }
  5162. },
  5163. exportPushLog(){
  5164. this.http.post('/sap-sync-log/export',{},
  5165. res => {
  5166. if (res.code == "ok") {
  5167. var filePath = res.data;
  5168. var fName = '推送日志.xlsx'
  5169. const a = document.createElement('a'); // 创建a标签
  5170. a.setAttribute('download', fName);// download属性
  5171. a.setAttribute('href', filePath);// href链接
  5172. a.click(); //自执行点击事件
  5173. a.remove();
  5174. } else {
  5175. this.$message({
  5176. message: res.msg,
  5177. type: "error"
  5178. });
  5179. }
  5180. },
  5181. error => {
  5182. this.$message({
  5183. message: error,
  5184. type: "error"
  5185. });
  5186. });
  5187. },
  5188. theValues(id, item) {
  5189. for(var i in item) {
  5190. if(item[i].id == id) {
  5191. this.depData = item[i]
  5192. if(id == '-1') {
  5193. this.translation = '1'
  5194. } else {
  5195. if(item[i].children) {
  5196. this.translation = '2'
  5197. } else {
  5198. this.translation = '3'
  5199. }
  5200. }
  5201. return
  5202. } else {
  5203. if(item[i].children) {
  5204. this.theValues(id, item[i].children)
  5205. }
  5206. }
  5207. }
  5208. },
  5209. //获取可以选择的代填的人员列表
  5210. getSubstitudeUserDeptList() {
  5211. if (this.deptMembData.length == 0) {
  5212. this.http.post("/department/listMyMembs", {},
  5213. res => {
  5214. if (res.code == "ok") {
  5215. let noAllData = JSON.parse(JSON.stringify(res.data));
  5216. if (noAllData.length > 0) {
  5217. // if (noAllData[0].label == '全部人员') {
  5218. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5219. noAllData.splice(0,1);
  5220. }
  5221. }
  5222. this.setUserToDept(noAllData);
  5223. this.deptMembData = noAllData;
  5224. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5225. console.log(this.deptMembData, '代填人员数据')
  5226. } else {
  5227. this.$message({
  5228. message: res.msg,
  5229. type: "error"
  5230. });
  5231. }
  5232. },
  5233. error => {
  5234. this.$message({
  5235. message: error,
  5236. type: "error"
  5237. });
  5238. });
  5239. }
  5240. },
  5241. // 获取部门列表
  5242. getDepartmentForApprove() {
  5243. this.http.post( this.port.manage.depList, {},
  5244. res => {
  5245. if (res.code == "ok") {
  5246. var list1 = JSON.parse(JSON.stringify(res.data));
  5247. this.deptOptionList = this.changeArr(list1);
  5248. console.log(this.deptOptionList, '部门')
  5249. } else {
  5250. this.$message({
  5251. message: res.msg,
  5252. type: "error"
  5253. });
  5254. }
  5255. },
  5256. error => {
  5257. this.$message({
  5258. message: error,
  5259. type: "error"
  5260. });
  5261. });
  5262. },
  5263. // 获取部门列表
  5264. getDepartment() {
  5265. //如果没有权限,就不需要获取
  5266. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5267. return;
  5268. }
  5269. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5270. var param = {date:this.date + day};
  5271. this.http.post("/report/getMembList", param,
  5272. res => {
  5273. if (res.code == "ok") {
  5274. if(res.data.length == 0){
  5275. return
  5276. }
  5277. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5278. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5279. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5280. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5281. // if (this.user.role > 0) {
  5282. // }
  5283. list.splice(0,0,{
  5284. id: -1,
  5285. label: this.$t('lable.allStaff'),
  5286. })
  5287. this.membCount = 0;
  5288. //设置员工到部门下面
  5289. this.setUserToDept(list);
  5290. this.data = list;
  5291. // console.log('data',this.data);
  5292. this.expandDate = [this.data[1].id]
  5293. this.allData = list;
  5294. // if (noAllData.length > 0) {
  5295. // if (noAllData[0].label == '全部人员') {
  5296. // noAllData.splice(0,1);
  5297. // }
  5298. // }
  5299. // this.setUserToDept(noAllData);
  5300. // this.deptMembData = noAllData;
  5301. this.option = this.changeArr(list1);
  5302. list[0].membCount = this.membCount;
  5303. if (this.depData.id == -1) {
  5304. this.depData.membCount = this.membCount;
  5305. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5306. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5307. } else {
  5308. if (this.depData.isUser == null) {
  5309. var dep = this.findTargetDept(this.data, this.depData.id);
  5310. var membDeptList = [];
  5311. membDeptList.push(dep);
  5312. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5313. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5314. }
  5315. }
  5316. if (this.depData.isUser == null) {
  5317. if (this.isFill) {
  5318. this.fillMembList = this.fillList;
  5319. } else {
  5320. this.fillMembList = this.unFillList;
  5321. }
  5322. }
  5323. this.leaveAllNum = 0
  5324. for(let i in this.unFillList){
  5325. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5326. this.leaveAllNum += 1
  5327. }
  5328. }
  5329. this.stateChange()
  5330. } else {
  5331. this.$message({
  5332. message: res.msg,
  5333. type: "error"
  5334. });
  5335. }
  5336. },
  5337. error => {
  5338. this.$message({
  5339. message: error,
  5340. type: "error"
  5341. });
  5342. });
  5343. this.getReportFillStatus();
  5344. },
  5345. findTargetDept(list, deptId) {
  5346. var t = null;
  5347. for (var i=0;i<list.length; i++) {
  5348. if (list[i].isUser == null && list[i].id == deptId) {
  5349. t = list[i];
  5350. break;
  5351. }
  5352. }
  5353. if (t == null) {
  5354. for (var i=0;i<list.length; i++) {
  5355. if (list[i].children != null && list[i].children.length > 0) {
  5356. t = this.findTargetDept(list[i].children, deptId);
  5357. if (t != null) {
  5358. break;
  5359. }
  5360. }
  5361. }
  5362. }
  5363. return t;
  5364. },
  5365. getUserMembListFromDeptList(list, isFill) {
  5366. var membList = [];
  5367. for (var i in list) {
  5368. var deptName = list[i].label;
  5369. if (list[i].userList != null) {
  5370. list[i].userList.forEach(element => {
  5371. if (isFill == 0) {
  5372. //获取未填的
  5373. if (element.state == null) {
  5374. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5375. membList.push(obj);
  5376. }
  5377. } else {
  5378. if (element.state != null) {
  5379. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5380. membList.push(obj);
  5381. }
  5382. }
  5383. });
  5384. }
  5385. if (list[i].children != null) {
  5386. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5387. }
  5388. }
  5389. return membList;
  5390. },
  5391. setUserToDept(list) {
  5392. for (var i in list) {
  5393. var cnt = 0;
  5394. if (list[i].children != null) {
  5395. this.setUserToDept(list[i].children);
  5396. for (var m in list[i].children) {
  5397. cnt += list[i].children[m].membCount;
  5398. }
  5399. }
  5400. if (list[i].userList != null) {
  5401. if (list[i].children == null) {
  5402. list[i].children = [];
  5403. }
  5404. list[i].userList.forEach(element => {
  5405. var obj = {
  5406. id: element.id,
  5407. label:element.name,
  5408. state:element.state,
  5409. parentId:element.departmentId,
  5410. isUser:1,
  5411. workingTime: element.workingTime,
  5412. leaveDays: element.leaveDays,
  5413. leaveTimes: element.leaveTimes
  5414. };
  5415. list[i].children.push(obj);
  5416. this.membCount++;
  5417. cnt++;
  5418. });
  5419. }
  5420. list[i].membCount = cnt;
  5421. }
  5422. },
  5423. // 修改数组
  5424. changeArr(arr) {
  5425. for (var i = 0; i < arr.length; i++) {
  5426. if(arr[i].id != -1 && arr[i].id != 0) {
  5427. if (arr[i].children != null && arr[i].children.length>0) {
  5428. arr[i].children = this.changeArr(arr[i].children);
  5429. }
  5430. arr[i].id && (arr[i].value = arr[i].id);
  5431. delete arr[i].id;
  5432. }
  5433. }
  5434. for(var i in arr) {
  5435. if(arr[i].id == -1 || arr[i].id == 0) {
  5436. arr.splice(i,1)
  5437. }
  5438. }
  5439. return arr;
  5440. },
  5441. //时间段范围设置改动,监听
  5442. onTimeTypeChange(timeType) {
  5443. this.seleChn(1)
  5444. this.showAddMore = true;
  5445. for(var i in this.workForm.domains) {
  5446. if (this.workForm.domains[i].timeType == 0) {
  5447. this.showAddMore = false;
  5448. break;
  5449. }
  5450. }
  5451. if (this.showAddMore) {
  5452. //检测数量
  5453. if (this.workForm.domains.length == 2) {
  5454. this.showAddMore = false;
  5455. } else {
  5456. this.showAddMore = true;
  5457. }
  5458. }
  5459. },
  5460. getTimeType() {
  5461. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5462. res => {
  5463. if (res.code == "ok") {
  5464. var t = res.data;
  5465. this.reportTimeType = t;
  5466. if (this.reportTimeType.type > 0) {
  5467. this.showAddMore = true;
  5468. }
  5469. //转化时间格式
  5470. if (t.allday != null) {
  5471. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5472. }
  5473. if (t.am != null) {
  5474. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5475. }
  5476. if (t.pm != null) {
  5477. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5478. }
  5479. let arr = []
  5480. for(var i in res.data.excludeTimeList) {
  5481. let obj = {
  5482. s: res.data.excludeTimeList[i].startTime,
  5483. e: res.data.excludeTimeList[i].endTime,
  5484. }
  5485. arr.push(obj)
  5486. }
  5487. this.vacationTime = arr
  5488. } else {
  5489. this.$message({
  5490. message: res.msg,
  5491. type: "error"
  5492. });
  5493. }
  5494. },
  5495. error => {
  5496. this.listLoading = false;
  5497. this.$message({
  5498. message: error,
  5499. type: "error"
  5500. });
  5501. });
  5502. },
  5503. // 改变月份 -------
  5504. changeMonthOut() {
  5505. this.getAllDate();
  5506. this.getReportList();
  5507. this.getDepartment();
  5508. },
  5509. // 选择日期
  5510. choseDate(i, item) {
  5511. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5512. return
  5513. }
  5514. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5515. this.choseDay = i;
  5516. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5517. sessionStorage.msg = this.date + day,
  5518. this.getReportList();
  5519. this.getDepartment();
  5520. this.curDate = item.date;
  5521. },
  5522. canClick(i, item){
  5523. let nowDate = new Date()
  5524. let nowDateYear = nowDate.getFullYear()
  5525. let itemYear = parseInt(this.date.split('-')[0])
  5526. let nowDateMonth = nowDate.getMonth() + 1
  5527. let itemMonth = parseInt(this.date.split('-')[1])
  5528. let nowDateDay = nowDate.getDate()
  5529. let itemDay = parseInt(item.showDate.split('.')[1])
  5530. if(nowDateYear < itemYear){
  5531. return false
  5532. }else if(nowDateYear == itemYear){
  5533. if(nowDateMonth < itemMonth){
  5534. return false
  5535. }else if(nowDateMonth == itemMonth){
  5536. if(nowDateDay < itemDay){
  5537. return false
  5538. }
  5539. }
  5540. }
  5541. },
  5542. // 获取日期列表
  5543. getAllDate(e) {
  5544. var dayArry = [];
  5545. var day = this.getCountDays();
  5546. let curMonthDay = null;
  5547. for (var k = 1; k <= day; k++) {
  5548. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5549. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5550. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5551. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5552. if(sessionStorage.msg) {
  5553. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5554. this.choseDay = k - 1;
  5555. curMonthDay = str;
  5556. }
  5557. } else {
  5558. if (new Date().getDate() == k) {
  5559. this.choseDay = k - 1;
  5560. }
  5561. }
  5562. } else {
  5563. this.choseDay = 0;
  5564. }
  5565. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5566. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5567. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5568. }
  5569. this.allDate = dayArry;
  5570. //不能超过最大日期
  5571. if (this.choseDay > day-1) {
  5572. this.choseDay = day-1;
  5573. }
  5574. if(sessionStorage.from != 1){
  5575. let nowmonth = new Date().getMonth() + 1
  5576. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5577. let nowdate = new Date().getDate()
  5578. if(nowd == this.date){
  5579. if(e && sessionStorage.msg){
  5580. }else{
  5581. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5582. }
  5583. let nowday = new Date(sessionStorage.msg).getDate()
  5584. this.choseDay = nowday - 1
  5585. let monthdate = new Date(sessionStorage.msg)
  5586. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5587. }else{
  5588. if(e && sessionStorage.msg){
  5589. }else{
  5590. sessionStorage.msg = this.date + '-01'
  5591. }
  5592. let monthdate = new Date(sessionStorage.msg)
  5593. this.choseDay = monthdate.getDate() - 1
  5594. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5595. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5596. }
  5597. }else{
  5598. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5599. }
  5600. //从消息点击跳转过来的,直接加载指定日期
  5601. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5602. this.curDate = sessionStorage.msg;
  5603. sessionStorage.from = 0;
  5604. } else {
  5605. // if (curMonthDay != null) {
  5606. // // this.curDate = curMonthDay;
  5607. // let d = new Date(sessionStorage.msg)
  5608. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5609. // } else {
  5610. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5611. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5612. // }
  5613. }
  5614. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5615. // if(!sessionStorage.msg){
  5616. // let msgday = this.choseDay + 1
  5617. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5618. // }
  5619. this.getReportFillStatus();
  5620. },
  5621. getCountDays() {
  5622. var newstr = this.date.replace(/-/g, "/");
  5623. var curDate = new Date(newstr+'/01');
  5624. var curMonth = curDate.getMonth();
  5625. curDate.setMonth(curMonth + 1);
  5626. curDate.setDate(0);
  5627. return curDate.getDate();
  5628. },
  5629. reqMore() {
  5630. if (this.hasMore) {
  5631. this.pageIndex++;
  5632. this.requestHttpReports();
  5633. }
  5634. },
  5635. //加载日报数据
  5636. requestHttpReports() {
  5637. //请求数据
  5638. this.listLoading = true;
  5639. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5640. let param = {date: this.date + day};
  5641. if (this.deptId) {
  5642. param.deptId = this.deptId;
  5643. }
  5644. if (this.targetUid) {
  5645. param.userId = this.targetUid;
  5646. }
  5647. //传页码
  5648. if (this.hasMore) {
  5649. param.pageIndex = this.pageIndex;
  5650. }
  5651. this.http.post( this.port.report.list, param,
  5652. res => {
  5653. this.listLoading = false;
  5654. if (res.code == "ok") {
  5655. //扩增
  5656. if (res.data.data.length > 0) {
  5657. this.reportList = this.reportList.concat(res.data.data);
  5658. } else if (this.pageIndex > 1){
  5659. this.$message({
  5660. message: this.$t('meiYouGengDuoShuJuLe'),
  5661. type: "info"
  5662. });
  5663. }
  5664. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5665. if(document.querySelector("#day"+this.choseDay)){
  5666. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5667. }
  5668. } else {
  5669. this.$message({
  5670. message: res.msg,
  5671. type: "error"
  5672. });
  5673. }
  5674. },
  5675. error => {
  5676. this.listLoading = false;
  5677. this.$message({
  5678. message: error,
  5679. type: "error"
  5680. });
  5681. });
  5682. },
  5683. //获取日报列表
  5684. getReportList() {
  5685. //初始化,重置数据
  5686. this.pageIndex = 0;
  5687. this.hasMore = true;
  5688. this.reportList = [];
  5689. this.requestHttpReports();
  5690. },
  5691. //刷新日报状态,用于审核后更新
  5692. refreshReportData(reportId) {
  5693. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5694. res => {
  5695. if (res.code == "ok") {
  5696. for (var m=0;m<this.reportList.length; m++) {
  5697. var d = this.reportList[m].data;
  5698. var find = d.filter(r=>r.id == reportId);
  5699. if (find.length > 0) {
  5700. find[0].state = res.data.state;
  5701. if (find[0].state == 2) {//被驳回,要可以编辑
  5702. this.reportList[m].state = 2;
  5703. }
  5704. find[0].isDeptAudit = res.data.isDeptAudit;
  5705. find[0].departmentAuditState = res.data.departmentAuditState;
  5706. find[0].projectAuditorName = res.data.projectAuditorName;
  5707. find[0].projectAuditorId = res.data.projectAuditorId;
  5708. find[0].projectAuditState = res.data.projectAuditState;
  5709. find[0].rejectUserid = res.data.rejectUserid;
  5710. find[0].rejectUsername = res.data.rejectUsername;
  5711. find[0].rejectReason = res.data.rejectReason;
  5712. this.$forceUpdate();
  5713. break;
  5714. }
  5715. }
  5716. } else {
  5717. this.$message({
  5718. message: res.msg,
  5719. type: "error"
  5720. });
  5721. }
  5722. },
  5723. error => {
  5724. this.listLoading = false;
  5725. this.$message({
  5726. message: error,
  5727. type: "error"
  5728. });
  5729. });
  5730. },
  5731. //导出员工工时统计
  5732. exportUserTime() {
  5733. this.listLoading = true;
  5734. var param = {};
  5735. if (this.exportParam.dateRange != null) {
  5736. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5737. }
  5738. this.http.post('/department/exportDeptStatistic', param,
  5739. res => {
  5740. this.listLoading = false;
  5741. if (res.code == "ok") {
  5742. location.href = res.data;
  5743. this.exportTimeDialog = false;
  5744. } else {
  5745. this.$message({
  5746. message: res.msg,
  5747. type: "error"
  5748. });
  5749. }
  5750. },
  5751. error => {
  5752. this.listLoading = false;
  5753. this.$message({
  5754. message: error,
  5755. type: "error"
  5756. });
  5757. });
  5758. },
  5759. //导出日报
  5760. exportReport() {
  5761. this.exportingData = true;
  5762. var param = {};
  5763. if (this.exportParam.dateRange != null) {
  5764. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5765. }
  5766. if (this.exportParam.projectId != null) {
  5767. param.projectId = this.exportParam.projectId;
  5768. }
  5769. if (this.exportParam.departmentId != null) {
  5770. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5771. param.departmentIds = this.exportParam.departmentId.join(',')
  5772. }
  5773. param.stateKey = this.stateKey
  5774. // param.departmentId = this.user.departmentId
  5775. console.log(param, '《=== 导出传的参数');
  5776. console.log('开始调用exportReport接口');
  5777. this.http.post(this.port.report.export, param,
  5778. res => {
  5779. this.exportingData = false;
  5780. if (res.code == "ok") {
  5781. var filePath = res.data;
  5782. const a = document.createElement('a'); // 创建a标签
  5783. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5784. a.setAttribute('href', filePath);// href链接
  5785. a.click(); //自执行点击事件
  5786. a.remove();
  5787. this.exportDialog = false;
  5788. } else {
  5789. this.$message({
  5790. message: res.msg,
  5791. type: "error"
  5792. });
  5793. }
  5794. },
  5795. error => {
  5796. this.exportingData = false;
  5797. this.$message({
  5798. message: error,
  5799. type: "error"
  5800. });
  5801. });
  5802. },
  5803. //导出日报审核记录
  5804. exportReportLog() {
  5805. this.exportingData = true;
  5806. var param = {};
  5807. if (this.exportReportLogParam.dateRange != null) {
  5808. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5809. }
  5810. this.http.post('/report-log/exportReportLog', param,
  5811. res => {
  5812. this.exportingData = false;
  5813. if (res.code == "ok") {
  5814. var filePath = res.data;
  5815. const a = document.createElement('a'); // 创建a标签
  5816. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5817. a.setAttribute('href', filePath);// href链接
  5818. a.click(); //自执行点击事件
  5819. a.remove();
  5820. this.exportDialog = false;
  5821. } else {
  5822. this.$message({
  5823. message: res.msg,
  5824. type: "error"
  5825. });
  5826. }
  5827. },
  5828. error => {
  5829. this.exportingData = false;
  5830. this.$message({
  5831. message: error,
  5832. type: "error"
  5833. });
  5834. });
  5835. },
  5836. restUserCardTime(item){
  5837. let param={}
  5838. param.userId=item.userId
  5839. param.createDate=item.createDate
  5840. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5841. res => {
  5842. if (res.code == "ok") {
  5843. this.showMonthWorkTimeReminder()
  5844. } else {
  5845. this.$message({
  5846. message: res.msg,
  5847. type: "error"
  5848. });
  5849. }
  5850. },
  5851. error => {
  5852. this.$message({
  5853. message: error,
  5854. type: "error"
  5855. });
  5856. });
  5857. },
  5858. importReportLog(item){
  5859. //首先判断文件类型
  5860. let str = item.file.name.split(".");
  5861. let format = str[str.length - 1];
  5862. if (format != "xls" && format != "xlsx") {
  5863. this.$message({
  5864. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5865. type: "error"
  5866. });
  5867. } else {
  5868. const loading = this.$loading({
  5869. lock: true,
  5870. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5871. spinner: 'el-icon-loading',
  5872. background: 'rgba(0, 0, 0, 0.7)'
  5873. });
  5874. let formData = new FormData();
  5875. formData.append("multipartFile", item.file);
  5876. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5877. res => {
  5878. this.$refs.upload.clearFiles();
  5879. loading.close();
  5880. if (res.code == "ok") {
  5881. this.$message({
  5882. message: res.msg,
  5883. type: "success"
  5884. });
  5885. } else {
  5886. this.$message({
  5887. message: res.msg,
  5888. type: "error"
  5889. });
  5890. }
  5891. },
  5892. error => {
  5893. this.$refs.upload.clearFiles();
  5894. loading.close();
  5895. this.$message({
  5896. message: error,
  5897. type: "error"
  5898. });
  5899. });
  5900. }
  5901. },
  5902. //获取项目列表
  5903. getProjectList() {
  5904. this.listLoading = true;
  5905. this.http.post( this.port.project.list, {},
  5906. res => {
  5907. this.listLoading = false;
  5908. if (res.code == "ok") {
  5909. for(var i in res.data) {
  5910. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5911. res.data[i].projectCode = ''
  5912. }
  5913. }
  5914. this.projectList = res.data;
  5915. console.log("项目列表",this.projectList);
  5916. } else {
  5917. this.$message({
  5918. message: res.msg,
  5919. type: "error"
  5920. });
  5921. }
  5922. },
  5923. error => {
  5924. this.listLoading = false;
  5925. this.$message({
  5926. message: error,
  5927. type: "error"
  5928. });
  5929. });
  5930. },
  5931. getSubUsersFillProjectList(userId) {
  5932. this.http.post( this.port.project.list, {
  5933. forReport: 1,
  5934. userId: userId
  5935. },res => {
  5936. if (res.code == "ok") {
  5937. for(var i in res.data) {
  5938. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5939. res.data[i].projectCode = ''
  5940. }
  5941. }
  5942. this.subFillProjectList = res.data;
  5943. this.getRecentlyProject(userId)
  5944. } else {
  5945. this.$message({
  5946. message: res.msg,
  5947. type: "error"
  5948. });
  5949. }
  5950. },
  5951. error => {
  5952. this.$message({
  5953. message: error,
  5954. type: "error"
  5955. });
  5956. });
  5957. },
  5958. // 获取填报日报的项目下拉列表
  5959. getFillProjectList() {
  5960. this.http.post( this.port.project.list, {
  5961. forReport: 1
  5962. },res => {
  5963. if (res.code == "ok") {
  5964. for(var i in res.data) {
  5965. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5966. res.data[i].projectCode = ''
  5967. }
  5968. }
  5969. this.fillProjectList = res.data;
  5970. this.getRecentlyProject()
  5971. } else {
  5972. this.$message({
  5973. message: res.msg,
  5974. type: "error"
  5975. });
  5976. }
  5977. },
  5978. error => {
  5979. this.$message({
  5980. message: error,
  5981. type: "error"
  5982. });
  5983. });
  5984. },
  5985. //自己填写日报时,刷新到自己的可填报日报列表
  5986. refreshToMyReportProjectList() {
  5987. this.getRecentlyProject();
  5988. },
  5989. getBasecostItemList() {
  5990. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5991. companyId: this.user.companyId
  5992. },
  5993. res => {
  5994. if (res.code == "ok") {
  5995. this.timeBasecostList = res.data;
  5996. }
  5997. });
  5998. },
  5999. getAIReport(createDate) {
  6000. this.http.post('/report/getAIReport', {},
  6001. res => {
  6002. if (res.code == "ok") {
  6003. var quanbu = 0
  6004. this.jsDay = 1
  6005. var zhi = ''
  6006. var slp = res.data
  6007. for(var i in slp) {
  6008. var sp = +slp[i].workingTime + 0
  6009. zhi = this.jsDay * sp
  6010. quanbu = +quanbu + zhi
  6011. }
  6012. this.jsTime = quanbu
  6013. var aiReportData = res.data;
  6014. this.canCancelInDialog = false
  6015. if(aiReportData.length != 0) {
  6016. var arr = [];
  6017. for(var i in aiReportData) {
  6018. arr.push({
  6019. id: null,
  6020. projectId: aiReportData[i].projectId,
  6021. workingTime: aiReportData[i].workingTime,
  6022. content: '',
  6023. progress:100,
  6024. state: 2,
  6025. timeType: aiReportData[i].timeType,
  6026. subProjectList: aiReportData[i].subProjectList,
  6027. taskList: aiReportData[i].taskList,
  6028. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6029. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6030. taskId: aiReportData[i].taskId,
  6031. startTime: aiReportData[i].startTime,
  6032. endTime: aiReportData[i].endTime,
  6033. isOvertime: 0,
  6034. progress:aiReportData[i].progress,
  6035. professionProgress: aiReportData[i].professionProgressList,
  6036. stages:aiReportData[i].stages,
  6037. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6038. pics: null,
  6039. multiWorktime: aiReportData[i].multiWorktime || 0,
  6040. worktimeList: [{}],
  6041. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6042. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6043. wuduList: aiReportData[i].degreeList,
  6044. taskGroups:aiReportData[i].taskGroups,
  6045. customData: aiReportData[i].customData,//自定义的数值
  6046. auditUserList: aiReportData[i].auditUserList,
  6047. projectAuditorId: aiReportData[i].projectAuditorId,
  6048. projectAuditorName: aiReportData[i].projectAuditorName,
  6049. overtimeHours: aiReportData[i].overtimeHours,
  6050. customText: aiReportData[i].customText,
  6051. basecostId: aiReportData[i].basecostId,
  6052. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6053. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6054. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6055. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6056. canEdit: true
  6057. })
  6058. }
  6059. this.workForm.domains = arr;
  6060. } else {
  6061. }
  6062. this.canEdit = true;
  6063. this.originCanEdit = true;
  6064. this.seleChn()
  6065. } else {
  6066. this.$message({
  6067. message: res.msg,
  6068. type: "error"
  6069. });
  6070. }
  6071. },
  6072. error => {
  6073. this.$message({
  6074. message: error,
  6075. type: "error"
  6076. });
  6077. });
  6078. },
  6079. // 获取个人某天的日报 111111
  6080. getReport() {
  6081. this.http.post( this.port.report.getPort, {
  6082. date: this.workForm.createDate
  6083. },
  6084. res => {
  6085. if (res.code == "ok") {
  6086. var quanbu = 0
  6087. this.jsDay = 1
  6088. var zhi = ''
  6089. var slp = res.data.report
  6090. for(var i in slp) {
  6091. var sp = +slp[i].workingTime + 0
  6092. zhi = this.jsDay * sp
  6093. quanbu = +quanbu + zhi
  6094. }
  6095. this.jsTime = quanbu
  6096. var list = res.data;
  6097. this.report = list;
  6098. this.reportTimeType = this.report.timeType;
  6099. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6100. this.isWeekend = !this.report.isWorkDay;
  6101. this.canCancelInDialog = false;
  6102. this.hasWrittenReport = list.report.length != 0;
  6103. if(list.report.length != 0) {
  6104. var arr = [];
  6105. this.canEdit = false;
  6106. let candelete = true
  6107. for(var i in list.report) {
  6108. var flg = null
  6109. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6110. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6111. var filteredRespList = null
  6112. if (targetP.length > 0) {
  6113. var isPublic = targetP[0].isPublic;
  6114. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  6115. }
  6116. let copyData = {
  6117. id: list.report[i].id,
  6118. projectId: list.report[i].projectId,
  6119. workingTime: list.report[i].workingTime,
  6120. content: list.report[i].content,
  6121. state: list.report[i].state,
  6122. timeType: list.report[i].timeType,
  6123. subProjectList: list.report[i].subProjectList,
  6124. taskList: list.report[i].taskList,
  6125. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6126. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6127. taskId: list.report[i].taskId,
  6128. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6129. startTime: list.report[i].startTime,
  6130. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6131. endTime: list.report[i].endTime,
  6132. isOvertime: flg,
  6133. progress:list.report[i].progress,
  6134. professionProgress: list.report[i].professionProgressList,
  6135. stages:list.report[i].stages,
  6136. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6137. pics: list.report[i].pics,
  6138. multiWorktime: list.report[i].multiWorktime,
  6139. worktimeList: list.report[i].worktimeList,
  6140. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6141. multiDegrIdArray: list.report[i].multiDegrIdList,
  6142. wuduList: list.report[i].degreeList,
  6143. taskGroups:list.report[i].taskGroups,
  6144. customData: list.report[i].customData,//自定义的数值
  6145. auditUserList: list.report[i].auditUserList,
  6146. overtimeHours: list.report[i].overtimeHours,
  6147. customText: list.report[i].customText,
  6148. basecostId: list.report[i].basecostId,
  6149. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6150. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6151. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6152. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6153. canEdit: list.report[i].state >= 2 ? true : false,
  6154. extraField1: list.report[i].extraField1,
  6155. extraField2: list.report[i].extraField2,
  6156. extraField3: list.report[i].extraField3,
  6157. workContentList: list.report[i].workContentList,
  6158. filteredRespList: filteredRespList,
  6159. serviceList: list.report[i].serviceList,
  6160. sapServiceId: list.report[i].sapServiceId,
  6161. reportTargetDeptId: list.report[i].deptId
  6162. }
  6163. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6164. //分组负责人审核的情况下,前端不需要显示,无需设置
  6165. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6166. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6167. }
  6168. arr.push(copyData);
  6169. if (list.report[i].state >= 2) {
  6170. this.canEdit = true;
  6171. }
  6172. if(list.report[i].state < 2){
  6173. candelete = false
  6174. }
  6175. if (list.report[i].state == 0){
  6176. this.canCancelInDialog = true
  6177. }
  6178. // 加判断
  6179. if(this.user.timeType.choseFromAlbum == 1) {
  6180. let arrList = []
  6181. for(var k in list.report[i].pics) {
  6182. let obj = {
  6183. name: k,
  6184. url: list.report[i].pics[k]
  6185. }
  6186. arrList.push(obj)
  6187. }
  6188. arr[i].imgListUrl = arrList
  6189. arr[i].imgList = list.report[i].pics
  6190. }
  6191. }
  6192. this.reportCanDelete = candelete
  6193. this.workForm = {
  6194. createDate: this.workForm.createDate,
  6195. domains: arr,
  6196. userNames:null,
  6197. userId:null,
  6198. time: list.time,
  6199. showRefresh: list.showRefresh
  6200. }
  6201. console.log('workForm', this.workForm)
  6202. } else {
  6203. this.workForm = {
  6204. createDate: this.workForm.createDate,
  6205. domains: [{
  6206. id: null,
  6207. projectId: "",
  6208. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6209. content: "",
  6210. progress:100,
  6211. state: 2,
  6212. timeType:0,
  6213. multiWorktime: this.reportTimeType.multiWorktime,
  6214. worktimeList:[{}],
  6215. canEdit: true,
  6216. auditorFirst: '',
  6217. auditorSec: '',
  6218. auditorThird: '',
  6219. ccUserid: ''
  6220. }],
  6221. userId:null,
  6222. userNames:null,
  6223. time: this.report.time,
  6224. showRefresh: list.showRefresh
  6225. }
  6226. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6227. this.$set(this.workForm.domains[0],'isOvertime',true)
  6228. if(this.reportTimeType.type != 2){
  6229. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6230. }
  6231. }
  6232. if(this.user.timeType.type == 1) {
  6233. var shuzhi = this.user.timeType.allday + ''
  6234. // console.log('执行一次', shuzhi.indexOf('.'))
  6235. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6236. }
  6237. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6238. //默认给第一个,必填字段
  6239. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6240. }
  6241. this.canEdit = true;
  6242. }
  6243. this.originCanEdit = this.canEdit;
  6244. this.seleChn()
  6245. } else {
  6246. this.$message({
  6247. message: res.msg,
  6248. type: "error"
  6249. });
  6250. }
  6251. },
  6252. error => {
  6253. this.$message({
  6254. message: error,
  6255. type: "error"
  6256. });
  6257. });
  6258. },
  6259. guanbi() {
  6260. this.falsss = false,
  6261. this.workTimeForMinYi=0
  6262. },
  6263. // 打开日报填写
  6264. fillInReport(i, isBatch) {
  6265. this.isWeekend = false
  6266. this.reportCanDelete = false
  6267. // console.log(this.user.timeType.type, '选择时长')
  6268. if(i != 1) {
  6269. this.falsss = false
  6270. } else {
  6271. this.falsss = true
  6272. }
  6273. if (this.isSubstitude) {
  6274. this.getSubstitudeUserDeptList();
  6275. } else {
  6276. this.refreshToMyReportProjectList();
  6277. }
  6278. if(i == -1 || this.isSubstitude) {
  6279. this.isDisable = false;
  6280. } else {
  6281. this.isDisable = true;
  6282. }
  6283. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6284. this.isBatch = isBatch;
  6285. if (this.isBatch == 0 && !this.isSubstitude) {
  6286. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6287. let weekday = new Date(this.workForm.createDate).getDay()
  6288. if(this.user.companyId == 817){
  6289. if(weekday == 0){
  6290. this.isWeekend = true
  6291. }
  6292. }else{
  6293. if(weekday == 0 || weekday == 6){
  6294. this.isWeekend = true
  6295. }
  6296. }
  6297. this.getReport(i);
  6298. } else {
  6299. // console.log('执行到了这里')
  6300. this.jsTime = 0
  6301. this.jsDay = 0
  6302. this.workForm = {
  6303. createDate: null,//批量填报没有日期
  6304. domains: [{
  6305. id: null,
  6306. projectId: "",
  6307. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6308. content: "",
  6309. progress:100,
  6310. state: 2,
  6311. timeType:0,
  6312. multiWorktime: this.reportTimeType.multiWorktime,
  6313. worktimeList:[{}],
  6314. canEdit: true,
  6315. }],
  6316. }
  6317. if(this.user.timeType.type == 1) {
  6318. var shuzhi = this.user.timeType.allday + ''
  6319. // console.log('执行二次')
  6320. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6321. }
  6322. // console.log(this.workForm)
  6323. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6324. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6325. }
  6326. this.canEdit = true;
  6327. }
  6328. this.dialogVisible = true;
  6329. },
  6330. //按周填报的弹窗口中编辑单项目相关数据
  6331. setWeekFormReportItem(reportId, i, names, row,sss) {
  6332. console.log(sss)
  6333. this.http.post('/report/getReportById', {
  6334. reportId: reportId
  6335. },
  6336. res => {
  6337. if (res.code == "ok") {
  6338. var data = res.data.report;
  6339. sss.subProjectId = data.subProjectId
  6340. sss.subProjectList = data.subProjectList;
  6341. sss.stage = data.stage
  6342. sss.subProjectList = data.subProjectList
  6343. sss.stages = data.stages
  6344. sss.taskGroups = data.taskGroups;
  6345. sss.auditUserList = data.auditUserList;
  6346. sss.degreeId = data.degreeId;
  6347. sss.customData = data.customData;
  6348. sss.wuduList = data.degreeList;
  6349. this.zhoBaoIdx = i
  6350. this.zhoBaoName = names
  6351. this.zhoBao = sss
  6352. this.zhis = row
  6353. if (sss.groupId) {
  6354. //最后一个参数表示是否保留stage的值,不要重置为空
  6355. this.getGroupStages(this.zhoBao, 0, true)
  6356. }
  6357. this.$forceUpdate();
  6358. }
  6359. });
  6360. },
  6361. // 按周填报里内容的填写
  6362. showWeekItemEdit(item, i, projectId,names, row) {
  6363. if (item.state == 0) {
  6364. this.$message({
  6365. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6366. type: "error"
  6367. });
  6368. return;
  6369. }
  6370. if (item.state == 1) {
  6371. this.$message({
  6372. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6373. type: "error"
  6374. });
  6375. return;
  6376. }
  6377. if(this.user.timeType.notAllowedNoAttendance == 1){
  6378. if(this.zhoData[i].corpTime){
  6379. if(this.zhoData[i].corpTime.workHours == 0){
  6380. this.$message({
  6381. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6382. type: 'error'
  6383. })
  6384. return
  6385. }
  6386. }else{
  6387. this.$message({
  6388. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6389. type: 'error'
  6390. })
  6391. return
  6392. }
  6393. }
  6394. var obj = {}
  6395. obj.projectId = projectId
  6396. this.tianxieDialogVisible = true
  6397. this.scopess = item
  6398. var sss = {}
  6399. if (item.id != null) {
  6400. sss.id = item.id;
  6401. sss.state = item.state;
  6402. } else {
  6403. sss.id = -1;
  6404. sss.state = 3;
  6405. }
  6406. sss.projectId = projectId;
  6407. sss.progress = item.progress
  6408. sss.time = item.time
  6409. sss.content = item.content;
  6410. console.log('333', sss.content)
  6411. if (sss.time == '' && this.reportTimeType.type == 2) {
  6412. //取已填时间范围中最大的一个作为开始时间
  6413. var startTime = '09:00';
  6414. var fillStartTime = '00:00';
  6415. for (var t in this.selProjectList) {
  6416. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6417. if (fillItem.time) {
  6418. if (fillItem.time[1] > fillStartTime) {
  6419. fillStartTime = fillItem.time[1];
  6420. }
  6421. }
  6422. }
  6423. if (fillStartTime == '00:00') {
  6424. fillStartTime = '09:00';
  6425. }
  6426. var fillEndMax = '18:00';
  6427. if (fillStartTime >= '18:00') {
  6428. fillEndMax = '23:59';
  6429. }
  6430. sss.time = [fillStartTime, fillEndMax];
  6431. }
  6432. sss.groupId = item.groupId
  6433. sss.stage = item.stage;
  6434. sss.workingTime = item.workingTime
  6435. sss.projectAuditorId = item.projectAuditorId;
  6436. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6437. //默认选中第一个
  6438. sss.basecostId = this.timeBasecostList[0].id;
  6439. }
  6440. var hasEdited = this.zhoData[i][names].hasEdited;
  6441. if (hasEdited) {
  6442. sss = { ...item }
  6443. //编辑过了
  6444. sss.subProjectId = item.subProjectId
  6445. sss.stage = item.stage
  6446. sss.subProjectList = item.subProjectList
  6447. sss.stages = item.stages
  6448. sss.taskGroups = item.taskGroups;
  6449. console.log(sss.taskGroups, '33333');
  6450. sss.auditUserList = obj.auditUserList;
  6451. sss.degreeId = item.degreeId;
  6452. sss.customData = item.customData;
  6453. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6454. //只有一个审核人,自动设置上去
  6455. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6456. }
  6457. sss.wuduList = item.wuduList;
  6458. this.zhoBaoIdx = i
  6459. this.zhoBaoName = names
  6460. this.zhoBao = sss
  6461. this.zhis = row
  6462. if (sss.groupId) {
  6463. //最后一个参数表示是否保留stage的值,不要重置为空
  6464. this.getGroupStages(this.zhoBao, 0, true)
  6465. }
  6466. this.$forceUpdate();
  6467. this.getWeeklyTaskList(sss)
  6468. console.log('最后的周报 ===>', this.zhoBao)
  6469. } else {
  6470. //第一次打开,获取数据
  6471. if (sss.id == -1) {
  6472. //新填报的
  6473. this.selectProject(obj, 0);
  6474. var that = this
  6475. setTimeout(() =>{
  6476. sss.subProjectId = that.workForm.domains[0].subProjectId
  6477. sss.subProjectList = item.subProjectList;
  6478. sss.stage = that.workForm.domains[0].stage
  6479. sss.subProjectList = that.workForm.domains[0].subProjectList
  6480. sss.stages = that.workForm.domains[0].stages
  6481. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6482. sss.auditUserList = obj.auditUserList;
  6483. sss.degreeId = item.degreeId;
  6484. sss.customData = item.customData;
  6485. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6486. //只有一个审核人,自动设置上去
  6487. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6488. }
  6489. sss.wuduList = row[0].wuduList
  6490. that.zhoBaoIdx = i
  6491. that.zhoBaoName = names
  6492. that.zhoBao = sss
  6493. that.zhis = row
  6494. if (sss.groupId) {
  6495. //最后一个参数表示是否保留stage的值,不要重置为空
  6496. this.getGroupStages(that.zhoBao, 0, false)
  6497. }
  6498. that.$forceUpdate();
  6499. this.getWeeklyTaskList(sss)
  6500. },600);
  6501. } else {
  6502. //编辑填报过的;数据库已经存在的
  6503. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6504. }
  6505. }
  6506. },
  6507. // 按周填报里内容的填写点击确定
  6508. setWeekProItemData() {
  6509. //专业版模式下,任务分组和阶段必填
  6510. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6511. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6512. this.$message({
  6513. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6514. type: "error"
  6515. });
  6516. return;
  6517. }
  6518. }
  6519. // 检查任务分组
  6520. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6521. this.$message({
  6522. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6523. type: "error"
  6524. });
  6525. return
  6526. }
  6527. //检查子项目是否必填
  6528. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6529. this.$message({
  6530. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6531. type: "error"
  6532. });
  6533. return;
  6534. }
  6535. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6536. this.$message({
  6537. message: this.$t('message.Pleaseselectareviewer'),
  6538. type: "error"
  6539. });
  6540. return
  6541. }
  6542. if(this.user.timeType.reportAuditType == 3){
  6543. let auditTips = ''
  6544. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6545. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6546. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6547. if(auditTips){
  6548. auditTips = auditTips.substring(0,auditTips.length - 1)
  6549. this.$message({
  6550. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6551. type: 'error'
  6552. })
  6553. return
  6554. }
  6555. }
  6556. let errtips = ''
  6557. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6558. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6559. errtips += this.user.timeType.customDegreeName + '、'
  6560. }
  6561. }
  6562. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6563. errtips += this.user.timeType.customDataName + '、'
  6564. }
  6565. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6566. errtips += this.user.timeType.customTextName + '、'
  6567. }
  6568. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6569. errtips += this.$t('other.workMatters') +'、'
  6570. }
  6571. if(errtips){
  6572. errtips = errtips.substring(0,errtips.length - 1)
  6573. this.$message({
  6574. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6575. type: 'error'
  6576. })
  6577. return
  6578. }
  6579. this.tianxieDialogVisible = false
  6580. var zhong = this.zhoData
  6581. this.zhoBao.hasEdited = true;
  6582. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6583. this.zhoData = zhong
  6584. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6585. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6586. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6587. },
  6588. // 获取本周
  6589. getCurrentWeek() {
  6590. //今天
  6591. this.targetWeekDate = new Date();
  6592. this.initWeekFormData();
  6593. // this.jiazai()
  6594. },
  6595. // 获取上周
  6596. handleGetPrevWeek() {
  6597. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6598. this.initWeekFormData();
  6599. // this.jiazai()
  6600. },
  6601. // 获取下周
  6602. handleGetNextvWeek() {
  6603. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6604. this.initWeekFormData()
  6605. },
  6606. // 加载动画
  6607. jiazai() {
  6608. this.weekDataLoading = true
  6609. var that = this
  6610. setTimeout(() =>{
  6611. that.weekDataLoading = false
  6612. },1000);
  6613. },
  6614. // 转时间格式
  6615. dealdate(date) {
  6616. const dt = new Date(date)
  6617. const y = dt.getFullYear()
  6618. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6619. const d = (dt.getDate() + '').padStart(2, '0')
  6620. return `${y}-${m}-${d}`
  6621. },
  6622. // 按周填报
  6623. fillInReportss() {
  6624. window.addEventListener('scroll', this.handleScroll, true)
  6625. // this.jiazai()
  6626. this.fillWeekDialogVisi = true;
  6627. if (this.isSubstitude) {
  6628. this.substitudeStep = 1;
  6629. this.getSubstitudeUserDeptList();
  6630. } else {
  6631. this.getCurrentWeek();
  6632. }
  6633. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6634. //重新获取工时预警类型的预算项
  6635. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6636. companyId: this.user.companyId
  6637. },
  6638. res => {
  6639. if (res.code == "ok") {
  6640. this.timeBasecostList = res.data;
  6641. }
  6642. });
  6643. }
  6644. },
  6645. fillInReportCustom() {
  6646. this.weekIndex++
  6647. this.weekParentData = {
  6648. isSubstitude: this.isSubstitude
  6649. }
  6650. this.fillWeekDialogVisiCustom = true
  6651. },
  6652. // 按周填报的项目筛选
  6653. selListFun(){
  6654. this.selProjectList = []
  6655. if(this.selCon.length){
  6656. for (let i = 0; i < this.selCon.length; i++) {
  6657. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6658. }
  6659. this.selConShow = false ;
  6660. for (let i in this.zhoData) {
  6661. var obj = this.zhoData[i];
  6662. for(var j in this.selProjectList) {
  6663. var xinzhi = this.selProjectList[j].projectName
  6664. obj[xinzhi] = {}
  6665. obj[xinzhi].time = ''
  6666. obj[xinzhi].content = ''
  6667. obj[xinzhi].progress = 0
  6668. obj[xinzhi].workingTime = 0
  6669. }
  6670. }
  6671. this.initWeekFormData();
  6672. }else{
  6673. this.$message({
  6674. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6675. type:'error'
  6676. })
  6677. }
  6678. },
  6679. setWeekCardTimeData(list) {
  6680. for(let i in list){
  6681. let datei = '';
  6682. if (this.user.timeType.showDdCardtime == 1) {
  6683. datei = list[i].workDate;
  6684. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6685. datei = list[i].createDate;
  6686. } else if (this.user.timeType.syncFanwei == 1) {
  6687. datei = list[i].workDate;
  6688. }
  6689. for(let m in this.zhoData) {
  6690. if(datei == this.zhoData[m].zhoDataTime){
  6691. let item = {
  6692. startTime: list[i].startTime,
  6693. endTime: list[i].endTime,
  6694. workHours: list[i].workHours,
  6695. otTime: list[i].otTime
  6696. }
  6697. this.$set(this.zhoData[m],'corpTime',item)
  6698. }
  6699. }
  6700. }
  6701. },
  6702. getWeeklyCardTime(){ //按周填报获取考勤信息
  6703. let dateStr = []
  6704. for(let i in this.zhoData){
  6705. dateStr.push(this.zhoData[i].zhoDataTime)
  6706. }
  6707. this.http.post('/report/getWeeklyCardTime',{
  6708. dateStr: JSON.stringify(dateStr)
  6709. },res => {
  6710. if(res.code == 'ok'){
  6711. for(let i in res.data){
  6712. let datei = '';
  6713. if (this.user.timeType.showDdCardtime == 1) {
  6714. datei = res.data[i].workDate.split('-');
  6715. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6716. datei = res.data[i].createDate.split('-');
  6717. }
  6718. for(let m in this.zhoData){
  6719. let datem = new Date(this.zhoData[m].zhoDataTime)
  6720. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6721. let item = {
  6722. startTime: res.data[i].startTime,
  6723. endTime: res.data[i].endTime,
  6724. workHours: res.data[i].workHours
  6725. }
  6726. this.$set(this.zhoData[m],'corpTime',item)
  6727. }
  6728. }
  6729. }
  6730. }else{
  6731. this.$message({
  6732. message: res.msg,
  6733. type: 'error'
  6734. })
  6735. }
  6736. },err => {
  6737. this.$message({
  6738. message: err,
  6739. type: 'error'
  6740. })
  6741. })
  6742. },
  6743. selListqx(){
  6744. this.fillWeekDialogVisi = false
  6745. this.selProjectList = []
  6746. this.selCon = []
  6747. },
  6748. handleScroll() {
  6749. this.changdu = this.projectList.length + 1
  6750. },
  6751. // 自动选择时间点的事件
  6752. // async zhoTimes(item, i) {
  6753. // var iss = i
  6754. // if(item.time == null) {
  6755. // return
  6756. // } else {
  6757. // const zhi = this.zhoData[iss];
  6758. // let he = 0;
  6759. // const timeArr = Object.values(zhi)
  6760. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6761. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6762. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6763. // console.log(data, 'data');
  6764. // zhi.he = `${he}h`;
  6765. // }
  6766. // },
  6767. async zhoTimes(item, index) {
  6768. const zho = this.zhoData[index];
  6769. if (!item.time) {
  6770. return;
  6771. }
  6772. const timeArr = Object.values(zho)
  6773. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6774. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6775. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6776. zho.he = `${totalHours[0]}h`;
  6777. },
  6778. // 判断两个时间段是否重叠
  6779. timeOverlap(idx, dateAr) {
  6780. let zhi = 0
  6781. for (let k in dateAr) {
  6782. if (idx !== k) {
  6783. 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))) {
  6784. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6785. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6786. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6787. }
  6788. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6789. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6790. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6791. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6792. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6793. } else {
  6794. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6795. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6796. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6797. }
  6798. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6799. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6800. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6801. }
  6802. }
  6803. }
  6804. }
  6805. }
  6806. return zhi
  6807. },
  6808. // 计算时间
  6809. getHourMinutes(str, end) {
  6810. var he = 0
  6811. var date2 = '2021/12/12 ' + end +':00'
  6812. var date1 = '2021/12/12 ' + str +':00'
  6813. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6814. var leave1=date3%(24*3600*1000)
  6815. var hours=Math.floor(leave1/(3600*1000))
  6816. var leave2=leave1%(3600*1000)
  6817. var minutes=Math.floor(leave2/(60*1000))
  6818. var shi = hours+'.'+ minutes
  6819. return he += +shi
  6820. },
  6821. // 自动选择事件长度的事件
  6822. zhoXuan(item, i) {
  6823. var iss = i
  6824. if(item.time == null) {
  6825. return
  6826. } else {
  6827. var zhi = this.zhoData[iss]
  6828. var he = 0
  6829. for(var i in zhi) {
  6830. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6831. he += +zhi[i].workingTime
  6832. }
  6833. }
  6834. zhi.he = he + 'h'
  6835. }
  6836. },
  6837. getPushWorkLogData(){
  6838. this.http.post('/sap-sync-log/list', {},
  6839. res => {
  6840. if (res.code == "ok") {
  6841. this.pushWorkTimeLogData = res.data;
  6842. } else {
  6843. this.$message({
  6844. message: res.msg,
  6845. type: "error"
  6846. });
  6847. }
  6848. },
  6849. error => {
  6850. this.$message({
  6851. message: error,
  6852. type: "error"
  6853. });
  6854. });
  6855. },
  6856. // 获取全部人员
  6857. getUsers() {
  6858. this.http.post('/user/getSimpleActiveUserList', {},
  6859. res => {
  6860. if (res.code == "ok") {
  6861. this.usersList = res.data;
  6862. } else {
  6863. this.$message({
  6864. message: res.msg,
  6865. type: "error"
  6866. });
  6867. }
  6868. },
  6869. error => {
  6870. this.$message({
  6871. message: error,
  6872. type: "error"
  6873. });
  6874. });
  6875. },
  6876. // 按时间比例
  6877. addBli(item, i) {
  6878. var iss = i
  6879. if(item.time == null) {
  6880. return
  6881. } else {
  6882. var zhi = this.zhoData[iss]
  6883. var he = 0
  6884. for(var i in zhi) {
  6885. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6886. he += +zhi[i].workingTime
  6887. }
  6888. }
  6889. zhi.he = he.toFixed(1) + 'h'
  6890. }
  6891. },
  6892. //按周填报选择的项目发生变化,需要设置列
  6893. onSelProjectChange() {
  6894. for (let i = 0; i < this.selCon.length; i++) {
  6895. var exists = false;
  6896. for (let j = 0; j < this.selProjectList.length; j++) {
  6897. if (this.selProjectList[j].id == this.selCon[i]) {
  6898. exists = true;
  6899. break;
  6900. }
  6901. }
  6902. if (!exists) {
  6903. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6904. this.selProjectList.push(newProject);
  6905. //添加新项目
  6906. for (var w in this.zhoData) {
  6907. var dayItem = this.zhoData[w];
  6908. var pName = newProject.projectName;
  6909. dayItem[pName] = {};
  6910. dayItem[pName].time = ''
  6911. dayItem[pName].content = ''
  6912. dayItem[pName].progress = 0
  6913. dayItem[pName].workingTime = 0
  6914. }
  6915. }
  6916. }
  6917. //去掉
  6918. for (let j = 0; j < this.selProjectList.length; j++) {
  6919. var exists = false;
  6920. for (let i = 0; i < this.selCon.length; i++) {
  6921. if (this.selProjectList[j].id == this.selCon[i]) {
  6922. exists = true;
  6923. break;
  6924. }
  6925. }
  6926. if (!exists) {
  6927. this.selProjectList.splice(j, 1);
  6928. j--;
  6929. }
  6930. }
  6931. this.loadFilledWeekReportItem();
  6932. //刷新表格
  6933. // this.$refs.weekTable.doLayout();
  6934. },
  6935. //根据选中的项目来刷新填写表格
  6936. loadFilledWeekReportItem() {
  6937. for (var w in this.zhoData) {
  6938. var dayItem = this.zhoData[w];
  6939. for (var i = 0; i < this.selProjectList.length; i++) {
  6940. var curColumnProject = this.selProjectList[i];
  6941. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6942. for (var t in dayItem.reportList) {
  6943. //有日报的项目,不能取消选择
  6944. for (var p in this.fillProjectList) {
  6945. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6946. }
  6947. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6948. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6949. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6950. if (this.reportTimeType.type == 2) {
  6951. //时间段模式
  6952. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6953. }
  6954. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6955. break;
  6956. }
  6957. }
  6958. // dayItem[curColumnProject.projectName] = matchReportItem;
  6959. }
  6960. }
  6961. this.$nextTick(()=>{
  6962. this.$refs.weekTable.doLayout();
  6963. });
  6964. },
  6965. initWeekFormData() {
  6966. this.weekDataLoading = true;
  6967. for (var p in this.fillProjectList) {
  6968. this.fillProjectList[p].canCancel = 1;
  6969. }
  6970. var param = {
  6971. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6972. };
  6973. if (this.isSubstitude) {
  6974. //传代填人的userId
  6975. param.targetUserId = this.workForm.userId[0];
  6976. }
  6977. this.http.post('/report/getWeeklyReportData',param,res => {
  6978. this.weekDataLoading = false;
  6979. if(res.code == 'ok'){
  6980. let projectList = res.data.projectList;
  6981. if (projectList.length > 0) {
  6982. //有选择过项目进行填报,直接选中
  6983. this.selProjectList = projectList;
  6984. this.selCon = [];
  6985. for (let i = 0; i < projectList.length; i++) {
  6986. this.selCon.push(projectList[i].id);
  6987. }
  6988. }
  6989. //设置日期
  6990. this.weekDateRange = res.data.dateList;
  6991. this.zhoData = [];
  6992. var arrst = []
  6993. for(var i in this.weekDateRange) {
  6994. var obj = {}
  6995. obj.zhoDataTime = this.weekDateRange[i].date
  6996. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6997. obj.he = this.weekDateRange[i].filledTime;
  6998. obj.canFill = this.weekDateRange[i].canFill;
  6999. // obj.filledTime = this.weekDateRange[i].filledTime;
  7000. obj.reportList = this.weekDateRange[i].reportList;
  7001. //初始化,防止渲染报错
  7002. for (var j = 0; j < this.selProjectList.length; j++) {
  7003. var pName = this.selProjectList[j].projectName
  7004. obj[pName] = {}
  7005. obj[pName].time = ''
  7006. obj[pName].content = ''
  7007. obj[pName].progress = 0
  7008. obj[pName].workingTime = 0
  7009. }
  7010. arrst.push(obj)
  7011. }
  7012. this.zhoData = arrst
  7013. this.setWeekCardTimeData(res.data.cardTimeList);
  7014. this.loadFilledWeekReportItem();
  7015. }else{
  7016. this.$message({
  7017. message: res.msg,
  7018. type: 'error'
  7019. })
  7020. }
  7021. },err => {
  7022. this.$message({
  7023. message: err,
  7024. type: 'error'
  7025. })
  7026. })
  7027. },
  7028. zhoZhi(res, i) {
  7029. var zhi = 0
  7030. for(var i in res) {
  7031. if(i != 'zhoDataTime' && i != 'he') {
  7032. zhi += +res[i]
  7033. }
  7034. }
  7035. res.he = zhi
  7036. },
  7037. zhoBtn(i) {
  7038. // this.zhoData.split(i, 1)
  7039. var arr = this.zhoData
  7040. arr.splice(i, 1)
  7041. },
  7042. zhoAddlast(){
  7043. this.selConShow = true
  7044. },
  7045. closeAddWeeklyReport(){
  7046. this.fillWeekDialogVisi = false
  7047. this.selConShow = true
  7048. this.selProjectList = []
  7049. this.selCon = []
  7050. },
  7051. checkDateWorkTime() {
  7052. //针对苏州景昱,单独的检查逻辑
  7053. if (this.user.companyId == 5978) {
  7054. //调接口,先检查工时是否存在异常
  7055. var zhi = this.zhoData;
  7056. var array = [];
  7057. for(let n in zhi){
  7058. if(zhi[n].he){
  7059. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7060. array.push(workData)
  7061. }
  7062. }
  7063. this.submitingReport = true;
  7064. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7065. res => {
  7066. this.submitingReport = false;
  7067. if (res.code == "ok") {
  7068. this.submitWeekReport(0)
  7069. } else {
  7070. this.$confirm(res.msg, this.$t('other.prompts'), {
  7071. confirmButtonText: this.$t('huLveBingTiJiao'),
  7072. cancelButtonText: this.$t('btn.cancel'),
  7073. type: 'error'
  7074. }).then(() => {
  7075. this.submitWeekReport(0)
  7076. }).catch(() => {
  7077. });
  7078. }
  7079. },
  7080. error => {
  7081. this.$message({
  7082. message: error,
  7083. type: "error"
  7084. });
  7085. });
  7086. }
  7087. },
  7088. // 提交按周填报
  7089. submitWeekReport(isDraft) {
  7090. var zhi = this.zhoData
  7091. var ll = 0
  7092. if(this.reportTimeType.type == 2) {
  7093. for(var i in zhi) {
  7094. this.dateAr = []
  7095. var alp = []
  7096. var zhis = zhi[i]
  7097. console.log(zhis)
  7098. for(var j in zhis) {
  7099. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7100. let objs = {}
  7101. objs.s = zhis[j].time[0]
  7102. objs.e = zhis[j].time[1]
  7103. objs.p = j
  7104. alp.push(objs)
  7105. }
  7106. }
  7107. console.log(alp)
  7108. this.dateAr = alp
  7109. if (this.reportTimeType.timeCanOverlap == 0) {
  7110. let str = this.$t('message.Filledtimeperiodsoverlap')
  7111. if(this.dateAr.length > 0) {
  7112. const trus = this.fns();
  7113. const overlapDataTime = this.getOverlapData(alp);
  7114. if (overlapDataTime.length > 0) {
  7115. const arrList = overlapDataTime.map((item) => item.p);
  7116. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7117. }
  7118. ll += 1
  7119. if(!trus) {
  7120. this.$message({
  7121. message: str,
  7122. type: 'error'
  7123. })
  7124. return false
  7125. }
  7126. }
  7127. } else {
  7128. if(this.dateAr.length > 0) {
  7129. ll +=1 ;
  7130. }
  7131. }
  7132. }
  7133. if(ll == 0) {
  7134. this.$message({
  7135. message: this.$t('message.Pleasefillinthetime'),
  7136. type: 'error'
  7137. })
  7138. return false
  7139. }
  7140. } else if(this.reportTimeType.type == 1){
  7141. for(var i in zhi) {
  7142. var zhis = zhi[i]
  7143. for(var j in zhis) {
  7144. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7145. ll += 1
  7146. }
  7147. }
  7148. }
  7149. if(ll == 0) {
  7150. this.$message({
  7151. message: this.$t('message.Pleaseselectatime'),
  7152. type: 'error'
  7153. })
  7154. return false
  7155. }
  7156. let overcorp = ''
  7157. for(let n in zhi){
  7158. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7159. overcorp += zhi[n].zhoDataTime + ','
  7160. }
  7161. }
  7162. if(this.user.companyId != 5978 && overcorp != ''){
  7163. overcorp = overcorp.substring(0,overcorp.length - 1)
  7164. this.$message({
  7165. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7166. type: 'error'
  7167. })
  7168. return
  7169. }
  7170. }
  7171. var submits = []
  7172. let formData = new FormData();
  7173. formData.append("draft", isDraft);
  7174. if(this.reportTimeType.multiWorktime == 1){
  7175. for (var i in this.zhoData) {
  7176. var zhoD = this.zhoData[i]
  7177. var flgs = false
  7178. for(var j in zhoD) {
  7179. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7180. flgs = true
  7181. // formData.append("degreeId", "-1");
  7182. formData.append("id", '-1');
  7183. if (this.isSubstitude) {
  7184. formData.append('targetUids',this.workForm.userId[0]);
  7185. }
  7186. for(var s in this.projectList) {
  7187. if(j == this.projectList[s].projectName) {
  7188. formData.append("projectId", this.projectList[s].id);
  7189. }
  7190. }
  7191. if(this.user.timeType.reportAuditType == 3){
  7192. let audItem = {}
  7193. if(this.user.timeType.auditLevel > 0){
  7194. audItem.auditorFirst = zhoD[j].auditorFirst
  7195. }
  7196. if(this.user.timeType.auditLevel > 1){
  7197. audItem.auditorSec = zhoD[j].auditorSec
  7198. }
  7199. if(this.user.timeType.auditLevel > 2){
  7200. audItem.auditorThird = zhoD[j].auditorThird
  7201. }
  7202. if(zhoD[j].ccUserid){
  7203. audItem.ccUserid = zhoD[j].ccUserid
  7204. }
  7205. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7206. }
  7207. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7208. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7209. formData.append("reportTimeType", this.reportTimeType.type);
  7210. formData.append("endTime", '');
  7211. formData.append("startTime", '');
  7212. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7213. var lix = []
  7214. var objjs = {}
  7215. objjs.startTime = zhoD[j].time[0]
  7216. objjs.endTime = zhoD[j].time[1]
  7217. if (zhoD[j].content == null || zhoD[j].content == '') {
  7218. zhoD[j].content == '-'
  7219. }
  7220. objjs.content = zhoD[j].content
  7221. lix.push(objjs)
  7222. var zhiZhi = JSON.stringify(lix)
  7223. zhiZhi = zhiZhi.replace(/,/g,"@");
  7224. formData.append("content", zhiZhi)
  7225. formData.append("isOvertime", 0)
  7226. formData.append("professionProgress", "[]")
  7227. if (zhoD[j].groupId) {
  7228. formData.append("groupId",zhoD[j].groupId)
  7229. } else {
  7230. //解决后台groupId数组越界的问题
  7231. formData.append("groupId",0)
  7232. }
  7233. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7234. formData.append("createDate",zhoD.zhoDataTime)
  7235. if (zhoD[j].projectAuditorId) {
  7236. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7237. }
  7238. if(zhoD[j].basecostId) {
  7239. formData.append("basecostId", zhoD[j].basecostId);
  7240. } else {
  7241. formData.append("basecostId", 0);
  7242. }
  7243. if(this.user.timeType.customDegreeActive){
  7244. if (this.user.timeType.customDegreeMultiple) {
  7245. if (zhoD[j].multiDegrIdArray) {
  7246. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7247. } else {
  7248. formData.append('multiDegrId','[]')
  7249. }
  7250. } else {
  7251. if (zhoD[j].degreeId) {
  7252. formData.append('degreeId',zhoD[j].degreeId)
  7253. } else {
  7254. formData.append('degreeId','-1')
  7255. }
  7256. }
  7257. }else{
  7258. formData.append("degreeId", "-1");
  7259. }
  7260. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7261. formData.append('customData',zhoD[j].customData)
  7262. }else if(this.user.timeType.customDataActive){
  7263. formData.append('customData',0)
  7264. }
  7265. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7266. formData.append('customText',zhoD[j].customText)
  7267. }else if(this.user.timeType.customTextActive){
  7268. formData.append('customText','-')
  7269. }
  7270. }
  7271. }
  7272. }
  7273. } else {
  7274. for (var i in this.zhoData) {
  7275. var zhoD = this.zhoData[i]
  7276. var flgs = false
  7277. if(this.reportTimeType.type == 2) {
  7278. for(var k in this.selProjectList) {
  7279. var pItem = this.selProjectList[k];
  7280. var pName = pItem.projectName;
  7281. var j = pName;
  7282. console.log('j==周报中的项目='+j);
  7283. if(zhoD[j].time && zhoD[j].time != 'null') {
  7284. flgs = true
  7285. // formData.append("degreeId", "-1");
  7286. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7287. if (this.isSubstitude) {
  7288. formData.append('targetUids',this.workForm.userId[0]);
  7289. }
  7290. for(var s in this.projectList) {
  7291. if(j == this.projectList[s].projectName) {
  7292. formData.append("projectId", this.projectList[s].id);
  7293. }
  7294. }
  7295. if(this.user.timeType.reportAuditType == 3){
  7296. let audItem = {}
  7297. if(this.user.timeType.auditLevel > 0){
  7298. audItem.auditorFirst = zhoD[j].auditorFirst
  7299. }
  7300. if(this.user.timeType.auditLevel > 1){
  7301. audItem.auditorSec = zhoD[j].auditorSec
  7302. }
  7303. if(this.user.timeType.auditLevel > 2){
  7304. audItem.auditorThird = zhoD[j].auditorThird
  7305. }
  7306. if(zhoD[j].ccUserid){
  7307. audItem.ccUserid = zhoD[j].ccUserid
  7308. }
  7309. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7310. }
  7311. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7312. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7313. formData.append("reportTimeType", this.reportTimeType.type);
  7314. formData.append("endTime", zhoD[j].time[1]);
  7315. formData.append("startTime", zhoD[j].time[0]);
  7316. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7317. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7318. formData.append("isOvertime", 0)
  7319. formData.append("professionProgress", "[]")
  7320. if (zhoD[j].groupId) {
  7321. formData.append("groupId",zhoD[j].groupId)
  7322. } else {
  7323. //解决后台groupId数组越界的问题
  7324. formData.append("groupId",0)
  7325. }
  7326. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7327. formData.append("createDate",zhoD.zhoDataTime)
  7328. if (zhoD[j].projectAuditorId) {
  7329. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7330. }
  7331. if(zhoD[j].basecostId) {
  7332. formData.append("basecostId", zhoD[j].basecostId);
  7333. } else {
  7334. formData.append("basecostId", 0);
  7335. }
  7336. if(this.user.timeType.customDegreeActive){
  7337. if (this.user.timeType.customDegreeMultiple) {
  7338. if (zhoD[j].multiDegrIdArray) {
  7339. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7340. } else {
  7341. formData.append("multiDegrId", "[]");
  7342. }
  7343. } else {
  7344. if (zhoD[j].degreeId) {
  7345. formData.append('degreeId',zhoD[j].degreeId)
  7346. } else {
  7347. formData.append("degreeId", "-1");
  7348. }
  7349. }
  7350. }else{
  7351. formData.append("degreeId", "-1");
  7352. }
  7353. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7354. formData.append('customData',zhoD[j].customData)
  7355. }else if(this.user.timeType.customDataActive){
  7356. formData.append('customData',0)
  7357. }
  7358. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7359. formData.append('customText',zhoD[j].customText)
  7360. }else if(this.user.timeType.customTextActive){
  7361. formData.append('customText','-')
  7362. }
  7363. }
  7364. }
  7365. } else {
  7366. for(var k in this.selProjectList) {
  7367. var pItem = this.selProjectList[k];
  7368. var pName = pItem.projectName;
  7369. var j = pName;
  7370. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7371. flgs = true
  7372. // formData.append("degreeId", "-1");
  7373. console.log('进入了workFpppp==='+j);
  7374. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7375. if (this.isSubstitude) {
  7376. formData.append('targetUids',this.workForm.userId[0]);
  7377. }
  7378. for(var s in this.projectList) {
  7379. if(j == this.projectList[s].projectName) {
  7380. formData.append("projectId", this.projectList[s].id);
  7381. }
  7382. }
  7383. if(this.user.timeType.reportAuditType == 3){
  7384. let audItem = {}
  7385. if(this.user.timeType.auditLevel > 0){
  7386. audItem.auditorFirst = zhoD[j].auditorFirst
  7387. }
  7388. if(this.user.timeType.auditLevel > 1){
  7389. audItem.auditorSec = zhoD[j].auditorSec
  7390. }
  7391. if(this.user.timeType.auditLevel > 2){
  7392. audItem.auditorThird = zhoD[j].auditorThird
  7393. }
  7394. if(zhoD[j].ccUserid){
  7395. audItem.ccUserid = zhoD[j].ccUserid
  7396. }
  7397. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7398. }
  7399. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7400. // formData.append("subProjectId", zhoD[j].subProjectId);
  7401. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7402. formData.append("reportTimeType", this.reportTimeType.type);
  7403. if(this.reportTimeType.type == 1) {
  7404. formData.append("workingTime", zhoD[j].workingTime);
  7405. } else if(this.reportTimeType.type == 2) {
  7406. formData.append("endTime", zhoD[j].time[1]);
  7407. formData.append("startTime", zhoD[j].time[0]);
  7408. } else if(this.reportTimeType.type == 3) {
  7409. formData.append("progress", zhoD[j].progress);
  7410. formData.append("workingTime", zhoD[j].workingTime);
  7411. }
  7412. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7413. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7414. formData.append("isOvertime", 0)
  7415. formData.append("professionProgress", "[]")
  7416. if (zhoD[j].groupId) {
  7417. formData.append("groupId",zhoD[j].groupId)
  7418. } else {
  7419. //解决后台groupId数组越界的问题
  7420. formData.append("groupId",0)
  7421. }
  7422. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7423. formData.append("createDate",zhoD.zhoDataTime)
  7424. if (zhoD[j].projectAuditorId) {
  7425. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7426. }
  7427. if(zhoD[j].basecostId) {
  7428. formData.append("basecostId", zhoD[j].basecostId);
  7429. } else {
  7430. formData.append("basecostId", 0);
  7431. }
  7432. if(this.user.timeType.customDegreeActive){
  7433. if (this.user.timeType.customDegreeMultiple) {
  7434. if (zhoD[j].multiDegrIdArray) {
  7435. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7436. } else {
  7437. formData.append("multiDegrId", "[]");
  7438. }
  7439. } else {
  7440. if (zhoD[j].degreeId) {
  7441. formData.append('degreeId',zhoD[j].degreeId)
  7442. } else {
  7443. formData.append("degreeId", "-1");
  7444. }
  7445. }
  7446. }else{
  7447. formData.append("degreeId", "-1");
  7448. }
  7449. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7450. formData.append('customData',zhoD[j].customData)
  7451. }else if(this.user.timeType.customDataActive){
  7452. formData.append('customData',0)
  7453. }
  7454. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7455. formData.append('customText',zhoD[j].customText)
  7456. }else if(this.user.timeType.customTextActive){
  7457. formData.append('customText','-')
  7458. }
  7459. }
  7460. }
  7461. }
  7462. }
  7463. }
  7464. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7465. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7466. if(!next) {
  7467. this.$message({
  7468. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7469. type: 'error'
  7470. })
  7471. return
  7472. }
  7473. // 自定义维度
  7474. this.submitingReport = true;
  7475. this.http.uploadFile( this.port.report.editPort, formData,
  7476. res => {
  7477. // this.listLoading = false;
  7478. this.submitingReport = false;
  7479. if (res.code == "ok") {
  7480. this.$message({
  7481. message: this.$t('message.fillinsuccessfully'),
  7482. type: "success"
  7483. });
  7484. this.fillWeekDialogVisi = false
  7485. this.selConShow = true
  7486. this.zhoData = []
  7487. this.weekDateRange = ''
  7488. this.getReportList();
  7489. this.getDepartment();
  7490. // 关闭弹窗 并 清空
  7491. this.selProjectList = []
  7492. this.selCon = []
  7493. this.getRecentlyProject()
  7494. } else {
  7495. this.$message({
  7496. message: res.msg,
  7497. type: "error"
  7498. });
  7499. }
  7500. },
  7501. error => {
  7502. this.submitingReport = false;
  7503. this.$message({
  7504. message: error,
  7505. type: "error"
  7506. });
  7507. });
  7508. },
  7509. handleGroupAuditorData(data) {
  7510. const { reportAuditType } = this.user.timeType
  7511. if(reportAuditType != 1 && reportAuditType != 2) {
  7512. return {next: true}
  7513. }
  7514. let arrList = [];
  7515. Object.entries(data).forEach(([key, obj]) => {
  7516. Object.entries(obj).forEach(([projectName, projectData]) => {
  7517. if (projectData.workingTime && !projectData.groupId) {
  7518. arrList.push({
  7519. projectName,
  7520. date: obj.zhoDataTime,
  7521. dateText: obj.zhoDataTimeTxt
  7522. });
  7523. }
  7524. });
  7525. });
  7526. if(arrList.length > 0) {
  7527. return {
  7528. next: false,
  7529. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7530. }
  7531. } else {
  7532. return {
  7533. next: true,
  7534. error: [],
  7535. }
  7536. }
  7537. },
  7538. ChangeHourMinutestr (str) {
  7539. if (str !== "0" && str !== "" && str !== null) {
  7540. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7541. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7542. } else {
  7543. return "";
  7544. }
  7545. },
  7546. // 得到两个日期中间的日期
  7547. getdiffdate(stime,etime){
  7548. //初始化日期列表,数组
  7549. var diffdate = new Array();
  7550. var i=0;
  7551. //开始日期小于等于结束日期,并循环
  7552. while(stime<=etime){
  7553. diffdate[i] = stime;
  7554. //获取开始日期时间戳
  7555. var stime_ts = new Date(stime).getTime();
  7556. //增加一天时间戳后的日期
  7557. var next_date = stime_ts + (24*60*60*1000);
  7558. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7559. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7560. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7561. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7562. stime = next_dates_y+next_dates_m+next_dates_d;
  7563. //增加数组key
  7564. i++;
  7565. }
  7566. return diffdate;
  7567. },
  7568. // 添加模块
  7569. addDomain(i) {
  7570. var leftProgress = 10;
  7571. if (this.reportTimeType.type == 3) {
  7572. //计算已经待分配工时比例
  7573. let array = this.workForm.domains;
  7574. let totalProgress = 0;
  7575. for (var i=0;i<array.length; i++) {
  7576. totalProgress += array[i].progress;
  7577. }
  7578. if (totalProgress < 100) {
  7579. leftProgress = 100 - totalProgress;
  7580. }
  7581. }
  7582. var addItem = {
  7583. projectId: "",
  7584. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7585. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7586. ),
  7587. content: "",
  7588. progress:leftProgress,
  7589. state:2,//2-表示待提交
  7590. multiWorktime: this.reportTimeType.multiWorktime,
  7591. worktimeList:[{}],
  7592. canEdit: true,
  7593. auditorFirst: '',
  7594. auditorSec: '',
  7595. auditorThird: '',
  7596. ccUserid: ''
  7597. // degreeId: '',
  7598. };
  7599. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7600. this.$set(addItem,'isOvertime',true)
  7601. if(this.reportTimeType.type == 3){
  7602. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7603. }
  7604. }
  7605. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7606. //默认给第一个,必填字段
  7607. addItem.basecostId = this.timeBasecostList[0].id;
  7608. }
  7609. this.workForm.domains.push(addItem);
  7610. document.getElementById('workFormsItemBottom').scrollIntoView()
  7611. this.canEdit = true
  7612. if (this.reportTimeType.type == 0) {
  7613. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7614. var length = this.workForm.domains.length;
  7615. if (length == 2) {
  7616. this.showAddMore = false;
  7617. }
  7618. }
  7619. this.chuji()
  7620. this.seleChn()
  7621. },
  7622. // 移除模块
  7623. delDomain(i) {
  7624. this.workForm.domains.splice(i,1)
  7625. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7626. if (!this.originCanEdit) {
  7627. let iscan = false
  7628. for(let i in this.workForm.domains){
  7629. if(this.workForm.domains[i].canEdit){
  7630. iscan = true
  7631. }
  7632. }
  7633. this.canEdit = iscan
  7634. }
  7635. //检测当前剩下的一个,时间类型是否是全天
  7636. if (this.reportTimeType.type == 0) {
  7637. if (this.workForm.domains[0].timeType == 0) {
  7638. this.showAddMore = false;
  7639. } else {
  7640. this.showAddMore = true;
  7641. }
  7642. }
  7643. if(this.user.timeType.multiWorktime == 1) {
  7644. this.iptChangs()
  7645. } else {
  7646. this.seleChn(0)
  7647. }
  7648. },
  7649. // 改变月份
  7650. changeMonth() {
  7651. this.isWeekend = false
  7652. let date = new Date()
  7653. let nowmon = date.getMonth() + 1
  7654. let nowday = date.getDate()
  7655. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7656. if (this.isBatch == 0) {
  7657. if(this.user.timeType.fillAhead == 0){
  7658. let date_a = new Date(this.workForm.createDate)
  7659. if(date_a.getTime() > date.getTime()){
  7660. this.workForm.createDate = nowdate
  7661. }
  7662. }
  7663. //只有按天填报才能获取当天的日报
  7664. if(!this.isSubstitude){
  7665. let weekday = new Date(this.workForm.createDate).getDay()
  7666. if(this.user.companyId == 817){
  7667. if(weekday == 0){
  7668. this.isWeekend = true
  7669. }
  7670. }else{
  7671. if(weekday == 0 || weekday == 6){
  7672. this.isWeekend = true
  7673. }
  7674. }
  7675. this.getReport()
  7676. }
  7677. }else {
  7678. if(this.user.timeType.fillAhead == 0){
  7679. let date_a = new Date(this.workForm.createDate[1])
  7680. if(date_a.getTime() > date.getTime()){
  7681. this.workForm.createDate[1] = nowdate
  7682. let sdate = new Date(this.workForm.createDate[0])
  7683. let edate = new Date(this.workForm.createDate[1])
  7684. if(sdate > edate){
  7685. this.workForm.createDate[0] = this.workForm.createDate[1]
  7686. }
  7687. }
  7688. }
  7689. }
  7690. },
  7691. // 判断时间段
  7692. fns() {
  7693. for (let k in this.dateAr) {
  7694. if (!this.judege(k)) {
  7695. return false
  7696. }
  7697. }
  7698. return true
  7699. },
  7700. judege(idx){
  7701. for (let k in this.dateAr) {
  7702. if (idx !== k) {
  7703. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7704. return false
  7705. }
  7706. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7707. return false
  7708. }
  7709. }
  7710. }
  7711. return true
  7712. },
  7713. getOverlapData(data) {
  7714. let overlapData = [];
  7715. for (let i = 0; i < data.length; i++) {
  7716. for (let j = i + 1; j < data.length; j++) {
  7717. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7718. overlapData.push(data[i], data[j]);
  7719. }
  7720. }
  7721. }
  7722. return overlapData;
  7723. },
  7724. // 保存日报111111
  7725. submitReport(isDraft) {
  7726. this.isDraft = isDraft;
  7727. this.$refs.workForm.validate(valid => {
  7728. if (valid) {
  7729. if (!isDraft) {
  7730. //针对苏州景昱,单独的检查逻辑
  7731. if (this.user.companyId == 5978) {
  7732. //调接口,先检查工时是否存在异常
  7733. var totalTime = 0;
  7734. for (var t=0;t<this.workForm.domains.length; t++) {
  7735. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7736. }
  7737. var array = [];
  7738. if (this.isBatch) {
  7739. var startDate = new Date(this.workForm.createDate[0]);
  7740. var endDate = new Date(this.workForm.createDate[1]);
  7741. if (startDate > endDate) {
  7742. this.$message({
  7743. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7744. type: "error"
  7745. });
  7746. return
  7747. } else {
  7748. while(true){
  7749. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7750. array.push(workData);
  7751. startDate.setDate(startDate.getDate() + 1);
  7752. if (startDate > endDate) {
  7753. break;
  7754. }
  7755. }
  7756. }
  7757. } else {
  7758. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7759. array.push(workData)
  7760. }
  7761. this.submitingReport = true;
  7762. var passUserId = this.user.id;
  7763. if (this.isSubstitude) {
  7764. passUserId = this.targetUids;
  7765. }
  7766. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7767. res => {
  7768. this.submitingReport = false;
  7769. if (res.code == "ok") {
  7770. this.submitReportSon()
  7771. } else {
  7772. this.$confirm(res.msg, this.$t('other.prompts'), {
  7773. confirmButtonText: this.$t('huLveBingTiJiao'),
  7774. cancelButtonText: this.$t('btn.cancel'),
  7775. type: 'error'
  7776. }).then(() => {
  7777. this.submitReportSon()
  7778. }).catch(() => {
  7779. });
  7780. }
  7781. },
  7782. error => {
  7783. this.$message({
  7784. message: error,
  7785. type: "error"
  7786. });
  7787. });
  7788. } else {
  7789. if(this.totalReportHours < this.user.timeType.allday){
  7790. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7791. confirmButtonText: this.$t('btn.determine'),
  7792. cancelButtonText: this.$t('btn.cancel'),
  7793. type: 'warning'
  7794. }).then(() => {
  7795. this.submitReportSon()
  7796. }).catch(() => {
  7797. });
  7798. }else{
  7799. this.submitReportSon()
  7800. }
  7801. }
  7802. } else {
  7803. //暂存,不需要检查工时是否超过考勤
  7804. this.submitReportSon()
  7805. }
  7806. }
  7807. });
  7808. },
  7809. submitReportSon() {
  7810. this.dateAr = []
  7811. //检查重叠
  7812. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7813. let alp = []
  7814. if(this.user.timeType.multiWorktime != 1) {
  7815. for(var p in this.workForm.domains) {
  7816. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7817. let objs = {}
  7818. objs.s = this.workForm.domains[p].startTime
  7819. objs.e = this.workForm.domains[p].endTime
  7820. alp.push(objs)
  7821. }
  7822. }
  7823. this.dateAr = alp
  7824. if(this.dateAr.length > 0) {
  7825. let trus = this.fns()
  7826. if(!trus) {
  7827. this.$message({
  7828. message: this.$t('message.Filledtimeperiodsoverlap'),
  7829. type: "error"
  7830. });
  7831. return
  7832. }
  7833. }
  7834. } else {
  7835. for(var p in this.workForm.domains) {
  7836. var slll = this.workForm.domains[p]
  7837. for(var o in slll.worktimeList) {
  7838. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7839. let objs = {}
  7840. objs.s = slll.worktimeList[o].startTime
  7841. objs.e = slll.worktimeList[o].endTime
  7842. alp.push(objs)
  7843. }
  7844. }
  7845. }
  7846. this.dateAr = alp
  7847. if(this.dateAr.length > 0) {
  7848. let trus = this.fns()
  7849. if(!trus) {
  7850. this.$message({
  7851. message: this.$t('message.Filledtimeperiodsoverlap'),
  7852. type: "error"
  7853. });
  7854. return
  7855. }
  7856. }
  7857. }
  7858. }
  7859. //检查子项目
  7860. if (this.user.timeType.subProMustFill == 1) {
  7861. for(var p in this.workForm.domains) {
  7862. var oneProItem = this.workForm.domains[p]
  7863. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7864. //没有选择子项目
  7865. this.$message({
  7866. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7867. type: "error"
  7868. });
  7869. return
  7870. }
  7871. }
  7872. }
  7873. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7874. if (this.user.companyId == this.yuzhongCompId) {
  7875. for(var p in this.workForm.domains) {
  7876. var oneProItem = this.workForm.domains[p]
  7877. if (!oneProItem.extraField1) {
  7878. this.$message({
  7879. message: this.$t('jiaoSeBiTianQingJianCha'),
  7880. type: "error"
  7881. });
  7882. return
  7883. }
  7884. if (!oneProItem.extraField2) {
  7885. this.$message({
  7886. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7887. type: "error"
  7888. });
  7889. return
  7890. }
  7891. if (!oneProItem.extraField3) {
  7892. this.$message({
  7893. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7894. type: "error"
  7895. });
  7896. return
  7897. }
  7898. }
  7899. }
  7900. // return
  7901. //代填的情况,检查人员是否已经选择
  7902. if (this.isSubstitude) {
  7903. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7904. this.$message({
  7905. message: this.$t('message.pleaseselectthepersontofillin'),
  7906. type: "error"
  7907. });
  7908. return;
  7909. }
  7910. }
  7911. //检查时间,全天和上下午不能同时存在
  7912. if (this.reportTimeType.type == 0) {
  7913. var alldayNum = 0;
  7914. var amNum = 0;
  7915. var pmNum = 0;
  7916. for(var i in this.workForm.domains) {
  7917. if (this.workForm.domains[i].timeType == 0) {
  7918. alldayNum ++;
  7919. } else if (this.workForm.domains[i].timeType == 1) {
  7920. amNum++;
  7921. } else if (this.workForm.domains[i].timeType == 2) {
  7922. pmNum++;
  7923. }
  7924. }
  7925. if (alldayNum > 1) {
  7926. this.$message({
  7927. // message: "工作时间-全天,只能选择一次",
  7928. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7929. type: "error"
  7930. });
  7931. return;
  7932. }
  7933. if (amNum > 1) {
  7934. this.$message({
  7935. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7936. type: "error"
  7937. });
  7938. return;
  7939. }
  7940. if (pmNum > 1) {
  7941. this.$message({
  7942. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7943. type: "error"
  7944. });
  7945. return;
  7946. }
  7947. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7948. this.$message({
  7949. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7950. type: "error"
  7951. });
  7952. return;
  7953. }
  7954. } else if (this.reportTimeType.type == 3) {
  7955. //总百分比不能超过100%
  7956. let total = 0;
  7957. this.workForm.domains.forEach(w=>{total += w.progress});
  7958. if (total > 100) {
  7959. this.$message({
  7960. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7961. type: "error"
  7962. });
  7963. return;
  7964. } else if (total < 100) {
  7965. this.$message({
  7966. message: this.$t('message.cannotbesubmitted'),
  7967. type: "error"
  7968. });
  7969. return;
  7970. }
  7971. }
  7972. this.listLoading = true;
  7973. let formData = new FormData();
  7974. formData.append("draft", this.isDraft);
  7975. var totalTime = 0;
  7976. for (var t=0;t<this.workForm.domains.length; t++) {
  7977. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7978. }
  7979. //批量填报不校验考勤时长,交给后台校验
  7980. if (!this.isBatch) {
  7981. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7982. if (this.workForm.time){
  7983. if (this.workForm.time.workHours == 0){
  7984. this.$message({
  7985. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7986. type: 'error'
  7987. })
  7988. return
  7989. }
  7990. }else{
  7991. this.$message({
  7992. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7993. type: 'error'
  7994. })
  7995. return
  7996. }
  7997. }
  7998. }
  7999. //针对凡己和景昱,苏州博海,此处不校验考勤时长
  8000. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.workForm.time) {
  8001. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8002. this.$message({
  8003. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8004. type: "error"
  8005. });
  8006. return;
  8007. }
  8008. }
  8009. for(var i in this.workForm.domains) {
  8010. // 检查任务/里程碑是否为必填
  8011. let taskRequired = this.user.timeType.taskRequired
  8012. if(taskRequired == 1) {
  8013. if(!this.workForm.domains[i].taskId) {
  8014. this.$message({
  8015. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8016. type: "error"
  8017. });
  8018. return
  8019. }
  8020. }
  8021. if(this.user.timeType.reportAuditType == 3){
  8022. let audItem = {}
  8023. let auditRule = ''
  8024. if(this.workForm.domains[i].id){
  8025. audItem.reportId = this.workForm.domains[i].id
  8026. }
  8027. if(this.user.timeType.auditLevel > 0){
  8028. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8029. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8030. }
  8031. if(this.user.timeType.auditLevel > 1){
  8032. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8033. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8034. }
  8035. if(this.user.timeType.auditLevel > 2){
  8036. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8037. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8038. }
  8039. if(this.workForm.domains[i].ccUserid){
  8040. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8041. }
  8042. if(auditRule){
  8043. auditRule = auditRule.substring(0,auditRule.length - 1)
  8044. this.$message({
  8045. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8046. type: 'error'
  8047. })
  8048. return
  8049. }
  8050. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8051. }
  8052. if (this.user.timeType.customDegreeActive) {
  8053. if (this.user.timeType.customDegreeMultiple) {
  8054. //多选
  8055. if (this.workForm.domains[i].multiDegrIdArray) {
  8056. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8057. degreeArray = degreeArray.replace(/,/g,"@");
  8058. formData.append("multiDegrId", degreeArray);
  8059. } else {
  8060. formData.append("multiDegrId", '[]');
  8061. }
  8062. } else {
  8063. //单选
  8064. if (this.workForm.domains[i].degreeId) {
  8065. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8066. } else {
  8067. formData.append("degreeId", -1);
  8068. }
  8069. }
  8070. } else {
  8071. formData.append("degreeId", -1);
  8072. }
  8073. if(this.workForm.domains[i].customData) {
  8074. // var sss = this.workForm.domains[i].degreeId.toString()
  8075. formData.append("customData", this.workForm.domains[i].customData);
  8076. } else {
  8077. formData.append("customData", 0);
  8078. }
  8079. if(this.workForm.domains[i].customText) {
  8080. formData.append("customText", this.workForm.domains[i].customText);
  8081. } else {
  8082. formData.append("customText", '-');
  8083. }
  8084. if (this.workForm.domains[i].id) {
  8085. formData.append("id", this.workForm.domains[i].id);
  8086. } else {
  8087. formData.append("id", -1);
  8088. }
  8089. formData.append("projectId", this.workForm.domains[i].projectId);
  8090. if (this.workForm.domains[i].subProjectId) {
  8091. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8092. } else {
  8093. formData.append("subProjectId", 0);
  8094. }
  8095. if (this.workForm.domains[i].groupId) {
  8096. formData.append("groupId", this.workForm.domains[i].groupId);
  8097. } else {
  8098. formData.append("groupId", 0);
  8099. }
  8100. if (this.workForm.domains[i].taskId) {
  8101. formData.append("taskId", this.workForm.domains[i].taskId);
  8102. } else {
  8103. formData.append("taskId", 0);
  8104. }
  8105. if (this.workForm.domains[i].taskFinish == true) {
  8106. formData.append("taskFinish", 1);
  8107. } else {
  8108. formData.append("taskFinish", 0);
  8109. }
  8110. formData.append("reportTimeType", this.reportTimeType.type);
  8111. if (this.reportTimeType.type == 0) {
  8112. formData.append("timeType", this.workForm.domains[i].timeType);
  8113. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8114. formData.append("workingTime", workingTime);
  8115. } else if (this.reportTimeType.type == 1){
  8116. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8117. } else if (this.reportTimeType.type == 2) {
  8118. formData.append("endTime", this.workForm.domains[i].endTime);
  8119. formData.append("startTime", this.workForm.domains[i].startTime);
  8120. } else if (this.reportTimeType.type == 3) {
  8121. //按比例分配
  8122. formData.append("progress", this.workForm.domains[i].progress);
  8123. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8124. }
  8125. if(this.user.timeType.choseFromAlbum == 1 ) {
  8126. console.log(this.workForm.domains[i].imgList)
  8127. if(this.workForm.domains[i].imgList) {
  8128. let imgListFor = this.workForm.domains[i].imgList
  8129. for(var b in imgListFor) {
  8130. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8131. }
  8132. console.log(imgListFor)
  8133. let m = JSON.stringify(imgListFor);
  8134. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8135. formData.append("picStr", m);
  8136. } else {
  8137. formData.append("picStr", '[]');
  8138. }
  8139. }
  8140. //处理多个时间事项
  8141. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8142. if (this.reportTimeType.multiWorktime == 1) {
  8143. //检查时间是否有重叠
  8144. var workList = this.workForm.domains[i].worktimeList;
  8145. for (var j=0;j<workList.length; j++) {
  8146. var curItem = workList[j];
  8147. //检查开始时间是否大于结束时间
  8148. if (curItem.startTime >= curItem.endTime) {
  8149. this.$message({
  8150. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8151. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8152. type: "error"
  8153. });
  8154. return;
  8155. }
  8156. //时间不可重叠
  8157. if (this.reportTimeType.timeCanOverlap == 0) {
  8158. for (var p = j+1;p<workList.length; p++) {
  8159. var jItem = workList[p];
  8160. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8161. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8162. this.$message({
  8163. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8164. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8165. type: "error"
  8166. });
  8167. return;
  8168. }
  8169. }
  8170. }
  8171. }
  8172. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8173. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8174. formData.append("content", m);
  8175. } else {
  8176. if (this.workForm.domains[i].content) {
  8177. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8178. m = m.replace(/,/g,",");
  8179. console.log(m, '需要传值的数据')
  8180. // formData.append("content", this.workForm.domains[i].content);
  8181. formData.append("content", m);
  8182. } else {
  8183. formData.append("content", '-');
  8184. }
  8185. }
  8186. if (this.isBatch == 0) {
  8187. formData.append("createDate", this.workForm.createDate);
  8188. } else {
  8189. //批量填报,时间范围
  8190. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8191. }
  8192. if(this.workForm.domains[i].isOvertime) {
  8193. formData.append("isOvertime", 1);
  8194. } else {
  8195. formData.append("isOvertime", 0);
  8196. }
  8197. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8198. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8199. } else {
  8200. formData.append("overtimeHours", 0);
  8201. }
  8202. if(this.workForm.domains[i].basecostId) {
  8203. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8204. } else {
  8205. formData.append("basecostId", 0);
  8206. }
  8207. if (this.workForm.userId != null) {
  8208. var targetUids = '';
  8209. this.workForm.userId.forEach(u=>{
  8210. targetUids += u + '@';
  8211. });
  8212. if (targetUids.length > 0) {
  8213. targetUids = targetUids.substring(0, targetUids.length -1);
  8214. formData.append("targetUids", targetUids);
  8215. }
  8216. }
  8217. //项目专业进度
  8218. if (this.workForm.domains[i].professionProgress) {
  8219. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8220. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8221. formData.append("professionProgress", m);
  8222. } else {
  8223. formData.append("professionProgress", "[]");
  8224. }
  8225. if (this.workForm.domains[i].stage) {
  8226. formData.append("stage", this.workForm.domains[i].stage);
  8227. } else {
  8228. formData.append("stage", "-");
  8229. }
  8230. if (this.workForm.domains[i].projectAuditorId) {
  8231. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8232. } else {
  8233. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8234. this.$message({
  8235. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8236. type: "error"
  8237. });
  8238. return;
  8239. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8240. //分组负责人先审核, 确定是选择了任务分组
  8241. if (this.workForm.domains[i].taskGroups.length == 0) {
  8242. this.$message({
  8243. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8244. type: "error"
  8245. });
  8246. return;
  8247. } else if (!this.workForm.domains[i].groupId) {
  8248. // console.log(this.workForm.domains[i]);
  8249. this.$message({
  8250. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8251. type: "error"
  8252. });
  8253. return;
  8254. }
  8255. }
  8256. }
  8257. if (this.user.companyId == this.yuzhongCompId) {
  8258. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8259. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8260. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8261. }
  8262. //依斯贝的服务Id
  8263. if (this.user.companyId == this.yisibeiCompId) {
  8264. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8265. }
  8266. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8267. this.$message({
  8268. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8269. type: "error"
  8270. });
  8271. return
  8272. }
  8273. if(this.user.timeType.userWithMultiDept == 1) {
  8274. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8275. }
  8276. }
  8277. this.submitingReport = true;
  8278. this.http.uploadFile( this.port.report.editPort, formData,
  8279. res => {
  8280. this.listLoading = false;
  8281. this.submitingReport = false;
  8282. if (res.code == "ok") {
  8283. if(res.msg!=null){
  8284. this.$message({
  8285. dangerouslyUseHTMLString: true,
  8286. message: res.msg,
  8287. type: "warning",
  8288. showClose: true,
  8289. duration: 0
  8290. });
  8291. }else{
  8292. this.$message({
  8293. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8294. type: "success"
  8295. });
  8296. }
  8297. this.dialogVisible = false;
  8298. this.jsDay = 0
  8299. this.jsTime = 0
  8300. this.getReportList();
  8301. this.getDepartment();
  8302. this.getRecentlyProject()
  8303. } else {
  8304. this.$message({
  8305. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8306. type: "error"
  8307. });
  8308. }
  8309. },
  8310. error => {
  8311. this.listLoading = false;
  8312. this.submitingReport = false;
  8313. this.$message({
  8314. message: error,
  8315. type: "error"
  8316. });
  8317. });
  8318. },
  8319. // 判断是展示那个工时导入
  8320. imports() {
  8321. if(this.user.timeType.syncCorpwxTime == 0) {
  8322. this.importDialog = true
  8323. } else {
  8324. this.importWxDialog = true
  8325. }
  8326. },
  8327. // 跳转
  8328. junpToDeskTop(id) {
  8329. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8330. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8331. },
  8332. // 通过日报
  8333. approve(id, item) {
  8334. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8335. this.approveinData = {
  8336. id: id,
  8337. date: this.date +day,
  8338. reportIds: item.id
  8339. }
  8340. if(this.user.timeType.needEvaluate == 1){
  8341. this.$set(this.approveinData,'evaluate','')
  8342. this.approveinDialog = true
  8343. }else{
  8344. this.logining = true;
  8345. this.approveinfun()
  8346. }
  8347. },
  8348. approveinfun(){
  8349. this.http.post( this.port.report.approve, this.approveinData,
  8350. res => {
  8351. this.logining = false;
  8352. if (res.code == "ok") {
  8353. this.approveinDialog = false
  8354. this.$message({
  8355. message: this.$t('message.Reviewsucceeded'),
  8356. type: "success"
  8357. });
  8358. this.refreshReportData(this.approveinData.reportIds);
  8359. this.getDepartment();
  8360. } else {
  8361. this.$message({
  8362. message: res.msg,
  8363. type: "error"
  8364. });
  8365. }
  8366. },
  8367. error => {
  8368. this.logining = false;
  8369. this.$message({
  8370. message: error,
  8371. type: "error"
  8372. });
  8373. });
  8374. },
  8375. //撤回日报
  8376. cancel(item,e) {
  8377. // console.log('can can need',item);
  8378. this.logining = true;
  8379. var ids = '';
  8380. var data = e ? item : item.data;
  8381. data.forEach(element => {
  8382. if(element.id){
  8383. ids +=(element.id+',');
  8384. }
  8385. });
  8386. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8387. res => {
  8388. this.logining = false;
  8389. if (res.code == "ok") {
  8390. this.$message({
  8391. message:this.$t('message.Withdrawalsucceeded'),
  8392. type: "success"
  8393. });
  8394. this.getReportList();
  8395. if(e){this.getReport()}
  8396. this.getDepartment();
  8397. } else {
  8398. this.$message({
  8399. message: res.msg,
  8400. type: "error"
  8401. });
  8402. }
  8403. },
  8404. error => {
  8405. this.logining = false;
  8406. this.$message({
  8407. message: error,
  8408. type: "error"
  8409. });
  8410. });
  8411. },
  8412. showDenyDialog(id,i, item) {
  8413. this.denyReasonDialog = true;
  8414. this.isDenying = false;
  8415. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8416. var ids = item.id;
  8417. // var data = item.data;
  8418. // data.forEach(element => {
  8419. // ids +=(element.id+',');
  8420. // });
  8421. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8422. },
  8423. // 未通过日报
  8424. deny() {
  8425. this.logining = true;
  8426. this.isDenying = true;
  8427. this.http.post( this.port.report.deny, this.denyForm,
  8428. res => {
  8429. this.logining = false;
  8430. this.isDenying = false;
  8431. if (res.code == "ok") {
  8432. this.$message({
  8433. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8434. type: "success"
  8435. });
  8436. this.refreshReportData(this.denyForm.reportIds);
  8437. this.getDepartment();
  8438. this.denyReasonDialog = false;
  8439. } else {
  8440. this.$message({
  8441. message: res.msg,
  8442. type: "error"
  8443. });
  8444. }
  8445. },
  8446. error => {
  8447. this.logining = false;
  8448. this.$message({
  8449. message: error,
  8450. type: "error"
  8451. });
  8452. });
  8453. },
  8454. // 查看工时记录弹窗
  8455. toView() {
  8456. this.toViewDialogVisible = true
  8457. this.toViewloading = true
  8458. this.getToView()
  8459. },
  8460. getToView() {
  8461. this.http.post( '/report-import-log/getList', this.toViewForm,
  8462. res => {
  8463. this.toViewloading = false;
  8464. if (res.code == "ok") {
  8465. // console.log(res.data, '数据数据')
  8466. this.toViewList = res.data.records
  8467. this.toViewForm.total = res.data.total
  8468. } else {
  8469. this.toViewloading = false;
  8470. this.$message({
  8471. message: res.msg,
  8472. type: "error"
  8473. });
  8474. }
  8475. })
  8476. },
  8477. // 触发 selectCat 组件更改他的值
  8478. selectCatCli(obj) {
  8479. // console.log(obj, '看看')
  8480. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8481. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8482. },
  8483. vueCasader(obj) {
  8484. console.log(obj, '看看值', this.departmentList)
  8485. if(obj.distinction == 1 && obj.item) {
  8486. let arr = []
  8487. arr.push(obj.item.value)
  8488. this.exportParam.departmentId = arr
  8489. }
  8490. if(obj.distinction == '10' && obj) {
  8491. const { id, other } = obj
  8492. this.workForm.domains[other].reportTargetDeptId = id
  8493. }
  8494. if(obj.distinction == '14' && obj) {
  8495. let arr = []
  8496. arr.push(obj.id)
  8497. this.deptIdForHasReport = arr
  8498. this.showMonthWorkTime()
  8499. }
  8500. if(obj.distinction == '15' && obj) {
  8501. let arr = []
  8502. arr.push(obj.id)
  8503. this.deptIdForNoReport = arr
  8504. this.showMonthNotWorkTime()
  8505. }
  8506. if(obj.distinction == '16' && obj) {
  8507. let arr = []
  8508. arr.push(obj.id)
  8509. this.deptIdForReminder = arr
  8510. this.showMonthWorkTimeReminder()
  8511. }
  8512. },
  8513. //分页
  8514. handleCurrentChange(val) {
  8515. this.toViewForm.pageIndex = val;
  8516. this.getToView();
  8517. },
  8518. handleSizeChange(val) {
  8519. this.toViewForm.pageSize = val;
  8520. this.getToView();
  8521. },
  8522. getAllUsersList(){
  8523. this.http.post('/user/getSimpleActiveUserList',{
  8524. },res => {
  8525. if(res.code == 'ok'){
  8526. this.allUsersList = res.data
  8527. }else{
  8528. this.$message({
  8529. message: res.msg,
  8530. type: 'error'
  8531. })
  8532. }
  8533. },err => {
  8534. this.$message({
  8535. message: err,
  8536. type: 'error'
  8537. })
  8538. })
  8539. },
  8540. //景昱变更提醒
  8541. changeReminder(item){
  8542. console.log("============",item)
  8543. let parameter={
  8544. startDate: this.WorktimeDatepickValue[0],
  8545. endDate: this.WorktimeDatepickValue[1],
  8546. }
  8547. if(item){
  8548. parameter.createDate=item.createDate,
  8549. parameter.userId=item.userId
  8550. }
  8551. this.http.post('/report/changeReminder',parameter,res => {
  8552. if(res.code == 'ok'){
  8553. this.$message({
  8554. message: res.msg,
  8555. type: 'success'
  8556. })
  8557. }else{
  8558. this.$message({
  8559. message: res.msg,
  8560. type: 'error'
  8561. })
  8562. }
  8563. },err => {
  8564. this.$message({
  8565. message: err,
  8566. type: 'error'
  8567. })
  8568. })
  8569. },
  8570. //景昱取消异常
  8571. cancelReminder(item){
  8572. let parameter={}
  8573. if(item){
  8574. parameter.createDate=item.createDate,
  8575. parameter.userId=item.userId
  8576. }
  8577. this.http.post('/report/cancelReminder',parameter,res => {
  8578. if(res.code == 'ok'){
  8579. this.$message({
  8580. message: res.msg,
  8581. type: 'success'
  8582. })
  8583. }else{
  8584. this.$message({
  8585. message: res.msg,
  8586. type: 'error'
  8587. })
  8588. }
  8589. },err => {
  8590. this.$message({
  8591. message: err,
  8592. type: 'error'
  8593. })
  8594. })
  8595. this.showMonthWorkTimeReminder()
  8596. },
  8597. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8598. fillWeekCustomClne() {
  8599. this.fillWeekDialogVisiCustom = false
  8600. },
  8601. fillWeekCustomClneTwo() {
  8602. this.fillWeekDialogVisiCustomTwo = false
  8603. },
  8604. fillWeekCustomSubmit() {
  8605. this.getReportList();
  8606. this.getDepartment();
  8607. this.getRecentlyProject()
  8608. },
  8609. // 待填日报姓名搜索
  8610. nameAearchSeek(flg) {
  8611. if(!this.nameAearch) {
  8612. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8613. return
  8614. }
  8615. if(flg) {
  8616. this.enterpriseWechatgetUser()
  8617. }
  8618. },
  8619. handleThreeData(userList) {
  8620. console.log(userList, '人员数据')
  8621. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8622. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8623. },
  8624. // 过滤树节点
  8625. filterTreeNodes(treeData, filterKeywords) {
  8626. return treeData.filter((node) => {
  8627. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8628. if (node.children && node.children.length > 0) {
  8629. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8630. }
  8631. return true;
  8632. }
  8633. if (node.children && node.children.length > 0) {
  8634. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8635. return node.children.length > 0;
  8636. }
  8637. return false;
  8638. });
  8639. },
  8640. // 企业微信获取人员
  8641. enterpriseWechatgetUser() {
  8642. this.deptMembDataLoading = true
  8643. this.http.post('/user/getEmployeeList',{
  8644. departmentId: -1,
  8645. pageIndex: 1,
  8646. pageSize: 100,
  8647. keyword: this.nameAearch,
  8648. status: '',
  8649. roleId: '',
  8650. cursor: '',
  8651. onlyDirect: '',
  8652. matchingType: ''
  8653. },res => {
  8654. if(res.code == 'ok'){
  8655. this.deptMembDataLoading = false
  8656. const userListName = res.data.records.map(item => item.name)
  8657. this.handleThreeData(userListName)
  8658. setTimeout(() => {
  8659. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8660. }, 200)
  8661. }else{
  8662. this.deptMembDataLoading = false
  8663. this.$message({
  8664. message: res.msg,
  8665. type: 'error'
  8666. })
  8667. }
  8668. },err => {
  8669. this.deptMembDataLoading = false
  8670. this.$message({
  8671. message: err,
  8672. type: 'error'
  8673. })
  8674. })
  8675. },
  8676. changeTreeNodeStatus(node) {
  8677. console.log(node)
  8678. let allZt = true
  8679. node.expanded = allZt
  8680. for (let i = 0; i < node.childNodes.length; i++) {
  8681. node.childNodes[i].expanded = allZt
  8682. if (node.childNodes[i].childNodes.length > 0) {
  8683. this.changeTreeNodeStatus(node.childNodes[i])
  8684. }
  8685. }
  8686. },
  8687. // 按周填报获取相关任务
  8688. async getWeeklyTaskList(item) {
  8689. console.log(item, '<=== 数据')
  8690. const { projectId, groupId, stage, taskId } = item
  8691. console.log(projectId, groupId, stage)
  8692. let parms = { projectId, isSubstitude: 0 }
  8693. groupId ? parms.groupId = groupId : ''
  8694. stage ? parms.stage = stage : ''
  8695. const { data } = await this.postData('/task/getRecentTask', parms)
  8696. this.zhoBao.taskId = taskId
  8697. this.$set(this.zhoBao, 'taskList', data)
  8698. console.log(this.zhoBao)
  8699. },
  8700. // 封装 post 请求
  8701. postData(url, params) {
  8702. return new Promise((resolve, reject) => {
  8703. this.http.post(url, { ...params },
  8704. res => {
  8705. resolve(res)
  8706. },
  8707. error => {
  8708. this.$message({
  8709. message: error,
  8710. type: "error"
  8711. });
  8712. reject(error)
  8713. })
  8714. })
  8715. },
  8716. // 自定义事件
  8717. selectCal(obj) {
  8718. console.log(obj, '传数据来源')
  8719. if(obj.distinction == '1') {
  8720. this.zhoBao.projectAuditorId = obj.id
  8721. } else if(obj.distinction == '2') {
  8722. this.zhoBao.auditorFirst = obj.id
  8723. } else if(obj.distinction == '3') {
  8724. this.zhoBao.auditorSec = obj.id
  8725. } else if(obj.distinction == '4') {
  8726. this.zhoBao.auditorThird = obj.id
  8727. } else if(obj.distinction == '5') {
  8728. this.zhoBao.ccUserid = obj.id
  8729. } else if(obj.distinction == '12') {
  8730. this.usersListId = obj.id
  8731. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8732. this.searchKeyword = obj.name
  8733. } else {
  8734. this.searchKeyword = ''
  8735. }
  8736. this.searchScreen(0)
  8737. } else if(obj.distinction == '13') {
  8738. this.usersListId = obj.id
  8739. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8740. this.searchKeyword = obj.name
  8741. } else {
  8742. this.searchKeyword = ''
  8743. }
  8744. this.searchScreen(1)
  8745. }
  8746. }
  8747. },
  8748. created() {
  8749. this.getUsers()
  8750. let height = window.innerHeight;
  8751. this.tableHeight = height - 178;
  8752. const that = this;
  8753. window.onresize = function temp() {
  8754. that.tableHeight = window.innerHeight - 178;
  8755. };
  8756. this.toViewForm.companyId = this.user.companyId
  8757. this.initDrag([{
  8758. type: "LR",
  8759. domClass: {
  8760. // 中间分割线的名字
  8761. resize: "line-line",
  8762. // 左侧盒子的名字
  8763. left: "box-left",
  8764. // 右侧盒子的名字
  8765. right: "box-right",
  8766. // 父级的名字
  8767. box: "box-father",
  8768. },
  8769. otherInfo: {
  8770. // 限制左边栏最低宽度
  8771. leftWidth: 120,
  8772. },
  8773. },
  8774. {
  8775. type: "LR",
  8776. domClass: {
  8777. // 中间分割线的名字
  8778. resize: "line-second",
  8779. // 左侧盒子的名字
  8780. left: "left-laowang",
  8781. // 右侧盒子的名字
  8782. right: "box-second-father",
  8783. // 父级的名字
  8784. box: "grand",
  8785. },
  8786. otherInfo: {
  8787. // 限制左边栏最低宽度
  8788. leftWidth: 120,
  8789. },
  8790. },
  8791. ]);
  8792. }
  8793. };
  8794. </script>
  8795. <style lang="scss" scoped>
  8796. .fillWeekDialogVisiCustom {
  8797. width: 100%;
  8798. height: 70vh;
  8799. }
  8800. .fillWeekCustom {
  8801. .el-dialog__body {
  8802. padding: 20px 20px !important;
  8803. }
  8804. }
  8805. .photos {
  8806. position: relative;
  8807. display: flex;
  8808. flex-wrap: wrap;
  8809. }
  8810. .photos_img {
  8811. width: 120px;
  8812. height: 120px;
  8813. margin-right: 20px;
  8814. margin-bottom: 20px;
  8815. cursor: pointer;
  8816. img {
  8817. width: 100%;
  8818. height: 100%;
  8819. }
  8820. }
  8821. .paginatis {
  8822. padding: 10px 10px;
  8823. background: #f2f2f2;
  8824. }
  8825. .waiting {
  8826. color:orange;
  8827. }
  8828. .filledReportStyle {
  8829. color:#32CD32;
  8830. }
  8831. .RejectStyle {
  8832. color:red;
  8833. }
  8834. .waitSubmitStyle{
  8835. color: #409eff;
  8836. }
  8837. .chooseDate {
  8838. .waiting {
  8839. color: #20a0ff;
  8840. }
  8841. .filledReportStyle {
  8842. color:#20a0ff;
  8843. }
  8844. .RejectStyle {
  8845. color: #20a0ff;
  8846. }
  8847. .waitSubmitStyle{
  8848. color: #20a0ff;
  8849. }
  8850. }
  8851. .allDaily {
  8852. width:100%;
  8853. }
  8854. .report_title {
  8855. padding:10px 0;
  8856. color:#666;
  8857. }
  8858. .clearfix {
  8859. overflow-x: auto;
  8860. white-space: nowrap;
  8861. padding: 15px 0 10px 0;
  8862. // overflow-y: hidden;
  8863. .date_item {
  8864. padding: 0 3px;
  8865. cursor: pointer;
  8866. position: relative;
  8867. }
  8868. .chooseDate {
  8869. position: absolute;
  8870. bottom: -3px;
  8871. width: 37px;
  8872. height: 2px;
  8873. left: 14px;
  8874. background: #20a0ff;
  8875. }
  8876. }
  8877. .one_daily {
  8878. i {
  8879. color: #9ed0ff;
  8880. margin-right: 5px;
  8881. }
  8882. .one_daily_body {
  8883. padding: 10px 0px;
  8884. p {
  8885. margin: 0;
  8886. line-height: 30px;
  8887. }
  8888. }
  8889. ul {
  8890. padding: 0;
  8891. }
  8892. }
  8893. .checkbtn {
  8894. float: right;
  8895. margin-top: -10px;
  8896. }
  8897. .selConStyle{
  8898. margin-top:9rem;
  8899. margin-bottom:11rem;
  8900. .selConStyle_title{
  8901. height: 3rem;
  8902. text-align: center;
  8903. font-size: 17px;
  8904. }
  8905. .el-select{
  8906. margin: 0 15%;
  8907. width: 70%;
  8908. }
  8909. }
  8910. </style>
  8911. <style lang="scss">
  8912. /*去除upload组件过渡效果*/
  8913. .photos .el-upload-list__item {
  8914. transition: none !important;
  8915. }
  8916. .daily {
  8917. .el-card__body {
  8918. height: 80%;
  8919. overflow-y: auto;
  8920. }
  8921. .el-card__header {
  8922. padding: 0 20px;
  8923. }
  8924. }
  8925. .membListClass{
  8926. .el-dialog__body{
  8927. padding-top: 10px;
  8928. }
  8929. }
  8930. // .editReportDialog .el-dialog__footer{
  8931. // position: sticky;
  8932. // bottom: 0;
  8933. // background: #fff;
  8934. // height: 70px;
  8935. // z-index: 1010;
  8936. // }
  8937. .editReportDialog{
  8938. min-width: 800px;
  8939. }
  8940. .touruxiangmu{
  8941. max-width: 1000px;
  8942. }
  8943. </style>
  8944. <style scoped>
  8945. /* 项目标签的样式 */
  8946. .el-tag + .el-tag {
  8947. margin-left: 10px;
  8948. }
  8949. .button-new-tag {
  8950. margin-left: 10px;
  8951. height: 32px;
  8952. line-height: 30px;
  8953. padding-top: 0;
  8954. padding-bottom: 0;
  8955. }
  8956. .input-new-tag {
  8957. width: 90px;
  8958. margin-left: 10px;
  8959. vertical-align: bottom;
  8960. }
  8961. .selectworktime .el-table__fixed-body-wrapper{
  8962. top: 48px !important;
  8963. }
  8964. .selectworktime_export .selectworktime_export_l{
  8965. width: 650px;
  8966. float: left;
  8967. height: 42px;
  8968. }
  8969. .approvalProcessBox{
  8970. margin-left: 30px;
  8971. font-size: 14px;
  8972. line-height: 16px;
  8973. cursor: pointer;
  8974. }
  8975. .approvalProcessBox i {
  8976. margin-right: 0;
  8977. height: 16px;
  8978. width: 16px;
  8979. display: inline-block;
  8980. transform: scale(1.2);
  8981. position: relative;
  8982. top: 0.5px;
  8983. color: #409eff;
  8984. }
  8985. .approvalProcessBox .approvalProcessClick{
  8986. cursor: pointer;
  8987. color: #409eff;
  8988. font-size: 14px;
  8989. }
  8990. .approvalProcessBox:hover .approvalProcessClick{
  8991. color: #3485fb;
  8992. }
  8993. </style>
  8994. <style lang="scss" scoped>
  8995. .bionicClass {
  8996. -webkit-appearance: none;
  8997. background-color: #FFF;
  8998. background-image: none;
  8999. border-radius: 4px;
  9000. border: 1px solid #DCDFE6;
  9001. box-sizing: border-box;
  9002. color: #606266;
  9003. display: inline-block;
  9004. height: 40px;
  9005. line-height: 40px;
  9006. outline: 0;
  9007. padding: 0 15px;
  9008. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9009. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9010. width: 350px;
  9011. cursor: pointer;
  9012. .bionicClassText {
  9013. color: #C0C4CC;
  9014. }
  9015. }
  9016. // 加班样式
  9017. .overtime {
  9018. display: inline-block;
  9019. margin-left: 20px;
  9020. input {
  9021. display: inline-block;
  9022. margin-top: 5px;
  9023. }
  9024. }
  9025. .plus {
  9026. display: inline-block;
  9027. }
  9028. // .tages {
  9029. // float: right;
  9030. // }
  9031. .overtime {
  9032. display: inline-block;
  9033. margin-left: 30px;
  9034. }
  9035. .bloks {
  9036. display: inline-block;
  9037. width: 380px;
  9038. }
  9039. .zhiss {
  9040. display: flex;
  9041. justify-content: space-around;
  9042. align-items: center;
  9043. }
  9044. .zhoFel {
  9045. display: flex;
  9046. justify-content: space-between;
  9047. align-items: center;
  9048. }
  9049. // 左右滑动样式
  9050. .line {
  9051. width: 30px;
  9052. /* height: 500px; */
  9053. background: #f2f2f2;
  9054. cursor: w-resize;
  9055. }
  9056. .box-father {
  9057. border: 8px solid #000;
  9058. }
  9059. .line-second {
  9060. width: 10px;
  9061. /* background: red; */
  9062. }
  9063. .flex {
  9064. display: flex;
  9065. width: 100%;
  9066. }
  9067. .box-left {
  9068. flex: 0 0 400px;
  9069. /* height: 600px; */
  9070. /* background: blue; */
  9071. }
  9072. .box-right {
  9073. /* height: 600px; */
  9074. /* background: green; */
  9075. flex: 1;
  9076. }
  9077. .box-postion {
  9078. width: 200px;
  9079. /* height: 400px; */
  9080. background: #ccc;
  9081. }
  9082. .custom-tree-node {
  9083. flex: 1;
  9084. display: flex;
  9085. align-items: center;
  9086. justify-content: space-between;
  9087. font-size: 14px;
  9088. padding-right: 8px;
  9089. }
  9090. .daitianrbao {
  9091. width: 100%;
  9092. box-sizing: border-box;
  9093. height: 40px;
  9094. border-radius: 4px;
  9095. border: 1px solid #DCDFE6;
  9096. overflow: hidden;
  9097. text-overflow: ellipsis;
  9098. display: flex;
  9099. // align-items: center;
  9100. }
  9101. .daitianrbao .spnn {
  9102. display: inline-block;
  9103. box-sizing: border-box;
  9104. padding: 0 15px;
  9105. overflow: hidden;
  9106. text-overflow: ellipsis;
  9107. }
  9108. .daitianrbao .hover {
  9109. color: #DCDFE6 !important;
  9110. }
  9111. </style>