daily.vue 520 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree class="el-tree-resetStyles" :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="font-size:13px" class="themeFontColor">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  178. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1" style="margin-left:20px;">
  182. <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. <p v-if="item1.attachment != null" >附件
  184. <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
  185. </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  257. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  275. </p>
  276. <!-- 工单号,行号 -->
  277. <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
  278. <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
  279. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  280. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  281. <!-- 自定义日报文本 -->
  282. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  283. <p v-if="user.company.packageEngineering == 1">
  284. {{$t('other.professionalProgress')}}:
  285. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  286. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  287. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhetongguo"></i>
  291. </el-tooltip>
  292. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  293. <i class="iconfont firerock-iconshenhebohui"></i>
  294. </el-tooltip>
  295. </span>
  296. </p>
  297. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  298. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  299. </p>
  300. <div v-if="item2.multiWorktime==0">
  301. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  303. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  304. {{item2.time.toFixed(1)}}h
  305. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  306. </p>
  307. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  308. <span style="margin-right:10px;">{{item2.progress}}%</span>
  309. </p>
  310. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  311. </div>
  312. <div v-if="item2.multiWorktime==1" >
  313. <p>{{$t('other.projectDuration')}}:{{item2.time.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>
  314. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  315. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  316. <p style="display: inline-block;">{{$t('time.duration')}}:
  317. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  318. {{timeItem.time.toFixed(1)}}h
  319. <span v-if="timeItem.detail" style="margin-left:10px;">
  320. {{timeItem.detail}}
  321. </span>
  322. </p>
  323. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  324. </div>
  325. </div>
  326. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  327. <!--照片的显示 -->
  328. <p v-if="item2.pics != null && item2.pics.length > 0">
  329. <el-image v-for="(pic, index) in item2.pics" :key="index"
  330. style="width: 100px; height: 100px; margin-right:10px;"
  331. :src="pic"
  332. :preview-src-list="item2.pics">
  333. </el-image>
  334. </p>
  335. </el-card>
  336. </el-timeline-item>
  337. </el-timeline>
  338. </div>
  339. </div>
  340. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false class="themeFontColor">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  341. <!-- 简陋的无报告提示 -->
  342. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </el-card>
  349. </div>
  350. <!-- 工时推送日志弹窗 -->
  351. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  352. <template>
  353. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  354. </template>
  355. <template>
  356. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  357. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  358. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  359. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  360. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  361. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  362. <template slot-scope="scope">
  363. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  364. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  368. </el-table>
  369. </template>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  372. </span>
  373. </el-dialog>
  374. <!-- 填写日报的dialog -->
  375. <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  376. <div style="height: 65vh;overflow: auto;">
  377. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  378. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  379. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  380. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  381. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  382. <span class="spnn" v-if="workForm.userNames">
  383. <span v-for="(item, index) in workForm.userNames" :key="index">
  384. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  385. <span v-if="index < workForm.userNames.length - 1">,</span>
  386. </span>
  387. </span>
  388. <span class="spnn hover" v-else>
  389. {{$t('defaultText.pleaseSelectAsubstitute')}}
  390. </span>
  391. </div>
  392. </el-form-item>
  393. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  394. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  395. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  396. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  397. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  398. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  399. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  400. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  401. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  402. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  403. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  404. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  405. <!-- AI智能填报 -->
  406. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  407. </el-form-item>
  408. <!--考勤时长显示-->
  409. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh">
  410. <template v-if="user.companyId != 7536">
  411. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  412. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  413. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  414. </span>
  415. </template>
  416. <template v-if="user.companyId == 7536 && workForm.time">
  417. {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  418. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  419. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  420. </template>
  421. <!--批量填报不显示考勤记录-->
  422. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  423. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  424. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  425. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  426. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  427. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  428. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  429. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  430. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  431. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  432. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  433. @click="refreshAttendance(workForm.createDate)"></el-button>
  434. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  435. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  436. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  437. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  438. v-if="!isBatch && user.companyId === 7536" icon="el-icon-refresh"
  439. @click="refreshBeiSengAttendanceTwo(workForm.createDate)"></el-button>
  440. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  441. </el-form-item>
  442. <!-- 000000 -->
  443. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  444. <div v-if="reportTimeType.multiWorktime==0">
  445. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  446. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  447. <el-select v-model="domain.timeType" style="width:200px;"
  448. v-if="reportTimeType.type == 0"
  449. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  450. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  451. @change="onTimeTypeChange(domain.timeType)">
  452. <el-option
  453. v-for="item in timeType"
  454. :key="item.value"
  455. :label="item.label"
  456. :value="item.value">
  457. </el-option>
  458. </el-select>
  459. <!-- 数字时长选择 -->
  460. <el-select v-model="domain.workingTime" style="width:200px;"
  461. v-if="reportTimeType.type == 1"
  462. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  463. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  464. @change="seleChn(0,domain)">
  465. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  466. </el-select>
  467. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  468. <span v-if="reportTimeType.type == 2">
  469. <!--时间范围选择 -->
  470. <el-time-picker
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  472. v-model="domain.startTime"
  473. :placeholder="$t('time.startTime')"
  474. style="width:120px;"
  475. format="HH:mm"
  476. value-format="HH:mm"
  477. :picker-options="{
  478. start: '08:00',
  479. end: '23:30'
  480. }"
  481. @change="iptChang()">
  482. </el-time-picker> - <el-time-picker
  483. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  484. v-model="domain.endTime"
  485. :placeholder="$t('time.endTime')"
  486. style="width:120px;"
  487. format="HH:mm"
  488. value-format="HH:mm"
  489. :picker-options="{
  490. start: '08:00',
  491. end: '23:30',
  492. minTime: domain.startTime
  493. }"
  494. @change="iptChang()">
  495. </el-time-picker>
  496. </span>
  497. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  498. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  499. <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>
  500. </div>
  501. </el-form-item>
  502. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  503. :prop="'domains.' + index + '.reportTargetDeptId'"
  504. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  505. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  506. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  507. <span style="float: left">
  508. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  509. </span>
  510. </el-option>
  511. </el-select>
  512. <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>
  513. </el-form-item>
  514. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  515. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  516. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  517. @change="selectProject(domain, index)"
  518. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  519. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  520. <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">
  521. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  522. <span style="float: right;">{{ item.projectName }}</span>
  523. </el-option>
  524. </el-option-group>
  525. </el-select>
  526. <!--昱众不显示子项目-->
  527. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  528. <span style="margin-left:45px;">
  529. {{$t('lable.subproject')}}</span>
  530. <!--子项目 -->
  531. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  532. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  533. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  534. </el-select>
  535. </template>
  536. <template v-if="user.companyId == yuzhongCompId">
  537. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  538. <!--角色选择 -->
  539. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  540. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  541. <el-option
  542. v-for="item in roleList"
  543. :key="item.value"
  544. :label="item.label"
  545. :value="item.value">
  546. </el-option>
  547. </el-select>
  548. </template>
  549. <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%;"
  550. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  551. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  552. </el-link>
  553. <!-- <el-link type="primary" v-if="canEdit"
  554. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  555. </el-form-item>
  556. <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">
  557. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  558. </el-form-item>
  559. <!--如果设置了工时成本预警的预算成本项-->
  560. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  561. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  562. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  563. </el-select>
  564. </el-form-item>
  565. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  566. <template slot="label">
  567. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  568. <span >{{$t('lable.taskGrouping')}}</span>
  569. </template>
  570. <!-- 任务分组 -->
  571. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  572. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  573. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  574. </el-select>
  575. <template v-if="user.companyId == yuzhongCompId">
  576. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  577. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  578. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  579. <el-option
  580. v-for="item in domain.filteredRespList"
  581. :key="item.id"
  582. :label="item.jobRespon"
  583. :value="item.id">
  584. </el-option>
  585. </el-select>
  586. </template>
  587. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  588. <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>
  589. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  590. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  591. @change="changeStages(domain, index)"
  592. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  593. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  594. </el-select>
  595. </template>
  596. </el-form-item>
  597. <!-- 工单号,行号 -->
  598. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  599. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
  600. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  601. </el-option>
  602. </el-select>
  603. </el-form-item>
  604. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  605. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  606. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  607. </el-option>
  608. </el-select>
  609. </el-form-item>
  610. <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">
  611. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  612. <template slot="label">
  613. <span style="color:#FF0000;">*</span>
  614. <span >{{$t('other.projectAuditor')}}</span>
  615. </template>
  616. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  617. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  618. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  619. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  620. </el-option>
  621. </el-select>
  622. <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>
  623. </el-form-item>
  624. </div>
  625. <el-form-item v-if="user.companyId == yuzhongCompId">
  626. <template slot="label">
  627. <span style="color:#FF0000;">*</span>
  628. <span >{{ $t('gongZuoNeiRong') }}</span>
  629. </template>
  630. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  631. :disabled="(workForm.domains[index].state>=2?false:true)" >
  632. <el-option
  633. v-for="item in domain.workContentList"
  634. :key="item.id"
  635. :label="item.workContext"
  636. :value="item.id">
  637. </el-option>
  638. </el-select>
  639. </el-form-item>
  640. <!-- 111111 -->
  641. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  642. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  643. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  644. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  645. <span v-else>{{item.name}}</span>
  646. </el-option>
  647. </el-select>
  648. <template v-if="user.timeType.auditLevel > 1">
  649. <i class="el-icon-right"></i>
  650. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  651. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  652. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  653. <span v-else>{{item.name}}</span>
  654. </el-option>
  655. </el-select>
  656. </template>
  657. <template v-if="user.timeType.auditLevel > 2">
  658. <i class="el-icon-right"></i>
  659. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  660. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  661. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  662. <span v-else>{{item.name}}</span>
  663. </el-option>
  664. </el-select>
  665. </template>
  666. </el-form-item>
  667. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  668. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  669. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  670. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  671. <span v-else>{{item.name}}</span>
  672. </el-option>
  673. </el-select>
  674. </el-form-item>
  675. <!-- 相关维度/自定义维度 -->
  676. <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'">
  677. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  678. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  679. </el-option>
  680. </el-select>
  681. </el-form-item>
  682. <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'">
  683. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  684. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  685. </el-option>
  686. </el-select>
  687. </el-form-item>
  688. <!-- 相关数值 -->
  689. <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">
  690. <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>
  691. </el-form-item>
  692. <!-- 自定义文本 -->
  693. <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">
  694. <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>
  695. </el-form-item>
  696. <!--按比例填报-->
  697. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  698. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  699. <div style="width:400px;">
  700. <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>
  701. <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>
  702. </div>
  703. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  704. <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>
  705. </div>
  706. </el-form-item>
  707. <!--工程专业版本模式下, 各个专业的进度填报 -->
  708. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  709. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  710. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  711. <el-input size="mini" style="width:60px;" v-model="item.progress"
  712. @keyup.native="onProgressChange"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  714. </span>
  715. </el-form-item>
  716. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  717. <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))" >
  718. <template slot="label" v-if="user.timeType.taskRequired == 1">
  719. <span style="color:#FF0000;">*</span>
  720. <span >{{ $t('other.task') }}</span>
  721. </template>
  722. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  723. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  724. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  725. </el-select>
  726. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  727. </el-form-item>
  728. <!--针对依斯贝的SAP服务-->
  729. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  730. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  731. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  732. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  733. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  734. </el-select>
  735. </el-form-item>
  736. <!--工作事项-->
  737. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  738. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  739. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  740. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  741. </el-form-item>
  742. <!-- 拍照上传 -->
  743. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  744. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  745. <div class="photos">
  746. <div>
  747. <el-upload
  748. list-type="picture-card"
  749. :http-request="(file) => {return addImg(file, index)}"
  750. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  751. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  752. :file-list="domain.imgListUrl" :limit="9"
  753. :disabled="workForm.domains[index].state>=2?false:true">
  754. <i class="el-icon-plus"></i>
  755. </el-upload>
  756. </div>
  757. </div>
  758. </el-form-item>
  759. </div>
  760. <!--多个工作事项填报的情况 -->
  761. <div v-if="reportTimeType.multiWorktime==1">
  762. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  763. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  764. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  765. @change="selectProject(domain, index)"
  766. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  767. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  768. <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">
  769. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  770. <span style="float: right;">{{ item.projectName }}</span>
  771. </el-option>
  772. </el-option-group>
  773. </el-select>
  774. <template v-if="user.timeType.mainProjectState != 1">
  775. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  776. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  777. <!--子项目 -->
  778. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  779. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  780. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  781. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  782. </el-select>
  783. </template>
  784. <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;"
  785. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  786. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  787. </el-link>
  788. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  789. <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>
  790. </div>
  791. <!-- <el-link type="primary" v-if="canEdit"
  792. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  793. </el-form-item>
  794. <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">
  795. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  796. </el-form-item>
  797. <!--如果设置了工时成本预警的预算成本项-->
  798. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  799. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  800. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  801. </el-select>
  802. </el-form-item>
  803. <el-form-item v-if="user.company.packageProject == 1">
  804. <template slot="label">
  805. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  806. <span >{{$t('lable.taskGrouping')}}</span>
  807. </template>
  808. <!-- 任务分组 -->
  809. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  810. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  811. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  812. </el-select>
  813. <!-- 项目的阶段 -->
  814. <span v-if="domain.stages != null && domain.stages.length> 0"
  815. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  816. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  817. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  818. @change="changeStages(domain, index)"
  819. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  820. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  821. </el-select>
  822. </el-form-item>
  823. <el-form-item :label="$t('other.projectAuditor')" >
  824. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  825. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  826. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  827. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  828. </el-option>
  829. </el-select>
  830. <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>
  831. </el-form-item>
  832. <!--工程专业版本模式下, 各个专业的进度填报 -->
  833. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  834. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  835. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  836. <el-input size="mini" style="width:60px;" v-model="item.progress"
  837. @keyup.native="onProgressChange"
  838. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  839. </span>
  840. </el-form-item>
  841. <!-- 相关维度 -->
  842. <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'">
  843. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  844. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  845. </el-option>
  846. </el-select>
  847. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  848. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  849. </el-option>
  850. </el-select>
  851. </el-form-item>
  852. <!-- 相关数值 -->
  853. <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">
  854. <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>
  855. </el-form-item>
  856. <!-- 自定义文本 -->
  857. <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">
  858. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  859. </el-form-item>
  860. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  861. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  862. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  863. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  864. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  865. </el-select>
  866. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  867. </el-form-item>
  868. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  869. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  870. <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>
  871. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  872. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  873. <span v-if="reportTimeType.type == 2">
  874. <!-- <span> -->
  875. <!--时间范围选择 -->
  876. <el-time-picker
  877. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  878. v-model="timeItem.startTime"
  879. :placeholder="$t('time.startTime')"
  880. style="width:120px;"
  881. format="HH:mm"
  882. value-format="HH:mm"
  883. :picker-options="{
  884. start: '00:00',
  885. end: '23:59',
  886. }"
  887. @change="iptChangs()">
  888. </el-time-picker> - <el-time-picker
  889. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  890. v-model="timeItem.endTime"
  891. :placeholder="$t('time.endTime')"
  892. style="width:120px;"
  893. format="HH:mm"
  894. value-format="HH:mm"
  895. :picker-options="{
  896. start: '00:00',
  897. end: '23:59',
  898. minTime: timeItem.startTime
  899. }"
  900. @change="iptChangs()">
  901. </el-time-picker>
  902. </span>
  903. <!--工作细项-->
  904. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0 && user.canFillMoreOption"
  905. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  906. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  907. </el-select>
  908. </el-form-item>
  909. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  910. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  911. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  912. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  913. ></el-input>
  914. </el-form-item>
  915. </div>
  916. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  917. </div>
  918. <!--照片的显示 -->
  919. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  920. <el-image v-for="(pic, index) in domain.pics" :key="index"
  921. style="width: 100px; height: 100px; margin-right:10px;"
  922. :src="pic"
  923. :preview-src-list="domain.pics">
  924. </el-image>
  925. </p>
  926. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  927. </div>
  928. <span id="workFormsItemBottom"></span>
  929. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  930. </el-form>
  931. </div>
  932. <span slot="footer" class="dialog-footer">
  933. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  934. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  935. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  936. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  937. <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>
  938. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  939. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  940. </span>
  941. </el-dialog>
  942. <!-- 按周填报 -->
  943. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  944. <!-- 按周填报-已填工时-点击 -->
  945. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  946. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  947. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  948. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  949. <el-table-column prop="state" :label="$t('state.states')">
  950. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  951. </el-table-column>
  952. </el-table>
  953. <span slot="footer" class="dialog-footer">
  954. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  955. </span>
  956. </el-dialog>
  957. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  958. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  959. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  960. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  961. <span class="spnn" v-if="workForm.userNames">
  962. <span v-for="(item, index) in workForm.userNames" :key="index">
  963. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  964. <span v-if="index < workForm.userNames.length - 1">,</span>
  965. </span>
  966. </span>
  967. <span class="spnn hover" v-else>
  968. {{$t('defaultText.pleaseSelectAsubstitute')}}
  969. </span>
  970. </div>
  971. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  972. </div>
  973. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  974. <el-form-item style="height:30px;margin-top:-72px;">
  975. <!-- <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> -->
  976. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  977. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  978. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  979. <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>
  980. <el-option
  981. v-for="item in fillProjectList"
  982. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  983. :key="item.id"
  984. :label="item.projectName + '\u3000' + item.projectCode"
  985. :value="item.id">
  986. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  987. <span style="float: right">{{ item.projectName }}</span>
  988. </el-option>
  989. </el-select>
  990. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  991. </el-form-item>
  992. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  993. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  994. <template slot-scope="scope">
  995. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  996. </template>
  997. </el-table-column>
  998. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  999. <template slot-scope="scope">
  1000. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  1001. <p v-else></p>
  1002. </template>
  1003. </el-table-column> -->
  1004. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  1005. <template slot-scope="scope">
  1006. <div v-if="scope.row.canFill == 1">
  1007. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  1008. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  1009. <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)" @input="onInputWorkTime(scope.$index)"></el-input-number>
  1010. <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
  1011. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1012. </div>
  1013. </template>
  1014. <template v-else>
  1015. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1016. <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>
  1017. <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>
  1018. <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>
  1019. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1020. </div>
  1021. </template>
  1022. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1023. <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>
  1024. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1025. </div>
  1026. </div>
  1027. <div v-else >
  1028. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1029. </div>
  1030. </template>
  1031. </el-table-column>
  1032. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1033. <template slot-scope="scope">
  1034. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1035. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1036. </span>
  1037. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1038. </template>
  1039. </el-table-column>
  1040. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1041. <template slot-scope="scope">
  1042. <div class="zhiss">
  1043. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1044. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1045. </div>
  1046. </template>
  1047. </el-table-column>
  1048. </el-table>
  1049. </el-form>
  1050. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1051. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1052. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1053. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1054. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1055. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1056. <!--针对景昱,先检查工时是否存在异常-->
  1057. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1058. </span>
  1059. </el-dialog>
  1060. <!-- 重庆物奇私人定制的按周填报 -->
  1061. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1062. <div class="fillWeekDialogVisiCustom">
  1063. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1064. </div>
  1065. </el-dialog>
  1066. <!-- enableNewWeeklyfill==2 -->
  1067. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1068. <div class="fillWeekDialogVisiCustom">
  1069. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1070. </div>
  1071. </el-dialog>
  1072. <!-- 选择时间 -->
  1073. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1074. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1075. <span slot="footer" class="dialog-footer">
  1076. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1077. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1078. </span>
  1079. </el-dialog>
  1080. <!-- 按周填报弹窗 -->
  1081. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1082. <div>
  1083. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1084. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1085. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1086. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1087. </el-select>
  1088. </div>
  1089. <!--如果设置了工时成本预警的预算成本项-->
  1090. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1091. <p>{{$t('lable.budgetSource')}}</p>
  1092. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1093. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1094. </el-select>
  1095. </div>
  1096. <!-- 任务分组 -->
  1097. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1098. <p>{{$t('lable.taskGrouping')}}</p>
  1099. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1100. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1101. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1102. </el-select>
  1103. </div>
  1104. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1105. <p>{{$t('other.inputStage')}}</p>
  1106. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1107. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1108. </el-select>
  1109. </div>
  1110. <!-- 工单号,行号 -->
  1111. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1112. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1113. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1114. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1115. </el-option>
  1116. </el-select>
  1117. </div>
  1118. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1119. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1120. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1121. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1122. </el-option>
  1123. </el-select>
  1124. </div>
  1125. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1126. <p>{{$t('other.reviewer')}}</p>
  1127. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1128. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1129. </el-select>
  1130. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1131. </div>
  1132. <template v-if="user.timeType.reportAuditType == 3">
  1133. <div class="zhoFel">
  1134. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1135. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1136. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1137. </el-select>
  1138. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1139. </div>
  1140. <div class="zhoFel">
  1141. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1142. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1143. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1144. </el-select>
  1145. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1146. </div>
  1147. <div class="zhoFel">
  1148. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1149. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1150. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1151. </el-select>
  1152. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1153. </div>
  1154. <div class="zhoFel">
  1155. <p>{{ $t('chao-song-ren') }}</p>
  1156. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1157. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1158. </el-select>
  1159. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1160. </div>
  1161. </template>
  1162. <!-- 自定义维度 -->
  1163. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1164. <p>{{user.timeType.customDegreeName}}</p>
  1165. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1166. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1167. </el-select>
  1168. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1169. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1170. </el-select>
  1171. </div>
  1172. <!-- 自定义数值 -->
  1173. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1174. <p>{{user.timeType.customDataName}}</p>
  1175. <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>
  1176. </div>
  1177. <!-- 自定义文本 -->
  1178. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1179. <p>{{user.timeType.customTextName}}</p>
  1180. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1181. </div>
  1182. <!-- 选择任务 -->
  1183. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1184. <p>{{ $t('renWuLiChengBei') }}</p>
  1185. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1186. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1187. </el-select>
  1188. </div>
  1189. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1190. <p>{{$t('other.timeSelection')}}</p>
  1191. <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>
  1192. </div>
  1193. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1194. <p>{{$t('other.chooseDuration')}}</p>
  1195. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1196. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1197. </el-select>
  1198. </div>
  1199. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1200. <p>{{$t('lable.percentageOfTime')}}</p>
  1201. <div style="width:400px;display: flex;align-items: center;">
  1202. <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>
  1203. <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>
  1204. </div>
  1205. </div>
  1206. <div class="zhoFel">
  1207. <p>{{$t('other.workMatters')}}</p>
  1208. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1209. </div>
  1210. </div>
  1211. <span slot="footer" class="dialog-footer">
  1212. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1213. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1214. </span>
  1215. </el-dialog>
  1216. <!--导出报表条件选择 -->
  1217. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1218. <el-form ref="form3" :model="exportParam" >
  1219. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1220. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1221. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1222. </el-select>
  1223. </el-form-item>
  1224. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1225. <!-- <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>
  1226. <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> -->
  1227. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1228. </el-form-item>
  1229. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1230. <el-date-picker
  1231. v-model="exportParam.dateRange" :editable="false"
  1232. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1233. :range-separator="$t('other.to')"
  1234. type="daterange"
  1235. :start-placeholder="$t('time.startDate')"
  1236. :end-placeholder="$t('time.endDate')"
  1237. ></el-date-picker>
  1238. </el-form-item>
  1239. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1240. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1241. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1242. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1243. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1244. </el-select>
  1245. </el-form-item>
  1246. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1247. <div class="exportReportRadio">
  1248. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1249. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1250. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1251. <i class="el-icon-question"></i>
  1252. </el-tooltip>
  1253. </div>
  1254. </el-form-item>
  1255. </el-form>
  1256. <div slot="footer" class="dialog-footer">
  1257. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1258. </div>
  1259. </el-dialog>
  1260. <!--导出报表条件选择 -->
  1261. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1262. <el-form ref="form3" :model="exportParam" >
  1263. <el-form-item prop="range" :label="$t('time.dateRange')">
  1264. <el-date-picker
  1265. v-model="exportParam.dateRange" :editable="false"
  1266. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1267. :clearable="true"
  1268. :range-separator="$t('other.to')"
  1269. type="daterange"
  1270. :start-placeholder="$t('time.startDate')"
  1271. :end-placeholder="$t('time.endDate')"
  1272. ></el-date-picker>
  1273. </el-form-item>
  1274. </el-form>
  1275. <div slot="footer" class="dialog-footer">
  1276. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1277. </div>
  1278. </el-dialog>
  1279. <!--人员列表 -->
  1280. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1281. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1282. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1283. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1284. <el-table-column type="selection"></el-table-column>
  1285. <el-table-column prop="label" :label="$t('lable.name')" >
  1286. <template slot-scope="scope">
  1287. <span>
  1288. <!-- {{(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}} -->
  1289. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1290. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1291. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1292. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1293. </span>
  1294. <span v-else>
  1295. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1296. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1297. </span>
  1298. </span>
  1299. </template>
  1300. </el-table-column>
  1301. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1302. <template slot-scope="scope">
  1303. <div>
  1304. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1305. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1306. </div>
  1307. </template>
  1308. </el-table-column>
  1309. </el-table>
  1310. </el-tab-pane>
  1311. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1312. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1313. <el-table-column prop="label" :label="$t('lable.name')" >
  1314. <template slot-scope="scope">
  1315. <!-- <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> -->
  1316. <!-- <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> -->
  1317. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1318. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1319. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1320. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1321. </span>
  1322. <span v-else>
  1323. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1324. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1325. </span>
  1326. </template>
  1327. </el-table-column>
  1328. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1329. <template slot-scope="scope">
  1330. <div>
  1331. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1332. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1333. </div>
  1334. </template>
  1335. </el-table-column>
  1336. </el-table>
  1337. </el-tab-pane>
  1338. </el-tabs>
  1339. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1340. <el-table-column type="selection"></el-table-column>
  1341. <el-table-column prop="label" :label="$t('lable.name')" >
  1342. <template slot-scope="scope">
  1343. <div>
  1344. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1345. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1346. </div>
  1347. </template>
  1348. </el-table-column>
  1349. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1350. <template slot-scope="scope">
  1351. <div>
  1352. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1353. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1354. </div>
  1355. </template>
  1356. </el-table-column>
  1357. </el-table>
  1358. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1359. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1360. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1361. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1362. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1363. </div>
  1364. </el-dialog>
  1365. <!-- 日报审核修改 -->
  1366. <el-dialog
  1367. :title="$t('riBaoShenHeXiuGai')"
  1368. :visible.sync="reportLogCheckDialog"
  1369. width="30%"
  1370. :before-close="handleClose">
  1371. <el-form ref="form3" :model="exportReportLogParam" >
  1372. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1373. <el-date-picker
  1374. v-model="exportReportLogParam.dateRange" :editable="false"
  1375. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1376. :range-separator="$t('other.to')"
  1377. type="daterange"
  1378. :start-placeholder="$t('time.startDate')"
  1379. :end-placeholder="$t('time.endDate')"
  1380. ></el-date-picker>
  1381. </el-form-item>
  1382. </el-form>
  1383. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1384. <br>
  1385. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1386. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1387. <span slot="footer" class="dialog-footer">
  1388. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1389. </span>
  1390. </el-dialog>
  1391. <!-- 按部门选择人员 -->
  1392. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1393. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1394. <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)">
  1395. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1396. </el-input>
  1397. <div class="tree" style="height:400px">
  1398. <el-scrollbar style="height:100%">
  1399. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1400. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1401. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1402. <span class="custom-tree-node" slot-scope="{ node }">
  1403. <span v-if="user.userNameNeedTranslate == '1'">
  1404. <span v-if="node.data.children">
  1405. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1406. </span>
  1407. <span v-else>
  1408. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1409. </span>
  1410. </span>
  1411. <span v-if="user.userNameNeedTranslate != '1'">
  1412. {{ node.label }}
  1413. </span>
  1414. <!-- {{ node.label }} -->
  1415. </span>
  1416. </el-tree>
  1417. </el-scrollbar>
  1418. </div>
  1419. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1420. <div slot="footer" class="dialog-footer">
  1421. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1422. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1423. </div>
  1424. </el-dialog>
  1425. <el-dialog
  1426. v-if="monthWorkTimeDialog"
  1427. :visible.sync="monthWorkTimeDialog"
  1428. :close-on-click-modal="false"
  1429. customClass="customWidth selectworktime"
  1430. width="92%"
  1431. top="60px"
  1432. >
  1433. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1434. <el-tabs v-model="activeName" @tab-click="handleClick">
  1435. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1436. <div class="selectworktime_export" style="margin-top:10px;">
  1437. <div class="selectworktime_export_l">
  1438. <el-date-picker
  1439. class="selecteworktime_datapick"
  1440. v-model="WorktimeDatepickValue"
  1441. value-format="yyyy-MM-dd"
  1442. type="daterange"
  1443. align="right"
  1444. unlink-panels
  1445. :range-separator="$t('other.to')"
  1446. :start-placeholder="$t('time.startDate')"
  1447. :end-placeholder="$t('time.endDate')"
  1448. :default-time="['12:00:00', '12:00:00']"
  1449. size="small"
  1450. popper-class="selecteorktime_datapick_popper"
  1451. @change="showMonthWorkTime()"
  1452. >
  1453. </el-date-picker>
  1454. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1455. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1456. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1457. <!-- 222 -->
  1458. </div>
  1459. <div>
  1460. <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>
  1461. <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>
  1462. <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">
  1463. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1464. </el-input>
  1465. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1466. </div>
  1467. <div style="float: left; height:32px; padding-top:10px;">
  1468. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1469. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1470. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1471. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1472. </div>
  1473. <div style="float: right; vertical-align: middle;height:32px">
  1474. <el-link
  1475. type="primary"
  1476. @click="exportMembWorkHours()"
  1477. >{{$t('export.exportData')}}</el-link
  1478. >
  1479. </div>
  1480. </div>
  1481. <el-table ref="hasworkTbl"
  1482. :data="monthWorkDataS"
  1483. v-el-table-infinite-scroll="listScroll"
  1484. border
  1485. :height="'70vh'"
  1486. highlight-current-row
  1487. style="width: 100%"
  1488. v-loading="tbload"
  1489. :lazy="true"
  1490. :cell-style="hasworkTblCellStyle"
  1491. >
  1492. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1493. <template slot-scope="scope">
  1494. {{ scope.$index + 1 }}
  1495. </template>
  1496. </el-table-column>
  1497. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1498. <template slot-scope="scope">
  1499. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1500. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1501. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1502. <!-- {{scope.row.name}} -->
  1503. </span>
  1504. </template>
  1505. </el-table-column>
  1506. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1507. <template slot-scope="scope">
  1508. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1509. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1510. </template>
  1511. </el-table-column>
  1512. <el-table-column
  1513. min-width="60"
  1514. v-for="(item, index) in pickDateArray"
  1515. :key="index"
  1516. :label="item"
  1517. align="center"
  1518. >
  1519. <template slot="header" slot-scope="scope">
  1520. <div>{{ scope.column.label.dateStr }}</div>
  1521. <div>{{ scope.column.label.weekStr }}</div>
  1522. </template>
  1523. <template slot-scope="scope">
  1524. <div
  1525. v-if="
  1526. scope.row.worktimeList.filter(
  1527. (w) =>
  1528. w.createDate==item.date
  1529. ).length > 0 &&
  1530. scope.row.worktimeList.filter(
  1531. (w) =>w.createDate==item.date
  1532. )[0].workingTime < reportTimeType.allday
  1533. "
  1534. >
  1535. {{
  1536. scope.row.worktimeList.filter(
  1537. (w) =>w.createDate==item.date
  1538. )[0].workingTime.toFixed(1)
  1539. }}
  1540. </div>
  1541. <div
  1542. v-if="
  1543. scope.row.worktimeList.filter(
  1544. (w) =>w.createDate==item.date
  1545. ).length > 0 &&
  1546. scope.row.worktimeList.filter(
  1547. (w) =>w.createDate==item.date
  1548. )[0].workingTime > reportTimeType.allday
  1549. "
  1550. >
  1551. {{
  1552. scope.row.worktimeList.filter(
  1553. (w) =>w.createDate==item.date
  1554. )[0].workingTime.toFixed(1)
  1555. }}
  1556. </div>
  1557. <div
  1558. v-if="
  1559. scope.row.worktimeList.filter(
  1560. (w) =>w.createDate==item.date
  1561. ).length > 0 &&
  1562. scope.row.worktimeList.filter(
  1563. (w) =>w.createDate==item.date
  1564. )[0].workingTime == reportTimeType.allday
  1565. "
  1566. >
  1567. {{
  1568. scope.row.worktimeList.filter(
  1569. (w) =>w.createDate==item.date
  1570. )[0].workingTime
  1571. }}
  1572. </div>
  1573. <div
  1574. v-if="
  1575. scope.row.worktimeList.filter(
  1576. (w) =>w.createDate==item.date
  1577. ).length == 0
  1578. "
  1579. >
  1580. 0
  1581. </div>
  1582. <div
  1583. v-if="
  1584. scope.row.worktimeList.filter(
  1585. (w) =>w.createDate==item.date
  1586. ).length > 0 &&
  1587. typeof scope.row.worktimeList.filter(
  1588. (w) =>w.createDate==item.date
  1589. )[0].workingTime == 'string'
  1590. "
  1591. >
  1592. {{
  1593. scope.row.worktimeList.filter(
  1594. (w) =>w.createDate==item.date
  1595. )[0].workingTime
  1596. }}
  1597. </div>
  1598. </template>
  1599. </el-table-column>
  1600. </el-table>
  1601. <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>
  1602. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1603. </el-tab-pane>
  1604. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1605. <div class="selectworktime_export" style="margin-top:10px">
  1606. <div class="selectworktime_export_l">
  1607. <el-date-picker
  1608. class="selecteworktime_datapick"
  1609. v-model="WorktimeDatepickValue"
  1610. value-format="yyyy-MM-dd"
  1611. type="daterange"
  1612. align="right"
  1613. unlink-panels
  1614. :range-separator="$t('other.to')"
  1615. :start-placeholder="$t('time.startDate')"
  1616. :end-placeholder="$t('time.endDate')"
  1617. :default-time="['12:00:00', '12:00:00']"
  1618. size="small"
  1619. popper-class="selecteorktime_datapick_popper"
  1620. @change="showMonthNotWorkTime()"
  1621. >
  1622. </el-date-picker>
  1623. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1624. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1625. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1626. </div>
  1627. <div>
  1628. <div style="margin-top:10px;">
  1629. <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>
  1630. <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>
  1631. <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">
  1632. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1633. </el-input>
  1634. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1635. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1636. <el-link
  1637. type="primary"
  1638. style="float: right; vertical-align: middle;height:32px"
  1639. @click="exportMembNotWorkHours()"
  1640. >{{$t('export.exportData')}}</el-link
  1641. >
  1642. </div>
  1643. </div>
  1644. </div>
  1645. <el-table
  1646. ref="hasworkTbl2"
  1647. :data="monthNotWorkDateS"
  1648. v-el-table-infinite-scroll="notListScroll"
  1649. border
  1650. :height="'70vh'"
  1651. highlight-current-row
  1652. style="width: 100%"
  1653. v-loading="tbload"
  1654. lazy
  1655. >
  1656. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1657. <template slot-scope="scope">
  1658. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1659. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1660. </template>
  1661. </el-table-column>
  1662. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1663. <template slot-scope="scope">
  1664. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1665. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1666. </template>
  1667. </el-table-column>
  1668. <el-table-column
  1669. min-width="200"
  1670. :label="$t('weekDay.date')"
  1671. align="center"
  1672. prop="createDate"
  1673. >
  1674. </el-table-column>
  1675. <el-table-column
  1676. min-width="200"
  1677. :label="$t('state.states')"
  1678. align="center"
  1679. prop="status"
  1680. />
  1681. <el-table-column
  1682. min-width="200"
  1683. :label="$t('other.attendanceData')"
  1684. prop="cardTime"
  1685. align="center"
  1686. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1687. </el-table>
  1688. <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>
  1689. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1690. </el-tab-pane>
  1691. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="(user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1) && user.companyId!=5978">
  1692. <div class="selectworktime_export" style="margin-top:10px">
  1693. <div class="selectworktime_export_l">
  1694. <el-date-picker
  1695. class="selecteworktime_datapick"
  1696. v-model="notfullSelectDateMonth"
  1697. value-format="yyyy-MM"
  1698. type="month"
  1699. align="right"
  1700. unlink-panels
  1701. size="small"
  1702. popper-class="selecteorktime_datapick_popper"
  1703. @change="showReportTimeLessThanCardTimeList()"
  1704. >
  1705. </el-date-picker>
  1706. </div>
  1707. <div>
  1708. <div style="margin-top:10px;">
  1709. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showReportTimeLessThanCardTimeList()"></el-cascader>
  1710. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'17'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1711. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(2)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1712. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1713. </el-input>
  1714. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1715. <div style="float: right; vertical-align: middle;height:32px">
  1716. <el-link v-if="user.companyId==7536" style="margin-right: 14px"
  1717. type="primary" v-loading="refreshAttendanceLoading"
  1718. @click="refreshAttendanceCli()" >刷新考勤</el-link>
  1719. <el-link
  1720. type="primary" v-loading="remindering"
  1721. @click="batchRejectAndRemind()" >一键驳回并提醒</el-link>
  1722. <!-- <el-link
  1723. type="primary"
  1724. @click="exportMembWorkHoursReminder()"
  1725. >{{$t('export.exportData')}}</el-link> -->
  1726. </div>
  1727. <!-- <el-link
  1728. type="primary"
  1729. style="float: right; vertical-align: middle;height:32px"
  1730. @click="exportMembNotWorkHours()"
  1731. >{{$t('export.exportData')}}</el-link
  1732. > -->
  1733. </div>
  1734. </div>
  1735. </div>
  1736. <el-table
  1737. ref="hasworkTbl4"
  1738. :data="notFullData"
  1739. border
  1740. :height="'70vh'"
  1741. highlight-current-row
  1742. style="width: 100%"
  1743. v-loading="tbload"
  1744. lazy
  1745. >
  1746. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1747. <template slot-scope="scope">
  1748. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1749. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1750. </template>
  1751. </el-table-column>
  1752. <el-table-column
  1753. min-width="200"
  1754. :label="$t('weekDay.date')"
  1755. align="center"
  1756. prop="createDate"
  1757. >
  1758. </el-table-column>
  1759. <el-table-column
  1760. min-width="200"
  1761. :label="$t('fillReportTime')"
  1762. align="center"
  1763. prop="reportTime"
  1764. />
  1765. <el-table-column
  1766. min-width="200"
  1767. :label="$t('workAttendance')"
  1768. prop="workHours"
  1769. align="center"></el-table-column>
  1770. </el-table>
  1771. </el-tab-pane>
  1772. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1773. <div class="selectworktime_export" style="margin-top:10px;">
  1774. <div class="selectworktime_export_l">
  1775. <el-date-picker
  1776. class="selecteworktime_datapick"
  1777. v-model="WorktimeDatepickValue"
  1778. value-format="yyyy-MM-dd"
  1779. type="daterange"
  1780. align="right"
  1781. unlink-panels
  1782. :range-separator="$t('other.to')"
  1783. :start-placeholder="$t('time.startDate')"
  1784. :end-placeholder="$t('time.endDate')"
  1785. :default-time="['12:00:00', '12:00:00']"
  1786. size="small"
  1787. popper-class="selecteorktime_datapick_popper"
  1788. @change="showMonthWorkTimeReminder()"
  1789. >
  1790. </el-date-picker>
  1791. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1792. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1793. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1794. </div>
  1795. <div>
  1796. <div style="margin-top:10px;">
  1797. <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>
  1798. <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>
  1799. <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">
  1800. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1801. </el-input>
  1802. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1803. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1804. </div>
  1805. </div>
  1806. <div style="float: right; vertical-align: middle;height:32px">
  1807. <el-link
  1808. type="primary" v-loading="remindering"
  1809. @click="changeReminder()"
  1810. >{{ $t('bianGengTiXing') }}</el-link>
  1811. <el-link
  1812. type="primary"
  1813. @click="exportMembWorkHoursReminder()"
  1814. >{{$t('export.exportData')}}</el-link>
  1815. </div>
  1816. </div>
  1817. <el-table ref="hasworkTbl"
  1818. :data="monthWorkDataS"
  1819. v-el-table-infinite-scroll="listScroll"
  1820. border
  1821. :height="'70vh'"
  1822. highlight-current-row
  1823. style="width: 100%"
  1824. v-loading="tbload"
  1825. :lazy="true"
  1826. >
  1827. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1828. <template slot-scope="scope">
  1829. {{ scope.row.createDate}}
  1830. </template>
  1831. </el-table-column>
  1832. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1833. <template slot-scope="scope">
  1834. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1835. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1836. <!-- {{scope.row.name}} -->
  1837. </template>
  1838. </el-table-column>
  1839. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1840. <template slot-scope="scope">
  1841. {{scope.row.invokeValue}}
  1842. </template>
  1843. </el-table-column>
  1844. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1845. <template slot-scope="scope">
  1846. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1847. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1848. </template>
  1849. </el-table-column>
  1850. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1851. <template slot-scope="scope">
  1852. {{ scope.row.workingTime}}
  1853. </template>
  1854. </el-table-column>
  1855. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1856. <template slot-scope="scope">
  1857. {{ scope.row.cardTime}}
  1858. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1859. </template>
  1860. </el-table-column>
  1861. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1862. <template slot-scope="scope">
  1863. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1864. </template>
  1865. </el-table-column>
  1866. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1867. <template slot-scope="scope">
  1868. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1869. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1870. </template>
  1871. </el-table-column>
  1872. </el-table>
  1873. <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>
  1874. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1875. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1876. <label style="font-size: 16px">员工每日已填报工时数</label>
  1877. <el-link
  1878. type="primary"
  1879. style="float: right; margin-right: 60px"
  1880. @click="exportMembWorkHours()"
  1881. >导出已填报数据</el-link
  1882. > -->
  1883. <!-- <el-button >导出</el-button> -->
  1884. <!-- </div> -->
  1885. </el-tab-pane>
  1886. </el-tabs>
  1887. </el-dialog>
  1888. <!--驳回弹出框 -->
  1889. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1890. <div>
  1891. <span style="color:red;">*</span><el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
  1892. </div>
  1893. <div slot="footer" class="dialog-footer">
  1894. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1895. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1896. </div>
  1897. </el-dialog>
  1898. <!-- 通过弹出框 -->
  1899. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1900. <div>
  1901. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1902. </div>
  1903. <div slot="footer" class="dialog-footer">
  1904. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1905. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1906. </div>
  1907. </el-dialog>
  1908. <!--批量导入日报 -->
  1909. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1910. <p>1. {{$t('other.download')}}
  1911. <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>
  1912. </p>
  1913. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1914. <p style="display: flex;justify-content: center;">
  1915. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1916. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1917. </el-upload>
  1918. </p>
  1919. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1920. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1921. </div>
  1922. </el-dialog>
  1923. <!-- 工时导入记录弹窗 -->
  1924. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1925. <div style="height: 452px">
  1926. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1927. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1928. <el-table-column prop="userName" :label="$t('other.operator')">
  1929. <template slot-scope="scope">
  1930. <div>
  1931. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1932. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1933. </div>
  1934. </template>
  1935. </el-table-column>
  1936. <el-table-column prop="datel" :label="$t('other.document')">
  1937. <template slot-scope="scope">
  1938. <div>
  1939. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1940. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1941. </div>
  1942. </template>
  1943. </el-table-column>
  1944. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1945. <template slot-scope="scope">
  1946. <div>
  1947. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1948. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1949. </div>
  1950. </template>
  1951. </el-table-column>
  1952. </el-table>
  1953. <el-col :span="24" class="paginatis">
  1954. <el-pagination
  1955. @size-change="handleSizeChange"
  1956. @current-change="handleCurrentChange"
  1957. :page-sizes="[20 , 50 , 80 , 100]"
  1958. :page-size="20"
  1959. layout="total, sizes, prev, pager, next"
  1960. :total="toViewForm.total"
  1961. style="float:right;"
  1962. ></el-pagination>
  1963. </el-col>
  1964. </div>
  1965. </el-dialog>
  1966. <!--基于企业微信考勤数据的工时导入 -->
  1967. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1968. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1969. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1970. </el-step>
  1971. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1972. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1973. </el-steps>
  1974. <div v-if="active==0" style="padding:30px;height:360px;">
  1975. <div style="margin-top:50px;margin-left:280px;">
  1976. <el-date-picker
  1977. v-model="importWxParam.date" :editable="false"
  1978. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1979. :clearable="true"
  1980. :range-separator="$t('other.to')"
  1981. type="daterange"
  1982. :start-placeholder="$t('time.startDate')"
  1983. :end-placeholder="$t('time.endDate')"
  1984. @change="loadCheckInData"
  1985. ></el-date-picker>
  1986. </div>
  1987. </div>
  1988. <div v-if="active==1" style="padding:10px;">
  1989. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1990. style="width: 100%;margin-top:5px;" >
  1991. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1992. <template slot-scope="scope">
  1993. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1994. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1995. </template>
  1996. </el-table-column>
  1997. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1998. </el-table-column>
  1999. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  2000. <el-table-column prop="username" :label="$t('screening.employeename')" >
  2001. <template slot-scope="scope">
  2002. <div>
  2003. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2004. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2005. </div>
  2006. </template>
  2007. </el-table-column>
  2008. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  2009. <template slot-scope="scope">
  2010. <div>
  2011. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  2012. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  2013. </div>
  2014. </template>
  2015. </el-table-column>
  2016. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  2017. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  2018. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  2019. <template slot-scope="scope">
  2020. {{scope.row.workHours.toFixed(1)}}h
  2021. </template>
  2022. </el-table-column>
  2023. </el-table>
  2024. </div>
  2025. <div v-if="active==2" >
  2026. <p style="display: flex;justify-content: center;height:390px;">
  2027. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2028. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2029. </el-upload>
  2030. </p>
  2031. </div>
  2032. <div slot="title">
  2033. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2034. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2035. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2036. <el-link v-if="active==0 && ((showHidden && user.companyId == 469) || user.companyId == 7703 || user.companyId == 7544) && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2037. <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>
  2038. <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>
  2039. </div>
  2040. <span slot="footer">
  2041. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2042. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2043. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2044. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2045. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2046. </span>
  2047. </el-dialog>
  2048. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2049. <p style="display: flex;justify-content: center;height:100px;">
  2050. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2051. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2052. </el-upload>
  2053. </p>
  2054. </el-dialog>
  2055. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2056. <div>
  2057. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2058. v-model="deleteReportParam.date" :editable="false"
  2059. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2060. :clearable="true"
  2061. :range-separator="$t('other.to')"
  2062. type="daterange"
  2063. :start-placeholder="$t('time.startDate')"
  2064. :end-placeholder="$t('time.endDate')"
  2065. ></el-date-picker>
  2066. </div>
  2067. <div style="margin-top:10px;">
  2068. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2069. <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>
  2070. <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>
  2071. </div>
  2072. <div style="margin-top:10px;">
  2073. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2074. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2075. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2076. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2077. <span v-else>{{item.name}}</span>
  2078. </el-option>
  2079. </el-select>
  2080. </div>
  2081. <span slot="footer">
  2082. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2083. </span>
  2084. </el-dialog>
  2085. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2086. <div>
  2087. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2088. v-model="deleteReportParam.date" :editable="false"
  2089. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2090. :clearable="true"
  2091. :range-separator="$t('other.to')"
  2092. type="daterange"
  2093. :start-placeholder="$t('time.startDate')"
  2094. :end-placeholder="$t('time.endDate')"
  2095. ></el-date-picker>
  2096. </div>
  2097. <div style="margin-top:15px;">
  2098. <span>{{ $t('other.selectdepartment') }}:</span>
  2099. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2100. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2101. size="small" v-if="user.userNameNeedTranslate != 1"
  2102. ></el-cascader>
  2103. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2104. </div>
  2105. <span slot="footer">
  2106. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2107. </span>
  2108. </el-dialog>
  2109. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2110. <div>
  2111. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2112. v-model="modImportTime"
  2113. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2114. :clearable="true"
  2115. type="datetime"
  2116. ></el-date-picker>
  2117. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2118. v-model="modImportUserId"
  2119. >
  2120. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2121. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2122. <span v-else>{{item.name}}</span>
  2123. </el-option>
  2124. </el-select>
  2125. </div>
  2126. <span slot="footer">
  2127. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2128. </span>
  2129. </el-dialog>
  2130. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2131. <div>
  2132. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2133. <el-date-picker
  2134. v-model="ratioYmonth" :editable="false"
  2135. format="yyyyMM" value-format="yyyyMM"
  2136. type="month"
  2137. ></el-date-picker>
  2138. </div>
  2139. <span slot="footer">
  2140. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2141. </span>
  2142. </el-dialog>
  2143. <!--工时批量代填 -->
  2144. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2145. <div>
  2146. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2147. v-model="importWxParam.date" :editable="false"
  2148. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2149. :clearable="true"
  2150. :range-separator="$t('other.to')"
  2151. type="daterange"
  2152. :start-placeholder="$t('time.startDate')"
  2153. :end-placeholder="$t('time.endDate')"
  2154. @change="loadCheckInData"
  2155. ></el-date-picker>
  2156. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2157. </div>
  2158. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2159. :key="timeStamp"
  2160. style="width: 100%;margin-top:5px;" ref="tab">
  2161. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2162. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2163. <template slot-scope="scope">
  2164. <div>
  2165. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2166. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2167. </div>
  2168. </template>
  2169. </el-table-column>
  2170. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2171. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2172. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2173. <template slot-scope="scope">
  2174. {{scope.row.workHours.toFixed(1)}}h
  2175. </template>
  2176. </el-table-column>
  2177. <!--项目名称列表 -->
  2178. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2179. <template slot-scope="scope">
  2180. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2181. </template>
  2182. </el-table-column>
  2183. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2184. <template slot-scope="scope">
  2185. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2186. </template>
  2187. </el-table-column>
  2188. </el-table>
  2189. </el-dialog>
  2190. <!--基于企业微信考勤数据的工时导入 -->
  2191. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2192. <div style="padding-bottom:10px;">
  2193. <p>{{importResultMsg}}</p>
  2194. </div>
  2195. <!-- <span slot="footer" class="dialog-footer">
  2196. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2197. </span> -->
  2198. </el-dialog>
  2199. <!-- 审核流程展示 -->
  2200. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2201. <div style="padding:20px 40px 20px 0">
  2202. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2203. <el-step title="待提交"></el-step>
  2204. <el-step title="员工提交"></el-step>
  2205. <el-step title="审核通过"></el-step>
  2206. </el-steps>
  2207. <el-divider v-if="user.companyId == 7544"></el-divider>
  2208. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2209. <el-timeline :reverse="false" style="margin-top:10px;">
  2210. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2211. <!-- {{item.msg}} -->
  2212. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2213. <span v-if="user.userNameNeedTranslate == 1">
  2214. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2215. <span>{{item.msgCon.two}}</span>
  2216. </span>
  2217. </el-timeline-item>
  2218. </el-timeline>
  2219. </div>
  2220. </el-dialog>
  2221. <!-- 威派格定制 -->
  2222. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2223. </section>
  2224. </template>
  2225. <script>
  2226. // 左右滑动
  2227. import dragMixin from "@/common/js/tensile.js";
  2228. import util from "../../common/js/util";
  2229. // 自定义select组件
  2230. import selectCat from "@/components/select.vue"
  2231. // 引入自定义级联组件
  2232. import vueCascader from "@/components/cascader.vue"
  2233. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2234. // 重庆物奇定制组件
  2235. import WeeklyCustomization from "./weeklyCustomization.vue"
  2236. // 威派格定制转移工时
  2237. import TransferWorkingHours from "./transferWorkingHours.vue"
  2238. // 新的按周填报
  2239. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2240. import { mapMutations } from 'vuex'
  2241. let _that = this
  2242. export default {
  2243. mixins: [dragMixin],
  2244. components: {
  2245. selectCat,
  2246. vueCascader,
  2247. WeeklyCustomization,
  2248. vueMultipleDept,
  2249. TransferWorkingHours,
  2250. NewWeeklyCustomization
  2251. },
  2252. data() {
  2253. return {
  2254. remindering: false,
  2255. onlyHaveAttendance: false,
  2256. notFullData:[],
  2257. notFullOriginList:[],
  2258. singleDate:1,
  2259. subFillProjectList:[],
  2260. curAuditNode: 1,
  2261. refreshingTime: false,
  2262. substitudeStep: 1,
  2263. showHidden: false,
  2264. pageIndex: 0,
  2265. hasMore: true,
  2266. exportType: 0,
  2267. exportingData: false,
  2268. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2269. jobResponseList:[],
  2270. yisibeiCompId: 3092,
  2271. yuzhongCompId: 3385,
  2272. mingyiName : '成都明夷电子科技有限公司',
  2273. // mingyiName : '明夷',
  2274. modItemDataId: null,
  2275. modImportTime: null,
  2276. modImportUserId: null,
  2277. showModImportTimeDialog: false,
  2278. showBatchSimpleApproveReport: false,
  2279. startDeleting: false,
  2280. showBatchDeleteReport: false,
  2281. deleteReportParam: {date:null, userIds:[]},
  2282. isDenying: false,
  2283. targetWeekDate: null,//填写周报中的周日期
  2284. importCardTimeVisi: false,
  2285. startRatioExporting: false,
  2286. exportUserRatio: false,
  2287. ratioYmonth:null,
  2288. hasWrittenReport: false,
  2289. today:null,
  2290. syncTimeLoading: false,
  2291. seluserText: '',
  2292. translation: '1', // 1、文字, 2、部门, 3、人员
  2293. exportLoad: false,
  2294. getPickerOptions: {
  2295. disabledDate: (time) => {
  2296. var date = new Date();
  2297. var year = date.getFullYear();
  2298. var month = date.getMonth() + 1;
  2299. if (month >= 1 && month <= 9) {
  2300. month = "0" + month;
  2301. }
  2302. var currentdate = year.toString() + month.toString();
  2303. var timeyear = time.getFullYear();
  2304. var timemonth = time.getMonth() + 1;
  2305. if (timemonth >= 1 && timemonth <= 9) {
  2306. timemonth = "0" + timemonth;
  2307. }
  2308. var timedate = timeyear.toString() + timemonth.toString();
  2309. if(this.user.timeType.fillAhead == 0){
  2310. return currentdate < timedate;
  2311. }else{
  2312. return false
  2313. }
  2314. }
  2315. },
  2316. alalal: '8.0',
  2317. timeBasecostList:null,
  2318. tbload: false,
  2319. exportTimeDialog: false,
  2320. searchKeyword: '',
  2321. monthWorkDataS: [],
  2322. monthNotWorkDateS: [],
  2323. pickDateArray:[],
  2324. WorktimeDatepickValue: [],
  2325. activeName:"first",
  2326. isLeave: 0,
  2327. submitingReport: false,
  2328. importResultMsg:null,
  2329. showImportResult:false,
  2330. importingData: false,
  2331. isDraft: 0,
  2332. timeStamp: 0,
  2333. projectColumns:[],
  2334. checkinLoading:false,
  2335. importWxParam:{date:null,},
  2336. active:0,
  2337. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2338. importWxDialog:false,
  2339. importDialog:false,
  2340. denyForm:null,
  2341. denyReasonDialog:false,
  2342. monthWorkTimeDialog: false,
  2343. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2344. isSubstitude:false,
  2345. isFill:false,
  2346. unFillList:[],
  2347. fillList:[],
  2348. fillMembList:[],
  2349. fillMembList_leave: [],
  2350. membListVisible: false,
  2351. isBatch:0,//是否是批量填报
  2352. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2353. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2354. 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')],
  2355. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2356. fillStatusList: [],
  2357. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2358. exportReportLogParam:{dateRange:[]},
  2359. exportDialog:false,
  2360. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2361. subProjectList:[],
  2362. canEdit: true,
  2363. originCanEdit: true,
  2364. 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],
  2365. selectTime:null,
  2366. reportTimeType:{},
  2367. curDate:'',
  2368. isAllSelect: false,
  2369. approveDialogVisible:false,
  2370. deptId:null,
  2371. targetUid: null,
  2372. membCount:0,
  2373. selectState:"-1",
  2374. user: JSON.parse(sessionStorage.getItem("user")),
  2375. allUsersList: [],
  2376. showAddMore:false,
  2377. allDate: [],
  2378. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2379. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2380. choseDay: 0,
  2381. tableHeight: 0,
  2382. listLoading: false,
  2383. projectList: [], //项目列表
  2384. fillProjectList: [],
  2385. reportList: [], //日报列表
  2386. reportNames:[], //批量审批列表
  2387. selCon:[], //筛选条件
  2388. selProjectList:[], //筛选后项目列表
  2389. selConShow: true,
  2390. usersList: [], // 全部人员列表
  2391. usersListId: '', // 选中的人员id
  2392. dialogVisible: false, //项目弹窗
  2393. report: '',
  2394. workForm: {
  2395. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2396. domains: [{
  2397. id: null,
  2398. projectId: "",
  2399. workingTime: "",
  2400. timeType:0,
  2401. content: "",
  2402. state: 2,
  2403. multiWorktime:0,
  2404. worktimeList:[],
  2405. degreeId: null,
  2406. auditUserList: [],
  2407. }],
  2408. showRefresh: false,
  2409. },
  2410. workRules: {
  2411. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2412. },
  2413. chooseParticipVisible: false,
  2414. logining: false,
  2415. isDisable: false,
  2416. timeType:[],
  2417. deptMembData: [
  2418. ],
  2419. //部门人员树状结构
  2420. data: [
  2421. {
  2422. id: -1,
  2423. label: this.$t('lable.allStaff'),
  2424. membCount:0
  2425. },
  2426. {
  2427. id: 0,
  2428. label: this.$t('lable.unassigned'),
  2429. }
  2430. ],
  2431. allData:{},
  2432. batchShowData:{},
  2433. option: [],
  2434. deptOptionList: [],
  2435. depData: {
  2436. id: -1,
  2437. label: this.$t('lable.allStaff'),
  2438. },
  2439. defaultProps: {
  2440. children: 'children',
  2441. label: 'label'
  2442. },
  2443. isNew: false,
  2444. selected: false,
  2445. valuet: new Date(),
  2446. domObj: null,
  2447. participator:[],
  2448. chosenMembCount:0,
  2449. jsDay: 0,
  2450. jsTime: 0,
  2451. falsss: false,
  2452. weidu: [],
  2453. weiduList: [],
  2454. yonghuUser: [],
  2455. dateAr: [],
  2456. batchSubFillDialog: false,
  2457. isSubstiS: false,
  2458. fillWeekDialogVisi: false,
  2459. fillWeekDialogVisiCustom: false,
  2460. fillWeekDialogVisiCustomTwo: false,
  2461. zhoData: [],
  2462. weekDateRange: [],
  2463. btnZho: false,
  2464. weekDataLoading: false,
  2465. changdu: 6,
  2466. tianxieDialogVisible: false,
  2467. scopess: {},
  2468. zhoBao: {
  2469. time: '',
  2470. workingTime: '',
  2471. progress: '',
  2472. con: '',
  2473. subProjectId: '',
  2474. stage: '',
  2475. subProjectList: [],
  2476. stages: [],
  2477. },
  2478. zhoBaoIdx: '',
  2479. zhoBaoName: '',
  2480. zhis: {},
  2481. dealList: [],
  2482. toViewDialogVisible: false,
  2483. toViewList: [],
  2484. toViewloading: true,
  2485. toViewForm: {
  2486. pageIndex: '1',
  2487. pageSize: '20',
  2488. total: 0,
  2489. },
  2490. toViewloadings: false,
  2491. tabPositionss: 'top',
  2492. monthTotal: 0,
  2493. monthTotalPage: 0,
  2494. monthTotalLages: 20,
  2495. monthWorkData: [],
  2496. monthNotWorkDate: [],
  2497. monthWorkDataS1: [],
  2498. monthnotTotal: 0,
  2499. monthnotTotalPage: 0,
  2500. monthnotTotalLages: 20,
  2501. monthNotWorkDateS1: [],
  2502. deptMembDataText: '',
  2503. isFlag: false,
  2504. isMore: false,
  2505. stateKey: '0',
  2506. expandDate: [],
  2507. notifySelList:[],
  2508. departmentList: [],
  2509. trandepartmentList:[],
  2510. approvalProcessDialog: false,
  2511. approvalProcessData: [],
  2512. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2513. 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')],
  2514. isWeekend: false,
  2515. canCancelInDialog: false,
  2516. approveinData: {},
  2517. approveinDialog: false,
  2518. reportCanDelete: false,
  2519. weeklyFilledTimeDialog: false,
  2520. weeklyFilledTimeList: [],
  2521. weeklyFilledTimeLoading: false,
  2522. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2523. weeklyFilledTimeCanDelete: false,
  2524. weeklyFilledTimeDate: null,
  2525. leaveAllNum: 0,
  2526. dataLoading: false,
  2527. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2528. vacationTime: {},
  2529. integrationProjectList: [],
  2530. totalReportHours: 0, // 合计的工时
  2531. workTimeForMinYi:0,
  2532. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2533. weekIndex: 1,
  2534. weekParentData: {},
  2535. deptIdForNoReport:[],
  2536. deptIdForReminder:[],
  2537. nameAearch: '', // 企业微信姓名搜索
  2538. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2539. deptMembDataLoading: false,
  2540. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2541. {
  2542. id: 4811,
  2543. // id: 10,
  2544. name: '陕西柘中建设工程有限公司'
  2545. }
  2546. ],
  2547. pushWorkTimeLogDig:false,
  2548. pushWorkTimeLogData:[],
  2549. userReportDeptList: [],
  2550. isReminder:true,
  2551. reportLogCheckDialog:false,
  2552. deptIdForHasReport:[],
  2553. transferWorkingHoursVisable: false,
  2554. multiOptionData:[],
  2555. businessTripsArray: [],
  2556. refreshAttendanceLoading: false
  2557. };
  2558. },
  2559. watch: {
  2560. deptMembDataText(val) {
  2561. this.$refs.chooseMembTree.filter(val);
  2562. }
  2563. },
  2564. filters: {
  2565. // 过滤
  2566. amounts(value) {
  2567. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2568. return 0
  2569. }
  2570. var zhi = +value + 0
  2571. return zhi.toFixed(1)
  2572. },
  2573. // zhoData
  2574. zhoData(value, arr) {
  2575. var dateArray = value.split("-");
  2576. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2577. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2578. // console.log(arr[date.getDay()])
  2579. // return "周" + "日一二三四五六".charAt(date.getDay());
  2580. return arr[date.getDay()]
  2581. },
  2582. // 过滤数字
  2583. numbers(value) {
  2584. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2585. return 0
  2586. }
  2587. return value
  2588. },
  2589. },
  2590. computed: {},
  2591. mounted() {
  2592. var now = new Date();
  2593. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2594. this.today = t;
  2595. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2596. this.exportParam.dateRange = [startStr,t];
  2597. this.exportReportLogParam.dateRange = [startStr,t];
  2598. this.getAllDate(1);
  2599. this.getReportList();
  2600. this.getProjectList();
  2601. this.getFillProjectList();
  2602. this.getTimeType();
  2603. this.getDepartment();
  2604. this.scrollFunction()
  2605. this.userssHu();
  2606. this.getFirstAndLastDay()
  2607. this.getMultiOptionData();
  2608. if(this.user.timeType.reportAuditType == 3){
  2609. this.getAllUsersList()
  2610. }
  2611. if (this.user.company.packageProject == 1) {
  2612. this.getBasecostItemList();
  2613. }
  2614. if(this.user.timeType.userWithMultiDept == 1) {
  2615. this.getDeptMembData();
  2616. }
  2617. if(this.user.timeType.lockWorktime){
  2618. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2619. }
  2620. //设置了下限
  2621. if (this.user.timeType.minReportTime) {
  2622. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2623. }
  2624. const that = this
  2625. if(this.user.userNameNeedTranslate == 1) {
  2626. that.dataLoading = that.$store.state.dataLoading
  2627. this.upDataLoading()
  2628. setTimeout(()=>{
  2629. that.dataLoading = that.$store.state.dataLoading
  2630. }, 1000)
  2631. }
  2632. if (this.user.companyId == this.yuzhongCompId) {
  2633. this.getJobResponList();
  2634. }
  2635. },
  2636. methods: {
  2637. ...mapMutations(['upDataLoading']),
  2638. // 刷新考勤
  2639. refreshAttendanceCli() {
  2640. const firstDay = this.dayjs(this.date, 'YYYY-MM').startOf('month');
  2641. const lastDay = this.dayjs(this.date, 'YYYY-MM').endOf('month');
  2642. const formData = {
  2643. startDate: firstDay.format('YYYY-MM-DD'),
  2644. endDate: lastDay.format('YYYY-MM-DD')
  2645. }
  2646. this.refreshAttendanceLoading = true;
  2647. this.http.post('/user-fv-time/syncHongHuFvTime',{
  2648. ...formData
  2649. },res => {
  2650. this.refreshAttendanceLoading = false;
  2651. if(res.code == 'ok'){
  2652. this.$message({
  2653. message: `刷新成功!`,
  2654. type: 'success'
  2655. })
  2656. this.showReportTimeLessThanCardTimeList()
  2657. }else {
  2658. this.$message({
  2659. message: res.msg,
  2660. type: 'error'
  2661. })
  2662. }
  2663. },err => {
  2664. this.refreshAttendanceLoading = false;
  2665. this.$message({
  2666. message: err,
  2667. type: 'error'
  2668. })
  2669. })
  2670. },
  2671. // 已填工时情况表设置背景色
  2672. hasworkTblCellStyle({ columnIndex, row, column }) {
  2673. if(columnIndex > 2) {
  2674. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2675. const worktimeList = row.worktimeList || []
  2676. const times = this.reportTimeType.allday
  2677. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2678. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2679. const missReport = filterData[0] && filterData[0].missReport;
  2680. const state = filterData[0] && filterData[0].state
  2681. if (missReport) {
  2682. return "backgroundColor: red"
  2683. } else {
  2684. if (state == 0 || state == -1) {
  2685. return "backgroundColor: orange"
  2686. } else if (state == 1) {
  2687. //审核通过
  2688. return "backgroundColor: #32CD32"
  2689. } else if (state == 2) {
  2690. return "backgroundColor: red"
  2691. } else {
  2692. return "backgroundColor: #E0E0E0"
  2693. }
  2694. }
  2695. }
  2696. },
  2697. getMultiOptionData() {
  2698. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2699. res => {
  2700. if (res.code == "ok") {
  2701. this.multiOptionData = res.data;
  2702. } else {
  2703. this.$message({
  2704. message: res.msg,
  2705. type: "error"
  2706. });
  2707. }
  2708. },
  2709. error => {
  2710. this.$message({
  2711. message: error,
  2712. type: "error"
  2713. });
  2714. }
  2715. );
  2716. },
  2717. showReportTimeLessThanCardTimeList() {
  2718. this.monthTotalPage = 0,
  2719. this.tbload = true,
  2720. this.http.post(
  2721. "/report/getReportTimeLessThanCardTimeList",
  2722. {
  2723. date: this.notfullSelectDateMonth,
  2724. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2725. userId: this.usersListId,
  2726. },
  2727. (res) => {
  2728. if (res.code == "ok") {
  2729. this.tbload = false
  2730. this.notFullData = res.data;
  2731. this.notFullOriginList = res.data;
  2732. }
  2733. },
  2734. (error) => {
  2735. this.tbload = false
  2736. this.$message({
  2737. message: error,
  2738. type: "error",
  2739. });
  2740. }
  2741. );
  2742. },
  2743. //按选择的日期范围刷新考勤
  2744. refreshWXCardTimeByRange() {
  2745. this.refreshingTime = true;
  2746. var param = {
  2747. companyId: this.user.companyId,
  2748. startDate: this.importWxParam.date[0],
  2749. endDate: this.importWxParam.date[1],
  2750. }
  2751. //非管理员只能看到自己的
  2752. if (this.user.roleName.indexOf('管理员') == -1) {
  2753. param.userId = this.user.id;
  2754. }
  2755. this.http.post('/wxcorp/getUserCheckInDayData',param,res => {
  2756. this.refreshingTime = false;
  2757. if(res.code == 'ok'){
  2758. this.loadCheckInData();
  2759. }else {
  2760. this.$message({
  2761. message: res.msg,
  2762. type: 'error'
  2763. })
  2764. }
  2765. },err => {
  2766. this.syncTimeLoading = false;
  2767. this.$message({
  2768. message: err,
  2769. type: 'error'
  2770. })
  2771. })
  2772. },
  2773. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2774. isCustomization(userInfo, permissionArray) {
  2775. const { companyId } = userInfo
  2776. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2777. return isReportPictureRequired
  2778. },
  2779. showHiddenFunction() {
  2780. this.showHidden = true;
  2781. },
  2782. // 获取如何信息选的可填写部门
  2783. getDeptMembData() {
  2784. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2785. if (res.code == "ok") {
  2786. let lists = res.data.userReportDeptList || []
  2787. const optimizedList = lists.map(item => ({
  2788. ...item,
  2789. label: item.departmentName,
  2790. value: item.departmentId,
  2791. }));
  2792. this.$set(this, 'userReportDeptList', optimizedList || []);
  2793. } else {
  2794. this.$message({
  2795. message: res.msg,
  2796. type: "error"
  2797. });
  2798. }
  2799. },error => { });
  2800. },
  2801. //任务被选中
  2802. onTaskSelected(domainItem) {
  2803. //取服务
  2804. if (domainItem.taskId) {
  2805. var that = this;
  2806. var param = {taskId:domainItem.taskId};
  2807. if (this.isSubstitude) {
  2808. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2809. param.userId = this.workForm.userId[0];
  2810. }
  2811. }
  2812. this.http.post('/task/getMyTaskService',param, res => {
  2813. if (res.code == "ok") {
  2814. // domainItem.workContentList = res.data;
  2815. that.$set(domainItem, 'sapServiceId', null);
  2816. that.$set(domainItem, 'serviceList', res.data);
  2817. } else {
  2818. this.$message({
  2819. message: res.msg,
  2820. type: "error"
  2821. });
  2822. }
  2823. },error => {
  2824. this.$message({
  2825. message: error,
  2826. type: "error"
  2827. });
  2828. }
  2829. );
  2830. } else {
  2831. //清空服务
  2832. }
  2833. },
  2834. onBatchTimeChange() {
  2835. //反向计算每日工作时长
  2836. if (this.workForm.createDate) {
  2837. let sdate = new Date(this.workForm.createDate[0]);
  2838. let edate = new Date(this.workForm.createDate[1]);
  2839. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2840. if (days < 0) {
  2841. return;
  2842. }
  2843. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2844. //总时长发生改变,自动按比例计算
  2845. this.workForm.domains.forEach(d=>{
  2846. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2847. });
  2848. }
  2849. },
  2850. //更新工作内容列表
  2851. updateJobContent(domainItem) {
  2852. var that = this;
  2853. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2854. if (res.code == "ok") {
  2855. // domainItem.workContentList = res.data;
  2856. that.$set(domainItem, 'extraField3', null);
  2857. that.$set(domainItem, 'workContentList', res.data);
  2858. } else {
  2859. this.$message({
  2860. message: res.msg,
  2861. type: "error"
  2862. });
  2863. }
  2864. },error => {
  2865. this.$message({
  2866. message: error,
  2867. type: "error"
  2868. });
  2869. }
  2870. );
  2871. },
  2872. updateResponse(domainItem) {
  2873. var that = this;
  2874. var selectPid = domainItem.projectId;
  2875. domainItem.extraField2 = null;
  2876. domainItem.extraField3 = null;
  2877. if (selectPid && domainItem.extraField1) {
  2878. //是否非项目
  2879. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2880. 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));
  2881. domainItem.filteredRespList = filteredRespList;
  2882. }
  2883. },
  2884. getJobResponList() {
  2885. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2886. if (res.code == "ok") {
  2887. this.jobResponseList = res.data;
  2888. } else {
  2889. this.$message({
  2890. message: res.msg,
  2891. type: "error"
  2892. });
  2893. }
  2894. },error => {
  2895. this.$message({
  2896. message: error,
  2897. type: "error"
  2898. });
  2899. }
  2900. );
  2901. },
  2902. openModImportTime(row) {
  2903. this.showModImportTimeDialog = true;
  2904. this.modItemDataId = row.id;
  2905. },
  2906. delImportTime(row) {
  2907. let rowId = row.id;
  2908. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2909. confirmButtonText: this.$t('btn.determine'),
  2910. cancelButtonText: this.$t('btn.cancel'),
  2911. type: "warning"
  2912. })
  2913. .then(() => {
  2914. this.http.post('/report-import-log/delete',{
  2915. id: rowId
  2916. },res => {
  2917. if (res.code == "ok") {
  2918. this.$message({
  2919. message: this.$t('message.successfullyDeleted'),
  2920. type: "success"
  2921. });
  2922. this.getToView();
  2923. } else {
  2924. this.$message({
  2925. message: res.msg,
  2926. type: "error"
  2927. });
  2928. }
  2929. },error => {
  2930. this.$message({
  2931. message: error,
  2932. type: "error"
  2933. });
  2934. }
  2935. );
  2936. }).catch(() => {this.startDeleting = false});
  2937. },
  2938. confirmChangeModTime() {
  2939. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2940. this.$message({
  2941. message: this.$t('message.Pleaseselectatime'),
  2942. type: "error"
  2943. });
  2944. return;
  2945. }
  2946. this.http.post('/report-import-log/changeTime',{
  2947. modLogDateTime: this.modImportTime,
  2948. modImportUserId: this.modImportUserId,
  2949. id: this.modItemDataId
  2950. },res => {
  2951. if (res.code == "ok") {
  2952. this.$message({
  2953. message: this.$t('message.modifyTheSuccess'),
  2954. type: "success"
  2955. });
  2956. this.getToView();
  2957. this.showModImportTimeDialog = false;
  2958. } else {
  2959. this.$message({
  2960. message: res.msg,
  2961. type: "error"
  2962. });
  2963. }
  2964. },error => {
  2965. this.$message({
  2966. message: error,
  2967. type: "error"
  2968. });
  2969. }
  2970. );
  2971. },
  2972. confirmBatchApproveReport() {
  2973. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2974. this.$message({
  2975. message: this.$t('qingXuanZeRiQiFanWei'),
  2976. type: "error"
  2977. });
  2978. return;
  2979. }
  2980. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2981. confirmButtonText: this.$t('btn.determine'),
  2982. cancelButtonText: this.$t('btn.cancel'),
  2983. type: "warning"
  2984. })
  2985. .then(() => {
  2986. this.startDeleting = true;
  2987. let obj = {
  2988. startDate: this.deleteReportParam.date[0],
  2989. endDate: this.deleteReportParam.date[1]
  2990. }
  2991. if(this.deleteReportParam.departmentId) {
  2992. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2993. } else {
  2994. obj.departmentId = null
  2995. }
  2996. this.http.post('/report/batchApproveByDate',obj,res => {
  2997. if (res.code == "ok") {
  2998. this.$message({
  2999. message: this.$t('state.approved'),
  3000. type: "success"
  3001. });
  3002. this.getReportList();
  3003. this.getDepartment();
  3004. this.startDeleting = false;
  3005. } else {
  3006. this.$message({
  3007. message: res.msg,
  3008. type: "error"
  3009. });
  3010. }
  3011. },error => {
  3012. this.$message({
  3013. message: error,
  3014. type: "error"
  3015. });
  3016. }
  3017. );
  3018. }).catch(() => {this.startDeleting = false});
  3019. },
  3020. confirmBatchDelReport() {
  3021. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  3022. this.$message({
  3023. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  3024. type: "error"
  3025. });
  3026. return;
  3027. }
  3028. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  3029. this.$message({
  3030. message: this.$t('qingXuanZeRiQiFanWei'),
  3031. type: "error"
  3032. });
  3033. return;
  3034. }
  3035. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  3036. confirmButtonText: this.$t('btn.determine'),
  3037. cancelButtonText: this.$t('btn.cancel'),
  3038. type: "warning"
  3039. })
  3040. .then(() => {
  3041. this.startDeleting = true;
  3042. this.http.post('/report/batchDelete',{
  3043. userIds: JSON.stringify(this.deleteReportParam.userIds),
  3044. startDate: this.deleteReportParam.date[0],
  3045. endDate: this.deleteReportParam.date[1],
  3046. deptId: this.deleteReportParam.deptId[0]
  3047. },res => {
  3048. if (res.code == "ok") {
  3049. this.$message({
  3050. message: this.$t('message.successfullyDeleted'),
  3051. type: "success"
  3052. });
  3053. this.getReportList();
  3054. this.getDepartment();
  3055. this.startDeleting = false;
  3056. } else {
  3057. this.$message({
  3058. message: res.msg,
  3059. type: "error"
  3060. });
  3061. }
  3062. },error => {
  3063. this.$message({
  3064. message: error,
  3065. type: "error"
  3066. });
  3067. }
  3068. );
  3069. }).catch(() => {this.startDeleting = false});
  3070. },
  3071. getRecentlyProject(userId) {
  3072. this.http.post('/project/nearProject',{userId: userId},res => {
  3073. if(res.code == 'ok'){
  3074. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3075. let topObj = {
  3076. label: this.$t('zuiJinXuanZeXiangMu'),
  3077. peojectList: res.data
  3078. }
  3079. let botomObj = {
  3080. label: this.$t('other.allProject'),
  3081. peojectList: bottomList
  3082. }
  3083. //最近项目如果在fillProjectList中不存在,需要移除
  3084. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3085. this.integrationProjectList = [topObj, botomObj]
  3086. }else {
  3087. this.$message({
  3088. message: res.msg,
  3089. type: 'error'
  3090. })
  3091. }
  3092. },err => {
  3093. this.$message({
  3094. message: err,
  3095. type: 'error'
  3096. })
  3097. })
  3098. },
  3099. handlePictureCardPreview(file, index) {
  3100. let arr = []
  3101. let imgArr = this.workForm.domains[index].imgListUrl
  3102. for(var i in imgArr) {
  3103. arr.push(imgArr[i].url)
  3104. }
  3105. const $viewer = this.$viewerApi({
  3106. images: arr
  3107. });
  3108. },
  3109. // 图片上传
  3110. addImg(e, index) {
  3111. let formData = new FormData()
  3112. formData.append('multipartFile', e.file)
  3113. this.http.uploadFile('/common/uploadFile', formData,
  3114. res => {
  3115. if (res.code == "ok") {
  3116. this.$message({
  3117. message: this.$t('uploadedsuccessfully'),
  3118. type: "success"
  3119. });
  3120. if(!this.workForm.domains[index].imgList) {
  3121. this.workForm.domains[index].imgList = []
  3122. this.workForm.domains[index].imgListUrl = []
  3123. }
  3124. this.workForm.domains[index].imgList.push(res.data)
  3125. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3126. } else {
  3127. this.$message({message: res.msg,type: "error"});
  3128. }
  3129. },
  3130. error => {this.$message({message: error,type: "error"});
  3131. });
  3132. },
  3133. // 删除图片
  3134. delImg(file,fileList, index) {
  3135. let idx = 0
  3136. for(let i in fileList) {
  3137. if(fileList[i].uid == file.uid) {
  3138. idx = i
  3139. }
  3140. }
  3141. this.workForm.domains[index].imgList.splice(idx, 1)
  3142. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3143. },
  3144. test(){
  3145. console.log('test',this.workForm.domains);
  3146. },
  3147. getHour(s1, s2) {
  3148. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3149. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3150. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3151. var ms = s2.getTime() - s1.getTime();
  3152. if (ms < 0) return 0;
  3153. let ma = ms / 1000 / 60 / 60
  3154. return ma; //小时
  3155. },
  3156. refreshDDCardTime(workdate) {
  3157. if (!workdate) return;
  3158. this.syncTimeLoading = true;
  3159. this.http.post('/dingding/refreshUserCardTime',{
  3160. companyId: this.user.companyId,
  3161. userId: this.user.id,
  3162. date: workdate,
  3163. },res => {
  3164. this.syncTimeLoading = false;
  3165. if(res.code == 'ok'){
  3166. if (!res.data) {
  3167. this.$message({
  3168. message: '获取考勤失败',
  3169. type: 'error'
  3170. })
  3171. } else {
  3172. this.workForm.time = res.data;
  3173. }
  3174. }else {
  3175. this.$message({
  3176. message: res.msg,
  3177. type: 'error'
  3178. })
  3179. }
  3180. },err => {
  3181. this.syncTimeLoading = false;
  3182. this.$message({
  3183. message: err,
  3184. type: 'error'
  3185. })
  3186. })
  3187. },
  3188. refreshWXCardTime(workdate) {
  3189. if (!workdate) return;
  3190. this.syncTimeLoading = true;
  3191. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3192. date: workdate,
  3193. },res => {
  3194. this.syncTimeLoading = false;
  3195. if(res.code == 'ok'){
  3196. this.workForm.time = res.data.time;
  3197. }else {
  3198. this.$message({
  3199. message: res.msg,
  3200. type: 'error'
  3201. })
  3202. }
  3203. },err => {
  3204. this.syncTimeLoading = false;
  3205. this.$message({
  3206. message: err,
  3207. type: 'error'
  3208. })
  3209. })
  3210. },
  3211. refreshAttendance(workdate) {
  3212. if (!workdate) return;
  3213. this.syncTimeLoading = true;
  3214. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3215. startDate: workdate[0],
  3216. endDate: workdate[1]
  3217. },res => {
  3218. this.syncTimeLoading = false;
  3219. if(res.code == 'ok'){
  3220. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3221. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3222. this.totalReportHours = this.workTimeForMinYi;
  3223. }else {
  3224. this.$message({
  3225. message: res.msg,
  3226. type: 'error'
  3227. })
  3228. }
  3229. },err => {
  3230. this.syncTimeLoading = false;
  3231. this.$message({
  3232. message: err,
  3233. type: 'error'
  3234. })
  3235. })
  3236. },
  3237. refreshBeiSengAttendance(workdate) {
  3238. if (!workdate) return;
  3239. this.syncTimeLoading = true;
  3240. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3241. createDate: workdate
  3242. },res => {
  3243. this.syncTimeLoading = false;
  3244. if(res.code == 'ok'){
  3245. this.workForm.time = res.data;
  3246. }else {
  3247. this.$message({
  3248. message: res.msg,
  3249. type: 'error'
  3250. })
  3251. }
  3252. },err => {
  3253. this.syncTimeLoading = false;
  3254. this.$message({
  3255. message: err,
  3256. type: 'error'
  3257. })
  3258. })
  3259. },
  3260. refreshBeiSengAttendanceTwo(workdate) {
  3261. if (!workdate) return;
  3262. this.syncTimeLoading = true;
  3263. this.http.post('/user-fv-time/syncHongHuFvTime',{
  3264. startDate: workdate,
  3265. endDate: workdate,
  3266. userId: this.user.id
  3267. },res => {
  3268. this.syncTimeLoading = false;
  3269. if(res.code == 'ok'){
  3270. this.workForm.time = res.data;
  3271. }else {
  3272. this.$message({
  3273. message: res.msg,
  3274. type: 'error'
  3275. })
  3276. }
  3277. },err => {
  3278. this.syncTimeLoading = false;
  3279. this.$message({
  3280. message: err,
  3281. type: 'error'
  3282. })
  3283. })
  3284. },
  3285. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3286. this.weeklyFilledTimeDialog = true
  3287. this.weeklyFilledTimeLoading = true
  3288. this.weeklyFilledTimeDate = parameterDate
  3289. this.http.post('/report/getReportList',{
  3290. date: parameterDate,
  3291. userId: this.user.id
  3292. },res => {
  3293. this.weeklyFilledTimeLoading = false
  3294. if(res.code == 'ok'){
  3295. this.weeklyFilledTimeList = res.data[0].data
  3296. let candelete = true
  3297. for(let i in this.weeklyFilledTimeList){
  3298. if(this.weeklyFilledTimeList[i].state < 2){
  3299. candelete = false
  3300. }
  3301. }
  3302. this.weeklyFilledTimeCanDelete = candelete
  3303. }else {
  3304. this.$message({
  3305. message: res.msg,
  3306. type: 'error'
  3307. })
  3308. }
  3309. },err => {
  3310. this.weeklyFilledTimeLoading = false
  3311. this.$message({
  3312. message: err,
  3313. type: 'error'
  3314. })
  3315. })
  3316. },
  3317. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3318. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3319. confirmButtonText: this.$t('btn.determine'),
  3320. cancelButtonText: this.$t('btn.cancel'),
  3321. type: "warning"
  3322. })
  3323. .then(() => {
  3324. this.http.post('/report/delete',{
  3325. userId: this.user.id,
  3326. date: this.weeklyFilledTimeDate
  3327. },res => {
  3328. if (res.code == "ok") {
  3329. this.$message({
  3330. message: this.$t('message.successfullyDeleted'),
  3331. type: "success"
  3332. });
  3333. this.getWeeklyWorkTime()
  3334. this.getReportList();
  3335. this.getDepartment();
  3336. this.weeklyFilledTimeDialog = false;
  3337. } else {
  3338. this.$message({
  3339. message: res.msg,
  3340. type: "error"
  3341. });
  3342. }
  3343. },error => {
  3344. this.$message({
  3345. message: error,
  3346. type: "error"
  3347. });
  3348. }
  3349. );
  3350. }).catch(() => {});
  3351. },
  3352. getApprovalProcess(item){
  3353. // console.log('this.date',this.choseDate);
  3354. this.http.post('/report-log/get',{
  3355. creatorId: item.id,
  3356. createDate: sessionStorage.msg
  3357. },res => {
  3358. if(res.code == 'ok'){
  3359. this.approvalProcessDialog = true
  3360. if(this.user.userNameNeedTranslate == 1) {
  3361. for(var i in res.data) {
  3362. let obj = {
  3363. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3364. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3365. }
  3366. res.data[i].msgCon = obj
  3367. }
  3368. }
  3369. this.approvalProcessData = res.data
  3370. }else{
  3371. this.$message({
  3372. message: res.msg,
  3373. type: 'error'
  3374. })
  3375. }
  3376. },err => {
  3377. this.$message({
  3378. message: err,
  3379. type: 'error'
  3380. })
  3381. })
  3382. //获取审批节点状态
  3383. if (this.user.companyId == 7544) {
  3384. this.http.post('/report/getCurAuditNode',{
  3385. userId: item.id,
  3386. date: sessionStorage.msg
  3387. },res => {
  3388. if(res.code == 'ok'){
  3389. this.curAuditNode = res.data
  3390. }else{
  3391. }
  3392. },err => {
  3393. this.$message({
  3394. message: err,
  3395. type: 'error'
  3396. })
  3397. })
  3398. }
  3399. },
  3400. filterNode(value, data) {
  3401. if (!value) return true;
  3402. return data.label.indexOf(value) !== -1;
  3403. },
  3404. triggerCalculateOT(index) {
  3405. var str = this.workForm.domains[index].overtimeHours + ''
  3406. if(str.indexOf('.') != '-1') {
  3407. var s = str.split('.')[0]
  3408. var st = str.split('.')[1]
  3409. var sts = st.split('')
  3410. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3411. }
  3412. },
  3413. searchScreen(e){
  3414. if(e == 1){
  3415. this.monthNotWorkDateS1 = []
  3416. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3417. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3418. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3419. }
  3420. }
  3421. if (this.monthNotWorkDateS1.length > 50) {
  3422. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3423. }else{
  3424. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3425. }
  3426. } else if (e == 0) {
  3427. this.monthWorkDataS1 = []
  3428. for (let i = 0; i < this.monthWorkData.length; i++) {
  3429. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3430. this.monthWorkDataS1.push(this.monthWorkData[i])
  3431. }
  3432. }
  3433. if (this.monthWorkDataS1.length > 50) {
  3434. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3435. }else{
  3436. this.monthWorkDataS = this.monthWorkDataS1
  3437. }
  3438. } else if (e == 2) {
  3439. this.monthWorkDataS1 = []
  3440. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3441. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3442. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3443. }
  3444. }
  3445. if (this.monthWorkDataS1.length > 50) {
  3446. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3447. }else{
  3448. this.notFullData = this.monthWorkDataS1
  3449. }
  3450. }
  3451. },
  3452. addUpload(data) {
  3453. // var zhi = data.fileName.split('.')[0]
  3454. // var sss = zhi + '.xlsx'
  3455. // return
  3456. var filePath = '/upload/' + data.serverName;
  3457. const a = document.createElement('a'); // 创建a标签
  3458. a.setAttribute('download', data.fileName);// download属性
  3459. a.setAttribute('href', filePath);// href链接
  3460. a.click(); //自执行点击事件
  3461. a.remove();
  3462. },
  3463. restrictNumber(targetId) {
  3464. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3465. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3466. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3467. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3468. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3469. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3470. inpu.value = parseFloat(inpu.value);
  3471. }
  3472. },
  3473. //获取项目下的任务分组
  3474. getTaskGroups(domain, index) {
  3475. domain.groupId=null;
  3476. this.http.post('/task-group/listMyJoinGroup',{
  3477. projectId: domain.projectId,
  3478. isSubstitude: this.isSubstitude ? 1 : 0
  3479. },
  3480. res => {
  3481. if (res.code == "ok") {
  3482. this.workForm.domains[index].taskGroups = res.data;
  3483. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3484. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3485. // this.getGroupStages(domain, index);
  3486. // }
  3487. const projectIdStr = domain.projectId;
  3488. const businessTripsArray = this.businessTripsArray
  3489. const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
  3490. if(list.length > 0) {
  3491. const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
  3492. this.workForm.domains[index].groupId = obj.id || ''
  3493. }
  3494. this.$forceUpdate();
  3495. }
  3496. },
  3497. error => {
  3498. this.$message({
  3499. message: error,
  3500. type: "error"
  3501. });
  3502. }
  3503. );
  3504. },
  3505. //下载填报工时占比报表
  3506. downloadProjectRatio() {
  3507. this.exportUserRatio = true;
  3508. // let now = new Date();
  3509. // let month = now.getMonth();//默认看上个月的
  3510. // let monthStr = month<10? ('0'+month): month;
  3511. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3512. const today = new Date();
  3513. const year = today.getFullYear();
  3514. const month = today.getMonth() + 1;
  3515. let lastMonthYear, lastMonth;
  3516. if (month === 1) {
  3517. lastMonthYear = year - 1;
  3518. lastMonth = 12;
  3519. } else {
  3520. lastMonthYear = year;
  3521. lastMonth = month - 1;
  3522. }
  3523. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3524. },
  3525. confirmDownloadRatio() {
  3526. this.startRatioExporting = true;
  3527. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3528. ymonth: this.ratioYmonth
  3529. },
  3530. res => {
  3531. if (res.code == "ok") {
  3532. this.startRatioExporting = false;
  3533. var filePath = res.data;
  3534. const a = document.createElement('a'); // 创建a标签
  3535. var data = filePath.split("/");
  3536. a.setAttribute('download', data[data.length-1]);// download属性
  3537. a.setAttribute('href', filePath);// href链接
  3538. a.click(); //自执行点击事件
  3539. a.remove();
  3540. } else {
  3541. this.startRatioExporting = false;
  3542. this.$message({
  3543. message: res.msg,
  3544. type: "error"
  3545. });
  3546. }
  3547. },
  3548. error => {
  3549. this.checkinLoading = false;
  3550. this.$message({
  3551. message: error,
  3552. type: "error"
  3553. });
  3554. }
  3555. );
  3556. },
  3557. //下载带企业微信考勤数据的工时统计模板
  3558. downloadCheckInExcel() {
  3559. var param = {
  3560. startDate: this.importWxParam.date[0],
  3561. endDate: this.importWxParam.date[1],
  3562. };
  3563. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3564. param.onlySelfData = false;
  3565. }
  3566. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3567. res => {
  3568. if (res.code == "ok") {
  3569. var filePath = res.data;
  3570. const a = document.createElement('a'); // 创建a标签
  3571. var data = filePath.split("/");
  3572. a.setAttribute('download', data[data.length-1]);// download属性
  3573. a.setAttribute('href', filePath);// href链接
  3574. a.click(); //自执行点击事件
  3575. a.remove();
  3576. } else {
  3577. this.$message({
  3578. message: res.msg,
  3579. type: "error"
  3580. });
  3581. }
  3582. },
  3583. error => {
  3584. this.checkinLoading = false;
  3585. this.$message({
  3586. message: error,
  3587. type: "error"
  3588. });
  3589. }
  3590. );
  3591. },
  3592. pre() {
  3593. if (this.active == 0) return;
  3594. this.active--;
  3595. },
  3596. next() {
  3597. this.active++;
  3598. },
  3599. triggerTotalTime(index) {
  3600. var item = this.checkinList[index];
  3601. var total = 0.0;
  3602. for (var i=0;i<this.projectColumns.length; i++) {
  3603. var key = this.projectColumns[i];
  3604. if (item[key] != null && item[key] != '') {
  3605. total += parseFloat(item[key]);
  3606. }
  3607. }
  3608. item.totalFillTime = total;
  3609. },
  3610. //提交批量代填的数据
  3611. submitBatchSubFillData() {
  3612. var data = JSON.stringify(this.checkinList);
  3613. this.http.post('/user-corpwx-time/submitProjectTime',{
  3614. json: data,
  3615. projectColumns: JSON.stringify(this.projectColumns)
  3616. },
  3617. res => {
  3618. if (res.code == "ok") {
  3619. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3620. this.importWxDialog = false;
  3621. }
  3622. },
  3623. error => {
  3624. this.checkinLoading = false;
  3625. this.$message({
  3626. message: error,
  3627. type: "error"
  3628. });
  3629. }
  3630. );
  3631. },
  3632. loadCheckInData() {
  3633. if (this.importWxParam.date == null) {
  3634. this.checkinList = [];
  3635. return;
  3636. }
  3637. this.checkinLoading = true;
  3638. this.http.post('/user-corpwx-time/getMyData',{
  3639. startDate: this.importWxParam.date[0],
  3640. endDate: this.importWxParam.date[1],
  3641. },
  3642. res => {
  3643. if (res.code == "ok") {
  3644. this.checkinLoading = false;
  3645. this.checkinList = res.data.list;
  3646. this.projectColumns = res.data.projects;
  3647. // 自定义表格会导致表格错乱,需重新计算表格
  3648. this.$nextTick(()=>{
  3649. this.$refs.tab.doLayout()
  3650. })
  3651. }
  3652. },
  3653. error => {
  3654. this.checkinLoading = false;
  3655. this.$message({
  3656. message: error,
  3657. type: "error"
  3658. });
  3659. }
  3660. );
  3661. },
  3662. importCardTime(item) {
  3663. //首先判断文件类型
  3664. let str = item.file.name.split(".");
  3665. let format = str[str.length - 1];
  3666. if (format != "xls" && format != "xlsx") {
  3667. this.$message({
  3668. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3669. type: "error"
  3670. });
  3671. } else {
  3672. this.importingData = true;
  3673. let formData = new FormData();
  3674. formData.append("multipartFile", item.file);
  3675. formData.append("companyId", this.user.companyId);
  3676. this.http.uploadFile(this.user.companyId == 7703?'/user-corpwx-time/importZhengBeiAttendance':'/user-corpwx-time/importCardTime', formData,
  3677. res => {
  3678. this.$refs.uploadCardTime.clearFiles();
  3679. this.importingData = false;
  3680. if (res.code == "ok") {
  3681. //换成弹出框,以免有人等了半天回来啥也没看到
  3682. this.$message({
  3683. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3684. type: "success"
  3685. });
  3686. } else {
  3687. this.$message({
  3688. message: res.msg,
  3689. type: "error"
  3690. });
  3691. }
  3692. },
  3693. error => {
  3694. this.$refs.upload.clearFiles();
  3695. this.listLoading = false;
  3696. this.$message({
  3697. message: error,
  3698. type: "error"
  3699. });
  3700. });
  3701. }
  3702. },
  3703. batchImportWxData(item) {
  3704. //首先判断文件类型
  3705. let str = item.file.name.split(".");
  3706. let format = str[str.length - 1];
  3707. if (format != "xls" && format != "xlsx") {
  3708. this.$message({
  3709. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3710. type: "error"
  3711. });
  3712. } else {
  3713. this.importingData = true;
  3714. let formData = new FormData();
  3715. formData.append("file", item.file);
  3716. formData.append("companyId", this.user.companyId);
  3717. formData.append("withCheckIn", 1);
  3718. this.http.uploadFile('/report/importData', formData,
  3719. res => {
  3720. this.$refs.upload.clearFiles();
  3721. this.showImportResult = true;
  3722. this.importingData = false;
  3723. if (res.code == "ok") {
  3724. //换成弹出框,以免有人等了半天回来啥也没看到
  3725. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3726. this.getReportList();
  3727. this.importWxDialog = false;
  3728. } else {
  3729. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3730. }
  3731. },
  3732. error => {
  3733. this.$refs.upload.clearFiles();
  3734. this.listLoading = false;
  3735. this.$message({
  3736. message: error,
  3737. type: "error"
  3738. });
  3739. });
  3740. }
  3741. },
  3742. batchImportData(item) {
  3743. //首先判断文件类型
  3744. let str = item.file.name.split(".");
  3745. let format = str[str.length - 1];
  3746. if (format != "xls" && format != "xlsx") {
  3747. this.$message({
  3748. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3749. type: "error"
  3750. });
  3751. } else {
  3752. this.importingData = true;
  3753. let formData = new FormData();
  3754. formData.append("file", item.file);
  3755. formData.append("companyId", this.user.companyId);
  3756. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3757. this.http.uploadFile(url, formData,
  3758. res => {
  3759. this.$refs.upload.clearFiles();
  3760. this.importingData = false;
  3761. this.showImportResult = true;
  3762. if (res.code == "ok") {
  3763. //换成弹出框,以免有人等了半天回来啥也没看到
  3764. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3765. this.getReportList();
  3766. this.importWXDialog = false;
  3767. } else {
  3768. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3769. }
  3770. },
  3771. error => {
  3772. this.$refs.upload.clearFiles();
  3773. this.importingData = false;
  3774. this.$message({
  3775. message: error,
  3776. type: "error"
  3777. });
  3778. });
  3779. }
  3780. },
  3781. userssHu() {
  3782. this.http.post('/time-type/getCompanyTimeSetting',{
  3783. companyId: this.user.companyId
  3784. },
  3785. res => {
  3786. if (res.code == "ok") {
  3787. this.yonghuUser = res.data
  3788. }
  3789. },
  3790. error => {
  3791. this.$message({
  3792. message: error,
  3793. type: "error"
  3794. });
  3795. }
  3796. );
  3797. },
  3798. iptBlur(i) {
  3799. if(this.isBatch == 0) {
  3800. return
  3801. }
  3802. var reqParam = {
  3803. startDate: this.workForm.createDate[0],
  3804. endDate: this.workForm.createDate[1]
  3805. };
  3806. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3807. reqParam.userId = this.workForm.userId[0];
  3808. }
  3809. this.http.post('/report/getWorkDays',reqParam,
  3810. res => {
  3811. if (res.code == "ok") {
  3812. this.jsDay = res.data
  3813. this.chuji(i)
  3814. } else {
  3815. this.$message({
  3816. message: res.msg,
  3817. type: "error"
  3818. });
  3819. }
  3820. },
  3821. error => {
  3822. this.$message({
  3823. message: error,
  3824. type: "error"
  3825. });
  3826. }
  3827. );
  3828. //明夷硬编码获取
  3829. if (this.user.company.companyName == this.mingyiName) {
  3830. this.getWorkTimeForMinYi();
  3831. }
  3832. },
  3833. getWorkTimeForMinYi(){
  3834. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3835. startDate: this.workForm.createDate[0],
  3836. endDate: this.workForm.createDate[1]
  3837. },
  3838. res => {
  3839. if (res.code == "ok") {
  3840. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3841. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3842. this.totalReportHours = this.workTimeForMinYi;
  3843. } else {
  3844. this.$message({
  3845. message: res.msg,
  3846. type: "error"
  3847. });
  3848. this.workForm.createDate = [];
  3849. }
  3850. },
  3851. error => {
  3852. this.$message({
  3853. message: error,
  3854. type: "error"
  3855. });
  3856. }
  3857. );
  3858. },
  3859. chuji(i) {
  3860. if(i == 0) {
  3861. this.seleChn(1)
  3862. } else if(i == 1) {
  3863. this.seleChn(0)
  3864. } else if(i == 2) {
  3865. if(this.workForm.domains[0].multiWorktime > 0) {
  3866. this.iptChangs()
  3867. } else {
  3868. this.iptChang()
  3869. }
  3870. } else if(i == 3) {
  3871. this.seleChn(0)
  3872. }
  3873. },
  3874. seleChn(e,domain) {
  3875. if(e == 1) {
  3876. for(var i in this.workForm.domains) {
  3877. if(this.workForm.domains[i].timeType == 0) {
  3878. this.workForm.domains[i].workingTime = 8
  3879. } else {
  3880. this.workForm.domains[i].workingTime = 4
  3881. }
  3882. }
  3883. }
  3884. var quanbu = 0
  3885. var spl = this.workForm.domains
  3886. var zhi = ''
  3887. for(var i in spl) {
  3888. var sp = +spl[i].workingTime + 0
  3889. zhi = this.jsDay * sp
  3890. quanbu = +quanbu + zhi
  3891. }
  3892. this.jsTime = quanbu
  3893. this.totalReportHours = quanbu
  3894. let worktime = this.jsTime
  3895. // 自动计算加班时长
  3896. if(this.isBatch != 0){
  3897. worktime = this.jsTime / this.jsDay
  3898. }
  3899. if(this.user.timeType.fillOvertime && domain){
  3900. let isover = false
  3901. let alltime = 0
  3902. let allover = 0 //此处alltime同上面的worktime
  3903. for(let d in spl){
  3904. if(spl[d].isOvertime){
  3905. isover = true
  3906. allover += spl[d].overtimeHours*1
  3907. }
  3908. alltime += spl[d].workingTime*1
  3909. }
  3910. if(domain.overtimeHours){
  3911. allover = allover - domain.overtimeHours
  3912. }
  3913. if(worktime*1 > this.user.timeType.allday){
  3914. if(isover){
  3915. if(alltime > (allover + this.user.timeType.allday)){
  3916. this.$set(domain,'isOvertime',true)
  3917. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3918. }else{
  3919. this.$set(domain,'isOvertime',false)
  3920. this.$set(domain,'overtimeHours',null)
  3921. if(alltime < (allover + this.user.timeType.allday)){
  3922. let overtime = allover + this.user.timeType.allday - alltime
  3923. for(let pi in spl){
  3924. if(spl[pi].overtimeHours){
  3925. if((overtime - spl[pi].overtimeHours*1) > 0){
  3926. overtime = overtime - spl[pi].overtimeHours*1
  3927. this.$set(spl[pi],'isOvertime',false)
  3928. this.$set(spl[pi],'overtimeHours',null)
  3929. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3930. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3931. break
  3932. }else{
  3933. this.$set(spl[pi],'isOvertime',false)
  3934. this.$set(spl[pi],'overtimeHours',null)
  3935. break
  3936. }
  3937. }
  3938. }
  3939. }
  3940. }
  3941. }else{
  3942. this.$set(domain,'isOvertime',true)
  3943. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3944. }
  3945. }else{
  3946. for(let di in spl){
  3947. this.$set(spl[di],'isOvertime',false)
  3948. this.$set(spl[di],'overtimeHours',null)
  3949. }
  3950. }
  3951. }
  3952. },
  3953. iptChang() {
  3954. var sl = this.workForm.domains
  3955. let timeArr = []
  3956. for(var i in sl) {
  3957. if(sl[i].startTime && sl[i].endTime) {
  3958. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3959. }
  3960. }
  3961. this.getTimeHours(timeArr)
  3962. },
  3963. iptChangs() {
  3964. var sl = this.workForm.domains
  3965. let timeArr = []
  3966. for(var i in sl) {
  3967. for(var j in sl[i].worktimeList){
  3968. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3969. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3970. }
  3971. }
  3972. }
  3973. this.getTimeHours(timeArr)
  3974. },
  3975. // 调用接口或去数据
  3976. getTimeHours(arr) {
  3977. this.http.post('/report/getHoursByTimeRange',{
  3978. timeJsonStr: JSON.stringify(arr)
  3979. },res => {
  3980. if(res.code === 'ok') {
  3981. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3982. } else {
  3983. this.$message({
  3984. message: res.msg,
  3985. type: 'error'
  3986. })
  3987. }
  3988. },err => {
  3989. this.$message({
  3990. message: err,
  3991. type: 'error'
  3992. })
  3993. })
  3994. },
  3995. // 按周填报调用接口计算时间
  3996. async getWeekHoursByTimeRange(timeRange) {
  3997. const url = '/report/getHoursByTimeRange';
  3998. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3999. var that = this;
  4000. return new Promise((resolve, reject) => {
  4001. this.http.post(url, data, function(res) {
  4002. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  4003. }, function(err) {
  4004. reject(err);
  4005. });
  4006. });
  4007. },
  4008. removeTimeItem(item, index) {
  4009. item.worktimeList.splice(index, 1);
  4010. this.iptChangs()
  4011. },
  4012. //添加工时
  4013. addNewWorktime(index, item) {
  4014. if(item.worktimeList == null ) {
  4015. item.worktimeList = []
  4016. }
  4017. item.worktimeList.push({});
  4018. },
  4019. //复制项目
  4020. copyProject(index) {
  4021. var leftProgress = 10;
  4022. if (this.reportTimeType.type == 3) {
  4023. //计算已经待分配工时比例
  4024. let array = this.workForm.domains;
  4025. let totalProgress = 0;
  4026. for (var i=0;i<array.length; i++) {
  4027. totalProgress += array[i].progress;
  4028. }
  4029. if (totalProgress < 100) {
  4030. leftProgress = 100 - totalProgress;
  4031. }
  4032. }
  4033. var newIndex = index+1;
  4034. var itemDomain = {
  4035. projectId: this.workForm.domains[index].projectId,
  4036. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  4037. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  4038. ),
  4039. content: "",
  4040. progress:leftProgress,
  4041. state:2,//2-表示待提交
  4042. };
  4043. this.workForm.domains.splice(newIndex, 0,itemDomain);
  4044. if (this.reportTimeType.type == 0) {
  4045. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  4046. var length = this.workForm.domains.length;
  4047. if (length == 2) {
  4048. this.showAddMore = false;
  4049. }
  4050. }
  4051. this.selectProject(itemDomain, newIndex);
  4052. },
  4053. pushWorkTime(reportId){
  4054. let url=''
  4055. if(this.user.timeType.syncSap == 1){
  4056. url='/report/pushProjectReportToSap'
  4057. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4058. var pushDate = this.date + day;
  4059. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  4060. confirmButtonText: this.$t('btn.determine'),
  4061. cancelButtonText: this.$t('btn.cancel'),
  4062. type: 'info'
  4063. }).then(() => {
  4064. const loading = this.$loading({
  4065. lock: true,
  4066. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4067. spinner: 'el-icon-loading',
  4068. background: 'rgba(0, 0, 0, 0.7)'
  4069. });
  4070. this.http.post(url,{
  4071. pushDate: pushDate,
  4072. reportId: reportId
  4073. },res => {
  4074. loading.close();
  4075. if(res.code == 'ok'){
  4076. this.$message({
  4077. type: 'success',
  4078. message: res.data
  4079. });
  4080. }else{
  4081. this.$message({
  4082. type: 'error',
  4083. message: res.msg
  4084. })
  4085. }
  4086. },err => {
  4087. loading.close();
  4088. this.$message({
  4089. type: 'error',
  4090. message: err
  4091. })
  4092. })
  4093. }).catch(() => {
  4094. });
  4095. }else{
  4096. url='/report/pushReportDataToThird'
  4097. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4098. confirmButtonText: this.$t('btn.determine'),
  4099. cancelButtonText: this.$t('btn.cancel'),
  4100. type: 'info'
  4101. }).then(() => {
  4102. const loading = this.$loading({
  4103. lock: true,
  4104. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4105. spinner: 'el-icon-loading',
  4106. background: 'rgba(0, 0, 0, 0.7)'
  4107. });
  4108. this.http.post(url,{
  4109. yearMonth: this.date
  4110. },res => {
  4111. loading.close();
  4112. if(res.code == 'ok'){
  4113. this.$message({
  4114. type: 'success',
  4115. message: this.$t('tuiSongChengGong')
  4116. });
  4117. }else{
  4118. this.$message({
  4119. type: 'error',
  4120. message: res.msg
  4121. })
  4122. }
  4123. },err => {
  4124. loading.close();
  4125. this.$message({
  4126. type: 'error',
  4127. message: err
  4128. })
  4129. })
  4130. }).catch(() => {
  4131. });
  4132. }
  4133. },
  4134. showWorkTime(){
  4135. this.monthWorkTimeDialog = true;
  4136. this.searchKeyword = ''
  4137. this.WorktimeDatepickValue = this.istoMonth()
  4138. if(this.WorktimeDatepickValue.length == 0){
  4139. let newdate = new Date();
  4140. let nowdate = newdate.toLocaleDateString();
  4141. let getauto = this.getAutoWeekDate(nowdate)
  4142. let nowwd = [getauto[0],getauto[6]]
  4143. this.WorktimeDatepickValue = nowwd
  4144. }
  4145. this.showMonthWorkTime()
  4146. },
  4147. handleClick(t,e){
  4148. if (t.name == "second") {
  4149. this.showMonthNotWorkTime()
  4150. }else if(t.name == "first"){
  4151. this.showMonthWorkTime()
  4152. }else if(t.name == "third"){
  4153. this.showMonthWorkTimeReminder()
  4154. } else if (t.name == "fourth") {
  4155. this.showReportTimeLessThanCardTimeList();
  4156. }
  4157. },
  4158. //导出员工每日填报工时数
  4159. exportMembWorkHours() {
  4160. this.http.post(
  4161. "/report/exportUserDailyWorkTime",
  4162. {
  4163. // month: this.date,
  4164. startDate: this.WorktimeDatepickValue[0],
  4165. endDate: this.WorktimeDatepickValue[1],
  4166. },
  4167. (res) => {
  4168. if (res.code == "ok") {
  4169. let url = res.data;
  4170. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4171. }
  4172. },
  4173. (error) => {
  4174. this.$message({
  4175. message: error,
  4176. type: "error",
  4177. });
  4178. }
  4179. );
  4180. },
  4181. exportMembWorkHoursReminder() {
  4182. this.http.post(
  4183. "/report/exportUserDailyWorkTimeReminder",
  4184. {
  4185. // month: this.date,
  4186. startDate: this.WorktimeDatepickValue[0],
  4187. endDate: this.WorktimeDatepickValue[1],
  4188. },
  4189. (res) => {
  4190. if (res.code == "ok") {
  4191. let url = res.data;
  4192. this.downloadByA('工时异常表.xlsx', url);
  4193. }
  4194. },
  4195. (error) => {
  4196. this.$message({
  4197. message: error,
  4198. type: "error",
  4199. });
  4200. }
  4201. );
  4202. },
  4203. exportMembNotWorkHours() {
  4204. this.http.post(
  4205. "/report/exportNoReportUserList",
  4206. {
  4207. // month: this.date,
  4208. startDate: this.WorktimeDatepickValue[0],
  4209. endDate: this.WorktimeDatepickValue[1],
  4210. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4211. },
  4212. (res) => {
  4213. if (res.code == "ok") {
  4214. let url = res.data;
  4215. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4216. }
  4217. },
  4218. (error) => {
  4219. this.$message({
  4220. message: error,
  4221. type: "error",
  4222. });
  4223. }
  4224. );
  4225. },
  4226. downloadByA(name, url) {
  4227. const a = document.createElement("a"); // 创建a标签
  4228. a.setAttribute("download", name); // download属性
  4229. a.setAttribute("href", url); // href链接
  4230. a.click(); // 自执行点击事件
  4231. a.remove();
  4232. },
  4233. // 是否本月判断
  4234. istoMonth(){
  4235. let todate = new Date()
  4236. let tomonth = todate.getMonth() + 1
  4237. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4238. if(this.date == adate){
  4239. return []
  4240. }else{
  4241. let sedate = new Date(this.date)
  4242. let semonth = sedate.getMonth() + 1
  4243. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4244. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4245. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4246. return [sedates1, sedates2]
  4247. }
  4248. },
  4249. showMonthWorkTime() {
  4250. this.monthTotalPage = 0,
  4251. this.tbload = true
  4252. let parameter={
  4253. startDate: this.WorktimeDatepickValue[0],
  4254. endDate: this.WorktimeDatepickValue[1],
  4255. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4256. }
  4257. this.http.post(
  4258. "/report/getUserDailyWorkTime",
  4259. // "/report/getNoReportUserList",
  4260. parameter,
  4261. (res) => {
  4262. if (res.code == "ok") {
  4263. this.tbload = false;
  4264. this.pickDateArray = res.data.days.map(item => {
  4265. return {
  4266. ...item,
  4267. dateStr: item.label.split('/')[0],
  4268. weekStr: item.label.split('/')[1]
  4269. }
  4270. });
  4271. // console.log('dataarray',res.data.days);
  4272. this.monthWorkData = res.data.list;
  4273. // this.monthWorkDataS = this.monthWorkData
  4274. // this.monthWorkDataS1 = res.data.list
  4275. this.monthTotal = res.data.list.length
  4276. if (this.monthWorkData.length > 50) {
  4277. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4278. }else{
  4279. this.monthWorkDataS = this.monthWorkData
  4280. }
  4281. this.searchScreen(0)
  4282. // this.monthWorkDataS = infoList
  4283. // 判断
  4284. // if (this.monthWorkDataS1.length > 0) {
  4285. // setTimeout(() => {
  4286. // this.tableListener()
  4287. // }, 1000);
  4288. // }
  4289. this.$nextTick(function(){
  4290. this.$refs.hasworkTbl.doLayout();
  4291. });
  4292. // this.$forceUpdate()
  4293. }
  4294. },
  4295. (error) => {
  4296. this.tbload = false
  4297. this.$message({
  4298. message: error,
  4299. type: "error",
  4300. });
  4301. }
  4302. );
  4303. },
  4304. showMonthWorkTimeReminder() {
  4305. this.monthTotalPage = 0,
  4306. this.tbload = true
  4307. let parameter={}
  4308. parameter={
  4309. startDate: this.WorktimeDatepickValue[0],
  4310. endDate: this.WorktimeDatepickValue[1],
  4311. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4312. viewValue:this.isReminder?1:0
  4313. }
  4314. this.http.post(
  4315. "/report/getUserDailyWorkTimeReminder",
  4316. parameter,
  4317. (res) => {
  4318. if (res.code == "ok") {
  4319. this.tbload = false;
  4320. this.monthWorkData = res.data.list;
  4321. this.monthTotal = res.data.list.length
  4322. if (this.monthWorkData.length > 50) {
  4323. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4324. }else{
  4325. this.monthWorkDataS = this.monthWorkData
  4326. }
  4327. this.searchScreen(0)
  4328. this.$nextTick(function(){
  4329. this.$refs.hasworkTbl.doLayout();
  4330. });
  4331. }
  4332. },
  4333. (error) => {
  4334. this.tbload = false
  4335. this.$message({
  4336. message: error,
  4337. type: "error",
  4338. });
  4339. }
  4340. );
  4341. },
  4342. showMonthNotWorkTime() {
  4343. this.monthTotalPage = 0,
  4344. this.tbload = true,
  4345. this.http.post(
  4346. "/report/getNoReportUserList",
  4347. {
  4348. startDate: this.WorktimeDatepickValue[0],
  4349. endDate: this.WorktimeDatepickValue[1],
  4350. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4351. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4352. },
  4353. (res) => {
  4354. if (res.code == "ok") {
  4355. this.tbload = false
  4356. this.monthNotWorkDate = res.data;
  4357. this.monthnotTotal = res.data.length
  4358. if (this.monthNotWorkDate.length > 50) {
  4359. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4360. } else {
  4361. this.monthNotWorkDateS = this.monthNotWorkDate
  4362. }
  4363. this.searchScreen(1)
  4364. this.$nextTick(function(){
  4365. this.$refs.hasworkTbl2.doLayout();
  4366. });
  4367. }
  4368. },
  4369. (error) => {
  4370. this.tbload = false
  4371. this.$message({
  4372. message: error,
  4373. type: "error",
  4374. });
  4375. }
  4376. );
  4377. },
  4378. listScroll(){
  4379. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4380. this.isMore = true
  4381. setTimeout(()=>{
  4382. this.isMore = false
  4383. },1000)
  4384. }else {
  4385. this.isFlag = true
  4386. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4387. this.monthWorkDataS = datalist
  4388. setTimeout(()=>{
  4389. this.isFlag = false
  4390. },300)
  4391. }
  4392. },
  4393. notListScroll(){
  4394. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4395. this.isMore = true
  4396. setTimeout(()=>{
  4397. this.isMore = false
  4398. },1000)
  4399. }else {
  4400. this.isFlag = true
  4401. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4402. this.monthNotWorkDateS = datalist
  4403. // console.log('length',this.monthNotWorkDateS.length)
  4404. setTimeout(()=>{
  4405. this.isFlag = false
  4406. },300)
  4407. }
  4408. },
  4409. getFirstAndLastDay() {
  4410. // 将选定的月份转换为Date对象
  4411. var monthDate = new Date();
  4412. var year = monthDate.getFullYear();
  4413. var month = monthDate.getMonth();
  4414. // 计算起始日和结束日
  4415. var startDay = new Date(year, month, 1);
  4416. var endDay = new Date(year, month + 1, 0);
  4417. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4418. this.WorktimeDatepickValueForMonth=lastmd
  4419. },
  4420. formatDate(date) {
  4421. var year = date.getFullYear();
  4422. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4423. var day = ("0" + date.getDate()).slice(-2);
  4424. return year + "-" + month + "-" + day;
  4425. },
  4426. // 获取默认这zhou日期参数 222
  4427. getLastWeek(e){
  4428. let newdate = new Date()
  4429. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4430. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4431. if(e==1){
  4432. this.WorktimeDatepickValue = lastwd
  4433. this.showMonthWorkTime()
  4434. }else if(e==2){
  4435. this.WorktimeDatepickValue = lastwd
  4436. this.showMonthWorkTimeReminder()
  4437. }else{
  4438. this.WorktimeDatepickValue = lastwd
  4439. this.showMonthNotWorkTime()
  4440. }
  4441. },
  4442. getThisWeek(e){
  4443. let newdate = new Date();
  4444. let nowdate = newdate.toLocaleDateString();
  4445. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4446. if(e==1){
  4447. this.WorktimeDatepickValue = nowwd
  4448. this.showMonthWorkTime()
  4449. }else if(e==2){
  4450. this.WorktimeDatepickValue = nowwd
  4451. this.showMonthWorkTimeReminder()
  4452. }else{
  4453. this.WorktimeDatepickValue = nowwd
  4454. this.showMonthNotWorkTime()
  4455. }
  4456. },
  4457. getDoubleLastWeek(e){
  4458. let newdate = new Date()
  4459. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4460. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4461. if(e==1){
  4462. this.WorktimeDatepickValue = nextwd
  4463. this.showMonthWorkTime()
  4464. }else if(e==2){
  4465. this.WorktimeDatepickValue = nextwd
  4466. this.showMonthWorkTimeReminder()
  4467. }else{
  4468. this.WorktimeDatepickValue = nextwd
  4469. this.showMonthNotWorkTime()
  4470. }
  4471. },
  4472. alreadyAllDate(stime,etime){
  4473. let diffdate = new Array();
  4474. let i=0;
  4475. while(stime<=etime){
  4476. let dateArray = stime.split("-");
  4477. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4478. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4479. let stimewk = this.weekDay[date.getDay()]
  4480. 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')
  4481. 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])
  4482. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4483. let stime_ts = new Date(stime).getTime();
  4484. let next_date = stime_ts + (24*60*60*1000);
  4485. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4486. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4487. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4488. stime = next_dates_y+next_dates_m+next_dates_d;
  4489. i++;
  4490. }
  4491. return diffdate
  4492. },
  4493. getAutoWeekDate(e) {
  4494. let dateString = e;
  4495. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4496. if (dateString.match(dateStringReg)) {
  4497. let presentDate = new Date(dateString),
  4498. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4499. return Array.from(new Array(7), function (val, index) {
  4500. let formatDate = new Date(
  4501. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4502. );
  4503. return (
  4504. formatDate.getFullYear() +
  4505. "-" +
  4506. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4507. "-" +
  4508. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4509. );
  4510. });
  4511. } else {
  4512. throw new Error(
  4513. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4514. );
  4515. }
  4516. },
  4517. onProgressChange() {
  4518. this.$forceUpdate();
  4519. },
  4520. showChooseMembTree() {
  4521. this.chosenMembCount = this.participator.length;
  4522. this.chooseParticipVisible = true;
  4523. },
  4524. onTreeItemChange() {
  4525. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4526. var list = chosenList.filter(item=>item.isUser == 1);
  4527. this.chosenMembCount = list.length;
  4528. },
  4529. findUserInTree() {
  4530. if (this.filterName == '') {
  4531. this.deptMembData = this.allMembData;
  4532. } else {
  4533. var list = this.findRecursively(this.filterName, this.allMembData);
  4534. this.deptMembData = list;
  4535. }
  4536. },
  4537. findRecursively(username, list) {
  4538. var filterList = [];
  4539. for (var i=0;i<list.length; i++) {
  4540. if (list[i].isUser == 1) {
  4541. if (list[i].label.indexOf(username) >= 0) {
  4542. //匹配上了
  4543. filterList.push(list[i]);
  4544. }
  4545. } else if (list[i].children != null && list[i].children.length > 0) {
  4546. var subList = this.findRecursively(username, list[i].children);
  4547. if (subList.length > 0) {
  4548. subList.forEach(s=>filterList.push(s));
  4549. }
  4550. }
  4551. }
  4552. return filterList;
  4553. },
  4554. //确定选择参与人
  4555. chooseParticip() {
  4556. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4557. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4558. //只能选择一个人进行代填,防止任务有问题
  4559. if (this.chosenMembList.length > 1) {
  4560. this.$message({
  4561. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4562. type: "error",
  4563. });
  4564. return;
  4565. }
  4566. this.chooseParticipVisible = false;
  4567. this.workForm.userNames = '';
  4568. this.workForm.userId = [];
  4569. this.participator = [];
  4570. for (var i=0;i<this.chosenMembList.length; i++) {
  4571. this.workForm.userId.push(this.chosenMembList[i].id);
  4572. this.workForm.userNames += this.chosenMembList[i].label+',';
  4573. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4574. this.participator.push(item);
  4575. }
  4576. if (this.workForm.userNames.length > 0) {
  4577. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4578. }
  4579. if(this.user.userNameNeedTranslate == 1) {
  4580. if(this.workForm.userNames) {
  4581. this.workForm.userNames = this.workForm.userNames.split(',')
  4582. }
  4583. }
  4584. //加载该人员的可填报项目
  4585. if (this.workForm.userId.length > 0) {
  4586. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4587. }
  4588. //打通企业微信考勤的情况,获取考勤
  4589. if (this.user.timeType.showCorpwxCardtime) {
  4590. this.getTargetUserCardTime();
  4591. }
  4592. },
  4593. getTargetUserCardTime() {
  4594. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4595. this.http.post('/user-corpwx-time/getUserCardTime',{
  4596. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4597. },
  4598. res => {
  4599. if (res.code == "ok") {
  4600. this.$set(this.workForm,'time', res.data);
  4601. }
  4602. },
  4603. error => {
  4604. this.$message({
  4605. message: error,
  4606. type: "error"
  4607. });
  4608. }
  4609. );
  4610. }
  4611. },
  4612. notifySel(sel){
  4613. // console.log(sel);
  4614. this.notifySelList = sel
  4615. },
  4616. //微信通知人员填写
  4617. Notify(code) {
  4618. if (this.notifySelList.length == 0) return;
  4619. var ids = '';
  4620. this.notifySelList.forEach(f=>{
  4621. ids += f.id+',';
  4622. })
  4623. this.http.post('/user/pushFillReport',{
  4624. ids: ids, date: this.curDate,
  4625. code: code
  4626. },
  4627. res => {
  4628. if (res.code == "ok") {
  4629. this.$message({
  4630. message: this.$t('message.sentSuccessfully'),
  4631. type: "success"
  4632. });
  4633. }
  4634. },
  4635. error => {
  4636. this.$message({
  4637. message: error,
  4638. type: "error"
  4639. });
  4640. }
  4641. );
  4642. },
  4643. //导出人员列表
  4644. exportMemb() {
  4645. if (this.fillMembList.length == 0) return;
  4646. var ids = '';
  4647. this.fillMembList.forEach(f=>{
  4648. ids += f.id+',';
  4649. })
  4650. this.http.post('/user/exportMembList',{
  4651. ids: ids,isFill: this.isFill, date: this.curDate
  4652. },
  4653. res => {
  4654. if (res.code == "ok") {
  4655. var aTag = document.createElement('a');
  4656. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4657. aTag.href = res.data;
  4658. aTag.click();
  4659. }
  4660. },
  4661. error => {
  4662. this.$message({
  4663. message: error,
  4664. type: "error"
  4665. });
  4666. }
  4667. );
  4668. },
  4669. showMembList(fill) {
  4670. this.membListVisible = true;
  4671. if (fill == 0) {
  4672. this.fillMembList = this.unFillList;
  4673. this.isFill = false;
  4674. let leaveList = []
  4675. let unleaveList = []
  4676. for(let i in this.fillMembList){
  4677. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4678. leaveList.push(this.fillMembList[i])
  4679. }else{
  4680. unleaveList.push(this.fillMembList[i])
  4681. }
  4682. }
  4683. this.fillMembList = unleaveList
  4684. this.fillMembList_leave = leaveList
  4685. } else if(fill == 1){
  4686. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4687. this.isFill = true;
  4688. }else{
  4689. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4690. this.isFill = true;
  4691. }
  4692. },
  4693. //获取自己填写的日报状态
  4694. getReportFillStatus() {
  4695. this.http.post('/report/getReportFillStatus',{
  4696. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4697. },
  4698. res => {
  4699. if (res.code == "ok") {
  4700. this.fillStatusList = res.data;
  4701. this.allDate.forEach(d=>{
  4702. var fillInfo = null;
  4703. d.state = null;
  4704. this.fillStatusList.forEach(s=>{
  4705. var d1 = s.createDate.split('-')[2];
  4706. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4707. if (d1.indexOf('0') == 0) {
  4708. d1 = d1.substring(1,d1.length);
  4709. }
  4710. if (d1 == d2) {
  4711. d.state = s.state;
  4712. d.missReport = s.missReport;//是否漏填
  4713. d.exceedCardTime = s.exceedCardTime
  4714. }
  4715. })
  4716. })
  4717. this.$forceUpdate();
  4718. }
  4719. },
  4720. error => {
  4721. this.$message({
  4722. message: error,
  4723. type: "error"
  4724. });
  4725. }
  4726. );
  4727. },
  4728. scrollFunction () {
  4729. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4730. if (this.domObj.attachEvent) { // IE
  4731. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4732. } else if (this.domObj.addEventListener) {
  4733. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4734. }
  4735. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4736. },
  4737. mouseScroll(event) { // google 浏览器下
  4738. let detail = event.wheelDelta || event.detail
  4739. let moveForwardStep = -1
  4740. let moveBackStep = 1
  4741. let step = 0
  4742. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4743. event.preventDefault() // 阻止浏览器默认事件
  4744. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4745. },
  4746. // //左右滚动
  4747. // wheel(e){
  4748. // var a = document.getElementById("dateScroll");
  4749. // var scroll_width = 80; //滚动一下的距离
  4750. // var e = e || window.event, v;
  4751. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4752. // if(v>3||-v>3) v=-v;
  4753. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4754. // e.preventDefault(); //阻止浏览器的默认滚动
  4755. // },
  4756. showExportDialog() {
  4757. this.exportType = 0
  4758. this.exportDialog = true;
  4759. },
  4760. showExportTimeDialog() {
  4761. this.exportTimeDialog = true;
  4762. },
  4763. changeAllTime() {
  4764. //总时长发生改变,自动按比例计算
  4765. this.workForm.domains.forEach(d=>{
  4766. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4767. });
  4768. //计算jsTime
  4769. if (this.workForm.createDate) {
  4770. let sdate = new Date(this.workForm.createDate[0]);
  4771. let edate = new Date(this.workForm.createDate[1]);
  4772. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4773. if (days < 0) {
  4774. days = 0;
  4775. }
  4776. this.jsTime = this.reportTimeType.allday * days;
  4777. }
  4778. },
  4779. // 是否加班的单机事件
  4780. check() {
  4781. this.selected = !this.selected
  4782. this.isNew = this.selected
  4783. },
  4784. updateSubProject() {
  4785. this.$forceUpdate();
  4786. },
  4787. selectDegreeId(domain, index) {
  4788. this.http.post('/report/defaultDegree',{
  4789. projectId: domain.projectId
  4790. },
  4791. res => {
  4792. if (res.code == "ok") {
  4793. if(res.data) {
  4794. this.workForm.domains[index].degreeId = res.data.id + ''
  4795. this.$forceUpdate();
  4796. }
  4797. }
  4798. },
  4799. error => {
  4800. this.$message({
  4801. message: error,
  4802. type: "error"
  4803. });
  4804. }
  4805. );
  4806. },
  4807. //项目选中了, 加载子项目
  4808. selectProject(domain, index) {
  4809. if(!domain.projectId){
  4810. return;
  4811. }
  4812. // 默认选中上次填写的自定义维度
  4813. if(this.yonghuUser.customDegreeActive == 1) {
  4814. this.selectDegreeId(domain, index)
  4815. }
  4816. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4817. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4818. this.http.post('/sub-project/list',{
  4819. projectId: domain.projectId,
  4820. isReport: true
  4821. },
  4822. res => {
  4823. //清空之前选中的子项目
  4824. // this.workForm.domains[index].subProjectId = 0;
  4825. if (res.code == "ok") {
  4826. this.workForm.domains[index].subProjectList = res.data;
  4827. this.workForm.domains[index].subProjectId = null;
  4828. this.$forceUpdate();
  4829. }
  4830. },
  4831. error => {
  4832. this.$message({
  4833. message: error,
  4834. type: "error"
  4835. });
  4836. }
  4837. );
  4838. //项目相关的近期任务
  4839. if (this.user.company.packageProject == 1) {
  4840. this.getRecentTaskList(domain, index);
  4841. //获取项目相关专业
  4842. if (this.user.company.packageEngineering == 1) {
  4843. this.getProjectProfessions(domain, index);
  4844. }
  4845. //获取项目下的任务分组
  4846. this.getTaskGroups(domain, index);
  4847. }
  4848. // 获取项目相关的维度
  4849. // domain.degreeId = null
  4850. this.$set(domain,'degreeId',null)
  4851. this.$set(domain,'multiDegrIdArray',null)
  4852. this.dimension(domain, index);
  4853. //获取项目审核人
  4854. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4855. this.getProjectAuditorList(domain, index);
  4856. } else {
  4857. //按分组的负责人来审核
  4858. domain.projectAuditorId = null;
  4859. domain.projectAuditorName = null;
  4860. domain.auditUserList = null;
  4861. }
  4862. if (this.reportTimeType.type == 3) {
  4863. //新增项目时,自动计算
  4864. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4865. }
  4866. //加载昱众的工作职责
  4867. if (this.user.companyId == this.yuzhongCompId) {
  4868. this.updateResponse(domain);
  4869. }
  4870. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4871. if(reportExtraField4Name || reportExtraField5Name) {
  4872. this.getInfoByProjectId(domain, index)
  4873. }
  4874. },
  4875. getInfoByProjectId(domain, index, flag = true) {
  4876. const { projectId } = domain
  4877. const projectList = this.fillProjectList || this.subFillProjectList
  4878. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4879. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  4880. projectId: projectCode,
  4881. date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1]
  4882. },
  4883. res => {
  4884. if (res.code == "ok") {
  4885. if(flag) {
  4886. this.workForm.domains[index].extraField4 = ''
  4887. this.workForm.domains[index].extraField5 = ''
  4888. }
  4889. if((res.data.orderIds || []).length > 0) {
  4890. this.workForm.domains[index].extraField4 = res.data.orderIds[0]
  4891. }
  4892. this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
  4893. this.workForm.domains[index].reportExtraField5List = res.data.lines || []
  4894. this.$forceUpdate();
  4895. }
  4896. },
  4897. error => {
  4898. this.$message({
  4899. message: error,
  4900. type: "error"
  4901. });
  4902. }
  4903. );
  4904. },
  4905. getRecentTaskList(domain, index) {
  4906. //刷新任务时,清空服务
  4907. this.$set(domain, 'sapServiceId', null);
  4908. this.$set(domain, 'taskId', null);
  4909. var param = {
  4910. projectId: domain.projectId,
  4911. isSubstitude:this.isSubstitude?1:0,
  4912. };
  4913. if (domain.groupId) {
  4914. param.groupId = domain.groupId;
  4915. }
  4916. if (domain.stage) {
  4917. param.stage = domain.stage;
  4918. }
  4919. //专业版代填,获取代填员工的任务
  4920. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4921. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4922. this.$message({
  4923. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4924. type: "error"
  4925. });
  4926. return;
  4927. } else {
  4928. param.userId = this.workForm.userId[0];
  4929. }
  4930. }
  4931. this.http.post('/task/getRecentTask',param,
  4932. res => {
  4933. if (res.code == "ok") {
  4934. this.workForm.domains[index].allTaskList = res.data;
  4935. this.workForm.domains[index].taskList = res.data;
  4936. this.$forceUpdate();
  4937. }
  4938. },
  4939. error => {
  4940. this.$message({
  4941. message: error,
  4942. type: "error"
  4943. });
  4944. }
  4945. );
  4946. },
  4947. //获取项目审核人
  4948. getProjectAuditorList(domainItem, index) {
  4949. if(domainItem.projectId == '') {
  4950. return
  4951. }
  4952. domainItem.projectAuditorId = null;
  4953. domainItem.projectAuditorName = null;
  4954. var param = { projectId: domainItem.projectId};
  4955. if (this.isSubstitude) {
  4956. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4957. param.userId = this.workForm.userId[0];
  4958. }
  4959. }
  4960. this.http.post('/project-auditor/getList',param,
  4961. res => {
  4962. if (res.code == "ok") {
  4963. domainItem.auditUserList = res.data;
  4964. if (res.data.length==0) {
  4965. this.$message({
  4966. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4967. type: "error"
  4968. });
  4969. } else if (res.data.length==1) {
  4970. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4971. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4972. }
  4973. this.$forceUpdate();
  4974. }
  4975. },
  4976. error => {
  4977. this.$message({
  4978. message: error,
  4979. type: "error"
  4980. });
  4981. }
  4982. );
  4983. },
  4984. // 获取维度数据
  4985. dimension(domain, index) {
  4986. if(domain.projectId == '') {
  4987. return
  4988. }
  4989. this.http.post('/project/getDegreeList',{
  4990. projectId: domain.projectId,
  4991. },
  4992. res => {
  4993. if (res.code == "ok") {
  4994. // console.log("维度数据",res.data);
  4995. this.workForm.domains[index].wuduList = res.data
  4996. // this.workForm = this.workForm
  4997. this.$forceUpdate()
  4998. }
  4999. },
  5000. error => {
  5001. this.$message({
  5002. message: error,
  5003. type: "error"
  5004. });
  5005. }
  5006. );
  5007. },
  5008. //切换任务阶段
  5009. changeStages(domain, index) {
  5010. if (domain.stage == null || domain.stage == '') {
  5011. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  5012. } else {
  5013. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  5014. }
  5015. this.getRecentTaskList(domain, index);
  5016. this.$forceUpdate();
  5017. },
  5018. getGroupStages(domain, index, keepStage) {
  5019. // console.log(domain);
  5020. if(!domain.groupId){
  5021. domain.projectAuditorId = ''
  5022. domain.stages = []
  5023. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  5024. domain.taskId = ''
  5025. domain.sapServiceId = ''
  5026. }
  5027. if(this.user.timeType.reportAuditType >= 1){
  5028. domain.auditUserList = []
  5029. }
  5030. this.$forceUpdate();
  5031. return
  5032. }
  5033. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  5034. res => {
  5035. if (res.code == "ok") {
  5036. if (!keepStage) {
  5037. domain.stage = '';
  5038. }
  5039. domain.stages = res.data;
  5040. this.getRecentTaskList(domain, index);
  5041. this.$forceUpdate();
  5042. }
  5043. },
  5044. error => {
  5045. this.$message({
  5046. message: error,
  5047. type: "error"
  5048. });
  5049. });
  5050. //检查当前的项目是否需要获取分组的负责人
  5051. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  5052. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  5053. res => {
  5054. if (res.code == "ok") {
  5055. domain.getProjectAuditorList = res.data;
  5056. domain.auditUserList = res.data;
  5057. if (res.data.length==1) {
  5058. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  5059. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  5060. } else if (res.data.length==0) {
  5061. domain.projectAuditorId = null;
  5062. domain.projectAuditorName = null;
  5063. }
  5064. this.$forceUpdate();
  5065. }
  5066. },
  5067. error => {
  5068. this.$message({
  5069. message: error,
  5070. type: "error"
  5071. });
  5072. });
  5073. }
  5074. },
  5075. getProjectProfessions(domain, index) {
  5076. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  5077. res => {
  5078. if (res.code == "ok") {
  5079. this.workForm.domains[index].professionProgress = res.data;
  5080. this.$forceUpdate();
  5081. }
  5082. },
  5083. error => {
  5084. this.$message({
  5085. message: error,
  5086. type: "error"
  5087. });
  5088. });
  5089. },
  5090. //删除自己的日报
  5091. deleteReport() {
  5092. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5093. confirmButtonText: this.$t('btn.determine'),
  5094. cancelButtonText: this.$t('btn.cancel'),
  5095. type: "warning"
  5096. })
  5097. .then(() => {
  5098. this.listLoading = true;
  5099. this.http.post('/report/delete',{
  5100. userId: this.user.id,
  5101. date: this.workForm.createDate
  5102. },
  5103. res => {
  5104. this.listLoading = false;
  5105. if (res.code == "ok") {
  5106. this.$message({
  5107. message: this.$t('message.successfullyDeleted'),
  5108. type: "success"
  5109. });
  5110. this.getReportList();
  5111. this.getDepartment();
  5112. this.dialogVisible = false;
  5113. } else {
  5114. this.$message({
  5115. message: res.msg,
  5116. type: "error"
  5117. });
  5118. }
  5119. },
  5120. error => {
  5121. this.listLoading = false;
  5122. this.$message({
  5123. message: error,
  5124. type: "error"
  5125. });
  5126. }
  5127. );
  5128. })
  5129. .catch(() => {});
  5130. },
  5131. // 管理员删除日报
  5132. guanli(item) {
  5133. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5134. let param = {date: this.date + day, userId: item.id};
  5135. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5136. confirmButtonText: this.$t('btn.determine'),
  5137. cancelButtonText: this.$t('btn.cancel'),
  5138. type: "warning"
  5139. })
  5140. .then(() => {
  5141. this.listLoading = true;
  5142. this.http.post('/report/delete',param,
  5143. res => {
  5144. this.listLoading = false;
  5145. if (res.code == "ok") {
  5146. this.$message({
  5147. message: this.$t('message.successfullyDeleted'),
  5148. type: "success"
  5149. });
  5150. this.getReportList();
  5151. this.getDepartment();
  5152. this.dialogVisible = false;
  5153. } else {
  5154. this.$message({
  5155. message: res.msg,
  5156. type: "error"
  5157. });
  5158. }
  5159. },
  5160. error => {
  5161. this.listLoading = false;
  5162. this.$message({
  5163. message: error,
  5164. type: "error"
  5165. });
  5166. }
  5167. );
  5168. })
  5169. .catch(() => {});
  5170. },
  5171. selectAll() {
  5172. if (this.isAllSelect) {
  5173. var keys = [];
  5174. this.reportNames.forEach(b=>{
  5175. keys.push(b.id);
  5176. })
  5177. this.$refs.approveTree.setCheckedKeys(keys);
  5178. } else {
  5179. this.$refs.approveTree.setCheckedKeys([]);
  5180. }
  5181. },
  5182. removeEmptyNode(list) {
  5183. for (var i=0;i<list.length;i++) {
  5184. var cnt = 0;
  5185. if (list[i].membCount == 0) {
  5186. list.splice(i, 1);
  5187. i--;
  5188. } else if (list[i].children != null) {
  5189. this.removeEmptyNode(list[i].children);
  5190. }
  5191. }
  5192. },
  5193. calculateMembCount(list) {
  5194. for (var i in list) {
  5195. var cnt = 0;
  5196. if (list[i].children != null) {
  5197. this.calculateMembCount(list[i].children);
  5198. for (var m in list[i].children) {
  5199. cnt += list[i].children[m].membCount;
  5200. }
  5201. }
  5202. if (list[i].isUser == 1) {
  5203. cnt++;
  5204. this.membCount++;
  5205. }
  5206. list[i].membCount = cnt;
  5207. }
  5208. },
  5209. stateChange() {
  5210. // console.log(this.allData,'alldate');
  5211. this.membCount = 0;
  5212. if (this.selectState == -1) {
  5213. //全部状态
  5214. this.data = this.allData;
  5215. } else {
  5216. //未填报
  5217. this.seluserText = ''
  5218. var newData = JSON.parse(JSON.stringify(this.allData));
  5219. this.filterState(this.selectState, newData);
  5220. this.data = newData;
  5221. }
  5222. this.calculateMembCount(this.data);
  5223. this.data[0].membCount = this.membCount;//总人数
  5224. },
  5225. //按状态过滤部门人员
  5226. filterState(state, list) {
  5227. for (var i =0;i<list.length; i++) {
  5228. var obj = list[i];
  5229. if (obj.isUser == 1) {
  5230. var match = false;
  5231. if (state == -2) {
  5232. if (obj.state == null) {
  5233. match = true;
  5234. }
  5235. } else {
  5236. if (obj.state == state) {
  5237. match = true;
  5238. }
  5239. }
  5240. if (!match) {
  5241. list.splice(i, 1);
  5242. i--;
  5243. } else {
  5244. }
  5245. } else {
  5246. if (obj.children != null) {
  5247. this.filterState(state, obj.children);
  5248. }
  5249. }
  5250. }
  5251. },
  5252. //a按名称过滤部门人员
  5253. async seluserforText(){
  5254. const { userNameNeedTranslate } = this.user
  5255. this.membCount = 0;
  5256. var newData = JSON.parse(JSON.stringify(this.allData));
  5257. let textList = [this.seluserText]
  5258. if(userNameNeedTranslate == 1) {
  5259. this.dataLoading = true
  5260. let res = await this.postData('/user/getEmployeeList', {
  5261. keyword: this.seluserText,
  5262. cursor: '',
  5263. departmentId: -1,
  5264. pageIndex: 1,
  5265. pageSize: 1000
  5266. })
  5267. textList = res.data.records.map(item => item.name)
  5268. this.dataLoading = false
  5269. }
  5270. // return
  5271. this.seluserforTextin(this.seluserText, newData, textList)
  5272. this.data = newData;
  5273. this.calculateMembCount(this.data);
  5274. this.data[0].membCount = this.membCount;//总人数
  5275. },
  5276. seluserforTextin(text, list, textList = []){
  5277. for (var i =0;i<list.length; i++) {
  5278. var obj = list[i];
  5279. if (obj.isUser == 1) {
  5280. var match = false;
  5281. // if (obj.label.indexOf(text) != -1) {
  5282. // match = true
  5283. // }
  5284. if(textList.some(item => item.includes(obj.label))) {
  5285. match = true
  5286. }
  5287. if (!match) {
  5288. list.splice(i, 1);
  5289. i--;
  5290. } else {
  5291. }
  5292. } else {
  5293. if (obj.children != null) {
  5294. this.seluserforTextin(text, obj.children, textList);
  5295. }
  5296. }
  5297. }
  5298. },
  5299. // 当节点发生变化时
  5300. nodeChangeExpand(data) {
  5301. // 保存当前展开的节点
  5302. let flag = false
  5303. this.nodeModelData.some(item => {
  5304. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5305. flag = true
  5306. return true
  5307. }
  5308. })
  5309. if (!flag) { // 不存在则存到数组里
  5310. this.nodeModelData.push(data.id)
  5311. }
  5312. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5313. },
  5314. nodeChangeCollapse(data) {
  5315. this.nodeModelData.some((item, i) => {
  5316. if (item === data.id) {
  5317. this.nodeModelData.length = i
  5318. }
  5319. })
  5320. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5321. },
  5322. // 部门列表点击
  5323. handleNodeClick(data) {
  5324. // this.dealList = data
  5325. this.theValues(data.id, this.allData)
  5326. // this.depData = data;
  5327. var list = [];
  5328. if (data.id == -1) {
  5329. this.deptId = null;
  5330. this.targetUid = null;
  5331. list = this.data;
  5332. } else if (data.isUser == 1) {
  5333. this.deptId = null;
  5334. this.targetUid = data.id;
  5335. } else {
  5336. this.deptId = data.id;
  5337. this.targetUid = null;
  5338. list.push(data);
  5339. }
  5340. this.getReportList();
  5341. if (list.length > 0) {
  5342. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5343. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5344. }
  5345. },
  5346. exportPushLog(){
  5347. this.http.post('/sap-sync-log/export',{},
  5348. res => {
  5349. if (res.code == "ok") {
  5350. var filePath = res.data;
  5351. var fName = '推送日志.xlsx'
  5352. const a = document.createElement('a'); // 创建a标签
  5353. a.setAttribute('download', fName);// download属性
  5354. a.setAttribute('href', filePath);// href链接
  5355. a.click(); //自执行点击事件
  5356. a.remove();
  5357. } else {
  5358. this.$message({
  5359. message: res.msg,
  5360. type: "error"
  5361. });
  5362. }
  5363. },
  5364. error => {
  5365. this.$message({
  5366. message: error,
  5367. type: "error"
  5368. });
  5369. });
  5370. },
  5371. theValues(id, item) {
  5372. for(var i in item) {
  5373. if(item[i].id == id) {
  5374. this.depData = item[i]
  5375. if(id == '-1') {
  5376. this.translation = '1'
  5377. } else {
  5378. if(item[i].children) {
  5379. this.translation = '2'
  5380. } else {
  5381. this.translation = '3'
  5382. }
  5383. }
  5384. return
  5385. } else {
  5386. if(item[i].children) {
  5387. this.theValues(id, item[i].children)
  5388. }
  5389. }
  5390. }
  5391. },
  5392. //获取可以选择的代填的人员列表
  5393. getSubstitudeUserDeptList() {
  5394. if (this.deptMembData.length == 0) {
  5395. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5396. res => {
  5397. if (res.code == "ok") {
  5398. let noAllData = JSON.parse(JSON.stringify(res.data));
  5399. if (noAllData.length > 0) {
  5400. // if (noAllData[0].label == '全部人员') {
  5401. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5402. noAllData.splice(0,1);
  5403. }
  5404. }
  5405. this.setUserToDept(noAllData);
  5406. this.deptMembData = noAllData;
  5407. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5408. } else {
  5409. this.$message({
  5410. message: res.msg,
  5411. type: "error"
  5412. });
  5413. }
  5414. },
  5415. error => {
  5416. this.$message({
  5417. message: error,
  5418. type: "error"
  5419. });
  5420. });
  5421. }
  5422. },
  5423. // 获取部门列表
  5424. getDepartmentForApprove() {
  5425. this.http.post( this.port.manage.depList, {},
  5426. res => {
  5427. if (res.code == "ok") {
  5428. var list1 = JSON.parse(JSON.stringify(res.data));
  5429. this.deptOptionList = this.changeArr(list1);
  5430. } else {
  5431. this.$message({
  5432. message: res.msg,
  5433. type: "error"
  5434. });
  5435. }
  5436. },
  5437. error => {
  5438. this.$message({
  5439. message: error,
  5440. type: "error"
  5441. });
  5442. });
  5443. },
  5444. // 获取部门列表
  5445. getDepartment() {
  5446. //如果没有权限,就不需要获取
  5447. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5448. return;
  5449. }
  5450. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5451. var param = {date:this.date + day};
  5452. this.http.post("/report/getMembList", param,
  5453. res => {
  5454. if (res.code == "ok") {
  5455. if(res.data.length == 0){
  5456. return
  5457. }
  5458. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5459. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5460. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5461. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5462. // if (this.user.role > 0) {
  5463. // }
  5464. list.splice(0,0,{
  5465. id: -1,
  5466. label: this.$t('lable.allStaff'),
  5467. })
  5468. this.membCount = 0;
  5469. //设置员工到部门下面
  5470. this.setUserToDept(list);
  5471. this.data = list;
  5472. // console.log('data',this.data);
  5473. this.expandDate = [this.data[1].id]
  5474. this.allData = list;
  5475. // if (noAllData.length > 0) {
  5476. // if (noAllData[0].label == '全部人员') {
  5477. // noAllData.splice(0,1);
  5478. // }
  5479. // }
  5480. // this.setUserToDept(noAllData);
  5481. // this.deptMembData = noAllData;
  5482. this.option = this.changeArr(list1);
  5483. list[0].membCount = this.membCount;
  5484. if (this.depData.id == -1) {
  5485. this.depData.membCount = this.membCount;
  5486. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5487. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5488. } else {
  5489. if (this.depData.isUser == null) {
  5490. var dep = this.findTargetDept(this.data, this.depData.id);
  5491. var membDeptList = [];
  5492. membDeptList.push(dep);
  5493. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5494. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5495. }
  5496. }
  5497. if (this.depData.isUser == null) {
  5498. if (this.isFill) {
  5499. this.fillMembList = this.fillList;
  5500. } else {
  5501. this.fillMembList = this.unFillList;
  5502. }
  5503. }
  5504. this.leaveAllNum = 0
  5505. for(let i in this.unFillList){
  5506. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5507. this.leaveAllNum += 1
  5508. }
  5509. }
  5510. this.stateChange()
  5511. } else {
  5512. this.$message({
  5513. message: res.msg,
  5514. type: "error"
  5515. });
  5516. }
  5517. },
  5518. error => {
  5519. this.$message({
  5520. message: error,
  5521. type: "error"
  5522. });
  5523. });
  5524. this.getReportFillStatus();
  5525. },
  5526. findTargetDept(list, deptId) {
  5527. var t = null;
  5528. for (var i=0;i<list.length; i++) {
  5529. if (list[i].isUser == null && list[i].id == deptId) {
  5530. t = list[i];
  5531. break;
  5532. }
  5533. }
  5534. if (t == null) {
  5535. for (var i=0;i<list.length; i++) {
  5536. if (list[i].children != null && list[i].children.length > 0) {
  5537. t = this.findTargetDept(list[i].children, deptId);
  5538. if (t != null) {
  5539. break;
  5540. }
  5541. }
  5542. }
  5543. }
  5544. return t;
  5545. },
  5546. getUserMembListFromDeptList(list, isFill) {
  5547. var membList = [];
  5548. for (var i in list) {
  5549. var deptName = list[i].label;
  5550. if (list[i].userList != null) {
  5551. list[i].userList.forEach(element => {
  5552. if (isFill == 0) {
  5553. //获取未填的
  5554. if (element.state == null) {
  5555. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5556. membList.push(obj);
  5557. }
  5558. } else {
  5559. if (element.state != null) {
  5560. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5561. membList.push(obj);
  5562. }
  5563. }
  5564. });
  5565. }
  5566. if (list[i].children != null) {
  5567. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5568. }
  5569. }
  5570. return membList;
  5571. },
  5572. setUserToDept(list) {
  5573. for (var i in list) {
  5574. var cnt = 0;
  5575. if (list[i].children != null) {
  5576. this.setUserToDept(list[i].children);
  5577. for (var m in list[i].children) {
  5578. cnt += list[i].children[m].membCount;
  5579. }
  5580. }
  5581. if (list[i].userList != null) {
  5582. if (list[i].children == null) {
  5583. list[i].children = [];
  5584. }
  5585. list[i].userList.forEach(element => {
  5586. var obj = {
  5587. id: element.id,
  5588. label:element.name,
  5589. state:element.state,
  5590. parentId:element.departmentId,
  5591. isUser:1,
  5592. workingTime: element.workingTime,
  5593. leaveDays: element.leaveDays,
  5594. leaveTimes: element.leaveTimes
  5595. };
  5596. list[i].children.push(obj);
  5597. this.membCount++;
  5598. cnt++;
  5599. });
  5600. }
  5601. list[i].membCount = cnt;
  5602. }
  5603. },
  5604. // 修改数组
  5605. changeArr(arr) {
  5606. for (var i = 0; i < arr.length; i++) {
  5607. if(arr[i].id != -1 && arr[i].id != 0) {
  5608. if (arr[i].children != null && arr[i].children.length>0) {
  5609. arr[i].children = this.changeArr(arr[i].children);
  5610. }
  5611. arr[i].id && (arr[i].value = arr[i].id);
  5612. delete arr[i].id;
  5613. }
  5614. }
  5615. for(var i in arr) {
  5616. if(arr[i].id == -1 || arr[i].id == 0) {
  5617. arr.splice(i,1)
  5618. }
  5619. }
  5620. return arr;
  5621. },
  5622. //时间段范围设置改动,监听
  5623. onTimeTypeChange(timeType) {
  5624. this.seleChn(1)
  5625. this.showAddMore = true;
  5626. for(var i in this.workForm.domains) {
  5627. if (this.workForm.domains[i].timeType == 0) {
  5628. this.showAddMore = false;
  5629. break;
  5630. }
  5631. }
  5632. if (this.showAddMore) {
  5633. //检测数量
  5634. if (this.workForm.domains.length == 2) {
  5635. this.showAddMore = false;
  5636. } else {
  5637. this.showAddMore = true;
  5638. }
  5639. }
  5640. },
  5641. getTimeType() {
  5642. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5643. res => {
  5644. if (res.code == "ok") {
  5645. var t = res.data;
  5646. this.reportTimeType = t;
  5647. if (this.reportTimeType.type > 0) {
  5648. this.showAddMore = true;
  5649. }
  5650. //转化时间格式
  5651. if (t.allday != null) {
  5652. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5653. }
  5654. if (t.am != null) {
  5655. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5656. }
  5657. if (t.pm != null) {
  5658. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5659. }
  5660. let arr = []
  5661. for(var i in res.data.excludeTimeList) {
  5662. let obj = {
  5663. s: res.data.excludeTimeList[i].startTime,
  5664. e: res.data.excludeTimeList[i].endTime,
  5665. }
  5666. arr.push(obj)
  5667. }
  5668. this.vacationTime = arr
  5669. } else {
  5670. this.$message({
  5671. message: res.msg,
  5672. type: "error"
  5673. });
  5674. }
  5675. },
  5676. error => {
  5677. this.listLoading = false;
  5678. this.$message({
  5679. message: error,
  5680. type: "error"
  5681. });
  5682. });
  5683. },
  5684. // 改变月份 -------
  5685. changeMonthOut() {
  5686. this.getAllDate();
  5687. this.getReportList();
  5688. this.getDepartment();
  5689. },
  5690. // 选择日期
  5691. choseDate(i, item) {
  5692. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5693. return
  5694. }
  5695. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5696. this.choseDay = i;
  5697. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5698. sessionStorage.msg = this.date + day,
  5699. this.getReportList();
  5700. this.getDepartment();
  5701. this.curDate = item.date;
  5702. },
  5703. canClick(i, item){
  5704. let nowDate = new Date()
  5705. let nowDateYear = nowDate.getFullYear()
  5706. let itemYear = parseInt(this.date.split('-')[0])
  5707. let nowDateMonth = nowDate.getMonth() + 1
  5708. let itemMonth = parseInt(this.date.split('-')[1])
  5709. let nowDateDay = nowDate.getDate()
  5710. let itemDay = parseInt(item.showDate.split('.')[1])
  5711. if(nowDateYear < itemYear){
  5712. return false
  5713. }else if(nowDateYear == itemYear){
  5714. if(nowDateMonth < itemMonth){
  5715. return false
  5716. }else if(nowDateMonth == itemMonth){
  5717. if(nowDateDay < itemDay){
  5718. return false
  5719. }
  5720. }
  5721. }
  5722. },
  5723. // 获取日期列表
  5724. getAllDate(e) {
  5725. var dayArry = [];
  5726. var day = this.getCountDays();
  5727. let curMonthDay = null;
  5728. for (var k = 1; k <= day; k++) {
  5729. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5730. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5731. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5732. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5733. if(sessionStorage.msg) {
  5734. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5735. this.choseDay = k - 1;
  5736. curMonthDay = str;
  5737. }
  5738. } else {
  5739. if (new Date().getDate() == k) {
  5740. this.choseDay = k - 1;
  5741. }
  5742. }
  5743. } else {
  5744. this.choseDay = 0;
  5745. }
  5746. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5747. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5748. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5749. }
  5750. this.allDate = dayArry;
  5751. //不能超过最大日期
  5752. if (this.choseDay > day-1) {
  5753. this.choseDay = day-1;
  5754. }
  5755. if(sessionStorage.from != 1){
  5756. let nowmonth = new Date().getMonth() + 1
  5757. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5758. let nowdate = new Date().getDate()
  5759. if(nowd == this.date){
  5760. if(e && sessionStorage.msg){
  5761. }else{
  5762. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5763. }
  5764. let nowday = new Date(sessionStorage.msg).getDate()
  5765. this.choseDay = nowday - 1
  5766. let monthdate = new Date(sessionStorage.msg)
  5767. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5768. }else{
  5769. if(e && sessionStorage.msg){
  5770. }else{
  5771. sessionStorage.msg = this.date + '-01'
  5772. }
  5773. let monthdate = new Date(sessionStorage.msg)
  5774. this.choseDay = monthdate.getDate() - 1
  5775. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5776. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5777. }
  5778. }else{
  5779. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5780. }
  5781. //从消息点击跳转过来的,直接加载指定日期
  5782. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5783. this.curDate = sessionStorage.msg;
  5784. sessionStorage.from = 0;
  5785. } else {
  5786. // if (curMonthDay != null) {
  5787. // // this.curDate = curMonthDay;
  5788. // let d = new Date(sessionStorage.msg)
  5789. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5790. // } else {
  5791. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5792. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5793. // }
  5794. }
  5795. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5796. // if(!sessionStorage.msg){
  5797. // let msgday = this.choseDay + 1
  5798. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5799. // }
  5800. this.getReportFillStatus();
  5801. },
  5802. getCountDays() {
  5803. var newstr = this.date.replace(/-/g, "/");
  5804. var curDate = new Date(newstr+'/01');
  5805. var curMonth = curDate.getMonth();
  5806. curDate.setMonth(curMonth + 1);
  5807. curDate.setDate(0);
  5808. return curDate.getDate();
  5809. },
  5810. reqMore() {
  5811. if (this.hasMore) {
  5812. this.pageIndex++;
  5813. this.requestHttpReports();
  5814. }
  5815. },
  5816. //加载日报数据
  5817. requestHttpReports() {
  5818. //请求数据
  5819. this.listLoading = true;
  5820. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5821. let param = {date: this.date + day};
  5822. if (this.deptId) {
  5823. param.deptId = this.deptId;
  5824. }
  5825. if (this.targetUid) {
  5826. param.userId = this.targetUid;
  5827. }
  5828. //传页码
  5829. if (this.hasMore) {
  5830. param.pageIndex = this.pageIndex;
  5831. }
  5832. this.http.post( this.port.report.list, param,
  5833. res => {
  5834. this.listLoading = false;
  5835. if (res.code == "ok") {
  5836. //扩增
  5837. if (res.data.data.length > 0) {
  5838. this.reportList = this.reportList.concat(res.data.data);
  5839. } else if (this.pageIndex > 1){
  5840. this.$message({
  5841. message: this.$t('meiYouGengDuoShuJuLe'),
  5842. type: "info"
  5843. });
  5844. }
  5845. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5846. if(document.querySelector("#day"+this.choseDay)){
  5847. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5848. }
  5849. } else {
  5850. this.$message({
  5851. message: res.msg,
  5852. type: "error"
  5853. });
  5854. }
  5855. },
  5856. error => {
  5857. this.listLoading = false;
  5858. this.$message({
  5859. message: error,
  5860. type: "error"
  5861. });
  5862. });
  5863. },
  5864. //获取日报列表
  5865. getReportList() {
  5866. //初始化,重置数据
  5867. this.pageIndex = 0;
  5868. this.hasMore = true;
  5869. this.reportList = [];
  5870. this.requestHttpReports();
  5871. },
  5872. //刷新日报状态,用于审核后更新
  5873. refreshReportData(reportId) {
  5874. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5875. res => {
  5876. if (res.code == "ok") {
  5877. for (var m=0;m<this.reportList.length; m++) {
  5878. var d = this.reportList[m].data;
  5879. var find = d.filter(r=>r.id == reportId);
  5880. if (find.length > 0) {
  5881. find[0].state = res.data.state;
  5882. if (find[0].state == 2) {//被驳回,要可以编辑
  5883. this.reportList[m].state = 2;
  5884. }
  5885. find[0].isDeptAudit = res.data.isDeptAudit;
  5886. find[0].departmentAuditState = res.data.departmentAuditState;
  5887. find[0].projectAuditorName = res.data.projectAuditorName;
  5888. find[0].projectAuditorId = res.data.projectAuditorId;
  5889. find[0].projectAuditState = res.data.projectAuditState;
  5890. find[0].rejectUserid = res.data.rejectUserid;
  5891. find[0].rejectUsername = res.data.rejectUsername;
  5892. find[0].rejectReason = res.data.rejectReason;
  5893. this.$forceUpdate();
  5894. break;
  5895. }
  5896. }
  5897. } else {
  5898. this.$message({
  5899. message: res.msg,
  5900. type: "error"
  5901. });
  5902. }
  5903. },
  5904. error => {
  5905. this.listLoading = false;
  5906. this.$message({
  5907. message: error,
  5908. type: "error"
  5909. });
  5910. });
  5911. },
  5912. //导出员工工时统计
  5913. exportUserTime() {
  5914. this.listLoading = true;
  5915. var param = {};
  5916. if (this.exportParam.dateRange != null) {
  5917. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5918. }
  5919. this.http.post('/department/exportDeptStatistic', param,
  5920. res => {
  5921. this.listLoading = false;
  5922. if (res.code == "ok") {
  5923. location.href = res.data;
  5924. this.exportTimeDialog = false;
  5925. } else {
  5926. this.$message({
  5927. message: res.msg,
  5928. type: "error"
  5929. });
  5930. }
  5931. },
  5932. error => {
  5933. this.listLoading = false;
  5934. this.$message({
  5935. message: error,
  5936. type: "error"
  5937. });
  5938. });
  5939. },
  5940. //导出日报
  5941. exportReport() {
  5942. this.exportingData = true;
  5943. var param = {};
  5944. if (this.exportParam.dateRange != null) {
  5945. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5946. }
  5947. if (this.exportParam.projectId != null) {
  5948. param.projectId = this.exportParam.projectId;
  5949. }
  5950. if (this.exportParam.departmentId != null) {
  5951. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5952. param.departmentIds = this.exportParam.departmentId.join(',')
  5953. }
  5954. param.stateKey = this.stateKey
  5955. // param.departmentId = this.user.departmentId
  5956. this.http.post(this.port.report.export, param,
  5957. res => {
  5958. this.exportingData = false;
  5959. if (res.code == "ok") {
  5960. var filePath = res.data;
  5961. const a = document.createElement('a'); // 创建a标签
  5962. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5963. a.setAttribute('href', filePath);// href链接
  5964. a.click(); //自执行点击事件
  5965. a.remove();
  5966. this.exportDialog = false;
  5967. } else {
  5968. this.$message({
  5969. message: res.msg,
  5970. type: "error"
  5971. });
  5972. }
  5973. },
  5974. error => {
  5975. this.exportingData = false;
  5976. this.$message({
  5977. message: error,
  5978. type: "error"
  5979. });
  5980. });
  5981. },
  5982. //导出日报审核记录
  5983. exportReportLog() {
  5984. this.exportingData = true;
  5985. var param = {};
  5986. if (this.exportReportLogParam.dateRange != null) {
  5987. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5988. }
  5989. this.http.post('/report-log/exportReportLog', param,
  5990. res => {
  5991. this.exportingData = false;
  5992. if (res.code == "ok") {
  5993. var filePath = res.data;
  5994. const a = document.createElement('a'); // 创建a标签
  5995. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5996. a.setAttribute('href', filePath);// href链接
  5997. a.click(); //自执行点击事件
  5998. a.remove();
  5999. this.exportDialog = false;
  6000. } else {
  6001. this.$message({
  6002. message: res.msg,
  6003. type: "error"
  6004. });
  6005. }
  6006. },
  6007. error => {
  6008. this.exportingData = false;
  6009. this.$message({
  6010. message: error,
  6011. type: "error"
  6012. });
  6013. });
  6014. },
  6015. restUserCardTime(item){
  6016. let param={}
  6017. param.userId=item.userId
  6018. param.createDate=item.createDate
  6019. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  6020. res => {
  6021. if (res.code == "ok") {
  6022. this.showMonthWorkTimeReminder()
  6023. } else {
  6024. this.$message({
  6025. message: res.msg,
  6026. type: "error"
  6027. });
  6028. }
  6029. },
  6030. error => {
  6031. this.$message({
  6032. message: error,
  6033. type: "error"
  6034. });
  6035. });
  6036. },
  6037. importReportLog(item){
  6038. //首先判断文件类型
  6039. let str = item.file.name.split(".");
  6040. let format = str[str.length - 1];
  6041. if (format != "xls" && format != "xlsx") {
  6042. this.$message({
  6043. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  6044. type: "error"
  6045. });
  6046. } else {
  6047. const loading = this.$loading({
  6048. lock: true,
  6049. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  6050. spinner: 'el-icon-loading',
  6051. background: 'rgba(0, 0, 0, 0.7)'
  6052. });
  6053. let formData = new FormData();
  6054. formData.append("multipartFile", item.file);
  6055. this.http.uploadFile('/report-log/importReportLogChange', formData,
  6056. res => {
  6057. this.$refs.upload.clearFiles();
  6058. loading.close();
  6059. if (res.code == "ok") {
  6060. this.$message({
  6061. message: res.msg,
  6062. type: "success"
  6063. });
  6064. } else {
  6065. this.$message({
  6066. message: res.msg,
  6067. type: "error"
  6068. });
  6069. }
  6070. },
  6071. error => {
  6072. this.$refs.upload.clearFiles();
  6073. loading.close();
  6074. this.$message({
  6075. message: error,
  6076. type: "error"
  6077. });
  6078. });
  6079. }
  6080. },
  6081. //获取项目列表
  6082. getProjectList() {
  6083. this.listLoading = true;
  6084. this.http.post( this.port.project.list, {},
  6085. res => {
  6086. this.listLoading = false;
  6087. if (res.code == "ok") {
  6088. for(var i in res.data) {
  6089. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6090. res.data[i].projectCode = ''
  6091. }
  6092. }
  6093. this.projectList = res.data;
  6094. } else {
  6095. this.$message({
  6096. message: res.msg,
  6097. type: "error"
  6098. });
  6099. }
  6100. },
  6101. error => {
  6102. this.listLoading = false;
  6103. this.$message({
  6104. message: error,
  6105. type: "error"
  6106. });
  6107. });
  6108. },
  6109. getSubUsersFillProjectList(userId) {
  6110. this.http.post( this.port.project.list, {
  6111. forReport: 1,
  6112. userId: userId
  6113. },res => {
  6114. if (res.code == "ok") {
  6115. for(var i in res.data) {
  6116. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6117. res.data[i].projectCode = ''
  6118. }
  6119. }
  6120. this.subFillProjectList = res.data;
  6121. this.getRecentlyProject(userId)
  6122. } else {
  6123. this.$message({
  6124. message: res.msg,
  6125. type: "error"
  6126. });
  6127. }
  6128. },
  6129. error => {
  6130. this.$message({
  6131. message: error,
  6132. type: "error"
  6133. });
  6134. });
  6135. },
  6136. // 获取填报日报的项目下拉列表
  6137. getFillProjectList() {
  6138. this.http.post( this.port.project.list, {
  6139. forReport: 1
  6140. },res => {
  6141. if (res.code == "ok") {
  6142. for(var i in res.data) {
  6143. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6144. res.data[i].projectCode = ''
  6145. }
  6146. }
  6147. this.fillProjectList = res.data;
  6148. this.getRecentlyProject()
  6149. } else {
  6150. this.$message({
  6151. message: res.msg,
  6152. type: "error"
  6153. });
  6154. }
  6155. },
  6156. error => {
  6157. this.$message({
  6158. message: error,
  6159. type: "error"
  6160. });
  6161. });
  6162. },
  6163. //自己填写日报时,刷新到自己的可填报日报列表
  6164. refreshToMyReportProjectList() {
  6165. this.getRecentlyProject();
  6166. },
  6167. getBasecostItemList() {
  6168. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6169. companyId: this.user.companyId
  6170. },
  6171. res => {
  6172. if (res.code == "ok") {
  6173. this.timeBasecostList = res.data;
  6174. }
  6175. });
  6176. },
  6177. getAIReport(createDate) {
  6178. this.http.post('/report/getAIReport', {},
  6179. res => {
  6180. if (res.code == "ok") {
  6181. var quanbu = 0
  6182. this.jsDay = 1
  6183. var zhi = ''
  6184. var slp = res.data
  6185. for(var i in slp) {
  6186. var sp = +slp[i].workingTime + 0
  6187. zhi = this.jsDay * sp
  6188. quanbu = +quanbu + zhi
  6189. }
  6190. this.jsTime = quanbu
  6191. var aiReportData = res.data;
  6192. this.canCancelInDialog = false
  6193. if(aiReportData.length != 0) {
  6194. var arr = [];
  6195. for(var i in aiReportData) {
  6196. arr.push({
  6197. id: null,
  6198. projectId: aiReportData[i].projectId,
  6199. workingTime: aiReportData[i].workingTime,
  6200. content: '',
  6201. progress:100,
  6202. state: 2,
  6203. timeType: aiReportData[i].timeType,
  6204. subProjectList: aiReportData[i].subProjectList,
  6205. taskList: aiReportData[i].taskList,
  6206. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6207. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6208. taskId: aiReportData[i].taskId,
  6209. startTime: aiReportData[i].startTime,
  6210. endTime: aiReportData[i].endTime,
  6211. isOvertime: 0,
  6212. progress:aiReportData[i].progress,
  6213. professionProgress: aiReportData[i].professionProgressList,
  6214. stages:aiReportData[i].stages,
  6215. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6216. pics: null,
  6217. multiWorktime: aiReportData[i].multiWorktime || 0,
  6218. worktimeList: [{}],
  6219. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6220. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6221. wuduList: aiReportData[i].degreeList,
  6222. taskGroups:aiReportData[i].taskGroups,
  6223. customData: aiReportData[i].customData,//自定义的数值
  6224. auditUserList: aiReportData[i].auditUserList,
  6225. projectAuditorId: aiReportData[i].projectAuditorId,
  6226. projectAuditorName: aiReportData[i].projectAuditorName,
  6227. overtimeHours: aiReportData[i].overtimeHours,
  6228. customText: aiReportData[i].customText,
  6229. basecostId: aiReportData[i].basecostId,
  6230. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6231. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6232. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6233. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6234. canEdit: true
  6235. })
  6236. }
  6237. this.workForm.domains = arr;
  6238. } else {
  6239. }
  6240. this.canEdit = true;
  6241. this.originCanEdit = true;
  6242. this.seleChn()
  6243. } else {
  6244. this.$message({
  6245. message: res.msg,
  6246. type: "error"
  6247. });
  6248. }
  6249. },
  6250. error => {
  6251. this.$message({
  6252. message: error,
  6253. type: "error"
  6254. });
  6255. });
  6256. },
  6257. // 获取个人某天的日报 111111
  6258. getReport() {
  6259. this.http.post( this.port.report.getPort, {
  6260. date: this.workForm.createDate
  6261. },
  6262. res => {
  6263. if (res.code == "ok") {
  6264. var quanbu = 0
  6265. this.jsDay = 1
  6266. var zhi = ''
  6267. var slp = res.data.report
  6268. for(var i in slp) {
  6269. var sp = +slp[i].workingTime + 0
  6270. zhi = this.jsDay * sp
  6271. quanbu = +quanbu + zhi
  6272. }
  6273. this.jsTime = quanbu
  6274. var list = res.data;
  6275. this.report = list;
  6276. this.reportTimeType = this.report.timeType;
  6277. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6278. this.isWeekend = !this.report.isWorkDay;
  6279. this.canCancelInDialog = false;
  6280. this.hasWrittenReport = list.report.length != 0;
  6281. if(list.report.length != 0) {
  6282. var arr = [];
  6283. this.canEdit = false;
  6284. let candelete = true
  6285. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6286. for(var i in list.report) {
  6287. var flg = null
  6288. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6289. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6290. var filteredRespList = null
  6291. if (targetP.length > 0) {
  6292. var isPublic = targetP[0].isPublic;
  6293. 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);
  6294. }
  6295. let copyData = {
  6296. id: list.report[i].id,
  6297. projectId: list.report[i].projectId,
  6298. workingTime: list.report[i].workingTime,
  6299. content: list.report[i].content,
  6300. state: list.report[i].state,
  6301. timeType: list.report[i].timeType,
  6302. subProjectList: list.report[i].subProjectList,
  6303. taskList: list.report[i].taskList,
  6304. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6305. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6306. taskId: list.report[i].taskId,
  6307. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6308. startTime: list.report[i].startTime,
  6309. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6310. endTime: list.report[i].endTime,
  6311. isOvertime: flg,
  6312. progress:list.report[i].progress,
  6313. professionProgress: list.report[i].professionProgressList,
  6314. stages:list.report[i].stages,
  6315. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6316. pics: list.report[i].pics,
  6317. multiWorktime: list.report[i].multiWorktime,
  6318. worktimeList: list.report[i].worktimeList,
  6319. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6320. multiDegrIdArray: list.report[i].multiDegrIdList,
  6321. wuduList: list.report[i].degreeList,
  6322. taskGroups:list.report[i].taskGroups,
  6323. customData: list.report[i].customData,//自定义的数值
  6324. auditUserList: list.report[i].auditUserList,
  6325. overtimeHours: list.report[i].overtimeHours,
  6326. customText: list.report[i].customText,
  6327. basecostId: list.report[i].basecostId,
  6328. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6329. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6330. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6331. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6332. canEdit: list.report[i].state >= 2 ? true : false,
  6333. extraField1: list.report[i].extraField1,
  6334. extraField2: list.report[i].extraField2,
  6335. extraField3: list.report[i].extraField3,
  6336. extraField4: list.report[i].extraField4,
  6337. extraField5: list.report[i].extraField5,
  6338. workContentList: list.report[i].workContentList,
  6339. filteredRespList: filteredRespList,
  6340. serviceList: list.report[i].serviceList,
  6341. sapServiceId: list.report[i].sapServiceId,
  6342. reportTargetDeptId: list.report[i].deptId
  6343. }
  6344. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6345. //分组负责人审核的情况下,前端不需要显示,无需设置
  6346. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6347. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6348. }
  6349. arr.push(copyData);
  6350. if (list.report[i].state >= 2) {
  6351. this.canEdit = true;
  6352. }
  6353. if(list.report[i].state < 2){
  6354. candelete = false
  6355. }
  6356. if (list.report[i].state == 0){
  6357. this.canCancelInDialog = true
  6358. }
  6359. // 加判断
  6360. if(this.user.timeType.choseFromAlbum == 1) {
  6361. let arrList = []
  6362. for(var k in list.report[i].pics) {
  6363. let obj = {
  6364. name: k,
  6365. url: list.report[i].pics[k]
  6366. }
  6367. arrList.push(obj)
  6368. }
  6369. arr[i].imgListUrl = arrList
  6370. arr[i].imgList = list.report[i].pics
  6371. }
  6372. if(reportExtraField4Name || reportExtraField5Name) {
  6373. this.getInfoByProjectId(copyData, i, false)
  6374. }
  6375. }
  6376. this.reportCanDelete = candelete
  6377. this.workForm = {
  6378. createDate: this.workForm.createDate,
  6379. domains: arr,
  6380. userNames:null,
  6381. userId:null,
  6382. time: list.time,
  6383. showRefresh: list.showRefresh
  6384. }
  6385. } else {
  6386. this.workForm = {
  6387. createDate: this.workForm.createDate,
  6388. domains: [{
  6389. id: null,
  6390. projectId: "",
  6391. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6392. content: "",
  6393. progress:100,
  6394. state: 2,
  6395. timeType:0,
  6396. multiWorktime: this.reportTimeType.multiWorktime,
  6397. worktimeList:[{}],
  6398. canEdit: true,
  6399. auditorFirst: '',
  6400. auditorSec: '',
  6401. auditorThird: '',
  6402. ccUserid: ''
  6403. }],
  6404. userId:null,
  6405. userNames:null,
  6406. time: this.report.time,
  6407. showRefresh: list.showRefresh
  6408. }
  6409. // businessTrips 有数据的情况下
  6410. const businessTrips = res.data.businessTrips || []
  6411. this.businessTripsArray = res.data.businessTrips || []
  6412. if(businessTrips.length > 0) {
  6413. this.workForm.domains = businessTrips.map((item, index) => {
  6414. return {
  6415. id: null,
  6416. projectId: item.projectId,
  6417. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6418. content: "",
  6419. progress:100,
  6420. state: 2,
  6421. timeType:0,
  6422. multiWorktime: this.reportTimeType.multiWorktime,
  6423. worktimeList:[{}],
  6424. canEdit: true,
  6425. auditorFirst: '',
  6426. auditorSec: '',
  6427. auditorThird: '',
  6428. ccUserid: ''
  6429. }
  6430. })
  6431. for(let domainsIndex in this.workForm.domains) {
  6432. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6433. }
  6434. }
  6435. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6436. this.$set(this.workForm.domains[0],'isOvertime',true)
  6437. if(this.reportTimeType.type != 2){
  6438. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6439. }
  6440. }
  6441. if(this.user.timeType.type == 1) {
  6442. var shuzhi = this.user.timeType.allday + ''
  6443. // console.log('执行一次', shuzhi.indexOf('.'))
  6444. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6445. }
  6446. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6447. //默认给第一个,必填字段
  6448. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6449. }
  6450. this.canEdit = true;
  6451. }
  6452. this.originCanEdit = this.canEdit;
  6453. this.seleChn()
  6454. } else {
  6455. this.$message({
  6456. message: res.msg,
  6457. type: "error"
  6458. });
  6459. }
  6460. },
  6461. error => {
  6462. this.$message({
  6463. message: error,
  6464. type: "error"
  6465. });
  6466. });
  6467. },
  6468. guanbi() {
  6469. this.falsss = false,
  6470. this.workTimeForMinYi=0
  6471. },
  6472. // 打开日报填写
  6473. fillInReport(i, isBatch) {
  6474. this.isWeekend = false
  6475. this.reportCanDelete = false
  6476. // console.log(this.user.timeType.type, '选择时长')
  6477. if(i != 1) {
  6478. this.falsss = false
  6479. } else {
  6480. this.falsss = true
  6481. }
  6482. if (this.isSubstitude) {
  6483. this.getSubstitudeUserDeptList();
  6484. } else {
  6485. this.refreshToMyReportProjectList();
  6486. }
  6487. if(i == -1 || this.isSubstitude) {
  6488. this.isDisable = false;
  6489. } else {
  6490. this.isDisable = true;
  6491. }
  6492. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6493. this.isBatch = isBatch;
  6494. if (this.isBatch == 0 && !this.isSubstitude) {
  6495. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6496. let weekday = new Date(this.workForm.createDate).getDay()
  6497. if(this.user.companyId == 817){
  6498. if(weekday == 0){
  6499. this.isWeekend = true
  6500. }
  6501. }else{
  6502. if(weekday == 0 || weekday == 6){
  6503. this.isWeekend = true
  6504. }
  6505. }
  6506. this.getReport(i);
  6507. } else {
  6508. this.jsTime = 0
  6509. this.jsDay = 0
  6510. this.workForm = {
  6511. createDate: null,//批量填报没有日期
  6512. domains: [{
  6513. id: null,
  6514. projectId: "",
  6515. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6516. content: "",
  6517. progress:100,
  6518. state: 2,
  6519. timeType:0,
  6520. multiWorktime: this.reportTimeType.multiWorktime,
  6521. worktimeList:[{}],
  6522. canEdit: true,
  6523. }],
  6524. }
  6525. if(this.user.timeType.type == 1) {
  6526. var shuzhi = this.user.timeType.allday + ''
  6527. // console.log('执行二次')
  6528. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6529. }
  6530. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6531. this.workForm.showRefresh = true;
  6532. }
  6533. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6534. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6535. }
  6536. this.canEdit = true;
  6537. }
  6538. if (this.isSubstitude) {
  6539. //代填情况,默认计算合计工时
  6540. this.jsDay = 1
  6541. this.seleChn();
  6542. }
  6543. this.dialogVisible = true;
  6544. },
  6545. //按周填报的弹窗口中编辑单项目相关数据
  6546. setWeekFormReportItem(reportId, i, names, row,sss) {
  6547. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6548. this.http.post('/report/getReportById', {
  6549. reportId: reportId
  6550. },
  6551. res => {
  6552. if (res.code == "ok") {
  6553. var data = res.data.report;
  6554. sss.subProjectId = data.subProjectId
  6555. sss.subProjectList = data.subProjectList;
  6556. sss.stage = data.stage
  6557. sss.subProjectList = data.subProjectList
  6558. sss.stages = data.stages
  6559. sss.taskGroups = data.taskGroups;
  6560. sss.auditUserList = data.auditUserList;
  6561. sss.degreeId = data.degreeId;
  6562. sss.customData = data.customData;
  6563. sss.wuduList = data.degreeList;
  6564. if(reportExtraField4Name || reportExtraField5Name) {
  6565. sss.extraField4 = data.extraField4 || ''
  6566. sss.extraField5 = data.extraField5 || ''
  6567. }
  6568. this.zhoBaoIdx = i
  6569. this.zhoBaoName = names
  6570. this.zhoBao = sss
  6571. this.zhis = row
  6572. if (sss.groupId) {
  6573. //最后一个参数表示是否保留stage的值,不要重置为空
  6574. this.getGroupStages(this.zhoBao, 0, true)
  6575. }
  6576. if(reportExtraField4Name || reportExtraField5Name) {
  6577. this.weekGetInfoByProjectId(sss)
  6578. }
  6579. this.$forceUpdate();
  6580. }
  6581. });
  6582. },
  6583. // 重新计算合计
  6584. fillInThePedometerOnAWeeklyBasis(index) {
  6585. const weeklyItem = this.zhoData[index] || {}
  6586. const dynamicProjectList = this.selProjectList || []
  6587. const collectionArray = dynamicProjectList.map(item => {
  6588. const name = item.projectName
  6589. return Number(weeklyItem[name].workingTime || 0)
  6590. })
  6591. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6592. this.zhoData[index].he = totalNum
  6593. },
  6594. //输入工时触发
  6595. onInputWorkTime(index) {
  6596. const weeklyItem = this.zhoData[index] || {}
  6597. },
  6598. // 按周填报里内容的填写
  6599. showWeekItemEdit(item, i, projectId,names, row) {
  6600. if (item.state == 0) {
  6601. this.$message({
  6602. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6603. type: "error"
  6604. });
  6605. return;
  6606. }
  6607. if (item.state == 1) {
  6608. this.$message({
  6609. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6610. type: "error"
  6611. });
  6612. return;
  6613. }
  6614. if(this.user.timeType.notAllowedNoAttendance == 1){
  6615. if(this.zhoData[i].corpTime){
  6616. if(this.zhoData[i].corpTime.workHours == 0){
  6617. this.$message({
  6618. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6619. type: 'error'
  6620. })
  6621. return
  6622. }
  6623. }else{
  6624. this.$message({
  6625. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6626. type: 'error'
  6627. })
  6628. return
  6629. }
  6630. }
  6631. var obj = {}
  6632. obj.projectId = projectId
  6633. this.tianxieDialogVisible = true
  6634. this.scopess = item
  6635. var sss = {}
  6636. if (item.id != null) {
  6637. sss.id = item.id;
  6638. sss.state = item.state;
  6639. } else {
  6640. sss.id = -1;
  6641. sss.state = 3;
  6642. }
  6643. sss.projectId = projectId;
  6644. sss.progress = item.progress
  6645. sss.time = item.time
  6646. sss.content = item.content;
  6647. if (sss.time == '' && this.reportTimeType.type == 2) {
  6648. //取已填时间范围中最大的一个作为开始时间
  6649. var startTime = '09:00';
  6650. var fillStartTime = '00:00';
  6651. for (var t in this.selProjectList) {
  6652. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6653. if (fillItem.time) {
  6654. if (fillItem.time[1] > fillStartTime) {
  6655. fillStartTime = fillItem.time[1];
  6656. }
  6657. }
  6658. }
  6659. if (fillStartTime == '00:00') {
  6660. fillStartTime = '09:00';
  6661. }
  6662. var fillEndMax = '18:00';
  6663. if (fillStartTime >= '18:00') {
  6664. fillEndMax = '23:59';
  6665. }
  6666. sss.time = [fillStartTime, fillEndMax];
  6667. }
  6668. sss.groupId = item.groupId
  6669. sss.stage = item.stage;
  6670. sss.workingTime = item.workingTime
  6671. sss.projectAuditorId = item.projectAuditorId;
  6672. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6673. //默认选中第一个
  6674. sss.basecostId = this.timeBasecostList[0].id;
  6675. }
  6676. var hasEdited = this.zhoData[i][names].hasEdited;
  6677. if (hasEdited) {
  6678. console.log('执行到了这个')
  6679. console.log('执行到了这个', { ...item }, obj)
  6680. sss = { ...item }
  6681. //编辑过了
  6682. sss.subProjectId = item.subProjectId
  6683. sss.stage = item.stage
  6684. sss.subProjectList = item.subProjectList
  6685. sss.stages = item.stages
  6686. sss.taskGroups = item.taskGroups;
  6687. // sss.auditUserList = obj.auditUserList ;
  6688. sss.degreeId = item.degreeId;
  6689. sss.customData = item.customData;
  6690. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6691. //只有一个审核人,自动设置上去
  6692. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6693. }
  6694. sss.wuduList = item.wuduList;
  6695. this.zhoBaoIdx = i
  6696. this.zhoBaoName = names
  6697. this.zhoBao = sss
  6698. this.zhis = row
  6699. if (sss.groupId) {
  6700. //最后一个参数表示是否保留stage的值,不要重置为空
  6701. this.getGroupStages(this.zhoBao, 0, true)
  6702. }
  6703. this.$forceUpdate();
  6704. this.getWeeklyTaskList(sss)
  6705. } else {
  6706. //第一次打开,获取数据
  6707. if (sss.id == -1) {
  6708. //新填报的
  6709. this.selectProject(obj, 0);
  6710. var that = this
  6711. setTimeout(() =>{
  6712. sss.subProjectId = that.workForm.domains[0].subProjectId
  6713. sss.subProjectList = item.subProjectList;
  6714. sss.stage = that.workForm.domains[0].stage
  6715. sss.subProjectList = that.workForm.domains[0].subProjectList
  6716. sss.stages = that.workForm.domains[0].stages
  6717. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6718. sss.auditUserList = obj.auditUserList;
  6719. sss.degreeId = item.degreeId;
  6720. sss.customData = item.customData;
  6721. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6722. //只有一个审核人,自动设置上去
  6723. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6724. }
  6725. sss.wuduList = row[0].wuduList
  6726. that.zhoBaoIdx = i
  6727. that.zhoBaoName = names
  6728. that.zhoBao = sss
  6729. that.zhis = row
  6730. if (sss.groupId) {
  6731. //最后一个参数表示是否保留stage的值,不要重置为空
  6732. this.getGroupStages(that.zhoBao, 0, false)
  6733. }
  6734. that.$forceUpdate();
  6735. this.getWeeklyTaskList(sss)
  6736. },600);
  6737. } else {
  6738. //编辑填报过的;数据库已经存在的
  6739. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6740. }
  6741. if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
  6742. setTimeout(() => {
  6743. this.weekGetInfoByProjectId(sss)
  6744. }, 1000)
  6745. }
  6746. }
  6747. },
  6748. weekGetInfoByProjectId(item) {
  6749. console.log(item, '<=== item')
  6750. const { projectId } = item
  6751. const projectList = this.fillProjectList || this.subFillProjectList
  6752. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6753. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  6754. projectId: projectCode,
  6755. date: this.zhoData[this.zhoBaoIdx].zhoDataTime
  6756. },
  6757. res => {
  6758. if (res.code == "ok") {
  6759. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6760. this.zhoBao.reportExtraField5List = res.data.lines || []
  6761. if((res.data.orderIds || []).length > 0) {
  6762. this.zhoBao.extraField4 = res.data.orderIds[0]
  6763. }
  6764. console.log(this.zhoBao, '<===== this.zhoBao')
  6765. this.$forceUpdate();
  6766. }
  6767. },
  6768. error => {
  6769. this.$message({
  6770. message: error,
  6771. type: "error"
  6772. });
  6773. });
  6774. // console.log(item)
  6775. // console.log(this.zhoBao)
  6776. },
  6777. // 按周填报里内容的填写点击确定
  6778. setWeekProItemData() {
  6779. //专业版模式下,任务分组和阶段必填
  6780. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6781. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6782. this.$message({
  6783. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6784. type: "error"
  6785. });
  6786. return;
  6787. }
  6788. }
  6789. // 检查任务分组
  6790. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6791. this.$message({
  6792. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6793. type: "error"
  6794. });
  6795. return
  6796. }
  6797. //检查子项目是否必填
  6798. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6799. this.$message({
  6800. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6801. type: "error"
  6802. });
  6803. return;
  6804. }
  6805. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6806. this.$message({
  6807. message: this.$t('message.Pleaseselectareviewer'),
  6808. type: "error"
  6809. });
  6810. return
  6811. }
  6812. if(this.user.timeType.reportAuditType == 3){
  6813. let auditTips = ''
  6814. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6815. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6816. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6817. if(auditTips){
  6818. auditTips = auditTips.substring(0,auditTips.length - 1)
  6819. this.$message({
  6820. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6821. type: 'error'
  6822. })
  6823. return
  6824. }
  6825. }
  6826. let errtips = ''
  6827. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6828. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6829. errtips += this.user.timeType.customDegreeName + '、'
  6830. }
  6831. }
  6832. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6833. errtips += this.user.timeType.customDataName + '、'
  6834. }
  6835. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6836. errtips += this.user.timeType.customTextName + '、'
  6837. }
  6838. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6839. errtips += this.$t('other.workMatters') +'、'
  6840. }
  6841. if(errtips){
  6842. errtips = errtips.substring(0,errtips.length - 1)
  6843. this.$message({
  6844. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6845. type: 'error'
  6846. })
  6847. return
  6848. }
  6849. this.tianxieDialogVisible = false
  6850. var zhong = this.zhoData
  6851. this.zhoBao.hasEdited = true;
  6852. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6853. this.zhoData = zhong
  6854. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6855. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6856. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6857. },
  6858. // 获取本周
  6859. getCurrentWeek() {
  6860. //今天
  6861. this.targetWeekDate = new Date();
  6862. this.initWeekFormData();
  6863. // this.jiazai()
  6864. },
  6865. // 获取上周
  6866. handleGetPrevWeek() {
  6867. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6868. this.initWeekFormData();
  6869. // this.jiazai()
  6870. },
  6871. // 获取下周
  6872. handleGetNextvWeek() {
  6873. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6874. this.initWeekFormData()
  6875. },
  6876. // 加载动画
  6877. jiazai() {
  6878. this.weekDataLoading = true
  6879. var that = this
  6880. setTimeout(() =>{
  6881. that.weekDataLoading = false
  6882. },1000);
  6883. },
  6884. // 转时间格式
  6885. dealdate(date) {
  6886. const dt = new Date(date)
  6887. const y = dt.getFullYear()
  6888. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6889. const d = (dt.getDate() + '').padStart(2, '0')
  6890. return `${y}-${m}-${d}`
  6891. },
  6892. // 按周填报
  6893. fillInReportss() {
  6894. window.addEventListener('scroll', this.handleScroll, true)
  6895. // this.jiazai()
  6896. this.fillWeekDialogVisi = true;
  6897. if (this.isSubstitude) {
  6898. this.substitudeStep = 1;
  6899. this.getSubstitudeUserDeptList();
  6900. } else {
  6901. this.getCurrentWeek();
  6902. }
  6903. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6904. //重新获取工时预警类型的预算项
  6905. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6906. companyId: this.user.companyId
  6907. },
  6908. res => {
  6909. if (res.code == "ok") {
  6910. this.timeBasecostList = res.data;
  6911. }
  6912. });
  6913. }
  6914. },
  6915. fillInReportCustom() {
  6916. this.weekIndex++
  6917. this.weekParentData = {
  6918. isSubstitude: this.isSubstitude
  6919. }
  6920. this.fillWeekDialogVisiCustom = true
  6921. },
  6922. // 按周填报的项目筛选
  6923. selListFun(){
  6924. this.selProjectList = []
  6925. if(this.selCon.length){
  6926. for (let i = 0; i < this.selCon.length; i++) {
  6927. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6928. }
  6929. this.selConShow = false ;
  6930. for (let i in this.zhoData) {
  6931. var obj = this.zhoData[i];
  6932. for(var j in this.selProjectList) {
  6933. var xinzhi = this.selProjectList[j].projectName
  6934. obj[xinzhi] = {}
  6935. obj[xinzhi].time = ''
  6936. obj[xinzhi].content = ''
  6937. obj[xinzhi].progress = 0
  6938. obj[xinzhi].workingTime = 0
  6939. }
  6940. }
  6941. this.initWeekFormData();
  6942. }else{
  6943. this.$message({
  6944. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6945. type:'error'
  6946. })
  6947. }
  6948. },
  6949. setWeekCardTimeData(list) {
  6950. for(let i in list){
  6951. let datei = '';
  6952. if (this.user.timeType.showDdCardtime == 1) {
  6953. datei = list[i].workDate;
  6954. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6955. datei = list[i].createDate;
  6956. } else if (this.user.timeType.syncFanwei == 1) {
  6957. datei = list[i].workDate;
  6958. }
  6959. for(let m in this.zhoData) {
  6960. if(datei == this.zhoData[m].zhoDataTime){
  6961. let item = {
  6962. startTime: list[i].startTime,
  6963. endTime: list[i].endTime,
  6964. workHours: list[i].workHours,
  6965. otTime: list[i].otTime
  6966. }
  6967. this.$set(this.zhoData[m],'corpTime',item)
  6968. }
  6969. }
  6970. }
  6971. },
  6972. getWeeklyCardTime(){ //按周填报获取考勤信息
  6973. let dateStr = []
  6974. for(let i in this.zhoData){
  6975. dateStr.push(this.zhoData[i].zhoDataTime)
  6976. }
  6977. this.http.post('/report/getWeeklyCardTime',{
  6978. dateStr: JSON.stringify(dateStr)
  6979. },res => {
  6980. if(res.code == 'ok'){
  6981. for(let i in res.data){
  6982. let datei = '';
  6983. if (this.user.timeType.showDdCardtime == 1) {
  6984. datei = res.data[i].workDate.split('-');
  6985. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6986. datei = res.data[i].createDate.split('-');
  6987. }
  6988. for(let m in this.zhoData){
  6989. let datem = new Date(this.zhoData[m].zhoDataTime)
  6990. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6991. let item = {
  6992. startTime: res.data[i].startTime,
  6993. endTime: res.data[i].endTime,
  6994. workHours: res.data[i].workHours
  6995. }
  6996. this.$set(this.zhoData[m],'corpTime',item)
  6997. }
  6998. }
  6999. }
  7000. }else{
  7001. this.$message({
  7002. message: res.msg,
  7003. type: 'error'
  7004. })
  7005. }
  7006. },err => {
  7007. this.$message({
  7008. message: err,
  7009. type: 'error'
  7010. })
  7011. })
  7012. },
  7013. selListqx(){
  7014. this.fillWeekDialogVisi = false
  7015. this.selProjectList = []
  7016. this.selCon = []
  7017. },
  7018. handleScroll() {
  7019. this.changdu = this.projectList.length + 1
  7020. },
  7021. // 自动选择时间点的事件
  7022. // async zhoTimes(item, i) {
  7023. // var iss = i
  7024. // if(item.time == null) {
  7025. // return
  7026. // } else {
  7027. // const zhi = this.zhoData[iss];
  7028. // let he = 0;
  7029. // const timeArr = Object.values(zhi)
  7030. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  7031. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  7032. // const data = await this.getWeekHoursByTimeRange(timeArr);
  7033. // console.log(data, 'data');
  7034. // zhi.he = `${he}h`;
  7035. // }
  7036. // },
  7037. async zhoTimes(item, index) {
  7038. const zho = this.zhoData[index];
  7039. if (!item.time) {
  7040. return;
  7041. }
  7042. const timeArr = Object.values(zho)
  7043. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  7044. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  7045. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  7046. zho.he = `${totalHours[0]}h`;
  7047. },
  7048. // 判断两个时间段是否重叠
  7049. timeOverlap(idx, dateAr) {
  7050. let zhi = 0
  7051. for (let k in dateAr) {
  7052. if (idx !== k) {
  7053. 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))) {
  7054. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  7055. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  7056. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  7057. }
  7058. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  7059. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7060. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  7061. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7062. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7063. } else {
  7064. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  7065. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  7066. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  7067. }
  7068. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  7069. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  7070. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7071. }
  7072. }
  7073. }
  7074. }
  7075. }
  7076. return zhi
  7077. },
  7078. // 计算时间
  7079. getHourMinutes(str, end) {
  7080. var he = 0
  7081. var date2 = '2021/12/12 ' + end +':00'
  7082. var date1 = '2021/12/12 ' + str +':00'
  7083. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  7084. var leave1=date3%(24*3600*1000)
  7085. var hours=Math.floor(leave1/(3600*1000))
  7086. var leave2=leave1%(3600*1000)
  7087. var minutes=Math.floor(leave2/(60*1000))
  7088. var shi = hours+'.'+ minutes
  7089. return he += +shi
  7090. },
  7091. // 自动选择事件长度的事件
  7092. zhoXuan(item, i) {
  7093. var iss = i
  7094. if(item.time == null) {
  7095. return
  7096. } else {
  7097. var zhi = this.zhoData[iss]
  7098. var he = 0
  7099. for(var i in zhi) {
  7100. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  7101. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  7102. console.log('执行')
  7103. he += +zhi[i].workingTime
  7104. }
  7105. }
  7106. zhi.he = he + 'h'
  7107. }
  7108. },
  7109. getPushWorkLogData(){
  7110. this.http.post('/sap-sync-log/list', {},
  7111. res => {
  7112. if (res.code == "ok") {
  7113. this.pushWorkTimeLogData = res.data;
  7114. } else {
  7115. this.$message({
  7116. message: res.msg,
  7117. type: "error"
  7118. });
  7119. }
  7120. },
  7121. error => {
  7122. this.$message({
  7123. message: error,
  7124. type: "error"
  7125. });
  7126. });
  7127. },
  7128. // 获取全部人员
  7129. getUsers() {
  7130. this.http.post('/user/getSimpleActiveUserList', {},
  7131. res => {
  7132. if (res.code == "ok") {
  7133. this.usersList = res.data;
  7134. } else {
  7135. this.$message({
  7136. message: res.msg,
  7137. type: "error"
  7138. });
  7139. }
  7140. },
  7141. error => {
  7142. this.$message({
  7143. message: error,
  7144. type: "error"
  7145. });
  7146. });
  7147. },
  7148. // 按时间比例
  7149. addBli(item, i) {
  7150. var iss = i
  7151. if(item.time == null) {
  7152. return
  7153. } else {
  7154. var zhi = this.zhoData[iss]
  7155. var he = 0
  7156. for(var i in zhi) {
  7157. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7158. he += +zhi[i].workingTime
  7159. }
  7160. }
  7161. zhi.he = he.toFixed(1) + 'h'
  7162. }
  7163. },
  7164. //按周填报选择的项目发生变化,需要设置列
  7165. onSelProjectChange() {
  7166. for (let i = 0; i < this.selCon.length; i++) {
  7167. var exists = false;
  7168. for (let j = 0; j < this.selProjectList.length; j++) {
  7169. if (this.selProjectList[j].id == this.selCon[i]) {
  7170. exists = true;
  7171. break;
  7172. }
  7173. }
  7174. if (!exists) {
  7175. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7176. this.selProjectList.push(newProject);
  7177. //添加新项目
  7178. for (var w in this.zhoData) {
  7179. var dayItem = this.zhoData[w];
  7180. var pName = newProject.projectName;
  7181. dayItem[pName] = {};
  7182. dayItem[pName].time = ''
  7183. dayItem[pName].content = ''
  7184. dayItem[pName].progress = 0
  7185. dayItem[pName].workingTime = 0
  7186. }
  7187. }
  7188. }
  7189. //去掉
  7190. for (let j = 0; j < this.selProjectList.length; j++) {
  7191. var exists = false;
  7192. for (let i = 0; i < this.selCon.length; i++) {
  7193. if (this.selProjectList[j].id == this.selCon[i]) {
  7194. exists = true;
  7195. break;
  7196. }
  7197. }
  7198. if (!exists) {
  7199. this.selProjectList.splice(j, 1);
  7200. j--;
  7201. }
  7202. }
  7203. this.loadFilledWeekReportItem();
  7204. //刷新表格
  7205. // this.$refs.weekTable.doLayout();
  7206. },
  7207. //根据选中的项目来刷新填写表格
  7208. loadFilledWeekReportItem() {
  7209. for (var w in this.zhoData) {
  7210. var dayItem = this.zhoData[w];
  7211. for (var i = 0; i < this.selProjectList.length; i++) {
  7212. var curColumnProject = this.selProjectList[i];
  7213. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7214. for (var t in dayItem.reportList) {
  7215. //有日报的项目,不能取消选择
  7216. for (var p in this.fillProjectList) {
  7217. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7218. }
  7219. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7220. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7221. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7222. if (this.reportTimeType.type == 2) {
  7223. //时间段模式
  7224. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7225. }
  7226. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7227. break;
  7228. }
  7229. }
  7230. // dayItem[curColumnProject.projectName] = matchReportItem;
  7231. }
  7232. }
  7233. this.$nextTick(()=>{
  7234. this.$refs.weekTable.doLayout();
  7235. });
  7236. },
  7237. initWeekFormData() {
  7238. this.weekDataLoading = true;
  7239. for (var p in this.fillProjectList) {
  7240. this.fillProjectList[p].canCancel = 1;
  7241. }
  7242. var param = {
  7243. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7244. };
  7245. if (this.isSubstitude) {
  7246. //传代填人的userId
  7247. param.targetUserId = this.workForm.userId[0];
  7248. }
  7249. this.http.post('/report/getWeeklyReportData',param,res => {
  7250. this.weekDataLoading = false;
  7251. if(res.code == 'ok'){
  7252. let projectList = res.data.projectList;
  7253. if (projectList.length > 0) {
  7254. //有选择过项目进行填报,直接选中
  7255. this.selProjectList = projectList;
  7256. this.selCon = [];
  7257. for (let i = 0; i < projectList.length; i++) {
  7258. this.selCon.push(projectList[i].id);
  7259. }
  7260. }
  7261. //设置日期
  7262. this.weekDateRange = res.data.dateList;
  7263. this.zhoData = [];
  7264. var arrst = []
  7265. for(var i in this.weekDateRange) {
  7266. var obj = {}
  7267. obj.zhoDataTime = this.weekDateRange[i].date
  7268. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7269. obj.he = this.weekDateRange[i].filledTime;
  7270. obj.canFill = this.weekDateRange[i].canFill;
  7271. // obj.filledTime = this.weekDateRange[i].filledTime;
  7272. obj.reportList = this.weekDateRange[i].reportList;
  7273. //初始化,防止渲染报错
  7274. for (var j = 0; j < this.selProjectList.length; j++) {
  7275. var pName = this.selProjectList[j].projectName
  7276. obj[pName] = {}
  7277. obj[pName].time = ''
  7278. obj[pName].content = ''
  7279. obj[pName].progress = 0
  7280. obj[pName].workingTime = 0
  7281. }
  7282. arrst.push(obj)
  7283. }
  7284. this.zhoData = arrst
  7285. this.setWeekCardTimeData(res.data.cardTimeList);
  7286. this.loadFilledWeekReportItem();
  7287. }else{
  7288. this.$message({
  7289. message: res.msg,
  7290. type: 'error'
  7291. })
  7292. }
  7293. },err => {
  7294. this.$message({
  7295. message: err,
  7296. type: 'error'
  7297. })
  7298. })
  7299. },
  7300. zhoZhi(res, i) {
  7301. var zhi = 0
  7302. for(var i in res) {
  7303. if(i != 'zhoDataTime' && i != 'he') {
  7304. zhi += +res[i]
  7305. }
  7306. }
  7307. res.he = zhi
  7308. },
  7309. zhoBtn(i) {
  7310. // this.zhoData.split(i, 1)
  7311. var arr = this.zhoData
  7312. arr.splice(i, 1)
  7313. },
  7314. zhoAddlast(){
  7315. this.selConShow = true
  7316. },
  7317. closeAddWeeklyReport(){
  7318. this.fillWeekDialogVisi = false
  7319. this.selConShow = true
  7320. this.selProjectList = []
  7321. this.selCon = []
  7322. },
  7323. checkDateWorkTime() {
  7324. //针对苏州景昱,单独的检查逻辑
  7325. if (this.user.companyId == 5978) {
  7326. //调接口,先检查工时是否存在异常
  7327. var zhi = this.zhoData;
  7328. var array = [];
  7329. for(let n in zhi){
  7330. if(zhi[n].he){
  7331. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7332. array.push(workData)
  7333. }
  7334. }
  7335. this.submitingReport = true;
  7336. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7337. res => {
  7338. this.submitingReport = false;
  7339. if (res.code == "ok") {
  7340. this.submitWeekReport(0)
  7341. } else {
  7342. this.$confirm(res.msg, this.$t('other.prompts'), {
  7343. confirmButtonText: this.$t('huLveBingTiJiao'),
  7344. cancelButtonText: this.$t('btn.cancel'),
  7345. type: 'error'
  7346. }).then(() => {
  7347. this.submitWeekReport(0)
  7348. }).catch(() => {
  7349. });
  7350. }
  7351. },
  7352. error => {
  7353. this.$message({
  7354. message: error,
  7355. type: "error"
  7356. });
  7357. });
  7358. }
  7359. },
  7360. // 提交按周填报
  7361. submitWeekReport(isDraft) {
  7362. var zhi = this.zhoData
  7363. var ll = 0
  7364. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7365. if(this.reportTimeType.type == 2) {
  7366. for(var i in zhi) {
  7367. this.dateAr = []
  7368. var alp = []
  7369. var zhis = zhi[i]
  7370. for(var j in zhis) {
  7371. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7372. let objs = {}
  7373. objs.s = zhis[j].time[0]
  7374. objs.e = zhis[j].time[1]
  7375. objs.p = j
  7376. alp.push(objs)
  7377. }
  7378. }
  7379. this.dateAr = alp
  7380. if (this.reportTimeType.timeCanOverlap == 0) {
  7381. let str = this.$t('message.Filledtimeperiodsoverlap')
  7382. if(this.dateAr.length > 0) {
  7383. const trus = this.fns();
  7384. const overlapDataTime = this.getOverlapData(alp);
  7385. if (overlapDataTime.length > 0) {
  7386. const arrList = overlapDataTime.map((item) => item.p);
  7387. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7388. }
  7389. ll += 1
  7390. if(!trus) {
  7391. this.$message({
  7392. message: str,
  7393. type: 'error'
  7394. })
  7395. return false
  7396. }
  7397. }
  7398. } else {
  7399. if(this.dateAr.length > 0) {
  7400. ll +=1 ;
  7401. }
  7402. }
  7403. }
  7404. if(ll == 0) {
  7405. this.$message({
  7406. message: this.$t('message.Pleasefillinthetime'),
  7407. type: 'error'
  7408. })
  7409. return false
  7410. }
  7411. } else if(this.reportTimeType.type == 1){
  7412. for(var i in zhi) {
  7413. var zhis = zhi[i]
  7414. for(var j in zhis) {
  7415. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7416. ll += 1
  7417. }
  7418. }
  7419. }
  7420. if(ll == 0) {
  7421. this.$message({
  7422. message: this.$t('message.Pleaseselectatime'),
  7423. type: 'error'
  7424. })
  7425. return false
  7426. }
  7427. let overcorp = ''
  7428. for(let n in zhi){
  7429. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7430. overcorp += zhi[n].zhoDataTime + ','
  7431. }
  7432. }
  7433. if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
  7434. overcorp = overcorp.substring(0,overcorp.length - 1)
  7435. this.$message({
  7436. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7437. type: 'error'
  7438. })
  7439. return
  7440. }
  7441. }
  7442. var submits = []
  7443. let formData = new FormData();
  7444. formData.append("draft", isDraft);
  7445. if(this.reportTimeType.multiWorktime == 1){
  7446. for (var i in this.zhoData) {
  7447. var zhoD = this.zhoData[i]
  7448. var flgs = false
  7449. for(var j in zhoD) {
  7450. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7451. flgs = true
  7452. // formData.append("degreeId", "-1");
  7453. formData.append("id", '-1');
  7454. if (this.isSubstitude) {
  7455. formData.append('targetUids',this.workForm.userId[0]);
  7456. }
  7457. for(var s in this.selProjectList) {
  7458. if(j == this.selProjectList[s].projectName) {
  7459. formData.append("projectId", this.selProjectList[s].id);
  7460. break;
  7461. }
  7462. }
  7463. if(this.user.timeType.reportAuditType == 3){
  7464. let audItem = {}
  7465. if(this.user.timeType.auditLevel > 0){
  7466. audItem.auditorFirst = zhoD[j].auditorFirst
  7467. }
  7468. if(this.user.timeType.auditLevel > 1){
  7469. audItem.auditorSec = zhoD[j].auditorSec
  7470. }
  7471. if(this.user.timeType.auditLevel > 2){
  7472. audItem.auditorThird = zhoD[j].auditorThird
  7473. }
  7474. if(zhoD[j].ccUserid){
  7475. audItem.ccUserid = zhoD[j].ccUserid
  7476. }
  7477. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7478. }
  7479. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7480. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7481. formData.append("reportTimeType", this.reportTimeType.type);
  7482. formData.append("endTime", '');
  7483. formData.append("startTime", '');
  7484. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7485. var lix = []
  7486. var objjs = {}
  7487. objjs.startTime = zhoD[j].time[0]
  7488. objjs.endTime = zhoD[j].time[1]
  7489. if (zhoD[j].content == null || zhoD[j].content == '') {
  7490. zhoD[j].content == '-'
  7491. }
  7492. objjs.content = zhoD[j].content
  7493. lix.push(objjs)
  7494. var zhiZhi = JSON.stringify(lix)
  7495. zhiZhi = zhiZhi.replace(/,/g,"@");
  7496. formData.append("content", zhiZhi)
  7497. formData.append("isOvertime", 0)
  7498. formData.append("professionProgress", "[]")
  7499. if (zhoD[j].groupId) {
  7500. formData.append("groupId",zhoD[j].groupId)
  7501. } else {
  7502. //解决后台groupId数组越界的问题
  7503. formData.append("groupId",0)
  7504. }
  7505. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7506. formData.append("createDate",zhoD.zhoDataTime)
  7507. if (zhoD[j].projectAuditorId) {
  7508. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7509. }
  7510. if(zhoD[j].basecostId) {
  7511. formData.append("basecostId", zhoD[j].basecostId);
  7512. } else {
  7513. formData.append("basecostId", 0);
  7514. }
  7515. if(this.user.timeType.customDegreeActive){
  7516. if (this.user.timeType.customDegreeMultiple) {
  7517. if (zhoD[j].multiDegrIdArray) {
  7518. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7519. } else {
  7520. formData.append('multiDegrId','[]')
  7521. }
  7522. } else {
  7523. if (zhoD[j].degreeId) {
  7524. formData.append('degreeId',zhoD[j].degreeId)
  7525. } else {
  7526. formData.append('degreeId','-1')
  7527. }
  7528. }
  7529. }else{
  7530. formData.append("degreeId", "-1");
  7531. }
  7532. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7533. formData.append('customData',zhoD[j].customData)
  7534. }else if(this.user.timeType.customDataActive){
  7535. formData.append('customData',0)
  7536. }
  7537. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7538. formData.append('customText',zhoD[j].customText)
  7539. }else if(this.user.timeType.customTextActive){
  7540. formData.append('customText','-')
  7541. }
  7542. if(reportExtraField4Name || reportExtraField5Name) {
  7543. formData.append('extraField4', zhoD[j].extraField4 || '')
  7544. formData.append('extraField5', zhoD[j].extraField5 || '')
  7545. }
  7546. }
  7547. }
  7548. }
  7549. } else {
  7550. for (var i in this.zhoData) {
  7551. var zhoD = this.zhoData[i]
  7552. var flgs = false
  7553. if(this.reportTimeType.type == 2) {
  7554. for(var k in this.selProjectList) {
  7555. var pItem = this.selProjectList[k];
  7556. var pName = pItem.projectName;
  7557. var j = pName;
  7558. var pid = pItem.id;
  7559. console.log('j==周报中的项目='+j);
  7560. if(zhoD[j].time && zhoD[j].time != 'null') {
  7561. flgs = true
  7562. // formData.append("degreeId", "-1");
  7563. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7564. if (this.isSubstitude) {
  7565. formData.append('targetUids',this.workForm.userId[0]);
  7566. }
  7567. formData.append("projectId", pid);
  7568. if(this.user.timeType.reportAuditType == 3){
  7569. let audItem = {}
  7570. if(this.user.timeType.auditLevel > 0){
  7571. audItem.auditorFirst = zhoD[j].auditorFirst
  7572. }
  7573. if(this.user.timeType.auditLevel > 1){
  7574. audItem.auditorSec = zhoD[j].auditorSec
  7575. }
  7576. if(this.user.timeType.auditLevel > 2){
  7577. audItem.auditorThird = zhoD[j].auditorThird
  7578. }
  7579. if(zhoD[j].ccUserid){
  7580. audItem.ccUserid = zhoD[j].ccUserid
  7581. }
  7582. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7583. }
  7584. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7585. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7586. formData.append("reportTimeType", this.reportTimeType.type);
  7587. formData.append("endTime", zhoD[j].time[1]);
  7588. formData.append("startTime", zhoD[j].time[0]);
  7589. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7590. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7591. formData.append("isOvertime", 0)
  7592. formData.append("professionProgress", "[]")
  7593. if (zhoD[j].groupId) {
  7594. formData.append("groupId",zhoD[j].groupId)
  7595. } else {
  7596. //解决后台groupId数组越界的问题
  7597. formData.append("groupId",0)
  7598. }
  7599. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7600. formData.append("createDate",zhoD.zhoDataTime)
  7601. if (zhoD[j].projectAuditorId) {
  7602. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7603. } else {
  7604. //对齐数据
  7605. formData.append("projectAuditorId",'-');
  7606. }
  7607. if(zhoD[j].basecostId) {
  7608. formData.append("basecostId", zhoD[j].basecostId);
  7609. } else {
  7610. formData.append("basecostId", 0);
  7611. }
  7612. if(this.user.timeType.customDegreeActive){
  7613. if (this.user.timeType.customDegreeMultiple) {
  7614. if (zhoD[j].multiDegrIdArray) {
  7615. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7616. } else {
  7617. formData.append("multiDegrId", "[]");
  7618. }
  7619. } else {
  7620. if (zhoD[j].degreeId) {
  7621. formData.append('degreeId',zhoD[j].degreeId)
  7622. } else {
  7623. formData.append("degreeId", "-1");
  7624. }
  7625. }
  7626. }else{
  7627. formData.append("degreeId", "-1");
  7628. }
  7629. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7630. formData.append('customData',zhoD[j].customData)
  7631. }else if(this.user.timeType.customDataActive){
  7632. formData.append('customData',0)
  7633. }
  7634. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7635. formData.append('customText',zhoD[j].customText)
  7636. }else if(this.user.timeType.customTextActive){
  7637. formData.append('customText','-')
  7638. }
  7639. if(reportExtraField4Name || reportExtraField5Name) {
  7640. formData.append('extraField4', zhoD[j].extraField4 || '')
  7641. formData.append('extraField5', zhoD[j].extraField5 || '')
  7642. }
  7643. }
  7644. }
  7645. } else {
  7646. for(var k in this.selProjectList) {
  7647. var pItem = this.selProjectList[k];
  7648. var pName = pItem.projectName;
  7649. var j = pName;
  7650. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7651. flgs = true
  7652. // formData.append("degreeId", "-1");
  7653. console.log('进入了workFpppp==='+j);
  7654. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7655. if (this.isSubstitude) {
  7656. formData.append('targetUids',this.workForm.userId[0]);
  7657. }
  7658. formData.append("projectId", pItem.id);
  7659. if(this.user.timeType.reportAuditType == 3){
  7660. let audItem = {}
  7661. if(this.user.timeType.auditLevel > 0){
  7662. audItem.auditorFirst = zhoD[j].auditorFirst
  7663. }
  7664. if(this.user.timeType.auditLevel > 1){
  7665. audItem.auditorSec = zhoD[j].auditorSec
  7666. }
  7667. if(this.user.timeType.auditLevel > 2){
  7668. audItem.auditorThird = zhoD[j].auditorThird
  7669. }
  7670. if(zhoD[j].ccUserid){
  7671. audItem.ccUserid = zhoD[j].ccUserid
  7672. }
  7673. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7674. }
  7675. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7676. // formData.append("subProjectId", zhoD[j].subProjectId);
  7677. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7678. formData.append("reportTimeType", this.reportTimeType.type);
  7679. if(this.reportTimeType.type == 1) {
  7680. formData.append("workingTime", zhoD[j].workingTime);
  7681. } else if(this.reportTimeType.type == 2) {
  7682. formData.append("endTime", zhoD[j].time[1]);
  7683. formData.append("startTime", zhoD[j].time[0]);
  7684. } else if(this.reportTimeType.type == 3) {
  7685. formData.append("progress", zhoD[j].progress);
  7686. formData.append("workingTime", zhoD[j].workingTime);
  7687. }
  7688. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7689. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7690. formData.append("isOvertime", 0)
  7691. formData.append("professionProgress", "[]")
  7692. if (zhoD[j].groupId) {
  7693. formData.append("groupId",zhoD[j].groupId)
  7694. } else {
  7695. //解决后台groupId数组越界的问题
  7696. formData.append("groupId",0)
  7697. }
  7698. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7699. formData.append("createDate",zhoD.zhoDataTime)
  7700. if (zhoD[j].projectAuditorId) {
  7701. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7702. } else {
  7703. //对齐数据
  7704. formData.append("projectAuditorId",'-')
  7705. }
  7706. if(zhoD[j].basecostId) {
  7707. formData.append("basecostId", zhoD[j].basecostId);
  7708. } else {
  7709. formData.append("basecostId", 0);
  7710. }
  7711. if(this.user.timeType.customDegreeActive){
  7712. if (this.user.timeType.customDegreeMultiple) {
  7713. if (zhoD[j].multiDegrIdArray) {
  7714. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7715. } else {
  7716. formData.append("multiDegrId", "[]");
  7717. }
  7718. } else {
  7719. if (zhoD[j].degreeId) {
  7720. formData.append('degreeId',zhoD[j].degreeId)
  7721. } else {
  7722. formData.append("degreeId", "-1");
  7723. }
  7724. }
  7725. }else{
  7726. formData.append("degreeId", "-1");
  7727. }
  7728. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7729. formData.append('customData',zhoD[j].customData)
  7730. }else if(this.user.timeType.customDataActive){
  7731. formData.append('customData',0)
  7732. }
  7733. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7734. formData.append('customText',zhoD[j].customText)
  7735. }else if(this.user.timeType.customTextActive){
  7736. formData.append('customText','-')
  7737. }
  7738. if(reportExtraField4Name || reportExtraField5Name) {
  7739. formData.append('extraField4', zhoD[j].extraField4 || '')
  7740. formData.append('extraField5', zhoD[j].extraField5 || '')
  7741. }
  7742. }
  7743. }
  7744. }
  7745. }
  7746. }
  7747. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7748. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7749. if(!next) {
  7750. this.$message({
  7751. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7752. type: 'error'
  7753. })
  7754. return
  7755. }
  7756. // 自定义维度
  7757. this.submitingReport = true;
  7758. this.http.uploadFile( this.port.report.editPort, formData,
  7759. res => {
  7760. // this.listLoading = false;
  7761. this.submitingReport = false;
  7762. if (res.code == "ok") {
  7763. this.$message({
  7764. message: this.$t('message.fillinsuccessfully'),
  7765. type: "success"
  7766. });
  7767. this.fillWeekDialogVisi = false
  7768. this.selConShow = true
  7769. this.zhoData = []
  7770. this.weekDateRange = ''
  7771. this.getReportList();
  7772. this.getDepartment();
  7773. // 关闭弹窗 并 清空
  7774. this.selProjectList = []
  7775. this.selCon = []
  7776. this.getRecentlyProject()
  7777. } else {
  7778. this.$message({
  7779. message: res.msg,
  7780. type: "error"
  7781. });
  7782. }
  7783. },
  7784. error => {
  7785. this.submitingReport = false;
  7786. this.$message({
  7787. message: error,
  7788. type: "error"
  7789. });
  7790. });
  7791. },
  7792. handleGroupAuditorData(data) {
  7793. const { reportAuditType } = this.user.timeType
  7794. if(reportAuditType != 1 && reportAuditType != 2) {
  7795. return {next: true}
  7796. }
  7797. let arrList = [];
  7798. Object.entries(data).forEach(([key, obj]) => {
  7799. Object.entries(obj).forEach(([projectName, projectData]) => {
  7800. if (projectData.workingTime && !projectData.groupId) {
  7801. arrList.push({
  7802. projectName,
  7803. date: obj.zhoDataTime,
  7804. dateText: obj.zhoDataTimeTxt
  7805. });
  7806. }
  7807. });
  7808. });
  7809. if(arrList.length > 0) {
  7810. return {
  7811. next: false,
  7812. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7813. }
  7814. } else {
  7815. return {
  7816. next: true,
  7817. error: [],
  7818. }
  7819. }
  7820. },
  7821. ChangeHourMinutestr (str) {
  7822. if (str !== "0" && str !== "" && str !== null) {
  7823. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7824. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7825. } else {
  7826. return "";
  7827. }
  7828. },
  7829. // 得到两个日期中间的日期
  7830. getdiffdate(stime,etime){
  7831. //初始化日期列表,数组
  7832. var diffdate = new Array();
  7833. var i=0;
  7834. //开始日期小于等于结束日期,并循环
  7835. while(stime<=etime){
  7836. diffdate[i] = stime;
  7837. //获取开始日期时间戳
  7838. var stime_ts = new Date(stime).getTime();
  7839. //增加一天时间戳后的日期
  7840. var next_date = stime_ts + (24*60*60*1000);
  7841. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7842. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7843. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7844. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7845. stime = next_dates_y+next_dates_m+next_dates_d;
  7846. //增加数组key
  7847. i++;
  7848. }
  7849. return diffdate;
  7850. },
  7851. // 添加模块
  7852. addDomain(i) {
  7853. var leftProgress = 10;
  7854. if (this.reportTimeType.type == 3) {
  7855. //计算已经待分配工时比例
  7856. let array = this.workForm.domains;
  7857. let totalProgress = 0;
  7858. for (var i=0;i<array.length; i++) {
  7859. totalProgress += array[i].progress;
  7860. }
  7861. if (totalProgress < 100) {
  7862. leftProgress = 100 - totalProgress;
  7863. }
  7864. }
  7865. var addItem = {
  7866. projectId: "",
  7867. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7868. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7869. ),
  7870. content: "",
  7871. progress:leftProgress,
  7872. state:2,//2-表示待提交
  7873. multiWorktime: this.reportTimeType.multiWorktime,
  7874. worktimeList:[{}],
  7875. canEdit: true,
  7876. auditorFirst: '',
  7877. auditorSec: '',
  7878. auditorThird: '',
  7879. ccUserid: ''
  7880. // degreeId: '',
  7881. };
  7882. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7883. this.$set(addItem,'isOvertime',true)
  7884. if(this.reportTimeType.type == 3){
  7885. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7886. }
  7887. }
  7888. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7889. //默认给第一个,必填字段
  7890. addItem.basecostId = this.timeBasecostList[0].id;
  7891. }
  7892. this.workForm.domains.push(addItem);
  7893. document.getElementById('workFormsItemBottom').scrollIntoView()
  7894. this.canEdit = true
  7895. if (this.reportTimeType.type == 0) {
  7896. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7897. var length = this.workForm.domains.length;
  7898. if (length == 2) {
  7899. this.showAddMore = false;
  7900. }
  7901. }
  7902. this.chuji()
  7903. this.seleChn()
  7904. },
  7905. // 移除模块
  7906. delDomain(i) {
  7907. this.workForm.domains.splice(i,1)
  7908. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7909. if (!this.originCanEdit) {
  7910. let iscan = false
  7911. for(let i in this.workForm.domains){
  7912. if(this.workForm.domains[i].canEdit){
  7913. iscan = true
  7914. }
  7915. }
  7916. this.canEdit = iscan
  7917. }
  7918. //检测当前剩下的一个,时间类型是否是全天
  7919. if (this.reportTimeType.type == 0) {
  7920. if (this.workForm.domains[0].timeType == 0) {
  7921. this.showAddMore = false;
  7922. } else {
  7923. this.showAddMore = true;
  7924. }
  7925. }
  7926. if(this.user.timeType.multiWorktime == 1) {
  7927. this.iptChangs()
  7928. } else {
  7929. this.seleChn(0)
  7930. }
  7931. },
  7932. // 改变月份
  7933. changeMonth() {
  7934. this.isWeekend = false
  7935. let date = new Date()
  7936. let nowmon = date.getMonth() + 1
  7937. let nowday = date.getDate()
  7938. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7939. if (this.isBatch == 0) {
  7940. if(this.user.timeType.fillAhead == 0){
  7941. let date_a = new Date(this.workForm.createDate)
  7942. if(date_a.getTime() > date.getTime()){
  7943. this.workForm.createDate = nowdate
  7944. }
  7945. }
  7946. //只有按天填报才能获取当天的日报
  7947. if(!this.isSubstitude){
  7948. let weekday = new Date(this.workForm.createDate).getDay()
  7949. if(this.user.companyId == 817){
  7950. if(weekday == 0){
  7951. this.isWeekend = true
  7952. }
  7953. }else{
  7954. if(weekday == 0 || weekday == 6){
  7955. this.isWeekend = true
  7956. }
  7957. }
  7958. this.getReport()
  7959. } else {
  7960. //获取代填人员的考勤
  7961. if (this.user.timeType.showCorpwxCardtime == 1) {
  7962. this.getTargetUserCardTime();
  7963. }
  7964. }
  7965. }else {
  7966. if(this.user.timeType.fillAhead == 0){
  7967. let date_a = new Date(this.workForm.createDate[1])
  7968. if(date_a.getTime() > date.getTime()){
  7969. this.workForm.createDate[1] = nowdate
  7970. let sdate = new Date(this.workForm.createDate[0])
  7971. let edate = new Date(this.workForm.createDate[1])
  7972. if(sdate > edate){
  7973. this.workForm.createDate[0] = this.workForm.createDate[1]
  7974. }
  7975. }
  7976. }
  7977. }
  7978. },
  7979. // 判断时间段
  7980. fns() {
  7981. for (let k in this.dateAr) {
  7982. if (!this.judege(k)) {
  7983. return false
  7984. }
  7985. }
  7986. return true
  7987. },
  7988. judege(idx){
  7989. for (let k in this.dateAr) {
  7990. if (idx !== k) {
  7991. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7992. return false
  7993. }
  7994. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7995. return false
  7996. }
  7997. }
  7998. }
  7999. return true
  8000. },
  8001. getOverlapData(data) {
  8002. let overlapData = [];
  8003. for (let i = 0; i < data.length; i++) {
  8004. for (let j = i + 1; j < data.length; j++) {
  8005. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  8006. overlapData.push(data[i], data[j]);
  8007. }
  8008. }
  8009. }
  8010. return overlapData;
  8011. },
  8012. // 保存日报111111
  8013. submitReport(isDraft) {
  8014. this.isDraft = isDraft;
  8015. this.$refs.workForm.validate(valid => {
  8016. if (valid) {
  8017. if (!isDraft) {
  8018. //针对苏州景昱,单独的检查逻辑
  8019. if (this.user.companyId == 5978) {
  8020. //调接口,先检查工时是否存在异常
  8021. var totalTime = 0;
  8022. for (var t=0;t<this.workForm.domains.length; t++) {
  8023. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8024. }
  8025. var array = [];
  8026. if (this.isBatch) {
  8027. var startDate = new Date(this.workForm.createDate[0]);
  8028. var endDate = new Date(this.workForm.createDate[1]);
  8029. if (startDate > endDate) {
  8030. this.$message({
  8031. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  8032. type: "error"
  8033. });
  8034. return
  8035. } else {
  8036. while(true){
  8037. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  8038. array.push(workData);
  8039. startDate.setDate(startDate.getDate() + 1);
  8040. if (startDate > endDate) {
  8041. break;
  8042. }
  8043. }
  8044. }
  8045. } else {
  8046. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  8047. array.push(workData)
  8048. }
  8049. this.submitingReport = true;
  8050. var passUserId = this.user.id;
  8051. if (this.isSubstitude) {
  8052. passUserId = this.targetUids;
  8053. }
  8054. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  8055. res => {
  8056. this.submitingReport = false;
  8057. if (res.code == "ok") {
  8058. this.submitReportSon()
  8059. } else {
  8060. this.$confirm(res.msg, this.$t('other.prompts'), {
  8061. confirmButtonText: this.$t('huLveBingTiJiao'),
  8062. cancelButtonText: this.$t('btn.cancel'),
  8063. type: 'error'
  8064. }).then(() => {
  8065. this.submitReportSon()
  8066. }).catch(() => {
  8067. });
  8068. }
  8069. },
  8070. error => {
  8071. this.$message({
  8072. message: error,
  8073. type: "error"
  8074. });
  8075. });
  8076. } else if (this.user.companyId == 469) {
  8077. //试点,针对赛元微电子校验考勤工时
  8078. if (this.workForm.time && this.workForm.time.workHours) {
  8079. if (this.totalReportHours > this.workForm.time.workHours) {
  8080. this.$message({
  8081. message: '填报工时不得超过考勤时长',
  8082. type: "error"
  8083. });
  8084. } else if (this.totalReportHours < this.workForm.time.workHours) {
  8085. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  8086. confirmButtonText: this.$t('btn.determine'),
  8087. cancelButtonText: this.$t('btn.cancel'),
  8088. type: 'warning'
  8089. }).then(() => {
  8090. this.submitReportSon()
  8091. }).catch(() => {
  8092. });
  8093. } else {
  8094. this.submitReportSon();
  8095. }
  8096. } else {
  8097. this.$message({
  8098. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  8099. type: "error"
  8100. });
  8101. }
  8102. } else {
  8103. if(this.totalReportHours < this.user.timeType.allday){
  8104. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  8105. confirmButtonText: this.$t('btn.determine'),
  8106. cancelButtonText: this.$t('btn.cancel'),
  8107. type: 'warning'
  8108. }).then(() => {
  8109. this.submitReportSon()
  8110. }).catch(() => {
  8111. });
  8112. }else{
  8113. this.submitReportSon()
  8114. }
  8115. }
  8116. } else {
  8117. //暂存,不需要检查工时是否超过考勤
  8118. this.submitReportSon()
  8119. }
  8120. }
  8121. });
  8122. },
  8123. submitReportSon() {
  8124. this.dateAr = []
  8125. //检查重叠
  8126. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8127. let alp = []
  8128. if(this.user.timeType.multiWorktime != 1) {
  8129. for(var p in this.workForm.domains) {
  8130. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8131. let objs = {}
  8132. objs.s = this.workForm.domains[p].startTime
  8133. objs.e = this.workForm.domains[p].endTime
  8134. alp.push(objs)
  8135. }
  8136. }
  8137. this.dateAr = alp
  8138. if(this.dateAr.length > 0) {
  8139. let trus = this.fns()
  8140. if(!trus) {
  8141. this.$message({
  8142. message: this.$t('message.Filledtimeperiodsoverlap'),
  8143. type: "error"
  8144. });
  8145. return
  8146. }
  8147. }
  8148. } else {
  8149. for(var p in this.workForm.domains) {
  8150. var slll = this.workForm.domains[p]
  8151. for(var o in slll.worktimeList) {
  8152. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8153. let objs = {}
  8154. objs.s = slll.worktimeList[o].startTime
  8155. objs.e = slll.worktimeList[o].endTime
  8156. alp.push(objs)
  8157. }
  8158. }
  8159. }
  8160. this.dateAr = alp
  8161. if(this.dateAr.length > 0) {
  8162. let trus = this.fns()
  8163. if(!trus) {
  8164. this.$message({
  8165. message: this.$t('message.Filledtimeperiodsoverlap'),
  8166. type: "error"
  8167. });
  8168. return
  8169. }
  8170. }
  8171. }
  8172. }
  8173. //检查子项目
  8174. if (this.user.timeType.subProMustFill == 1) {
  8175. for(var p in this.workForm.domains) {
  8176. var oneProItem = this.workForm.domains[p]
  8177. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8178. //没有选择子项目
  8179. this.$message({
  8180. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8181. type: "error"
  8182. });
  8183. return
  8184. }
  8185. }
  8186. }
  8187. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8188. if (this.user.companyId == this.yuzhongCompId) {
  8189. for(var p in this.workForm.domains) {
  8190. var oneProItem = this.workForm.domains[p]
  8191. if (!oneProItem.extraField1) {
  8192. this.$message({
  8193. message: this.$t('jiaoSeBiTianQingJianCha'),
  8194. type: "error"
  8195. });
  8196. return
  8197. }
  8198. if (!oneProItem.extraField2) {
  8199. this.$message({
  8200. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8201. type: "error"
  8202. });
  8203. return
  8204. }
  8205. if (!oneProItem.extraField3) {
  8206. this.$message({
  8207. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8208. type: "error"
  8209. });
  8210. return
  8211. }
  8212. }
  8213. }
  8214. // return
  8215. //代填的情况,检查人员是否已经选择
  8216. if (this.isSubstitude) {
  8217. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8218. this.$message({
  8219. message: this.$t('message.pleaseselectthepersontofillin'),
  8220. type: "error"
  8221. });
  8222. return;
  8223. }
  8224. }
  8225. //检查时间,全天和上下午不能同时存在
  8226. if (this.reportTimeType.type == 0) {
  8227. var alldayNum = 0;
  8228. var amNum = 0;
  8229. var pmNum = 0;
  8230. for(var i in this.workForm.domains) {
  8231. if (this.workForm.domains[i].timeType == 0) {
  8232. alldayNum ++;
  8233. } else if (this.workForm.domains[i].timeType == 1) {
  8234. amNum++;
  8235. } else if (this.workForm.domains[i].timeType == 2) {
  8236. pmNum++;
  8237. }
  8238. }
  8239. if (alldayNum > 1) {
  8240. this.$message({
  8241. // message: "工作时间-全天,只能选择一次",
  8242. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8243. type: "error"
  8244. });
  8245. return;
  8246. }
  8247. if (amNum > 1) {
  8248. this.$message({
  8249. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8250. type: "error"
  8251. });
  8252. return;
  8253. }
  8254. if (pmNum > 1) {
  8255. this.$message({
  8256. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8257. type: "error"
  8258. });
  8259. return;
  8260. }
  8261. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8262. this.$message({
  8263. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8264. type: "error"
  8265. });
  8266. return;
  8267. }
  8268. } else if (this.reportTimeType.type == 3) {
  8269. //总百分比不能超过100%
  8270. let total = 0;
  8271. this.workForm.domains.forEach(w=>{total += w.progress});
  8272. if (total > 100) {
  8273. this.$message({
  8274. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8275. type: "error"
  8276. });
  8277. return;
  8278. } else if (total < 100) {
  8279. this.$message({
  8280. message: this.$t('message.cannotbesubmitted'),
  8281. type: "error"
  8282. });
  8283. return;
  8284. }
  8285. }
  8286. this.listLoading = true;
  8287. let formData = new FormData();
  8288. formData.append("draft", this.isDraft);
  8289. var totalTime = 0;
  8290. for (var t=0;t<this.workForm.domains.length; t++) {
  8291. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8292. }
  8293. //批量填报不校验考勤时长,交给后台校验
  8294. if (!this.isBatch) {
  8295. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8296. if (this.workForm.time){
  8297. if (this.workForm.time.workHours == 0){
  8298. this.$message({
  8299. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8300. type: 'error'
  8301. })
  8302. return
  8303. }
  8304. }else{
  8305. this.$message({
  8306. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8307. type: 'error'
  8308. })
  8309. return
  8310. }
  8311. }
  8312. }
  8313. //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
  8314. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
  8315. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8316. this.$message({
  8317. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8318. type: "error"
  8319. });
  8320. return;
  8321. }
  8322. }
  8323. for(var i in this.workForm.domains) {
  8324. // 检查任务/里程碑是否为必填
  8325. let taskRequired = this.user.timeType.taskRequired
  8326. if(taskRequired == 1) {
  8327. if(!this.workForm.domains[i].taskId) {
  8328. this.$message({
  8329. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8330. type: "error"
  8331. });
  8332. return
  8333. }
  8334. }
  8335. if(this.user.timeType.reportAuditType == 3){
  8336. let audItem = {}
  8337. let auditRule = ''
  8338. if(this.workForm.domains[i].id){
  8339. audItem.reportId = this.workForm.domains[i].id
  8340. }
  8341. if(this.user.timeType.auditLevel > 0){
  8342. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8343. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8344. }
  8345. if(this.user.timeType.auditLevel > 1){
  8346. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8347. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8348. }
  8349. if(this.user.timeType.auditLevel > 2){
  8350. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8351. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8352. }
  8353. if(this.workForm.domains[i].ccUserid){
  8354. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8355. }
  8356. if(auditRule){
  8357. auditRule = auditRule.substring(0,auditRule.length - 1)
  8358. this.$message({
  8359. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8360. type: 'error'
  8361. })
  8362. return
  8363. }
  8364. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8365. }
  8366. if (this.user.timeType.customDegreeActive) {
  8367. if (this.user.timeType.customDegreeMultiple) {
  8368. //多选
  8369. if (this.workForm.domains[i].multiDegrIdArray) {
  8370. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8371. degreeArray = degreeArray.replace(/,/g,"@");
  8372. formData.append("multiDegrId", degreeArray);
  8373. } else {
  8374. formData.append("multiDegrId", '[]');
  8375. }
  8376. } else {
  8377. //单选
  8378. if (this.workForm.domains[i].degreeId) {
  8379. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8380. } else {
  8381. formData.append("degreeId", -1);
  8382. }
  8383. }
  8384. } else {
  8385. formData.append("degreeId", -1);
  8386. }
  8387. if(this.workForm.domains[i].customData) {
  8388. // var sss = this.workForm.domains[i].degreeId.toString()
  8389. formData.append("customData", this.workForm.domains[i].customData);
  8390. } else {
  8391. formData.append("customData", 0);
  8392. }
  8393. if(this.workForm.domains[i].customText) {
  8394. formData.append("customText", this.workForm.domains[i].customText);
  8395. } else {
  8396. formData.append("customText", '-');
  8397. }
  8398. if (this.workForm.domains[i].id) {
  8399. formData.append("id", this.workForm.domains[i].id);
  8400. } else {
  8401. formData.append("id", -1);
  8402. }
  8403. formData.append("projectId", this.workForm.domains[i].projectId);
  8404. if (this.workForm.domains[i].subProjectId) {
  8405. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8406. } else {
  8407. formData.append("subProjectId", 0);
  8408. }
  8409. if (this.workForm.domains[i].groupId) {
  8410. formData.append("groupId", this.workForm.domains[i].groupId);
  8411. } else {
  8412. formData.append("groupId", 0);
  8413. }
  8414. if (this.workForm.domains[i].taskId) {
  8415. formData.append("taskId", this.workForm.domains[i].taskId);
  8416. } else {
  8417. formData.append("taskId", 0);
  8418. }
  8419. if (this.workForm.domains[i].taskFinish == true) {
  8420. formData.append("taskFinish", 1);
  8421. } else {
  8422. formData.append("taskFinish", 0);
  8423. }
  8424. formData.append("reportTimeType", this.reportTimeType.type);
  8425. if (this.reportTimeType.type == 0) {
  8426. formData.append("timeType", this.workForm.domains[i].timeType);
  8427. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8428. formData.append("workingTime", workingTime);
  8429. } else if (this.reportTimeType.type == 1){
  8430. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8431. } else if (this.reportTimeType.type == 2) {
  8432. formData.append("endTime", this.workForm.domains[i].endTime);
  8433. formData.append("startTime", this.workForm.domains[i].startTime);
  8434. } else if (this.reportTimeType.type == 3) {
  8435. //按比例分配
  8436. formData.append("progress", this.workForm.domains[i].progress);
  8437. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8438. }
  8439. if(this.user.timeType.choseFromAlbum == 1 ) {
  8440. console.log(this.workForm.domains[i].imgList)
  8441. if(this.workForm.domains[i].imgList) {
  8442. let imgListFor = this.workForm.domains[i].imgList
  8443. for(var b in imgListFor) {
  8444. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8445. }
  8446. console.log(imgListFor)
  8447. let m = JSON.stringify(imgListFor);
  8448. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8449. formData.append("picStr", m);
  8450. } else {
  8451. formData.append("picStr", '[]');
  8452. }
  8453. }
  8454. //处理多个时间事项
  8455. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8456. if (this.reportTimeType.multiWorktime == 1) {
  8457. //检查时间是否有重叠
  8458. var workList = this.workForm.domains[i].worktimeList;
  8459. for (var j=0;j<workList.length; j++) {
  8460. var curItem = workList[j];
  8461. //检查开始时间是否大于结束时间
  8462. if (curItem.startTime >= curItem.endTime) {
  8463. this.$message({
  8464. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8465. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8466. type: "error"
  8467. });
  8468. return;
  8469. }
  8470. //时间不可重叠
  8471. if (this.reportTimeType.timeCanOverlap == 0) {
  8472. for (var p = j+1;p<workList.length; p++) {
  8473. var jItem = workList[p];
  8474. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8475. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8476. this.$message({
  8477. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8478. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8479. type: "error"
  8480. });
  8481. return;
  8482. }
  8483. }
  8484. }
  8485. }
  8486. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8487. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8488. formData.append("content", m);
  8489. } else {
  8490. if (this.workForm.domains[i].content) {
  8491. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8492. m = m.replace(/,/g,",");
  8493. console.log(m, '需要传值的数据')
  8494. // formData.append("content", this.workForm.domains[i].content);
  8495. formData.append("content", m);
  8496. } else {
  8497. formData.append("content", '-');
  8498. }
  8499. }
  8500. if (this.isBatch == 0) {
  8501. formData.append("createDate", this.workForm.createDate);
  8502. } else {
  8503. //批量填报,时间范围
  8504. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8505. }
  8506. if(this.workForm.domains[i].isOvertime) {
  8507. formData.append("isOvertime", 1);
  8508. } else {
  8509. formData.append("isOvertime", 0);
  8510. }
  8511. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8512. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8513. } else {
  8514. formData.append("overtimeHours", 0);
  8515. }
  8516. if(this.workForm.domains[i].basecostId) {
  8517. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8518. } else {
  8519. formData.append("basecostId", 0);
  8520. }
  8521. if (this.workForm.userId != null) {
  8522. var targetUids = '';
  8523. this.workForm.userId.forEach(u=>{
  8524. targetUids += u + '@';
  8525. });
  8526. if (targetUids.length > 0) {
  8527. targetUids = targetUids.substring(0, targetUids.length -1);
  8528. formData.append("targetUids", targetUids);
  8529. }
  8530. }
  8531. //项目专业进度
  8532. if (this.workForm.domains[i].professionProgress) {
  8533. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8534. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8535. formData.append("professionProgress", m);
  8536. } else {
  8537. formData.append("professionProgress", "[]");
  8538. }
  8539. if (this.workForm.domains[i].stage) {
  8540. formData.append("stage", this.workForm.domains[i].stage);
  8541. } else {
  8542. formData.append("stage", "-");
  8543. }
  8544. if (this.workForm.domains[i].projectAuditorId) {
  8545. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8546. } else {
  8547. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8548. this.$message({
  8549. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8550. type: "error"
  8551. });
  8552. return;
  8553. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8554. //分组负责人先审核, 确定是选择了任务分组
  8555. if (this.workForm.domains[i].taskGroups.length == 0) {
  8556. this.$message({
  8557. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8558. type: "error"
  8559. });
  8560. return;
  8561. } else if (!this.workForm.domains[i].groupId) {
  8562. // console.log(this.workForm.domains[i]);
  8563. this.$message({
  8564. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8565. type: "error"
  8566. });
  8567. return;
  8568. }
  8569. }
  8570. }
  8571. if (this.user.companyId == this.yuzhongCompId) {
  8572. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8573. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8574. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8575. }
  8576. //依斯贝的服务Id
  8577. if (this.user.companyId == this.yisibeiCompId) {
  8578. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8579. }
  8580. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8581. this.$message({
  8582. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8583. type: "error"
  8584. });
  8585. return
  8586. }
  8587. if(this.user.timeType.userWithMultiDept == 1) {
  8588. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8589. }
  8590. if(this.user.timeType.reportExtraField4Name) {
  8591. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8592. }
  8593. if(this.user.timeType.reportExtraField5Name) {
  8594. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8595. }
  8596. }
  8597. this.submitingReport = true;
  8598. this.http.uploadFile( this.port.report.editPort, formData,
  8599. res => {
  8600. this.listLoading = false;
  8601. this.submitingReport = false;
  8602. if (res.code == "ok") {
  8603. if(res.msg!=null){
  8604. this.$message({
  8605. dangerouslyUseHTMLString: true,
  8606. message: res.msg,
  8607. type: "warning",
  8608. showClose: true,
  8609. duration: 0
  8610. });
  8611. }else{
  8612. this.$message({
  8613. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8614. type: "success"
  8615. });
  8616. }
  8617. this.dialogVisible = false;
  8618. this.jsDay = 0
  8619. this.jsTime = 0
  8620. this.getReportList();
  8621. this.getDepartment();
  8622. this.getRecentlyProject()
  8623. } else {
  8624. this.$message({
  8625. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8626. type: "error"
  8627. });
  8628. }
  8629. },
  8630. error => {
  8631. this.listLoading = false;
  8632. this.submitingReport = false;
  8633. this.$message({
  8634. message: error,
  8635. type: "error"
  8636. });
  8637. });
  8638. },
  8639. // 判断是展示那个工时导入
  8640. imports() {
  8641. if(this.user.timeType.syncCorpwxTime == 0) {
  8642. this.importDialog = true
  8643. } else {
  8644. this.importWxDialog = true
  8645. }
  8646. },
  8647. // 跳转
  8648. junpToDeskTop(id) {
  8649. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8650. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8651. },
  8652. // 通过日报
  8653. approve(id, item) {
  8654. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8655. this.approveinData = {
  8656. id: id,
  8657. date: this.date +day,
  8658. reportIds: item.id
  8659. }
  8660. if(this.user.timeType.needEvaluate == 1){
  8661. this.$set(this.approveinData,'evaluate','')
  8662. this.approveinDialog = true
  8663. }else{
  8664. this.logining = true;
  8665. this.approveinfun()
  8666. }
  8667. },
  8668. approveinfun(){
  8669. this.http.post( this.port.report.approve, this.approveinData,
  8670. res => {
  8671. this.logining = false;
  8672. if (res.code == "ok") {
  8673. this.approveinDialog = false
  8674. this.$message({
  8675. message: this.$t('message.Reviewsucceeded'),
  8676. type: "success"
  8677. });
  8678. this.refreshReportData(this.approveinData.reportIds);
  8679. this.getDepartment();
  8680. } else {
  8681. this.$message({
  8682. message: res.msg,
  8683. type: "error"
  8684. });
  8685. }
  8686. },
  8687. error => {
  8688. this.logining = false;
  8689. this.$message({
  8690. message: error,
  8691. type: "error"
  8692. });
  8693. });
  8694. },
  8695. //撤回日报
  8696. cancel(item,e) {
  8697. // console.log('can can need',item);
  8698. this.logining = true;
  8699. var ids = '';
  8700. var data = e ? item : item.data;
  8701. data.forEach(element => {
  8702. if(element.id){
  8703. ids +=(element.id+',');
  8704. }
  8705. });
  8706. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8707. res => {
  8708. this.logining = false;
  8709. if (res.code == "ok") {
  8710. this.$message({
  8711. message:this.$t('message.Withdrawalsucceeded'),
  8712. type: "success"
  8713. });
  8714. this.getReportList();
  8715. if(e){this.getReport()}
  8716. this.getDepartment();
  8717. } else {
  8718. this.$message({
  8719. message: res.msg,
  8720. type: "error"
  8721. });
  8722. }
  8723. },
  8724. error => {
  8725. this.logining = false;
  8726. this.$message({
  8727. message: error,
  8728. type: "error"
  8729. });
  8730. });
  8731. },
  8732. showDenyDialog(id,i, item) {
  8733. this.denyReasonDialog = true;
  8734. this.isDenying = false;
  8735. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8736. var ids = item.id;
  8737. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8738. },
  8739. // 未通过日报
  8740. deny() {
  8741. this.logining = true;
  8742. this.isDenying = true;
  8743. this.http.post( this.port.report.deny, this.denyForm,
  8744. res => {
  8745. this.logining = false;
  8746. this.isDenying = false;
  8747. if (res.code == "ok") {
  8748. this.$message({
  8749. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8750. type: "success"
  8751. });
  8752. this.refreshReportData(this.denyForm.reportIds);
  8753. this.getDepartment();
  8754. this.denyReasonDialog = false;
  8755. } else {
  8756. this.$message({
  8757. message: res.msg,
  8758. type: "error"
  8759. });
  8760. }
  8761. },
  8762. error => {
  8763. this.logining = false;
  8764. this.$message({
  8765. message: error,
  8766. type: "error"
  8767. });
  8768. });
  8769. },
  8770. // 查看工时记录弹窗
  8771. toView() {
  8772. this.toViewDialogVisible = true
  8773. this.toViewloading = true
  8774. this.getToView()
  8775. },
  8776. getToView() {
  8777. this.http.post( '/report-import-log/getList', this.toViewForm,
  8778. res => {
  8779. this.toViewloading = false;
  8780. if (res.code == "ok") {
  8781. // console.log(res.data, '数据数据')
  8782. this.toViewList = res.data.records
  8783. this.toViewForm.total = res.data.total
  8784. } else {
  8785. this.toViewloading = false;
  8786. this.$message({
  8787. message: res.msg,
  8788. type: "error"
  8789. });
  8790. }
  8791. })
  8792. },
  8793. // 触发 selectCat 组件更改他的值
  8794. selectCatCli(obj) {
  8795. // console.log(obj, '看看')
  8796. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8797. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8798. },
  8799. vueCasader(obj) {
  8800. if(obj.distinction == 1 && obj.item) {
  8801. let arr = []
  8802. arr.push(obj.item.value)
  8803. this.exportParam.departmentId = arr
  8804. }
  8805. if(obj.distinction == '10' && obj) {
  8806. const { id, other } = obj
  8807. this.workForm.domains[other].reportTargetDeptId = id
  8808. }
  8809. if(obj.distinction == '14' && obj) {
  8810. let arr = []
  8811. arr.push(obj.id)
  8812. this.deptIdForHasReport = arr
  8813. this.showMonthWorkTime()
  8814. }
  8815. if(obj.distinction == '15' && obj) {
  8816. let arr = []
  8817. arr.push(obj.id)
  8818. this.deptIdForNoReport = arr
  8819. this.showMonthNotWorkTime()
  8820. }
  8821. if(obj.distinction == '16' && obj) {
  8822. let arr = []
  8823. arr.push(obj.id)
  8824. this.deptIdForReminder = arr
  8825. this.showMonthWorkTimeReminder()
  8826. }
  8827. if(obj.distinction == '17' && obj) {
  8828. let arr = []
  8829. arr.push(obj.id)
  8830. this.deptIdForHasReport = arr
  8831. this.showReportTimeLessThanCardTimeList();
  8832. }
  8833. },
  8834. //分页
  8835. handleCurrentChange(val) {
  8836. this.toViewForm.pageIndex = val;
  8837. this.getToView();
  8838. },
  8839. handleSizeChange(val) {
  8840. this.toViewForm.pageSize = val;
  8841. this.getToView();
  8842. },
  8843. getAllUsersList(){
  8844. this.http.post('/user/getSimpleActiveUserList',{
  8845. },res => {
  8846. if(res.code == 'ok'){
  8847. this.allUsersList = res.data
  8848. }else{
  8849. this.$message({
  8850. message: res.msg,
  8851. type: 'error'
  8852. })
  8853. }
  8854. },err => {
  8855. this.$message({
  8856. message: err,
  8857. type: 'error'
  8858. })
  8859. })
  8860. },
  8861. //考勤工时异常,一键驳回并提醒修改
  8862. batchRejectAndRemind(item){
  8863. this.$confirm('您确定要一键驳回异常考勤工时的日报并发送消息提醒吗?',this.$t('other.prompts'), {
  8864. confirmButtonText: this.$t('btn.determine'),
  8865. cancelButtonText: this.$t('btn.cancel'),
  8866. type: "warning"
  8867. })
  8868. .then(() => {
  8869. let parameter={
  8870. ymonth: this.notfullSelectDateMonth
  8871. }
  8872. this.remindering = true;
  8873. this.http.post('/report/rejectAbnormalReportTime',parameter,res => {
  8874. this.remindering = false;
  8875. if(res.code == 'ok'){
  8876. this.$message({
  8877. message: res.msg,
  8878. type: 'success'
  8879. })
  8880. }else{
  8881. this.$message({
  8882. message: res.msg,
  8883. type: 'error'
  8884. })
  8885. }
  8886. },err => {
  8887. this.$message({
  8888. message: err,
  8889. type: 'error'
  8890. })
  8891. })
  8892. }).catch(() => {this.startDeleting = false});
  8893. },
  8894. //景昱变更提醒
  8895. changeReminder(item){
  8896. let parameter={
  8897. startDate: this.WorktimeDatepickValue[0],
  8898. endDate: this.WorktimeDatepickValue[1],
  8899. }
  8900. if(item){
  8901. parameter.createDate=item.createDate,
  8902. parameter.userId=item.userId
  8903. }
  8904. this.remindering = true;
  8905. this.http.post('/report/changeReminder',parameter,res => {
  8906. this.remindering = false;
  8907. if(res.code == 'ok'){
  8908. this.$message({
  8909. message: res.msg,
  8910. type: 'success'
  8911. })
  8912. }else{
  8913. this.$message({
  8914. message: res.msg,
  8915. type: 'error'
  8916. })
  8917. }
  8918. },err => {
  8919. this.$message({
  8920. message: err,
  8921. type: 'error'
  8922. })
  8923. })
  8924. },
  8925. //景昱取消异常
  8926. cancelReminder(item){
  8927. let parameter={}
  8928. if(item){
  8929. parameter.createDate=item.createDate,
  8930. parameter.userId=item.userId
  8931. }
  8932. this.http.post('/report/cancelReminder',parameter,res => {
  8933. if(res.code == 'ok'){
  8934. this.$message({
  8935. message: res.msg,
  8936. type: 'success'
  8937. })
  8938. }else{
  8939. this.$message({
  8940. message: res.msg,
  8941. type: 'error'
  8942. })
  8943. }
  8944. },err => {
  8945. this.$message({
  8946. message: err,
  8947. type: 'error'
  8948. })
  8949. })
  8950. this.showMonthWorkTimeReminder()
  8951. },
  8952. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8953. fillWeekCustomClne() {
  8954. this.fillWeekDialogVisiCustom = false
  8955. },
  8956. fillWeekCustomClneTwo() {
  8957. this.fillWeekDialogVisiCustomTwo = false
  8958. },
  8959. fillWeekCustomSubmit() {
  8960. this.getReportList();
  8961. this.getDepartment();
  8962. this.getRecentlyProject()
  8963. },
  8964. // 待填日报姓名搜索
  8965. nameAearchSeek(flg) {
  8966. if(!this.nameAearch) {
  8967. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8968. return
  8969. }
  8970. if(flg) {
  8971. this.enterpriseWechatgetUser()
  8972. }
  8973. },
  8974. handleThreeData(userList) {
  8975. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8976. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8977. },
  8978. // 过滤树节点
  8979. filterTreeNodes(treeData, filterKeywords) {
  8980. return treeData.filter((node) => {
  8981. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8982. if (node.children && node.children.length > 0) {
  8983. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8984. }
  8985. return true;
  8986. }
  8987. if (node.children && node.children.length > 0) {
  8988. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8989. return node.children.length > 0;
  8990. }
  8991. return false;
  8992. });
  8993. },
  8994. // 企业微信获取人员
  8995. enterpriseWechatgetUser() {
  8996. this.deptMembDataLoading = true
  8997. this.http.post('/user/getEmployeeList',{
  8998. departmentId: -1,
  8999. pageIndex: 1,
  9000. pageSize: 100,
  9001. keyword: this.nameAearch,
  9002. status: '',
  9003. roleId: '',
  9004. cursor: '',
  9005. onlyDirect: '',
  9006. matchingType: ''
  9007. },res => {
  9008. if(res.code == 'ok'){
  9009. this.deptMembDataLoading = false
  9010. const userListName = res.data.records.map(item => item.name)
  9011. this.handleThreeData(userListName)
  9012. setTimeout(() => {
  9013. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  9014. }, 200)
  9015. }else{
  9016. this.deptMembDataLoading = false
  9017. this.$message({
  9018. message: res.msg,
  9019. type: 'error'
  9020. })
  9021. }
  9022. },err => {
  9023. this.deptMembDataLoading = false
  9024. this.$message({
  9025. message: err,
  9026. type: 'error'
  9027. })
  9028. })
  9029. },
  9030. changeTreeNodeStatus(node) {
  9031. let allZt = true
  9032. node.expanded = allZt
  9033. for (let i = 0; i < node.childNodes.length; i++) {
  9034. node.childNodes[i].expanded = allZt
  9035. if (node.childNodes[i].childNodes.length > 0) {
  9036. this.changeTreeNodeStatus(node.childNodes[i])
  9037. }
  9038. }
  9039. },
  9040. // 按周填报获取相关任务
  9041. async getWeeklyTaskList(item) {
  9042. const { projectId, groupId, stage, taskId } = item
  9043. let parms = { projectId, isSubstitude: 0 }
  9044. groupId ? parms.groupId = groupId : ''
  9045. stage ? parms.stage = stage : ''
  9046. const { data } = await this.postData('/task/getRecentTask', parms)
  9047. this.zhoBao.taskId = taskId
  9048. this.$set(this.zhoBao, 'taskList', data)
  9049. },
  9050. // 封装 post 请求
  9051. postData(url, params) {
  9052. return new Promise((resolve, reject) => {
  9053. this.http.post(url, { ...params },
  9054. res => {
  9055. resolve(res)
  9056. },
  9057. error => {
  9058. this.$message({
  9059. message: error,
  9060. type: "error"
  9061. });
  9062. reject(error)
  9063. })
  9064. })
  9065. },
  9066. // 自定义事件
  9067. selectCal(obj) {
  9068. if(obj.distinction == '1') {
  9069. this.zhoBao.projectAuditorId = obj.id
  9070. } else if(obj.distinction == '2') {
  9071. this.zhoBao.auditorFirst = obj.id
  9072. } else if(obj.distinction == '3') {
  9073. this.zhoBao.auditorSec = obj.id
  9074. } else if(obj.distinction == '4') {
  9075. this.zhoBao.auditorThird = obj.id
  9076. } else if(obj.distinction == '5') {
  9077. this.zhoBao.ccUserid = obj.id
  9078. } else if(obj.distinction == '12') {
  9079. this.usersListId = obj.id
  9080. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9081. this.searchKeyword = obj.name
  9082. } else {
  9083. this.searchKeyword = ''
  9084. }
  9085. this.searchScreen(0)
  9086. } else if(obj.distinction == '13') {
  9087. this.usersListId = obj.id
  9088. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9089. this.searchKeyword = obj.name
  9090. } else {
  9091. this.searchKeyword = ''
  9092. }
  9093. this.searchScreen(1)
  9094. } else if(obj.distinction == '15') {
  9095. this.usersListId = obj.id
  9096. this.showReportTimeLessThanCardTimeList();
  9097. }
  9098. }
  9099. },
  9100. created() {
  9101. this.getUsers()
  9102. let height = window.innerHeight;
  9103. this.tableHeight = height - 178;
  9104. const that = this;
  9105. window.onresize = function temp() {
  9106. that.tableHeight = window.innerHeight - 178;
  9107. };
  9108. this.toViewForm.companyId = this.user.companyId
  9109. this.initDrag([{
  9110. type: "LR",
  9111. domClass: {
  9112. // 中间分割线的名字
  9113. resize: "line-line",
  9114. // 左侧盒子的名字
  9115. left: "box-left",
  9116. // 右侧盒子的名字
  9117. right: "box-right",
  9118. // 父级的名字
  9119. box: "box-father",
  9120. },
  9121. otherInfo: {
  9122. // 限制左边栏最低宽度
  9123. leftWidth: 120,
  9124. },
  9125. },
  9126. {
  9127. type: "LR",
  9128. domClass: {
  9129. // 中间分割线的名字
  9130. resize: "line-second",
  9131. // 左侧盒子的名字
  9132. left: "left-laowang",
  9133. // 右侧盒子的名字
  9134. right: "box-second-father",
  9135. // 父级的名字
  9136. box: "grand",
  9137. },
  9138. otherInfo: {
  9139. // 限制左边栏最低宽度
  9140. leftWidth: 120,
  9141. },
  9142. },
  9143. ]);
  9144. }
  9145. };
  9146. </script>
  9147. <style lang="scss" scoped>
  9148. @import "../../assets/scss/handle";
  9149. .themeFontColor {
  9150. @include font_color("color");
  9151. }
  9152. .fillWeekDialogVisiCustom {
  9153. width: 100%;
  9154. height: 70vh;
  9155. }
  9156. .fillWeekCustom {
  9157. .el-dialog__body {
  9158. padding: 20px 20px !important;
  9159. }
  9160. }
  9161. .photos {
  9162. position: relative;
  9163. display: flex;
  9164. flex-wrap: wrap;
  9165. }
  9166. .photos_img {
  9167. width: 120px;
  9168. height: 120px;
  9169. margin-right: 20px;
  9170. margin-bottom: 20px;
  9171. cursor: pointer;
  9172. img {
  9173. width: 100%;
  9174. height: 100%;
  9175. }
  9176. }
  9177. .paginatis {
  9178. padding: 10px 10px;
  9179. background: #f2f2f2;
  9180. }
  9181. .waiting {
  9182. color:orange;
  9183. }
  9184. .filledReportStyle {
  9185. color:#32CD32;
  9186. }
  9187. .RejectStyle {
  9188. color:red;
  9189. }
  9190. .waitSubmitStyle{
  9191. @include font_color("color");
  9192. }
  9193. .chooseDate {
  9194. .waiting {
  9195. @include font_color("color");
  9196. }
  9197. .filledReportStyle {
  9198. @include font_color("color");
  9199. }
  9200. .RejectStyle {
  9201. @include font_color("color");
  9202. }
  9203. .waitSubmitStyle{
  9204. @include font_color("color");
  9205. }
  9206. }
  9207. .allDaily {
  9208. width:100%;
  9209. }
  9210. .report_title {
  9211. padding:10px 0;
  9212. color:#666;
  9213. }
  9214. .clearfix {
  9215. overflow-x: auto;
  9216. white-space: nowrap;
  9217. padding: 15px 0 10px 0;
  9218. // overflow-y: hidden;
  9219. .date_item {
  9220. padding: 0 3px;
  9221. cursor: pointer;
  9222. position: relative;
  9223. }
  9224. .chooseDate {
  9225. position: absolute;
  9226. bottom: -3px;
  9227. width: 37px;
  9228. height: 2px;
  9229. left: 14px;
  9230. @include background_color("background_color");
  9231. }
  9232. }
  9233. .one_daily {
  9234. i {
  9235. @include font_color("color1");
  9236. margin-right: 5px;
  9237. }
  9238. .one_daily_body {
  9239. padding: 10px 0px;
  9240. p {
  9241. margin: 0;
  9242. line-height: 30px;
  9243. }
  9244. }
  9245. ul {
  9246. padding: 0;
  9247. }
  9248. }
  9249. .checkbtn {
  9250. float: right;
  9251. margin-top: -10px;
  9252. }
  9253. .selConStyle{
  9254. margin-top:9rem;
  9255. margin-bottom:11rem;
  9256. .selConStyle_title{
  9257. height: 3rem;
  9258. text-align: center;
  9259. font-size: 17px;
  9260. }
  9261. .el-select{
  9262. margin: 0 15%;
  9263. width: 70%;
  9264. }
  9265. }
  9266. </style>
  9267. <style lang="scss">
  9268. /*去除upload组件过渡效果*/
  9269. .photos .el-upload-list__item {
  9270. transition: none !important;
  9271. }
  9272. .daily {
  9273. .el-card__body {
  9274. height: 80%;
  9275. overflow-y: auto;
  9276. }
  9277. .el-card__header {
  9278. padding: 0 20px;
  9279. }
  9280. }
  9281. .membListClass{
  9282. .el-dialog__body{
  9283. padding-top: 10px;
  9284. }
  9285. }
  9286. // .editReportDialog .el-dialog__footer{
  9287. // position: sticky;
  9288. // bottom: 0;
  9289. // background: #fff;
  9290. // height: 70px;
  9291. // z-index: 1010;
  9292. // }
  9293. .editReportDialog{
  9294. min-width: 800px;
  9295. }
  9296. .touruxiangmu{
  9297. max-width: 1000px;
  9298. }
  9299. </style>
  9300. <style scoped>
  9301. /* 项目标签的样式 */
  9302. .el-tag + .el-tag {
  9303. margin-left: 10px;
  9304. }
  9305. .button-new-tag {
  9306. margin-left: 10px;
  9307. height: 32px;
  9308. line-height: 30px;
  9309. padding-top: 0;
  9310. padding-bottom: 0;
  9311. }
  9312. .input-new-tag {
  9313. width: 90px;
  9314. margin-left: 10px;
  9315. vertical-align: bottom;
  9316. }
  9317. .selectworktime .el-table__fixed-body-wrapper{
  9318. top: 48px !important;
  9319. }
  9320. .selectworktime_export .selectworktime_export_l{
  9321. width: 650px;
  9322. float: left;
  9323. height: 42px;
  9324. }
  9325. .approvalProcessBox{
  9326. margin-left: 30px;
  9327. font-size: 14px;
  9328. line-height: 16px;
  9329. cursor: pointer;
  9330. }
  9331. .approvalProcessBox i {
  9332. margin-right: 0;
  9333. height: 16px;
  9334. width: 16px;
  9335. display: inline-block;
  9336. transform: scale(1.2);
  9337. position: relative;
  9338. top: 0.5px;
  9339. @include font_color("color");
  9340. }
  9341. .approvalProcessBox .approvalProcessClick{
  9342. cursor: pointer;
  9343. @include font_color("color");
  9344. font-size: 14px;
  9345. }
  9346. .approvalProcessBox:hover .approvalProcessClick{
  9347. color: #3485fb;
  9348. }
  9349. </style>
  9350. <style lang="scss" scoped>
  9351. .bionicClass {
  9352. -webkit-appearance: none;
  9353. background-color: #FFF;
  9354. background-image: none;
  9355. border-radius: 4px;
  9356. border: 1px solid #DCDFE6;
  9357. box-sizing: border-box;
  9358. color: #606266;
  9359. display: inline-block;
  9360. height: 40px;
  9361. line-height: 40px;
  9362. outline: 0;
  9363. padding: 0 15px;
  9364. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9365. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9366. width: 350px;
  9367. cursor: pointer;
  9368. .bionicClassText {
  9369. color: #C0C4CC;
  9370. }
  9371. }
  9372. // 加班样式
  9373. .overtime {
  9374. display: inline-block;
  9375. margin-left: 20px;
  9376. input {
  9377. display: inline-block;
  9378. margin-top: 5px;
  9379. }
  9380. }
  9381. .plus {
  9382. display: inline-block;
  9383. }
  9384. // .tages {
  9385. // float: right;
  9386. // }
  9387. .overtime {
  9388. display: inline-block;
  9389. margin-left: 30px;
  9390. }
  9391. .bloks {
  9392. display: inline-block;
  9393. width: 380px;
  9394. }
  9395. .zhiss {
  9396. display: flex;
  9397. justify-content: space-around;
  9398. align-items: center;
  9399. }
  9400. .zhoFel {
  9401. display: flex;
  9402. justify-content: space-between;
  9403. align-items: center;
  9404. }
  9405. // 左右滑动样式
  9406. .line {
  9407. width: 30px;
  9408. /* height: 500px; */
  9409. background: #f2f2f2;
  9410. cursor: w-resize;
  9411. }
  9412. .box-father {
  9413. border: 8px solid #000;
  9414. }
  9415. .line-second {
  9416. width: 10px;
  9417. /* background: red; */
  9418. }
  9419. .flex {
  9420. display: flex;
  9421. width: 100%;
  9422. }
  9423. .box-left {
  9424. flex: 0 0 400px;
  9425. /* height: 600px; */
  9426. /* background: blue; */
  9427. }
  9428. .box-right {
  9429. /* height: 600px; */
  9430. /* background: green; */
  9431. flex: 1;
  9432. }
  9433. .box-postion {
  9434. width: 200px;
  9435. /* height: 400px; */
  9436. background: #ccc;
  9437. }
  9438. .custom-tree-node {
  9439. flex: 1;
  9440. display: flex;
  9441. align-items: center;
  9442. justify-content: space-between;
  9443. font-size: 14px;
  9444. padding-right: 8px;
  9445. }
  9446. .daitianrbao {
  9447. width: 100%;
  9448. box-sizing: border-box;
  9449. height: 40px;
  9450. border-radius: 4px;
  9451. border: 1px solid #DCDFE6;
  9452. overflow: hidden;
  9453. text-overflow: ellipsis;
  9454. display: flex;
  9455. // align-items: center;
  9456. }
  9457. .daitianrbao .spnn {
  9458. display: inline-block;
  9459. box-sizing: border-box;
  9460. padding: 0 15px;
  9461. overflow: hidden;
  9462. text-overflow: ellipsis;
  9463. }
  9464. .daitianrbao .hover {
  9465. color: #DCDFE6 !important;
  9466. }
  9467. </style>