daily.vue 493 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309
  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. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  165. <!-- 工作总时长: -->
  166. {{$t('other.totalWorkingHours')}}
  167. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  168. <span >{{item1.reportTime | amounts}}</span>h
  169. </span>
  170. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  171. <i class="iconfont firerock-iconliucheng1"></i>
  172. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  173. <!-- 审批流程 -->
  174. {{$t('other.approvalProcess')}}
  175. </span>
  176. </span>
  177. </span>
  178. <div class="checkbtn" style="padding-right:20px;">
  179. <!--编辑和删除日报-->
  180. <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>
  181. <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>
  182. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  183. </div>
  184. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  185. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?"待部门主管":$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?"部门主管":$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  257. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  275. </p>
  276. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  277. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  278. <!-- 自定义日报文本 -->
  279. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  280. <p v-if="user.company.packageEngineering == 1">
  281. {{$t('other.professionalProgress')}}:
  282. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  283. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  284. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  285. </el-tooltip>
  286. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  287. <i class="iconfont firerock-iconshenhetongguo"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhebohui"></i>
  291. </el-tooltip>
  292. </span>
  293. </p>
  294. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  295. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  296. </p>
  297. <div v-if="item2.multiWorktime==0">
  298. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  299. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  300. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  301. {{item2.time.toFixed(1)}}h
  302. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  303. </p>
  304. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  305. <span style="margin-right:10px;">{{item2.progress}}%</span>
  306. </p>
  307. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  308. </div>
  309. <div v-if="item2.multiWorktime==1" >
  310. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  311. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  312. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  313. <p style="display: inline-block;">{{$t('time.duration')}}:
  314. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  315. {{timeItem.time.toFixed(1)}}h
  316. </p>
  317. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  318. </div>
  319. </div>
  320. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  321. <!--照片的显示 -->
  322. <p v-if="item2.pics != null && item2.pics.length > 0">
  323. <el-image v-for="(pic, index) in item2.pics" :key="index"
  324. style="width: 100px; height: 100px; margin-right:10px;"
  325. :src="pic"
  326. :preview-src-list="item2.pics">
  327. </el-image>
  328. </p>
  329. </el-card>
  330. </el-timeline-item>
  331. </el-timeline>
  332. </div>
  333. </div>
  334. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  335. <!-- 简陋的无报告提示 -->
  336. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. </el-card>
  343. </div>
  344. <!-- 工时推送日志弹窗 -->
  345. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  346. <template>
  347. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  348. </template>
  349. <template>
  350. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  351. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  352. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  353. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  354. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  355. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  356. <template slot-scope="scope">
  357. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  358. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  359. </template>
  360. </el-table-column>
  361. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  362. </el-table>
  363. </template>
  364. <span slot="footer" class="dialog-footer">
  365. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  366. </span>
  367. </el-dialog>
  368. <!-- 填写日报的dialog -->
  369. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  370. <div style="height: 65vh;overflow: auto;">
  371. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  372. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  373. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  374. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  375. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  376. <span class="spnn" v-if="workForm.userNames">
  377. <span v-for="(item, index) in workForm.userNames" :key="index">
  378. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  379. <span v-if="index < workForm.userNames.length - 1">,</span>
  380. </span>
  381. </span>
  382. <span class="spnn hover" v-else>
  383. {{$t('defaultText.pleaseSelectAsubstitute')}}
  384. </span>
  385. </div>
  386. </el-form-item>
  387. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  388. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  389. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  390. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  391. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  392. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  393. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  394. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  395. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  396. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  397. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  398. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  399. <!-- AI智能填报 -->
  400. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  401. </el-form-item>
  402. <!--考勤时长显示-->
  403. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  404. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  405. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  406. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  407. </span>
  408. <!--批量填报和批量代填不显示考勤记录-->
  409. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  410. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  411. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  414. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  415. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  416. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  417. @click="refreshAttendance(workForm.createDate)"></el-button>
  418. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  419. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  420. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  421. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  422. </el-form-item>
  423. <!-- 000000 -->
  424. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  425. <div v-if="reportTimeType.multiWorktime==0">
  426. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  427. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  428. <el-select v-model="domain.timeType" style="width:200px;"
  429. v-if="reportTimeType.type == 0"
  430. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  432. @change="onTimeTypeChange(domain.timeType)">
  433. <el-option
  434. v-for="item in timeType"
  435. :key="item.value"
  436. :label="item.label"
  437. :value="item.value">
  438. </el-option>
  439. </el-select>
  440. <!-- 数字时长选择 -->
  441. <el-select v-model="domain.workingTime" style="width:200px;"
  442. v-if="reportTimeType.type == 1"
  443. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  444. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  445. @change="seleChn(0,domain)">
  446. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  447. </el-select>
  448. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  449. <span v-if="reportTimeType.type == 2">
  450. <!--时间范围选择 -->
  451. <el-time-picker
  452. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  453. v-model="domain.startTime"
  454. :placeholder="$t('time.startTime')"
  455. style="width:120px;"
  456. format="HH:mm"
  457. value-format="HH:mm"
  458. :picker-options="{
  459. start: '08:00',
  460. end: '23:30'
  461. }"
  462. @change="iptChang()">
  463. </el-time-picker> - <el-time-picker
  464. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  465. v-model="domain.endTime"
  466. :placeholder="$t('time.endTime')"
  467. style="width:120px;"
  468. format="HH:mm"
  469. value-format="HH:mm"
  470. :picker-options="{
  471. start: '08:00',
  472. end: '23:30',
  473. minTime: domain.startTime
  474. }"
  475. @change="iptChang()">
  476. </el-time-picker>
  477. </span>
  478. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  479. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  480. <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>
  481. </div>
  482. </el-form-item>
  483. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  484. :prop="'domains.' + index + '.reportTargetDeptId'"
  485. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  486. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  487. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  488. <span style="float: left">
  489. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  490. </span>
  491. </el-option>
  492. </el-select>
  493. <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>
  494. </el-form-item>
  495. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  496. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  497. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  498. @change="selectProject(domain, index)"
  499. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  500. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  501. <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">
  502. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  503. <span style="float: right;">{{ item.projectName }}</span>
  504. </el-option>
  505. </el-option-group>
  506. </el-select>
  507. <!--昱众不显示子项目-->
  508. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  509. <span style="margin-left:45px;">
  510. {{$t('lable.subproject')}}</span>
  511. <!--子项目 -->
  512. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  513. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  514. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  515. </el-select>
  516. </template>
  517. <template v-if="user.companyId == yuzhongCompId">
  518. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  519. <!--角色选择 -->
  520. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  521. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  522. <el-option
  523. v-for="item in roleList"
  524. :key="item.value"
  525. :label="item.label"
  526. :value="item.value">
  527. </el-option>
  528. </el-select>
  529. </template>
  530. <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%;"
  531. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  532. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  533. </el-link>
  534. <!-- <el-link type="primary" v-if="canEdit"
  535. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  536. </el-form-item>
  537. <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">
  538. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  539. </el-form-item>
  540. <!--如果设置了工时成本预警的预算成本项-->
  541. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  542. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  543. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  544. </el-select>
  545. </el-form-item>
  546. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  547. <template slot="label">
  548. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  549. <span >{{$t('lable.taskGrouping')}}</span>
  550. </template>
  551. <!-- 任务分组 -->
  552. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  553. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  554. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  555. </el-select>
  556. <template v-if="user.companyId == yuzhongCompId">
  557. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  558. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  559. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  560. <el-option
  561. v-for="item in domain.filteredRespList"
  562. :key="item.id"
  563. :label="item.jobRespon"
  564. :value="item.id">
  565. </el-option>
  566. </el-select>
  567. </template>
  568. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  569. <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>
  570. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  571. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  572. @change="changeStages(domain, index)"
  573. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  574. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  575. </el-select>
  576. </template>
  577. </el-form-item>
  578. <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">
  579. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  580. <template slot="label">
  581. <span style="color:#FF0000;">*</span>
  582. <span >{{$t('other.projectAuditor')}}</span>
  583. </template>
  584. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  585. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  586. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  587. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  588. </el-option>
  589. </el-select>
  590. <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>
  591. </el-form-item>
  592. </div>
  593. <el-form-item v-if="user.companyId == yuzhongCompId">
  594. <template slot="label">
  595. <span style="color:#FF0000;">*</span>
  596. <span >{{ $t('gongZuoNeiRong') }}</span>
  597. </template>
  598. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  599. :disabled="(workForm.domains[index].state>=2?false:true)" >
  600. <el-option
  601. v-for="item in domain.workContentList"
  602. :key="item.id"
  603. :label="item.workContext"
  604. :value="item.id">
  605. </el-option>
  606. </el-select>
  607. </el-form-item>
  608. <!-- 111111 -->
  609. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  610. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  611. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  612. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  613. <span v-else>{{item.name}}</span>
  614. </el-option>
  615. </el-select>
  616. <template v-if="user.timeType.auditLevel > 1">
  617. <i class="el-icon-right"></i>
  618. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  619. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  620. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  621. <span v-else>{{item.name}}</span>
  622. </el-option>
  623. </el-select>
  624. </template>
  625. <template v-if="user.timeType.auditLevel > 2">
  626. <i class="el-icon-right"></i>
  627. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  628. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  629. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  630. <span v-else>{{item.name}}</span>
  631. </el-option>
  632. </el-select>
  633. </template>
  634. </el-form-item>
  635. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  636. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  637. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  638. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  639. <span v-else>{{item.name}}</span>
  640. </el-option>
  641. </el-select>
  642. </el-form-item>
  643. <!-- 相关维度/自定义维度 -->
  644. <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'">
  645. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  646. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  647. </el-option>
  648. </el-select>
  649. </el-form-item>
  650. <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'">
  651. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  652. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  653. </el-option>
  654. </el-select>
  655. </el-form-item>
  656. <!-- 相关数值 -->
  657. <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">
  658. <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>
  659. </el-form-item>
  660. <!-- 自定义文本 -->
  661. <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">
  662. <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>
  663. </el-form-item>
  664. <!--按比例填报-->
  665. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  666. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  667. <div style="width:400px;">
  668. <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>
  669. <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>
  670. </div>
  671. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  672. <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>
  673. </div>
  674. </el-form-item>
  675. <!--工程专业版本模式下, 各个专业的进度填报 -->
  676. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  677. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  678. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  679. <el-input size="mini" style="width:60px;" v-model="item.progress"
  680. @keyup.native="onProgressChange"
  681. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  682. </span>
  683. </el-form-item>
  684. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  685. <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))" >
  686. <template slot="label" v-if="user.timeType.taskRequired == 1">
  687. <span style="color:#FF0000;">*</span>
  688. <span >{{ $t('other.task') }}</span>
  689. </template>
  690. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  691. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  692. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  693. </el-select>
  694. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  695. </el-form-item>
  696. <!--针对依斯贝的SAP服务-->
  697. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  698. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  699. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  700. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  701. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  702. </el-select>
  703. </el-form-item>
  704. <!--工作事项-->
  705. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  706. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  707. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  708. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  709. </el-form-item>
  710. <!-- 拍照上传 -->
  711. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  712. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  713. <div class="photos">
  714. <div>
  715. <el-upload
  716. list-type="picture-card"
  717. :http-request="(file) => {return addImg(file, index)}"
  718. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  719. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  720. :file-list="domain.imgListUrl" :limit="9"
  721. :disabled="workForm.domains[index].state>=2?false:true">
  722. <i class="el-icon-plus"></i>
  723. </el-upload>
  724. </div>
  725. </div>
  726. </el-form-item>
  727. </div>
  728. <!--多个工作事项填报的情况 -->
  729. <div v-if="reportTimeType.multiWorktime==1">
  730. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  731. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  732. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  733. @change="selectProject(domain, index)"
  734. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  735. <!-- <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">
  736. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  737. <span style="float: right;">{{ item.projectName }}</span>
  738. </el-option> -->
  739. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  740. <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">
  741. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  742. <span style="float: right;">{{ item.projectName }}</span>
  743. </el-option>
  744. </el-option-group>
  745. </el-select>
  746. <template v-if="user.timeType.mainProjectState != 1">
  747. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  748. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  749. <!--子项目 -->
  750. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  751. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  752. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  753. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  754. </el-select>
  755. </template>
  756. <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;"
  757. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  758. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  759. </el-link>
  760. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  761. <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>
  762. </div>
  763. <!-- <el-link type="primary" v-if="canEdit"
  764. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  765. </el-form-item>
  766. <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">
  767. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  768. </el-form-item>
  769. <!--如果设置了工时成本预警的预算成本项-->
  770. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  771. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  772. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  773. </el-select>
  774. </el-form-item>
  775. <el-form-item v-if="user.company.packageProject == 1">
  776. <template slot="label">
  777. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  778. <span >{{$t('lable.taskGrouping')}}</span>
  779. </template>
  780. <!-- 任务分组 -->
  781. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  782. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  783. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  784. </el-select>
  785. <!-- 项目的阶段 -->
  786. <span v-if="domain.stages != null && domain.stages.length> 0"
  787. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  788. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  789. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  790. @change="changeStages(domain, index)"
  791. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  792. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  793. </el-select>
  794. </el-form-item>
  795. <el-form-item :label="$t('other.projectAuditor')" >
  796. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  797. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  798. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  799. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  800. </el-option>
  801. </el-select>
  802. <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>
  803. </el-form-item>
  804. <!--工程专业版本模式下, 各个专业的进度填报 -->
  805. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  806. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  807. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  808. <el-input size="mini" style="width:60px;" v-model="item.progress"
  809. @keyup.native="onProgressChange"
  810. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  811. </span>
  812. </el-form-item>
  813. <!-- 相关维度 -->
  814. <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'">
  815. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  816. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  817. </el-option>
  818. </el-select>
  819. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  820. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  821. </el-option>
  822. </el-select>
  823. </el-form-item>
  824. <!-- 相关数值 -->
  825. <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">
  826. <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>
  827. </el-form-item>
  828. <!-- 自定义文本 -->
  829. <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">
  830. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  831. </el-form-item>
  832. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  833. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  834. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  835. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  836. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  837. </el-select>
  838. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  839. </el-form-item>
  840. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  841. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  842. <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>
  843. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  844. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  845. <span v-if="reportTimeType.type == 2">
  846. <!-- <span> -->
  847. <!--时间范围选择 -->
  848. <el-time-picker
  849. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  850. v-model="timeItem.startTime"
  851. :placeholder="$t('time.startTime')"
  852. style="width:120px;"
  853. format="HH:mm"
  854. value-format="HH:mm"
  855. :picker-options="{
  856. start: '00:00',
  857. end: '23:59',
  858. }"
  859. @change="iptChangs()">
  860. </el-time-picker> - <el-time-picker
  861. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  862. v-model="timeItem.endTime"
  863. :placeholder="$t('time.endTime')"
  864. style="width:120px;"
  865. format="HH:mm"
  866. value-format="HH:mm"
  867. :picker-options="{
  868. start: '00:00',
  869. end: '23:59',
  870. minTime: timeItem.startTime
  871. }"
  872. @change="iptChangs()">
  873. </el-time-picker>
  874. </span>
  875. </el-form-item>
  876. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  877. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  878. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  879. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  880. ></el-input>
  881. </el-form-item>
  882. </div>
  883. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  884. </div>
  885. <!--照片的显示 -->
  886. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  887. <el-image v-for="(pic, index) in domain.pics" :key="index"
  888. style="width: 100px; height: 100px; margin-right:10px;"
  889. :src="pic"
  890. :preview-src-list="domain.pics">
  891. </el-image>
  892. </p>
  893. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  894. </div>
  895. <span id="workFormsItemBottom"></span>
  896. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  897. </el-form>
  898. </div>
  899. <span slot="footer" class="dialog-footer">
  900. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  901. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  902. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  903. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  904. <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>
  905. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  906. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  907. </span>
  908. </el-dialog>
  909. <!-- 按周填报 -->
  910. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  911. <!-- 按周填报-已填工时-点击 -->
  912. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  913. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  914. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  915. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  916. <el-table-column prop="state" :label="$t('state.states')">
  917. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  918. </el-table-column>
  919. </el-table>
  920. <span slot="footer" class="dialog-footer">
  921. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  922. </span>
  923. </el-dialog>
  924. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  925. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  926. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  927. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  928. <span class="spnn" v-if="workForm.userNames">
  929. <span v-for="(item, index) in workForm.userNames" :key="index">
  930. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  931. <span v-if="index < workForm.userNames.length - 1">,</span>
  932. </span>
  933. </span>
  934. <span class="spnn hover" v-else>
  935. {{$t('defaultText.pleaseSelectAsubstitute')}}
  936. </span>
  937. </div>
  938. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  939. </div>
  940. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  941. <el-form-item style="height:30px;margin-top:-72px;">
  942. <!-- <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> -->
  943. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  944. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  945. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  946. <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>
  947. <el-option
  948. v-for="item in fillProjectList"
  949. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  950. :key="item.id"
  951. :label="item.projectName + '\u3000' + item.projectCode"
  952. :value="item.id">
  953. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  954. <span style="float: right">{{ item.projectName }}</span>
  955. </el-option>
  956. </el-select>
  957. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  958. </el-form-item>
  959. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  960. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  961. <template slot-scope="scope">
  962. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  963. </template>
  964. </el-table-column>
  965. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  966. <template slot-scope="scope">
  967. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  968. <p v-else></p>
  969. </template>
  970. </el-table-column> -->
  971. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  972. <template slot-scope="scope">
  973. <div v-if="scope.row.canFill == 1">
  974. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  975. <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>
  976. <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>
  977. <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>
  978. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  979. </div>
  980. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  981. <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>
  982. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  983. </div>
  984. </div>
  985. <div v-else >
  986. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  987. </div>
  988. </template>
  989. </el-table-column>
  990. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  991. <template slot-scope="scope">
  992. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  993. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  994. </span>
  995. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  996. </template>
  997. </el-table-column>
  998. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  999. <template slot-scope="scope">
  1000. <div class="zhiss">
  1001. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1002. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1003. </div>
  1004. </template>
  1005. </el-table-column>
  1006. </el-table>
  1007. </el-form>
  1008. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1009. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1010. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1011. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1012. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1013. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1014. <!--针对景昱,先检查工时是否存在异常-->
  1015. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1016. </span>
  1017. </el-dialog>
  1018. <!-- 重庆物奇私人定制的按周填报 -->
  1019. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1020. <div class="fillWeekDialogVisiCustom">
  1021. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1022. </div>
  1023. </el-dialog>
  1024. <!-- enableNewWeeklyfill==2 -->
  1025. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1026. <div class="fillWeekDialogVisiCustom">
  1027. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1028. </div>
  1029. </el-dialog>
  1030. <!-- 选择时间 -->
  1031. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1032. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1033. <span slot="footer" class="dialog-footer">
  1034. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1035. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1036. </span>
  1037. </el-dialog>
  1038. <!-- 按周填报弹窗 -->
  1039. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1040. <div>
  1041. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1042. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1043. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1044. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1045. </el-select>
  1046. </div>
  1047. <!--如果设置了工时成本预警的预算成本项-->
  1048. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1049. <p>{{$t('lable.budgetSource')}}</p>
  1050. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1051. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1052. </el-select>
  1053. </div>
  1054. <!-- 任务分组 -->
  1055. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1056. <p>{{$t('lable.taskGrouping')}}</p>
  1057. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1058. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1059. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1060. </el-select>
  1061. </div>
  1062. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1063. <p>{{$t('other.inputStage')}}</p>
  1064. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1065. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1066. </el-select>
  1067. </div>
  1068. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1069. <p>{{$t('other.reviewer')}}</p>
  1070. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1071. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1072. </el-select>
  1073. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1074. </div>
  1075. <template v-if="user.timeType.reportAuditType == 3">
  1076. <div class="zhoFel">
  1077. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1078. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1079. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1080. </el-select>
  1081. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1082. </div>
  1083. <div class="zhoFel">
  1084. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1085. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1086. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1087. </el-select>
  1088. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1089. </div>
  1090. <div class="zhoFel">
  1091. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1092. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1093. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1094. </el-select>
  1095. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1096. </div>
  1097. <div class="zhoFel">
  1098. <p>{{ $t('chao-song-ren') }}</p>
  1099. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1100. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1101. </el-select>
  1102. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1103. </div>
  1104. </template>
  1105. <!-- 自定义维度 -->
  1106. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1107. <p>{{user.timeType.customDegreeName}}</p>
  1108. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :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. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1112. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1113. </el-select>
  1114. </div>
  1115. <!-- 自定义数值 -->
  1116. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1117. <p>{{user.timeType.customDataName}}</p>
  1118. <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>
  1119. </div>
  1120. <!-- 自定义文本 -->
  1121. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1122. <p>{{user.timeType.customTextName}}</p>
  1123. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1124. </div>
  1125. <!-- 选择任务 -->
  1126. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1127. <p>{{ $t('renWuLiChengBei') }}</p>
  1128. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1129. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1130. </el-select>
  1131. </div>
  1132. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1133. <p>{{$t('other.timeSelection')}}</p>
  1134. <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>
  1135. </div>
  1136. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1137. <p>{{$t('other.chooseDuration')}}</p>
  1138. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1139. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1140. </el-select>
  1141. </div>
  1142. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1143. <p>{{$t('lable.percentageOfTime')}}</p>
  1144. <div style="width:400px;display: flex;align-items: center;">
  1145. <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>
  1146. <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>
  1147. </div>
  1148. </div>
  1149. <div class="zhoFel">
  1150. <p>{{$t('other.workMatters')}}</p>
  1151. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1152. </div>
  1153. </div>
  1154. <span slot="footer" class="dialog-footer">
  1155. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1156. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1157. </span>
  1158. </el-dialog>
  1159. <!--导出报表条件选择 -->
  1160. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1161. <el-form ref="form3" :model="exportParam" >
  1162. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1163. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1164. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1165. </el-select>
  1166. </el-form-item>
  1167. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1168. <!-- <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>
  1169. <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> -->
  1170. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1171. </el-form-item>
  1172. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1173. <el-date-picker
  1174. v-model="exportParam.dateRange" :editable="false"
  1175. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1176. :range-separator="$t('other.to')"
  1177. type="daterange"
  1178. :start-placeholder="$t('time.startDate')"
  1179. :end-placeholder="$t('time.endDate')"
  1180. ></el-date-picker>
  1181. </el-form-item>
  1182. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1183. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1184. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1185. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1186. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1187. </el-select>
  1188. </el-form-item>
  1189. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1190. <div class="exportReportRadio">
  1191. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1192. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1193. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1194. <i class="el-icon-question"></i>
  1195. </el-tooltip>
  1196. </div>
  1197. </el-form-item>
  1198. </el-form>
  1199. <div slot="footer" class="dialog-footer">
  1200. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1201. </div>
  1202. </el-dialog>
  1203. <!--导出报表条件选择 -->
  1204. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1205. <el-form ref="form3" :model="exportParam" >
  1206. <el-form-item prop="range" :label="$t('time.dateRange')">
  1207. <el-date-picker
  1208. v-model="exportParam.dateRange" :editable="false"
  1209. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1210. :clearable="true"
  1211. :range-separator="$t('other.to')"
  1212. type="daterange"
  1213. :start-placeholder="$t('time.startDate')"
  1214. :end-placeholder="$t('time.endDate')"
  1215. ></el-date-picker>
  1216. </el-form-item>
  1217. </el-form>
  1218. <div slot="footer" class="dialog-footer">
  1219. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1220. </div>
  1221. </el-dialog>
  1222. <!--人员列表 -->
  1223. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1224. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1225. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1226. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1227. <el-table-column type="selection"></el-table-column>
  1228. <el-table-column prop="label" :label="$t('lable.name')" >
  1229. <template slot-scope="scope">
  1230. <span>
  1231. <!-- {{(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}} -->
  1232. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1233. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1234. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1235. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1236. </span>
  1237. <span v-else>
  1238. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1239. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1240. </span>
  1241. </span>
  1242. </template>
  1243. </el-table-column>
  1244. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1245. <template slot-scope="scope">
  1246. <div>
  1247. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1248. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1249. </div>
  1250. </template>
  1251. </el-table-column>
  1252. </el-table>
  1253. </el-tab-pane>
  1254. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1255. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1256. <el-table-column prop="label" :label="$t('lable.name')" >
  1257. <template slot-scope="scope">
  1258. <!-- <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> -->
  1259. <!-- <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> -->
  1260. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1261. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1262. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1263. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1264. </span>
  1265. <span v-else>
  1266. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1267. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1268. </span>
  1269. </template>
  1270. </el-table-column>
  1271. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1272. <template slot-scope="scope">
  1273. <div>
  1274. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1275. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1276. </div>
  1277. </template>
  1278. </el-table-column>
  1279. </el-table>
  1280. </el-tab-pane>
  1281. </el-tabs>
  1282. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1283. <el-table-column type="selection"></el-table-column>
  1284. <el-table-column prop="label" :label="$t('lable.name')" >
  1285. <template slot-scope="scope">
  1286. <div>
  1287. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1288. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1289. </div>
  1290. </template>
  1291. </el-table-column>
  1292. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1293. <template slot-scope="scope">
  1294. <div>
  1295. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1296. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1297. </div>
  1298. </template>
  1299. </el-table-column>
  1300. </el-table>
  1301. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1302. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1303. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1304. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1305. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1306. </div>
  1307. </el-dialog>
  1308. <!-- 日报审核修改 -->
  1309. <el-dialog
  1310. :title="$t('riBaoShenHeXiuGai')"
  1311. :visible.sync="reportLogCheckDialog"
  1312. width="30%"
  1313. :before-close="handleClose">
  1314. <el-form ref="form3" :model="exportReportLogParam" >
  1315. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1316. <el-date-picker
  1317. v-model="exportReportLogParam.dateRange" :editable="false"
  1318. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1319. :range-separator="$t('other.to')"
  1320. type="daterange"
  1321. :start-placeholder="$t('time.startDate')"
  1322. :end-placeholder="$t('time.endDate')"
  1323. ></el-date-picker>
  1324. </el-form-item>
  1325. </el-form>
  1326. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1327. <br>
  1328. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1329. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1330. <span slot="footer" class="dialog-footer">
  1331. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1332. </span>
  1333. </el-dialog>
  1334. <!-- 按部门选择人员 -->
  1335. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1336. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1337. <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)">
  1338. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1339. </el-input>
  1340. <div class="tree" style="height:400px">
  1341. <el-scrollbar style="height:100%">
  1342. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1343. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1344. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1345. <span class="custom-tree-node" slot-scope="{ node }">
  1346. <span v-if="user.userNameNeedTranslate == '1'">
  1347. <span v-if="node.data.children">
  1348. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1349. </span>
  1350. <span v-else>
  1351. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1352. </span>
  1353. </span>
  1354. <span v-if="user.userNameNeedTranslate != '1'">
  1355. {{ node.label }}
  1356. </span>
  1357. <!-- {{ node.label }} -->
  1358. </span>
  1359. </el-tree>
  1360. </el-scrollbar>
  1361. </div>
  1362. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1363. <div slot="footer" class="dialog-footer">
  1364. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1365. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1366. </div>
  1367. </el-dialog>
  1368. <el-dialog
  1369. v-if="monthWorkTimeDialog"
  1370. :visible.sync="monthWorkTimeDialog"
  1371. :close-on-click-modal="false"
  1372. customClass="customWidth selectworktime"
  1373. width="92%"
  1374. top="60px"
  1375. >
  1376. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1377. <el-tabs v-model="activeName" @tab-click="handleClick">
  1378. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1379. <div class="selectworktime_export" style="margin-top:10px;">
  1380. <div class="selectworktime_export_l">
  1381. <el-date-picker
  1382. class="selecteworktime_datapick"
  1383. v-model="WorktimeDatepickValue"
  1384. value-format="yyyy-MM-dd"
  1385. type="daterange"
  1386. align="right"
  1387. unlink-panels
  1388. :range-separator="$t('other.to')"
  1389. :start-placeholder="$t('time.startDate')"
  1390. :end-placeholder="$t('time.endDate')"
  1391. :default-time="['12:00:00', '12:00:00']"
  1392. size="small"
  1393. popper-class="selecteorktime_datapick_popper"
  1394. @change="showMonthWorkTime()"
  1395. >
  1396. </el-date-picker>
  1397. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1398. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1399. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1400. <!-- 222 -->
  1401. </div>
  1402. <div>
  1403. <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>
  1404. <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>
  1405. <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">
  1406. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1407. </el-input>
  1408. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1409. </div>
  1410. <div style="float: left; height:32px; padding-top:10px;">
  1411. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1412. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1413. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1414. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1415. </div>
  1416. <div style="float: right; vertical-align: middle;height:32px">
  1417. <el-link
  1418. type="primary"
  1419. @click="exportMembWorkHours()"
  1420. >{{$t('export.exportData')}}</el-link
  1421. >
  1422. </div>
  1423. </div>
  1424. <el-table ref="hasworkTbl"
  1425. :data="monthWorkDataS"
  1426. v-el-table-infinite-scroll="listScroll"
  1427. border
  1428. :height="'70vh'"
  1429. highlight-current-row
  1430. style="width: 100%"
  1431. v-loading="tbload"
  1432. :lazy="true"
  1433. :cell-style="hasworkTblCellStyle"
  1434. >
  1435. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1436. <template slot-scope="scope">
  1437. {{ scope.$index + 1 }}
  1438. </template>
  1439. </el-table-column>
  1440. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1441. <template slot-scope="scope">
  1442. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1443. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1444. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1445. <!-- {{scope.row.name}} -->
  1446. </span>
  1447. </template>
  1448. </el-table-column>
  1449. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1450. <template slot-scope="scope">
  1451. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1452. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1453. </template>
  1454. </el-table-column>
  1455. <el-table-column
  1456. min-width="60"
  1457. v-for="(item, index) in pickDateArray"
  1458. :key="index"
  1459. :label="item"
  1460. align="center"
  1461. >
  1462. <template slot="header" slot-scope="scope">
  1463. <div>{{ scope.column.label.dateStr }}</div>
  1464. <div>{{ scope.column.label.weekStr }}</div>
  1465. </template>
  1466. <template slot-scope="scope">
  1467. <div
  1468. v-if="
  1469. scope.row.worktimeList.filter(
  1470. (w) =>
  1471. w.createDate==item.date
  1472. ).length > 0 &&
  1473. scope.row.worktimeList.filter(
  1474. (w) =>w.createDate==item.date
  1475. )[0].workingTime < reportTimeType.allday
  1476. "
  1477. >
  1478. {{
  1479. scope.row.worktimeList.filter(
  1480. (w) =>w.createDate==item.date
  1481. )[0].workingTime.toFixed(1)
  1482. }}
  1483. </div>
  1484. <div
  1485. v-if="
  1486. scope.row.worktimeList.filter(
  1487. (w) =>w.createDate==item.date
  1488. ).length > 0 &&
  1489. scope.row.worktimeList.filter(
  1490. (w) =>w.createDate==item.date
  1491. )[0].workingTime > reportTimeType.allday
  1492. "
  1493. >
  1494. {{
  1495. scope.row.worktimeList.filter(
  1496. (w) =>w.createDate==item.date
  1497. )[0].workingTime.toFixed(1)
  1498. }}
  1499. </div>
  1500. <div
  1501. v-if="
  1502. scope.row.worktimeList.filter(
  1503. (w) =>w.createDate==item.date
  1504. ).length > 0 &&
  1505. scope.row.worktimeList.filter(
  1506. (w) =>w.createDate==item.date
  1507. )[0].workingTime == reportTimeType.allday
  1508. "
  1509. >
  1510. {{
  1511. scope.row.worktimeList.filter(
  1512. (w) =>w.createDate==item.date
  1513. )[0].workingTime
  1514. }}
  1515. </div>
  1516. <div
  1517. v-if="
  1518. scope.row.worktimeList.filter(
  1519. (w) =>w.createDate==item.date
  1520. ).length == 0
  1521. "
  1522. >
  1523. 0
  1524. </div>
  1525. <div
  1526. v-if="
  1527. scope.row.worktimeList.filter(
  1528. (w) =>w.createDate==item.date
  1529. ).length > 0 &&
  1530. typeof scope.row.worktimeList.filter(
  1531. (w) =>w.createDate==item.date
  1532. )[0].workingTime == 'string'
  1533. "
  1534. >
  1535. {{
  1536. scope.row.worktimeList.filter(
  1537. (w) =>w.createDate==item.date
  1538. )[0].workingTime
  1539. }}
  1540. </div>
  1541. </template>
  1542. </el-table-column>
  1543. </el-table>
  1544. <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>
  1545. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1546. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1547. <label style="font-size: 16px">员工每日已填报工时数</label>
  1548. <el-link
  1549. type="primary"
  1550. style="float: right; margin-right: 60px"
  1551. @click="exportMembWorkHours()"
  1552. >导出已填报数据</el-link
  1553. > -->
  1554. <!-- <el-button >导出</el-button> -->
  1555. <!-- </div> -->
  1556. </el-tab-pane>
  1557. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1558. <div class="selectworktime_export" style="margin-top:10px">
  1559. <div class="selectworktime_export_l">
  1560. <el-date-picker
  1561. class="selecteworktime_datapick"
  1562. v-model="WorktimeDatepickValue"
  1563. value-format="yyyy-MM-dd"
  1564. type="daterange"
  1565. align="right"
  1566. unlink-panels
  1567. :range-separator="$t('other.to')"
  1568. :start-placeholder="$t('time.startDate')"
  1569. :end-placeholder="$t('time.endDate')"
  1570. :default-time="['12:00:00', '12:00:00']"
  1571. size="small"
  1572. popper-class="selecteorktime_datapick_popper"
  1573. @change="showMonthNotWorkTime()"
  1574. >
  1575. </el-date-picker>
  1576. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1577. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1578. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1579. </div>
  1580. <div>
  1581. <div style="margin-top:10px;">
  1582. <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>
  1583. <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>
  1584. <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">
  1585. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1586. </el-input>
  1587. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1588. <el-link
  1589. type="primary"
  1590. style="float: right; vertical-align: middle;height:32px"
  1591. @click="exportMembNotWorkHours()"
  1592. >{{$t('export.exportData')}}</el-link
  1593. >
  1594. </div>
  1595. </div>
  1596. </div>
  1597. <el-table
  1598. ref="hasworkTbl2"
  1599. :data="monthNotWorkDateS"
  1600. v-el-table-infinite-scroll="notListScroll"
  1601. border
  1602. :height="'70vh'"
  1603. highlight-current-row
  1604. style="width: 100%"
  1605. v-loading="tbload"
  1606. lazy
  1607. >
  1608. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1609. <template slot-scope="scope">
  1610. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1611. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1612. </template>
  1613. </el-table-column>
  1614. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1615. <template slot-scope="scope">
  1616. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1617. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1618. </template>
  1619. </el-table-column>
  1620. <el-table-column
  1621. min-width="200"
  1622. :label="$t('weekDay.date')"
  1623. align="center"
  1624. prop="createDate"
  1625. >
  1626. </el-table-column>
  1627. <el-table-column
  1628. min-width="200"
  1629. :label="$t('state.states')"
  1630. align="center"
  1631. prop="status"
  1632. />
  1633. <el-table-column
  1634. min-width="200"
  1635. :label="$t('other.attendanceData')"
  1636. prop="cardTime"
  1637. align="center"
  1638. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1639. </el-table>
  1640. <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>
  1641. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1642. </el-tab-pane>
  1643. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1644. <div class="selectworktime_export" style="margin-top:10px;">
  1645. <div class="selectworktime_export_l">
  1646. <el-date-picker
  1647. class="selecteworktime_datapick"
  1648. v-model="WorktimeDatepickValue"
  1649. value-format="yyyy-MM-dd"
  1650. type="daterange"
  1651. align="right"
  1652. unlink-panels
  1653. :range-separator="$t('other.to')"
  1654. :start-placeholder="$t('time.startDate')"
  1655. :end-placeholder="$t('time.endDate')"
  1656. :default-time="['12:00:00', '12:00:00']"
  1657. size="small"
  1658. popper-class="selecteorktime_datapick_popper"
  1659. @change="showMonthWorkTimeReminder()"
  1660. >
  1661. </el-date-picker>
  1662. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1663. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1664. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1665. </div>
  1666. <div>
  1667. <div style="margin-top:10px;">
  1668. <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>
  1669. <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>
  1670. <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">
  1671. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1672. </el-input>
  1673. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1674. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1675. </div>
  1676. </div>
  1677. <div style="float: right; vertical-align: middle;height:32px">
  1678. <el-link
  1679. type="primary"
  1680. @click="changeReminder()"
  1681. >{{ $t('bianGengTiXing') }}</el-link
  1682. >
  1683. <el-link
  1684. type="primary"
  1685. @click="exportMembWorkHoursReminder()"
  1686. >{{$t('export.exportData')}}</el-link
  1687. >
  1688. </div>
  1689. </div>
  1690. <el-table ref="hasworkTbl"
  1691. :data="monthWorkDataS"
  1692. v-el-table-infinite-scroll="listScroll"
  1693. border
  1694. :height="'70vh'"
  1695. highlight-current-row
  1696. style="width: 100%"
  1697. v-loading="tbload"
  1698. :lazy="true"
  1699. >
  1700. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1701. <template slot-scope="scope">
  1702. {{ scope.row.createDate}}
  1703. </template>
  1704. </el-table-column>
  1705. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1706. <template slot-scope="scope">
  1707. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1708. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1709. <!-- {{scope.row.name}} -->
  1710. </template>
  1711. </el-table-column>
  1712. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1713. <template slot-scope="scope">
  1714. {{scope.row.invokeValue}}
  1715. </template>
  1716. </el-table-column>
  1717. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1718. <template slot-scope="scope">
  1719. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1720. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1721. </template>
  1722. </el-table-column>
  1723. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1724. <template slot-scope="scope">
  1725. {{ scope.row.workingTime}}
  1726. </template>
  1727. </el-table-column>
  1728. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1729. <template slot-scope="scope">
  1730. {{ scope.row.cardTime}}
  1731. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1732. </template>
  1733. </el-table-column>
  1734. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1735. <template slot-scope="scope">
  1736. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1737. </template>
  1738. </el-table-column>
  1739. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1740. <template slot-scope="scope">
  1741. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1742. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1743. </template>
  1744. </el-table-column>
  1745. </el-table>
  1746. <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>
  1747. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1748. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1749. <label style="font-size: 16px">员工每日已填报工时数</label>
  1750. <el-link
  1751. type="primary"
  1752. style="float: right; margin-right: 60px"
  1753. @click="exportMembWorkHours()"
  1754. >导出已填报数据</el-link
  1755. > -->
  1756. <!-- <el-button >导出</el-button> -->
  1757. <!-- </div> -->
  1758. </el-tab-pane>
  1759. </el-tabs>
  1760. </el-dialog>
  1761. <!--驳回弹出框 -->
  1762. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1763. <div>
  1764. <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')" />
  1765. </div>
  1766. <div slot="footer" class="dialog-footer">
  1767. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1768. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1769. </div>
  1770. </el-dialog>
  1771. <!-- 通过弹出框 -->
  1772. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1773. <div>
  1774. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1775. </div>
  1776. <div slot="footer" class="dialog-footer">
  1777. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1778. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1779. </div>
  1780. </el-dialog>
  1781. <!--批量导入日报 -->
  1782. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1783. <p>1. {{$t('other.download')}}
  1784. <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>
  1785. </p>
  1786. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1787. <p style="display: flex;justify-content: center;">
  1788. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1789. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1790. </el-upload>
  1791. </p>
  1792. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1793. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1794. </div>
  1795. </el-dialog>
  1796. <!-- 工时导入记录弹窗 -->
  1797. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1798. <div style="height: 452px">
  1799. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1800. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1801. <el-table-column prop="userName" :label="$t('other.operator')">
  1802. <template slot-scope="scope">
  1803. <div>
  1804. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1805. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1806. </div>
  1807. </template>
  1808. </el-table-column>
  1809. <el-table-column prop="datel" :label="$t('other.document')">
  1810. <template slot-scope="scope">
  1811. <div>
  1812. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1813. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1814. </div>
  1815. </template>
  1816. </el-table-column>
  1817. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1818. <template slot-scope="scope">
  1819. <div>
  1820. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1821. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1822. </div>
  1823. </template>
  1824. </el-table-column>
  1825. </el-table>
  1826. <el-col :span="24" class="paginatis">
  1827. <el-pagination
  1828. @size-change="handleSizeChange"
  1829. @current-change="handleCurrentChange"
  1830. :page-sizes="[20 , 50 , 80 , 100]"
  1831. :page-size="20"
  1832. layout="total, sizes, prev, pager, next"
  1833. :total="toViewForm.total"
  1834. style="float:right;"
  1835. ></el-pagination>
  1836. </el-col>
  1837. </div>
  1838. </el-dialog>
  1839. <!--基于企业微信考勤数据的工时导入 -->
  1840. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1841. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1842. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1843. </el-step>
  1844. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1845. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1846. </el-steps>
  1847. <div v-if="active==0" style="padding:30px;height:360px;">
  1848. <div style="margin-top:50px;margin-left:280px;">
  1849. <el-date-picker
  1850. v-model="importWxParam.date" :editable="false"
  1851. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1852. :clearable="true"
  1853. :range-separator="$t('other.to')"
  1854. type="daterange"
  1855. :start-placeholder="$t('time.startDate')"
  1856. :end-placeholder="$t('time.endDate')"
  1857. @change="loadCheckInData"
  1858. ></el-date-picker>
  1859. </div>
  1860. </div>
  1861. <div v-if="active==1" style="padding:10px;">
  1862. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1863. style="width: 100%;margin-top:5px;" >
  1864. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1865. <template slot-scope="scope">
  1866. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1867. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1868. </template>
  1869. </el-table-column>
  1870. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1871. </el-table-column>
  1872. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1873. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1874. <template slot-scope="scope">
  1875. <div>
  1876. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1877. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1878. </div>
  1879. </template>
  1880. </el-table-column>
  1881. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1882. <template slot-scope="scope">
  1883. <div>
  1884. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1885. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1886. </div>
  1887. </template>
  1888. </el-table-column>
  1889. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1890. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1891. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1892. <template slot-scope="scope">
  1893. {{scope.row.workHours.toFixed(1)}}h
  1894. </template>
  1895. </el-table-column>
  1896. </el-table>
  1897. </div>
  1898. <div v-if="active==2" >
  1899. <p style="display: flex;justify-content: center;height:390px;">
  1900. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1901. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1902. </el-upload>
  1903. </p>
  1904. </div>
  1905. <div slot="title">
  1906. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1907. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1908. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1909. <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>
  1910. <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>
  1911. <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>
  1912. </div>
  1913. <span slot="footer">
  1914. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1915. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1916. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  1917. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1918. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1919. </span>
  1920. </el-dialog>
  1921. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1922. <p style="display: flex;justify-content: center;height:100px;">
  1923. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1924. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1925. </el-upload>
  1926. </p>
  1927. </el-dialog>
  1928. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1929. <div>
  1930. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1931. v-model="deleteReportParam.date" :editable="false"
  1932. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1933. :clearable="true"
  1934. :range-separator="$t('other.to')"
  1935. type="daterange"
  1936. :start-placeholder="$t('time.startDate')"
  1937. :end-placeholder="$t('time.endDate')"
  1938. ></el-date-picker>
  1939. </div>
  1940. <div style="margin-top:10px;">
  1941. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  1942. <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>
  1943. <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>
  1944. </div>
  1945. <div style="margin-top:10px;">
  1946. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  1947. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  1948. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1949. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1950. <span v-else>{{item.name}}</span>
  1951. </el-option>
  1952. </el-select>
  1953. </div>
  1954. <span slot="footer">
  1955. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  1956. </span>
  1957. </el-dialog>
  1958. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1959. <div>
  1960. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1961. v-model="deleteReportParam.date" :editable="false"
  1962. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1963. :clearable="true"
  1964. :range-separator="$t('other.to')"
  1965. type="daterange"
  1966. :start-placeholder="$t('time.startDate')"
  1967. :end-placeholder="$t('time.endDate')"
  1968. ></el-date-picker>
  1969. </div>
  1970. <div style="margin-top:15px;">
  1971. <span>{{ $t('other.selectdepartment') }}:</span>
  1972. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  1973. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1974. size="small" v-if="user.userNameNeedTranslate != 1"
  1975. ></el-cascader>
  1976. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1977. </div>
  1978. <span slot="footer">
  1979. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  1980. </span>
  1981. </el-dialog>
  1982. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1983. <div>
  1984. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  1985. v-model="modImportTime"
  1986. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1987. :clearable="true"
  1988. type="datetime"
  1989. ></el-date-picker>
  1990. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  1991. v-model="modImportUserId"
  1992. >
  1993. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1994. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1995. <span v-else>{{item.name}}</span>
  1996. </el-option>
  1997. </el-select>
  1998. </div>
  1999. <span slot="footer">
  2000. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2001. </span>
  2002. </el-dialog>
  2003. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2004. <div>
  2005. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2006. <el-date-picker
  2007. v-model="ratioYmonth" :editable="false"
  2008. format="yyyyMM" value-format="yyyyMM"
  2009. type="month"
  2010. ></el-date-picker>
  2011. </div>
  2012. <span slot="footer">
  2013. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2014. </span>
  2015. </el-dialog>
  2016. <!--工时批量代填 -->
  2017. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2018. <div>
  2019. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2020. v-model="importWxParam.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. @change="loadCheckInData"
  2028. ></el-date-picker>
  2029. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2030. </div>
  2031. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2032. :key="timeStamp"
  2033. style="width: 100%;margin-top:5px;" ref="tab">
  2034. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2035. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2036. <template slot-scope="scope">
  2037. <div>
  2038. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2039. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2040. </div>
  2041. </template>
  2042. </el-table-column>
  2043. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2044. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2045. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2046. <template slot-scope="scope">
  2047. {{scope.row.workHours.toFixed(1)}}h
  2048. </template>
  2049. </el-table-column>
  2050. <!--项目名称列表 -->
  2051. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2052. <template slot-scope="scope">
  2053. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2054. </template>
  2055. </el-table-column>
  2056. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2057. <template slot-scope="scope">
  2058. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2059. </template>
  2060. </el-table-column>
  2061. </el-table>
  2062. </el-dialog>
  2063. <!--基于企业微信考勤数据的工时导入 -->
  2064. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2065. <div style="padding-bottom:10px;">
  2066. <p>{{importResultMsg}}</p>
  2067. </div>
  2068. <!-- <span slot="footer" class="dialog-footer">
  2069. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2070. </span> -->
  2071. </el-dialog>
  2072. <!-- 审核流程展示 -->
  2073. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2074. <div style="padding:20px 40px 20px 0">
  2075. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2076. <el-step title="待提交"></el-step>
  2077. <el-step title="员工提交"></el-step>
  2078. <el-step title="审核通过"></el-step>
  2079. </el-steps>
  2080. <el-divider v-if="user.companyId == 7544"></el-divider>
  2081. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2082. <el-timeline :reverse="false" style="margin-top:10px;">
  2083. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2084. <!-- {{item.msg}} -->
  2085. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2086. <span v-if="user.userNameNeedTranslate == 1">
  2087. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2088. <span>{{item.msgCon.two}}</span>
  2089. </span>
  2090. </el-timeline-item>
  2091. </el-timeline>
  2092. </div>
  2093. </el-dialog>
  2094. <!-- 威派格定制 -->
  2095. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2096. </section>
  2097. </template>
  2098. <script>
  2099. // 左右滑动
  2100. import dragMixin from "@/common/js/tensile.js";
  2101. import util from "../../common/js/util";
  2102. // 自定义select组件
  2103. import selectCat from "@/components/select.vue"
  2104. // 引入自定义级联组件
  2105. import vueCascader from "@/components/cascader.vue"
  2106. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2107. // 重庆物奇定制组件
  2108. import WeeklyCustomization from "./weeklyCustomization.vue"
  2109. // 威派格定制转移工时
  2110. import TransferWorkingHours from "./transferWorkingHours.vue"
  2111. // 新的按周填报
  2112. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2113. import { mapMutations } from 'vuex'
  2114. let _that = this
  2115. export default {
  2116. mixins: [dragMixin],
  2117. components: {
  2118. selectCat,
  2119. vueCascader,
  2120. WeeklyCustomization,
  2121. vueMultipleDept,
  2122. TransferWorkingHours,
  2123. NewWeeklyCustomization
  2124. },
  2125. data() {
  2126. return {
  2127. curAuditNode: 1,
  2128. refreshingTime: false,
  2129. substitudeStep: 1,
  2130. showHidden: false,
  2131. pageIndex: 0,
  2132. hasMore: true,
  2133. exportType: 0,
  2134. exportingData: false,
  2135. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2136. jobResponseList:[],
  2137. yisibeiCompId: 3092,
  2138. yuzhongCompId: 3385,
  2139. mingyiName : '成都明夷电子科技有限公司',
  2140. // mingyiName : '明夷',
  2141. modItemDataId: null,
  2142. modImportTime: null,
  2143. modImportUserId: null,
  2144. showModImportTimeDialog: false,
  2145. showBatchSimpleApproveReport: false,
  2146. startDeleting: false,
  2147. showBatchDeleteReport: false,
  2148. deleteReportParam: {date:null, userIds:[]},
  2149. isDenying: false,
  2150. targetWeekDate: null,//填写周报中的周日期
  2151. importCardTimeVisi: false,
  2152. startRatioExporting: false,
  2153. exportUserRatio: false,
  2154. ratioYmonth:null,
  2155. hasWrittenReport: false,
  2156. today:null,
  2157. syncTimeLoading: false,
  2158. seluserText: '',
  2159. translation: '1', // 1、文字, 2、部门, 3、人员
  2160. exportLoad: false,
  2161. getPickerOptions: {
  2162. disabledDate: (time) => {
  2163. var date = new Date();
  2164. var year = date.getFullYear();
  2165. var month = date.getMonth() + 1;
  2166. if (month >= 1 && month <= 9) {
  2167. month = "0" + month;
  2168. }
  2169. var currentdate = year.toString() + month.toString();
  2170. var timeyear = time.getFullYear();
  2171. var timemonth = time.getMonth() + 1;
  2172. if (timemonth >= 1 && timemonth <= 9) {
  2173. timemonth = "0" + timemonth;
  2174. }
  2175. var timedate = timeyear.toString() + timemonth.toString();
  2176. if(this.user.timeType.fillAhead == 0){
  2177. return currentdate < timedate;
  2178. }else{
  2179. return false
  2180. }
  2181. }
  2182. },
  2183. alalal: '8.0',
  2184. timeBasecostList:null,
  2185. tbload: false,
  2186. exportTimeDialog: false,
  2187. searchKeyword: '',
  2188. monthWorkDataS: [],
  2189. monthNotWorkDateS: [],
  2190. pickDateArray:[],
  2191. WorktimeDatepickValue: [],
  2192. activeName:"first",
  2193. isLeave: 0,
  2194. submitingReport: false,
  2195. importResultMsg:null,
  2196. showImportResult:false,
  2197. importingData: false,
  2198. isDraft: 0,
  2199. timeStamp: 0,
  2200. projectColumns:[],
  2201. checkinLoading:false,
  2202. importWxParam:{date:null,},
  2203. active:0,
  2204. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2205. importWxDialog:false,
  2206. importDialog:false,
  2207. denyForm:null,
  2208. denyReasonDialog:false,
  2209. monthWorkTimeDialog: false,
  2210. isSubstitude:false,
  2211. isFill:false,
  2212. unFillList:[],
  2213. fillList:[],
  2214. fillMembList:[],
  2215. fillMembList_leave: [],
  2216. membListVisible: false,
  2217. isBatch:0,//是否是批量填报
  2218. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2219. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2220. 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')],
  2221. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2222. fillStatusList: [],
  2223. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2224. exportReportLogParam:{dateRange:[]},
  2225. exportDialog:false,
  2226. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2227. subProjectList:[],
  2228. canEdit: true,
  2229. originCanEdit: true,
  2230. 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],
  2231. selectTime:null,
  2232. reportTimeType:{},
  2233. curDate:'',
  2234. isAllSelect: false,
  2235. approveDialogVisible:false,
  2236. deptId:null,
  2237. targetUid: null,
  2238. membCount:0,
  2239. selectState:"-1",
  2240. user: JSON.parse(sessionStorage.getItem("user")),
  2241. allUsersList: [],
  2242. showAddMore:false,
  2243. allDate: [],
  2244. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2245. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2246. choseDay: 0,
  2247. tableHeight: 0,
  2248. listLoading: false,
  2249. projectList: [], //项目列表
  2250. fillProjectList: [],
  2251. reportList: [], //日报列表
  2252. reportNames:[], //批量审批列表
  2253. selCon:[], //筛选条件
  2254. selProjectList:[], //筛选后项目列表
  2255. selConShow: true,
  2256. usersList: [], // 全部人员列表
  2257. usersListId: '', // 选中的人员id
  2258. dialogVisible: false, //项目弹窗
  2259. report: '',
  2260. workForm: {
  2261. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2262. domains: [{
  2263. id: null,
  2264. projectId: "",
  2265. workingTime: "",
  2266. timeType:0,
  2267. content: "",
  2268. state: 2,
  2269. multiWorktime:0,
  2270. worktimeList:[],
  2271. degreeId: null,
  2272. auditUserList: [],
  2273. }],
  2274. showRefresh: false,
  2275. },
  2276. workRules: {
  2277. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2278. },
  2279. chooseParticipVisible: false,
  2280. logining: false,
  2281. isDisable: false,
  2282. timeType:[],
  2283. deptMembData: [
  2284. ],
  2285. //部门人员树状结构
  2286. data: [
  2287. {
  2288. id: -1,
  2289. label: this.$t('lable.allStaff'),
  2290. membCount:0
  2291. },
  2292. {
  2293. id: 0,
  2294. label: this.$t('lable.unassigned'),
  2295. }
  2296. ],
  2297. allData:{},
  2298. batchShowData:{},
  2299. option: [],
  2300. deptOptionList: [],
  2301. depData: {
  2302. id: -1,
  2303. label: this.$t('lable.allStaff'),
  2304. },
  2305. defaultProps: {
  2306. children: 'children',
  2307. label: 'label'
  2308. },
  2309. isNew: false,
  2310. selected: false,
  2311. valuet: new Date(),
  2312. domObj: null,
  2313. participator:[],
  2314. chosenMembCount:0,
  2315. jsDay: 0,
  2316. jsTime: 0,
  2317. falsss: false,
  2318. weidu: [],
  2319. weiduList: [],
  2320. yonghuUser: [],
  2321. dateAr: [],
  2322. batchSubFillDialog: false,
  2323. isSubstiS: false,
  2324. fillWeekDialogVisi: false,
  2325. fillWeekDialogVisiCustom: false,
  2326. fillWeekDialogVisiCustomTwo: false,
  2327. zhoData: [],
  2328. weekDateRange: [],
  2329. btnZho: false,
  2330. weekDataLoading: false,
  2331. changdu: 6,
  2332. tianxieDialogVisible: false,
  2333. scopess: {},
  2334. zhoBao: {
  2335. time: '',
  2336. workingTime: '',
  2337. progress: '',
  2338. con: '',
  2339. subProjectId: '',
  2340. stage: '',
  2341. subProjectList: [],
  2342. stages: [],
  2343. },
  2344. zhoBaoIdx: '',
  2345. zhoBaoName: '',
  2346. zhis: {},
  2347. dealList: [],
  2348. toViewDialogVisible: false,
  2349. toViewList: [],
  2350. toViewloading: true,
  2351. toViewForm: {
  2352. pageIndex: '1',
  2353. pageSize: '20',
  2354. total: 0,
  2355. },
  2356. toViewloadings: false,
  2357. tabPositionss: 'top',
  2358. monthTotal: 0,
  2359. monthTotalPage: 0,
  2360. monthTotalLages: 20,
  2361. monthWorkData: [],
  2362. monthNotWorkDate: [],
  2363. monthWorkDataS1: [],
  2364. monthnotTotal: 0,
  2365. monthnotTotalPage: 0,
  2366. monthnotTotalLages: 20,
  2367. monthNotWorkDateS1: [],
  2368. deptMembDataText: '',
  2369. isFlag: false,
  2370. isMore: false,
  2371. stateKey: '0',
  2372. expandDate: [],
  2373. notifySelList:[],
  2374. departmentList: [],
  2375. trandepartmentList:[],
  2376. approvalProcessDialog: false,
  2377. approvalProcessData: [],
  2378. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2379. 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')],
  2380. isWeekend: false,
  2381. canCancelInDialog: false,
  2382. approveinData: {},
  2383. approveinDialog: false,
  2384. reportCanDelete: false,
  2385. weeklyFilledTimeDialog: false,
  2386. weeklyFilledTimeList: [],
  2387. weeklyFilledTimeLoading: false,
  2388. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2389. weeklyFilledTimeCanDelete: false,
  2390. weeklyFilledTimeDate: null,
  2391. leaveAllNum: 0,
  2392. dataLoading: false,
  2393. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2394. vacationTime: {},
  2395. integrationProjectList: [],
  2396. totalReportHours: 0, // 合计的工时
  2397. workTimeForMinYi:0,
  2398. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2399. weekIndex: 1,
  2400. weekParentData: {},
  2401. deptIdForNoReport:[],
  2402. deptIdForReminder:[],
  2403. nameAearch: '', // 企业微信姓名搜索
  2404. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2405. deptMembDataLoading: false,
  2406. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2407. {
  2408. id: 4811,
  2409. // id: 10,
  2410. name: '陕西柘中建设工程有限公司'
  2411. }
  2412. ],
  2413. pushWorkTimeLogDig:false,
  2414. pushWorkTimeLogData:[],
  2415. userReportDeptList: [],
  2416. isReminder:true,
  2417. reportLogCheckDialog:false,
  2418. deptIdForHasReport:[],
  2419. transferWorkingHoursVisable: false
  2420. };
  2421. },
  2422. watch: {
  2423. deptMembDataText(val) {
  2424. this.$refs.chooseMembTree.filter(val);
  2425. }
  2426. },
  2427. filters: {
  2428. // 过滤
  2429. amounts(value) {
  2430. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2431. return 0
  2432. }
  2433. var zhi = +value + 0
  2434. return zhi.toFixed(1)
  2435. },
  2436. // zhoData
  2437. zhoData(value, arr) {
  2438. var dateArray = value.split("-");
  2439. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2440. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2441. // console.log(arr[date.getDay()])
  2442. // return "周" + "日一二三四五六".charAt(date.getDay());
  2443. return arr[date.getDay()]
  2444. },
  2445. // 过滤数字
  2446. numbers(value) {
  2447. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2448. return 0
  2449. }
  2450. return value
  2451. },
  2452. },
  2453. computed: {},
  2454. mounted() {
  2455. var now = new Date();
  2456. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2457. this.today = t;
  2458. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2459. this.exportParam.dateRange = [startStr,t];
  2460. this.exportReportLogParam.dateRange = [startStr,t];
  2461. this.getAllDate(1);
  2462. this.getReportList();
  2463. this.getProjectList();
  2464. this.getFillProjectList();
  2465. this.getTimeType();
  2466. this.getDepartment();
  2467. this.scrollFunction()
  2468. this.userssHu();
  2469. this.getFirstAndLastDay()
  2470. if(this.user.timeType.reportAuditType == 3){
  2471. this.getAllUsersList()
  2472. }
  2473. if (this.user.company.packageProject == 1) {
  2474. this.getBasecostItemList();
  2475. }
  2476. if(this.user.timeType.userWithMultiDept == 1) {
  2477. this.getDeptMembData();
  2478. }
  2479. if(this.user.timeType.lockWorktime){
  2480. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2481. }
  2482. //设置了下限
  2483. if (this.user.timeType.minReportTime) {
  2484. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2485. }
  2486. const that = this
  2487. if(this.user.userNameNeedTranslate == 1) {
  2488. that.dataLoading = that.$store.state.dataLoading
  2489. this.upDataLoading()
  2490. setTimeout(()=>{
  2491. that.dataLoading = that.$store.state.dataLoading
  2492. }, 1000)
  2493. }
  2494. if (this.user.companyId == this.yuzhongCompId) {
  2495. this.getJobResponList();
  2496. }
  2497. },
  2498. methods: {
  2499. ...mapMutations(['upDataLoading']),
  2500. // 已填工时情况表设置背景色
  2501. hasworkTblCellStyle({ columnIndex, row, column }) {
  2502. if(columnIndex > 2) {
  2503. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2504. const worktimeList = row.worktimeList || []
  2505. const times = this.reportTimeType.allday
  2506. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2507. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2508. const missReport = filterData[0] && filterData[0].missReport;
  2509. const state = filterData[0] && filterData[0].state
  2510. if (missReport) {
  2511. return "backgroundColor: red"
  2512. } else {
  2513. if (state == 0 || state == -1) {
  2514. return "backgroundColor: orange"
  2515. } else if (state == 1) {
  2516. //审核通过
  2517. return "backgroundColor: #32CD32"
  2518. } else if (state == 2) {
  2519. return "backgroundColor: red"
  2520. } else {
  2521. return "backgroundColor: #E0E0E0"
  2522. }
  2523. }
  2524. }
  2525. },
  2526. //按选择的日期范围刷新考勤
  2527. refreshWXCardTimeByRange() {
  2528. this.refreshingTime = true;
  2529. this.http.post('/wxcorp/getUserCheckInDayData',{
  2530. companyId: this.user.companyId,
  2531. userId: this.user.id,
  2532. startDate: this.importWxParam.date[0],
  2533. endDate: this.importWxParam.date[1],
  2534. },res => {
  2535. this.refreshingTime = false;
  2536. if(res.code == 'ok'){
  2537. this.loadCheckInData();
  2538. }else {
  2539. this.$message({
  2540. message: res.msg,
  2541. type: 'error'
  2542. })
  2543. }
  2544. },err => {
  2545. this.syncTimeLoading = false;
  2546. this.$message({
  2547. message: err,
  2548. type: 'error'
  2549. })
  2550. })
  2551. },
  2552. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2553. isCustomization(userInfo, permissionArray) {
  2554. const { companyId } = userInfo
  2555. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2556. return isReportPictureRequired
  2557. },
  2558. showHiddenFunction() {
  2559. this.showHidden = true;
  2560. },
  2561. // 获取如何信息选的可填写部门
  2562. getDeptMembData() {
  2563. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2564. if (res.code == "ok") {
  2565. let lists = res.data.userReportDeptList || []
  2566. const optimizedList = lists.map(item => ({
  2567. ...item,
  2568. label: item.departmentName,
  2569. value: item.departmentId,
  2570. }));
  2571. this.$set(this, 'userReportDeptList', optimizedList || []);
  2572. } else {
  2573. this.$message({
  2574. message: res.msg,
  2575. type: "error"
  2576. });
  2577. }
  2578. },error => { });
  2579. },
  2580. //任务被选中
  2581. onTaskSelected(domainItem) {
  2582. //取服务
  2583. if (domainItem.taskId) {
  2584. var that = this;
  2585. var param = {taskId:domainItem.taskId};
  2586. if (this.isSubstitude) {
  2587. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2588. param.userId = this.workForm.userId[0];
  2589. }
  2590. }
  2591. this.http.post('/task/getMyTaskService',param, res => {
  2592. if (res.code == "ok") {
  2593. // domainItem.workContentList = res.data;
  2594. that.$set(domainItem, 'sapServiceId', null);
  2595. that.$set(domainItem, 'serviceList', res.data);
  2596. } else {
  2597. this.$message({
  2598. message: res.msg,
  2599. type: "error"
  2600. });
  2601. }
  2602. },error => {
  2603. this.$message({
  2604. message: error,
  2605. type: "error"
  2606. });
  2607. }
  2608. );
  2609. } else {
  2610. //清空服务
  2611. }
  2612. },
  2613. onBatchTimeChange() {
  2614. //反向计算每日工作时长
  2615. if (this.workForm.createDate) {
  2616. let sdate = new Date(this.workForm.createDate[0]);
  2617. let edate = new Date(this.workForm.createDate[1]);
  2618. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2619. console.log('days===', days)
  2620. if (days < 0) {
  2621. return;
  2622. }
  2623. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2624. //总时长发生改变,自动按比例计算
  2625. this.workForm.domains.forEach(d=>{
  2626. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2627. });
  2628. }
  2629. },
  2630. //更新工作内容列表
  2631. updateJobContent(domainItem) {
  2632. var that = this;
  2633. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2634. if (res.code == "ok") {
  2635. // domainItem.workContentList = res.data;
  2636. that.$set(domainItem, 'extraField3', null);
  2637. that.$set(domainItem, 'workContentList', res.data);
  2638. } else {
  2639. this.$message({
  2640. message: res.msg,
  2641. type: "error"
  2642. });
  2643. }
  2644. },error => {
  2645. this.$message({
  2646. message: error,
  2647. type: "error"
  2648. });
  2649. }
  2650. );
  2651. },
  2652. updateResponse(domainItem) {
  2653. var that = this;
  2654. var selectPid = domainItem.projectId;
  2655. domainItem.extraField2 = null;
  2656. domainItem.extraField3 = null;
  2657. if (selectPid && domainItem.extraField1) {
  2658. //是否非项目
  2659. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2660. console.log('==========','isPublic=='+isPublic);
  2661. 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));
  2662. console.log(filteredRespList);
  2663. domainItem.filteredRespList = filteredRespList;
  2664. }
  2665. },
  2666. getJobResponList() {
  2667. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2668. if (res.code == "ok") {
  2669. this.jobResponseList = res.data;
  2670. } else {
  2671. this.$message({
  2672. message: res.msg,
  2673. type: "error"
  2674. });
  2675. }
  2676. },error => {
  2677. this.$message({
  2678. message: error,
  2679. type: "error"
  2680. });
  2681. }
  2682. );
  2683. },
  2684. openModImportTime(row) {
  2685. this.showModImportTimeDialog = true;
  2686. this.modItemDataId = row.id;
  2687. },
  2688. delImportTime(row) {
  2689. let rowId = row.id;
  2690. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2691. confirmButtonText: this.$t('btn.determine'),
  2692. cancelButtonText: this.$t('btn.cancel'),
  2693. type: "warning"
  2694. })
  2695. .then(() => {
  2696. this.http.post('/report-import-log/delete',{
  2697. id: rowId
  2698. },res => {
  2699. if (res.code == "ok") {
  2700. this.$message({
  2701. message: this.$t('message.successfullyDeleted'),
  2702. type: "success"
  2703. });
  2704. this.getToView();
  2705. } else {
  2706. this.$message({
  2707. message: res.msg,
  2708. type: "error"
  2709. });
  2710. }
  2711. },error => {
  2712. this.$message({
  2713. message: error,
  2714. type: "error"
  2715. });
  2716. }
  2717. );
  2718. }).catch(() => {this.startDeleting = false});
  2719. },
  2720. confirmChangeModTime() {
  2721. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2722. this.$message({
  2723. message: this.$t('message.Pleaseselectatime'),
  2724. type: "error"
  2725. });
  2726. return;
  2727. }
  2728. this.http.post('/report-import-log/changeTime',{
  2729. modLogDateTime: this.modImportTime,
  2730. modImportUserId: this.modImportUserId,
  2731. id: this.modItemDataId
  2732. },res => {
  2733. if (res.code == "ok") {
  2734. this.$message({
  2735. message: this.$t('message.modifyTheSuccess'),
  2736. type: "success"
  2737. });
  2738. this.getToView();
  2739. this.showModImportTimeDialog = false;
  2740. } else {
  2741. this.$message({
  2742. message: res.msg,
  2743. type: "error"
  2744. });
  2745. }
  2746. },error => {
  2747. this.$message({
  2748. message: error,
  2749. type: "error"
  2750. });
  2751. }
  2752. );
  2753. },
  2754. confirmBatchApproveReport() {
  2755. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2756. this.$message({
  2757. message: this.$t('qingXuanZeRiQiFanWei'),
  2758. type: "error"
  2759. });
  2760. return;
  2761. }
  2762. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2763. confirmButtonText: this.$t('btn.determine'),
  2764. cancelButtonText: this.$t('btn.cancel'),
  2765. type: "warning"
  2766. })
  2767. .then(() => {
  2768. this.startDeleting = true;
  2769. let obj = {
  2770. startDate: this.deleteReportParam.date[0],
  2771. endDate: this.deleteReportParam.date[1]
  2772. }
  2773. if(this.deleteReportParam.departmentId) {
  2774. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2775. } else {
  2776. obj.departmentId = null
  2777. }
  2778. this.http.post('/report/batchApproveByDate',obj,res => {
  2779. if (res.code == "ok") {
  2780. this.$message({
  2781. message: this.$t('state.approved'),
  2782. type: "success"
  2783. });
  2784. this.getReportList();
  2785. this.getDepartment();
  2786. this.startDeleting = false;
  2787. } else {
  2788. this.$message({
  2789. message: res.msg,
  2790. type: "error"
  2791. });
  2792. }
  2793. },error => {
  2794. this.$message({
  2795. message: error,
  2796. type: "error"
  2797. });
  2798. }
  2799. );
  2800. }).catch(() => {this.startDeleting = false});
  2801. },
  2802. confirmBatchDelReport() {
  2803. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2804. this.$message({
  2805. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2806. type: "error"
  2807. });
  2808. return;
  2809. }
  2810. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2811. this.$message({
  2812. message: this.$t('qingXuanZeRiQiFanWei'),
  2813. type: "error"
  2814. });
  2815. return;
  2816. }
  2817. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2818. confirmButtonText: this.$t('btn.determine'),
  2819. cancelButtonText: this.$t('btn.cancel'),
  2820. type: "warning"
  2821. })
  2822. .then(() => {
  2823. this.startDeleting = true;
  2824. this.http.post('/report/batchDelete',{
  2825. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2826. startDate: this.deleteReportParam.date[0],
  2827. endDate: this.deleteReportParam.date[1],
  2828. deptId: this.deleteReportParam.deptId[0]
  2829. },res => {
  2830. if (res.code == "ok") {
  2831. this.$message({
  2832. message: this.$t('message.successfullyDeleted'),
  2833. type: "success"
  2834. });
  2835. this.getReportList();
  2836. this.getDepartment();
  2837. this.startDeleting = false;
  2838. } else {
  2839. this.$message({
  2840. message: res.msg,
  2841. type: "error"
  2842. });
  2843. }
  2844. },error => {
  2845. this.$message({
  2846. message: error,
  2847. type: "error"
  2848. });
  2849. }
  2850. );
  2851. }).catch(() => {this.startDeleting = false});
  2852. },
  2853. getRecentlyProject() {
  2854. this.http.post('/project/nearProject',{},res => {
  2855. if(res.code == 'ok'){
  2856. let topObj = {
  2857. label: this.$t('zuiJinXuanZeXiangMu'),
  2858. peojectList: res.data
  2859. }
  2860. let botomObj = {
  2861. label: this.$t('other.allProject'),
  2862. peojectList: this.fillProjectList
  2863. }
  2864. //最近项目如果在fillProjectList中不存在,需要移除
  2865. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2866. this.integrationProjectList = [topObj, botomObj]
  2867. }else {
  2868. this.$message({
  2869. message: res.msg,
  2870. type: 'error'
  2871. })
  2872. }
  2873. },err => {
  2874. this.$message({
  2875. message: err,
  2876. type: 'error'
  2877. })
  2878. })
  2879. },
  2880. handlePictureCardPreview(file, index) {
  2881. console.log(file, index)
  2882. let arr = []
  2883. let imgArr = this.workForm.domains[index].imgListUrl
  2884. for(var i in imgArr) {
  2885. arr.push(imgArr[i].url)
  2886. }
  2887. console.log(arr, '图片数据')
  2888. const $viewer = this.$viewerApi({
  2889. images: arr
  2890. });
  2891. },
  2892. // 图片上传
  2893. addImg(e, index) {
  2894. console.log(e, '数据')
  2895. let formData = new FormData()
  2896. formData.append('multipartFile', e.file)
  2897. this.http.uploadFile('/common/uploadFile', formData,
  2898. res => {
  2899. if (res.code == "ok") {
  2900. this.$message({
  2901. message: this.$t('uploadedsuccessfully'),
  2902. type: "success"
  2903. });
  2904. if(!this.workForm.domains[index].imgList) {
  2905. this.workForm.domains[index].imgList = []
  2906. this.workForm.domains[index].imgListUrl = []
  2907. }
  2908. this.workForm.domains[index].imgList.push(res.data)
  2909. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2910. } else {
  2911. this.$message({message: res.msg,type: "error"});
  2912. }
  2913. console.log(this.workForm.domains[index])
  2914. },
  2915. error => {this.$message({message: error,type: "error"});
  2916. });
  2917. },
  2918. // 删除图片
  2919. delImg(file,fileList, index) {
  2920. console.log(file, fileList)
  2921. let idx = 0
  2922. for(let i in fileList) {
  2923. if(fileList[i].uid == file.uid) {
  2924. idx = i
  2925. }
  2926. }
  2927. this.workForm.domains[index].imgList.splice(idx, 1)
  2928. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2929. console.log(this.workForm.domains[index])
  2930. },
  2931. test(){
  2932. console.log('test',this.workForm.domains);
  2933. },
  2934. getHour(s1, s2) {
  2935. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2936. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2937. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2938. var ms = s2.getTime() - s1.getTime();
  2939. if (ms < 0) return 0;
  2940. let ma = ms / 1000 / 60 / 60
  2941. return ma; //小时
  2942. },
  2943. refreshWXCardTime(workdate) {
  2944. if (!workdate) return;
  2945. this.syncTimeLoading = true;
  2946. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2947. date: workdate,
  2948. },res => {
  2949. this.syncTimeLoading = false;
  2950. if(res.code == 'ok'){
  2951. this.workForm.time = res.data.time;
  2952. }else {
  2953. this.$message({
  2954. message: res.msg,
  2955. type: 'error'
  2956. })
  2957. }
  2958. },err => {
  2959. this.syncTimeLoading = false;
  2960. this.$message({
  2961. message: err,
  2962. type: 'error'
  2963. })
  2964. })
  2965. },
  2966. refreshAttendance(workdate) {
  2967. if (!workdate) return;
  2968. this.syncTimeLoading = true;
  2969. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2970. startDate: workdate[0],
  2971. endDate: workdate[1]
  2972. },res => {
  2973. this.syncTimeLoading = false;
  2974. if(res.code == 'ok'){
  2975. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2976. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2977. this.totalReportHours = this.workTimeForMinYi;
  2978. }else {
  2979. this.$message({
  2980. message: res.msg,
  2981. type: 'error'
  2982. })
  2983. }
  2984. },err => {
  2985. this.syncTimeLoading = false;
  2986. this.$message({
  2987. message: err,
  2988. type: 'error'
  2989. })
  2990. })
  2991. },
  2992. refreshBeiSengAttendance(workdate) {
  2993. if (!workdate) return;
  2994. this.syncTimeLoading = true;
  2995. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2996. createDate: workdate
  2997. },res => {
  2998. this.syncTimeLoading = false;
  2999. if(res.code == 'ok'){
  3000. this.workForm.time = res.data;
  3001. }else {
  3002. this.$message({
  3003. message: res.msg,
  3004. type: 'error'
  3005. })
  3006. }
  3007. },err => {
  3008. this.syncTimeLoading = false;
  3009. this.$message({
  3010. message: err,
  3011. type: 'error'
  3012. })
  3013. })
  3014. },
  3015. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3016. this.weeklyFilledTimeDialog = true
  3017. this.weeklyFilledTimeLoading = true
  3018. this.weeklyFilledTimeDate = parameterDate
  3019. this.http.post('/report/getReportList',{
  3020. date: parameterDate,
  3021. userId: this.user.id
  3022. },res => {
  3023. this.weeklyFilledTimeLoading = false
  3024. if(res.code == 'ok'){
  3025. this.weeklyFilledTimeList = res.data[0].data
  3026. let candelete = true
  3027. for(let i in this.weeklyFilledTimeList){
  3028. if(this.weeklyFilledTimeList[i].state < 2){
  3029. candelete = false
  3030. }
  3031. }
  3032. this.weeklyFilledTimeCanDelete = candelete
  3033. }else {
  3034. this.$message({
  3035. message: res.msg,
  3036. type: 'error'
  3037. })
  3038. }
  3039. },err => {
  3040. this.weeklyFilledTimeLoading = false
  3041. this.$message({
  3042. message: err,
  3043. type: 'error'
  3044. })
  3045. })
  3046. },
  3047. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3048. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3049. confirmButtonText: this.$t('btn.determine'),
  3050. cancelButtonText: this.$t('btn.cancel'),
  3051. type: "warning"
  3052. })
  3053. .then(() => {
  3054. this.http.post('/report/delete',{
  3055. userId: this.user.id,
  3056. date: this.weeklyFilledTimeDate
  3057. },res => {
  3058. if (res.code == "ok") {
  3059. this.$message({
  3060. message: this.$t('message.successfullyDeleted'),
  3061. type: "success"
  3062. });
  3063. this.getWeeklyWorkTime()
  3064. this.getReportList();
  3065. this.getDepartment();
  3066. this.weeklyFilledTimeDialog = false;
  3067. } else {
  3068. this.$message({
  3069. message: res.msg,
  3070. type: "error"
  3071. });
  3072. }
  3073. },error => {
  3074. this.$message({
  3075. message: error,
  3076. type: "error"
  3077. });
  3078. }
  3079. );
  3080. }).catch(() => {});
  3081. },
  3082. getApprovalProcess(item){
  3083. // console.log('this.date',this.choseDate);
  3084. this.http.post('/report-log/get',{
  3085. creatorId: item.id,
  3086. createDate: sessionStorage.msg
  3087. },res => {
  3088. if(res.code == 'ok'){
  3089. this.approvalProcessDialog = true
  3090. if(this.user.userNameNeedTranslate == 1) {
  3091. for(var i in res.data) {
  3092. let obj = {
  3093. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3094. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3095. }
  3096. res.data[i].msgCon = obj
  3097. }
  3098. }
  3099. this.approvalProcessData = res.data
  3100. console.log(this.approvalProcessData, '数据卡看')
  3101. }else{
  3102. this.$message({
  3103. message: res.msg,
  3104. type: 'error'
  3105. })
  3106. }
  3107. },err => {
  3108. this.$message({
  3109. message: err,
  3110. type: 'error'
  3111. })
  3112. })
  3113. //获取审批节点状态
  3114. if (this.user.companyId == 7544) {
  3115. this.http.post('/report/getCurAuditNode',{
  3116. userId: item.id,
  3117. date: sessionStorage.msg
  3118. },res => {
  3119. if(res.code == 'ok'){
  3120. this.curAuditNode = res.data
  3121. }else{
  3122. }
  3123. },err => {
  3124. this.$message({
  3125. message: err,
  3126. type: 'error'
  3127. })
  3128. })
  3129. }
  3130. },
  3131. filterNode(value, data) {
  3132. if (!value) return true;
  3133. return data.label.indexOf(value) !== -1;
  3134. },
  3135. triggerCalculateOT(index) {
  3136. var str = this.workForm.domains[index].overtimeHours + ''
  3137. if(str.indexOf('.') != '-1') {
  3138. var s = str.split('.')[0]
  3139. var st = str.split('.')[1]
  3140. var sts = st.split('')
  3141. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3142. }
  3143. },
  3144. searchScreen(e){
  3145. if(e){
  3146. this.monthNotWorkDateS1 = []
  3147. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3148. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3149. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3150. }
  3151. }
  3152. if (this.monthNotWorkDateS1.length > 50) {
  3153. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3154. }else{
  3155. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3156. }
  3157. // if (this.monthNotWorkDateS1.length > 0) {
  3158. // setTimeout(() => {
  3159. // this.tableListenernot()
  3160. // }, 1000);
  3161. // }
  3162. }else{
  3163. this.monthWorkDataS1 = []
  3164. for (let i = 0; i < this.monthWorkData.length; i++) {
  3165. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3166. this.monthWorkDataS1.push(this.monthWorkData[i])
  3167. }
  3168. }
  3169. if (this.monthWorkDataS1.length > 50) {
  3170. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3171. }else{
  3172. this.monthWorkDataS = this.monthWorkDataS1
  3173. }
  3174. // if (this.monthWorkDataS1.length > 0) {
  3175. // setTimeout(() => {
  3176. // this.tableListener()
  3177. // }, 1000);
  3178. // }
  3179. }
  3180. },
  3181. addUpload(data) {
  3182. // var zhi = data.fileName.split('.')[0]
  3183. // var sss = zhi + '.xlsx'
  3184. // return
  3185. var filePath = '/upload/' + data.serverName;
  3186. const a = document.createElement('a'); // 创建a标签
  3187. a.setAttribute('download', data.fileName);// download属性
  3188. a.setAttribute('href', filePath);// href链接
  3189. a.click(); //自执行点击事件
  3190. a.remove();
  3191. },
  3192. restrictNumber(targetId) {
  3193. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3194. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3195. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3196. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3197. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3198. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3199. inpu.value = parseFloat(inpu.value);
  3200. }
  3201. },
  3202. //获取项目下的任务分组
  3203. getTaskGroups(domain, index) {
  3204. domain.groupId=null;
  3205. this.http.post('/task-group/listMyJoinGroup',{
  3206. projectId: domain.projectId,
  3207. isSubstitude: this.isSubstitude ? 1 : 0
  3208. },
  3209. res => {
  3210. if (res.code == "ok") {
  3211. this.workForm.domains[index].taskGroups = res.data;
  3212. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3213. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3214. // this.getGroupStages(domain, index);
  3215. // }
  3216. this.$forceUpdate();
  3217. }
  3218. },
  3219. error => {
  3220. this.$message({
  3221. message: error,
  3222. type: "error"
  3223. });
  3224. }
  3225. );
  3226. },
  3227. //下载填报工时占比报表
  3228. downloadProjectRatio() {
  3229. this.exportUserRatio = true;
  3230. // let now = new Date();
  3231. // let month = now.getMonth();//默认看上个月的
  3232. // let monthStr = month<10? ('0'+month): month;
  3233. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3234. const today = new Date();
  3235. const year = today.getFullYear();
  3236. const month = today.getMonth() + 1;
  3237. let lastMonthYear, lastMonth;
  3238. if (month === 1) {
  3239. lastMonthYear = year - 1;
  3240. lastMonth = 12;
  3241. } else {
  3242. lastMonthYear = year;
  3243. lastMonth = month - 1;
  3244. }
  3245. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3246. console.log('赋值 ==>', this.ratioYmonth)
  3247. },
  3248. confirmDownloadRatio() {
  3249. this.startRatioExporting = true;
  3250. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3251. ymonth: this.ratioYmonth
  3252. },
  3253. res => {
  3254. if (res.code == "ok") {
  3255. this.startRatioExporting = false;
  3256. var filePath = res.data;
  3257. const a = document.createElement('a'); // 创建a标签
  3258. var data = filePath.split("/");
  3259. a.setAttribute('download', data[data.length-1]);// download属性
  3260. a.setAttribute('href', filePath);// href链接
  3261. a.click(); //自执行点击事件
  3262. a.remove();
  3263. } else {
  3264. this.startRatioExporting = false;
  3265. this.$message({
  3266. message: res.msg,
  3267. type: "error"
  3268. });
  3269. }
  3270. },
  3271. error => {
  3272. this.checkinLoading = false;
  3273. this.$message({
  3274. message: error,
  3275. type: "error"
  3276. });
  3277. }
  3278. );
  3279. },
  3280. //下载带企业微信考勤数据的工时统计模板
  3281. downloadCheckInExcel() {
  3282. var param = {
  3283. startDate: this.importWxParam.date[0],
  3284. endDate: this.importWxParam.date[1],
  3285. };
  3286. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3287. param.onlySelfData = false;
  3288. }
  3289. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3290. res => {
  3291. if (res.code == "ok") {
  3292. var filePath = res.data;
  3293. const a = document.createElement('a'); // 创建a标签
  3294. var data = filePath.split("/");
  3295. a.setAttribute('download', data[data.length-1]);// download属性
  3296. a.setAttribute('href', filePath);// href链接
  3297. a.click(); //自执行点击事件
  3298. a.remove();
  3299. } else {
  3300. this.$message({
  3301. message: res.msg,
  3302. type: "error"
  3303. });
  3304. }
  3305. },
  3306. error => {
  3307. this.checkinLoading = false;
  3308. this.$message({
  3309. message: error,
  3310. type: "error"
  3311. });
  3312. }
  3313. );
  3314. },
  3315. pre() {
  3316. if (this.active == 0) return;
  3317. this.active--;
  3318. },
  3319. next() {
  3320. this.active++;
  3321. },
  3322. triggerTotalTime(index) {
  3323. var item = this.checkinList[index];
  3324. var total = 0.0;
  3325. for (var i=0;i<this.projectColumns.length; i++) {
  3326. var key = this.projectColumns[i];
  3327. if (item[key] != null && item[key] != '') {
  3328. total += parseFloat(item[key]);
  3329. }
  3330. }
  3331. item.totalFillTime = total;
  3332. },
  3333. //提交批量代填的数据
  3334. submitBatchSubFillData() {
  3335. var data = JSON.stringify(this.checkinList);
  3336. this.http.post('/user-corpwx-time/submitProjectTime',{
  3337. json: data,
  3338. projectColumns: JSON.stringify(this.projectColumns)
  3339. },
  3340. res => {
  3341. if (res.code == "ok") {
  3342. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3343. this.importWxDialog = false;
  3344. }
  3345. },
  3346. error => {
  3347. this.checkinLoading = false;
  3348. this.$message({
  3349. message: error,
  3350. type: "error"
  3351. });
  3352. }
  3353. );
  3354. },
  3355. loadCheckInData() {
  3356. if (this.importWxParam.date == null) {
  3357. this.checkinList = [];
  3358. return;
  3359. }
  3360. this.checkinLoading = true;
  3361. this.http.post('/user-corpwx-time/getMyData',{
  3362. startDate: this.importWxParam.date[0],
  3363. endDate: this.importWxParam.date[1],
  3364. },
  3365. res => {
  3366. if (res.code == "ok") {
  3367. this.checkinLoading = false;
  3368. this.checkinList = res.data.list;
  3369. this.projectColumns = res.data.projects;
  3370. // 自定义表格会导致表格错乱,需重新计算表格
  3371. this.$nextTick(()=>{
  3372. this.$refs.tab.doLayout()
  3373. })
  3374. }
  3375. },
  3376. error => {
  3377. this.checkinLoading = false;
  3378. this.$message({
  3379. message: error,
  3380. type: "error"
  3381. });
  3382. }
  3383. );
  3384. },
  3385. importCardTime(item) {
  3386. //首先判断文件类型
  3387. let str = item.file.name.split(".");
  3388. let format = str[str.length - 1];
  3389. if (format != "xls" && format != "xlsx") {
  3390. this.$message({
  3391. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3392. type: "error"
  3393. });
  3394. } else {
  3395. this.importingData = true;
  3396. let formData = new FormData();
  3397. formData.append("multipartFile", item.file);
  3398. formData.append("companyId", this.user.companyId);
  3399. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3400. res => {
  3401. this.$refs.uploadCardTime.clearFiles();
  3402. this.importingData = false;
  3403. if (res.code == "ok") {
  3404. //换成弹出框,以免有人等了半天回来啥也没看到
  3405. this.$message({
  3406. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3407. type: "success"
  3408. });
  3409. } else {
  3410. this.$message({
  3411. message: res.msg,
  3412. type: "error"
  3413. });
  3414. }
  3415. },
  3416. error => {
  3417. this.$refs.upload.clearFiles();
  3418. this.listLoading = false;
  3419. this.$message({
  3420. message: error,
  3421. type: "error"
  3422. });
  3423. });
  3424. }
  3425. },
  3426. batchImportWxData(item) {
  3427. //首先判断文件类型
  3428. let str = item.file.name.split(".");
  3429. let format = str[str.length - 1];
  3430. if (format != "xls" && format != "xlsx") {
  3431. this.$message({
  3432. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3433. type: "error"
  3434. });
  3435. } else {
  3436. this.importingData = true;
  3437. let formData = new FormData();
  3438. formData.append("file", item.file);
  3439. formData.append("companyId", this.user.companyId);
  3440. formData.append("withCheckIn", 1);
  3441. this.http.uploadFile('/report/importData', formData,
  3442. res => {
  3443. this.$refs.upload.clearFiles();
  3444. this.showImportResult = true;
  3445. this.importingData = false;
  3446. if (res.code == "ok") {
  3447. //换成弹出框,以免有人等了半天回来啥也没看到
  3448. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3449. this.getReportList();
  3450. this.importWxDialog = false;
  3451. } else {
  3452. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3453. }
  3454. },
  3455. error => {
  3456. this.$refs.upload.clearFiles();
  3457. this.listLoading = false;
  3458. this.$message({
  3459. message: error,
  3460. type: "error"
  3461. });
  3462. });
  3463. }
  3464. },
  3465. batchImportData(item) {
  3466. //首先判断文件类型
  3467. let str = item.file.name.split(".");
  3468. let format = str[str.length - 1];
  3469. if (format != "xls" && format != "xlsx") {
  3470. this.$message({
  3471. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3472. type: "error"
  3473. });
  3474. } else {
  3475. this.importingData = true;
  3476. let formData = new FormData();
  3477. formData.append("file", item.file);
  3478. formData.append("companyId", this.user.companyId);
  3479. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3480. this.http.uploadFile(url, formData,
  3481. res => {
  3482. this.$refs.upload.clearFiles();
  3483. this.importingData = false;
  3484. this.showImportResult = true;
  3485. if (res.code == "ok") {
  3486. //换成弹出框,以免有人等了半天回来啥也没看到
  3487. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3488. this.getReportList();
  3489. this.importWXDialog = false;
  3490. } else {
  3491. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3492. }
  3493. },
  3494. error => {
  3495. this.$refs.upload.clearFiles();
  3496. this.importingData = false;
  3497. this.$message({
  3498. message: error,
  3499. type: "error"
  3500. });
  3501. });
  3502. }
  3503. },
  3504. userssHu() {
  3505. this.http.post('/time-type/getCompanyTimeSetting',{
  3506. companyId: this.user.companyId
  3507. },
  3508. res => {
  3509. if (res.code == "ok") {
  3510. this.yonghuUser = res.data
  3511. }
  3512. },
  3513. error => {
  3514. this.$message({
  3515. message: error,
  3516. type: "error"
  3517. });
  3518. }
  3519. );
  3520. },
  3521. iptBlur(i) {
  3522. if(this.isBatch == 0) {
  3523. return
  3524. }
  3525. var reqParam = {
  3526. startDate: this.workForm.createDate[0],
  3527. endDate: this.workForm.createDate[1]
  3528. };
  3529. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3530. reqParam.userId = this.workForm.userId[0];
  3531. }
  3532. this.http.post('/report/getWorkDays',reqParam,
  3533. res => {
  3534. if (res.code == "ok") {
  3535. this.jsDay = res.data
  3536. this.chuji(i)
  3537. } else {
  3538. this.$message({
  3539. message: res.msg,
  3540. type: "error"
  3541. });
  3542. }
  3543. },
  3544. error => {
  3545. this.$message({
  3546. message: error,
  3547. type: "error"
  3548. });
  3549. }
  3550. );
  3551. //明夷硬编码获取
  3552. if (this.user.company.companyName == this.mingyiName) {
  3553. this.getWorkTimeForMinYi();
  3554. }
  3555. },
  3556. getWorkTimeForMinYi(){
  3557. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3558. startDate: this.workForm.createDate[0],
  3559. endDate: this.workForm.createDate[1]
  3560. },
  3561. res => {
  3562. if (res.code == "ok") {
  3563. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3564. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3565. this.totalReportHours = this.workTimeForMinYi;
  3566. } else {
  3567. this.$message({
  3568. message: res.msg,
  3569. type: "error"
  3570. });
  3571. this.workForm.createDate = [];
  3572. }
  3573. },
  3574. error => {
  3575. this.$message({
  3576. message: error,
  3577. type: "error"
  3578. });
  3579. }
  3580. );
  3581. },
  3582. chuji(i) {
  3583. if(i == 0) {
  3584. this.seleChn(1)
  3585. } else if(i == 1) {
  3586. this.seleChn(0)
  3587. } else if(i == 2) {
  3588. if(this.workForm.domains[0].multiWorktime > 0) {
  3589. this.iptChangs()
  3590. } else {
  3591. this.iptChang()
  3592. }
  3593. } else if(i == 3) {
  3594. this.seleChn(0)
  3595. }
  3596. },
  3597. seleChn(e,domain) {
  3598. if(e == 1) {
  3599. for(var i in this.workForm.domains) {
  3600. if(this.workForm.domains[i].timeType == 0) {
  3601. this.workForm.domains[i].workingTime = 8
  3602. } else {
  3603. this.workForm.domains[i].workingTime = 4
  3604. }
  3605. }
  3606. }
  3607. var quanbu = 0
  3608. var spl = this.workForm.domains
  3609. var zhi = ''
  3610. for(var i in spl) {
  3611. var sp = +spl[i].workingTime + 0
  3612. zhi = this.jsDay * sp
  3613. quanbu = +quanbu + zhi
  3614. }
  3615. this.jsTime = quanbu
  3616. this.totalReportHours = quanbu
  3617. let worktime = this.jsTime
  3618. // 自动计算加班时长
  3619. if(this.isBatch != 0){
  3620. worktime = this.jsTime / this.jsDay
  3621. }
  3622. if(this.user.timeType.fillOvertime && domain){
  3623. let isover = false
  3624. let alltime = 0
  3625. let allover = 0 //此处alltime同上面的worktime
  3626. for(let d in spl){
  3627. if(spl[d].isOvertime){
  3628. isover = true
  3629. allover += spl[d].overtimeHours*1
  3630. }
  3631. alltime += spl[d].workingTime*1
  3632. }
  3633. if(domain.overtimeHours){
  3634. allover = allover - domain.overtimeHours
  3635. }
  3636. if(worktime*1 > this.user.timeType.allday){
  3637. if(isover){
  3638. if(alltime > (allover + this.user.timeType.allday)){
  3639. this.$set(domain,'isOvertime',true)
  3640. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3641. }else{
  3642. this.$set(domain,'isOvertime',false)
  3643. this.$set(domain,'overtimeHours',null)
  3644. if(alltime < (allover + this.user.timeType.allday)){
  3645. let overtime = allover + this.user.timeType.allday - alltime
  3646. for(let pi in spl){
  3647. if(spl[pi].overtimeHours){
  3648. if((overtime - spl[pi].overtimeHours*1) > 0){
  3649. overtime = overtime - spl[pi].overtimeHours*1
  3650. this.$set(spl[pi],'isOvertime',false)
  3651. this.$set(spl[pi],'overtimeHours',null)
  3652. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3653. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3654. break
  3655. }else{
  3656. this.$set(spl[pi],'isOvertime',false)
  3657. this.$set(spl[pi],'overtimeHours',null)
  3658. break
  3659. }
  3660. }
  3661. }
  3662. }
  3663. }
  3664. }else{
  3665. this.$set(domain,'isOvertime',true)
  3666. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3667. }
  3668. }else{
  3669. for(let di in spl){
  3670. this.$set(spl[di],'isOvertime',false)
  3671. this.$set(spl[di],'overtimeHours',null)
  3672. }
  3673. }
  3674. }
  3675. },
  3676. iptChang() {
  3677. var sl = this.workForm.domains
  3678. let timeArr = []
  3679. for(var i in sl) {
  3680. if(sl[i].startTime && sl[i].endTime) {
  3681. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3682. }
  3683. }
  3684. this.getTimeHours(timeArr)
  3685. // for(let j in arrNum) {
  3686. // this.timeJsonStr += arrNum[j]
  3687. // if(flg) {
  3688. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3689. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3690. // }
  3691. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3692. // flg = true
  3693. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3694. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3695. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3696. // }
  3697. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3698. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3699. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3700. // }
  3701. // }
  3702. },
  3703. iptChangs() {
  3704. var sl = this.workForm.domains
  3705. let timeArr = []
  3706. for(var i in sl) {
  3707. for(var j in sl[i].worktimeList){
  3708. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3709. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3710. }
  3711. }
  3712. }
  3713. this.getTimeHours(timeArr)
  3714. },
  3715. // 调用接口或去数据
  3716. getTimeHours(arr) {
  3717. this.http.post('/report/getHoursByTimeRange',{
  3718. timeJsonStr: JSON.stringify(arr)
  3719. },res => {
  3720. if(res.code === 'ok') {
  3721. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3722. } else {
  3723. this.$message({
  3724. message: res.msg,
  3725. type: 'error'
  3726. })
  3727. }
  3728. },err => {
  3729. this.$message({
  3730. message: err,
  3731. type: 'error'
  3732. })
  3733. })
  3734. },
  3735. // 按周填报调用接口计算时间
  3736. async getWeekHoursByTimeRange(timeRange) {
  3737. const url = '/report/getHoursByTimeRange';
  3738. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3739. var that = this;
  3740. return new Promise((resolve, reject) => {
  3741. this.http.post(url, data, function(res) {
  3742. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3743. }, function(err) {
  3744. reject(err);
  3745. });
  3746. });
  3747. },
  3748. removeTimeItem(item, index) {
  3749. item.worktimeList.splice(index, 1);
  3750. this.iptChangs()
  3751. },
  3752. //添加工时
  3753. addNewWorktime(index, item) {
  3754. if(item.worktimeList == null ) {
  3755. item.worktimeList = []
  3756. }
  3757. item.worktimeList.push({});
  3758. },
  3759. //复制项目
  3760. copyProject(index) {
  3761. var leftProgress = 10;
  3762. if (this.reportTimeType.type == 3) {
  3763. //计算已经待分配工时比例
  3764. let array = this.workForm.domains;
  3765. let totalProgress = 0;
  3766. for (var i=0;i<array.length; i++) {
  3767. totalProgress += array[i].progress;
  3768. }
  3769. if (totalProgress < 100) {
  3770. leftProgress = 100 - totalProgress;
  3771. }
  3772. }
  3773. var newIndex = index+1;
  3774. var itemDomain = {
  3775. projectId: this.workForm.domains[index].projectId,
  3776. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3777. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3778. ),
  3779. content: "",
  3780. progress:leftProgress,
  3781. state:2,//2-表示待提交
  3782. };
  3783. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3784. if (this.reportTimeType.type == 0) {
  3785. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3786. var length = this.workForm.domains.length;
  3787. if (length == 2) {
  3788. this.showAddMore = false;
  3789. }
  3790. }
  3791. this.selectProject(itemDomain, newIndex);
  3792. },
  3793. pushWorkTime(reportId){
  3794. let url=''
  3795. if(this.user.timeType.syncSap == 1){
  3796. url='/report/pushProjectReportToSap'
  3797. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3798. var pushDate = this.date + day;
  3799. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3800. confirmButtonText: this.$t('btn.determine'),
  3801. cancelButtonText: this.$t('btn.cancel'),
  3802. type: 'info'
  3803. }).then(() => {
  3804. const loading = this.$loading({
  3805. lock: true,
  3806. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3807. spinner: 'el-icon-loading',
  3808. background: 'rgba(0, 0, 0, 0.7)'
  3809. });
  3810. this.http.post(url,{
  3811. pushDate: pushDate,
  3812. reportId: reportId
  3813. },res => {
  3814. loading.close();
  3815. if(res.code == 'ok'){
  3816. this.$message({
  3817. type: 'success',
  3818. message: res.data
  3819. });
  3820. }else{
  3821. this.$message({
  3822. type: 'error',
  3823. message: res.msg
  3824. })
  3825. }
  3826. },err => {
  3827. loading.close();
  3828. this.$message({
  3829. type: 'error',
  3830. message: err
  3831. })
  3832. })
  3833. }).catch(() => {
  3834. });
  3835. }else{
  3836. url='/report/pushReportDataToThird'
  3837. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3838. confirmButtonText: this.$t('btn.determine'),
  3839. cancelButtonText: this.$t('btn.cancel'),
  3840. type: 'info'
  3841. }).then(() => {
  3842. const loading = this.$loading({
  3843. lock: true,
  3844. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3845. spinner: 'el-icon-loading',
  3846. background: 'rgba(0, 0, 0, 0.7)'
  3847. });
  3848. this.http.post(url,{
  3849. yearMonth: this.date
  3850. },res => {
  3851. loading.close();
  3852. if(res.code == 'ok'){
  3853. this.$message({
  3854. type: 'success',
  3855. message: this.$t('tuiSongChengGong')
  3856. });
  3857. }else{
  3858. this.$message({
  3859. type: 'error',
  3860. message: res.msg
  3861. })
  3862. }
  3863. },err => {
  3864. loading.close();
  3865. this.$message({
  3866. type: 'error',
  3867. message: err
  3868. })
  3869. })
  3870. }).catch(() => {
  3871. });
  3872. }
  3873. },
  3874. showWorkTime(){
  3875. this.monthWorkTimeDialog = true;
  3876. this.searchKeyword = ''
  3877. this.WorktimeDatepickValue = this.istoMonth()
  3878. if(this.WorktimeDatepickValue.length == 0){
  3879. let newdate = new Date();
  3880. let nowdate = newdate.toLocaleDateString();
  3881. let getauto = this.getAutoWeekDate(nowdate)
  3882. let nowwd = [getauto[0],getauto[6]]
  3883. this.WorktimeDatepickValue = nowwd
  3884. }
  3885. this.showMonthWorkTime()
  3886. },
  3887. handleClick(t,e){
  3888. if (t.name == "second") {
  3889. this.showMonthNotWorkTime()
  3890. }else if(t.name == "first"){
  3891. this.showMonthWorkTime()
  3892. }else if(t.name == "third"){
  3893. this.showMonthWorkTimeReminder()
  3894. }
  3895. },
  3896. //导出员工每日填报工时数
  3897. exportMembWorkHours() {
  3898. this.http.post(
  3899. "/report/exportUserDailyWorkTime",
  3900. {
  3901. // month: this.date,
  3902. startDate: this.WorktimeDatepickValue[0],
  3903. endDate: this.WorktimeDatepickValue[1],
  3904. },
  3905. (res) => {
  3906. if (res.code == "ok") {
  3907. let url = res.data;
  3908. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3909. }
  3910. },
  3911. (error) => {
  3912. this.$message({
  3913. message: error,
  3914. type: "error",
  3915. });
  3916. }
  3917. );
  3918. },
  3919. exportMembWorkHoursReminder() {
  3920. this.http.post(
  3921. "/report/exportUserDailyWorkTimeReminder",
  3922. {
  3923. // month: this.date,
  3924. startDate: this.WorktimeDatepickValue[0],
  3925. endDate: this.WorktimeDatepickValue[1],
  3926. },
  3927. (res) => {
  3928. if (res.code == "ok") {
  3929. let url = res.data;
  3930. this.downloadByA('工时异常表.xlsx', url);
  3931. }
  3932. },
  3933. (error) => {
  3934. this.$message({
  3935. message: error,
  3936. type: "error",
  3937. });
  3938. }
  3939. );
  3940. },
  3941. exportMembNotWorkHours() {
  3942. this.http.post(
  3943. "/report/exportNoReportUserList",
  3944. {
  3945. // month: this.date,
  3946. startDate: this.WorktimeDatepickValue[0],
  3947. endDate: this.WorktimeDatepickValue[1],
  3948. },
  3949. (res) => {
  3950. if (res.code == "ok") {
  3951. let url = res.data;
  3952. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3953. }
  3954. },
  3955. (error) => {
  3956. this.$message({
  3957. message: error,
  3958. type: "error",
  3959. });
  3960. }
  3961. );
  3962. },
  3963. downloadByA(name, url) {
  3964. const a = document.createElement("a"); // 创建a标签
  3965. a.setAttribute("download", name); // download属性
  3966. a.setAttribute("href", url); // href链接
  3967. a.click(); // 自执行点击事件
  3968. a.remove();
  3969. },
  3970. // 是否本月判断
  3971. istoMonth(){
  3972. let todate = new Date()
  3973. let tomonth = todate.getMonth() + 1
  3974. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3975. if(this.date == adate){
  3976. return []
  3977. }else{
  3978. let sedate = new Date(this.date)
  3979. let semonth = sedate.getMonth() + 1
  3980. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3981. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3982. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3983. return [sedates1, sedates2]
  3984. }
  3985. },
  3986. showMonthWorkTime() {
  3987. this.monthTotalPage = 0,
  3988. this.tbload = true
  3989. let parameter={
  3990. startDate: this.WorktimeDatepickValue[0],
  3991. endDate: this.WorktimeDatepickValue[1],
  3992. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3993. }
  3994. this.http.post(
  3995. "/report/getUserDailyWorkTime",
  3996. // "/report/getNoReportUserList",
  3997. parameter,
  3998. (res) => {
  3999. if (res.code == "ok") {
  4000. this.tbload = false;
  4001. this.pickDateArray = res.data.days.map(item => {
  4002. return {
  4003. ...item,
  4004. dateStr: item.label.split('/')[0],
  4005. weekStr: item.label.split('/')[1]
  4006. }
  4007. });
  4008. // console.log('dataarray',res.data.days);
  4009. this.monthWorkData = res.data.list;
  4010. // this.monthWorkDataS = this.monthWorkData
  4011. // this.monthWorkDataS1 = res.data.list
  4012. this.monthTotal = res.data.list.length
  4013. if (this.monthWorkData.length > 50) {
  4014. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4015. }else{
  4016. this.monthWorkDataS = this.monthWorkData
  4017. }
  4018. this.searchScreen(0)
  4019. // this.monthWorkDataS = infoList
  4020. // 判断
  4021. // if (this.monthWorkDataS1.length > 0) {
  4022. // setTimeout(() => {
  4023. // this.tableListener()
  4024. // }, 1000);
  4025. // }
  4026. this.$nextTick(function(){
  4027. this.$refs.hasworkTbl.doLayout();
  4028. });
  4029. // this.$forceUpdate()
  4030. }
  4031. },
  4032. (error) => {
  4033. this.tbload = false
  4034. this.$message({
  4035. message: error,
  4036. type: "error",
  4037. });
  4038. }
  4039. );
  4040. },
  4041. showMonthWorkTimeReminder() {
  4042. this.monthTotalPage = 0,
  4043. this.tbload = true
  4044. let parameter={}
  4045. parameter={
  4046. startDate: this.WorktimeDatepickValue[0],
  4047. endDate: this.WorktimeDatepickValue[1],
  4048. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4049. viewValue:this.isReminder?1:0
  4050. }
  4051. this.http.post(
  4052. "/report/getUserDailyWorkTimeReminder",
  4053. parameter,
  4054. (res) => {
  4055. if (res.code == "ok") {
  4056. this.tbload = false;
  4057. this.monthWorkData = res.data.list;
  4058. this.monthTotal = res.data.list.length
  4059. if (this.monthWorkData.length > 50) {
  4060. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4061. }else{
  4062. this.monthWorkDataS = this.monthWorkData
  4063. }
  4064. this.searchScreen(0)
  4065. this.$nextTick(function(){
  4066. this.$refs.hasworkTbl.doLayout();
  4067. });
  4068. }
  4069. },
  4070. (error) => {
  4071. this.tbload = false
  4072. this.$message({
  4073. message: error,
  4074. type: "error",
  4075. });
  4076. }
  4077. );
  4078. },
  4079. // tableListener(){
  4080. // let that = this;
  4081. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4082. // // 添加scroll监听事件
  4083. // dom.addEventListener("scroll", function () {
  4084. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4085. // if (scrollDistance < 2) {
  4086. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4087. // that.monthTotalPage++; //当前页数自增
  4088. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4089. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4090. // var infoList = arrList.splice(
  4091. // that.monthTotalPage * that.monthTotalLages,
  4092. // that.monthTotalLages
  4093. // );
  4094. // // 数据添加
  4095. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4096. // }
  4097. // }
  4098. // })
  4099. // },
  4100. showMonthNotWorkTime() {
  4101. this.monthTotalPage = 0,
  4102. this.tbload = true,
  4103. this.http.post(
  4104. "/report/getNoReportUserList",
  4105. {
  4106. startDate: this.WorktimeDatepickValue[0],
  4107. endDate: this.WorktimeDatepickValue[1],
  4108. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4109. },
  4110. (res) => {
  4111. if (res.code == "ok") {
  4112. this.tbload = false
  4113. this.monthNotWorkDate = res.data;
  4114. // this.monthNotWorkDateS1 = res.data
  4115. this.monthnotTotal = res.data.length
  4116. // 2222111
  4117. if (this.monthNotWorkDate.length > 50) {
  4118. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4119. } else {
  4120. this.monthNotWorkDateS = this.monthNotWorkDate
  4121. }
  4122. this.searchScreen(1)
  4123. // 判断
  4124. // if (this.monthnotworkDateS1.length > 0) {
  4125. // setTimeout(() => {
  4126. // this.tableListenernot()
  4127. // }, 1000);
  4128. // }
  4129. this.$nextTick(function(){
  4130. this.$refs.hasworkTbl2.doLayout();
  4131. });
  4132. }
  4133. },
  4134. (error) => {
  4135. this.tbload = false
  4136. this.$message({
  4137. message: error,
  4138. type: "error",
  4139. });
  4140. }
  4141. );
  4142. },
  4143. // tableListenernot(){
  4144. // let that = this;
  4145. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4146. // dom.addEventListener("scroll", function () {
  4147. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4148. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4149. // if (scrollDistance2 < 2) {
  4150. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4151. // that.monthnotTotalPage++; //当前页数自增
  4152. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4153. // var infoList = arrList.splice(
  4154. // that.monthnotTotalPage * that.monthnotTotalLages,
  4155. // that.monthnotTotalLages
  4156. // );
  4157. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4158. // }
  4159. // }
  4160. // })
  4161. // },
  4162. listScroll(){
  4163. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4164. this.isMore = true
  4165. setTimeout(()=>{
  4166. this.isMore = false
  4167. },1000)
  4168. }else {
  4169. this.isFlag = true
  4170. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4171. this.monthWorkDataS = datalist
  4172. setTimeout(()=>{
  4173. this.isFlag = false
  4174. },300)
  4175. }
  4176. },
  4177. notListScroll(){
  4178. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4179. this.isMore = true
  4180. setTimeout(()=>{
  4181. this.isMore = false
  4182. },1000)
  4183. }else {
  4184. this.isFlag = true
  4185. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4186. this.monthNotWorkDateS = datalist
  4187. // console.log('length',this.monthNotWorkDateS.length)
  4188. setTimeout(()=>{
  4189. this.isFlag = false
  4190. },300)
  4191. }
  4192. },
  4193. getFirstAndLastDay() {
  4194. // 将选定的月份转换为Date对象
  4195. var monthDate = new Date();
  4196. var year = monthDate.getFullYear();
  4197. var month = monthDate.getMonth();
  4198. // 计算起始日和结束日
  4199. var startDay = new Date(year, month, 1);
  4200. var endDay = new Date(year, month + 1, 0);
  4201. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4202. this.WorktimeDatepickValueForMonth=lastmd
  4203. },
  4204. formatDate(date) {
  4205. var year = date.getFullYear();
  4206. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4207. var day = ("0" + date.getDate()).slice(-2);
  4208. return year + "-" + month + "-" + day;
  4209. },
  4210. // 获取默认这zhou日期参数 222
  4211. getLastWeek(e){
  4212. let newdate = new Date()
  4213. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4214. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4215. if(e==1){
  4216. this.WorktimeDatepickValue = lastwd
  4217. this.showMonthWorkTime()
  4218. }else if(e==2){
  4219. this.WorktimeDatepickValue = lastwd
  4220. this.showMonthWorkTimeReminder()
  4221. }else{
  4222. this.WorktimeDatepickValue = lastwd
  4223. this.showMonthNotWorkTime()
  4224. }
  4225. },
  4226. getThisWeek(e){
  4227. let newdate = new Date();
  4228. let nowdate = newdate.toLocaleDateString();
  4229. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4230. if(e==1){
  4231. this.WorktimeDatepickValue = nowwd
  4232. this.showMonthWorkTime()
  4233. }else if(e==2){
  4234. this.WorktimeDatepickValue = nowwd
  4235. this.showMonthWorkTimeReminder()
  4236. }else{
  4237. this.WorktimeDatepickValue = nowwd
  4238. this.showMonthNotWorkTime()
  4239. }
  4240. },
  4241. getDoubleLastWeek(e){
  4242. let newdate = new Date()
  4243. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4244. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4245. if(e==1){
  4246. this.WorktimeDatepickValue = nextwd
  4247. this.showMonthWorkTime()
  4248. }else if(e==2){
  4249. this.WorktimeDatepickValue = nextwd
  4250. this.showMonthWorkTimeReminder()
  4251. }else{
  4252. this.WorktimeDatepickValue = nextwd
  4253. this.showMonthNotWorkTime()
  4254. }
  4255. },
  4256. alreadyAllDate(stime,etime){
  4257. let diffdate = new Array();
  4258. let i=0;
  4259. while(stime<=etime){
  4260. let dateArray = stime.split("-");
  4261. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4262. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4263. let stimewk = this.weekDay[date.getDay()]
  4264. 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')
  4265. 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])
  4266. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4267. let stime_ts = new Date(stime).getTime();
  4268. let next_date = stime_ts + (24*60*60*1000);
  4269. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4270. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4271. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4272. stime = next_dates_y+next_dates_m+next_dates_d;
  4273. i++;
  4274. }
  4275. return diffdate
  4276. },
  4277. getAutoWeekDate(e) {
  4278. let dateString = e;
  4279. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4280. if (dateString.match(dateStringReg)) {
  4281. let presentDate = new Date(dateString),
  4282. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4283. return Array.from(new Array(7), function (val, index) {
  4284. let formatDate = new Date(
  4285. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4286. );
  4287. return (
  4288. formatDate.getFullYear() +
  4289. "-" +
  4290. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4291. "-" +
  4292. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4293. );
  4294. });
  4295. } else {
  4296. throw new Error(
  4297. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4298. );
  4299. }
  4300. },
  4301. onProgressChange() {
  4302. this.$forceUpdate();
  4303. },
  4304. showChooseMembTree() {
  4305. this.chosenMembCount = this.participator.length;
  4306. this.chooseParticipVisible = true;
  4307. },
  4308. onTreeItemChange() {
  4309. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4310. var list = chosenList.filter(item=>item.isUser == 1);
  4311. this.chosenMembCount = list.length;
  4312. },
  4313. findUserInTree() {
  4314. if (this.filterName == '') {
  4315. this.deptMembData = this.allMembData;
  4316. } else {
  4317. var list = this.findRecursively(this.filterName, this.allMembData);
  4318. this.deptMembData = list;
  4319. }
  4320. },
  4321. findRecursively(username, list) {
  4322. var filterList = [];
  4323. for (var i=0;i<list.length; i++) {
  4324. if (list[i].isUser == 1) {
  4325. if (list[i].label.indexOf(username) >= 0) {
  4326. //匹配上了
  4327. filterList.push(list[i]);
  4328. }
  4329. } else if (list[i].children != null && list[i].children.length > 0) {
  4330. var subList = this.findRecursively(username, list[i].children);
  4331. if (subList.length > 0) {
  4332. subList.forEach(s=>filterList.push(s));
  4333. }
  4334. }
  4335. }
  4336. return filterList;
  4337. },
  4338. //确定选择参与人
  4339. chooseParticip() {
  4340. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4341. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4342. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4343. if (this.user.company.packageProject == 1) {
  4344. if (this.chosenMembList.length > 1) {
  4345. this.$message({
  4346. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4347. type: "error",
  4348. });
  4349. return;
  4350. }
  4351. }
  4352. this.chooseParticipVisible = false;
  4353. this.workForm.userNames = '';
  4354. this.workForm.userId = [];
  4355. this.participator = [];
  4356. for (var i=0;i<this.chosenMembList.length; i++) {
  4357. this.workForm.userId.push(this.chosenMembList[i].id);
  4358. this.workForm.userNames += this.chosenMembList[i].label+',';
  4359. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4360. this.participator.push(item);
  4361. }
  4362. if (this.workForm.userNames.length > 0) {
  4363. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4364. }
  4365. if(this.user.userNameNeedTranslate == 1) {
  4366. if(this.workForm.userNames) {
  4367. this.workForm.userNames = this.workForm.userNames.split(',')
  4368. }
  4369. }
  4370. },
  4371. notifySel(sel){
  4372. // console.log(sel);
  4373. this.notifySelList = sel
  4374. },
  4375. //微信通知人员填写
  4376. Notify(code) {
  4377. if (this.notifySelList.length == 0) return;
  4378. var ids = '';
  4379. this.notifySelList.forEach(f=>{
  4380. ids += f.id+',';
  4381. })
  4382. this.http.post('/user/pushFillReport',{
  4383. ids: ids, date: this.curDate,
  4384. code: code
  4385. },
  4386. res => {
  4387. if (res.code == "ok") {
  4388. this.$message({
  4389. message: this.$t('message.sentSuccessfully'),
  4390. type: "success"
  4391. });
  4392. }
  4393. },
  4394. error => {
  4395. this.$message({
  4396. message: error,
  4397. type: "error"
  4398. });
  4399. }
  4400. );
  4401. },
  4402. //导出人员列表
  4403. exportMemb() {
  4404. if (this.fillMembList.length == 0) return;
  4405. var ids = '';
  4406. this.fillMembList.forEach(f=>{
  4407. ids += f.id+',';
  4408. })
  4409. this.http.post('/user/exportMembList',{
  4410. ids: ids,isFill: this.isFill, date: this.curDate
  4411. },
  4412. res => {
  4413. if (res.code == "ok") {
  4414. var aTag = document.createElement('a');
  4415. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4416. aTag.href = res.data;
  4417. aTag.click();
  4418. }
  4419. },
  4420. error => {
  4421. this.$message({
  4422. message: error,
  4423. type: "error"
  4424. });
  4425. }
  4426. );
  4427. },
  4428. showMembList(fill) {
  4429. this.membListVisible = true;
  4430. if (fill == 0) {
  4431. this.fillMembList = this.unFillList;
  4432. this.isFill = false;
  4433. let leaveList = []
  4434. let unleaveList = []
  4435. for(let i in this.fillMembList){
  4436. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4437. leaveList.push(this.fillMembList[i])
  4438. }else{
  4439. unleaveList.push(this.fillMembList[i])
  4440. }
  4441. }
  4442. this.fillMembList = unleaveList
  4443. this.fillMembList_leave = leaveList
  4444. } else if(fill == 1){
  4445. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4446. this.isFill = true;
  4447. }else{
  4448. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4449. this.isFill = true;
  4450. }
  4451. },
  4452. //获取自己填写的日报状态
  4453. getReportFillStatus() {
  4454. this.http.post('/report/getReportFillStatus',{
  4455. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4456. },
  4457. res => {
  4458. if (res.code == "ok") {
  4459. this.fillStatusList = res.data;
  4460. this.allDate.forEach(d=>{
  4461. var fillInfo = null;
  4462. d.state = null;
  4463. this.fillStatusList.forEach(s=>{
  4464. var d1 = s.createDate.split('-')[2];
  4465. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4466. if (d1.indexOf('0') == 0) {
  4467. d1 = d1.substring(1,d1.length);
  4468. }
  4469. if (d1 == d2) {
  4470. d.state = s.state;
  4471. d.missReport = s.missReport;//是否漏填
  4472. d.exceedCardTime = s.exceedCardTime
  4473. }
  4474. })
  4475. })
  4476. this.$forceUpdate();
  4477. }
  4478. },
  4479. error => {
  4480. this.$message({
  4481. message: error,
  4482. type: "error"
  4483. });
  4484. }
  4485. );
  4486. },
  4487. scrollFunction () {
  4488. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4489. if (this.domObj.attachEvent) { // IE
  4490. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4491. } else if (this.domObj.addEventListener) {
  4492. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4493. }
  4494. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4495. },
  4496. mouseScroll(event) { // google 浏览器下
  4497. let detail = event.wheelDelta || event.detail
  4498. let moveForwardStep = -1
  4499. let moveBackStep = 1
  4500. let step = 0
  4501. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4502. event.preventDefault() // 阻止浏览器默认事件
  4503. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4504. },
  4505. // //左右滚动
  4506. // wheel(e){
  4507. // var a = document.getElementById("dateScroll");
  4508. // var scroll_width = 80; //滚动一下的距离
  4509. // var e = e || window.event, v;
  4510. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4511. // if(v>3||-v>3) v=-v;
  4512. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4513. // e.preventDefault(); //阻止浏览器的默认滚动
  4514. // },
  4515. showExportDialog() {
  4516. this.exportType = 0
  4517. this.exportDialog = true;
  4518. },
  4519. showExportTimeDialog() {
  4520. this.exportTimeDialog = true;
  4521. },
  4522. changeAllTime() {
  4523. //总时长发生改变,自动按比例计算
  4524. this.workForm.domains.forEach(d=>{
  4525. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4526. });
  4527. //计算jsTime
  4528. if (this.workForm.createDate) {
  4529. let sdate = new Date(this.workForm.createDate[0]);
  4530. let edate = new Date(this.workForm.createDate[1]);
  4531. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4532. console.log('days===', days)
  4533. if (days < 0) {
  4534. days = 0;
  4535. }
  4536. this.jsTime = this.reportTimeType.allday * days;
  4537. }
  4538. },
  4539. // 是否加班的单机事件
  4540. check() {
  4541. this.selected = !this.selected
  4542. this.isNew = this.selected
  4543. },
  4544. updateSubProject() {
  4545. this.$forceUpdate();
  4546. },
  4547. selectDegreeId(domain, index) {
  4548. this.http.post('/report/defaultDegree',{
  4549. projectId: domain.projectId
  4550. },
  4551. res => {
  4552. if (res.code == "ok") {
  4553. if(res.data) {
  4554. this.workForm.domains[index].degreeId = res.data.id + ''
  4555. this.$forceUpdate();
  4556. }
  4557. }
  4558. },
  4559. error => {
  4560. this.$message({
  4561. message: error,
  4562. type: "error"
  4563. });
  4564. }
  4565. );
  4566. },
  4567. //项目选中了, 加载子项目
  4568. selectProject(domain, index) {
  4569. if(!domain.projectId){
  4570. return;
  4571. }
  4572. // 默认选中上次填写的自定义维度
  4573. if(this.yonghuUser.customDegreeActive == 1) {
  4574. this.selectDegreeId(domain, index)
  4575. }
  4576. // console.log('projectId===',domain.projectId);
  4577. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4578. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4579. this.http.post('/sub-project/list',{
  4580. projectId: domain.projectId,
  4581. isReport: true
  4582. },
  4583. res => {
  4584. //清空之前选中的子项目
  4585. // this.workForm.domains[index].subProjectId = 0;
  4586. if (res.code == "ok") {
  4587. this.workForm.domains[index].subProjectList = res.data;
  4588. this.workForm.domains[index].subProjectId = null;
  4589. this.$forceUpdate();
  4590. }
  4591. },
  4592. error => {
  4593. this.$message({
  4594. message: error,
  4595. type: "error"
  4596. });
  4597. }
  4598. );
  4599. //项目相关的近期任务
  4600. if (this.user.company.packageProject == 1) {
  4601. this.getRecentTaskList(domain, index);
  4602. //获取项目相关专业
  4603. if (this.user.company.packageEngineering == 1) {
  4604. this.getProjectProfessions(domain, index);
  4605. }
  4606. //获取项目下的任务分组
  4607. this.getTaskGroups(domain, index);
  4608. }
  4609. // 获取项目相关的维度
  4610. // domain.degreeId = null
  4611. this.$set(domain,'degreeId',null)
  4612. this.$set(domain,'multiDegrIdArray',null)
  4613. this.dimension(domain, index);
  4614. //获取项目审核人
  4615. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4616. this.getProjectAuditorList(domain, index);
  4617. } else {
  4618. //按分组的负责人来审核
  4619. domain.projectAuditorId = null;
  4620. domain.projectAuditorName = null;
  4621. domain.auditUserList = null;
  4622. }
  4623. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4624. if (this.reportTimeType.type == 3) {
  4625. //新增项目时,自动计算
  4626. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4627. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4628. }
  4629. //加载昱众的工作职责
  4630. if (this.user.companyId == this.yuzhongCompId) {
  4631. this.updateResponse(domain);
  4632. }
  4633. },
  4634. getRecentTaskList(domain, index) {
  4635. //刷新任务时,清空服务
  4636. this.$set(domain, 'sapServiceId', null);
  4637. this.$set(domain, 'taskId', null);
  4638. var param = {
  4639. projectId: domain.projectId,
  4640. isSubstitude:this.isSubstitude?1:0,
  4641. };
  4642. if (domain.groupId) {
  4643. param.groupId = domain.groupId;
  4644. }
  4645. if (domain.stage) {
  4646. param.stage = domain.stage;
  4647. }
  4648. //专业版代填,获取代填员工的任务
  4649. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4650. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4651. this.$message({
  4652. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4653. type: "error"
  4654. });
  4655. return;
  4656. } else {
  4657. param.userId = this.workForm.userId[0];
  4658. }
  4659. }
  4660. this.http.post('/task/getRecentTask',param,
  4661. res => {
  4662. if (res.code == "ok") {
  4663. this.workForm.domains[index].allTaskList = res.data;
  4664. this.workForm.domains[index].taskList = res.data;
  4665. this.$forceUpdate();
  4666. }
  4667. },
  4668. error => {
  4669. this.$message({
  4670. message: error,
  4671. type: "error"
  4672. });
  4673. }
  4674. );
  4675. },
  4676. //获取项目审核人
  4677. getProjectAuditorList(domainItem, index) {
  4678. if(domainItem.projectId == '') {
  4679. return
  4680. }
  4681. domainItem.projectAuditorId = null;
  4682. domainItem.projectAuditorName = null;
  4683. this.http.post('/project-auditor/getList',{
  4684. projectId: domainItem.projectId,
  4685. },
  4686. res => {
  4687. if (res.code == "ok") {
  4688. domainItem.auditUserList = res.data;
  4689. if (res.data.length==0) {
  4690. this.$message({
  4691. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4692. type: "error"
  4693. });
  4694. } else if (res.data.length==1) {
  4695. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4696. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4697. }
  4698. this.$forceUpdate();
  4699. }
  4700. },
  4701. error => {
  4702. this.$message({
  4703. message: error,
  4704. type: "error"
  4705. });
  4706. }
  4707. );
  4708. },
  4709. // 获取维度数据
  4710. dimension(domain, index) {
  4711. if(domain.projectId == '') {
  4712. return
  4713. }
  4714. this.http.post('/project/getDegreeList',{
  4715. projectId: domain.projectId,
  4716. },
  4717. res => {
  4718. if (res.code == "ok") {
  4719. // console.log("维度数据",res.data);
  4720. this.workForm.domains[index].wuduList = res.data
  4721. // this.workForm = this.workForm
  4722. this.$forceUpdate()
  4723. }
  4724. },
  4725. error => {
  4726. this.$message({
  4727. message: error,
  4728. type: "error"
  4729. });
  4730. }
  4731. );
  4732. },
  4733. //切换任务阶段
  4734. changeStages(domain, index) {
  4735. if (domain.stage == null || domain.stage == '') {
  4736. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4737. } else {
  4738. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4739. }
  4740. this.getRecentTaskList(domain, index);
  4741. this.$forceUpdate();
  4742. },
  4743. getGroupStages(domain, index, keepStage) {
  4744. // console.log(domain);
  4745. if(!domain.groupId){
  4746. domain.projectAuditorId = ''
  4747. domain.stages = []
  4748. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4749. domain.taskId = ''
  4750. domain.sapServiceId = ''
  4751. }
  4752. if(this.user.timeType.reportAuditType >= 1){
  4753. domain.auditUserList = []
  4754. }
  4755. this.$forceUpdate();
  4756. return
  4757. }
  4758. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4759. res => {
  4760. if (res.code == "ok") {
  4761. if (!keepStage) {
  4762. domain.stage = '';
  4763. }
  4764. domain.stages = res.data;
  4765. this.getRecentTaskList(domain, index);
  4766. this.$forceUpdate();
  4767. }
  4768. },
  4769. error => {
  4770. this.$message({
  4771. message: error,
  4772. type: "error"
  4773. });
  4774. });
  4775. //检查当前的项目是否需要获取分组的负责人
  4776. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4777. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4778. res => {
  4779. if (res.code == "ok") {
  4780. domain.getProjectAuditorList = res.data;
  4781. domain.auditUserList = res.data;
  4782. if (res.data.length==1) {
  4783. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4784. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4785. } else if (res.data.length==0) {
  4786. domain.projectAuditorId = null;
  4787. domain.projectAuditorName = null;
  4788. }
  4789. this.$forceUpdate();
  4790. }
  4791. },
  4792. error => {
  4793. this.$message({
  4794. message: error,
  4795. type: "error"
  4796. });
  4797. });
  4798. }
  4799. },
  4800. getProjectProfessions(domain, index) {
  4801. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4802. res => {
  4803. if (res.code == "ok") {
  4804. this.workForm.domains[index].professionProgress = res.data;
  4805. this.$forceUpdate();
  4806. }
  4807. },
  4808. error => {
  4809. this.$message({
  4810. message: error,
  4811. type: "error"
  4812. });
  4813. });
  4814. },
  4815. //删除自己的日报
  4816. deleteReport() {
  4817. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4818. confirmButtonText: this.$t('btn.determine'),
  4819. cancelButtonText: this.$t('btn.cancel'),
  4820. type: "warning"
  4821. })
  4822. .then(() => {
  4823. this.listLoading = true;
  4824. this.http.post('/report/delete',{
  4825. userId: this.user.id,
  4826. date: this.workForm.createDate
  4827. },
  4828. res => {
  4829. this.listLoading = false;
  4830. if (res.code == "ok") {
  4831. this.$message({
  4832. message: this.$t('message.successfullyDeleted'),
  4833. type: "success"
  4834. });
  4835. this.getReportList();
  4836. this.getDepartment();
  4837. this.dialogVisible = false;
  4838. } else {
  4839. this.$message({
  4840. message: res.msg,
  4841. type: "error"
  4842. });
  4843. }
  4844. },
  4845. error => {
  4846. this.listLoading = false;
  4847. this.$message({
  4848. message: error,
  4849. type: "error"
  4850. });
  4851. }
  4852. );
  4853. })
  4854. .catch(() => {});
  4855. },
  4856. // 管理员删除日报
  4857. guanli(item) {
  4858. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4859. let param = {date: this.date + day, userId: item.id};
  4860. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4861. confirmButtonText: this.$t('btn.determine'),
  4862. cancelButtonText: this.$t('btn.cancel'),
  4863. type: "warning"
  4864. })
  4865. .then(() => {
  4866. this.listLoading = true;
  4867. this.http.post('/report/delete',param,
  4868. res => {
  4869. this.listLoading = false;
  4870. if (res.code == "ok") {
  4871. this.$message({
  4872. message: this.$t('message.successfullyDeleted'),
  4873. type: "success"
  4874. });
  4875. this.getReportList();
  4876. this.getDepartment();
  4877. this.dialogVisible = false;
  4878. } else {
  4879. this.$message({
  4880. message: res.msg,
  4881. type: "error"
  4882. });
  4883. }
  4884. },
  4885. error => {
  4886. this.listLoading = false;
  4887. this.$message({
  4888. message: error,
  4889. type: "error"
  4890. });
  4891. }
  4892. );
  4893. })
  4894. .catch(() => {});
  4895. },
  4896. selectAll() {
  4897. if (this.isAllSelect) {
  4898. var keys = [];
  4899. this.reportNames.forEach(b=>{
  4900. keys.push(b.id);
  4901. })
  4902. this.$refs.approveTree.setCheckedKeys(keys);
  4903. } else {
  4904. this.$refs.approveTree.setCheckedKeys([]);
  4905. }
  4906. },
  4907. removeEmptyNode(list) {
  4908. for (var i=0;i<list.length;i++) {
  4909. var cnt = 0;
  4910. if (list[i].membCount == 0) {
  4911. list.splice(i, 1);
  4912. i--;
  4913. } else if (list[i].children != null) {
  4914. this.removeEmptyNode(list[i].children);
  4915. }
  4916. }
  4917. },
  4918. calculateMembCount(list) {
  4919. for (var i in list) {
  4920. var cnt = 0;
  4921. if (list[i].children != null) {
  4922. this.calculateMembCount(list[i].children);
  4923. for (var m in list[i].children) {
  4924. cnt += list[i].children[m].membCount;
  4925. }
  4926. }
  4927. if (list[i].isUser == 1) {
  4928. cnt++;
  4929. this.membCount++;
  4930. }
  4931. list[i].membCount = cnt;
  4932. }
  4933. },
  4934. stateChange() {
  4935. // console.log(this.allData,'alldate');
  4936. this.membCount = 0;
  4937. if (this.selectState == -1) {
  4938. //全部状态
  4939. this.data = this.allData;
  4940. } else {
  4941. //未填报
  4942. this.seluserText = ''
  4943. var newData = JSON.parse(JSON.stringify(this.allData));
  4944. this.filterState(this.selectState, newData);
  4945. this.data = newData;
  4946. }
  4947. this.calculateMembCount(this.data);
  4948. this.data[0].membCount = this.membCount;//总人数
  4949. },
  4950. //按状态过滤部门人员
  4951. filterState(state, list) {
  4952. for (var i =0;i<list.length; i++) {
  4953. var obj = list[i];
  4954. if (obj.isUser == 1) {
  4955. var match = false;
  4956. if (state == -2) {
  4957. if (obj.state == null) {
  4958. match = true;
  4959. }
  4960. } else {
  4961. if (obj.state == state) {
  4962. match = true;
  4963. }
  4964. }
  4965. if (!match) {
  4966. list.splice(i, 1);
  4967. i--;
  4968. } else {
  4969. }
  4970. } else {
  4971. if (obj.children != null) {
  4972. this.filterState(state, obj.children);
  4973. }
  4974. }
  4975. }
  4976. },
  4977. //a按名称过滤部门人员
  4978. async seluserforText(){
  4979. const { userNameNeedTranslate } = this.user
  4980. this.membCount = 0;
  4981. var newData = JSON.parse(JSON.stringify(this.allData));
  4982. let textList = [this.seluserText]
  4983. if(userNameNeedTranslate == 1) {
  4984. this.dataLoading = true
  4985. let res = await this.postData('/user/getEmployeeList', {
  4986. keyword: this.seluserText,
  4987. cursor: '',
  4988. departmentId: -1,
  4989. pageIndex: 1,
  4990. pageSize: 1000
  4991. })
  4992. textList = res.data.records.map(item => item.name)
  4993. this.dataLoading = false
  4994. }
  4995. // return
  4996. console.log(textList, '<=== textList')
  4997. this.seluserforTextin(this.seluserText, newData, textList)
  4998. console.log(newData, 'Data')
  4999. this.data = newData;
  5000. this.calculateMembCount(this.data);
  5001. this.data[0].membCount = this.membCount;//总人数
  5002. },
  5003. seluserforTextin(text, list, textList = []){
  5004. for (var i =0;i<list.length; i++) {
  5005. var obj = list[i];
  5006. if (obj.isUser == 1) {
  5007. var match = false;
  5008. // if (obj.label.indexOf(text) != -1) {
  5009. // match = true
  5010. // }
  5011. if(textList.some(item => item.includes(obj.label))) {
  5012. match = true
  5013. }
  5014. if (!match) {
  5015. list.splice(i, 1);
  5016. i--;
  5017. } else {
  5018. }
  5019. } else {
  5020. if (obj.children != null) {
  5021. this.seluserforTextin(text, obj.children, textList);
  5022. }
  5023. }
  5024. }
  5025. },
  5026. // 当节点发生变化时
  5027. nodeChangeExpand(data) {
  5028. // 保存当前展开的节点
  5029. let flag = false
  5030. this.nodeModelData.some(item => {
  5031. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5032. flag = true
  5033. return true
  5034. }
  5035. })
  5036. if (!flag) { // 不存在则存到数组里
  5037. this.nodeModelData.push(data.id)
  5038. }
  5039. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5040. },
  5041. nodeChangeCollapse(data) {
  5042. console.log(this.nodeModelData)
  5043. this.nodeModelData.some((item, i) => {
  5044. if (item === data.id) {
  5045. this.nodeModelData.length = i
  5046. }
  5047. })
  5048. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5049. },
  5050. // 部门列表点击
  5051. handleNodeClick(data) {
  5052. // this.dealList = data
  5053. this.theValues(data.id, this.allData)
  5054. // this.depData = data;
  5055. var list = [];
  5056. if (data.id == -1) {
  5057. this.deptId = null;
  5058. this.targetUid = null;
  5059. list = this.data;
  5060. } else if (data.isUser == 1) {
  5061. this.deptId = null;
  5062. this.targetUid = data.id;
  5063. } else {
  5064. this.deptId = data.id;
  5065. this.targetUid = null;
  5066. list.push(data);
  5067. }
  5068. this.getReportList();
  5069. if (list.length > 0) {
  5070. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5071. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5072. }
  5073. },
  5074. exportPushLog(){
  5075. this.http.post('/sap-sync-log/export',{},
  5076. res => {
  5077. if (res.code == "ok") {
  5078. var filePath = res.data;
  5079. var fName = '推送日志.xlsx'
  5080. const a = document.createElement('a'); // 创建a标签
  5081. a.setAttribute('download', fName);// download属性
  5082. a.setAttribute('href', filePath);// href链接
  5083. a.click(); //自执行点击事件
  5084. a.remove();
  5085. } else {
  5086. this.$message({
  5087. message: res.msg,
  5088. type: "error"
  5089. });
  5090. }
  5091. },
  5092. error => {
  5093. this.$message({
  5094. message: error,
  5095. type: "error"
  5096. });
  5097. });
  5098. },
  5099. theValues(id, item) {
  5100. for(var i in item) {
  5101. if(item[i].id == id) {
  5102. this.depData = item[i]
  5103. if(id == '-1') {
  5104. this.translation = '1'
  5105. } else {
  5106. if(item[i].children) {
  5107. this.translation = '2'
  5108. } else {
  5109. this.translation = '3'
  5110. }
  5111. }
  5112. return
  5113. } else {
  5114. if(item[i].children) {
  5115. this.theValues(id, item[i].children)
  5116. }
  5117. }
  5118. }
  5119. },
  5120. //获取可以选择的代填的人员列表
  5121. getSubstitudeUserDeptList() {
  5122. if (this.deptMembData.length == 0) {
  5123. this.http.post("/department/listMyMembs", {},
  5124. res => {
  5125. if (res.code == "ok") {
  5126. let noAllData = JSON.parse(JSON.stringify(res.data));
  5127. if (noAllData.length > 0) {
  5128. // if (noAllData[0].label == '全部人员') {
  5129. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5130. noAllData.splice(0,1);
  5131. }
  5132. }
  5133. this.setUserToDept(noAllData);
  5134. this.deptMembData = noAllData;
  5135. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5136. console.log(this.deptMembData, '代填人员数据')
  5137. } else {
  5138. this.$message({
  5139. message: res.msg,
  5140. type: "error"
  5141. });
  5142. }
  5143. },
  5144. error => {
  5145. this.$message({
  5146. message: error,
  5147. type: "error"
  5148. });
  5149. });
  5150. }
  5151. },
  5152. // 获取部门列表
  5153. getDepartmentForApprove() {
  5154. this.http.post( this.port.manage.depList, {},
  5155. res => {
  5156. if (res.code == "ok") {
  5157. var list1 = JSON.parse(JSON.stringify(res.data));
  5158. this.deptOptionList = this.changeArr(list1);
  5159. console.log(this.deptOptionList, '部门')
  5160. } else {
  5161. this.$message({
  5162. message: res.msg,
  5163. type: "error"
  5164. });
  5165. }
  5166. },
  5167. error => {
  5168. this.$message({
  5169. message: error,
  5170. type: "error"
  5171. });
  5172. });
  5173. },
  5174. // 获取部门列表
  5175. getDepartment() {
  5176. //如果没有权限,就不需要获取
  5177. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5178. return;
  5179. }
  5180. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5181. var param = {date:this.date + day};
  5182. this.http.post("/report/getMembList", param,
  5183. res => {
  5184. if (res.code == "ok") {
  5185. if(res.data.length == 0){
  5186. return
  5187. }
  5188. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5189. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5190. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5191. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5192. // if (this.user.role > 0) {
  5193. // }
  5194. list.splice(0,0,{
  5195. id: -1,
  5196. label: this.$t('lable.allStaff'),
  5197. })
  5198. this.membCount = 0;
  5199. //设置员工到部门下面
  5200. this.setUserToDept(list);
  5201. this.data = list;
  5202. // console.log('data',this.data);
  5203. this.expandDate = [this.data[1].id]
  5204. this.allData = list;
  5205. // if (noAllData.length > 0) {
  5206. // if (noAllData[0].label == '全部人员') {
  5207. // noAllData.splice(0,1);
  5208. // }
  5209. // }
  5210. // this.setUserToDept(noAllData);
  5211. // this.deptMembData = noAllData;
  5212. this.option = this.changeArr(list1);
  5213. list[0].membCount = this.membCount;
  5214. if (this.depData.id == -1) {
  5215. this.depData.membCount = this.membCount;
  5216. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5217. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5218. } else {
  5219. if (this.depData.isUser == null) {
  5220. var dep = this.findTargetDept(this.data, this.depData.id);
  5221. var membDeptList = [];
  5222. membDeptList.push(dep);
  5223. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5224. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5225. }
  5226. }
  5227. if (this.depData.isUser == null) {
  5228. if (this.isFill) {
  5229. this.fillMembList = this.fillList;
  5230. } else {
  5231. this.fillMembList = this.unFillList;
  5232. }
  5233. }
  5234. this.leaveAllNum = 0
  5235. for(let i in this.unFillList){
  5236. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5237. this.leaveAllNum += 1
  5238. }
  5239. }
  5240. this.stateChange()
  5241. } else {
  5242. this.$message({
  5243. message: res.msg,
  5244. type: "error"
  5245. });
  5246. }
  5247. },
  5248. error => {
  5249. this.$message({
  5250. message: error,
  5251. type: "error"
  5252. });
  5253. });
  5254. this.getReportFillStatus();
  5255. },
  5256. findTargetDept(list, deptId) {
  5257. var t = null;
  5258. for (var i=0;i<list.length; i++) {
  5259. if (list[i].isUser == null && list[i].id == deptId) {
  5260. t = list[i];
  5261. break;
  5262. }
  5263. }
  5264. if (t == null) {
  5265. for (var i=0;i<list.length; i++) {
  5266. if (list[i].children != null && list[i].children.length > 0) {
  5267. t = this.findTargetDept(list[i].children, deptId);
  5268. if (t != null) {
  5269. break;
  5270. }
  5271. }
  5272. }
  5273. }
  5274. return t;
  5275. },
  5276. getUserMembListFromDeptList(list, isFill) {
  5277. var membList = [];
  5278. for (var i in list) {
  5279. var deptName = list[i].label;
  5280. if (list[i].userList != null) {
  5281. list[i].userList.forEach(element => {
  5282. if (isFill == 0) {
  5283. //获取未填的
  5284. if (element.state == null) {
  5285. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5286. membList.push(obj);
  5287. }
  5288. } else {
  5289. if (element.state != null) {
  5290. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5291. membList.push(obj);
  5292. }
  5293. }
  5294. });
  5295. }
  5296. if (list[i].children != null) {
  5297. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5298. }
  5299. }
  5300. return membList;
  5301. },
  5302. setUserToDept(list) {
  5303. for (var i in list) {
  5304. var cnt = 0;
  5305. if (list[i].children != null) {
  5306. this.setUserToDept(list[i].children);
  5307. for (var m in list[i].children) {
  5308. cnt += list[i].children[m].membCount;
  5309. }
  5310. }
  5311. if (list[i].userList != null) {
  5312. if (list[i].children == null) {
  5313. list[i].children = [];
  5314. }
  5315. list[i].userList.forEach(element => {
  5316. var obj = {
  5317. id: element.id,
  5318. label:element.name,
  5319. state:element.state,
  5320. parentId:element.departmentId,
  5321. isUser:1,
  5322. workingTime: element.workingTime,
  5323. leaveDays: element.leaveDays,
  5324. leaveTimes: element.leaveTimes
  5325. };
  5326. list[i].children.push(obj);
  5327. this.membCount++;
  5328. cnt++;
  5329. });
  5330. }
  5331. list[i].membCount = cnt;
  5332. }
  5333. },
  5334. // 修改数组
  5335. changeArr(arr) {
  5336. for (var i = 0; i < arr.length; i++) {
  5337. if(arr[i].id != -1 && arr[i].id != 0) {
  5338. if (arr[i].children != null && arr[i].children.length>0) {
  5339. arr[i].children = this.changeArr(arr[i].children);
  5340. }
  5341. arr[i].id && (arr[i].value = arr[i].id);
  5342. delete arr[i].id;
  5343. }
  5344. }
  5345. for(var i in arr) {
  5346. if(arr[i].id == -1 || arr[i].id == 0) {
  5347. arr.splice(i,1)
  5348. }
  5349. }
  5350. return arr;
  5351. },
  5352. //时间段范围设置改动,监听
  5353. onTimeTypeChange(timeType) {
  5354. this.seleChn(1)
  5355. this.showAddMore = true;
  5356. for(var i in this.workForm.domains) {
  5357. if (this.workForm.domains[i].timeType == 0) {
  5358. this.showAddMore = false;
  5359. break;
  5360. }
  5361. }
  5362. if (this.showAddMore) {
  5363. //检测数量
  5364. if (this.workForm.domains.length == 2) {
  5365. this.showAddMore = false;
  5366. } else {
  5367. this.showAddMore = true;
  5368. }
  5369. }
  5370. },
  5371. getTimeType() {
  5372. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5373. res => {
  5374. if (res.code == "ok") {
  5375. var t = res.data;
  5376. this.reportTimeType = t;
  5377. if (this.reportTimeType.type > 0) {
  5378. this.showAddMore = true;
  5379. }
  5380. //转化时间格式
  5381. if (t.allday != null) {
  5382. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5383. }
  5384. if (t.am != null) {
  5385. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5386. }
  5387. if (t.pm != null) {
  5388. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5389. }
  5390. let arr = []
  5391. for(var i in res.data.excludeTimeList) {
  5392. let obj = {
  5393. s: res.data.excludeTimeList[i].startTime,
  5394. e: res.data.excludeTimeList[i].endTime,
  5395. }
  5396. arr.push(obj)
  5397. }
  5398. this.vacationTime = arr
  5399. } else {
  5400. this.$message({
  5401. message: res.msg,
  5402. type: "error"
  5403. });
  5404. }
  5405. },
  5406. error => {
  5407. this.listLoading = false;
  5408. this.$message({
  5409. message: error,
  5410. type: "error"
  5411. });
  5412. });
  5413. },
  5414. // 改变月份 -------
  5415. changeMonthOut() {
  5416. this.getAllDate();
  5417. this.getReportList();
  5418. this.getDepartment();
  5419. },
  5420. // 选择日期
  5421. choseDate(i, item) {
  5422. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5423. return
  5424. }
  5425. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5426. this.choseDay = i;
  5427. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5428. sessionStorage.msg = this.date + day,
  5429. this.getReportList();
  5430. this.getDepartment();
  5431. this.curDate = item.date;
  5432. },
  5433. canClick(i, item){
  5434. let nowDate = new Date()
  5435. let nowDateYear = nowDate.getFullYear()
  5436. let itemYear = parseInt(this.date.split('-')[0])
  5437. let nowDateMonth = nowDate.getMonth() + 1
  5438. let itemMonth = parseInt(this.date.split('-')[1])
  5439. let nowDateDay = nowDate.getDate()
  5440. let itemDay = parseInt(item.showDate.split('.')[1])
  5441. if(nowDateYear < itemYear){
  5442. return false
  5443. }else if(nowDateYear == itemYear){
  5444. if(nowDateMonth < itemMonth){
  5445. return false
  5446. }else if(nowDateMonth == itemMonth){
  5447. if(nowDateDay < itemDay){
  5448. return false
  5449. }
  5450. }
  5451. }
  5452. },
  5453. // 获取日期列表
  5454. getAllDate(e) {
  5455. var dayArry = [];
  5456. var day = this.getCountDays();
  5457. let curMonthDay = null;
  5458. for (var k = 1; k <= day; k++) {
  5459. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5460. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5461. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5462. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5463. if(sessionStorage.msg) {
  5464. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5465. this.choseDay = k - 1;
  5466. curMonthDay = str;
  5467. }
  5468. } else {
  5469. if (new Date().getDate() == k) {
  5470. this.choseDay = k - 1;
  5471. }
  5472. }
  5473. } else {
  5474. this.choseDay = 0;
  5475. }
  5476. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5477. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5478. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5479. }
  5480. this.allDate = dayArry;
  5481. //不能超过最大日期
  5482. if (this.choseDay > day-1) {
  5483. this.choseDay = day-1;
  5484. }
  5485. if(sessionStorage.from != 1){
  5486. let nowmonth = new Date().getMonth() + 1
  5487. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5488. let nowdate = new Date().getDate()
  5489. if(nowd == this.date){
  5490. if(e && sessionStorage.msg){
  5491. }else{
  5492. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5493. }
  5494. let nowday = new Date(sessionStorage.msg).getDate()
  5495. this.choseDay = nowday - 1
  5496. let monthdate = new Date(sessionStorage.msg)
  5497. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5498. }else{
  5499. if(e && sessionStorage.msg){
  5500. }else{
  5501. sessionStorage.msg = this.date + '-01'
  5502. }
  5503. let monthdate = new Date(sessionStorage.msg)
  5504. this.choseDay = monthdate.getDate() - 1
  5505. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5506. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5507. }
  5508. }else{
  5509. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5510. }
  5511. //从消息点击跳转过来的,直接加载指定日期
  5512. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5513. this.curDate = sessionStorage.msg;
  5514. sessionStorage.from = 0;
  5515. } else {
  5516. // if (curMonthDay != null) {
  5517. // // this.curDate = curMonthDay;
  5518. // let d = new Date(sessionStorage.msg)
  5519. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5520. // } else {
  5521. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5522. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5523. // }
  5524. }
  5525. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5526. // if(!sessionStorage.msg){
  5527. // let msgday = this.choseDay + 1
  5528. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5529. // }
  5530. this.getReportFillStatus();
  5531. },
  5532. getCountDays() {
  5533. var newstr = this.date.replace(/-/g, "/");
  5534. var curDate = new Date(newstr+'/01');
  5535. var curMonth = curDate.getMonth();
  5536. curDate.setMonth(curMonth + 1);
  5537. curDate.setDate(0);
  5538. return curDate.getDate();
  5539. },
  5540. reqMore() {
  5541. if (this.hasMore) {
  5542. this.pageIndex++;
  5543. this.requestHttpReports();
  5544. }
  5545. },
  5546. //加载日报数据
  5547. requestHttpReports() {
  5548. //请求数据
  5549. this.listLoading = true;
  5550. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5551. let param = {date: this.date + day};
  5552. if (this.deptId) {
  5553. param.deptId = this.deptId;
  5554. }
  5555. if (this.targetUid) {
  5556. param.userId = this.targetUid;
  5557. }
  5558. //传页码
  5559. if (this.hasMore) {
  5560. param.pageIndex = this.pageIndex;
  5561. }
  5562. this.http.post( this.port.report.list, param,
  5563. res => {
  5564. this.listLoading = false;
  5565. if (res.code == "ok") {
  5566. //扩增
  5567. if (res.data.data.length > 0) {
  5568. this.reportList = this.reportList.concat(res.data.data);
  5569. } else if (this.pageIndex > 1){
  5570. this.$message({
  5571. message: this.$t('meiYouGengDuoShuJuLe'),
  5572. type: "info"
  5573. });
  5574. }
  5575. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5576. if(document.querySelector("#day"+this.choseDay)){
  5577. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5578. }
  5579. } else {
  5580. this.$message({
  5581. message: res.msg,
  5582. type: "error"
  5583. });
  5584. }
  5585. },
  5586. error => {
  5587. this.listLoading = false;
  5588. this.$message({
  5589. message: error,
  5590. type: "error"
  5591. });
  5592. });
  5593. },
  5594. //获取日报列表
  5595. getReportList() {
  5596. //初始化,重置数据
  5597. this.pageIndex = 0;
  5598. this.hasMore = true;
  5599. this.reportList = [];
  5600. this.requestHttpReports();
  5601. },
  5602. //刷新日报状态,用于审核后更新
  5603. refreshReportData(reportId) {
  5604. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5605. res => {
  5606. if (res.code == "ok") {
  5607. for (var m=0;m<this.reportList.length; m++) {
  5608. var d = this.reportList[m].data;
  5609. var find = d.filter(r=>r.id == reportId);
  5610. if (find.length > 0) {
  5611. find[0].state = res.data.state;
  5612. if (find[0].state == 2) {//被驳回,要可以编辑
  5613. this.reportList[m].state = 2;
  5614. }
  5615. find[0].isDeptAudit = res.data.isDeptAudit;
  5616. find[0].departmentAuditState = res.data.departmentAuditState;
  5617. find[0].projectAuditorName = res.data.projectAuditorName;
  5618. find[0].projectAuditorId = res.data.projectAuditorId;
  5619. find[0].projectAuditState = res.data.projectAuditState;
  5620. find[0].rejectUserid = res.data.rejectUserid;
  5621. find[0].rejectUsername = res.data.rejectUsername;
  5622. find[0].rejectReason = res.data.rejectReason;
  5623. this.$forceUpdate();
  5624. break;
  5625. }
  5626. }
  5627. } else {
  5628. this.$message({
  5629. message: res.msg,
  5630. type: "error"
  5631. });
  5632. }
  5633. },
  5634. error => {
  5635. this.listLoading = false;
  5636. this.$message({
  5637. message: error,
  5638. type: "error"
  5639. });
  5640. });
  5641. },
  5642. //导出员工工时统计
  5643. exportUserTime() {
  5644. this.listLoading = true;
  5645. var param = {};
  5646. if (this.exportParam.dateRange != null) {
  5647. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5648. }
  5649. this.http.post('/department/exportDeptStatistic', param,
  5650. res => {
  5651. this.listLoading = false;
  5652. if (res.code == "ok") {
  5653. location.href = res.data;
  5654. this.exportTimeDialog = false;
  5655. } else {
  5656. this.$message({
  5657. message: res.msg,
  5658. type: "error"
  5659. });
  5660. }
  5661. },
  5662. error => {
  5663. this.listLoading = false;
  5664. this.$message({
  5665. message: error,
  5666. type: "error"
  5667. });
  5668. });
  5669. },
  5670. //导出日报
  5671. exportReport() {
  5672. this.exportingData = true;
  5673. var param = {};
  5674. if (this.exportParam.dateRange != null) {
  5675. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5676. }
  5677. if (this.exportParam.projectId != null) {
  5678. param.projectId = this.exportParam.projectId;
  5679. }
  5680. if (this.exportParam.departmentId != null) {
  5681. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5682. param.departmentIds = this.exportParam.departmentId.join(',')
  5683. }
  5684. param.stateKey = this.stateKey
  5685. // param.departmentId = this.user.departmentId
  5686. console.log(param, '《=== 导出传的参数');
  5687. console.log('开始调用exportReport接口');
  5688. this.http.post(this.port.report.export, param,
  5689. res => {
  5690. this.exportingData = false;
  5691. if (res.code == "ok") {
  5692. var filePath = res.data;
  5693. const a = document.createElement('a'); // 创建a标签
  5694. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5695. a.setAttribute('href', filePath);// href链接
  5696. a.click(); //自执行点击事件
  5697. a.remove();
  5698. this.exportDialog = false;
  5699. } else {
  5700. this.$message({
  5701. message: res.msg,
  5702. type: "error"
  5703. });
  5704. }
  5705. },
  5706. error => {
  5707. this.exportingData = false;
  5708. this.$message({
  5709. message: error,
  5710. type: "error"
  5711. });
  5712. });
  5713. },
  5714. //导出日报审核记录
  5715. exportReportLog() {
  5716. this.exportingData = true;
  5717. var param = {};
  5718. if (this.exportReportLogParam.dateRange != null) {
  5719. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5720. }
  5721. this.http.post('/report-log/exportReportLog', param,
  5722. res => {
  5723. this.exportingData = false;
  5724. if (res.code == "ok") {
  5725. var filePath = res.data;
  5726. const a = document.createElement('a'); // 创建a标签
  5727. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5728. a.setAttribute('href', filePath);// href链接
  5729. a.click(); //自执行点击事件
  5730. a.remove();
  5731. this.exportDialog = false;
  5732. } else {
  5733. this.$message({
  5734. message: res.msg,
  5735. type: "error"
  5736. });
  5737. }
  5738. },
  5739. error => {
  5740. this.exportingData = false;
  5741. this.$message({
  5742. message: error,
  5743. type: "error"
  5744. });
  5745. });
  5746. },
  5747. restUserCardTime(item){
  5748. let param={}
  5749. param.userId=item.userId
  5750. param.createDate=item.createDate
  5751. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5752. res => {
  5753. if (res.code == "ok") {
  5754. this.showMonthWorkTimeReminder()
  5755. } else {
  5756. this.$message({
  5757. message: res.msg,
  5758. type: "error"
  5759. });
  5760. }
  5761. },
  5762. error => {
  5763. this.$message({
  5764. message: error,
  5765. type: "error"
  5766. });
  5767. });
  5768. },
  5769. importReportLog(item){
  5770. //首先判断文件类型
  5771. let str = item.file.name.split(".");
  5772. let format = str[str.length - 1];
  5773. if (format != "xls" && format != "xlsx") {
  5774. this.$message({
  5775. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5776. type: "error"
  5777. });
  5778. } else {
  5779. const loading = this.$loading({
  5780. lock: true,
  5781. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5782. spinner: 'el-icon-loading',
  5783. background: 'rgba(0, 0, 0, 0.7)'
  5784. });
  5785. let formData = new FormData();
  5786. formData.append("multipartFile", item.file);
  5787. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5788. res => {
  5789. this.$refs.upload.clearFiles();
  5790. loading.close();
  5791. if (res.code == "ok") {
  5792. this.$message({
  5793. message: res.msg,
  5794. type: "success"
  5795. });
  5796. } else {
  5797. this.$message({
  5798. message: res.msg,
  5799. type: "error"
  5800. });
  5801. }
  5802. },
  5803. error => {
  5804. this.$refs.upload.clearFiles();
  5805. loading.close();
  5806. this.$message({
  5807. message: error,
  5808. type: "error"
  5809. });
  5810. });
  5811. }
  5812. },
  5813. //获取项目列表
  5814. getProjectList() {
  5815. this.listLoading = true;
  5816. this.http.post( this.port.project.list, {},
  5817. res => {
  5818. this.listLoading = false;
  5819. if (res.code == "ok") {
  5820. for(var i in res.data) {
  5821. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5822. res.data[i].projectCode = ''
  5823. }
  5824. }
  5825. this.projectList = res.data;
  5826. console.log("项目列表",this.projectList);
  5827. } else {
  5828. this.$message({
  5829. message: res.msg,
  5830. type: "error"
  5831. });
  5832. }
  5833. },
  5834. error => {
  5835. this.listLoading = false;
  5836. this.$message({
  5837. message: error,
  5838. type: "error"
  5839. });
  5840. });
  5841. },
  5842. // 获取填报日报的项目下拉列表
  5843. getFillProjectList() {
  5844. this.http.post( this.port.project.list, {
  5845. forReport: 1
  5846. },res => {
  5847. if (res.code == "ok") {
  5848. for(var i in res.data) {
  5849. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5850. res.data[i].projectCode = ''
  5851. }
  5852. }
  5853. this.fillProjectList = res.data;
  5854. this.getRecentlyProject()
  5855. } else {
  5856. this.$message({
  5857. message: res.msg,
  5858. type: "error"
  5859. });
  5860. }
  5861. },
  5862. error => {
  5863. this.$message({
  5864. message: error,
  5865. type: "error"
  5866. });
  5867. });
  5868. },
  5869. getBasecostItemList() {
  5870. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5871. companyId: this.user.companyId
  5872. },
  5873. res => {
  5874. if (res.code == "ok") {
  5875. this.timeBasecostList = res.data;
  5876. }
  5877. });
  5878. },
  5879. getAIReport(createDate) {
  5880. this.http.post('/report/getAIReport', {},
  5881. res => {
  5882. if (res.code == "ok") {
  5883. var quanbu = 0
  5884. this.jsDay = 1
  5885. var zhi = ''
  5886. var slp = res.data
  5887. for(var i in slp) {
  5888. var sp = +slp[i].workingTime + 0
  5889. zhi = this.jsDay * sp
  5890. quanbu = +quanbu + zhi
  5891. }
  5892. this.jsTime = quanbu
  5893. var aiReportData = res.data;
  5894. this.canCancelInDialog = false
  5895. if(aiReportData.length != 0) {
  5896. var arr = [];
  5897. for(var i in aiReportData) {
  5898. arr.push({
  5899. id: null,
  5900. projectId: aiReportData[i].projectId,
  5901. workingTime: aiReportData[i].workingTime,
  5902. content: '',
  5903. progress:100,
  5904. state: 2,
  5905. timeType: aiReportData[i].timeType,
  5906. subProjectList: aiReportData[i].subProjectList,
  5907. taskList: aiReportData[i].taskList,
  5908. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5909. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5910. taskId: aiReportData[i].taskId,
  5911. startTime: aiReportData[i].startTime,
  5912. endTime: aiReportData[i].endTime,
  5913. isOvertime: 0,
  5914. progress:aiReportData[i].progress,
  5915. professionProgress: aiReportData[i].professionProgressList,
  5916. stages:aiReportData[i].stages,
  5917. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5918. pics: null,
  5919. multiWorktime: aiReportData[i].multiWorktime || 0,
  5920. worktimeList: [{}],
  5921. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5922. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5923. wuduList: aiReportData[i].degreeList,
  5924. taskGroups:aiReportData[i].taskGroups,
  5925. customData: aiReportData[i].customData,//自定义的数值
  5926. auditUserList: aiReportData[i].auditUserList,
  5927. projectAuditorId: aiReportData[i].projectAuditorId,
  5928. projectAuditorName: aiReportData[i].projectAuditorName,
  5929. overtimeHours: aiReportData[i].overtimeHours,
  5930. customText: aiReportData[i].customText,
  5931. basecostId: aiReportData[i].basecostId,
  5932. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5933. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5934. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5935. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5936. canEdit: true
  5937. })
  5938. }
  5939. this.workForm.domains = arr;
  5940. } else {
  5941. }
  5942. this.canEdit = true;
  5943. this.originCanEdit = true;
  5944. this.seleChn()
  5945. } else {
  5946. this.$message({
  5947. message: res.msg,
  5948. type: "error"
  5949. });
  5950. }
  5951. },
  5952. error => {
  5953. this.$message({
  5954. message: error,
  5955. type: "error"
  5956. });
  5957. });
  5958. },
  5959. // 获取个人某天的日报 111111
  5960. getReport() {
  5961. this.http.post( this.port.report.getPort, {
  5962. date: this.workForm.createDate
  5963. },
  5964. res => {
  5965. if (res.code == "ok") {
  5966. var quanbu = 0
  5967. this.jsDay = 1
  5968. var zhi = ''
  5969. var slp = res.data.report
  5970. for(var i in slp) {
  5971. var sp = +slp[i].workingTime + 0
  5972. zhi = this.jsDay * sp
  5973. quanbu = +quanbu + zhi
  5974. }
  5975. this.jsTime = quanbu
  5976. var list = res.data;
  5977. this.report = list;
  5978. this.reportTimeType = this.report.timeType;
  5979. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5980. this.isWeekend = !this.report.isWorkDay;
  5981. this.canCancelInDialog = false;
  5982. this.hasWrittenReport = list.report.length != 0;
  5983. if(list.report.length != 0) {
  5984. var arr = [];
  5985. this.canEdit = false;
  5986. let candelete = true
  5987. for(var i in list.report) {
  5988. var flg = null
  5989. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5990. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5991. var filteredRespList = null
  5992. if (targetP.length > 0) {
  5993. var isPublic = targetP[0].isPublic;
  5994. 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);
  5995. }
  5996. let copyData = {
  5997. id: list.report[i].id,
  5998. projectId: list.report[i].projectId,
  5999. workingTime: list.report[i].workingTime,
  6000. content: list.report[i].content,
  6001. state: list.report[i].state,
  6002. timeType: list.report[i].timeType,
  6003. subProjectList: list.report[i].subProjectList,
  6004. taskList: list.report[i].taskList,
  6005. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6006. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6007. taskId: list.report[i].taskId,
  6008. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6009. startTime: list.report[i].startTime,
  6010. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6011. endTime: list.report[i].endTime,
  6012. isOvertime: flg,
  6013. progress:list.report[i].progress,
  6014. professionProgress: list.report[i].professionProgressList,
  6015. stages:list.report[i].stages,
  6016. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6017. pics: list.report[i].pics,
  6018. multiWorktime: list.report[i].multiWorktime,
  6019. worktimeList: list.report[i].worktimeList,
  6020. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6021. multiDegrIdArray: list.report[i].multiDegrIdList,
  6022. wuduList: list.report[i].degreeList,
  6023. taskGroups:list.report[i].taskGroups,
  6024. customData: list.report[i].customData,//自定义的数值
  6025. auditUserList: list.report[i].auditUserList,
  6026. overtimeHours: list.report[i].overtimeHours,
  6027. customText: list.report[i].customText,
  6028. basecostId: list.report[i].basecostId,
  6029. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6030. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6031. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6032. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6033. canEdit: list.report[i].state >= 2 ? true : false,
  6034. extraField1: list.report[i].extraField1,
  6035. extraField2: list.report[i].extraField2,
  6036. extraField3: list.report[i].extraField3,
  6037. workContentList: list.report[i].workContentList,
  6038. filteredRespList: filteredRespList,
  6039. serviceList: list.report[i].serviceList,
  6040. sapServiceId: list.report[i].sapServiceId,
  6041. reportTargetDeptId: list.report[i].deptId
  6042. }
  6043. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6044. //分组负责人审核的情况下,前端不需要显示,无需设置
  6045. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6046. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6047. }
  6048. arr.push(copyData);
  6049. if (list.report[i].state >= 2) {
  6050. this.canEdit = true;
  6051. }
  6052. if(list.report[i].state < 2){
  6053. candelete = false
  6054. }
  6055. if (list.report[i].state == 0){
  6056. this.canCancelInDialog = true
  6057. }
  6058. // 加判断
  6059. if(this.user.timeType.choseFromAlbum == 1) {
  6060. let arrList = []
  6061. for(var k in list.report[i].pics) {
  6062. let obj = {
  6063. name: k,
  6064. url: list.report[i].pics[k]
  6065. }
  6066. arrList.push(obj)
  6067. }
  6068. arr[i].imgListUrl = arrList
  6069. arr[i].imgList = list.report[i].pics
  6070. }
  6071. }
  6072. this.reportCanDelete = candelete
  6073. this.workForm = {
  6074. createDate: this.workForm.createDate,
  6075. domains: arr,
  6076. userNames:null,
  6077. userId:null,
  6078. time: list.time,
  6079. showRefresh: list.showRefresh
  6080. }
  6081. console.log('workForm', this.workForm)
  6082. } else {
  6083. this.workForm = {
  6084. createDate: this.workForm.createDate,
  6085. domains: [{
  6086. id: null,
  6087. projectId: "",
  6088. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6089. content: "",
  6090. progress:100,
  6091. state: 2,
  6092. timeType:0,
  6093. multiWorktime: this.reportTimeType.multiWorktime,
  6094. worktimeList:[{}],
  6095. canEdit: true,
  6096. auditorFirst: '',
  6097. auditorSec: '',
  6098. auditorThird: '',
  6099. ccUserid: ''
  6100. }],
  6101. userId:null,
  6102. userNames:null,
  6103. time: this.report.time,
  6104. showRefresh: list.showRefresh
  6105. }
  6106. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6107. this.$set(this.workForm.domains[0],'isOvertime',true)
  6108. if(this.reportTimeType.type != 2){
  6109. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6110. }
  6111. }
  6112. if(this.user.timeType.type == 1) {
  6113. var shuzhi = this.user.timeType.allday + ''
  6114. // console.log('执行一次', shuzhi.indexOf('.'))
  6115. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6116. }
  6117. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6118. //默认给第一个,必填字段
  6119. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6120. }
  6121. this.canEdit = true;
  6122. }
  6123. this.originCanEdit = this.canEdit;
  6124. this.seleChn()
  6125. } else {
  6126. this.$message({
  6127. message: res.msg,
  6128. type: "error"
  6129. });
  6130. }
  6131. },
  6132. error => {
  6133. this.$message({
  6134. message: error,
  6135. type: "error"
  6136. });
  6137. });
  6138. },
  6139. guanbi() {
  6140. this.falsss = false,
  6141. this.workTimeForMinYi=0
  6142. },
  6143. // 打开日报填写
  6144. fillInReport(i, isBatch) {
  6145. this.isWeekend = false
  6146. this.reportCanDelete = false
  6147. // console.log(this.user.timeType.type, '选择时长')
  6148. if(i != 1) {
  6149. this.falsss = false
  6150. } else {
  6151. this.falsss = true
  6152. }
  6153. if (this.isSubstitude) {
  6154. this.getSubstitudeUserDeptList();
  6155. }
  6156. if(i == -1 || this.isSubstitude) {
  6157. this.isDisable = false;
  6158. } else {
  6159. this.isDisable = true;
  6160. }
  6161. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6162. this.isBatch = isBatch;
  6163. if (this.isBatch == 0 && !this.isSubstitude) {
  6164. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6165. let weekday = new Date(this.workForm.createDate).getDay()
  6166. if(this.user.companyId == 817){
  6167. if(weekday == 0){
  6168. this.isWeekend = true
  6169. }
  6170. }else{
  6171. if(weekday == 0 || weekday == 6){
  6172. this.isWeekend = true
  6173. }
  6174. }
  6175. this.getReport(i);
  6176. } else {
  6177. // console.log('执行到了这里')
  6178. this.jsTime = 0
  6179. this.jsDay = 0
  6180. this.workForm = {
  6181. createDate: null,//批量填报没有日期
  6182. domains: [{
  6183. id: null,
  6184. projectId: "",
  6185. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6186. content: "",
  6187. progress:100,
  6188. state: 2,
  6189. timeType:0,
  6190. multiWorktime: this.reportTimeType.multiWorktime,
  6191. worktimeList:[{}],
  6192. canEdit: true,
  6193. }],
  6194. }
  6195. if(this.user.timeType.type == 1) {
  6196. var shuzhi = this.user.timeType.allday + ''
  6197. // console.log('执行二次')
  6198. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6199. }
  6200. // console.log(this.workForm)
  6201. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6202. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6203. }
  6204. this.canEdit = true;
  6205. }
  6206. this.dialogVisible = true;
  6207. },
  6208. //按周填报的弹窗口中编辑单项目相关数据
  6209. setWeekFormReportItem(reportId, i, names, row,sss) {
  6210. console.log(sss)
  6211. this.http.post('/report/getReportById', {
  6212. reportId: reportId
  6213. },
  6214. res => {
  6215. if (res.code == "ok") {
  6216. var data = res.data.report;
  6217. sss.subProjectId = data.subProjectId
  6218. sss.subProjectList = data.subProjectList;
  6219. sss.stage = data.stage
  6220. sss.subProjectList = data.subProjectList
  6221. sss.stages = data.stages
  6222. sss.taskGroups = data.taskGroups;
  6223. sss.auditUserList = data.auditUserList;
  6224. sss.degreeId = data.degreeId;
  6225. sss.customData = data.customData;
  6226. sss.wuduList = data.degreeList;
  6227. this.zhoBaoIdx = i
  6228. this.zhoBaoName = names
  6229. this.zhoBao = sss
  6230. this.zhis = row
  6231. if (sss.groupId) {
  6232. //最后一个参数表示是否保留stage的值,不要重置为空
  6233. this.getGroupStages(this.zhoBao, 0, true)
  6234. }
  6235. this.$forceUpdate();
  6236. }
  6237. });
  6238. },
  6239. // 按周填报里内容的填写
  6240. showWeekItemEdit(item, i, projectId,names, row) {
  6241. if (item.state == 0) {
  6242. this.$message({
  6243. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6244. type: "error"
  6245. });
  6246. return;
  6247. }
  6248. if (item.state == 1) {
  6249. this.$message({
  6250. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6251. type: "error"
  6252. });
  6253. return;
  6254. }
  6255. if(this.user.timeType.notAllowedNoAttendance == 1){
  6256. if(this.zhoData[i].corpTime){
  6257. if(this.zhoData[i].corpTime.workHours == 0){
  6258. this.$message({
  6259. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6260. type: 'error'
  6261. })
  6262. return
  6263. }
  6264. }else{
  6265. this.$message({
  6266. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6267. type: 'error'
  6268. })
  6269. return
  6270. }
  6271. }
  6272. var obj = {}
  6273. obj.projectId = projectId
  6274. this.tianxieDialogVisible = true
  6275. this.scopess = item
  6276. var sss = {}
  6277. if (item.id != null) {
  6278. sss.id = item.id;
  6279. sss.state = item.state;
  6280. } else {
  6281. sss.id = -1;
  6282. sss.state = 3;
  6283. }
  6284. sss.projectId = projectId;
  6285. sss.progress = item.progress
  6286. sss.time = item.time
  6287. sss.content = item.content;
  6288. console.log('333', sss.content)
  6289. if (sss.time == '' && this.reportTimeType.type == 2) {
  6290. //取已填时间范围中最大的一个作为开始时间
  6291. var startTime = '09:00';
  6292. var fillStartTime = '00:00';
  6293. for (var t in this.selProjectList) {
  6294. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6295. if (fillItem.time) {
  6296. if (fillItem.time[1] > fillStartTime) {
  6297. fillStartTime = fillItem.time[1];
  6298. }
  6299. }
  6300. }
  6301. if (fillStartTime == '00:00') {
  6302. fillStartTime = '09:00';
  6303. }
  6304. var fillEndMax = '18:00';
  6305. if (fillStartTime >= '18:00') {
  6306. fillEndMax = '23:59';
  6307. }
  6308. sss.time = [fillStartTime, fillEndMax];
  6309. }
  6310. sss.groupId = item.groupId
  6311. sss.stage = item.stage;
  6312. sss.workingTime = item.workingTime
  6313. sss.projectAuditorId = item.projectAuditorId;
  6314. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6315. //默认选中第一个
  6316. sss.basecostId = this.timeBasecostList[0].id;
  6317. }
  6318. var hasEdited = this.zhoData[i][names].hasEdited;
  6319. if (hasEdited) {
  6320. sss = { ...item }
  6321. //编辑过了
  6322. sss.subProjectId = item.subProjectId
  6323. sss.stage = item.stage
  6324. sss.subProjectList = item.subProjectList
  6325. sss.stages = item.stages
  6326. sss.taskGroups = item.taskGroups;
  6327. console.log(sss.taskGroups, '33333');
  6328. sss.auditUserList = obj.auditUserList;
  6329. sss.degreeId = item.degreeId;
  6330. sss.customData = item.customData;
  6331. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6332. //只有一个审核人,自动设置上去
  6333. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6334. }
  6335. sss.wuduList = item.wuduList;
  6336. this.zhoBaoIdx = i
  6337. this.zhoBaoName = names
  6338. this.zhoBao = sss
  6339. this.zhis = row
  6340. if (sss.groupId) {
  6341. //最后一个参数表示是否保留stage的值,不要重置为空
  6342. this.getGroupStages(this.zhoBao, 0, true)
  6343. }
  6344. this.$forceUpdate();
  6345. this.getWeeklyTaskList(sss)
  6346. console.log('最后的周报 ===>', this.zhoBao)
  6347. } else {
  6348. //第一次打开,获取数据
  6349. if (sss.id == -1) {
  6350. //新填报的
  6351. this.selectProject(obj, 0);
  6352. var that = this
  6353. setTimeout(() =>{
  6354. sss.subProjectId = that.workForm.domains[0].subProjectId
  6355. sss.subProjectList = item.subProjectList;
  6356. sss.stage = that.workForm.domains[0].stage
  6357. sss.subProjectList = that.workForm.domains[0].subProjectList
  6358. sss.stages = that.workForm.domains[0].stages
  6359. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6360. sss.auditUserList = obj.auditUserList;
  6361. sss.degreeId = item.degreeId;
  6362. sss.customData = item.customData;
  6363. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6364. //只有一个审核人,自动设置上去
  6365. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6366. }
  6367. sss.wuduList = row[0].wuduList
  6368. that.zhoBaoIdx = i
  6369. that.zhoBaoName = names
  6370. that.zhoBao = sss
  6371. that.zhis = row
  6372. if (sss.groupId) {
  6373. //最后一个参数表示是否保留stage的值,不要重置为空
  6374. this.getGroupStages(that.zhoBao, 0, false)
  6375. }
  6376. that.$forceUpdate();
  6377. this.getWeeklyTaskList(sss)
  6378. },600);
  6379. } else {
  6380. //编辑填报过的;数据库已经存在的
  6381. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6382. }
  6383. }
  6384. },
  6385. // 按周填报里内容的填写点击确定
  6386. setWeekProItemData() {
  6387. //专业版模式下,任务分组和阶段必填
  6388. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6389. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6390. this.$message({
  6391. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6392. type: "error"
  6393. });
  6394. return;
  6395. }
  6396. }
  6397. // 检查任务分组
  6398. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6399. this.$message({
  6400. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6401. type: "error"
  6402. });
  6403. return
  6404. }
  6405. //检查子项目是否必填
  6406. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6407. this.$message({
  6408. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6409. type: "error"
  6410. });
  6411. return;
  6412. }
  6413. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6414. this.$message({
  6415. message: this.$t('message.Pleaseselectareviewer'),
  6416. type: "error"
  6417. });
  6418. return
  6419. }
  6420. if(this.user.timeType.reportAuditType == 3){
  6421. let auditTips = ''
  6422. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6423. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6424. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6425. if(auditTips){
  6426. auditTips = auditTips.substring(0,auditTips.length - 1)
  6427. this.$message({
  6428. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6429. type: 'error'
  6430. })
  6431. return
  6432. }
  6433. }
  6434. let errtips = ''
  6435. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6436. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6437. errtips += this.user.timeType.customDegreeName + '、'
  6438. }
  6439. }
  6440. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6441. errtips += this.user.timeType.customDataName + '、'
  6442. }
  6443. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6444. errtips += this.user.timeType.customTextName + '、'
  6445. }
  6446. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6447. errtips += this.$t('other.workMatters') +'、'
  6448. }
  6449. if(errtips){
  6450. errtips = errtips.substring(0,errtips.length - 1)
  6451. this.$message({
  6452. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6453. type: 'error'
  6454. })
  6455. return
  6456. }
  6457. this.tianxieDialogVisible = false
  6458. var zhong = this.zhoData
  6459. this.zhoBao.hasEdited = true;
  6460. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6461. this.zhoData = zhong
  6462. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6463. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6464. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6465. },
  6466. // 获取本周
  6467. getCurrentWeek() {
  6468. //今天
  6469. this.targetWeekDate = new Date();
  6470. this.initWeekFormData();
  6471. // this.jiazai()
  6472. },
  6473. // 获取上周
  6474. handleGetPrevWeek() {
  6475. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6476. this.initWeekFormData();
  6477. // this.jiazai()
  6478. },
  6479. // 获取下周
  6480. handleGetNextvWeek() {
  6481. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6482. this.initWeekFormData()
  6483. },
  6484. // 加载动画
  6485. jiazai() {
  6486. this.weekDataLoading = true
  6487. var that = this
  6488. setTimeout(() =>{
  6489. that.weekDataLoading = false
  6490. },1000);
  6491. },
  6492. // 转时间格式
  6493. dealdate(date) {
  6494. const dt = new Date(date)
  6495. const y = dt.getFullYear()
  6496. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6497. const d = (dt.getDate() + '').padStart(2, '0')
  6498. return `${y}-${m}-${d}`
  6499. },
  6500. // 按周填报
  6501. fillInReportss() {
  6502. window.addEventListener('scroll', this.handleScroll, true)
  6503. // this.jiazai()
  6504. this.fillWeekDialogVisi = true;
  6505. if (this.isSubstitude) {
  6506. this.substitudeStep = 1;
  6507. this.getSubstitudeUserDeptList();
  6508. } else {
  6509. this.getCurrentWeek();
  6510. }
  6511. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6512. //重新获取工时预警类型的预算项
  6513. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6514. companyId: this.user.companyId
  6515. },
  6516. res => {
  6517. if (res.code == "ok") {
  6518. this.timeBasecostList = res.data;
  6519. }
  6520. });
  6521. }
  6522. },
  6523. fillInReportCustom() {
  6524. this.weekIndex++
  6525. this.weekParentData = {
  6526. isSubstitude: this.isSubstitude
  6527. }
  6528. this.fillWeekDialogVisiCustom = true
  6529. },
  6530. // 按周填报的项目筛选
  6531. selListFun(){
  6532. this.selProjectList = []
  6533. if(this.selCon.length){
  6534. for (let i = 0; i < this.selCon.length; i++) {
  6535. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6536. }
  6537. this.selConShow = false ;
  6538. for (let i in this.zhoData) {
  6539. var obj = this.zhoData[i];
  6540. for(var j in this.selProjectList) {
  6541. var xinzhi = this.selProjectList[j].projectName
  6542. obj[xinzhi] = {}
  6543. obj[xinzhi].time = ''
  6544. obj[xinzhi].content = ''
  6545. obj[xinzhi].progress = 0
  6546. obj[xinzhi].workingTime = 0
  6547. }
  6548. }
  6549. this.initWeekFormData();
  6550. }else{
  6551. this.$message({
  6552. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6553. type:'error'
  6554. })
  6555. }
  6556. },
  6557. setWeekCardTimeData(list) {
  6558. for(let i in list){
  6559. let datei = '';
  6560. if (this.user.timeType.showDdCardtime == 1) {
  6561. datei = list[i].workDate;
  6562. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6563. datei = list[i].createDate;
  6564. } else if (this.user.timeType.syncFanwei == 1) {
  6565. datei = list[i].workDate;
  6566. }
  6567. for(let m in this.zhoData) {
  6568. if(datei == this.zhoData[m].zhoDataTime){
  6569. let item = {
  6570. startTime: list[i].startTime,
  6571. endTime: list[i].endTime,
  6572. workHours: list[i].workHours,
  6573. otTime: list[i].otTime
  6574. }
  6575. this.$set(this.zhoData[m],'corpTime',item)
  6576. }
  6577. }
  6578. }
  6579. },
  6580. getWeeklyCardTime(){ //按周填报获取考勤信息
  6581. let dateStr = []
  6582. for(let i in this.zhoData){
  6583. dateStr.push(this.zhoData[i].zhoDataTime)
  6584. }
  6585. this.http.post('/report/getWeeklyCardTime',{
  6586. dateStr: JSON.stringify(dateStr)
  6587. },res => {
  6588. if(res.code == 'ok'){
  6589. for(let i in res.data){
  6590. let datei = '';
  6591. if (this.user.timeType.showDdCardtime == 1) {
  6592. datei = res.data[i].workDate.split('-');
  6593. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6594. datei = res.data[i].createDate.split('-');
  6595. }
  6596. for(let m in this.zhoData){
  6597. let datem = new Date(this.zhoData[m].zhoDataTime)
  6598. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6599. let item = {
  6600. startTime: res.data[i].startTime,
  6601. endTime: res.data[i].endTime,
  6602. workHours: res.data[i].workHours
  6603. }
  6604. this.$set(this.zhoData[m],'corpTime',item)
  6605. }
  6606. }
  6607. }
  6608. }else{
  6609. this.$message({
  6610. message: res.msg,
  6611. type: 'error'
  6612. })
  6613. }
  6614. },err => {
  6615. this.$message({
  6616. message: err,
  6617. type: 'error'
  6618. })
  6619. })
  6620. },
  6621. selListqx(){
  6622. this.fillWeekDialogVisi = false
  6623. this.selProjectList = []
  6624. this.selCon = []
  6625. },
  6626. handleScroll() {
  6627. this.changdu = this.projectList.length + 1
  6628. },
  6629. // 自动选择时间点的事件
  6630. // async zhoTimes(item, i) {
  6631. // var iss = i
  6632. // if(item.time == null) {
  6633. // return
  6634. // } else {
  6635. // const zhi = this.zhoData[iss];
  6636. // let he = 0;
  6637. // const timeArr = Object.values(zhi)
  6638. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6639. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6640. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6641. // console.log(data, 'data');
  6642. // zhi.he = `${he}h`;
  6643. // }
  6644. // },
  6645. async zhoTimes(item, index) {
  6646. const zho = this.zhoData[index];
  6647. if (!item.time) {
  6648. return;
  6649. }
  6650. const timeArr = Object.values(zho)
  6651. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6652. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6653. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6654. zho.he = `${totalHours[0]}h`;
  6655. },
  6656. // 判断两个时间段是否重叠
  6657. timeOverlap(idx, dateAr) {
  6658. let zhi = 0
  6659. for (let k in dateAr) {
  6660. if (idx !== k) {
  6661. 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))) {
  6662. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6663. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6664. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6665. }
  6666. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6667. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6668. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6669. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6670. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6671. } else {
  6672. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6673. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6674. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6675. }
  6676. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6677. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6678. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6679. }
  6680. }
  6681. }
  6682. }
  6683. }
  6684. return zhi
  6685. },
  6686. // 计算时间
  6687. getHourMinutes(str, end) {
  6688. var he = 0
  6689. var date2 = '2021/12/12 ' + end +':00'
  6690. var date1 = '2021/12/12 ' + str +':00'
  6691. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6692. var leave1=date3%(24*3600*1000)
  6693. var hours=Math.floor(leave1/(3600*1000))
  6694. var leave2=leave1%(3600*1000)
  6695. var minutes=Math.floor(leave2/(60*1000))
  6696. var shi = hours+'.'+ minutes
  6697. return he += +shi
  6698. },
  6699. // 自动选择事件长度的事件
  6700. zhoXuan(item, i) {
  6701. var iss = i
  6702. if(item.time == null) {
  6703. return
  6704. } else {
  6705. var zhi = this.zhoData[iss]
  6706. var he = 0
  6707. for(var i in zhi) {
  6708. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6709. he += +zhi[i].workingTime
  6710. }
  6711. }
  6712. zhi.he = he + 'h'
  6713. }
  6714. },
  6715. getPushWorkLogData(){
  6716. this.http.post('/sap-sync-log/list', {},
  6717. res => {
  6718. if (res.code == "ok") {
  6719. this.pushWorkTimeLogData = res.data;
  6720. } else {
  6721. this.$message({
  6722. message: res.msg,
  6723. type: "error"
  6724. });
  6725. }
  6726. },
  6727. error => {
  6728. this.$message({
  6729. message: error,
  6730. type: "error"
  6731. });
  6732. });
  6733. },
  6734. // 获取全部人员
  6735. getUsers() {
  6736. this.http.post('/user/getSimpleActiveUserList', {},
  6737. res => {
  6738. if (res.code == "ok") {
  6739. this.usersList = res.data;
  6740. } else {
  6741. this.$message({
  6742. message: res.msg,
  6743. type: "error"
  6744. });
  6745. }
  6746. },
  6747. error => {
  6748. this.$message({
  6749. message: error,
  6750. type: "error"
  6751. });
  6752. });
  6753. },
  6754. // 按时间比例
  6755. addBli(item, i) {
  6756. var iss = i
  6757. if(item.time == null) {
  6758. return
  6759. } else {
  6760. var zhi = this.zhoData[iss]
  6761. var he = 0
  6762. for(var i in zhi) {
  6763. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6764. he += +zhi[i].workingTime
  6765. }
  6766. }
  6767. zhi.he = he.toFixed(1) + 'h'
  6768. }
  6769. },
  6770. //按周填报选择的项目发生变化,需要设置列
  6771. onSelProjectChange() {
  6772. for (let i = 0; i < this.selCon.length; i++) {
  6773. var exists = false;
  6774. for (let j = 0; j < this.selProjectList.length; j++) {
  6775. if (this.selProjectList[j].id == this.selCon[i]) {
  6776. exists = true;
  6777. break;
  6778. }
  6779. }
  6780. if (!exists) {
  6781. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6782. this.selProjectList.push(newProject);
  6783. //添加新项目
  6784. for (var w in this.zhoData) {
  6785. var dayItem = this.zhoData[w];
  6786. var pName = newProject.projectName;
  6787. dayItem[pName] = {};
  6788. dayItem[pName].time = ''
  6789. dayItem[pName].content = ''
  6790. dayItem[pName].progress = 0
  6791. dayItem[pName].workingTime = 0
  6792. }
  6793. }
  6794. }
  6795. //去掉
  6796. for (let j = 0; j < this.selProjectList.length; j++) {
  6797. var exists = false;
  6798. for (let i = 0; i < this.selCon.length; i++) {
  6799. if (this.selProjectList[j].id == this.selCon[i]) {
  6800. exists = true;
  6801. break;
  6802. }
  6803. }
  6804. if (!exists) {
  6805. this.selProjectList.splice(j, 1);
  6806. j--;
  6807. }
  6808. }
  6809. this.loadFilledWeekReportItem();
  6810. //刷新表格
  6811. // this.$refs.weekTable.doLayout();
  6812. },
  6813. //根据选中的项目来刷新填写表格
  6814. loadFilledWeekReportItem() {
  6815. for (var w in this.zhoData) {
  6816. var dayItem = this.zhoData[w];
  6817. for (var i = 0; i < this.selProjectList.length; i++) {
  6818. var curColumnProject = this.selProjectList[i];
  6819. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6820. for (var t in dayItem.reportList) {
  6821. //有日报的项目,不能取消选择
  6822. for (var p in this.fillProjectList) {
  6823. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6824. }
  6825. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6826. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6827. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6828. if (this.reportTimeType.type == 2) {
  6829. //时间段模式
  6830. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6831. }
  6832. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6833. break;
  6834. }
  6835. }
  6836. // dayItem[curColumnProject.projectName] = matchReportItem;
  6837. }
  6838. }
  6839. this.$nextTick(()=>{
  6840. this.$refs.weekTable.doLayout();
  6841. });
  6842. },
  6843. initWeekFormData() {
  6844. this.weekDataLoading = true;
  6845. for (var p in this.fillProjectList) {
  6846. this.fillProjectList[p].canCancel = 1;
  6847. }
  6848. var param = {
  6849. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6850. };
  6851. if (this.isSubstitude) {
  6852. //传代填人的userId
  6853. param.targetUserId = this.workForm.userId[0];
  6854. }
  6855. this.http.post('/report/getWeeklyReportData',param,res => {
  6856. this.weekDataLoading = false;
  6857. if(res.code == 'ok'){
  6858. let projectList = res.data.projectList;
  6859. if (projectList.length > 0) {
  6860. //有选择过项目进行填报,直接选中
  6861. this.selProjectList = projectList;
  6862. this.selCon = [];
  6863. for (let i = 0; i < projectList.length; i++) {
  6864. this.selCon.push(projectList[i].id);
  6865. }
  6866. }
  6867. //设置日期
  6868. this.weekDateRange = res.data.dateList;
  6869. this.zhoData = [];
  6870. var arrst = []
  6871. for(var i in this.weekDateRange) {
  6872. var obj = {}
  6873. obj.zhoDataTime = this.weekDateRange[i].date
  6874. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6875. obj.he = this.weekDateRange[i].filledTime;
  6876. obj.canFill = this.weekDateRange[i].canFill;
  6877. // obj.filledTime = this.weekDateRange[i].filledTime;
  6878. obj.reportList = this.weekDateRange[i].reportList;
  6879. //初始化,防止渲染报错
  6880. for (var j = 0; j < this.selProjectList.length; j++) {
  6881. var pName = this.selProjectList[j].projectName
  6882. obj[pName] = {}
  6883. obj[pName].time = ''
  6884. obj[pName].content = ''
  6885. obj[pName].progress = 0
  6886. obj[pName].workingTime = 0
  6887. }
  6888. arrst.push(obj)
  6889. }
  6890. this.zhoData = arrst
  6891. this.setWeekCardTimeData(res.data.cardTimeList);
  6892. this.loadFilledWeekReportItem();
  6893. }else{
  6894. this.$message({
  6895. message: res.msg,
  6896. type: 'error'
  6897. })
  6898. }
  6899. },err => {
  6900. this.$message({
  6901. message: err,
  6902. type: 'error'
  6903. })
  6904. })
  6905. },
  6906. zhoZhi(res, i) {
  6907. var zhi = 0
  6908. for(var i in res) {
  6909. if(i != 'zhoDataTime' && i != 'he') {
  6910. zhi += +res[i]
  6911. }
  6912. }
  6913. res.he = zhi
  6914. },
  6915. zhoBtn(i) {
  6916. // this.zhoData.split(i, 1)
  6917. var arr = this.zhoData
  6918. arr.splice(i, 1)
  6919. },
  6920. zhoAddlast(){
  6921. this.selConShow = true
  6922. },
  6923. closeAddWeeklyReport(){
  6924. this.fillWeekDialogVisi = false
  6925. this.selConShow = true
  6926. this.selProjectList = []
  6927. this.selCon = []
  6928. },
  6929. checkDateWorkTime() {
  6930. //针对苏州景昱,单独的检查逻辑
  6931. if (this.user.companyId == 5978) {
  6932. //调接口,先检查工时是否存在异常
  6933. var zhi = this.zhoData;
  6934. var array = [];
  6935. for(let n in zhi){
  6936. if(zhi[n].he){
  6937. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6938. array.push(workData)
  6939. }
  6940. }
  6941. this.submitingReport = true;
  6942. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6943. res => {
  6944. this.submitingReport = false;
  6945. if (res.code == "ok") {
  6946. this.submitWeekReport(0)
  6947. } else {
  6948. this.$confirm(res.msg, this.$t('other.prompts'), {
  6949. confirmButtonText: this.$t('huLveBingTiJiao'),
  6950. cancelButtonText: this.$t('btn.cancel'),
  6951. type: 'error'
  6952. }).then(() => {
  6953. this.submitWeekReport(0)
  6954. }).catch(() => {
  6955. });
  6956. }
  6957. },
  6958. error => {
  6959. this.$message({
  6960. message: error,
  6961. type: "error"
  6962. });
  6963. });
  6964. }
  6965. },
  6966. // 提交按周填报
  6967. submitWeekReport(isDraft) {
  6968. var zhi = this.zhoData
  6969. var ll = 0
  6970. if(this.reportTimeType.type == 2) {
  6971. for(var i in zhi) {
  6972. this.dateAr = []
  6973. var alp = []
  6974. var zhis = zhi[i]
  6975. console.log(zhis)
  6976. for(var j in zhis) {
  6977. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6978. let objs = {}
  6979. objs.s = zhis[j].time[0]
  6980. objs.e = zhis[j].time[1]
  6981. objs.p = j
  6982. alp.push(objs)
  6983. }
  6984. }
  6985. console.log(alp)
  6986. this.dateAr = alp
  6987. if (this.reportTimeType.timeCanOverlap == 0) {
  6988. let str = this.$t('message.Filledtimeperiodsoverlap')
  6989. if(this.dateAr.length > 0) {
  6990. const trus = this.fns();
  6991. const overlapDataTime = this.getOverlapData(alp);
  6992. if (overlapDataTime.length > 0) {
  6993. const arrList = overlapDataTime.map((item) => item.p);
  6994. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6995. }
  6996. ll += 1
  6997. if(!trus) {
  6998. this.$message({
  6999. message: str,
  7000. type: 'error'
  7001. })
  7002. return false
  7003. }
  7004. }
  7005. } else {
  7006. if(this.dateAr.length > 0) {
  7007. ll +=1 ;
  7008. }
  7009. }
  7010. }
  7011. if(ll == 0) {
  7012. this.$message({
  7013. message: this.$t('message.Pleasefillinthetime'),
  7014. type: 'error'
  7015. })
  7016. return false
  7017. }
  7018. } else if(this.reportTimeType.type == 1){
  7019. for(var i in zhi) {
  7020. var zhis = zhi[i]
  7021. for(var j in zhis) {
  7022. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7023. ll += 1
  7024. }
  7025. }
  7026. }
  7027. if(ll == 0) {
  7028. this.$message({
  7029. message: this.$t('message.Pleaseselectatime'),
  7030. type: 'error'
  7031. })
  7032. return false
  7033. }
  7034. let overcorp = ''
  7035. for(let n in zhi){
  7036. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7037. overcorp += zhi[n].zhoDataTime + ','
  7038. }
  7039. }
  7040. if(this.user.companyId != 5978 && overcorp != ''){
  7041. overcorp = overcorp.substring(0,overcorp.length - 1)
  7042. this.$message({
  7043. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7044. type: 'error'
  7045. })
  7046. return
  7047. }
  7048. }
  7049. var submits = []
  7050. let formData = new FormData();
  7051. formData.append("draft", isDraft);
  7052. if(this.reportTimeType.multiWorktime == 1){
  7053. for (var i in this.zhoData) {
  7054. var zhoD = this.zhoData[i]
  7055. var flgs = false
  7056. for(var j in zhoD) {
  7057. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7058. flgs = true
  7059. // formData.append("degreeId", "-1");
  7060. formData.append("id", '-1');
  7061. if (this.isSubstitude) {
  7062. formData.append('targetUids',this.workForm.userId[0]);
  7063. }
  7064. for(var s in this.projectList) {
  7065. if(j == this.projectList[s].projectName) {
  7066. formData.append("projectId", this.projectList[s].id);
  7067. }
  7068. }
  7069. if(this.user.timeType.reportAuditType == 3){
  7070. let audItem = {}
  7071. if(this.user.timeType.auditLevel > 0){
  7072. audItem.auditorFirst = zhoD[j].auditorFirst
  7073. }
  7074. if(this.user.timeType.auditLevel > 1){
  7075. audItem.auditorSec = zhoD[j].auditorSec
  7076. }
  7077. if(this.user.timeType.auditLevel > 2){
  7078. audItem.auditorThird = zhoD[j].auditorThird
  7079. }
  7080. if(zhoD[j].ccUserid){
  7081. audItem.ccUserid = zhoD[j].ccUserid
  7082. }
  7083. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7084. }
  7085. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7086. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7087. formData.append("reportTimeType", this.reportTimeType.type);
  7088. formData.append("endTime", '');
  7089. formData.append("startTime", '');
  7090. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7091. var lix = []
  7092. var objjs = {}
  7093. objjs.startTime = zhoD[j].time[0]
  7094. objjs.endTime = zhoD[j].time[1]
  7095. if (zhoD[j].content == null || zhoD[j].content == '') {
  7096. zhoD[j].content == '-'
  7097. }
  7098. objjs.content = zhoD[j].content
  7099. lix.push(objjs)
  7100. var zhiZhi = JSON.stringify(lix)
  7101. zhiZhi = zhiZhi.replace(/,/g,"@");
  7102. formData.append("content", zhiZhi)
  7103. formData.append("isOvertime", 0)
  7104. formData.append("professionProgress", "[]")
  7105. if (zhoD[j].groupId) {
  7106. formData.append("groupId",zhoD[j].groupId)
  7107. } else {
  7108. //解决后台groupId数组越界的问题
  7109. formData.append("groupId",0)
  7110. }
  7111. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7112. formData.append("createDate",zhoD.zhoDataTime)
  7113. if (zhoD[j].projectAuditorId) {
  7114. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7115. }
  7116. if(zhoD[j].basecostId) {
  7117. formData.append("basecostId", zhoD[j].basecostId);
  7118. } else {
  7119. formData.append("basecostId", 0);
  7120. }
  7121. if(this.user.timeType.customDegreeActive){
  7122. if (this.user.timeType.customDegreeMultiple) {
  7123. if (zhoD[j].multiDegrIdArray) {
  7124. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7125. } else {
  7126. formData.append('multiDegrId','[]')
  7127. }
  7128. } else {
  7129. if (zhoD[j].degreeId) {
  7130. formData.append('degreeId',zhoD[j].degreeId)
  7131. } else {
  7132. formData.append('degreeId','-1')
  7133. }
  7134. }
  7135. }else{
  7136. formData.append("degreeId", "-1");
  7137. }
  7138. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7139. formData.append('customData',zhoD[j].customData)
  7140. }else if(this.user.timeType.customDataActive){
  7141. formData.append('customData',0)
  7142. }
  7143. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7144. formData.append('customText',zhoD[j].customText)
  7145. }else if(this.user.timeType.customTextActive){
  7146. formData.append('customText','-')
  7147. }
  7148. }
  7149. }
  7150. }
  7151. } else {
  7152. for (var i in this.zhoData) {
  7153. var zhoD = this.zhoData[i]
  7154. var flgs = false
  7155. if(this.reportTimeType.type == 2) {
  7156. for(var k in this.selProjectList) {
  7157. var pItem = this.selProjectList[k];
  7158. var pName = pItem.projectName;
  7159. var j = pName;
  7160. console.log('j==周报中的项目='+j);
  7161. if(zhoD[j].time && zhoD[j].time != 'null') {
  7162. flgs = true
  7163. // formData.append("degreeId", "-1");
  7164. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7165. if (this.isSubstitude) {
  7166. formData.append('targetUids',this.workForm.userId[0]);
  7167. }
  7168. for(var s in this.projectList) {
  7169. if(j == this.projectList[s].projectName) {
  7170. formData.append("projectId", this.projectList[s].id);
  7171. }
  7172. }
  7173. if(this.user.timeType.reportAuditType == 3){
  7174. let audItem = {}
  7175. if(this.user.timeType.auditLevel > 0){
  7176. audItem.auditorFirst = zhoD[j].auditorFirst
  7177. }
  7178. if(this.user.timeType.auditLevel > 1){
  7179. audItem.auditorSec = zhoD[j].auditorSec
  7180. }
  7181. if(this.user.timeType.auditLevel > 2){
  7182. audItem.auditorThird = zhoD[j].auditorThird
  7183. }
  7184. if(zhoD[j].ccUserid){
  7185. audItem.ccUserid = zhoD[j].ccUserid
  7186. }
  7187. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7188. }
  7189. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7190. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7191. formData.append("reportTimeType", this.reportTimeType.type);
  7192. formData.append("endTime", zhoD[j].time[1]);
  7193. formData.append("startTime", zhoD[j].time[0]);
  7194. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7195. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7196. formData.append("isOvertime", 0)
  7197. formData.append("professionProgress", "[]")
  7198. if (zhoD[j].groupId) {
  7199. formData.append("groupId",zhoD[j].groupId)
  7200. } else {
  7201. //解决后台groupId数组越界的问题
  7202. formData.append("groupId",0)
  7203. }
  7204. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7205. formData.append("createDate",zhoD.zhoDataTime)
  7206. if (zhoD[j].projectAuditorId) {
  7207. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7208. }
  7209. if(zhoD[j].basecostId) {
  7210. formData.append("basecostId", zhoD[j].basecostId);
  7211. } else {
  7212. formData.append("basecostId", 0);
  7213. }
  7214. if(this.user.timeType.customDegreeActive){
  7215. if (this.user.timeType.customDegreeMultiple) {
  7216. if (zhoD[j].multiDegrIdArray) {
  7217. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7218. } else {
  7219. formData.append("multiDegrId", "[]");
  7220. }
  7221. } else {
  7222. if (zhoD[j].degreeId) {
  7223. formData.append('degreeId',zhoD[j].degreeId)
  7224. } else {
  7225. formData.append("degreeId", "-1");
  7226. }
  7227. }
  7228. }else{
  7229. formData.append("degreeId", "-1");
  7230. }
  7231. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7232. formData.append('customData',zhoD[j].customData)
  7233. }else if(this.user.timeType.customDataActive){
  7234. formData.append('customData',0)
  7235. }
  7236. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7237. formData.append('customText',zhoD[j].customText)
  7238. }else if(this.user.timeType.customTextActive){
  7239. formData.append('customText','-')
  7240. }
  7241. }
  7242. }
  7243. } else {
  7244. for(var k in this.selProjectList) {
  7245. var pItem = this.selProjectList[k];
  7246. var pName = pItem.projectName;
  7247. var j = pName;
  7248. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7249. flgs = true
  7250. // formData.append("degreeId", "-1");
  7251. console.log('进入了workFpppp==='+j);
  7252. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7253. if (this.isSubstitude) {
  7254. formData.append('targetUids',this.workForm.userId[0]);
  7255. }
  7256. for(var s in this.projectList) {
  7257. if(j == this.projectList[s].projectName) {
  7258. formData.append("projectId", this.projectList[s].id);
  7259. }
  7260. }
  7261. if(this.user.timeType.reportAuditType == 3){
  7262. let audItem = {}
  7263. if(this.user.timeType.auditLevel > 0){
  7264. audItem.auditorFirst = zhoD[j].auditorFirst
  7265. }
  7266. if(this.user.timeType.auditLevel > 1){
  7267. audItem.auditorSec = zhoD[j].auditorSec
  7268. }
  7269. if(this.user.timeType.auditLevel > 2){
  7270. audItem.auditorThird = zhoD[j].auditorThird
  7271. }
  7272. if(zhoD[j].ccUserid){
  7273. audItem.ccUserid = zhoD[j].ccUserid
  7274. }
  7275. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7276. }
  7277. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7278. // formData.append("subProjectId", zhoD[j].subProjectId);
  7279. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7280. formData.append("reportTimeType", this.reportTimeType.type);
  7281. if(this.reportTimeType.type == 1) {
  7282. formData.append("workingTime", zhoD[j].workingTime);
  7283. } else if(this.reportTimeType.type == 2) {
  7284. formData.append("endTime", zhoD[j].time[1]);
  7285. formData.append("startTime", zhoD[j].time[0]);
  7286. } else if(this.reportTimeType.type == 3) {
  7287. formData.append("progress", zhoD[j].progress);
  7288. formData.append("workingTime", zhoD[j].workingTime);
  7289. }
  7290. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7291. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7292. formData.append("isOvertime", 0)
  7293. formData.append("professionProgress", "[]")
  7294. if (zhoD[j].groupId) {
  7295. formData.append("groupId",zhoD[j].groupId)
  7296. } else {
  7297. //解决后台groupId数组越界的问题
  7298. formData.append("groupId",0)
  7299. }
  7300. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7301. formData.append("createDate",zhoD.zhoDataTime)
  7302. if (zhoD[j].projectAuditorId) {
  7303. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7304. }
  7305. if(zhoD[j].basecostId) {
  7306. formData.append("basecostId", zhoD[j].basecostId);
  7307. } else {
  7308. formData.append("basecostId", 0);
  7309. }
  7310. if(this.user.timeType.customDegreeActive){
  7311. if (this.user.timeType.customDegreeMultiple) {
  7312. if (zhoD[j].multiDegrIdArray) {
  7313. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7314. } else {
  7315. formData.append("multiDegrId", "[]");
  7316. }
  7317. } else {
  7318. if (zhoD[j].degreeId) {
  7319. formData.append('degreeId',zhoD[j].degreeId)
  7320. } else {
  7321. formData.append("degreeId", "-1");
  7322. }
  7323. }
  7324. }else{
  7325. formData.append("degreeId", "-1");
  7326. }
  7327. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7328. formData.append('customData',zhoD[j].customData)
  7329. }else if(this.user.timeType.customDataActive){
  7330. formData.append('customData',0)
  7331. }
  7332. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7333. formData.append('customText',zhoD[j].customText)
  7334. }else if(this.user.timeType.customTextActive){
  7335. formData.append('customText','-')
  7336. }
  7337. }
  7338. }
  7339. }
  7340. }
  7341. }
  7342. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7343. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7344. if(!next) {
  7345. this.$message({
  7346. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7347. type: 'error'
  7348. })
  7349. return
  7350. }
  7351. // 自定义维度
  7352. this.submitingReport = true;
  7353. this.http.uploadFile( this.port.report.editPort, formData,
  7354. res => {
  7355. // this.listLoading = false;
  7356. this.submitingReport = false;
  7357. if (res.code == "ok") {
  7358. this.$message({
  7359. message: this.$t('message.fillinsuccessfully'),
  7360. type: "success"
  7361. });
  7362. this.fillWeekDialogVisi = false
  7363. this.selConShow = true
  7364. this.zhoData = []
  7365. this.weekDateRange = ''
  7366. this.getReportList();
  7367. this.getDepartment();
  7368. // 关闭弹窗 并 清空
  7369. this.selProjectList = []
  7370. this.selCon = []
  7371. this.getRecentlyProject()
  7372. } else {
  7373. this.$message({
  7374. message: res.msg,
  7375. type: "error"
  7376. });
  7377. }
  7378. },
  7379. error => {
  7380. this.submitingReport = false;
  7381. this.$message({
  7382. message: error,
  7383. type: "error"
  7384. });
  7385. });
  7386. },
  7387. handleGroupAuditorData(data) {
  7388. const { reportAuditType } = this.user.timeType
  7389. if(reportAuditType != 1 && reportAuditType != 2) {
  7390. return {next: true}
  7391. }
  7392. let arrList = [];
  7393. Object.entries(data).forEach(([key, obj]) => {
  7394. Object.entries(obj).forEach(([projectName, projectData]) => {
  7395. if (projectData.workingTime && !projectData.groupId) {
  7396. arrList.push({
  7397. projectName,
  7398. date: obj.zhoDataTime,
  7399. dateText: obj.zhoDataTimeTxt
  7400. });
  7401. }
  7402. });
  7403. });
  7404. if(arrList.length > 0) {
  7405. return {
  7406. next: false,
  7407. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7408. }
  7409. } else {
  7410. return {
  7411. next: true,
  7412. error: [],
  7413. }
  7414. }
  7415. },
  7416. ChangeHourMinutestr (str) {
  7417. if (str !== "0" && str !== "" && str !== null) {
  7418. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7419. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7420. } else {
  7421. return "";
  7422. }
  7423. },
  7424. // 得到两个日期中间的日期
  7425. getdiffdate(stime,etime){
  7426. //初始化日期列表,数组
  7427. var diffdate = new Array();
  7428. var i=0;
  7429. //开始日期小于等于结束日期,并循环
  7430. while(stime<=etime){
  7431. diffdate[i] = stime;
  7432. //获取开始日期时间戳
  7433. var stime_ts = new Date(stime).getTime();
  7434. //增加一天时间戳后的日期
  7435. var next_date = stime_ts + (24*60*60*1000);
  7436. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7437. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7438. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7439. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7440. stime = next_dates_y+next_dates_m+next_dates_d;
  7441. //增加数组key
  7442. i++;
  7443. }
  7444. return diffdate;
  7445. },
  7446. // 添加模块
  7447. addDomain(i) {
  7448. var leftProgress = 10;
  7449. if (this.reportTimeType.type == 3) {
  7450. //计算已经待分配工时比例
  7451. let array = this.workForm.domains;
  7452. let totalProgress = 0;
  7453. for (var i=0;i<array.length; i++) {
  7454. totalProgress += array[i].progress;
  7455. }
  7456. if (totalProgress < 100) {
  7457. leftProgress = 100 - totalProgress;
  7458. }
  7459. }
  7460. var addItem = {
  7461. projectId: "",
  7462. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7463. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7464. ),
  7465. content: "",
  7466. progress:leftProgress,
  7467. state:2,//2-表示待提交
  7468. multiWorktime: this.reportTimeType.multiWorktime,
  7469. worktimeList:[{}],
  7470. canEdit: true,
  7471. auditorFirst: '',
  7472. auditorSec: '',
  7473. auditorThird: '',
  7474. ccUserid: ''
  7475. // degreeId: '',
  7476. };
  7477. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7478. this.$set(addItem,'isOvertime',true)
  7479. if(this.reportTimeType.type == 3){
  7480. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7481. }
  7482. }
  7483. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7484. //默认给第一个,必填字段
  7485. addItem.basecostId = this.timeBasecostList[0].id;
  7486. }
  7487. this.workForm.domains.push(addItem);
  7488. document.getElementById('workFormsItemBottom').scrollIntoView()
  7489. this.canEdit = true
  7490. if (this.reportTimeType.type == 0) {
  7491. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7492. var length = this.workForm.domains.length;
  7493. if (length == 2) {
  7494. this.showAddMore = false;
  7495. }
  7496. }
  7497. this.chuji()
  7498. this.seleChn()
  7499. },
  7500. // 移除模块
  7501. delDomain(i) {
  7502. this.workForm.domains.splice(i,1)
  7503. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7504. if (!this.originCanEdit) {
  7505. let iscan = false
  7506. for(let i in this.workForm.domains){
  7507. if(this.workForm.domains[i].canEdit){
  7508. iscan = true
  7509. }
  7510. }
  7511. this.canEdit = iscan
  7512. }
  7513. //检测当前剩下的一个,时间类型是否是全天
  7514. if (this.reportTimeType.type == 0) {
  7515. if (this.workForm.domains[0].timeType == 0) {
  7516. this.showAddMore = false;
  7517. } else {
  7518. this.showAddMore = true;
  7519. }
  7520. }
  7521. if(this.user.timeType.multiWorktime == 1) {
  7522. this.iptChangs()
  7523. } else {
  7524. this.seleChn(0)
  7525. }
  7526. },
  7527. // 改变月份
  7528. changeMonth() {
  7529. this.isWeekend = false
  7530. let date = new Date()
  7531. let nowmon = date.getMonth() + 1
  7532. let nowday = date.getDate()
  7533. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7534. if (this.isBatch == 0) {
  7535. if(this.user.timeType.fillAhead == 0){
  7536. let date_a = new Date(this.workForm.createDate)
  7537. if(date_a.getTime() > date.getTime()){
  7538. this.workForm.createDate = nowdate
  7539. }
  7540. }
  7541. //只有按天填报才能获取当天的日报
  7542. if(!this.isSubstitude){
  7543. let weekday = new Date(this.workForm.createDate).getDay()
  7544. if(this.user.companyId == 817){
  7545. if(weekday == 0){
  7546. this.isWeekend = true
  7547. }
  7548. }else{
  7549. if(weekday == 0 || weekday == 6){
  7550. this.isWeekend = true
  7551. }
  7552. }
  7553. this.getReport()
  7554. }
  7555. }else {
  7556. if(this.user.timeType.fillAhead == 0){
  7557. let date_a = new Date(this.workForm.createDate[1])
  7558. if(date_a.getTime() > date.getTime()){
  7559. this.workForm.createDate[1] = nowdate
  7560. let sdate = new Date(this.workForm.createDate[0])
  7561. let edate = new Date(this.workForm.createDate[1])
  7562. if(sdate > edate){
  7563. this.workForm.createDate[0] = this.workForm.createDate[1]
  7564. }
  7565. }
  7566. }
  7567. }
  7568. },
  7569. // 判断时间段
  7570. fns() {
  7571. for (let k in this.dateAr) {
  7572. if (!this.judege(k)) {
  7573. return false
  7574. }
  7575. }
  7576. return true
  7577. },
  7578. judege(idx){
  7579. for (let k in this.dateAr) {
  7580. if (idx !== k) {
  7581. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7582. return false
  7583. }
  7584. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7585. return false
  7586. }
  7587. }
  7588. }
  7589. return true
  7590. },
  7591. getOverlapData(data) {
  7592. let overlapData = [];
  7593. for (let i = 0; i < data.length; i++) {
  7594. for (let j = i + 1; j < data.length; j++) {
  7595. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7596. overlapData.push(data[i], data[j]);
  7597. }
  7598. }
  7599. }
  7600. return overlapData;
  7601. },
  7602. // 保存日报111111
  7603. submitReport(isDraft) {
  7604. this.isDraft = isDraft;
  7605. this.$refs.workForm.validate(valid => {
  7606. if (valid) {
  7607. if (!isDraft) {
  7608. //针对苏州景昱,单独的检查逻辑
  7609. if (this.user.companyId == 5978) {
  7610. //调接口,先检查工时是否存在异常
  7611. var totalTime = 0;
  7612. for (var t=0;t<this.workForm.domains.length; t++) {
  7613. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7614. }
  7615. var array = [];
  7616. if (this.isBatch) {
  7617. var startDate = new Date(this.workForm.createDate[0]);
  7618. var endDate = new Date(this.workForm.createDate[1]);
  7619. if (startDate > endDate) {
  7620. this.$message({
  7621. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7622. type: "error"
  7623. });
  7624. return
  7625. } else {
  7626. while(true){
  7627. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7628. array.push(workData);
  7629. startDate.setDate(startDate.getDate() + 1);
  7630. if (startDate > endDate) {
  7631. break;
  7632. }
  7633. }
  7634. }
  7635. } else {
  7636. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7637. array.push(workData)
  7638. }
  7639. this.submitingReport = true;
  7640. var passUserId = this.user.id;
  7641. if (this.isSubstitude) {
  7642. passUserId = this.targetUids;
  7643. }
  7644. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7645. res => {
  7646. this.submitingReport = false;
  7647. if (res.code == "ok") {
  7648. this.submitReportSon()
  7649. } else {
  7650. this.$confirm(res.msg, this.$t('other.prompts'), {
  7651. confirmButtonText: this.$t('huLveBingTiJiao'),
  7652. cancelButtonText: this.$t('btn.cancel'),
  7653. type: 'error'
  7654. }).then(() => {
  7655. this.submitReportSon()
  7656. }).catch(() => {
  7657. });
  7658. }
  7659. },
  7660. error => {
  7661. this.$message({
  7662. message: error,
  7663. type: "error"
  7664. });
  7665. });
  7666. } else {
  7667. if(this.totalReportHours < this.user.timeType.allday){
  7668. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7669. confirmButtonText: this.$t('btn.determine'),
  7670. cancelButtonText: this.$t('btn.cancel'),
  7671. type: 'warning'
  7672. }).then(() => {
  7673. this.submitReportSon()
  7674. }).catch(() => {
  7675. });
  7676. }else{
  7677. this.submitReportSon()
  7678. }
  7679. }
  7680. } else {
  7681. //暂存,不需要检查工时是否超过考勤
  7682. this.submitReportSon()
  7683. }
  7684. }
  7685. });
  7686. },
  7687. submitReportSon() {
  7688. this.dateAr = []
  7689. //检查重叠
  7690. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7691. let alp = []
  7692. if(this.user.timeType.multiWorktime != 1) {
  7693. for(var p in this.workForm.domains) {
  7694. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7695. let objs = {}
  7696. objs.s = this.workForm.domains[p].startTime
  7697. objs.e = this.workForm.domains[p].endTime
  7698. alp.push(objs)
  7699. }
  7700. }
  7701. this.dateAr = alp
  7702. if(this.dateAr.length > 0) {
  7703. let trus = this.fns()
  7704. if(!trus) {
  7705. this.$message({
  7706. message: this.$t('message.Filledtimeperiodsoverlap'),
  7707. type: "error"
  7708. });
  7709. return
  7710. }
  7711. }
  7712. } else {
  7713. for(var p in this.workForm.domains) {
  7714. var slll = this.workForm.domains[p]
  7715. for(var o in slll.worktimeList) {
  7716. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7717. let objs = {}
  7718. objs.s = slll.worktimeList[o].startTime
  7719. objs.e = slll.worktimeList[o].endTime
  7720. alp.push(objs)
  7721. }
  7722. }
  7723. }
  7724. this.dateAr = alp
  7725. if(this.dateAr.length > 0) {
  7726. let trus = this.fns()
  7727. if(!trus) {
  7728. this.$message({
  7729. message: this.$t('message.Filledtimeperiodsoverlap'),
  7730. type: "error"
  7731. });
  7732. return
  7733. }
  7734. }
  7735. }
  7736. }
  7737. //检查子项目
  7738. if (this.user.timeType.subProMustFill == 1) {
  7739. for(var p in this.workForm.domains) {
  7740. var oneProItem = this.workForm.domains[p]
  7741. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7742. //没有选择子项目
  7743. this.$message({
  7744. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7745. type: "error"
  7746. });
  7747. return
  7748. }
  7749. }
  7750. }
  7751. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7752. if (this.user.companyId == this.yuzhongCompId) {
  7753. for(var p in this.workForm.domains) {
  7754. var oneProItem = this.workForm.domains[p]
  7755. if (!oneProItem.extraField1) {
  7756. this.$message({
  7757. message: this.$t('jiaoSeBiTianQingJianCha'),
  7758. type: "error"
  7759. });
  7760. return
  7761. }
  7762. if (!oneProItem.extraField2) {
  7763. this.$message({
  7764. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7765. type: "error"
  7766. });
  7767. return
  7768. }
  7769. if (!oneProItem.extraField3) {
  7770. this.$message({
  7771. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7772. type: "error"
  7773. });
  7774. return
  7775. }
  7776. }
  7777. }
  7778. // return
  7779. //代填的情况,检查人员是否已经选择
  7780. if (this.isSubstitude) {
  7781. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7782. this.$message({
  7783. message: this.$t('message.pleaseselectthepersontofillin'),
  7784. type: "error"
  7785. });
  7786. return;
  7787. }
  7788. }
  7789. //检查时间,全天和上下午不能同时存在
  7790. if (this.reportTimeType.type == 0) {
  7791. var alldayNum = 0;
  7792. var amNum = 0;
  7793. var pmNum = 0;
  7794. for(var i in this.workForm.domains) {
  7795. if (this.workForm.domains[i].timeType == 0) {
  7796. alldayNum ++;
  7797. } else if (this.workForm.domains[i].timeType == 1) {
  7798. amNum++;
  7799. } else if (this.workForm.domains[i].timeType == 2) {
  7800. pmNum++;
  7801. }
  7802. }
  7803. if (alldayNum > 1) {
  7804. this.$message({
  7805. // message: "工作时间-全天,只能选择一次",
  7806. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7807. type: "error"
  7808. });
  7809. return;
  7810. }
  7811. if (amNum > 1) {
  7812. this.$message({
  7813. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7814. type: "error"
  7815. });
  7816. return;
  7817. }
  7818. if (pmNum > 1) {
  7819. this.$message({
  7820. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7821. type: "error"
  7822. });
  7823. return;
  7824. }
  7825. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7826. this.$message({
  7827. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7828. type: "error"
  7829. });
  7830. return;
  7831. }
  7832. } else if (this.reportTimeType.type == 3) {
  7833. //总百分比不能超过100%
  7834. let total = 0;
  7835. this.workForm.domains.forEach(w=>{total += w.progress});
  7836. if (total > 100) {
  7837. this.$message({
  7838. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7839. type: "error"
  7840. });
  7841. return;
  7842. } else if (total < 100) {
  7843. this.$message({
  7844. message: this.$t('message.cannotbesubmitted'),
  7845. type: "error"
  7846. });
  7847. return;
  7848. }
  7849. }
  7850. this.listLoading = true;
  7851. let formData = new FormData();
  7852. formData.append("draft", this.isDraft);
  7853. var totalTime = 0;
  7854. for (var t=0;t<this.workForm.domains.length; t++) {
  7855. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7856. }
  7857. //批量填报不校验考勤时长,交给后台校验
  7858. if (!this.isBatch) {
  7859. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7860. if (this.workForm.time){
  7861. if (this.workForm.time.workHours == 0){
  7862. this.$message({
  7863. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7864. type: 'error'
  7865. })
  7866. return
  7867. }
  7868. }else{
  7869. this.$message({
  7870. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7871. type: 'error'
  7872. })
  7873. return
  7874. }
  7875. }
  7876. }
  7877. //针对凡己和景昱,苏州博海,此处不校验考勤时长
  7878. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.workForm.time) {
  7879. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7880. this.$message({
  7881. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7882. type: "error"
  7883. });
  7884. return;
  7885. }
  7886. }
  7887. for(var i in this.workForm.domains) {
  7888. // 检查任务/里程碑是否为必填
  7889. let taskRequired = this.user.timeType.taskRequired
  7890. if(taskRequired == 1) {
  7891. if(!this.workForm.domains[i].taskId) {
  7892. this.$message({
  7893. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  7894. type: "error"
  7895. });
  7896. return
  7897. }
  7898. }
  7899. if(this.user.timeType.reportAuditType == 3){
  7900. let audItem = {}
  7901. let auditRule = ''
  7902. if(this.workForm.domains[i].id){
  7903. audItem.reportId = this.workForm.domains[i].id
  7904. }
  7905. if(this.user.timeType.auditLevel > 0){
  7906. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7907. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7908. }
  7909. if(this.user.timeType.auditLevel > 1){
  7910. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7911. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7912. }
  7913. if(this.user.timeType.auditLevel > 2){
  7914. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7915. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7916. }
  7917. if(this.workForm.domains[i].ccUserid){
  7918. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7919. }
  7920. if(auditRule){
  7921. auditRule = auditRule.substring(0,auditRule.length - 1)
  7922. this.$message({
  7923. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7924. type: 'error'
  7925. })
  7926. return
  7927. }
  7928. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7929. }
  7930. if (this.user.timeType.customDegreeActive) {
  7931. if (this.user.timeType.customDegreeMultiple) {
  7932. //多选
  7933. if (this.workForm.domains[i].multiDegrIdArray) {
  7934. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7935. degreeArray = degreeArray.replace(/,/g,"@");
  7936. formData.append("multiDegrId", degreeArray);
  7937. } else {
  7938. formData.append("multiDegrId", '[]');
  7939. }
  7940. } else {
  7941. //单选
  7942. if (this.workForm.domains[i].degreeId) {
  7943. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7944. } else {
  7945. formData.append("degreeId", -1);
  7946. }
  7947. }
  7948. } else {
  7949. formData.append("degreeId", -1);
  7950. }
  7951. if(this.workForm.domains[i].customData) {
  7952. // var sss = this.workForm.domains[i].degreeId.toString()
  7953. formData.append("customData", this.workForm.domains[i].customData);
  7954. } else {
  7955. formData.append("customData", 0);
  7956. }
  7957. if(this.workForm.domains[i].customText) {
  7958. formData.append("customText", this.workForm.domains[i].customText);
  7959. } else {
  7960. formData.append("customText", '-');
  7961. }
  7962. if (this.workForm.domains[i].id) {
  7963. formData.append("id", this.workForm.domains[i].id);
  7964. } else {
  7965. formData.append("id", -1);
  7966. }
  7967. formData.append("projectId", this.workForm.domains[i].projectId);
  7968. if (this.workForm.domains[i].subProjectId) {
  7969. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7970. } else {
  7971. formData.append("subProjectId", 0);
  7972. }
  7973. if (this.workForm.domains[i].groupId) {
  7974. formData.append("groupId", this.workForm.domains[i].groupId);
  7975. } else {
  7976. formData.append("groupId", 0);
  7977. }
  7978. if (this.workForm.domains[i].taskId) {
  7979. formData.append("taskId", this.workForm.domains[i].taskId);
  7980. } else {
  7981. formData.append("taskId", 0);
  7982. }
  7983. if (this.workForm.domains[i].taskFinish == true) {
  7984. formData.append("taskFinish", 1);
  7985. } else {
  7986. formData.append("taskFinish", 0);
  7987. }
  7988. formData.append("reportTimeType", this.reportTimeType.type);
  7989. if (this.reportTimeType.type == 0) {
  7990. formData.append("timeType", this.workForm.domains[i].timeType);
  7991. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7992. formData.append("workingTime", workingTime);
  7993. } else if (this.reportTimeType.type == 1){
  7994. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7995. } else if (this.reportTimeType.type == 2) {
  7996. formData.append("endTime", this.workForm.domains[i].endTime);
  7997. formData.append("startTime", this.workForm.domains[i].startTime);
  7998. } else if (this.reportTimeType.type == 3) {
  7999. //按比例分配
  8000. formData.append("progress", this.workForm.domains[i].progress);
  8001. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8002. }
  8003. if(this.user.timeType.choseFromAlbum == 1 ) {
  8004. console.log(this.workForm.domains[i].imgList)
  8005. if(this.workForm.domains[i].imgList) {
  8006. let imgListFor = this.workForm.domains[i].imgList
  8007. for(var b in imgListFor) {
  8008. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8009. }
  8010. console.log(imgListFor)
  8011. let m = JSON.stringify(imgListFor);
  8012. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8013. formData.append("picStr", m);
  8014. } else {
  8015. formData.append("picStr", '[]');
  8016. }
  8017. }
  8018. //处理多个时间事项
  8019. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8020. if (this.reportTimeType.multiWorktime == 1) {
  8021. //检查时间是否有重叠
  8022. var workList = this.workForm.domains[i].worktimeList;
  8023. for (var j=0;j<workList.length; j++) {
  8024. var curItem = workList[j];
  8025. //检查开始时间是否大于结束时间
  8026. if (curItem.startTime >= curItem.endTime) {
  8027. this.$message({
  8028. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8029. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8030. type: "error"
  8031. });
  8032. return;
  8033. }
  8034. //时间不可重叠
  8035. if (this.reportTimeType.timeCanOverlap == 0) {
  8036. for (var p = j+1;p<workList.length; p++) {
  8037. var jItem = workList[p];
  8038. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8039. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8040. this.$message({
  8041. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8042. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8043. type: "error"
  8044. });
  8045. return;
  8046. }
  8047. }
  8048. }
  8049. }
  8050. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8051. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8052. formData.append("content", m);
  8053. } else {
  8054. if (this.workForm.domains[i].content) {
  8055. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8056. m = m.replace(/,/g,",");
  8057. console.log(m, '需要传值的数据')
  8058. // formData.append("content", this.workForm.domains[i].content);
  8059. formData.append("content", m);
  8060. } else {
  8061. formData.append("content", '-');
  8062. }
  8063. }
  8064. if (this.isBatch == 0) {
  8065. formData.append("createDate", this.workForm.createDate);
  8066. } else {
  8067. //批量填报,时间范围
  8068. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8069. }
  8070. if(this.workForm.domains[i].isOvertime) {
  8071. formData.append("isOvertime", 1);
  8072. } else {
  8073. formData.append("isOvertime", 0);
  8074. }
  8075. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8076. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8077. } else {
  8078. formData.append("overtimeHours", 0);
  8079. }
  8080. if(this.workForm.domains[i].basecostId) {
  8081. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8082. } else {
  8083. formData.append("basecostId", 0);
  8084. }
  8085. if (this.workForm.userId != null) {
  8086. var targetUids = '';
  8087. this.workForm.userId.forEach(u=>{
  8088. targetUids += u + '@';
  8089. });
  8090. if (targetUids.length > 0) {
  8091. targetUids = targetUids.substring(0, targetUids.length -1);
  8092. formData.append("targetUids", targetUids);
  8093. }
  8094. }
  8095. //项目专业进度
  8096. if (this.workForm.domains[i].professionProgress) {
  8097. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8098. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8099. formData.append("professionProgress", m);
  8100. } else {
  8101. formData.append("professionProgress", "[]");
  8102. }
  8103. if (this.workForm.domains[i].stage) {
  8104. formData.append("stage", this.workForm.domains[i].stage);
  8105. } else {
  8106. formData.append("stage", "-");
  8107. }
  8108. if (this.workForm.domains[i].projectAuditorId) {
  8109. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8110. } else {
  8111. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8112. this.$message({
  8113. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8114. type: "error"
  8115. });
  8116. return;
  8117. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8118. //分组负责人先审核, 确定是选择了任务分组
  8119. if (this.workForm.domains[i].taskGroups.length == 0) {
  8120. this.$message({
  8121. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8122. type: "error"
  8123. });
  8124. return;
  8125. } else if (!this.workForm.domains[i].groupId) {
  8126. // console.log(this.workForm.domains[i]);
  8127. this.$message({
  8128. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8129. type: "error"
  8130. });
  8131. return;
  8132. }
  8133. }
  8134. }
  8135. if (this.user.companyId == this.yuzhongCompId) {
  8136. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8137. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8138. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8139. }
  8140. //依斯贝的服务Id
  8141. if (this.user.companyId == this.yisibeiCompId) {
  8142. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8143. }
  8144. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8145. this.$message({
  8146. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8147. type: "error"
  8148. });
  8149. return
  8150. }
  8151. if(this.user.timeType.userWithMultiDept == 1) {
  8152. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8153. }
  8154. }
  8155. this.submitingReport = true;
  8156. this.http.uploadFile( this.port.report.editPort, formData,
  8157. res => {
  8158. this.listLoading = false;
  8159. this.submitingReport = false;
  8160. if (res.code == "ok") {
  8161. if(res.msg!=null){
  8162. this.$message({
  8163. dangerouslyUseHTMLString: true,
  8164. message: res.msg,
  8165. type: "warning",
  8166. showClose: true,
  8167. duration: 0
  8168. });
  8169. }else{
  8170. this.$message({
  8171. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8172. type: "success"
  8173. });
  8174. }
  8175. this.dialogVisible = false;
  8176. this.jsDay = 0
  8177. this.jsTime = 0
  8178. this.getReportList();
  8179. this.getDepartment();
  8180. this.getRecentlyProject()
  8181. } else {
  8182. this.$message({
  8183. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8184. type: "error"
  8185. });
  8186. }
  8187. },
  8188. error => {
  8189. this.listLoading = false;
  8190. this.submitingReport = false;
  8191. this.$message({
  8192. message: error,
  8193. type: "error"
  8194. });
  8195. });
  8196. },
  8197. // 判断是展示那个工时导入
  8198. imports() {
  8199. if(this.user.timeType.syncCorpwxTime == 0) {
  8200. this.importDialog = true
  8201. } else {
  8202. this.importWxDialog = true
  8203. }
  8204. },
  8205. // 跳转
  8206. junpToDeskTop(id) {
  8207. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8208. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8209. },
  8210. // 通过日报
  8211. approve(id, item) {
  8212. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8213. this.approveinData = {
  8214. id: id,
  8215. date: this.date +day,
  8216. reportIds: item.id
  8217. }
  8218. if(this.user.timeType.needEvaluate == 1){
  8219. this.$set(this.approveinData,'evaluate','')
  8220. this.approveinDialog = true
  8221. }else{
  8222. this.logining = true;
  8223. this.approveinfun()
  8224. }
  8225. },
  8226. approveinfun(){
  8227. this.http.post( this.port.report.approve, this.approveinData,
  8228. res => {
  8229. this.logining = false;
  8230. if (res.code == "ok") {
  8231. this.approveinDialog = false
  8232. this.$message({
  8233. message: this.$t('message.Reviewsucceeded'),
  8234. type: "success"
  8235. });
  8236. this.refreshReportData(this.approveinData.reportIds);
  8237. this.getDepartment();
  8238. } else {
  8239. this.$message({
  8240. message: res.msg,
  8241. type: "error"
  8242. });
  8243. }
  8244. },
  8245. error => {
  8246. this.logining = false;
  8247. this.$message({
  8248. message: error,
  8249. type: "error"
  8250. });
  8251. });
  8252. },
  8253. //撤回日报
  8254. cancel(item,e) {
  8255. // console.log('can can need',item);
  8256. this.logining = true;
  8257. var ids = '';
  8258. var data = e ? item : item.data;
  8259. data.forEach(element => {
  8260. if(element.id){
  8261. ids +=(element.id+',');
  8262. }
  8263. });
  8264. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8265. res => {
  8266. this.logining = false;
  8267. if (res.code == "ok") {
  8268. this.$message({
  8269. message:this.$t('message.Withdrawalsucceeded'),
  8270. type: "success"
  8271. });
  8272. this.getReportList();
  8273. if(e){this.getReport()}
  8274. this.getDepartment();
  8275. } else {
  8276. this.$message({
  8277. message: res.msg,
  8278. type: "error"
  8279. });
  8280. }
  8281. },
  8282. error => {
  8283. this.logining = false;
  8284. this.$message({
  8285. message: error,
  8286. type: "error"
  8287. });
  8288. });
  8289. },
  8290. showDenyDialog(id,i, item) {
  8291. this.denyReasonDialog = true;
  8292. this.isDenying = false;
  8293. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8294. var ids = item.id;
  8295. // var data = item.data;
  8296. // data.forEach(element => {
  8297. // ids +=(element.id+',');
  8298. // });
  8299. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8300. },
  8301. // 未通过日报
  8302. deny() {
  8303. this.logining = true;
  8304. this.isDenying = true;
  8305. this.http.post( this.port.report.deny, this.denyForm,
  8306. res => {
  8307. this.logining = false;
  8308. this.isDenying = false;
  8309. if (res.code == "ok") {
  8310. this.$message({
  8311. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8312. type: "success"
  8313. });
  8314. this.refreshReportData(this.denyForm.reportIds);
  8315. this.getDepartment();
  8316. this.denyReasonDialog = false;
  8317. } else {
  8318. this.$message({
  8319. message: res.msg,
  8320. type: "error"
  8321. });
  8322. }
  8323. },
  8324. error => {
  8325. this.logining = false;
  8326. this.$message({
  8327. message: error,
  8328. type: "error"
  8329. });
  8330. });
  8331. },
  8332. // 查看工时记录弹窗
  8333. toView() {
  8334. this.toViewDialogVisible = true
  8335. this.toViewloading = true
  8336. this.getToView()
  8337. },
  8338. getToView() {
  8339. this.http.post( '/report-import-log/getList', this.toViewForm,
  8340. res => {
  8341. this.toViewloading = false;
  8342. if (res.code == "ok") {
  8343. // console.log(res.data, '数据数据')
  8344. this.toViewList = res.data.records
  8345. this.toViewForm.total = res.data.total
  8346. } else {
  8347. this.toViewloading = false;
  8348. this.$message({
  8349. message: res.msg,
  8350. type: "error"
  8351. });
  8352. }
  8353. })
  8354. },
  8355. // 触发 selectCat 组件更改他的值
  8356. selectCatCli(obj) {
  8357. // console.log(obj, '看看')
  8358. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8359. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8360. },
  8361. vueCasader(obj) {
  8362. console.log(obj, '看看值', this.departmentList)
  8363. if(obj.distinction == 1 && obj.item) {
  8364. let arr = []
  8365. arr.push(obj.item.value)
  8366. this.exportParam.departmentId = arr
  8367. }
  8368. if(obj.distinction == '10' && obj) {
  8369. const { id, other } = obj
  8370. this.workForm.domains[other].reportTargetDeptId = id
  8371. }
  8372. if(obj.distinction == '14' && obj) {
  8373. let arr = []
  8374. arr.push(obj.id)
  8375. this.deptIdForHasReport = arr
  8376. this.showMonthWorkTime()
  8377. }
  8378. if(obj.distinction == '15' && obj) {
  8379. let arr = []
  8380. arr.push(obj.id)
  8381. this.deptIdForNoReport = arr
  8382. this.showMonthNotWorkTime()
  8383. }
  8384. if(obj.distinction == '16' && obj) {
  8385. let arr = []
  8386. arr.push(obj.id)
  8387. this.deptIdForReminder = arr
  8388. this.showMonthWorkTimeReminder()
  8389. }
  8390. },
  8391. //分页
  8392. handleCurrentChange(val) {
  8393. this.toViewForm.pageIndex = val;
  8394. this.getToView();
  8395. },
  8396. handleSizeChange(val) {
  8397. this.toViewForm.pageSize = val;
  8398. this.getToView();
  8399. },
  8400. getAllUsersList(){
  8401. this.http.post('/user/getSimpleActiveUserList',{
  8402. },res => {
  8403. if(res.code == 'ok'){
  8404. this.allUsersList = res.data
  8405. }else{
  8406. this.$message({
  8407. message: res.msg,
  8408. type: 'error'
  8409. })
  8410. }
  8411. },err => {
  8412. this.$message({
  8413. message: err,
  8414. type: 'error'
  8415. })
  8416. })
  8417. },
  8418. //景昱变更提醒
  8419. changeReminder(item){
  8420. console.log("============",item)
  8421. let parameter={
  8422. startDate: this.WorktimeDatepickValue[0],
  8423. endDate: this.WorktimeDatepickValue[1],
  8424. }
  8425. if(item){
  8426. parameter.createDate=item.createDate,
  8427. parameter.userId=item.userId
  8428. }
  8429. this.http.post('/report/changeReminder',parameter,res => {
  8430. if(res.code == 'ok'){
  8431. this.$message({
  8432. message: res.msg,
  8433. type: 'success'
  8434. })
  8435. }else{
  8436. this.$message({
  8437. message: res.msg,
  8438. type: 'error'
  8439. })
  8440. }
  8441. },err => {
  8442. this.$message({
  8443. message: err,
  8444. type: 'error'
  8445. })
  8446. })
  8447. },
  8448. //景昱取消异常
  8449. cancelReminder(item){
  8450. let parameter={}
  8451. if(item){
  8452. parameter.createDate=item.createDate,
  8453. parameter.userId=item.userId
  8454. }
  8455. this.http.post('/report/cancelReminder',parameter,res => {
  8456. if(res.code == 'ok'){
  8457. this.$message({
  8458. message: res.msg,
  8459. type: 'success'
  8460. })
  8461. }else{
  8462. this.$message({
  8463. message: res.msg,
  8464. type: 'error'
  8465. })
  8466. }
  8467. },err => {
  8468. this.$message({
  8469. message: err,
  8470. type: 'error'
  8471. })
  8472. })
  8473. this.showMonthWorkTimeReminder()
  8474. },
  8475. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8476. fillWeekCustomClne() {
  8477. this.fillWeekDialogVisiCustom = false
  8478. },
  8479. fillWeekCustomClneTwo() {
  8480. this.fillWeekDialogVisiCustomTwo = false
  8481. },
  8482. fillWeekCustomSubmit() {
  8483. this.getReportList();
  8484. this.getDepartment();
  8485. this.getRecentlyProject()
  8486. },
  8487. // 待填日报姓名搜索
  8488. nameAearchSeek(flg) {
  8489. if(!this.nameAearch) {
  8490. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8491. return
  8492. }
  8493. if(flg) {
  8494. this.enterpriseWechatgetUser()
  8495. }
  8496. },
  8497. handleThreeData(userList) {
  8498. console.log(userList, '人员数据')
  8499. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8500. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8501. },
  8502. // 过滤树节点
  8503. filterTreeNodes(treeData, filterKeywords) {
  8504. return treeData.filter((node) => {
  8505. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8506. if (node.children && node.children.length > 0) {
  8507. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8508. }
  8509. return true;
  8510. }
  8511. if (node.children && node.children.length > 0) {
  8512. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8513. return node.children.length > 0;
  8514. }
  8515. return false;
  8516. });
  8517. },
  8518. // 企业微信获取人员
  8519. enterpriseWechatgetUser() {
  8520. this.deptMembDataLoading = true
  8521. this.http.post('/user/getEmployeeList',{
  8522. departmentId: -1,
  8523. pageIndex: 1,
  8524. pageSize: 100,
  8525. keyword: this.nameAearch,
  8526. status: '',
  8527. roleId: '',
  8528. cursor: '',
  8529. onlyDirect: '',
  8530. matchingType: ''
  8531. },res => {
  8532. if(res.code == 'ok'){
  8533. this.deptMembDataLoading = false
  8534. const userListName = res.data.records.map(item => item.name)
  8535. this.handleThreeData(userListName)
  8536. setTimeout(() => {
  8537. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8538. }, 200)
  8539. }else{
  8540. this.deptMembDataLoading = false
  8541. this.$message({
  8542. message: res.msg,
  8543. type: 'error'
  8544. })
  8545. }
  8546. },err => {
  8547. this.deptMembDataLoading = false
  8548. this.$message({
  8549. message: err,
  8550. type: 'error'
  8551. })
  8552. })
  8553. },
  8554. changeTreeNodeStatus(node) {
  8555. console.log(node)
  8556. let allZt = true
  8557. node.expanded = allZt
  8558. for (let i = 0; i < node.childNodes.length; i++) {
  8559. node.childNodes[i].expanded = allZt
  8560. if (node.childNodes[i].childNodes.length > 0) {
  8561. this.changeTreeNodeStatus(node.childNodes[i])
  8562. }
  8563. }
  8564. },
  8565. // 按周填报获取相关任务
  8566. async getWeeklyTaskList(item) {
  8567. console.log(item, '<=== 数据')
  8568. const { projectId, groupId, stage, taskId } = item
  8569. console.log(projectId, groupId, stage)
  8570. let parms = { projectId, isSubstitude: 0 }
  8571. groupId ? parms.groupId = groupId : ''
  8572. stage ? parms.stage = stage : ''
  8573. const { data } = await this.postData('/task/getRecentTask', parms)
  8574. this.zhoBao.taskId = taskId
  8575. this.$set(this.zhoBao, 'taskList', data)
  8576. console.log(this.zhoBao)
  8577. },
  8578. // 封装 post 请求
  8579. postData(url, params) {
  8580. return new Promise((resolve, reject) => {
  8581. this.http.post(url, { ...params },
  8582. res => {
  8583. resolve(res)
  8584. },
  8585. error => {
  8586. this.$message({
  8587. message: error,
  8588. type: "error"
  8589. });
  8590. reject(error)
  8591. })
  8592. })
  8593. },
  8594. // 自定义事件
  8595. selectCal(obj) {
  8596. console.log(obj, '传数据来源')
  8597. if(obj.distinction == '1') {
  8598. this.zhoBao.projectAuditorId = obj.id
  8599. } else if(obj.distinction == '2') {
  8600. this.zhoBao.auditorFirst = obj.id
  8601. } else if(obj.distinction == '3') {
  8602. this.zhoBao.auditorSec = obj.id
  8603. } else if(obj.distinction == '4') {
  8604. this.zhoBao.auditorThird = obj.id
  8605. } else if(obj.distinction == '5') {
  8606. this.zhoBao.ccUserid = obj.id
  8607. } else if(obj.distinction == '12') {
  8608. this.usersListId = obj.id
  8609. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8610. this.searchKeyword = obj.name
  8611. } else {
  8612. this.searchKeyword = ''
  8613. }
  8614. this.searchScreen(0)
  8615. } else if(obj.distinction == '13') {
  8616. this.usersListId = obj.id
  8617. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8618. this.searchKeyword = obj.name
  8619. } else {
  8620. this.searchKeyword = ''
  8621. }
  8622. this.searchScreen(1)
  8623. }
  8624. }
  8625. },
  8626. created() {
  8627. this.getUsers()
  8628. let height = window.innerHeight;
  8629. this.tableHeight = height - 178;
  8630. const that = this;
  8631. window.onresize = function temp() {
  8632. that.tableHeight = window.innerHeight - 178;
  8633. };
  8634. this.toViewForm.companyId = this.user.companyId
  8635. this.initDrag([{
  8636. type: "LR",
  8637. domClass: {
  8638. // 中间分割线的名字
  8639. resize: "line-line",
  8640. // 左侧盒子的名字
  8641. left: "box-left",
  8642. // 右侧盒子的名字
  8643. right: "box-right",
  8644. // 父级的名字
  8645. box: "box-father",
  8646. },
  8647. otherInfo: {
  8648. // 限制左边栏最低宽度
  8649. leftWidth: 120,
  8650. },
  8651. },
  8652. {
  8653. type: "LR",
  8654. domClass: {
  8655. // 中间分割线的名字
  8656. resize: "line-second",
  8657. // 左侧盒子的名字
  8658. left: "left-laowang",
  8659. // 右侧盒子的名字
  8660. right: "box-second-father",
  8661. // 父级的名字
  8662. box: "grand",
  8663. },
  8664. otherInfo: {
  8665. // 限制左边栏最低宽度
  8666. leftWidth: 120,
  8667. },
  8668. },
  8669. ]);
  8670. }
  8671. };
  8672. </script>
  8673. <style lang="scss" scoped>
  8674. .fillWeekDialogVisiCustom {
  8675. width: 100%;
  8676. height: 70vh;
  8677. }
  8678. .fillWeekCustom {
  8679. .el-dialog__body {
  8680. padding: 20px 20px !important;
  8681. }
  8682. }
  8683. .photos {
  8684. position: relative;
  8685. display: flex;
  8686. flex-wrap: wrap;
  8687. }
  8688. .photos_img {
  8689. width: 120px;
  8690. height: 120px;
  8691. margin-right: 20px;
  8692. margin-bottom: 20px;
  8693. cursor: pointer;
  8694. img {
  8695. width: 100%;
  8696. height: 100%;
  8697. }
  8698. }
  8699. .paginatis {
  8700. padding: 10px 10px;
  8701. background: #f2f2f2;
  8702. }
  8703. .waiting {
  8704. color:orange;
  8705. }
  8706. .filledReportStyle {
  8707. color:#32CD32;
  8708. }
  8709. .RejectStyle {
  8710. color:red;
  8711. }
  8712. .waitSubmitStyle{
  8713. color: #409eff;
  8714. }
  8715. .chooseDate {
  8716. .waiting {
  8717. color: #20a0ff;
  8718. }
  8719. .filledReportStyle {
  8720. color:#20a0ff;
  8721. }
  8722. .RejectStyle {
  8723. color: #20a0ff;
  8724. }
  8725. .waitSubmitStyle{
  8726. color: #20a0ff;
  8727. }
  8728. }
  8729. .allDaily {
  8730. width:100%;
  8731. }
  8732. .report_title {
  8733. padding:10px 0;
  8734. color:#666;
  8735. }
  8736. .clearfix {
  8737. overflow-x: auto;
  8738. white-space: nowrap;
  8739. padding: 15px 0 10px 0;
  8740. // overflow-y: hidden;
  8741. .date_item {
  8742. padding: 0 3px;
  8743. cursor: pointer;
  8744. position: relative;
  8745. }
  8746. .chooseDate {
  8747. position: absolute;
  8748. bottom: -3px;
  8749. width: 37px;
  8750. height: 2px;
  8751. left: 14px;
  8752. background: #20a0ff;
  8753. }
  8754. }
  8755. .one_daily {
  8756. i {
  8757. color: #9ed0ff;
  8758. margin-right: 5px;
  8759. }
  8760. .one_daily_body {
  8761. padding: 10px 0px;
  8762. p {
  8763. margin: 0;
  8764. line-height: 30px;
  8765. }
  8766. }
  8767. ul {
  8768. padding: 0;
  8769. }
  8770. }
  8771. .checkbtn {
  8772. float: right;
  8773. margin-top: -10px;
  8774. }
  8775. .selConStyle{
  8776. margin-top:9rem;
  8777. margin-bottom:11rem;
  8778. .selConStyle_title{
  8779. height: 3rem;
  8780. text-align: center;
  8781. font-size: 17px;
  8782. }
  8783. .el-select{
  8784. margin: 0 15%;
  8785. width: 70%;
  8786. }
  8787. }
  8788. </style>
  8789. <style lang="scss">
  8790. /*去除upload组件过渡效果*/
  8791. .photos .el-upload-list__item {
  8792. transition: none !important;
  8793. }
  8794. .daily {
  8795. .el-card__body {
  8796. height: 80%;
  8797. overflow-y: auto;
  8798. }
  8799. .el-card__header {
  8800. padding: 0 20px;
  8801. }
  8802. }
  8803. .membListClass{
  8804. .el-dialog__body{
  8805. padding-top: 10px;
  8806. }
  8807. }
  8808. // .editReportDialog .el-dialog__footer{
  8809. // position: sticky;
  8810. // bottom: 0;
  8811. // background: #fff;
  8812. // height: 70px;
  8813. // z-index: 1010;
  8814. // }
  8815. .editReportDialog{
  8816. min-width: 800px;
  8817. }
  8818. .touruxiangmu{
  8819. max-width: 1000px;
  8820. }
  8821. </style>
  8822. <style scoped>
  8823. /* 项目标签的样式 */
  8824. .el-tag + .el-tag {
  8825. margin-left: 10px;
  8826. }
  8827. .button-new-tag {
  8828. margin-left: 10px;
  8829. height: 32px;
  8830. line-height: 30px;
  8831. padding-top: 0;
  8832. padding-bottom: 0;
  8833. }
  8834. .input-new-tag {
  8835. width: 90px;
  8836. margin-left: 10px;
  8837. vertical-align: bottom;
  8838. }
  8839. .selectworktime .el-table__fixed-body-wrapper{
  8840. top: 48px !important;
  8841. }
  8842. .selectworktime_export .selectworktime_export_l{
  8843. width: 650px;
  8844. float: left;
  8845. height: 42px;
  8846. }
  8847. .approvalProcessBox{
  8848. margin-left: 30px;
  8849. font-size: 14px;
  8850. line-height: 16px;
  8851. cursor: pointer;
  8852. }
  8853. .approvalProcessBox i {
  8854. margin-right: 0;
  8855. height: 16px;
  8856. width: 16px;
  8857. display: inline-block;
  8858. transform: scale(1.2);
  8859. position: relative;
  8860. top: 0.5px;
  8861. color: #409eff;
  8862. }
  8863. .approvalProcessBox .approvalProcessClick{
  8864. cursor: pointer;
  8865. color: #409eff;
  8866. font-size: 14px;
  8867. }
  8868. .approvalProcessBox:hover .approvalProcessClick{
  8869. color: #3485fb;
  8870. }
  8871. </style>
  8872. <style lang="scss" scoped>
  8873. .bionicClass {
  8874. -webkit-appearance: none;
  8875. background-color: #FFF;
  8876. background-image: none;
  8877. border-radius: 4px;
  8878. border: 1px solid #DCDFE6;
  8879. box-sizing: border-box;
  8880. color: #606266;
  8881. display: inline-block;
  8882. height: 40px;
  8883. line-height: 40px;
  8884. outline: 0;
  8885. padding: 0 15px;
  8886. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8887. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8888. width: 350px;
  8889. cursor: pointer;
  8890. .bionicClassText {
  8891. color: #C0C4CC;
  8892. }
  8893. }
  8894. // 加班样式
  8895. .overtime {
  8896. display: inline-block;
  8897. margin-left: 20px;
  8898. input {
  8899. display: inline-block;
  8900. margin-top: 5px;
  8901. }
  8902. }
  8903. .plus {
  8904. display: inline-block;
  8905. }
  8906. // .tages {
  8907. // float: right;
  8908. // }
  8909. .overtime {
  8910. display: inline-block;
  8911. margin-left: 30px;
  8912. }
  8913. .bloks {
  8914. display: inline-block;
  8915. width: 380px;
  8916. }
  8917. .zhiss {
  8918. display: flex;
  8919. justify-content: space-around;
  8920. align-items: center;
  8921. }
  8922. .zhoFel {
  8923. display: flex;
  8924. justify-content: space-between;
  8925. align-items: center;
  8926. }
  8927. // 左右滑动样式
  8928. .line {
  8929. width: 30px;
  8930. /* height: 500px; */
  8931. background: #f2f2f2;
  8932. cursor: w-resize;
  8933. }
  8934. .box-father {
  8935. border: 8px solid #000;
  8936. }
  8937. .line-second {
  8938. width: 10px;
  8939. /* background: red; */
  8940. }
  8941. .flex {
  8942. display: flex;
  8943. width: 100%;
  8944. }
  8945. .box-left {
  8946. flex: 0 0 400px;
  8947. /* height: 600px; */
  8948. /* background: blue; */
  8949. }
  8950. .box-right {
  8951. /* height: 600px; */
  8952. /* background: green; */
  8953. flex: 1;
  8954. }
  8955. .box-postion {
  8956. width: 200px;
  8957. /* height: 400px; */
  8958. background: #ccc;
  8959. }
  8960. .custom-tree-node {
  8961. flex: 1;
  8962. display: flex;
  8963. align-items: center;
  8964. justify-content: space-between;
  8965. font-size: 14px;
  8966. padding-right: 8px;
  8967. }
  8968. .daitianrbao {
  8969. width: 100%;
  8970. box-sizing: border-box;
  8971. height: 40px;
  8972. border-radius: 4px;
  8973. border: 1px solid #DCDFE6;
  8974. overflow: hidden;
  8975. text-overflow: ellipsis;
  8976. display: flex;
  8977. // align-items: center;
  8978. }
  8979. .daitianrbao .spnn {
  8980. display: inline-block;
  8981. box-sizing: border-box;
  8982. padding: 0 15px;
  8983. overflow: hidden;
  8984. text-overflow: ellipsis;
  8985. }
  8986. .daitianrbao .hover {
  8987. color: #DCDFE6 !important;
  8988. }
  8989. </style>