daily.vue 503 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477
  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. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  277. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  278. <!-- 自定义日报文本 -->
  279. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  280. <p v-if="user.company.packageEngineering == 1">
  281. {{$t('other.professionalProgress')}}:
  282. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  283. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  284. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  285. </el-tooltip>
  286. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  287. <i class="iconfont firerock-iconshenhetongguo"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhebohui"></i>
  291. </el-tooltip>
  292. </span>
  293. </p>
  294. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  295. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  296. </p>
  297. <div v-if="item2.multiWorktime==0">
  298. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  299. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  300. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  301. {{item2.time.toFixed(1)}}h
  302. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  303. </p>
  304. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  305. <span style="margin-right:10px;">{{item2.progress}}%</span>
  306. </p>
  307. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  308. </div>
  309. <div v-if="item2.multiWorktime==1" >
  310. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  311. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  312. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  313. <p style="display: inline-block;">{{$t('time.duration')}}:
  314. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  315. {{timeItem.time.toFixed(1)}}h
  316. <span v-if="timeItem.detail" style="margin-left:10px;">
  317. {{timeItem.detail}}
  318. </span>
  319. </p>
  320. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  321. </div>
  322. </div>
  323. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  324. <!--照片的显示 -->
  325. <p v-if="item2.pics != null && item2.pics.length > 0">
  326. <el-image v-for="(pic, index) in item2.pics" :key="index"
  327. style="width: 100px; height: 100px; margin-right:10px;"
  328. :src="pic"
  329. :preview-src-list="item2.pics">
  330. </el-image>
  331. </p>
  332. </el-card>
  333. </el-timeline-item>
  334. </el-timeline>
  335. </div>
  336. </div>
  337. <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>
  338. <!-- 简陋的无报告提示 -->
  339. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  340. </div>
  341. </div>
  342. </div>
  343. </div>
  344. </div>
  345. </el-card>
  346. </div>
  347. <!-- 工时推送日志弹窗 -->
  348. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  349. <template>
  350. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  351. </template>
  352. <template>
  353. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  354. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  355. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  356. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  357. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  358. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  359. <template slot-scope="scope">
  360. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  361. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  365. </el-table>
  366. </template>
  367. <span slot="footer" class="dialog-footer">
  368. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  369. </span>
  370. </el-dialog>
  371. <!-- 填写日报的dialog -->
  372. <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">
  373. <div style="height: 65vh;overflow: auto;">
  374. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  375. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  376. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  377. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  378. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  379. <span class="spnn" v-if="workForm.userNames">
  380. <span v-for="(item, index) in workForm.userNames" :key="index">
  381. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  382. <span v-if="index < workForm.userNames.length - 1">,</span>
  383. </span>
  384. </span>
  385. <span class="spnn hover" v-else>
  386. {{$t('defaultText.pleaseSelectAsubstitute')}}
  387. </span>
  388. </div>
  389. </el-form-item>
  390. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  391. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  392. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  393. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  394. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  395. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  396. <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>
  397. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  398. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  399. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  400. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  401. <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>
  402. <!-- AI智能填报 -->
  403. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  404. </el-form-item>
  405. <!--考勤时长显示-->
  406. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  407. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  408. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  409. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  410. </span>
  411. <!--批量填报不显示考勤记录-->
  412. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  413. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  414. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  415. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  416. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  417. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  418. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  419. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  420. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  421. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  422. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  423. @click="refreshAttendance(workForm.createDate)"></el-button>
  424. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  425. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  426. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  427. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  428. </el-form-item>
  429. <!-- 000000 -->
  430. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  431. <div v-if="reportTimeType.multiWorktime==0">
  432. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  433. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  434. <el-select v-model="domain.timeType" style="width:200px;"
  435. v-if="reportTimeType.type == 0"
  436. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  437. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  438. @change="onTimeTypeChange(domain.timeType)">
  439. <el-option
  440. v-for="item in timeType"
  441. :key="item.value"
  442. :label="item.label"
  443. :value="item.value">
  444. </el-option>
  445. </el-select>
  446. <!-- 数字时长选择 -->
  447. <el-select v-model="domain.workingTime" style="width:200px;"
  448. v-if="reportTimeType.type == 1"
  449. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  450. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  451. @change="seleChn(0,domain)">
  452. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  453. </el-select>
  454. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  455. <span v-if="reportTimeType.type == 2">
  456. <!--时间范围选择 -->
  457. <el-time-picker
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  459. v-model="domain.startTime"
  460. :placeholder="$t('time.startTime')"
  461. style="width:120px;"
  462. format="HH:mm"
  463. value-format="HH:mm"
  464. :picker-options="{
  465. start: '08:00',
  466. end: '23:30'
  467. }"
  468. @change="iptChang()">
  469. </el-time-picker> - <el-time-picker
  470. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  471. v-model="domain.endTime"
  472. :placeholder="$t('time.endTime')"
  473. style="width:120px;"
  474. format="HH:mm"
  475. value-format="HH:mm"
  476. :picker-options="{
  477. start: '08:00',
  478. end: '23:30',
  479. minTime: domain.startTime
  480. }"
  481. @change="iptChang()">
  482. </el-time-picker>
  483. </span>
  484. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  485. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  486. <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>
  487. </div>
  488. </el-form-item>
  489. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  490. :prop="'domains.' + index + '.reportTargetDeptId'"
  491. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  492. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  493. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  494. <span style="float: left">
  495. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  496. </span>
  497. </el-option>
  498. </el-select>
  499. <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>
  500. </el-form-item>
  501. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  502. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  503. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  504. @change="selectProject(domain, index)"
  505. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  506. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  507. <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">
  508. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  509. <span style="float: right;">{{ item.projectName }}</span>
  510. </el-option>
  511. </el-option-group>
  512. </el-select>
  513. <!--昱众不显示子项目-->
  514. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  515. <span style="margin-left:45px;">
  516. {{$t('lable.subproject')}}</span>
  517. <!--子项目 -->
  518. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  519. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  520. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  521. </el-select>
  522. </template>
  523. <template v-if="user.companyId == yuzhongCompId">
  524. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  525. <!--角色选择 -->
  526. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  527. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  528. <el-option
  529. v-for="item in roleList"
  530. :key="item.value"
  531. :label="item.label"
  532. :value="item.value">
  533. </el-option>
  534. </el-select>
  535. </template>
  536. <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%;"
  537. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  538. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  539. </el-link>
  540. <!-- <el-link type="primary" v-if="canEdit"
  541. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  542. </el-form-item>
  543. <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">
  544. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  545. </el-form-item>
  546. <!--如果设置了工时成本预警的预算成本项-->
  547. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  548. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  549. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  550. </el-select>
  551. </el-form-item>
  552. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  553. <template slot="label">
  554. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  555. <span >{{$t('lable.taskGrouping')}}</span>
  556. </template>
  557. <!-- 任务分组 -->
  558. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  559. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  560. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  561. </el-select>
  562. <template v-if="user.companyId == yuzhongCompId">
  563. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  564. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  565. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  566. <el-option
  567. v-for="item in domain.filteredRespList"
  568. :key="item.id"
  569. :label="item.jobRespon"
  570. :value="item.id">
  571. </el-option>
  572. </el-select>
  573. </template>
  574. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  575. <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>
  576. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  577. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  578. @change="changeStages(domain, index)"
  579. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  580. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  581. </el-select>
  582. </template>
  583. </el-form-item>
  584. <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">
  585. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  586. <template slot="label">
  587. <span style="color:#FF0000;">*</span>
  588. <span >{{$t('other.projectAuditor')}}</span>
  589. </template>
  590. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  591. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  592. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  593. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  594. </el-option>
  595. </el-select>
  596. <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>
  597. </el-form-item>
  598. </div>
  599. <el-form-item v-if="user.companyId == yuzhongCompId">
  600. <template slot="label">
  601. <span style="color:#FF0000;">*</span>
  602. <span >{{ $t('gongZuoNeiRong') }}</span>
  603. </template>
  604. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  605. :disabled="(workForm.domains[index].state>=2?false:true)" >
  606. <el-option
  607. v-for="item in domain.workContentList"
  608. :key="item.id"
  609. :label="item.workContext"
  610. :value="item.id">
  611. </el-option>
  612. </el-select>
  613. </el-form-item>
  614. <!-- 111111 -->
  615. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  616. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  617. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  618. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  619. <span v-else>{{item.name}}</span>
  620. </el-option>
  621. </el-select>
  622. <template v-if="user.timeType.auditLevel > 1">
  623. <i class="el-icon-right"></i>
  624. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  625. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  626. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  627. <span v-else>{{item.name}}</span>
  628. </el-option>
  629. </el-select>
  630. </template>
  631. <template v-if="user.timeType.auditLevel > 2">
  632. <i class="el-icon-right"></i>
  633. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  634. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  635. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  636. <span v-else>{{item.name}}</span>
  637. </el-option>
  638. </el-select>
  639. </template>
  640. </el-form-item>
  641. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  642. <el-select v-model="domain.ccUserid" clearable :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. </el-form-item>
  649. <!-- 相关维度/自定义维度 -->
  650. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  651. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  652. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  653. </el-option>
  654. </el-select>
  655. </el-form-item>
  656. <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'">
  657. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  658. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  659. </el-option>
  660. </el-select>
  661. </el-form-item>
  662. <!-- 相关数值 -->
  663. <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">
  664. <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>
  665. </el-form-item>
  666. <!-- 自定义文本 -->
  667. <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">
  668. <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>
  669. </el-form-item>
  670. <!--按比例填报-->
  671. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  672. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  673. <div style="width:400px;">
  674. <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>
  675. <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>
  676. </div>
  677. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  678. <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>
  679. </div>
  680. </el-form-item>
  681. <!--工程专业版本模式下, 各个专业的进度填报 -->
  682. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  683. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  684. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  685. <el-input size="mini" style="width:60px;" v-model="item.progress"
  686. @keyup.native="onProgressChange"
  687. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  688. </span>
  689. </el-form-item>
  690. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  691. <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))" >
  692. <template slot="label" v-if="user.timeType.taskRequired == 1">
  693. <span style="color:#FF0000;">*</span>
  694. <span >{{ $t('other.task') }}</span>
  695. </template>
  696. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  697. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  698. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  699. </el-select>
  700. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  701. </el-form-item>
  702. <!--针对依斯贝的SAP服务-->
  703. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  704. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  705. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  707. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  708. </el-select>
  709. </el-form-item>
  710. <!--工作事项-->
  711. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  712. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  713. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  714. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  715. </el-form-item>
  716. <!-- 拍照上传 -->
  717. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  718. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  719. <div class="photos">
  720. <div>
  721. <el-upload
  722. list-type="picture-card"
  723. :http-request="(file) => {return addImg(file, index)}"
  724. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  725. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  726. :file-list="domain.imgListUrl" :limit="9"
  727. :disabled="workForm.domains[index].state>=2?false:true">
  728. <i class="el-icon-plus"></i>
  729. </el-upload>
  730. </div>
  731. </div>
  732. </el-form-item>
  733. </div>
  734. <!--多个工作事项填报的情况 -->
  735. <div v-if="reportTimeType.multiWorktime==1">
  736. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  737. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  738. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  739. @change="selectProject(domain, index)"
  740. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  741. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  742. <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">
  743. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  744. <span style="float: right;">{{ item.projectName }}</span>
  745. </el-option>
  746. </el-option-group>
  747. </el-select>
  748. <template v-if="user.timeType.mainProjectState != 1">
  749. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  750. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  751. <!--子项目 -->
  752. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  753. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  754. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  755. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  756. </el-select>
  757. </template>
  758. <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;"
  759. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  760. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  761. </el-link>
  762. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  763. <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>
  764. </div>
  765. <!-- <el-link type="primary" v-if="canEdit"
  766. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  767. </el-form-item>
  768. <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">
  769. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  770. </el-form-item>
  771. <!--如果设置了工时成本预警的预算成本项-->
  772. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  773. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  774. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  775. </el-select>
  776. </el-form-item>
  777. <el-form-item v-if="user.company.packageProject == 1">
  778. <template slot="label">
  779. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  780. <span >{{$t('lable.taskGrouping')}}</span>
  781. </template>
  782. <!-- 任务分组 -->
  783. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  784. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  785. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  786. </el-select>
  787. <!-- 项目的阶段 -->
  788. <span v-if="domain.stages != null && domain.stages.length> 0"
  789. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  790. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  791. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  792. @change="changeStages(domain, index)"
  793. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  794. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  795. </el-select>
  796. </el-form-item>
  797. <el-form-item :label="$t('other.projectAuditor')" >
  798. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  799. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  800. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  801. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  802. </el-option>
  803. </el-select>
  804. <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>
  805. </el-form-item>
  806. <!--工程专业版本模式下, 各个专业的进度填报 -->
  807. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  808. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  809. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  810. <el-input size="mini" style="width:60px;" v-model="item.progress"
  811. @keyup.native="onProgressChange"
  812. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  813. </span>
  814. </el-form-item>
  815. <!-- 相关维度 -->
  816. <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'">
  817. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  818. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  819. </el-option>
  820. </el-select>
  821. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  822. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  823. </el-option>
  824. </el-select>
  825. </el-form-item>
  826. <!-- 相关数值 -->
  827. <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">
  828. <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>
  829. </el-form-item>
  830. <!-- 自定义文本 -->
  831. <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">
  832. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  833. </el-form-item>
  834. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  835. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  836. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  837. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  838. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  839. </el-select>
  840. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  841. </el-form-item>
  842. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  843. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  844. <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>
  845. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  846. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  847. <span v-if="reportTimeType.type == 2">
  848. <!-- <span> -->
  849. <!--时间范围选择 -->
  850. <el-time-picker
  851. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  852. v-model="timeItem.startTime"
  853. :placeholder="$t('time.startTime')"
  854. style="width:120px;"
  855. format="HH:mm"
  856. value-format="HH:mm"
  857. :picker-options="{
  858. start: '00:00',
  859. end: '23:59',
  860. }"
  861. @change="iptChangs()">
  862. </el-time-picker> - <el-time-picker
  863. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  864. v-model="timeItem.endTime"
  865. :placeholder="$t('time.endTime')"
  866. style="width:120px;"
  867. format="HH:mm"
  868. value-format="HH:mm"
  869. :picker-options="{
  870. start: '00:00',
  871. end: '23:59',
  872. minTime: timeItem.startTime
  873. }"
  874. @change="iptChangs()">
  875. </el-time-picker>
  876. </span>
  877. <!--工作细项-->
  878. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0"
  879. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  880. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  881. </el-select>
  882. </el-form-item>
  883. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  884. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  885. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  886. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  887. ></el-input>
  888. </el-form-item>
  889. </div>
  890. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  891. </div>
  892. <!--照片的显示 -->
  893. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  894. <el-image v-for="(pic, index) in domain.pics" :key="index"
  895. style="width: 100px; height: 100px; margin-right:10px;"
  896. :src="pic"
  897. :preview-src-list="domain.pics">
  898. </el-image>
  899. </p>
  900. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  901. </div>
  902. <span id="workFormsItemBottom"></span>
  903. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  904. </el-form>
  905. </div>
  906. <span slot="footer" class="dialog-footer">
  907. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  908. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  909. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  910. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  911. <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>
  912. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  913. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  914. </span>
  915. </el-dialog>
  916. <!-- 按周填报 -->
  917. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  918. <!-- 按周填报-已填工时-点击 -->
  919. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  920. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  921. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  922. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  923. <el-table-column prop="state" :label="$t('state.states')">
  924. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  925. </el-table-column>
  926. </el-table>
  927. <span slot="footer" class="dialog-footer">
  928. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  929. </span>
  930. </el-dialog>
  931. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  932. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  933. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  934. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  935. <span class="spnn" v-if="workForm.userNames">
  936. <span v-for="(item, index) in workForm.userNames" :key="index">
  937. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  938. <span v-if="index < workForm.userNames.length - 1">,</span>
  939. </span>
  940. </span>
  941. <span class="spnn hover" v-else>
  942. {{$t('defaultText.pleaseSelectAsubstitute')}}
  943. </span>
  944. </div>
  945. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  946. </div>
  947. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  948. <el-form-item style="height:30px;margin-top:-72px;">
  949. <!-- <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> -->
  950. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  951. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  952. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  953. <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>
  954. <el-option
  955. v-for="item in fillProjectList"
  956. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  957. :key="item.id"
  958. :label="item.projectName + '\u3000' + item.projectCode"
  959. :value="item.id">
  960. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  961. <span style="float: right">{{ item.projectName }}</span>
  962. </el-option>
  963. </el-select>
  964. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  965. </el-form-item>
  966. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  967. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  968. <template slot-scope="scope">
  969. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  970. </template>
  971. </el-table-column>
  972. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  973. <template slot-scope="scope">
  974. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  975. <p v-else></p>
  976. </template>
  977. </el-table-column> -->
  978. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  979. <template slot-scope="scope">
  980. <div v-if="scope.row.canFill == 1">
  981. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  982. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  983. <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)"></el-input-number>
  984. <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>
  985. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  986. </div>
  987. </template>
  988. <template v-else>
  989. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  990. <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>
  991. <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>
  992. <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>
  993. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  994. </div>
  995. </template>
  996. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  997. <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>
  998. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  999. </div>
  1000. </div>
  1001. <div v-else >
  1002. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1003. </div>
  1004. </template>
  1005. </el-table-column>
  1006. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1007. <template slot-scope="scope">
  1008. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1009. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1010. </span>
  1011. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1012. </template>
  1013. </el-table-column>
  1014. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1015. <template slot-scope="scope">
  1016. <div class="zhiss">
  1017. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1018. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1019. </div>
  1020. </template>
  1021. </el-table-column>
  1022. </el-table>
  1023. </el-form>
  1024. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1025. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1026. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1027. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1028. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1029. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1030. <!--针对景昱,先检查工时是否存在异常-->
  1031. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1032. </span>
  1033. </el-dialog>
  1034. <!-- 重庆物奇私人定制的按周填报 -->
  1035. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1036. <div class="fillWeekDialogVisiCustom">
  1037. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1038. </div>
  1039. </el-dialog>
  1040. <!-- enableNewWeeklyfill==2 -->
  1041. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1042. <div class="fillWeekDialogVisiCustom">
  1043. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1044. </div>
  1045. </el-dialog>
  1046. <!-- 选择时间 -->
  1047. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1048. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1049. <span slot="footer" class="dialog-footer">
  1050. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1051. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1052. </span>
  1053. </el-dialog>
  1054. <!-- 按周填报弹窗 -->
  1055. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1056. <div>
  1057. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1058. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1059. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1060. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1061. </el-select>
  1062. </div>
  1063. <!--如果设置了工时成本预警的预算成本项-->
  1064. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1065. <p>{{$t('lable.budgetSource')}}</p>
  1066. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1067. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1068. </el-select>
  1069. </div>
  1070. <!-- 任务分组 -->
  1071. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1072. <p>{{$t('lable.taskGrouping')}}</p>
  1073. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1074. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1075. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1076. </el-select>
  1077. </div>
  1078. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1079. <p>{{$t('other.inputStage')}}</p>
  1080. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1081. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1082. </el-select>
  1083. </div>
  1084. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1085. <p>{{$t('other.reviewer')}}</p>
  1086. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1087. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1088. </el-select>
  1089. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1090. </div>
  1091. <template v-if="user.timeType.reportAuditType == 3">
  1092. <div class="zhoFel">
  1093. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1094. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1095. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1096. </el-select>
  1097. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1098. </div>
  1099. <div class="zhoFel">
  1100. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1101. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1102. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1103. </el-select>
  1104. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1105. </div>
  1106. <div class="zhoFel">
  1107. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1108. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1109. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1110. </el-select>
  1111. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1112. </div>
  1113. <div class="zhoFel">
  1114. <p>{{ $t('chao-song-ren') }}</p>
  1115. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1116. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1117. </el-select>
  1118. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1119. </div>
  1120. </template>
  1121. <!-- 自定义维度 -->
  1122. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1123. <p>{{user.timeType.customDegreeName}}</p>
  1124. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1125. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1126. </el-select>
  1127. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1128. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1129. </el-select>
  1130. </div>
  1131. <!-- 自定义数值 -->
  1132. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1133. <p>{{user.timeType.customDataName}}</p>
  1134. <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>
  1135. </div>
  1136. <!-- 自定义文本 -->
  1137. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1138. <p>{{user.timeType.customTextName}}</p>
  1139. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1140. </div>
  1141. <!-- 选择任务 -->
  1142. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1143. <p>{{ $t('renWuLiChengBei') }}</p>
  1144. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1145. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1146. </el-select>
  1147. </div>
  1148. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1149. <p>{{$t('other.timeSelection')}}</p>
  1150. <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>
  1151. </div>
  1152. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1153. <p>{{$t('other.chooseDuration')}}</p>
  1154. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1155. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1156. </el-select>
  1157. </div>
  1158. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1159. <p>{{$t('lable.percentageOfTime')}}</p>
  1160. <div style="width:400px;display: flex;align-items: center;">
  1161. <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>
  1162. <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>
  1163. </div>
  1164. </div>
  1165. <div class="zhoFel">
  1166. <p>{{$t('other.workMatters')}}</p>
  1167. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1168. </div>
  1169. </div>
  1170. <span slot="footer" class="dialog-footer">
  1171. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1172. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1173. </span>
  1174. </el-dialog>
  1175. <!--导出报表条件选择 -->
  1176. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1177. <el-form ref="form3" :model="exportParam" >
  1178. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1179. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1180. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1181. </el-select>
  1182. </el-form-item>
  1183. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1184. <!-- <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>
  1185. <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> -->
  1186. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1187. </el-form-item>
  1188. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1189. <el-date-picker
  1190. v-model="exportParam.dateRange" :editable="false"
  1191. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1192. :range-separator="$t('other.to')"
  1193. type="daterange"
  1194. :start-placeholder="$t('time.startDate')"
  1195. :end-placeholder="$t('time.endDate')"
  1196. ></el-date-picker>
  1197. </el-form-item>
  1198. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1199. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1200. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1201. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1202. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1203. </el-select>
  1204. </el-form-item>
  1205. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1206. <div class="exportReportRadio">
  1207. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1208. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1209. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1210. <i class="el-icon-question"></i>
  1211. </el-tooltip>
  1212. </div>
  1213. </el-form-item>
  1214. </el-form>
  1215. <div slot="footer" class="dialog-footer">
  1216. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1217. </div>
  1218. </el-dialog>
  1219. <!--导出报表条件选择 -->
  1220. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1221. <el-form ref="form3" :model="exportParam" >
  1222. <el-form-item prop="range" :label="$t('time.dateRange')">
  1223. <el-date-picker
  1224. v-model="exportParam.dateRange" :editable="false"
  1225. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1226. :clearable="true"
  1227. :range-separator="$t('other.to')"
  1228. type="daterange"
  1229. :start-placeholder="$t('time.startDate')"
  1230. :end-placeholder="$t('time.endDate')"
  1231. ></el-date-picker>
  1232. </el-form-item>
  1233. </el-form>
  1234. <div slot="footer" class="dialog-footer">
  1235. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1236. </div>
  1237. </el-dialog>
  1238. <!--人员列表 -->
  1239. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1240. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1241. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1242. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1243. <el-table-column type="selection"></el-table-column>
  1244. <el-table-column prop="label" :label="$t('lable.name')" >
  1245. <template slot-scope="scope">
  1246. <span>
  1247. <!-- {{(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}} -->
  1248. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1249. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1250. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1251. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1252. </span>
  1253. <span v-else>
  1254. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1256. </span>
  1257. </span>
  1258. </template>
  1259. </el-table-column>
  1260. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1261. <template slot-scope="scope">
  1262. <div>
  1263. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1264. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1265. </div>
  1266. </template>
  1267. </el-table-column>
  1268. </el-table>
  1269. </el-tab-pane>
  1270. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1271. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1272. <el-table-column prop="label" :label="$t('lable.name')" >
  1273. <template slot-scope="scope">
  1274. <!-- <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> -->
  1275. <!-- <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> -->
  1276. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1277. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1278. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1279. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1280. </span>
  1281. <span v-else>
  1282. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1283. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1284. </span>
  1285. </template>
  1286. </el-table-column>
  1287. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1288. <template slot-scope="scope">
  1289. <div>
  1290. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1291. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1292. </div>
  1293. </template>
  1294. </el-table-column>
  1295. </el-table>
  1296. </el-tab-pane>
  1297. </el-tabs>
  1298. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1299. <el-table-column type="selection"></el-table-column>
  1300. <el-table-column prop="label" :label="$t('lable.name')" >
  1301. <template slot-scope="scope">
  1302. <div>
  1303. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1304. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1305. </div>
  1306. </template>
  1307. </el-table-column>
  1308. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1309. <template slot-scope="scope">
  1310. <div>
  1311. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1312. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1313. </div>
  1314. </template>
  1315. </el-table-column>
  1316. </el-table>
  1317. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1318. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1319. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1320. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1321. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1322. </div>
  1323. </el-dialog>
  1324. <!-- 日报审核修改 -->
  1325. <el-dialog
  1326. :title="$t('riBaoShenHeXiuGai')"
  1327. :visible.sync="reportLogCheckDialog"
  1328. width="30%"
  1329. :before-close="handleClose">
  1330. <el-form ref="form3" :model="exportReportLogParam" >
  1331. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1332. <el-date-picker
  1333. v-model="exportReportLogParam.dateRange" :editable="false"
  1334. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1335. :range-separator="$t('other.to')"
  1336. type="daterange"
  1337. :start-placeholder="$t('time.startDate')"
  1338. :end-placeholder="$t('time.endDate')"
  1339. ></el-date-picker>
  1340. </el-form-item>
  1341. </el-form>
  1342. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1343. <br>
  1344. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1345. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1346. <span slot="footer" class="dialog-footer">
  1347. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1348. </span>
  1349. </el-dialog>
  1350. <!-- 按部门选择人员 -->
  1351. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1352. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1353. <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)">
  1354. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1355. </el-input>
  1356. <div class="tree" style="height:400px">
  1357. <el-scrollbar style="height:100%">
  1358. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1359. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1360. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1361. <span class="custom-tree-node" slot-scope="{ node }">
  1362. <span v-if="user.userNameNeedTranslate == '1'">
  1363. <span v-if="node.data.children">
  1364. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1365. </span>
  1366. <span v-else>
  1367. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1368. </span>
  1369. </span>
  1370. <span v-if="user.userNameNeedTranslate != '1'">
  1371. {{ node.label }}
  1372. </span>
  1373. <!-- {{ node.label }} -->
  1374. </span>
  1375. </el-tree>
  1376. </el-scrollbar>
  1377. </div>
  1378. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1379. <div slot="footer" class="dialog-footer">
  1380. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1381. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1382. </div>
  1383. </el-dialog>
  1384. <el-dialog
  1385. v-if="monthWorkTimeDialog"
  1386. :visible.sync="monthWorkTimeDialog"
  1387. :close-on-click-modal="false"
  1388. customClass="customWidth selectworktime"
  1389. width="92%"
  1390. top="60px"
  1391. >
  1392. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1393. <el-tabs v-model="activeName" @tab-click="handleClick">
  1394. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1395. <div class="selectworktime_export" style="margin-top:10px;">
  1396. <div class="selectworktime_export_l">
  1397. <el-date-picker
  1398. class="selecteworktime_datapick"
  1399. v-model="WorktimeDatepickValue"
  1400. value-format="yyyy-MM-dd"
  1401. type="daterange"
  1402. align="right"
  1403. unlink-panels
  1404. :range-separator="$t('other.to')"
  1405. :start-placeholder="$t('time.startDate')"
  1406. :end-placeholder="$t('time.endDate')"
  1407. :default-time="['12:00:00', '12:00:00']"
  1408. size="small"
  1409. popper-class="selecteorktime_datapick_popper"
  1410. @change="showMonthWorkTime()"
  1411. >
  1412. </el-date-picker>
  1413. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1414. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1415. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1416. <!-- 222 -->
  1417. </div>
  1418. <div>
  1419. <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>
  1420. <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>
  1421. <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">
  1422. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1423. </el-input>
  1424. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1425. </div>
  1426. <div style="float: left; height:32px; padding-top:10px;">
  1427. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1428. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1429. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1430. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1431. </div>
  1432. <div style="float: right; vertical-align: middle;height:32px">
  1433. <el-link
  1434. type="primary"
  1435. @click="exportMembWorkHours()"
  1436. >{{$t('export.exportData')}}</el-link
  1437. >
  1438. </div>
  1439. </div>
  1440. <el-table ref="hasworkTbl"
  1441. :data="monthWorkDataS"
  1442. v-el-table-infinite-scroll="listScroll"
  1443. border
  1444. :height="'70vh'"
  1445. highlight-current-row
  1446. style="width: 100%"
  1447. v-loading="tbload"
  1448. :lazy="true"
  1449. :cell-style="hasworkTblCellStyle"
  1450. >
  1451. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1452. <template slot-scope="scope">
  1453. {{ scope.$index + 1 }}
  1454. </template>
  1455. </el-table-column>
  1456. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1457. <template slot-scope="scope">
  1458. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1459. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1460. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1461. <!-- {{scope.row.name}} -->
  1462. </span>
  1463. </template>
  1464. </el-table-column>
  1465. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1466. <template slot-scope="scope">
  1467. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1468. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1469. </template>
  1470. </el-table-column>
  1471. <el-table-column
  1472. min-width="60"
  1473. v-for="(item, index) in pickDateArray"
  1474. :key="index"
  1475. :label="item"
  1476. align="center"
  1477. >
  1478. <template slot="header" slot-scope="scope">
  1479. <div>{{ scope.column.label.dateStr }}</div>
  1480. <div>{{ scope.column.label.weekStr }}</div>
  1481. </template>
  1482. <template slot-scope="scope">
  1483. <div
  1484. v-if="
  1485. scope.row.worktimeList.filter(
  1486. (w) =>
  1487. w.createDate==item.date
  1488. ).length > 0 &&
  1489. scope.row.worktimeList.filter(
  1490. (w) =>w.createDate==item.date
  1491. )[0].workingTime < reportTimeType.allday
  1492. "
  1493. >
  1494. {{
  1495. scope.row.worktimeList.filter(
  1496. (w) =>w.createDate==item.date
  1497. )[0].workingTime.toFixed(1)
  1498. }}
  1499. </div>
  1500. <div
  1501. v-if="
  1502. scope.row.worktimeList.filter(
  1503. (w) =>w.createDate==item.date
  1504. ).length > 0 &&
  1505. scope.row.worktimeList.filter(
  1506. (w) =>w.createDate==item.date
  1507. )[0].workingTime > reportTimeType.allday
  1508. "
  1509. >
  1510. {{
  1511. scope.row.worktimeList.filter(
  1512. (w) =>w.createDate==item.date
  1513. )[0].workingTime.toFixed(1)
  1514. }}
  1515. </div>
  1516. <div
  1517. v-if="
  1518. scope.row.worktimeList.filter(
  1519. (w) =>w.createDate==item.date
  1520. ).length > 0 &&
  1521. scope.row.worktimeList.filter(
  1522. (w) =>w.createDate==item.date
  1523. )[0].workingTime == reportTimeType.allday
  1524. "
  1525. >
  1526. {{
  1527. scope.row.worktimeList.filter(
  1528. (w) =>w.createDate==item.date
  1529. )[0].workingTime
  1530. }}
  1531. </div>
  1532. <div
  1533. v-if="
  1534. scope.row.worktimeList.filter(
  1535. (w) =>w.createDate==item.date
  1536. ).length == 0
  1537. "
  1538. >
  1539. 0
  1540. </div>
  1541. <div
  1542. v-if="
  1543. scope.row.worktimeList.filter(
  1544. (w) =>w.createDate==item.date
  1545. ).length > 0 &&
  1546. typeof scope.row.worktimeList.filter(
  1547. (w) =>w.createDate==item.date
  1548. )[0].workingTime == 'string'
  1549. "
  1550. >
  1551. {{
  1552. scope.row.worktimeList.filter(
  1553. (w) =>w.createDate==item.date
  1554. )[0].workingTime
  1555. }}
  1556. </div>
  1557. </template>
  1558. </el-table-column>
  1559. </el-table>
  1560. <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>
  1561. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1562. </el-tab-pane>
  1563. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1564. <div class="selectworktime_export" style="margin-top:10px">
  1565. <div class="selectworktime_export_l">
  1566. <el-date-picker
  1567. class="selecteworktime_datapick"
  1568. v-model="WorktimeDatepickValue"
  1569. value-format="yyyy-MM-dd"
  1570. type="daterange"
  1571. align="right"
  1572. unlink-panels
  1573. :range-separator="$t('other.to')"
  1574. :start-placeholder="$t('time.startDate')"
  1575. :end-placeholder="$t('time.endDate')"
  1576. :default-time="['12:00:00', '12:00:00']"
  1577. size="small"
  1578. popper-class="selecteorktime_datapick_popper"
  1579. @change="showMonthNotWorkTime()"
  1580. >
  1581. </el-date-picker>
  1582. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1583. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1584. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1585. </div>
  1586. <div>
  1587. <div style="margin-top:10px;">
  1588. <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>
  1589. <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>
  1590. <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">
  1591. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1592. </el-input>
  1593. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1594. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1595. <el-link
  1596. type="primary"
  1597. style="float: right; vertical-align: middle;height:32px"
  1598. @click="exportMembNotWorkHours()"
  1599. >{{$t('export.exportData')}}</el-link
  1600. >
  1601. </div>
  1602. </div>
  1603. </div>
  1604. <el-table
  1605. ref="hasworkTbl2"
  1606. :data="monthNotWorkDateS"
  1607. v-el-table-infinite-scroll="notListScroll"
  1608. border
  1609. :height="'70vh'"
  1610. highlight-current-row
  1611. style="width: 100%"
  1612. v-loading="tbload"
  1613. lazy
  1614. >
  1615. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1616. <template slot-scope="scope">
  1617. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1618. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1619. </template>
  1620. </el-table-column>
  1621. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1622. <template slot-scope="scope">
  1623. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1624. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1625. </template>
  1626. </el-table-column>
  1627. <el-table-column
  1628. min-width="200"
  1629. :label="$t('weekDay.date')"
  1630. align="center"
  1631. prop="createDate"
  1632. >
  1633. </el-table-column>
  1634. <el-table-column
  1635. min-width="200"
  1636. :label="$t('state.states')"
  1637. align="center"
  1638. prop="status"
  1639. />
  1640. <el-table-column
  1641. min-width="200"
  1642. :label="$t('other.attendanceData')"
  1643. prop="cardTime"
  1644. align="center"
  1645. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1646. </el-table>
  1647. <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>
  1648. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1649. </el-tab-pane>
  1650. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1">
  1651. <div class="selectworktime_export" style="margin-top:10px">
  1652. <div class="selectworktime_export_l">
  1653. <el-date-picker
  1654. class="selecteworktime_datapick"
  1655. v-model="notfullSelectDateMonth"
  1656. value-format="yyyy-MM"
  1657. type="month"
  1658. align="right"
  1659. unlink-panels
  1660. size="small"
  1661. popper-class="selecteorktime_datapick_popper"
  1662. @change="showReportTimeLessThanCardTimeList()"
  1663. >
  1664. </el-date-picker>
  1665. </div>
  1666. <div>
  1667. <div style="margin-top:10px;">
  1668. <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>
  1669. <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>
  1670. <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">
  1671. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1672. </el-input>
  1673. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1674. <!-- <el-link
  1675. type="primary"
  1676. style="float: right; vertical-align: middle;height:32px"
  1677. @click="exportMembNotWorkHours()"
  1678. >{{$t('export.exportData')}}</el-link
  1679. > -->
  1680. </div>
  1681. </div>
  1682. </div>
  1683. <el-table
  1684. ref="hasworkTbl4"
  1685. :data="notFullData"
  1686. border
  1687. :height="'70vh'"
  1688. highlight-current-row
  1689. style="width: 100%"
  1690. v-loading="tbload"
  1691. lazy
  1692. >
  1693. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1694. <template slot-scope="scope">
  1695. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1696. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1697. </template>
  1698. </el-table-column>
  1699. <el-table-column
  1700. min-width="200"
  1701. :label="$t('weekDay.date')"
  1702. align="center"
  1703. prop="createDate"
  1704. >
  1705. </el-table-column>
  1706. <el-table-column
  1707. min-width="200"
  1708. :label="$t('fillReportTime')"
  1709. align="center"
  1710. prop="reportTime"
  1711. />
  1712. <el-table-column
  1713. min-width="200"
  1714. :label="$t('workAttendance')"
  1715. prop="workHours"
  1716. align="center"></el-table-column>
  1717. </el-table>
  1718. </el-tab-pane>
  1719. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1720. <div class="selectworktime_export" style="margin-top:10px;">
  1721. <div class="selectworktime_export_l">
  1722. <el-date-picker
  1723. class="selecteworktime_datapick"
  1724. v-model="WorktimeDatepickValue"
  1725. value-format="yyyy-MM-dd"
  1726. type="daterange"
  1727. align="right"
  1728. unlink-panels
  1729. :range-separator="$t('other.to')"
  1730. :start-placeholder="$t('time.startDate')"
  1731. :end-placeholder="$t('time.endDate')"
  1732. :default-time="['12:00:00', '12:00:00']"
  1733. size="small"
  1734. popper-class="selecteorktime_datapick_popper"
  1735. @change="showMonthWorkTimeReminder()"
  1736. >
  1737. </el-date-picker>
  1738. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1739. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1740. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1741. </div>
  1742. <div>
  1743. <div style="margin-top:10px;">
  1744. <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>
  1745. <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>
  1746. <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">
  1747. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1748. </el-input>
  1749. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1750. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1751. </div>
  1752. </div>
  1753. <div style="float: right; vertical-align: middle;height:32px">
  1754. <el-link
  1755. type="primary"
  1756. @click="changeReminder()"
  1757. >{{ $t('bianGengTiXing') }}</el-link
  1758. >
  1759. <el-link
  1760. type="primary"
  1761. @click="exportMembWorkHoursReminder()"
  1762. >{{$t('export.exportData')}}</el-link
  1763. >
  1764. </div>
  1765. </div>
  1766. <el-table ref="hasworkTbl"
  1767. :data="monthWorkDataS"
  1768. v-el-table-infinite-scroll="listScroll"
  1769. border
  1770. :height="'70vh'"
  1771. highlight-current-row
  1772. style="width: 100%"
  1773. v-loading="tbload"
  1774. :lazy="true"
  1775. >
  1776. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1777. <template slot-scope="scope">
  1778. {{ scope.row.createDate}}
  1779. </template>
  1780. </el-table-column>
  1781. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1782. <template slot-scope="scope">
  1783. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1784. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1785. <!-- {{scope.row.name}} -->
  1786. </template>
  1787. </el-table-column>
  1788. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1789. <template slot-scope="scope">
  1790. {{scope.row.invokeValue}}
  1791. </template>
  1792. </el-table-column>
  1793. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1794. <template slot-scope="scope">
  1795. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1796. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1797. </template>
  1798. </el-table-column>
  1799. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1800. <template slot-scope="scope">
  1801. {{ scope.row.workingTime}}
  1802. </template>
  1803. </el-table-column>
  1804. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1805. <template slot-scope="scope">
  1806. {{ scope.row.cardTime}}
  1807. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1808. </template>
  1809. </el-table-column>
  1810. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1811. <template slot-scope="scope">
  1812. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1813. </template>
  1814. </el-table-column>
  1815. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1816. <template slot-scope="scope">
  1817. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1818. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1819. </template>
  1820. </el-table-column>
  1821. </el-table>
  1822. <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>
  1823. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1824. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1825. <label style="font-size: 16px">员工每日已填报工时数</label>
  1826. <el-link
  1827. type="primary"
  1828. style="float: right; margin-right: 60px"
  1829. @click="exportMembWorkHours()"
  1830. >导出已填报数据</el-link
  1831. > -->
  1832. <!-- <el-button >导出</el-button> -->
  1833. <!-- </div> -->
  1834. </el-tab-pane>
  1835. </el-tabs>
  1836. </el-dialog>
  1837. <!--驳回弹出框 -->
  1838. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1839. <div>
  1840. <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')" />
  1841. </div>
  1842. <div slot="footer" class="dialog-footer">
  1843. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1844. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1845. </div>
  1846. </el-dialog>
  1847. <!-- 通过弹出框 -->
  1848. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1849. <div>
  1850. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1851. </div>
  1852. <div slot="footer" class="dialog-footer">
  1853. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1854. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1855. </div>
  1856. </el-dialog>
  1857. <!--批量导入日报 -->
  1858. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1859. <p>1. {{$t('other.download')}}
  1860. <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>
  1861. </p>
  1862. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1863. <p style="display: flex;justify-content: center;">
  1864. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1865. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1866. </el-upload>
  1867. </p>
  1868. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1869. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1870. </div>
  1871. </el-dialog>
  1872. <!-- 工时导入记录弹窗 -->
  1873. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1874. <div style="height: 452px">
  1875. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1876. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1877. <el-table-column prop="userName" :label="$t('other.operator')">
  1878. <template slot-scope="scope">
  1879. <div>
  1880. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1881. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1882. </div>
  1883. </template>
  1884. </el-table-column>
  1885. <el-table-column prop="datel" :label="$t('other.document')">
  1886. <template slot-scope="scope">
  1887. <div>
  1888. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1889. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1890. </div>
  1891. </template>
  1892. </el-table-column>
  1893. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1894. <template slot-scope="scope">
  1895. <div>
  1896. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1897. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1898. </div>
  1899. </template>
  1900. </el-table-column>
  1901. </el-table>
  1902. <el-col :span="24" class="paginatis">
  1903. <el-pagination
  1904. @size-change="handleSizeChange"
  1905. @current-change="handleCurrentChange"
  1906. :page-sizes="[20 , 50 , 80 , 100]"
  1907. :page-size="20"
  1908. layout="total, sizes, prev, pager, next"
  1909. :total="toViewForm.total"
  1910. style="float:right;"
  1911. ></el-pagination>
  1912. </el-col>
  1913. </div>
  1914. </el-dialog>
  1915. <!--基于企业微信考勤数据的工时导入 -->
  1916. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1917. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1918. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1919. </el-step>
  1920. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1921. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1922. </el-steps>
  1923. <div v-if="active==0" style="padding:30px;height:360px;">
  1924. <div style="margin-top:50px;margin-left:280px;">
  1925. <el-date-picker
  1926. v-model="importWxParam.date" :editable="false"
  1927. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1928. :clearable="true"
  1929. :range-separator="$t('other.to')"
  1930. type="daterange"
  1931. :start-placeholder="$t('time.startDate')"
  1932. :end-placeholder="$t('time.endDate')"
  1933. @change="loadCheckInData"
  1934. ></el-date-picker>
  1935. </div>
  1936. </div>
  1937. <div v-if="active==1" style="padding:10px;">
  1938. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1939. style="width: 100%;margin-top:5px;" >
  1940. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1941. <template slot-scope="scope">
  1942. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1943. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1944. </template>
  1945. </el-table-column>
  1946. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1947. </el-table-column>
  1948. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1949. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1950. <template slot-scope="scope">
  1951. <div>
  1952. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1953. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1954. </div>
  1955. </template>
  1956. </el-table-column>
  1957. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1958. <template slot-scope="scope">
  1959. <div>
  1960. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1961. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1962. </div>
  1963. </template>
  1964. </el-table-column>
  1965. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1966. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1967. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1968. <template slot-scope="scope">
  1969. {{scope.row.workHours.toFixed(1)}}h
  1970. </template>
  1971. </el-table-column>
  1972. </el-table>
  1973. </div>
  1974. <div v-if="active==2" >
  1975. <p style="display: flex;justify-content: center;height:390px;">
  1976. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1977. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1978. </el-upload>
  1979. </p>
  1980. </div>
  1981. <div slot="title">
  1982. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1983. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1984. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1985. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  1986. <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>
  1987. <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>
  1988. </div>
  1989. <span slot="footer">
  1990. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1991. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1992. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  1993. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1994. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1995. </span>
  1996. </el-dialog>
  1997. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1998. <p style="display: flex;justify-content: center;height:100px;">
  1999. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2000. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2001. </el-upload>
  2002. </p>
  2003. </el-dialog>
  2004. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2005. <div>
  2006. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2007. v-model="deleteReportParam.date" :editable="false"
  2008. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2009. :clearable="true"
  2010. :range-separator="$t('other.to')"
  2011. type="daterange"
  2012. :start-placeholder="$t('time.startDate')"
  2013. :end-placeholder="$t('time.endDate')"
  2014. ></el-date-picker>
  2015. </div>
  2016. <div style="margin-top:10px;">
  2017. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2018. <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>
  2019. <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>
  2020. </div>
  2021. <div style="margin-top:10px;">
  2022. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2023. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2024. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2025. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2026. <span v-else>{{item.name}}</span>
  2027. </el-option>
  2028. </el-select>
  2029. </div>
  2030. <span slot="footer">
  2031. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2032. </span>
  2033. </el-dialog>
  2034. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2035. <div>
  2036. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2037. v-model="deleteReportParam.date" :editable="false"
  2038. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2039. :clearable="true"
  2040. :range-separator="$t('other.to')"
  2041. type="daterange"
  2042. :start-placeholder="$t('time.startDate')"
  2043. :end-placeholder="$t('time.endDate')"
  2044. ></el-date-picker>
  2045. </div>
  2046. <div style="margin-top:15px;">
  2047. <span>{{ $t('other.selectdepartment') }}:</span>
  2048. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2049. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2050. size="small" v-if="user.userNameNeedTranslate != 1"
  2051. ></el-cascader>
  2052. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2053. </div>
  2054. <span slot="footer">
  2055. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2056. </span>
  2057. </el-dialog>
  2058. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2059. <div>
  2060. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2061. v-model="modImportTime"
  2062. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2063. :clearable="true"
  2064. type="datetime"
  2065. ></el-date-picker>
  2066. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2067. v-model="modImportUserId"
  2068. >
  2069. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2070. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2071. <span v-else>{{item.name}}</span>
  2072. </el-option>
  2073. </el-select>
  2074. </div>
  2075. <span slot="footer">
  2076. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2077. </span>
  2078. </el-dialog>
  2079. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2080. <div>
  2081. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2082. <el-date-picker
  2083. v-model="ratioYmonth" :editable="false"
  2084. format="yyyyMM" value-format="yyyyMM"
  2085. type="month"
  2086. ></el-date-picker>
  2087. </div>
  2088. <span slot="footer">
  2089. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2090. </span>
  2091. </el-dialog>
  2092. <!--工时批量代填 -->
  2093. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2094. <div>
  2095. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2096. v-model="importWxParam.date" :editable="false"
  2097. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2098. :clearable="true"
  2099. :range-separator="$t('other.to')"
  2100. type="daterange"
  2101. :start-placeholder="$t('time.startDate')"
  2102. :end-placeholder="$t('time.endDate')"
  2103. @change="loadCheckInData"
  2104. ></el-date-picker>
  2105. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2106. </div>
  2107. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2108. :key="timeStamp"
  2109. style="width: 100%;margin-top:5px;" ref="tab">
  2110. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2111. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2112. <template slot-scope="scope">
  2113. <div>
  2114. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2115. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2116. </div>
  2117. </template>
  2118. </el-table-column>
  2119. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2120. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2121. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2122. <template slot-scope="scope">
  2123. {{scope.row.workHours.toFixed(1)}}h
  2124. </template>
  2125. </el-table-column>
  2126. <!--项目名称列表 -->
  2127. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2128. <template slot-scope="scope">
  2129. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2130. </template>
  2131. </el-table-column>
  2132. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2133. <template slot-scope="scope">
  2134. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2135. </template>
  2136. </el-table-column>
  2137. </el-table>
  2138. </el-dialog>
  2139. <!--基于企业微信考勤数据的工时导入 -->
  2140. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2141. <div style="padding-bottom:10px;">
  2142. <p>{{importResultMsg}}</p>
  2143. </div>
  2144. <!-- <span slot="footer" class="dialog-footer">
  2145. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2146. </span> -->
  2147. </el-dialog>
  2148. <!-- 审核流程展示 -->
  2149. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2150. <div style="padding:20px 40px 20px 0">
  2151. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2152. <el-step title="待提交"></el-step>
  2153. <el-step title="员工提交"></el-step>
  2154. <el-step title="审核通过"></el-step>
  2155. </el-steps>
  2156. <el-divider v-if="user.companyId == 7544"></el-divider>
  2157. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2158. <el-timeline :reverse="false" style="margin-top:10px;">
  2159. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2160. <!-- {{item.msg}} -->
  2161. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2162. <span v-if="user.userNameNeedTranslate == 1">
  2163. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2164. <span>{{item.msgCon.two}}</span>
  2165. </span>
  2166. </el-timeline-item>
  2167. </el-timeline>
  2168. </div>
  2169. </el-dialog>
  2170. <!-- 威派格定制 -->
  2171. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2172. </section>
  2173. </template>
  2174. <script>
  2175. // 左右滑动
  2176. import dragMixin from "@/common/js/tensile.js";
  2177. import util from "../../common/js/util";
  2178. // 自定义select组件
  2179. import selectCat from "@/components/select.vue"
  2180. // 引入自定义级联组件
  2181. import vueCascader from "@/components/cascader.vue"
  2182. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2183. // 重庆物奇定制组件
  2184. import WeeklyCustomization from "./weeklyCustomization.vue"
  2185. // 威派格定制转移工时
  2186. import TransferWorkingHours from "./transferWorkingHours.vue"
  2187. // 新的按周填报
  2188. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2189. import { mapMutations } from 'vuex'
  2190. let _that = this
  2191. export default {
  2192. mixins: [dragMixin],
  2193. components: {
  2194. selectCat,
  2195. vueCascader,
  2196. WeeklyCustomization,
  2197. vueMultipleDept,
  2198. TransferWorkingHours,
  2199. NewWeeklyCustomization
  2200. },
  2201. data() {
  2202. return {
  2203. onlyHaveAttendance: false,
  2204. notFullData:[],
  2205. notFullOriginList:[],
  2206. singleDate:1,
  2207. subFillProjectList:[],
  2208. curAuditNode: 1,
  2209. refreshingTime: false,
  2210. substitudeStep: 1,
  2211. showHidden: false,
  2212. pageIndex: 0,
  2213. hasMore: true,
  2214. exportType: 0,
  2215. exportingData: false,
  2216. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2217. jobResponseList:[],
  2218. yisibeiCompId: 3092,
  2219. yuzhongCompId: 3385,
  2220. mingyiName : '成都明夷电子科技有限公司',
  2221. // mingyiName : '明夷',
  2222. modItemDataId: null,
  2223. modImportTime: null,
  2224. modImportUserId: null,
  2225. showModImportTimeDialog: false,
  2226. showBatchSimpleApproveReport: false,
  2227. startDeleting: false,
  2228. showBatchDeleteReport: false,
  2229. deleteReportParam: {date:null, userIds:[]},
  2230. isDenying: false,
  2231. targetWeekDate: null,//填写周报中的周日期
  2232. importCardTimeVisi: false,
  2233. startRatioExporting: false,
  2234. exportUserRatio: false,
  2235. ratioYmonth:null,
  2236. hasWrittenReport: false,
  2237. today:null,
  2238. syncTimeLoading: false,
  2239. seluserText: '',
  2240. translation: '1', // 1、文字, 2、部门, 3、人员
  2241. exportLoad: false,
  2242. getPickerOptions: {
  2243. disabledDate: (time) => {
  2244. var date = new Date();
  2245. var year = date.getFullYear();
  2246. var month = date.getMonth() + 1;
  2247. if (month >= 1 && month <= 9) {
  2248. month = "0" + month;
  2249. }
  2250. var currentdate = year.toString() + month.toString();
  2251. var timeyear = time.getFullYear();
  2252. var timemonth = time.getMonth() + 1;
  2253. if (timemonth >= 1 && timemonth <= 9) {
  2254. timemonth = "0" + timemonth;
  2255. }
  2256. var timedate = timeyear.toString() + timemonth.toString();
  2257. if(this.user.timeType.fillAhead == 0){
  2258. return currentdate < timedate;
  2259. }else{
  2260. return false
  2261. }
  2262. }
  2263. },
  2264. alalal: '8.0',
  2265. timeBasecostList:null,
  2266. tbload: false,
  2267. exportTimeDialog: false,
  2268. searchKeyword: '',
  2269. monthWorkDataS: [],
  2270. monthNotWorkDateS: [],
  2271. pickDateArray:[],
  2272. WorktimeDatepickValue: [],
  2273. activeName:"first",
  2274. isLeave: 0,
  2275. submitingReport: false,
  2276. importResultMsg:null,
  2277. showImportResult:false,
  2278. importingData: false,
  2279. isDraft: 0,
  2280. timeStamp: 0,
  2281. projectColumns:[],
  2282. checkinLoading:false,
  2283. importWxParam:{date:null,},
  2284. active:0,
  2285. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2286. importWxDialog:false,
  2287. importDialog:false,
  2288. denyForm:null,
  2289. denyReasonDialog:false,
  2290. monthWorkTimeDialog: false,
  2291. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2292. isSubstitude:false,
  2293. isFill:false,
  2294. unFillList:[],
  2295. fillList:[],
  2296. fillMembList:[],
  2297. fillMembList_leave: [],
  2298. membListVisible: false,
  2299. isBatch:0,//是否是批量填报
  2300. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2301. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2302. 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')],
  2303. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2304. fillStatusList: [],
  2305. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2306. exportReportLogParam:{dateRange:[]},
  2307. exportDialog:false,
  2308. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2309. subProjectList:[],
  2310. canEdit: true,
  2311. originCanEdit: true,
  2312. 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],
  2313. selectTime:null,
  2314. reportTimeType:{},
  2315. curDate:'',
  2316. isAllSelect: false,
  2317. approveDialogVisible:false,
  2318. deptId:null,
  2319. targetUid: null,
  2320. membCount:0,
  2321. selectState:"-1",
  2322. user: JSON.parse(sessionStorage.getItem("user")),
  2323. allUsersList: [],
  2324. showAddMore:false,
  2325. allDate: [],
  2326. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2327. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2328. choseDay: 0,
  2329. tableHeight: 0,
  2330. listLoading: false,
  2331. projectList: [], //项目列表
  2332. fillProjectList: [],
  2333. reportList: [], //日报列表
  2334. reportNames:[], //批量审批列表
  2335. selCon:[], //筛选条件
  2336. selProjectList:[], //筛选后项目列表
  2337. selConShow: true,
  2338. usersList: [], // 全部人员列表
  2339. usersListId: '', // 选中的人员id
  2340. dialogVisible: false, //项目弹窗
  2341. report: '',
  2342. workForm: {
  2343. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2344. domains: [{
  2345. id: null,
  2346. projectId: "",
  2347. workingTime: "",
  2348. timeType:0,
  2349. content: "",
  2350. state: 2,
  2351. multiWorktime:0,
  2352. worktimeList:[],
  2353. degreeId: null,
  2354. auditUserList: [],
  2355. }],
  2356. showRefresh: false,
  2357. },
  2358. workRules: {
  2359. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2360. },
  2361. chooseParticipVisible: false,
  2362. logining: false,
  2363. isDisable: false,
  2364. timeType:[],
  2365. deptMembData: [
  2366. ],
  2367. //部门人员树状结构
  2368. data: [
  2369. {
  2370. id: -1,
  2371. label: this.$t('lable.allStaff'),
  2372. membCount:0
  2373. },
  2374. {
  2375. id: 0,
  2376. label: this.$t('lable.unassigned'),
  2377. }
  2378. ],
  2379. allData:{},
  2380. batchShowData:{},
  2381. option: [],
  2382. deptOptionList: [],
  2383. depData: {
  2384. id: -1,
  2385. label: this.$t('lable.allStaff'),
  2386. },
  2387. defaultProps: {
  2388. children: 'children',
  2389. label: 'label'
  2390. },
  2391. isNew: false,
  2392. selected: false,
  2393. valuet: new Date(),
  2394. domObj: null,
  2395. participator:[],
  2396. chosenMembCount:0,
  2397. jsDay: 0,
  2398. jsTime: 0,
  2399. falsss: false,
  2400. weidu: [],
  2401. weiduList: [],
  2402. yonghuUser: [],
  2403. dateAr: [],
  2404. batchSubFillDialog: false,
  2405. isSubstiS: false,
  2406. fillWeekDialogVisi: false,
  2407. fillWeekDialogVisiCustom: false,
  2408. fillWeekDialogVisiCustomTwo: false,
  2409. zhoData: [],
  2410. weekDateRange: [],
  2411. btnZho: false,
  2412. weekDataLoading: false,
  2413. changdu: 6,
  2414. tianxieDialogVisible: false,
  2415. scopess: {},
  2416. zhoBao: {
  2417. time: '',
  2418. workingTime: '',
  2419. progress: '',
  2420. con: '',
  2421. subProjectId: '',
  2422. stage: '',
  2423. subProjectList: [],
  2424. stages: [],
  2425. },
  2426. zhoBaoIdx: '',
  2427. zhoBaoName: '',
  2428. zhis: {},
  2429. dealList: [],
  2430. toViewDialogVisible: false,
  2431. toViewList: [],
  2432. toViewloading: true,
  2433. toViewForm: {
  2434. pageIndex: '1',
  2435. pageSize: '20',
  2436. total: 0,
  2437. },
  2438. toViewloadings: false,
  2439. tabPositionss: 'top',
  2440. monthTotal: 0,
  2441. monthTotalPage: 0,
  2442. monthTotalLages: 20,
  2443. monthWorkData: [],
  2444. monthNotWorkDate: [],
  2445. monthWorkDataS1: [],
  2446. monthnotTotal: 0,
  2447. monthnotTotalPage: 0,
  2448. monthnotTotalLages: 20,
  2449. monthNotWorkDateS1: [],
  2450. deptMembDataText: '',
  2451. isFlag: false,
  2452. isMore: false,
  2453. stateKey: '0',
  2454. expandDate: [],
  2455. notifySelList:[],
  2456. departmentList: [],
  2457. trandepartmentList:[],
  2458. approvalProcessDialog: false,
  2459. approvalProcessData: [],
  2460. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2461. 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')],
  2462. isWeekend: false,
  2463. canCancelInDialog: false,
  2464. approveinData: {},
  2465. approveinDialog: false,
  2466. reportCanDelete: false,
  2467. weeklyFilledTimeDialog: false,
  2468. weeklyFilledTimeList: [],
  2469. weeklyFilledTimeLoading: false,
  2470. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2471. weeklyFilledTimeCanDelete: false,
  2472. weeklyFilledTimeDate: null,
  2473. leaveAllNum: 0,
  2474. dataLoading: false,
  2475. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2476. vacationTime: {},
  2477. integrationProjectList: [],
  2478. totalReportHours: 0, // 合计的工时
  2479. workTimeForMinYi:0,
  2480. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2481. weekIndex: 1,
  2482. weekParentData: {},
  2483. deptIdForNoReport:[],
  2484. deptIdForReminder:[],
  2485. nameAearch: '', // 企业微信姓名搜索
  2486. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2487. deptMembDataLoading: false,
  2488. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2489. {
  2490. id: 4811,
  2491. // id: 10,
  2492. name: '陕西柘中建设工程有限公司'
  2493. }
  2494. ],
  2495. pushWorkTimeLogDig:false,
  2496. pushWorkTimeLogData:[],
  2497. userReportDeptList: [],
  2498. isReminder:true,
  2499. reportLogCheckDialog:false,
  2500. deptIdForHasReport:[],
  2501. transferWorkingHoursVisable: false,
  2502. multiOptionData:[],
  2503. };
  2504. },
  2505. watch: {
  2506. deptMembDataText(val) {
  2507. this.$refs.chooseMembTree.filter(val);
  2508. }
  2509. },
  2510. filters: {
  2511. // 过滤
  2512. amounts(value) {
  2513. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2514. return 0
  2515. }
  2516. var zhi = +value + 0
  2517. return zhi.toFixed(1)
  2518. },
  2519. // zhoData
  2520. zhoData(value, arr) {
  2521. var dateArray = value.split("-");
  2522. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2523. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2524. // console.log(arr[date.getDay()])
  2525. // return "周" + "日一二三四五六".charAt(date.getDay());
  2526. return arr[date.getDay()]
  2527. },
  2528. // 过滤数字
  2529. numbers(value) {
  2530. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2531. return 0
  2532. }
  2533. return value
  2534. },
  2535. },
  2536. computed: {},
  2537. mounted() {
  2538. var now = new Date();
  2539. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2540. this.today = t;
  2541. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2542. this.exportParam.dateRange = [startStr,t];
  2543. this.exportReportLogParam.dateRange = [startStr,t];
  2544. this.getAllDate(1);
  2545. this.getReportList();
  2546. this.getProjectList();
  2547. this.getFillProjectList();
  2548. this.getTimeType();
  2549. this.getDepartment();
  2550. this.scrollFunction()
  2551. this.userssHu();
  2552. this.getFirstAndLastDay()
  2553. this.getMultiOptionData();
  2554. if(this.user.timeType.reportAuditType == 3){
  2555. this.getAllUsersList()
  2556. }
  2557. if (this.user.company.packageProject == 1) {
  2558. this.getBasecostItemList();
  2559. }
  2560. if(this.user.timeType.userWithMultiDept == 1) {
  2561. this.getDeptMembData();
  2562. }
  2563. if(this.user.timeType.lockWorktime){
  2564. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2565. }
  2566. //设置了下限
  2567. if (this.user.timeType.minReportTime) {
  2568. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2569. }
  2570. const that = this
  2571. if(this.user.userNameNeedTranslate == 1) {
  2572. that.dataLoading = that.$store.state.dataLoading
  2573. this.upDataLoading()
  2574. setTimeout(()=>{
  2575. that.dataLoading = that.$store.state.dataLoading
  2576. }, 1000)
  2577. }
  2578. if (this.user.companyId == this.yuzhongCompId) {
  2579. this.getJobResponList();
  2580. }
  2581. },
  2582. methods: {
  2583. ...mapMutations(['upDataLoading']),
  2584. // 已填工时情况表设置背景色
  2585. hasworkTblCellStyle({ columnIndex, row, column }) {
  2586. if(columnIndex > 2) {
  2587. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2588. const worktimeList = row.worktimeList || []
  2589. const times = this.reportTimeType.allday
  2590. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2591. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2592. const missReport = filterData[0] && filterData[0].missReport;
  2593. const state = filterData[0] && filterData[0].state
  2594. if (missReport) {
  2595. return "backgroundColor: red"
  2596. } else {
  2597. if (state == 0 || state == -1) {
  2598. return "backgroundColor: orange"
  2599. } else if (state == 1) {
  2600. //审核通过
  2601. return "backgroundColor: #32CD32"
  2602. } else if (state == 2) {
  2603. return "backgroundColor: red"
  2604. } else {
  2605. return "backgroundColor: #E0E0E0"
  2606. }
  2607. }
  2608. }
  2609. },
  2610. getMultiOptionData() {
  2611. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2612. res => {
  2613. if (res.code == "ok") {
  2614. this.multiOptionData = res.data;
  2615. } else {
  2616. this.$message({
  2617. message: res.msg,
  2618. type: "error"
  2619. });
  2620. }
  2621. },
  2622. error => {
  2623. this.$message({
  2624. message: error,
  2625. type: "error"
  2626. });
  2627. }
  2628. );
  2629. },
  2630. showReportTimeLessThanCardTimeList() {
  2631. this.monthTotalPage = 0,
  2632. this.tbload = true,
  2633. this.http.post(
  2634. "/report/getReportTimeLessThanCardTimeList",
  2635. {
  2636. date: this.notfullSelectDateMonth,
  2637. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2638. userId: this.usersListId
  2639. },
  2640. (res) => {
  2641. if (res.code == "ok") {
  2642. this.tbload = false
  2643. this.notFullData = res.data;
  2644. this.notFullOriginList = res.data;
  2645. }
  2646. },
  2647. (error) => {
  2648. this.tbload = false
  2649. this.$message({
  2650. message: error,
  2651. type: "error",
  2652. });
  2653. }
  2654. );
  2655. },
  2656. //按选择的日期范围刷新考勤
  2657. refreshWXCardTimeByRange() {
  2658. this.refreshingTime = true;
  2659. this.http.post('/wxcorp/getUserCheckInDayData',{
  2660. companyId: this.user.companyId,
  2661. userId: this.user.id,
  2662. startDate: this.importWxParam.date[0],
  2663. endDate: this.importWxParam.date[1],
  2664. },res => {
  2665. this.refreshingTime = false;
  2666. if(res.code == 'ok'){
  2667. this.loadCheckInData();
  2668. }else {
  2669. this.$message({
  2670. message: res.msg,
  2671. type: 'error'
  2672. })
  2673. }
  2674. },err => {
  2675. this.syncTimeLoading = false;
  2676. this.$message({
  2677. message: err,
  2678. type: 'error'
  2679. })
  2680. })
  2681. },
  2682. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2683. isCustomization(userInfo, permissionArray) {
  2684. const { companyId } = userInfo
  2685. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2686. return isReportPictureRequired
  2687. },
  2688. showHiddenFunction() {
  2689. this.showHidden = true;
  2690. },
  2691. // 获取如何信息选的可填写部门
  2692. getDeptMembData() {
  2693. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2694. if (res.code == "ok") {
  2695. let lists = res.data.userReportDeptList || []
  2696. const optimizedList = lists.map(item => ({
  2697. ...item,
  2698. label: item.departmentName,
  2699. value: item.departmentId,
  2700. }));
  2701. this.$set(this, 'userReportDeptList', optimizedList || []);
  2702. } else {
  2703. this.$message({
  2704. message: res.msg,
  2705. type: "error"
  2706. });
  2707. }
  2708. },error => { });
  2709. },
  2710. //任务被选中
  2711. onTaskSelected(domainItem) {
  2712. //取服务
  2713. if (domainItem.taskId) {
  2714. var that = this;
  2715. var param = {taskId:domainItem.taskId};
  2716. if (this.isSubstitude) {
  2717. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2718. param.userId = this.workForm.userId[0];
  2719. }
  2720. }
  2721. this.http.post('/task/getMyTaskService',param, res => {
  2722. if (res.code == "ok") {
  2723. // domainItem.workContentList = res.data;
  2724. that.$set(domainItem, 'sapServiceId', null);
  2725. that.$set(domainItem, 'serviceList', res.data);
  2726. } else {
  2727. this.$message({
  2728. message: res.msg,
  2729. type: "error"
  2730. });
  2731. }
  2732. },error => {
  2733. this.$message({
  2734. message: error,
  2735. type: "error"
  2736. });
  2737. }
  2738. );
  2739. } else {
  2740. //清空服务
  2741. }
  2742. },
  2743. onBatchTimeChange() {
  2744. //反向计算每日工作时长
  2745. if (this.workForm.createDate) {
  2746. let sdate = new Date(this.workForm.createDate[0]);
  2747. let edate = new Date(this.workForm.createDate[1]);
  2748. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2749. if (days < 0) {
  2750. return;
  2751. }
  2752. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2753. //总时长发生改变,自动按比例计算
  2754. this.workForm.domains.forEach(d=>{
  2755. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2756. });
  2757. }
  2758. },
  2759. //更新工作内容列表
  2760. updateJobContent(domainItem) {
  2761. var that = this;
  2762. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2763. if (res.code == "ok") {
  2764. // domainItem.workContentList = res.data;
  2765. that.$set(domainItem, 'extraField3', null);
  2766. that.$set(domainItem, 'workContentList', res.data);
  2767. } else {
  2768. this.$message({
  2769. message: res.msg,
  2770. type: "error"
  2771. });
  2772. }
  2773. },error => {
  2774. this.$message({
  2775. message: error,
  2776. type: "error"
  2777. });
  2778. }
  2779. );
  2780. },
  2781. updateResponse(domainItem) {
  2782. var that = this;
  2783. var selectPid = domainItem.projectId;
  2784. domainItem.extraField2 = null;
  2785. domainItem.extraField3 = null;
  2786. if (selectPid && domainItem.extraField1) {
  2787. //是否非项目
  2788. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2789. 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));
  2790. domainItem.filteredRespList = filteredRespList;
  2791. }
  2792. },
  2793. getJobResponList() {
  2794. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2795. if (res.code == "ok") {
  2796. this.jobResponseList = res.data;
  2797. } else {
  2798. this.$message({
  2799. message: res.msg,
  2800. type: "error"
  2801. });
  2802. }
  2803. },error => {
  2804. this.$message({
  2805. message: error,
  2806. type: "error"
  2807. });
  2808. }
  2809. );
  2810. },
  2811. openModImportTime(row) {
  2812. this.showModImportTimeDialog = true;
  2813. this.modItemDataId = row.id;
  2814. },
  2815. delImportTime(row) {
  2816. let rowId = row.id;
  2817. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2818. confirmButtonText: this.$t('btn.determine'),
  2819. cancelButtonText: this.$t('btn.cancel'),
  2820. type: "warning"
  2821. })
  2822. .then(() => {
  2823. this.http.post('/report-import-log/delete',{
  2824. id: rowId
  2825. },res => {
  2826. if (res.code == "ok") {
  2827. this.$message({
  2828. message: this.$t('message.successfullyDeleted'),
  2829. type: "success"
  2830. });
  2831. this.getToView();
  2832. } else {
  2833. this.$message({
  2834. message: res.msg,
  2835. type: "error"
  2836. });
  2837. }
  2838. },error => {
  2839. this.$message({
  2840. message: error,
  2841. type: "error"
  2842. });
  2843. }
  2844. );
  2845. }).catch(() => {this.startDeleting = false});
  2846. },
  2847. confirmChangeModTime() {
  2848. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2849. this.$message({
  2850. message: this.$t('message.Pleaseselectatime'),
  2851. type: "error"
  2852. });
  2853. return;
  2854. }
  2855. this.http.post('/report-import-log/changeTime',{
  2856. modLogDateTime: this.modImportTime,
  2857. modImportUserId: this.modImportUserId,
  2858. id: this.modItemDataId
  2859. },res => {
  2860. if (res.code == "ok") {
  2861. this.$message({
  2862. message: this.$t('message.modifyTheSuccess'),
  2863. type: "success"
  2864. });
  2865. this.getToView();
  2866. this.showModImportTimeDialog = false;
  2867. } else {
  2868. this.$message({
  2869. message: res.msg,
  2870. type: "error"
  2871. });
  2872. }
  2873. },error => {
  2874. this.$message({
  2875. message: error,
  2876. type: "error"
  2877. });
  2878. }
  2879. );
  2880. },
  2881. confirmBatchApproveReport() {
  2882. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2883. this.$message({
  2884. message: this.$t('qingXuanZeRiQiFanWei'),
  2885. type: "error"
  2886. });
  2887. return;
  2888. }
  2889. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2890. confirmButtonText: this.$t('btn.determine'),
  2891. cancelButtonText: this.$t('btn.cancel'),
  2892. type: "warning"
  2893. })
  2894. .then(() => {
  2895. this.startDeleting = true;
  2896. let obj = {
  2897. startDate: this.deleteReportParam.date[0],
  2898. endDate: this.deleteReportParam.date[1]
  2899. }
  2900. if(this.deleteReportParam.departmentId) {
  2901. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2902. } else {
  2903. obj.departmentId = null
  2904. }
  2905. this.http.post('/report/batchApproveByDate',obj,res => {
  2906. if (res.code == "ok") {
  2907. this.$message({
  2908. message: this.$t('state.approved'),
  2909. type: "success"
  2910. });
  2911. this.getReportList();
  2912. this.getDepartment();
  2913. this.startDeleting = false;
  2914. } else {
  2915. this.$message({
  2916. message: res.msg,
  2917. type: "error"
  2918. });
  2919. }
  2920. },error => {
  2921. this.$message({
  2922. message: error,
  2923. type: "error"
  2924. });
  2925. }
  2926. );
  2927. }).catch(() => {this.startDeleting = false});
  2928. },
  2929. confirmBatchDelReport() {
  2930. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2931. this.$message({
  2932. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2933. type: "error"
  2934. });
  2935. return;
  2936. }
  2937. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2938. this.$message({
  2939. message: this.$t('qingXuanZeRiQiFanWei'),
  2940. type: "error"
  2941. });
  2942. return;
  2943. }
  2944. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2945. confirmButtonText: this.$t('btn.determine'),
  2946. cancelButtonText: this.$t('btn.cancel'),
  2947. type: "warning"
  2948. })
  2949. .then(() => {
  2950. this.startDeleting = true;
  2951. this.http.post('/report/batchDelete',{
  2952. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2953. startDate: this.deleteReportParam.date[0],
  2954. endDate: this.deleteReportParam.date[1],
  2955. deptId: this.deleteReportParam.deptId[0]
  2956. },res => {
  2957. if (res.code == "ok") {
  2958. this.$message({
  2959. message: this.$t('message.successfullyDeleted'),
  2960. type: "success"
  2961. });
  2962. this.getReportList();
  2963. this.getDepartment();
  2964. this.startDeleting = false;
  2965. } else {
  2966. this.$message({
  2967. message: res.msg,
  2968. type: "error"
  2969. });
  2970. }
  2971. },error => {
  2972. this.$message({
  2973. message: error,
  2974. type: "error"
  2975. });
  2976. }
  2977. );
  2978. }).catch(() => {this.startDeleting = false});
  2979. },
  2980. getRecentlyProject(userId) {
  2981. this.http.post('/project/nearProject',{userId: userId},res => {
  2982. if(res.code == 'ok'){
  2983. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  2984. let topObj = {
  2985. label: this.$t('zuiJinXuanZeXiangMu'),
  2986. peojectList: res.data
  2987. }
  2988. let botomObj = {
  2989. label: this.$t('other.allProject'),
  2990. peojectList: bottomList
  2991. }
  2992. //最近项目如果在fillProjectList中不存在,需要移除
  2993. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  2994. this.integrationProjectList = [topObj, botomObj]
  2995. }else {
  2996. this.$message({
  2997. message: res.msg,
  2998. type: 'error'
  2999. })
  3000. }
  3001. },err => {
  3002. this.$message({
  3003. message: err,
  3004. type: 'error'
  3005. })
  3006. })
  3007. },
  3008. handlePictureCardPreview(file, index) {
  3009. let arr = []
  3010. let imgArr = this.workForm.domains[index].imgListUrl
  3011. for(var i in imgArr) {
  3012. arr.push(imgArr[i].url)
  3013. }
  3014. const $viewer = this.$viewerApi({
  3015. images: arr
  3016. });
  3017. },
  3018. // 图片上传
  3019. addImg(e, index) {
  3020. let formData = new FormData()
  3021. formData.append('multipartFile', e.file)
  3022. this.http.uploadFile('/common/uploadFile', formData,
  3023. res => {
  3024. if (res.code == "ok") {
  3025. this.$message({
  3026. message: this.$t('uploadedsuccessfully'),
  3027. type: "success"
  3028. });
  3029. if(!this.workForm.domains[index].imgList) {
  3030. this.workForm.domains[index].imgList = []
  3031. this.workForm.domains[index].imgListUrl = []
  3032. }
  3033. this.workForm.domains[index].imgList.push(res.data)
  3034. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3035. } else {
  3036. this.$message({message: res.msg,type: "error"});
  3037. }
  3038. },
  3039. error => {this.$message({message: error,type: "error"});
  3040. });
  3041. },
  3042. // 删除图片
  3043. delImg(file,fileList, index) {
  3044. let idx = 0
  3045. for(let i in fileList) {
  3046. if(fileList[i].uid == file.uid) {
  3047. idx = i
  3048. }
  3049. }
  3050. this.workForm.domains[index].imgList.splice(idx, 1)
  3051. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3052. },
  3053. test(){
  3054. console.log('test',this.workForm.domains);
  3055. },
  3056. getHour(s1, s2) {
  3057. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3058. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3059. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3060. var ms = s2.getTime() - s1.getTime();
  3061. if (ms < 0) return 0;
  3062. let ma = ms / 1000 / 60 / 60
  3063. return ma; //小时
  3064. },
  3065. refreshDDCardTime(workdate) {
  3066. if (!workdate) return;
  3067. this.syncTimeLoading = true;
  3068. this.http.post('/dingding/refreshUserCardTime',{
  3069. companyId: this.user.companyId,
  3070. userId: this.user.id,
  3071. date: workdate,
  3072. },res => {
  3073. this.syncTimeLoading = false;
  3074. if(res.code == 'ok'){
  3075. if (!res.data) {
  3076. this.$message({
  3077. message: '获取考勤失败',
  3078. type: 'error'
  3079. })
  3080. } else {
  3081. this.workForm.time = res.data;
  3082. }
  3083. }else {
  3084. this.$message({
  3085. message: res.msg,
  3086. type: 'error'
  3087. })
  3088. }
  3089. },err => {
  3090. this.syncTimeLoading = false;
  3091. this.$message({
  3092. message: err,
  3093. type: 'error'
  3094. })
  3095. })
  3096. },
  3097. refreshWXCardTime(workdate) {
  3098. if (!workdate) return;
  3099. this.syncTimeLoading = true;
  3100. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3101. date: workdate,
  3102. },res => {
  3103. this.syncTimeLoading = false;
  3104. if(res.code == 'ok'){
  3105. this.workForm.time = res.data.time;
  3106. }else {
  3107. this.$message({
  3108. message: res.msg,
  3109. type: 'error'
  3110. })
  3111. }
  3112. },err => {
  3113. this.syncTimeLoading = false;
  3114. this.$message({
  3115. message: err,
  3116. type: 'error'
  3117. })
  3118. })
  3119. },
  3120. refreshAttendance(workdate) {
  3121. if (!workdate) return;
  3122. this.syncTimeLoading = true;
  3123. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3124. startDate: workdate[0],
  3125. endDate: workdate[1]
  3126. },res => {
  3127. this.syncTimeLoading = false;
  3128. if(res.code == 'ok'){
  3129. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3130. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3131. this.totalReportHours = this.workTimeForMinYi;
  3132. }else {
  3133. this.$message({
  3134. message: res.msg,
  3135. type: 'error'
  3136. })
  3137. }
  3138. },err => {
  3139. this.syncTimeLoading = false;
  3140. this.$message({
  3141. message: err,
  3142. type: 'error'
  3143. })
  3144. })
  3145. },
  3146. refreshBeiSengAttendance(workdate) {
  3147. if (!workdate) return;
  3148. this.syncTimeLoading = true;
  3149. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3150. createDate: workdate
  3151. },res => {
  3152. this.syncTimeLoading = false;
  3153. if(res.code == 'ok'){
  3154. this.workForm.time = res.data;
  3155. }else {
  3156. this.$message({
  3157. message: res.msg,
  3158. type: 'error'
  3159. })
  3160. }
  3161. },err => {
  3162. this.syncTimeLoading = false;
  3163. this.$message({
  3164. message: err,
  3165. type: 'error'
  3166. })
  3167. })
  3168. },
  3169. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3170. this.weeklyFilledTimeDialog = true
  3171. this.weeklyFilledTimeLoading = true
  3172. this.weeklyFilledTimeDate = parameterDate
  3173. this.http.post('/report/getReportList',{
  3174. date: parameterDate,
  3175. userId: this.user.id
  3176. },res => {
  3177. this.weeklyFilledTimeLoading = false
  3178. if(res.code == 'ok'){
  3179. this.weeklyFilledTimeList = res.data[0].data
  3180. let candelete = true
  3181. for(let i in this.weeklyFilledTimeList){
  3182. if(this.weeklyFilledTimeList[i].state < 2){
  3183. candelete = false
  3184. }
  3185. }
  3186. this.weeklyFilledTimeCanDelete = candelete
  3187. }else {
  3188. this.$message({
  3189. message: res.msg,
  3190. type: 'error'
  3191. })
  3192. }
  3193. },err => {
  3194. this.weeklyFilledTimeLoading = false
  3195. this.$message({
  3196. message: err,
  3197. type: 'error'
  3198. })
  3199. })
  3200. },
  3201. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3202. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3203. confirmButtonText: this.$t('btn.determine'),
  3204. cancelButtonText: this.$t('btn.cancel'),
  3205. type: "warning"
  3206. })
  3207. .then(() => {
  3208. this.http.post('/report/delete',{
  3209. userId: this.user.id,
  3210. date: this.weeklyFilledTimeDate
  3211. },res => {
  3212. if (res.code == "ok") {
  3213. this.$message({
  3214. message: this.$t('message.successfullyDeleted'),
  3215. type: "success"
  3216. });
  3217. this.getWeeklyWorkTime()
  3218. this.getReportList();
  3219. this.getDepartment();
  3220. this.weeklyFilledTimeDialog = false;
  3221. } else {
  3222. this.$message({
  3223. message: res.msg,
  3224. type: "error"
  3225. });
  3226. }
  3227. },error => {
  3228. this.$message({
  3229. message: error,
  3230. type: "error"
  3231. });
  3232. }
  3233. );
  3234. }).catch(() => {});
  3235. },
  3236. getApprovalProcess(item){
  3237. // console.log('this.date',this.choseDate);
  3238. this.http.post('/report-log/get',{
  3239. creatorId: item.id,
  3240. createDate: sessionStorage.msg
  3241. },res => {
  3242. if(res.code == 'ok'){
  3243. this.approvalProcessDialog = true
  3244. if(this.user.userNameNeedTranslate == 1) {
  3245. for(var i in res.data) {
  3246. let obj = {
  3247. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3248. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3249. }
  3250. res.data[i].msgCon = obj
  3251. }
  3252. }
  3253. this.approvalProcessData = res.data
  3254. }else{
  3255. this.$message({
  3256. message: res.msg,
  3257. type: 'error'
  3258. })
  3259. }
  3260. },err => {
  3261. this.$message({
  3262. message: err,
  3263. type: 'error'
  3264. })
  3265. })
  3266. //获取审批节点状态
  3267. if (this.user.companyId == 7544) {
  3268. this.http.post('/report/getCurAuditNode',{
  3269. userId: item.id,
  3270. date: sessionStorage.msg
  3271. },res => {
  3272. if(res.code == 'ok'){
  3273. this.curAuditNode = res.data
  3274. }else{
  3275. }
  3276. },err => {
  3277. this.$message({
  3278. message: err,
  3279. type: 'error'
  3280. })
  3281. })
  3282. }
  3283. },
  3284. filterNode(value, data) {
  3285. if (!value) return true;
  3286. return data.label.indexOf(value) !== -1;
  3287. },
  3288. triggerCalculateOT(index) {
  3289. var str = this.workForm.domains[index].overtimeHours + ''
  3290. if(str.indexOf('.') != '-1') {
  3291. var s = str.split('.')[0]
  3292. var st = str.split('.')[1]
  3293. var sts = st.split('')
  3294. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3295. }
  3296. },
  3297. searchScreen(e){
  3298. if(e == 1){
  3299. this.monthNotWorkDateS1 = []
  3300. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3301. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3302. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3303. }
  3304. }
  3305. if (this.monthNotWorkDateS1.length > 50) {
  3306. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3307. }else{
  3308. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3309. }
  3310. } else if (e == 0) {
  3311. this.monthWorkDataS1 = []
  3312. for (let i = 0; i < this.monthWorkData.length; i++) {
  3313. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3314. this.monthWorkDataS1.push(this.monthWorkData[i])
  3315. }
  3316. }
  3317. if (this.monthWorkDataS1.length > 50) {
  3318. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3319. }else{
  3320. this.monthWorkDataS = this.monthWorkDataS1
  3321. }
  3322. } else if (e == 2) {
  3323. this.monthWorkDataS1 = []
  3324. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3325. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3326. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3327. }
  3328. }
  3329. if (this.monthWorkDataS1.length > 50) {
  3330. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3331. }else{
  3332. this.notFullData = this.monthWorkDataS1
  3333. }
  3334. }
  3335. },
  3336. addUpload(data) {
  3337. // var zhi = data.fileName.split('.')[0]
  3338. // var sss = zhi + '.xlsx'
  3339. // return
  3340. var filePath = '/upload/' + data.serverName;
  3341. const a = document.createElement('a'); // 创建a标签
  3342. a.setAttribute('download', data.fileName);// download属性
  3343. a.setAttribute('href', filePath);// href链接
  3344. a.click(); //自执行点击事件
  3345. a.remove();
  3346. },
  3347. restrictNumber(targetId) {
  3348. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3349. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3350. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3351. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3352. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3353. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3354. inpu.value = parseFloat(inpu.value);
  3355. }
  3356. },
  3357. //获取项目下的任务分组
  3358. getTaskGroups(domain, index) {
  3359. domain.groupId=null;
  3360. this.http.post('/task-group/listMyJoinGroup',{
  3361. projectId: domain.projectId,
  3362. isSubstitude: this.isSubstitude ? 1 : 0
  3363. },
  3364. res => {
  3365. if (res.code == "ok") {
  3366. this.workForm.domains[index].taskGroups = res.data;
  3367. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3368. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3369. // this.getGroupStages(domain, index);
  3370. // }
  3371. this.$forceUpdate();
  3372. }
  3373. },
  3374. error => {
  3375. this.$message({
  3376. message: error,
  3377. type: "error"
  3378. });
  3379. }
  3380. );
  3381. },
  3382. //下载填报工时占比报表
  3383. downloadProjectRatio() {
  3384. this.exportUserRatio = true;
  3385. // let now = new Date();
  3386. // let month = now.getMonth();//默认看上个月的
  3387. // let monthStr = month<10? ('0'+month): month;
  3388. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3389. const today = new Date();
  3390. const year = today.getFullYear();
  3391. const month = today.getMonth() + 1;
  3392. let lastMonthYear, lastMonth;
  3393. if (month === 1) {
  3394. lastMonthYear = year - 1;
  3395. lastMonth = 12;
  3396. } else {
  3397. lastMonthYear = year;
  3398. lastMonth = month - 1;
  3399. }
  3400. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3401. },
  3402. confirmDownloadRatio() {
  3403. this.startRatioExporting = true;
  3404. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3405. ymonth: this.ratioYmonth
  3406. },
  3407. res => {
  3408. if (res.code == "ok") {
  3409. this.startRatioExporting = false;
  3410. var filePath = res.data;
  3411. const a = document.createElement('a'); // 创建a标签
  3412. var data = filePath.split("/");
  3413. a.setAttribute('download', data[data.length-1]);// download属性
  3414. a.setAttribute('href', filePath);// href链接
  3415. a.click(); //自执行点击事件
  3416. a.remove();
  3417. } else {
  3418. this.startRatioExporting = false;
  3419. this.$message({
  3420. message: res.msg,
  3421. type: "error"
  3422. });
  3423. }
  3424. },
  3425. error => {
  3426. this.checkinLoading = false;
  3427. this.$message({
  3428. message: error,
  3429. type: "error"
  3430. });
  3431. }
  3432. );
  3433. },
  3434. //下载带企业微信考勤数据的工时统计模板
  3435. downloadCheckInExcel() {
  3436. var param = {
  3437. startDate: this.importWxParam.date[0],
  3438. endDate: this.importWxParam.date[1],
  3439. };
  3440. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3441. param.onlySelfData = false;
  3442. }
  3443. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3444. res => {
  3445. if (res.code == "ok") {
  3446. var filePath = res.data;
  3447. const a = document.createElement('a'); // 创建a标签
  3448. var data = filePath.split("/");
  3449. a.setAttribute('download', data[data.length-1]);// download属性
  3450. a.setAttribute('href', filePath);// href链接
  3451. a.click(); //自执行点击事件
  3452. a.remove();
  3453. } else {
  3454. this.$message({
  3455. message: res.msg,
  3456. type: "error"
  3457. });
  3458. }
  3459. },
  3460. error => {
  3461. this.checkinLoading = false;
  3462. this.$message({
  3463. message: error,
  3464. type: "error"
  3465. });
  3466. }
  3467. );
  3468. },
  3469. pre() {
  3470. if (this.active == 0) return;
  3471. this.active--;
  3472. },
  3473. next() {
  3474. this.active++;
  3475. },
  3476. triggerTotalTime(index) {
  3477. var item = this.checkinList[index];
  3478. var total = 0.0;
  3479. for (var i=0;i<this.projectColumns.length; i++) {
  3480. var key = this.projectColumns[i];
  3481. if (item[key] != null && item[key] != '') {
  3482. total += parseFloat(item[key]);
  3483. }
  3484. }
  3485. item.totalFillTime = total;
  3486. },
  3487. //提交批量代填的数据
  3488. submitBatchSubFillData() {
  3489. var data = JSON.stringify(this.checkinList);
  3490. this.http.post('/user-corpwx-time/submitProjectTime',{
  3491. json: data,
  3492. projectColumns: JSON.stringify(this.projectColumns)
  3493. },
  3494. res => {
  3495. if (res.code == "ok") {
  3496. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3497. this.importWxDialog = false;
  3498. }
  3499. },
  3500. error => {
  3501. this.checkinLoading = false;
  3502. this.$message({
  3503. message: error,
  3504. type: "error"
  3505. });
  3506. }
  3507. );
  3508. },
  3509. loadCheckInData() {
  3510. if (this.importWxParam.date == null) {
  3511. this.checkinList = [];
  3512. return;
  3513. }
  3514. this.checkinLoading = true;
  3515. this.http.post('/user-corpwx-time/getMyData',{
  3516. startDate: this.importWxParam.date[0],
  3517. endDate: this.importWxParam.date[1],
  3518. },
  3519. res => {
  3520. if (res.code == "ok") {
  3521. this.checkinLoading = false;
  3522. this.checkinList = res.data.list;
  3523. this.projectColumns = res.data.projects;
  3524. // 自定义表格会导致表格错乱,需重新计算表格
  3525. this.$nextTick(()=>{
  3526. this.$refs.tab.doLayout()
  3527. })
  3528. }
  3529. },
  3530. error => {
  3531. this.checkinLoading = false;
  3532. this.$message({
  3533. message: error,
  3534. type: "error"
  3535. });
  3536. }
  3537. );
  3538. },
  3539. importCardTime(item) {
  3540. //首先判断文件类型
  3541. let str = item.file.name.split(".");
  3542. let format = str[str.length - 1];
  3543. if (format != "xls" && format != "xlsx") {
  3544. this.$message({
  3545. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3546. type: "error"
  3547. });
  3548. } else {
  3549. this.importingData = true;
  3550. let formData = new FormData();
  3551. formData.append("multipartFile", item.file);
  3552. formData.append("companyId", this.user.companyId);
  3553. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3554. res => {
  3555. this.$refs.uploadCardTime.clearFiles();
  3556. this.importingData = false;
  3557. if (res.code == "ok") {
  3558. //换成弹出框,以免有人等了半天回来啥也没看到
  3559. this.$message({
  3560. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3561. type: "success"
  3562. });
  3563. } else {
  3564. this.$message({
  3565. message: res.msg,
  3566. type: "error"
  3567. });
  3568. }
  3569. },
  3570. error => {
  3571. this.$refs.upload.clearFiles();
  3572. this.listLoading = false;
  3573. this.$message({
  3574. message: error,
  3575. type: "error"
  3576. });
  3577. });
  3578. }
  3579. },
  3580. batchImportWxData(item) {
  3581. //首先判断文件类型
  3582. let str = item.file.name.split(".");
  3583. let format = str[str.length - 1];
  3584. if (format != "xls" && format != "xlsx") {
  3585. this.$message({
  3586. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3587. type: "error"
  3588. });
  3589. } else {
  3590. this.importingData = true;
  3591. let formData = new FormData();
  3592. formData.append("file", item.file);
  3593. formData.append("companyId", this.user.companyId);
  3594. formData.append("withCheckIn", 1);
  3595. this.http.uploadFile('/report/importData', formData,
  3596. res => {
  3597. this.$refs.upload.clearFiles();
  3598. this.showImportResult = true;
  3599. this.importingData = false;
  3600. if (res.code == "ok") {
  3601. //换成弹出框,以免有人等了半天回来啥也没看到
  3602. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3603. this.getReportList();
  3604. this.importWxDialog = false;
  3605. } else {
  3606. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3607. }
  3608. },
  3609. error => {
  3610. this.$refs.upload.clearFiles();
  3611. this.listLoading = false;
  3612. this.$message({
  3613. message: error,
  3614. type: "error"
  3615. });
  3616. });
  3617. }
  3618. },
  3619. batchImportData(item) {
  3620. //首先判断文件类型
  3621. let str = item.file.name.split(".");
  3622. let format = str[str.length - 1];
  3623. if (format != "xls" && format != "xlsx") {
  3624. this.$message({
  3625. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3626. type: "error"
  3627. });
  3628. } else {
  3629. this.importingData = true;
  3630. let formData = new FormData();
  3631. formData.append("file", item.file);
  3632. formData.append("companyId", this.user.companyId);
  3633. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3634. this.http.uploadFile(url, formData,
  3635. res => {
  3636. this.$refs.upload.clearFiles();
  3637. this.importingData = false;
  3638. this.showImportResult = true;
  3639. if (res.code == "ok") {
  3640. //换成弹出框,以免有人等了半天回来啥也没看到
  3641. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3642. this.getReportList();
  3643. this.importWXDialog = false;
  3644. } else {
  3645. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3646. }
  3647. },
  3648. error => {
  3649. this.$refs.upload.clearFiles();
  3650. this.importingData = false;
  3651. this.$message({
  3652. message: error,
  3653. type: "error"
  3654. });
  3655. });
  3656. }
  3657. },
  3658. userssHu() {
  3659. this.http.post('/time-type/getCompanyTimeSetting',{
  3660. companyId: this.user.companyId
  3661. },
  3662. res => {
  3663. if (res.code == "ok") {
  3664. this.yonghuUser = res.data
  3665. }
  3666. },
  3667. error => {
  3668. this.$message({
  3669. message: error,
  3670. type: "error"
  3671. });
  3672. }
  3673. );
  3674. },
  3675. iptBlur(i) {
  3676. if(this.isBatch == 0) {
  3677. return
  3678. }
  3679. var reqParam = {
  3680. startDate: this.workForm.createDate[0],
  3681. endDate: this.workForm.createDate[1]
  3682. };
  3683. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3684. reqParam.userId = this.workForm.userId[0];
  3685. }
  3686. this.http.post('/report/getWorkDays',reqParam,
  3687. res => {
  3688. if (res.code == "ok") {
  3689. this.jsDay = res.data
  3690. this.chuji(i)
  3691. } else {
  3692. this.$message({
  3693. message: res.msg,
  3694. type: "error"
  3695. });
  3696. }
  3697. },
  3698. error => {
  3699. this.$message({
  3700. message: error,
  3701. type: "error"
  3702. });
  3703. }
  3704. );
  3705. //明夷硬编码获取
  3706. if (this.user.company.companyName == this.mingyiName) {
  3707. this.getWorkTimeForMinYi();
  3708. }
  3709. },
  3710. getWorkTimeForMinYi(){
  3711. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3712. startDate: this.workForm.createDate[0],
  3713. endDate: this.workForm.createDate[1]
  3714. },
  3715. res => {
  3716. if (res.code == "ok") {
  3717. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3718. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3719. this.totalReportHours = this.workTimeForMinYi;
  3720. } else {
  3721. this.$message({
  3722. message: res.msg,
  3723. type: "error"
  3724. });
  3725. this.workForm.createDate = [];
  3726. }
  3727. },
  3728. error => {
  3729. this.$message({
  3730. message: error,
  3731. type: "error"
  3732. });
  3733. }
  3734. );
  3735. },
  3736. chuji(i) {
  3737. if(i == 0) {
  3738. this.seleChn(1)
  3739. } else if(i == 1) {
  3740. this.seleChn(0)
  3741. } else if(i == 2) {
  3742. if(this.workForm.domains[0].multiWorktime > 0) {
  3743. this.iptChangs()
  3744. } else {
  3745. this.iptChang()
  3746. }
  3747. } else if(i == 3) {
  3748. this.seleChn(0)
  3749. }
  3750. },
  3751. seleChn(e,domain) {
  3752. if(e == 1) {
  3753. for(var i in this.workForm.domains) {
  3754. if(this.workForm.domains[i].timeType == 0) {
  3755. this.workForm.domains[i].workingTime = 8
  3756. } else {
  3757. this.workForm.domains[i].workingTime = 4
  3758. }
  3759. }
  3760. }
  3761. var quanbu = 0
  3762. var spl = this.workForm.domains
  3763. var zhi = ''
  3764. for(var i in spl) {
  3765. var sp = +spl[i].workingTime + 0
  3766. zhi = this.jsDay * sp
  3767. quanbu = +quanbu + zhi
  3768. }
  3769. this.jsTime = quanbu
  3770. this.totalReportHours = quanbu
  3771. let worktime = this.jsTime
  3772. // 自动计算加班时长
  3773. if(this.isBatch != 0){
  3774. worktime = this.jsTime / this.jsDay
  3775. }
  3776. if(this.user.timeType.fillOvertime && domain){
  3777. let isover = false
  3778. let alltime = 0
  3779. let allover = 0 //此处alltime同上面的worktime
  3780. for(let d in spl){
  3781. if(spl[d].isOvertime){
  3782. isover = true
  3783. allover += spl[d].overtimeHours*1
  3784. }
  3785. alltime += spl[d].workingTime*1
  3786. }
  3787. if(domain.overtimeHours){
  3788. allover = allover - domain.overtimeHours
  3789. }
  3790. if(worktime*1 > this.user.timeType.allday){
  3791. if(isover){
  3792. if(alltime > (allover + this.user.timeType.allday)){
  3793. this.$set(domain,'isOvertime',true)
  3794. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3795. }else{
  3796. this.$set(domain,'isOvertime',false)
  3797. this.$set(domain,'overtimeHours',null)
  3798. if(alltime < (allover + this.user.timeType.allday)){
  3799. let overtime = allover + this.user.timeType.allday - alltime
  3800. for(let pi in spl){
  3801. if(spl[pi].overtimeHours){
  3802. if((overtime - spl[pi].overtimeHours*1) > 0){
  3803. overtime = overtime - spl[pi].overtimeHours*1
  3804. this.$set(spl[pi],'isOvertime',false)
  3805. this.$set(spl[pi],'overtimeHours',null)
  3806. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3807. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3808. break
  3809. }else{
  3810. this.$set(spl[pi],'isOvertime',false)
  3811. this.$set(spl[pi],'overtimeHours',null)
  3812. break
  3813. }
  3814. }
  3815. }
  3816. }
  3817. }
  3818. }else{
  3819. this.$set(domain,'isOvertime',true)
  3820. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3821. }
  3822. }else{
  3823. for(let di in spl){
  3824. this.$set(spl[di],'isOvertime',false)
  3825. this.$set(spl[di],'overtimeHours',null)
  3826. }
  3827. }
  3828. }
  3829. },
  3830. iptChang() {
  3831. var sl = this.workForm.domains
  3832. let timeArr = []
  3833. for(var i in sl) {
  3834. if(sl[i].startTime && sl[i].endTime) {
  3835. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3836. }
  3837. }
  3838. this.getTimeHours(timeArr)
  3839. },
  3840. iptChangs() {
  3841. var sl = this.workForm.domains
  3842. let timeArr = []
  3843. for(var i in sl) {
  3844. for(var j in sl[i].worktimeList){
  3845. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3846. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3847. }
  3848. }
  3849. }
  3850. this.getTimeHours(timeArr)
  3851. },
  3852. // 调用接口或去数据
  3853. getTimeHours(arr) {
  3854. this.http.post('/report/getHoursByTimeRange',{
  3855. timeJsonStr: JSON.stringify(arr)
  3856. },res => {
  3857. if(res.code === 'ok') {
  3858. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3859. } else {
  3860. this.$message({
  3861. message: res.msg,
  3862. type: 'error'
  3863. })
  3864. }
  3865. },err => {
  3866. this.$message({
  3867. message: err,
  3868. type: 'error'
  3869. })
  3870. })
  3871. },
  3872. // 按周填报调用接口计算时间
  3873. async getWeekHoursByTimeRange(timeRange) {
  3874. const url = '/report/getHoursByTimeRange';
  3875. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3876. var that = this;
  3877. return new Promise((resolve, reject) => {
  3878. this.http.post(url, data, function(res) {
  3879. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3880. }, function(err) {
  3881. reject(err);
  3882. });
  3883. });
  3884. },
  3885. removeTimeItem(item, index) {
  3886. item.worktimeList.splice(index, 1);
  3887. this.iptChangs()
  3888. },
  3889. //添加工时
  3890. addNewWorktime(index, item) {
  3891. if(item.worktimeList == null ) {
  3892. item.worktimeList = []
  3893. }
  3894. item.worktimeList.push({});
  3895. },
  3896. //复制项目
  3897. copyProject(index) {
  3898. var leftProgress = 10;
  3899. if (this.reportTimeType.type == 3) {
  3900. //计算已经待分配工时比例
  3901. let array = this.workForm.domains;
  3902. let totalProgress = 0;
  3903. for (var i=0;i<array.length; i++) {
  3904. totalProgress += array[i].progress;
  3905. }
  3906. if (totalProgress < 100) {
  3907. leftProgress = 100 - totalProgress;
  3908. }
  3909. }
  3910. var newIndex = index+1;
  3911. var itemDomain = {
  3912. projectId: this.workForm.domains[index].projectId,
  3913. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3914. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3915. ),
  3916. content: "",
  3917. progress:leftProgress,
  3918. state:2,//2-表示待提交
  3919. };
  3920. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3921. if (this.reportTimeType.type == 0) {
  3922. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3923. var length = this.workForm.domains.length;
  3924. if (length == 2) {
  3925. this.showAddMore = false;
  3926. }
  3927. }
  3928. this.selectProject(itemDomain, newIndex);
  3929. },
  3930. pushWorkTime(reportId){
  3931. let url=''
  3932. if(this.user.timeType.syncSap == 1){
  3933. url='/report/pushProjectReportToSap'
  3934. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3935. var pushDate = this.date + day;
  3936. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3937. confirmButtonText: this.$t('btn.determine'),
  3938. cancelButtonText: this.$t('btn.cancel'),
  3939. type: 'info'
  3940. }).then(() => {
  3941. const loading = this.$loading({
  3942. lock: true,
  3943. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3944. spinner: 'el-icon-loading',
  3945. background: 'rgba(0, 0, 0, 0.7)'
  3946. });
  3947. this.http.post(url,{
  3948. pushDate: pushDate,
  3949. reportId: reportId
  3950. },res => {
  3951. loading.close();
  3952. if(res.code == 'ok'){
  3953. this.$message({
  3954. type: 'success',
  3955. message: res.data
  3956. });
  3957. }else{
  3958. this.$message({
  3959. type: 'error',
  3960. message: res.msg
  3961. })
  3962. }
  3963. },err => {
  3964. loading.close();
  3965. this.$message({
  3966. type: 'error',
  3967. message: err
  3968. })
  3969. })
  3970. }).catch(() => {
  3971. });
  3972. }else{
  3973. url='/report/pushReportDataToThird'
  3974. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3975. confirmButtonText: this.$t('btn.determine'),
  3976. cancelButtonText: this.$t('btn.cancel'),
  3977. type: 'info'
  3978. }).then(() => {
  3979. const loading = this.$loading({
  3980. lock: true,
  3981. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3982. spinner: 'el-icon-loading',
  3983. background: 'rgba(0, 0, 0, 0.7)'
  3984. });
  3985. this.http.post(url,{
  3986. yearMonth: this.date
  3987. },res => {
  3988. loading.close();
  3989. if(res.code == 'ok'){
  3990. this.$message({
  3991. type: 'success',
  3992. message: this.$t('tuiSongChengGong')
  3993. });
  3994. }else{
  3995. this.$message({
  3996. type: 'error',
  3997. message: res.msg
  3998. })
  3999. }
  4000. },err => {
  4001. loading.close();
  4002. this.$message({
  4003. type: 'error',
  4004. message: err
  4005. })
  4006. })
  4007. }).catch(() => {
  4008. });
  4009. }
  4010. },
  4011. showWorkTime(){
  4012. this.monthWorkTimeDialog = true;
  4013. this.searchKeyword = ''
  4014. this.WorktimeDatepickValue = this.istoMonth()
  4015. if(this.WorktimeDatepickValue.length == 0){
  4016. let newdate = new Date();
  4017. let nowdate = newdate.toLocaleDateString();
  4018. let getauto = this.getAutoWeekDate(nowdate)
  4019. let nowwd = [getauto[0],getauto[6]]
  4020. this.WorktimeDatepickValue = nowwd
  4021. }
  4022. this.showMonthWorkTime()
  4023. },
  4024. handleClick(t,e){
  4025. if (t.name == "second") {
  4026. this.showMonthNotWorkTime()
  4027. }else if(t.name == "first"){
  4028. this.showMonthWorkTime()
  4029. }else if(t.name == "third"){
  4030. this.showMonthWorkTimeReminder()
  4031. } else if (t.name == "fourth") {
  4032. this.showReportTimeLessThanCardTimeList();
  4033. }
  4034. },
  4035. //导出员工每日填报工时数
  4036. exportMembWorkHours() {
  4037. this.http.post(
  4038. "/report/exportUserDailyWorkTime",
  4039. {
  4040. // month: this.date,
  4041. startDate: this.WorktimeDatepickValue[0],
  4042. endDate: this.WorktimeDatepickValue[1],
  4043. },
  4044. (res) => {
  4045. if (res.code == "ok") {
  4046. let url = res.data;
  4047. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4048. }
  4049. },
  4050. (error) => {
  4051. this.$message({
  4052. message: error,
  4053. type: "error",
  4054. });
  4055. }
  4056. );
  4057. },
  4058. exportMembWorkHoursReminder() {
  4059. this.http.post(
  4060. "/report/exportUserDailyWorkTimeReminder",
  4061. {
  4062. // month: this.date,
  4063. startDate: this.WorktimeDatepickValue[0],
  4064. endDate: this.WorktimeDatepickValue[1],
  4065. },
  4066. (res) => {
  4067. if (res.code == "ok") {
  4068. let url = res.data;
  4069. this.downloadByA('工时异常表.xlsx', url);
  4070. }
  4071. },
  4072. (error) => {
  4073. this.$message({
  4074. message: error,
  4075. type: "error",
  4076. });
  4077. }
  4078. );
  4079. },
  4080. exportMembNotWorkHours() {
  4081. this.http.post(
  4082. "/report/exportNoReportUserList",
  4083. {
  4084. // month: this.date,
  4085. startDate: this.WorktimeDatepickValue[0],
  4086. endDate: this.WorktimeDatepickValue[1],
  4087. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4088. },
  4089. (res) => {
  4090. if (res.code == "ok") {
  4091. let url = res.data;
  4092. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4093. }
  4094. },
  4095. (error) => {
  4096. this.$message({
  4097. message: error,
  4098. type: "error",
  4099. });
  4100. }
  4101. );
  4102. },
  4103. downloadByA(name, url) {
  4104. const a = document.createElement("a"); // 创建a标签
  4105. a.setAttribute("download", name); // download属性
  4106. a.setAttribute("href", url); // href链接
  4107. a.click(); // 自执行点击事件
  4108. a.remove();
  4109. },
  4110. // 是否本月判断
  4111. istoMonth(){
  4112. let todate = new Date()
  4113. let tomonth = todate.getMonth() + 1
  4114. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4115. if(this.date == adate){
  4116. return []
  4117. }else{
  4118. let sedate = new Date(this.date)
  4119. let semonth = sedate.getMonth() + 1
  4120. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4121. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4122. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4123. return [sedates1, sedates2]
  4124. }
  4125. },
  4126. showMonthWorkTime() {
  4127. this.monthTotalPage = 0,
  4128. this.tbload = true
  4129. let parameter={
  4130. startDate: this.WorktimeDatepickValue[0],
  4131. endDate: this.WorktimeDatepickValue[1],
  4132. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4133. }
  4134. this.http.post(
  4135. "/report/getUserDailyWorkTime",
  4136. // "/report/getNoReportUserList",
  4137. parameter,
  4138. (res) => {
  4139. if (res.code == "ok") {
  4140. this.tbload = false;
  4141. this.pickDateArray = res.data.days.map(item => {
  4142. return {
  4143. ...item,
  4144. dateStr: item.label.split('/')[0],
  4145. weekStr: item.label.split('/')[1]
  4146. }
  4147. });
  4148. // console.log('dataarray',res.data.days);
  4149. this.monthWorkData = res.data.list;
  4150. // this.monthWorkDataS = this.monthWorkData
  4151. // this.monthWorkDataS1 = res.data.list
  4152. this.monthTotal = res.data.list.length
  4153. if (this.monthWorkData.length > 50) {
  4154. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4155. }else{
  4156. this.monthWorkDataS = this.monthWorkData
  4157. }
  4158. this.searchScreen(0)
  4159. // this.monthWorkDataS = infoList
  4160. // 判断
  4161. // if (this.monthWorkDataS1.length > 0) {
  4162. // setTimeout(() => {
  4163. // this.tableListener()
  4164. // }, 1000);
  4165. // }
  4166. this.$nextTick(function(){
  4167. this.$refs.hasworkTbl.doLayout();
  4168. });
  4169. // this.$forceUpdate()
  4170. }
  4171. },
  4172. (error) => {
  4173. this.tbload = false
  4174. this.$message({
  4175. message: error,
  4176. type: "error",
  4177. });
  4178. }
  4179. );
  4180. },
  4181. showMonthWorkTimeReminder() {
  4182. this.monthTotalPage = 0,
  4183. this.tbload = true
  4184. let parameter={}
  4185. parameter={
  4186. startDate: this.WorktimeDatepickValue[0],
  4187. endDate: this.WorktimeDatepickValue[1],
  4188. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4189. viewValue:this.isReminder?1:0
  4190. }
  4191. this.http.post(
  4192. "/report/getUserDailyWorkTimeReminder",
  4193. parameter,
  4194. (res) => {
  4195. if (res.code == "ok") {
  4196. this.tbload = false;
  4197. this.monthWorkData = res.data.list;
  4198. this.monthTotal = res.data.list.length
  4199. if (this.monthWorkData.length > 50) {
  4200. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4201. }else{
  4202. this.monthWorkDataS = this.monthWorkData
  4203. }
  4204. this.searchScreen(0)
  4205. this.$nextTick(function(){
  4206. this.$refs.hasworkTbl.doLayout();
  4207. });
  4208. }
  4209. },
  4210. (error) => {
  4211. this.tbload = false
  4212. this.$message({
  4213. message: error,
  4214. type: "error",
  4215. });
  4216. }
  4217. );
  4218. },
  4219. showMonthNotWorkTime() {
  4220. this.monthTotalPage = 0,
  4221. this.tbload = true,
  4222. this.http.post(
  4223. "/report/getNoReportUserList",
  4224. {
  4225. startDate: this.WorktimeDatepickValue[0],
  4226. endDate: this.WorktimeDatepickValue[1],
  4227. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4228. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4229. },
  4230. (res) => {
  4231. if (res.code == "ok") {
  4232. this.tbload = false
  4233. this.monthNotWorkDate = res.data;
  4234. this.monthnotTotal = res.data.length
  4235. if (this.monthNotWorkDate.length > 50) {
  4236. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4237. } else {
  4238. this.monthNotWorkDateS = this.monthNotWorkDate
  4239. }
  4240. this.searchScreen(1)
  4241. this.$nextTick(function(){
  4242. this.$refs.hasworkTbl2.doLayout();
  4243. });
  4244. }
  4245. },
  4246. (error) => {
  4247. this.tbload = false
  4248. this.$message({
  4249. message: error,
  4250. type: "error",
  4251. });
  4252. }
  4253. );
  4254. },
  4255. listScroll(){
  4256. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4257. this.isMore = true
  4258. setTimeout(()=>{
  4259. this.isMore = false
  4260. },1000)
  4261. }else {
  4262. this.isFlag = true
  4263. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4264. this.monthWorkDataS = datalist
  4265. setTimeout(()=>{
  4266. this.isFlag = false
  4267. },300)
  4268. }
  4269. },
  4270. notListScroll(){
  4271. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4272. this.isMore = true
  4273. setTimeout(()=>{
  4274. this.isMore = false
  4275. },1000)
  4276. }else {
  4277. this.isFlag = true
  4278. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4279. this.monthNotWorkDateS = datalist
  4280. // console.log('length',this.monthNotWorkDateS.length)
  4281. setTimeout(()=>{
  4282. this.isFlag = false
  4283. },300)
  4284. }
  4285. },
  4286. getFirstAndLastDay() {
  4287. // 将选定的月份转换为Date对象
  4288. var monthDate = new Date();
  4289. var year = monthDate.getFullYear();
  4290. var month = monthDate.getMonth();
  4291. // 计算起始日和结束日
  4292. var startDay = new Date(year, month, 1);
  4293. var endDay = new Date(year, month + 1, 0);
  4294. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4295. this.WorktimeDatepickValueForMonth=lastmd
  4296. },
  4297. formatDate(date) {
  4298. var year = date.getFullYear();
  4299. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4300. var day = ("0" + date.getDate()).slice(-2);
  4301. return year + "-" + month + "-" + day;
  4302. },
  4303. // 获取默认这zhou日期参数 222
  4304. getLastWeek(e){
  4305. let newdate = new Date()
  4306. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4307. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4308. if(e==1){
  4309. this.WorktimeDatepickValue = lastwd
  4310. this.showMonthWorkTime()
  4311. }else if(e==2){
  4312. this.WorktimeDatepickValue = lastwd
  4313. this.showMonthWorkTimeReminder()
  4314. }else{
  4315. this.WorktimeDatepickValue = lastwd
  4316. this.showMonthNotWorkTime()
  4317. }
  4318. },
  4319. getThisWeek(e){
  4320. let newdate = new Date();
  4321. let nowdate = newdate.toLocaleDateString();
  4322. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4323. if(e==1){
  4324. this.WorktimeDatepickValue = nowwd
  4325. this.showMonthWorkTime()
  4326. }else if(e==2){
  4327. this.WorktimeDatepickValue = nowwd
  4328. this.showMonthWorkTimeReminder()
  4329. }else{
  4330. this.WorktimeDatepickValue = nowwd
  4331. this.showMonthNotWorkTime()
  4332. }
  4333. },
  4334. getDoubleLastWeek(e){
  4335. let newdate = new Date()
  4336. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4337. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4338. if(e==1){
  4339. this.WorktimeDatepickValue = nextwd
  4340. this.showMonthWorkTime()
  4341. }else if(e==2){
  4342. this.WorktimeDatepickValue = nextwd
  4343. this.showMonthWorkTimeReminder()
  4344. }else{
  4345. this.WorktimeDatepickValue = nextwd
  4346. this.showMonthNotWorkTime()
  4347. }
  4348. },
  4349. alreadyAllDate(stime,etime){
  4350. let diffdate = new Array();
  4351. let i=0;
  4352. while(stime<=etime){
  4353. let dateArray = stime.split("-");
  4354. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4355. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4356. let stimewk = this.weekDay[date.getDay()]
  4357. 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')
  4358. 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])
  4359. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4360. let stime_ts = new Date(stime).getTime();
  4361. let next_date = stime_ts + (24*60*60*1000);
  4362. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4363. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4364. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4365. stime = next_dates_y+next_dates_m+next_dates_d;
  4366. i++;
  4367. }
  4368. return diffdate
  4369. },
  4370. getAutoWeekDate(e) {
  4371. let dateString = e;
  4372. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4373. if (dateString.match(dateStringReg)) {
  4374. let presentDate = new Date(dateString),
  4375. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4376. return Array.from(new Array(7), function (val, index) {
  4377. let formatDate = new Date(
  4378. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4379. );
  4380. return (
  4381. formatDate.getFullYear() +
  4382. "-" +
  4383. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4384. "-" +
  4385. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4386. );
  4387. });
  4388. } else {
  4389. throw new Error(
  4390. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4391. );
  4392. }
  4393. },
  4394. onProgressChange() {
  4395. this.$forceUpdate();
  4396. },
  4397. showChooseMembTree() {
  4398. this.chosenMembCount = this.participator.length;
  4399. this.chooseParticipVisible = true;
  4400. },
  4401. onTreeItemChange() {
  4402. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4403. var list = chosenList.filter(item=>item.isUser == 1);
  4404. this.chosenMembCount = list.length;
  4405. },
  4406. findUserInTree() {
  4407. if (this.filterName == '') {
  4408. this.deptMembData = this.allMembData;
  4409. } else {
  4410. var list = this.findRecursively(this.filterName, this.allMembData);
  4411. this.deptMembData = list;
  4412. }
  4413. },
  4414. findRecursively(username, list) {
  4415. var filterList = [];
  4416. for (var i=0;i<list.length; i++) {
  4417. if (list[i].isUser == 1) {
  4418. if (list[i].label.indexOf(username) >= 0) {
  4419. //匹配上了
  4420. filterList.push(list[i]);
  4421. }
  4422. } else if (list[i].children != null && list[i].children.length > 0) {
  4423. var subList = this.findRecursively(username, list[i].children);
  4424. if (subList.length > 0) {
  4425. subList.forEach(s=>filterList.push(s));
  4426. }
  4427. }
  4428. }
  4429. return filterList;
  4430. },
  4431. //确定选择参与人
  4432. chooseParticip() {
  4433. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4434. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4435. //只能选择一个人进行代填,防止任务有问题
  4436. if (this.chosenMembList.length > 1) {
  4437. this.$message({
  4438. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4439. type: "error",
  4440. });
  4441. return;
  4442. }
  4443. this.chooseParticipVisible = false;
  4444. this.workForm.userNames = '';
  4445. this.workForm.userId = [];
  4446. this.participator = [];
  4447. for (var i=0;i<this.chosenMembList.length; i++) {
  4448. this.workForm.userId.push(this.chosenMembList[i].id);
  4449. this.workForm.userNames += this.chosenMembList[i].label+',';
  4450. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4451. this.participator.push(item);
  4452. }
  4453. if (this.workForm.userNames.length > 0) {
  4454. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4455. }
  4456. if(this.user.userNameNeedTranslate == 1) {
  4457. if(this.workForm.userNames) {
  4458. this.workForm.userNames = this.workForm.userNames.split(',')
  4459. }
  4460. }
  4461. //加载该人员的可填报项目
  4462. if (this.workForm.userId.length > 0) {
  4463. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4464. }
  4465. //打通企业微信考勤的情况,获取考勤
  4466. if (this.user.timeType.showCorpwxCardtime) {
  4467. this.getTargetUserCardTime();
  4468. }
  4469. },
  4470. getTargetUserCardTime() {
  4471. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4472. this.http.post('/user-corpwx-time/getUserCardTime',{
  4473. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4474. },
  4475. res => {
  4476. if (res.code == "ok") {
  4477. this.$set(this.workForm,'time', res.data);
  4478. }
  4479. },
  4480. error => {
  4481. this.$message({
  4482. message: error,
  4483. type: "error"
  4484. });
  4485. }
  4486. );
  4487. }
  4488. },
  4489. notifySel(sel){
  4490. // console.log(sel);
  4491. this.notifySelList = sel
  4492. },
  4493. //微信通知人员填写
  4494. Notify(code) {
  4495. if (this.notifySelList.length == 0) return;
  4496. var ids = '';
  4497. this.notifySelList.forEach(f=>{
  4498. ids += f.id+',';
  4499. })
  4500. this.http.post('/user/pushFillReport',{
  4501. ids: ids, date: this.curDate,
  4502. code: code
  4503. },
  4504. res => {
  4505. if (res.code == "ok") {
  4506. this.$message({
  4507. message: this.$t('message.sentSuccessfully'),
  4508. type: "success"
  4509. });
  4510. }
  4511. },
  4512. error => {
  4513. this.$message({
  4514. message: error,
  4515. type: "error"
  4516. });
  4517. }
  4518. );
  4519. },
  4520. //导出人员列表
  4521. exportMemb() {
  4522. if (this.fillMembList.length == 0) return;
  4523. var ids = '';
  4524. this.fillMembList.forEach(f=>{
  4525. ids += f.id+',';
  4526. })
  4527. this.http.post('/user/exportMembList',{
  4528. ids: ids,isFill: this.isFill, date: this.curDate
  4529. },
  4530. res => {
  4531. if (res.code == "ok") {
  4532. var aTag = document.createElement('a');
  4533. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4534. aTag.href = res.data;
  4535. aTag.click();
  4536. }
  4537. },
  4538. error => {
  4539. this.$message({
  4540. message: error,
  4541. type: "error"
  4542. });
  4543. }
  4544. );
  4545. },
  4546. showMembList(fill) {
  4547. this.membListVisible = true;
  4548. if (fill == 0) {
  4549. this.fillMembList = this.unFillList;
  4550. this.isFill = false;
  4551. let leaveList = []
  4552. let unleaveList = []
  4553. for(let i in this.fillMembList){
  4554. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4555. leaveList.push(this.fillMembList[i])
  4556. }else{
  4557. unleaveList.push(this.fillMembList[i])
  4558. }
  4559. }
  4560. this.fillMembList = unleaveList
  4561. this.fillMembList_leave = leaveList
  4562. } else if(fill == 1){
  4563. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4564. this.isFill = true;
  4565. }else{
  4566. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4567. this.isFill = true;
  4568. }
  4569. },
  4570. //获取自己填写的日报状态
  4571. getReportFillStatus() {
  4572. this.http.post('/report/getReportFillStatus',{
  4573. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4574. },
  4575. res => {
  4576. if (res.code == "ok") {
  4577. this.fillStatusList = res.data;
  4578. this.allDate.forEach(d=>{
  4579. var fillInfo = null;
  4580. d.state = null;
  4581. this.fillStatusList.forEach(s=>{
  4582. var d1 = s.createDate.split('-')[2];
  4583. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4584. if (d1.indexOf('0') == 0) {
  4585. d1 = d1.substring(1,d1.length);
  4586. }
  4587. if (d1 == d2) {
  4588. d.state = s.state;
  4589. d.missReport = s.missReport;//是否漏填
  4590. d.exceedCardTime = s.exceedCardTime
  4591. }
  4592. })
  4593. })
  4594. this.$forceUpdate();
  4595. }
  4596. },
  4597. error => {
  4598. this.$message({
  4599. message: error,
  4600. type: "error"
  4601. });
  4602. }
  4603. );
  4604. },
  4605. scrollFunction () {
  4606. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4607. if (this.domObj.attachEvent) { // IE
  4608. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4609. } else if (this.domObj.addEventListener) {
  4610. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4611. }
  4612. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4613. },
  4614. mouseScroll(event) { // google 浏览器下
  4615. let detail = event.wheelDelta || event.detail
  4616. let moveForwardStep = -1
  4617. let moveBackStep = 1
  4618. let step = 0
  4619. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4620. event.preventDefault() // 阻止浏览器默认事件
  4621. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4622. },
  4623. // //左右滚动
  4624. // wheel(e){
  4625. // var a = document.getElementById("dateScroll");
  4626. // var scroll_width = 80; //滚动一下的距离
  4627. // var e = e || window.event, v;
  4628. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4629. // if(v>3||-v>3) v=-v;
  4630. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4631. // e.preventDefault(); //阻止浏览器的默认滚动
  4632. // },
  4633. showExportDialog() {
  4634. this.exportType = 0
  4635. this.exportDialog = true;
  4636. },
  4637. showExportTimeDialog() {
  4638. this.exportTimeDialog = true;
  4639. },
  4640. changeAllTime() {
  4641. //总时长发生改变,自动按比例计算
  4642. this.workForm.domains.forEach(d=>{
  4643. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4644. });
  4645. //计算jsTime
  4646. if (this.workForm.createDate) {
  4647. let sdate = new Date(this.workForm.createDate[0]);
  4648. let edate = new Date(this.workForm.createDate[1]);
  4649. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4650. if (days < 0) {
  4651. days = 0;
  4652. }
  4653. this.jsTime = this.reportTimeType.allday * days;
  4654. }
  4655. },
  4656. // 是否加班的单机事件
  4657. check() {
  4658. this.selected = !this.selected
  4659. this.isNew = this.selected
  4660. },
  4661. updateSubProject() {
  4662. this.$forceUpdate();
  4663. },
  4664. selectDegreeId(domain, index) {
  4665. this.http.post('/report/defaultDegree',{
  4666. projectId: domain.projectId
  4667. },
  4668. res => {
  4669. if (res.code == "ok") {
  4670. if(res.data) {
  4671. this.workForm.domains[index].degreeId = res.data.id + ''
  4672. this.$forceUpdate();
  4673. }
  4674. }
  4675. },
  4676. error => {
  4677. this.$message({
  4678. message: error,
  4679. type: "error"
  4680. });
  4681. }
  4682. );
  4683. },
  4684. //项目选中了, 加载子项目
  4685. selectProject(domain, index) {
  4686. if(!domain.projectId){
  4687. return;
  4688. }
  4689. // 默认选中上次填写的自定义维度
  4690. if(this.yonghuUser.customDegreeActive == 1) {
  4691. this.selectDegreeId(domain, index)
  4692. }
  4693. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4694. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4695. this.http.post('/sub-project/list',{
  4696. projectId: domain.projectId,
  4697. isReport: true
  4698. },
  4699. res => {
  4700. //清空之前选中的子项目
  4701. // this.workForm.domains[index].subProjectId = 0;
  4702. if (res.code == "ok") {
  4703. this.workForm.domains[index].subProjectList = res.data;
  4704. this.workForm.domains[index].subProjectId = null;
  4705. this.$forceUpdate();
  4706. }
  4707. },
  4708. error => {
  4709. this.$message({
  4710. message: error,
  4711. type: "error"
  4712. });
  4713. }
  4714. );
  4715. //项目相关的近期任务
  4716. if (this.user.company.packageProject == 1) {
  4717. this.getRecentTaskList(domain, index);
  4718. //获取项目相关专业
  4719. if (this.user.company.packageEngineering == 1) {
  4720. this.getProjectProfessions(domain, index);
  4721. }
  4722. //获取项目下的任务分组
  4723. this.getTaskGroups(domain, index);
  4724. }
  4725. // 获取项目相关的维度
  4726. // domain.degreeId = null
  4727. this.$set(domain,'degreeId',null)
  4728. this.$set(domain,'multiDegrIdArray',null)
  4729. this.dimension(domain, index);
  4730. //获取项目审核人
  4731. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4732. this.getProjectAuditorList(domain, index);
  4733. } else {
  4734. //按分组的负责人来审核
  4735. domain.projectAuditorId = null;
  4736. domain.projectAuditorName = null;
  4737. domain.auditUserList = null;
  4738. }
  4739. if (this.reportTimeType.type == 3) {
  4740. //新增项目时,自动计算
  4741. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4742. }
  4743. //加载昱众的工作职责
  4744. if (this.user.companyId == this.yuzhongCompId) {
  4745. this.updateResponse(domain);
  4746. }
  4747. },
  4748. getRecentTaskList(domain, index) {
  4749. //刷新任务时,清空服务
  4750. this.$set(domain, 'sapServiceId', null);
  4751. this.$set(domain, 'taskId', null);
  4752. var param = {
  4753. projectId: domain.projectId,
  4754. isSubstitude:this.isSubstitude?1:0,
  4755. };
  4756. if (domain.groupId) {
  4757. param.groupId = domain.groupId;
  4758. }
  4759. if (domain.stage) {
  4760. param.stage = domain.stage;
  4761. }
  4762. //专业版代填,获取代填员工的任务
  4763. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4764. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4765. this.$message({
  4766. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4767. type: "error"
  4768. });
  4769. return;
  4770. } else {
  4771. param.userId = this.workForm.userId[0];
  4772. }
  4773. }
  4774. this.http.post('/task/getRecentTask',param,
  4775. res => {
  4776. if (res.code == "ok") {
  4777. this.workForm.domains[index].allTaskList = res.data;
  4778. this.workForm.domains[index].taskList = res.data;
  4779. this.$forceUpdate();
  4780. }
  4781. },
  4782. error => {
  4783. this.$message({
  4784. message: error,
  4785. type: "error"
  4786. });
  4787. }
  4788. );
  4789. },
  4790. //获取项目审核人
  4791. getProjectAuditorList(domainItem, index) {
  4792. if(domainItem.projectId == '') {
  4793. return
  4794. }
  4795. domainItem.projectAuditorId = null;
  4796. domainItem.projectAuditorName = null;
  4797. var param = { projectId: domainItem.projectId};
  4798. if (this.isSubstitude) {
  4799. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4800. param.userId = this.workForm.userId[0];
  4801. }
  4802. }
  4803. this.http.post('/project-auditor/getList',param,
  4804. res => {
  4805. if (res.code == "ok") {
  4806. domainItem.auditUserList = res.data;
  4807. if (res.data.length==0) {
  4808. this.$message({
  4809. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4810. type: "error"
  4811. });
  4812. } else if (res.data.length==1) {
  4813. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4814. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4815. }
  4816. this.$forceUpdate();
  4817. }
  4818. },
  4819. error => {
  4820. this.$message({
  4821. message: error,
  4822. type: "error"
  4823. });
  4824. }
  4825. );
  4826. },
  4827. // 获取维度数据
  4828. dimension(domain, index) {
  4829. if(domain.projectId == '') {
  4830. return
  4831. }
  4832. this.http.post('/project/getDegreeList',{
  4833. projectId: domain.projectId,
  4834. },
  4835. res => {
  4836. if (res.code == "ok") {
  4837. // console.log("维度数据",res.data);
  4838. this.workForm.domains[index].wuduList = res.data
  4839. // this.workForm = this.workForm
  4840. this.$forceUpdate()
  4841. }
  4842. },
  4843. error => {
  4844. this.$message({
  4845. message: error,
  4846. type: "error"
  4847. });
  4848. }
  4849. );
  4850. },
  4851. //切换任务阶段
  4852. changeStages(domain, index) {
  4853. if (domain.stage == null || domain.stage == '') {
  4854. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4855. } else {
  4856. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4857. }
  4858. this.getRecentTaskList(domain, index);
  4859. this.$forceUpdate();
  4860. },
  4861. getGroupStages(domain, index, keepStage) {
  4862. // console.log(domain);
  4863. if(!domain.groupId){
  4864. domain.projectAuditorId = ''
  4865. domain.stages = []
  4866. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4867. domain.taskId = ''
  4868. domain.sapServiceId = ''
  4869. }
  4870. if(this.user.timeType.reportAuditType >= 1){
  4871. domain.auditUserList = []
  4872. }
  4873. this.$forceUpdate();
  4874. return
  4875. }
  4876. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4877. res => {
  4878. if (res.code == "ok") {
  4879. if (!keepStage) {
  4880. domain.stage = '';
  4881. }
  4882. domain.stages = res.data;
  4883. this.getRecentTaskList(domain, index);
  4884. this.$forceUpdate();
  4885. }
  4886. },
  4887. error => {
  4888. this.$message({
  4889. message: error,
  4890. type: "error"
  4891. });
  4892. });
  4893. //检查当前的项目是否需要获取分组的负责人
  4894. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4895. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4896. res => {
  4897. if (res.code == "ok") {
  4898. domain.getProjectAuditorList = res.data;
  4899. domain.auditUserList = res.data;
  4900. if (res.data.length==1) {
  4901. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4902. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4903. } else if (res.data.length==0) {
  4904. domain.projectAuditorId = null;
  4905. domain.projectAuditorName = null;
  4906. }
  4907. this.$forceUpdate();
  4908. }
  4909. },
  4910. error => {
  4911. this.$message({
  4912. message: error,
  4913. type: "error"
  4914. });
  4915. });
  4916. }
  4917. },
  4918. getProjectProfessions(domain, index) {
  4919. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4920. res => {
  4921. if (res.code == "ok") {
  4922. this.workForm.domains[index].professionProgress = res.data;
  4923. this.$forceUpdate();
  4924. }
  4925. },
  4926. error => {
  4927. this.$message({
  4928. message: error,
  4929. type: "error"
  4930. });
  4931. });
  4932. },
  4933. //删除自己的日报
  4934. deleteReport() {
  4935. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4936. confirmButtonText: this.$t('btn.determine'),
  4937. cancelButtonText: this.$t('btn.cancel'),
  4938. type: "warning"
  4939. })
  4940. .then(() => {
  4941. this.listLoading = true;
  4942. this.http.post('/report/delete',{
  4943. userId: this.user.id,
  4944. date: this.workForm.createDate
  4945. },
  4946. res => {
  4947. this.listLoading = false;
  4948. if (res.code == "ok") {
  4949. this.$message({
  4950. message: this.$t('message.successfullyDeleted'),
  4951. type: "success"
  4952. });
  4953. this.getReportList();
  4954. this.getDepartment();
  4955. this.dialogVisible = false;
  4956. } else {
  4957. this.$message({
  4958. message: res.msg,
  4959. type: "error"
  4960. });
  4961. }
  4962. },
  4963. error => {
  4964. this.listLoading = false;
  4965. this.$message({
  4966. message: error,
  4967. type: "error"
  4968. });
  4969. }
  4970. );
  4971. })
  4972. .catch(() => {});
  4973. },
  4974. // 管理员删除日报
  4975. guanli(item) {
  4976. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4977. let param = {date: this.date + day, userId: item.id};
  4978. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4979. confirmButtonText: this.$t('btn.determine'),
  4980. cancelButtonText: this.$t('btn.cancel'),
  4981. type: "warning"
  4982. })
  4983. .then(() => {
  4984. this.listLoading = true;
  4985. this.http.post('/report/delete',param,
  4986. res => {
  4987. this.listLoading = false;
  4988. if (res.code == "ok") {
  4989. this.$message({
  4990. message: this.$t('message.successfullyDeleted'),
  4991. type: "success"
  4992. });
  4993. this.getReportList();
  4994. this.getDepartment();
  4995. this.dialogVisible = false;
  4996. } else {
  4997. this.$message({
  4998. message: res.msg,
  4999. type: "error"
  5000. });
  5001. }
  5002. },
  5003. error => {
  5004. this.listLoading = false;
  5005. this.$message({
  5006. message: error,
  5007. type: "error"
  5008. });
  5009. }
  5010. );
  5011. })
  5012. .catch(() => {});
  5013. },
  5014. selectAll() {
  5015. if (this.isAllSelect) {
  5016. var keys = [];
  5017. this.reportNames.forEach(b=>{
  5018. keys.push(b.id);
  5019. })
  5020. this.$refs.approveTree.setCheckedKeys(keys);
  5021. } else {
  5022. this.$refs.approveTree.setCheckedKeys([]);
  5023. }
  5024. },
  5025. removeEmptyNode(list) {
  5026. for (var i=0;i<list.length;i++) {
  5027. var cnt = 0;
  5028. if (list[i].membCount == 0) {
  5029. list.splice(i, 1);
  5030. i--;
  5031. } else if (list[i].children != null) {
  5032. this.removeEmptyNode(list[i].children);
  5033. }
  5034. }
  5035. },
  5036. calculateMembCount(list) {
  5037. for (var i in list) {
  5038. var cnt = 0;
  5039. if (list[i].children != null) {
  5040. this.calculateMembCount(list[i].children);
  5041. for (var m in list[i].children) {
  5042. cnt += list[i].children[m].membCount;
  5043. }
  5044. }
  5045. if (list[i].isUser == 1) {
  5046. cnt++;
  5047. this.membCount++;
  5048. }
  5049. list[i].membCount = cnt;
  5050. }
  5051. },
  5052. stateChange() {
  5053. // console.log(this.allData,'alldate');
  5054. this.membCount = 0;
  5055. if (this.selectState == -1) {
  5056. //全部状态
  5057. this.data = this.allData;
  5058. } else {
  5059. //未填报
  5060. this.seluserText = ''
  5061. var newData = JSON.parse(JSON.stringify(this.allData));
  5062. this.filterState(this.selectState, newData);
  5063. this.data = newData;
  5064. }
  5065. this.calculateMembCount(this.data);
  5066. this.data[0].membCount = this.membCount;//总人数
  5067. },
  5068. //按状态过滤部门人员
  5069. filterState(state, list) {
  5070. for (var i =0;i<list.length; i++) {
  5071. var obj = list[i];
  5072. if (obj.isUser == 1) {
  5073. var match = false;
  5074. if (state == -2) {
  5075. if (obj.state == null) {
  5076. match = true;
  5077. }
  5078. } else {
  5079. if (obj.state == state) {
  5080. match = true;
  5081. }
  5082. }
  5083. if (!match) {
  5084. list.splice(i, 1);
  5085. i--;
  5086. } else {
  5087. }
  5088. } else {
  5089. if (obj.children != null) {
  5090. this.filterState(state, obj.children);
  5091. }
  5092. }
  5093. }
  5094. },
  5095. //a按名称过滤部门人员
  5096. async seluserforText(){
  5097. const { userNameNeedTranslate } = this.user
  5098. this.membCount = 0;
  5099. var newData = JSON.parse(JSON.stringify(this.allData));
  5100. let textList = [this.seluserText]
  5101. if(userNameNeedTranslate == 1) {
  5102. this.dataLoading = true
  5103. let res = await this.postData('/user/getEmployeeList', {
  5104. keyword: this.seluserText,
  5105. cursor: '',
  5106. departmentId: -1,
  5107. pageIndex: 1,
  5108. pageSize: 1000
  5109. })
  5110. textList = res.data.records.map(item => item.name)
  5111. this.dataLoading = false
  5112. }
  5113. // return
  5114. this.seluserforTextin(this.seluserText, newData, textList)
  5115. this.data = newData;
  5116. this.calculateMembCount(this.data);
  5117. this.data[0].membCount = this.membCount;//总人数
  5118. },
  5119. seluserforTextin(text, list, textList = []){
  5120. for (var i =0;i<list.length; i++) {
  5121. var obj = list[i];
  5122. if (obj.isUser == 1) {
  5123. var match = false;
  5124. // if (obj.label.indexOf(text) != -1) {
  5125. // match = true
  5126. // }
  5127. if(textList.some(item => item.includes(obj.label))) {
  5128. match = true
  5129. }
  5130. if (!match) {
  5131. list.splice(i, 1);
  5132. i--;
  5133. } else {
  5134. }
  5135. } else {
  5136. if (obj.children != null) {
  5137. this.seluserforTextin(text, obj.children, textList);
  5138. }
  5139. }
  5140. }
  5141. },
  5142. // 当节点发生变化时
  5143. nodeChangeExpand(data) {
  5144. // 保存当前展开的节点
  5145. let flag = false
  5146. this.nodeModelData.some(item => {
  5147. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5148. flag = true
  5149. return true
  5150. }
  5151. })
  5152. if (!flag) { // 不存在则存到数组里
  5153. this.nodeModelData.push(data.id)
  5154. }
  5155. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5156. },
  5157. nodeChangeCollapse(data) {
  5158. this.nodeModelData.some((item, i) => {
  5159. if (item === data.id) {
  5160. this.nodeModelData.length = i
  5161. }
  5162. })
  5163. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5164. },
  5165. // 部门列表点击
  5166. handleNodeClick(data) {
  5167. // this.dealList = data
  5168. this.theValues(data.id, this.allData)
  5169. // this.depData = data;
  5170. var list = [];
  5171. if (data.id == -1) {
  5172. this.deptId = null;
  5173. this.targetUid = null;
  5174. list = this.data;
  5175. } else if (data.isUser == 1) {
  5176. this.deptId = null;
  5177. this.targetUid = data.id;
  5178. } else {
  5179. this.deptId = data.id;
  5180. this.targetUid = null;
  5181. list.push(data);
  5182. }
  5183. this.getReportList();
  5184. if (list.length > 0) {
  5185. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5186. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5187. }
  5188. },
  5189. exportPushLog(){
  5190. this.http.post('/sap-sync-log/export',{},
  5191. res => {
  5192. if (res.code == "ok") {
  5193. var filePath = res.data;
  5194. var fName = '推送日志.xlsx'
  5195. const a = document.createElement('a'); // 创建a标签
  5196. a.setAttribute('download', fName);// download属性
  5197. a.setAttribute('href', filePath);// href链接
  5198. a.click(); //自执行点击事件
  5199. a.remove();
  5200. } else {
  5201. this.$message({
  5202. message: res.msg,
  5203. type: "error"
  5204. });
  5205. }
  5206. },
  5207. error => {
  5208. this.$message({
  5209. message: error,
  5210. type: "error"
  5211. });
  5212. });
  5213. },
  5214. theValues(id, item) {
  5215. for(var i in item) {
  5216. if(item[i].id == id) {
  5217. this.depData = item[i]
  5218. if(id == '-1') {
  5219. this.translation = '1'
  5220. } else {
  5221. if(item[i].children) {
  5222. this.translation = '2'
  5223. } else {
  5224. this.translation = '3'
  5225. }
  5226. }
  5227. return
  5228. } else {
  5229. if(item[i].children) {
  5230. this.theValues(id, item[i].children)
  5231. }
  5232. }
  5233. }
  5234. },
  5235. //获取可以选择的代填的人员列表
  5236. getSubstitudeUserDeptList() {
  5237. if (this.deptMembData.length == 0) {
  5238. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5239. res => {
  5240. if (res.code == "ok") {
  5241. let noAllData = JSON.parse(JSON.stringify(res.data));
  5242. if (noAllData.length > 0) {
  5243. // if (noAllData[0].label == '全部人员') {
  5244. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5245. noAllData.splice(0,1);
  5246. }
  5247. }
  5248. this.setUserToDept(noAllData);
  5249. this.deptMembData = noAllData;
  5250. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5251. } else {
  5252. this.$message({
  5253. message: res.msg,
  5254. type: "error"
  5255. });
  5256. }
  5257. },
  5258. error => {
  5259. this.$message({
  5260. message: error,
  5261. type: "error"
  5262. });
  5263. });
  5264. }
  5265. },
  5266. // 获取部门列表
  5267. getDepartmentForApprove() {
  5268. this.http.post( this.port.manage.depList, {},
  5269. res => {
  5270. if (res.code == "ok") {
  5271. var list1 = JSON.parse(JSON.stringify(res.data));
  5272. this.deptOptionList = this.changeArr(list1);
  5273. } else {
  5274. this.$message({
  5275. message: res.msg,
  5276. type: "error"
  5277. });
  5278. }
  5279. },
  5280. error => {
  5281. this.$message({
  5282. message: error,
  5283. type: "error"
  5284. });
  5285. });
  5286. },
  5287. // 获取部门列表
  5288. getDepartment() {
  5289. //如果没有权限,就不需要获取
  5290. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5291. return;
  5292. }
  5293. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5294. var param = {date:this.date + day};
  5295. this.http.post("/report/getMembList", param,
  5296. res => {
  5297. if (res.code == "ok") {
  5298. if(res.data.length == 0){
  5299. return
  5300. }
  5301. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5302. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5303. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5304. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5305. // if (this.user.role > 0) {
  5306. // }
  5307. list.splice(0,0,{
  5308. id: -1,
  5309. label: this.$t('lable.allStaff'),
  5310. })
  5311. this.membCount = 0;
  5312. //设置员工到部门下面
  5313. this.setUserToDept(list);
  5314. this.data = list;
  5315. // console.log('data',this.data);
  5316. this.expandDate = [this.data[1].id]
  5317. this.allData = list;
  5318. // if (noAllData.length > 0) {
  5319. // if (noAllData[0].label == '全部人员') {
  5320. // noAllData.splice(0,1);
  5321. // }
  5322. // }
  5323. // this.setUserToDept(noAllData);
  5324. // this.deptMembData = noAllData;
  5325. this.option = this.changeArr(list1);
  5326. list[0].membCount = this.membCount;
  5327. if (this.depData.id == -1) {
  5328. this.depData.membCount = this.membCount;
  5329. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5330. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5331. } else {
  5332. if (this.depData.isUser == null) {
  5333. var dep = this.findTargetDept(this.data, this.depData.id);
  5334. var membDeptList = [];
  5335. membDeptList.push(dep);
  5336. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5337. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5338. }
  5339. }
  5340. if (this.depData.isUser == null) {
  5341. if (this.isFill) {
  5342. this.fillMembList = this.fillList;
  5343. } else {
  5344. this.fillMembList = this.unFillList;
  5345. }
  5346. }
  5347. this.leaveAllNum = 0
  5348. for(let i in this.unFillList){
  5349. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5350. this.leaveAllNum += 1
  5351. }
  5352. }
  5353. this.stateChange()
  5354. } else {
  5355. this.$message({
  5356. message: res.msg,
  5357. type: "error"
  5358. });
  5359. }
  5360. },
  5361. error => {
  5362. this.$message({
  5363. message: error,
  5364. type: "error"
  5365. });
  5366. });
  5367. this.getReportFillStatus();
  5368. },
  5369. findTargetDept(list, deptId) {
  5370. var t = null;
  5371. for (var i=0;i<list.length; i++) {
  5372. if (list[i].isUser == null && list[i].id == deptId) {
  5373. t = list[i];
  5374. break;
  5375. }
  5376. }
  5377. if (t == null) {
  5378. for (var i=0;i<list.length; i++) {
  5379. if (list[i].children != null && list[i].children.length > 0) {
  5380. t = this.findTargetDept(list[i].children, deptId);
  5381. if (t != null) {
  5382. break;
  5383. }
  5384. }
  5385. }
  5386. }
  5387. return t;
  5388. },
  5389. getUserMembListFromDeptList(list, isFill) {
  5390. var membList = [];
  5391. for (var i in list) {
  5392. var deptName = list[i].label;
  5393. if (list[i].userList != null) {
  5394. list[i].userList.forEach(element => {
  5395. if (isFill == 0) {
  5396. //获取未填的
  5397. if (element.state == null) {
  5398. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5399. membList.push(obj);
  5400. }
  5401. } else {
  5402. if (element.state != null) {
  5403. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5404. membList.push(obj);
  5405. }
  5406. }
  5407. });
  5408. }
  5409. if (list[i].children != null) {
  5410. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5411. }
  5412. }
  5413. return membList;
  5414. },
  5415. setUserToDept(list) {
  5416. for (var i in list) {
  5417. var cnt = 0;
  5418. if (list[i].children != null) {
  5419. this.setUserToDept(list[i].children);
  5420. for (var m in list[i].children) {
  5421. cnt += list[i].children[m].membCount;
  5422. }
  5423. }
  5424. if (list[i].userList != null) {
  5425. if (list[i].children == null) {
  5426. list[i].children = [];
  5427. }
  5428. list[i].userList.forEach(element => {
  5429. var obj = {
  5430. id: element.id,
  5431. label:element.name,
  5432. state:element.state,
  5433. parentId:element.departmentId,
  5434. isUser:1,
  5435. workingTime: element.workingTime,
  5436. leaveDays: element.leaveDays,
  5437. leaveTimes: element.leaveTimes
  5438. };
  5439. list[i].children.push(obj);
  5440. this.membCount++;
  5441. cnt++;
  5442. });
  5443. }
  5444. list[i].membCount = cnt;
  5445. }
  5446. },
  5447. // 修改数组
  5448. changeArr(arr) {
  5449. for (var i = 0; i < arr.length; i++) {
  5450. if(arr[i].id != -1 && arr[i].id != 0) {
  5451. if (arr[i].children != null && arr[i].children.length>0) {
  5452. arr[i].children = this.changeArr(arr[i].children);
  5453. }
  5454. arr[i].id && (arr[i].value = arr[i].id);
  5455. delete arr[i].id;
  5456. }
  5457. }
  5458. for(var i in arr) {
  5459. if(arr[i].id == -1 || arr[i].id == 0) {
  5460. arr.splice(i,1)
  5461. }
  5462. }
  5463. return arr;
  5464. },
  5465. //时间段范围设置改动,监听
  5466. onTimeTypeChange(timeType) {
  5467. this.seleChn(1)
  5468. this.showAddMore = true;
  5469. for(var i in this.workForm.domains) {
  5470. if (this.workForm.domains[i].timeType == 0) {
  5471. this.showAddMore = false;
  5472. break;
  5473. }
  5474. }
  5475. if (this.showAddMore) {
  5476. //检测数量
  5477. if (this.workForm.domains.length == 2) {
  5478. this.showAddMore = false;
  5479. } else {
  5480. this.showAddMore = true;
  5481. }
  5482. }
  5483. },
  5484. getTimeType() {
  5485. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5486. res => {
  5487. if (res.code == "ok") {
  5488. var t = res.data;
  5489. this.reportTimeType = t;
  5490. if (this.reportTimeType.type > 0) {
  5491. this.showAddMore = true;
  5492. }
  5493. //转化时间格式
  5494. if (t.allday != null) {
  5495. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5496. }
  5497. if (t.am != null) {
  5498. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5499. }
  5500. if (t.pm != null) {
  5501. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5502. }
  5503. let arr = []
  5504. for(var i in res.data.excludeTimeList) {
  5505. let obj = {
  5506. s: res.data.excludeTimeList[i].startTime,
  5507. e: res.data.excludeTimeList[i].endTime,
  5508. }
  5509. arr.push(obj)
  5510. }
  5511. this.vacationTime = arr
  5512. } else {
  5513. this.$message({
  5514. message: res.msg,
  5515. type: "error"
  5516. });
  5517. }
  5518. },
  5519. error => {
  5520. this.listLoading = false;
  5521. this.$message({
  5522. message: error,
  5523. type: "error"
  5524. });
  5525. });
  5526. },
  5527. // 改变月份 -------
  5528. changeMonthOut() {
  5529. this.getAllDate();
  5530. this.getReportList();
  5531. this.getDepartment();
  5532. },
  5533. // 选择日期
  5534. choseDate(i, item) {
  5535. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5536. return
  5537. }
  5538. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5539. this.choseDay = i;
  5540. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5541. sessionStorage.msg = this.date + day,
  5542. this.getReportList();
  5543. this.getDepartment();
  5544. this.curDate = item.date;
  5545. },
  5546. canClick(i, item){
  5547. let nowDate = new Date()
  5548. let nowDateYear = nowDate.getFullYear()
  5549. let itemYear = parseInt(this.date.split('-')[0])
  5550. let nowDateMonth = nowDate.getMonth() + 1
  5551. let itemMonth = parseInt(this.date.split('-')[1])
  5552. let nowDateDay = nowDate.getDate()
  5553. let itemDay = parseInt(item.showDate.split('.')[1])
  5554. if(nowDateYear < itemYear){
  5555. return false
  5556. }else if(nowDateYear == itemYear){
  5557. if(nowDateMonth < itemMonth){
  5558. return false
  5559. }else if(nowDateMonth == itemMonth){
  5560. if(nowDateDay < itemDay){
  5561. return false
  5562. }
  5563. }
  5564. }
  5565. },
  5566. // 获取日期列表
  5567. getAllDate(e) {
  5568. var dayArry = [];
  5569. var day = this.getCountDays();
  5570. let curMonthDay = null;
  5571. for (var k = 1; k <= day; k++) {
  5572. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5573. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5574. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5575. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5576. if(sessionStorage.msg) {
  5577. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5578. this.choseDay = k - 1;
  5579. curMonthDay = str;
  5580. }
  5581. } else {
  5582. if (new Date().getDate() == k) {
  5583. this.choseDay = k - 1;
  5584. }
  5585. }
  5586. } else {
  5587. this.choseDay = 0;
  5588. }
  5589. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5590. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5591. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5592. }
  5593. this.allDate = dayArry;
  5594. //不能超过最大日期
  5595. if (this.choseDay > day-1) {
  5596. this.choseDay = day-1;
  5597. }
  5598. if(sessionStorage.from != 1){
  5599. let nowmonth = new Date().getMonth() + 1
  5600. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5601. let nowdate = new Date().getDate()
  5602. if(nowd == this.date){
  5603. if(e && sessionStorage.msg){
  5604. }else{
  5605. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5606. }
  5607. let nowday = new Date(sessionStorage.msg).getDate()
  5608. this.choseDay = nowday - 1
  5609. let monthdate = new Date(sessionStorage.msg)
  5610. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5611. }else{
  5612. if(e && sessionStorage.msg){
  5613. }else{
  5614. sessionStorage.msg = this.date + '-01'
  5615. }
  5616. let monthdate = new Date(sessionStorage.msg)
  5617. this.choseDay = monthdate.getDate() - 1
  5618. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5619. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5620. }
  5621. }else{
  5622. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5623. }
  5624. //从消息点击跳转过来的,直接加载指定日期
  5625. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5626. this.curDate = sessionStorage.msg;
  5627. sessionStorage.from = 0;
  5628. } else {
  5629. // if (curMonthDay != null) {
  5630. // // this.curDate = curMonthDay;
  5631. // let d = new Date(sessionStorage.msg)
  5632. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5633. // } else {
  5634. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5635. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5636. // }
  5637. }
  5638. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5639. // if(!sessionStorage.msg){
  5640. // let msgday = this.choseDay + 1
  5641. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5642. // }
  5643. this.getReportFillStatus();
  5644. },
  5645. getCountDays() {
  5646. var newstr = this.date.replace(/-/g, "/");
  5647. var curDate = new Date(newstr+'/01');
  5648. var curMonth = curDate.getMonth();
  5649. curDate.setMonth(curMonth + 1);
  5650. curDate.setDate(0);
  5651. return curDate.getDate();
  5652. },
  5653. reqMore() {
  5654. if (this.hasMore) {
  5655. this.pageIndex++;
  5656. this.requestHttpReports();
  5657. }
  5658. },
  5659. //加载日报数据
  5660. requestHttpReports() {
  5661. //请求数据
  5662. this.listLoading = true;
  5663. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5664. let param = {date: this.date + day};
  5665. if (this.deptId) {
  5666. param.deptId = this.deptId;
  5667. }
  5668. if (this.targetUid) {
  5669. param.userId = this.targetUid;
  5670. }
  5671. //传页码
  5672. if (this.hasMore) {
  5673. param.pageIndex = this.pageIndex;
  5674. }
  5675. this.http.post( this.port.report.list, param,
  5676. res => {
  5677. this.listLoading = false;
  5678. if (res.code == "ok") {
  5679. //扩增
  5680. if (res.data.data.length > 0) {
  5681. this.reportList = this.reportList.concat(res.data.data);
  5682. } else if (this.pageIndex > 1){
  5683. this.$message({
  5684. message: this.$t('meiYouGengDuoShuJuLe'),
  5685. type: "info"
  5686. });
  5687. }
  5688. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5689. if(document.querySelector("#day"+this.choseDay)){
  5690. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5691. }
  5692. } else {
  5693. this.$message({
  5694. message: res.msg,
  5695. type: "error"
  5696. });
  5697. }
  5698. },
  5699. error => {
  5700. this.listLoading = false;
  5701. this.$message({
  5702. message: error,
  5703. type: "error"
  5704. });
  5705. });
  5706. },
  5707. //获取日报列表
  5708. getReportList() {
  5709. //初始化,重置数据
  5710. this.pageIndex = 0;
  5711. this.hasMore = true;
  5712. this.reportList = [];
  5713. this.requestHttpReports();
  5714. },
  5715. //刷新日报状态,用于审核后更新
  5716. refreshReportData(reportId) {
  5717. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5718. res => {
  5719. if (res.code == "ok") {
  5720. for (var m=0;m<this.reportList.length; m++) {
  5721. var d = this.reportList[m].data;
  5722. var find = d.filter(r=>r.id == reportId);
  5723. if (find.length > 0) {
  5724. find[0].state = res.data.state;
  5725. if (find[0].state == 2) {//被驳回,要可以编辑
  5726. this.reportList[m].state = 2;
  5727. }
  5728. find[0].isDeptAudit = res.data.isDeptAudit;
  5729. find[0].departmentAuditState = res.data.departmentAuditState;
  5730. find[0].projectAuditorName = res.data.projectAuditorName;
  5731. find[0].projectAuditorId = res.data.projectAuditorId;
  5732. find[0].projectAuditState = res.data.projectAuditState;
  5733. find[0].rejectUserid = res.data.rejectUserid;
  5734. find[0].rejectUsername = res.data.rejectUsername;
  5735. find[0].rejectReason = res.data.rejectReason;
  5736. this.$forceUpdate();
  5737. break;
  5738. }
  5739. }
  5740. } else {
  5741. this.$message({
  5742. message: res.msg,
  5743. type: "error"
  5744. });
  5745. }
  5746. },
  5747. error => {
  5748. this.listLoading = false;
  5749. this.$message({
  5750. message: error,
  5751. type: "error"
  5752. });
  5753. });
  5754. },
  5755. //导出员工工时统计
  5756. exportUserTime() {
  5757. this.listLoading = true;
  5758. var param = {};
  5759. if (this.exportParam.dateRange != null) {
  5760. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5761. }
  5762. this.http.post('/department/exportDeptStatistic', param,
  5763. res => {
  5764. this.listLoading = false;
  5765. if (res.code == "ok") {
  5766. location.href = res.data;
  5767. this.exportTimeDialog = false;
  5768. } else {
  5769. this.$message({
  5770. message: res.msg,
  5771. type: "error"
  5772. });
  5773. }
  5774. },
  5775. error => {
  5776. this.listLoading = false;
  5777. this.$message({
  5778. message: error,
  5779. type: "error"
  5780. });
  5781. });
  5782. },
  5783. //导出日报
  5784. exportReport() {
  5785. this.exportingData = true;
  5786. var param = {};
  5787. if (this.exportParam.dateRange != null) {
  5788. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5789. }
  5790. if (this.exportParam.projectId != null) {
  5791. param.projectId = this.exportParam.projectId;
  5792. }
  5793. if (this.exportParam.departmentId != null) {
  5794. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5795. param.departmentIds = this.exportParam.departmentId.join(',')
  5796. }
  5797. param.stateKey = this.stateKey
  5798. // param.departmentId = this.user.departmentId
  5799. this.http.post(this.port.report.export, param,
  5800. res => {
  5801. this.exportingData = false;
  5802. if (res.code == "ok") {
  5803. var filePath = res.data;
  5804. const a = document.createElement('a'); // 创建a标签
  5805. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5806. a.setAttribute('href', filePath);// href链接
  5807. a.click(); //自执行点击事件
  5808. a.remove();
  5809. this.exportDialog = false;
  5810. } else {
  5811. this.$message({
  5812. message: res.msg,
  5813. type: "error"
  5814. });
  5815. }
  5816. },
  5817. error => {
  5818. this.exportingData = false;
  5819. this.$message({
  5820. message: error,
  5821. type: "error"
  5822. });
  5823. });
  5824. },
  5825. //导出日报审核记录
  5826. exportReportLog() {
  5827. this.exportingData = true;
  5828. var param = {};
  5829. if (this.exportReportLogParam.dateRange != null) {
  5830. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5831. }
  5832. this.http.post('/report-log/exportReportLog', param,
  5833. res => {
  5834. this.exportingData = false;
  5835. if (res.code == "ok") {
  5836. var filePath = res.data;
  5837. const a = document.createElement('a'); // 创建a标签
  5838. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5839. a.setAttribute('href', filePath);// href链接
  5840. a.click(); //自执行点击事件
  5841. a.remove();
  5842. this.exportDialog = false;
  5843. } else {
  5844. this.$message({
  5845. message: res.msg,
  5846. type: "error"
  5847. });
  5848. }
  5849. },
  5850. error => {
  5851. this.exportingData = false;
  5852. this.$message({
  5853. message: error,
  5854. type: "error"
  5855. });
  5856. });
  5857. },
  5858. restUserCardTime(item){
  5859. let param={}
  5860. param.userId=item.userId
  5861. param.createDate=item.createDate
  5862. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5863. res => {
  5864. if (res.code == "ok") {
  5865. this.showMonthWorkTimeReminder()
  5866. } else {
  5867. this.$message({
  5868. message: res.msg,
  5869. type: "error"
  5870. });
  5871. }
  5872. },
  5873. error => {
  5874. this.$message({
  5875. message: error,
  5876. type: "error"
  5877. });
  5878. });
  5879. },
  5880. importReportLog(item){
  5881. //首先判断文件类型
  5882. let str = item.file.name.split(".");
  5883. let format = str[str.length - 1];
  5884. if (format != "xls" && format != "xlsx") {
  5885. this.$message({
  5886. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5887. type: "error"
  5888. });
  5889. } else {
  5890. const loading = this.$loading({
  5891. lock: true,
  5892. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5893. spinner: 'el-icon-loading',
  5894. background: 'rgba(0, 0, 0, 0.7)'
  5895. });
  5896. let formData = new FormData();
  5897. formData.append("multipartFile", item.file);
  5898. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5899. res => {
  5900. this.$refs.upload.clearFiles();
  5901. loading.close();
  5902. if (res.code == "ok") {
  5903. this.$message({
  5904. message: res.msg,
  5905. type: "success"
  5906. });
  5907. } else {
  5908. this.$message({
  5909. message: res.msg,
  5910. type: "error"
  5911. });
  5912. }
  5913. },
  5914. error => {
  5915. this.$refs.upload.clearFiles();
  5916. loading.close();
  5917. this.$message({
  5918. message: error,
  5919. type: "error"
  5920. });
  5921. });
  5922. }
  5923. },
  5924. //获取项目列表
  5925. getProjectList() {
  5926. this.listLoading = true;
  5927. this.http.post( this.port.project.list, {},
  5928. res => {
  5929. this.listLoading = false;
  5930. if (res.code == "ok") {
  5931. for(var i in res.data) {
  5932. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5933. res.data[i].projectCode = ''
  5934. }
  5935. }
  5936. this.projectList = res.data;
  5937. } else {
  5938. this.$message({
  5939. message: res.msg,
  5940. type: "error"
  5941. });
  5942. }
  5943. },
  5944. error => {
  5945. this.listLoading = false;
  5946. this.$message({
  5947. message: error,
  5948. type: "error"
  5949. });
  5950. });
  5951. },
  5952. getSubUsersFillProjectList(userId) {
  5953. this.http.post( this.port.project.list, {
  5954. forReport: 1,
  5955. userId: userId
  5956. },res => {
  5957. if (res.code == "ok") {
  5958. for(var i in res.data) {
  5959. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5960. res.data[i].projectCode = ''
  5961. }
  5962. }
  5963. this.subFillProjectList = res.data;
  5964. this.getRecentlyProject(userId)
  5965. } else {
  5966. this.$message({
  5967. message: res.msg,
  5968. type: "error"
  5969. });
  5970. }
  5971. },
  5972. error => {
  5973. this.$message({
  5974. message: error,
  5975. type: "error"
  5976. });
  5977. });
  5978. },
  5979. // 获取填报日报的项目下拉列表
  5980. getFillProjectList() {
  5981. this.http.post( this.port.project.list, {
  5982. forReport: 1
  5983. },res => {
  5984. if (res.code == "ok") {
  5985. for(var i in res.data) {
  5986. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5987. res.data[i].projectCode = ''
  5988. }
  5989. }
  5990. this.fillProjectList = res.data;
  5991. this.getRecentlyProject()
  5992. } else {
  5993. this.$message({
  5994. message: res.msg,
  5995. type: "error"
  5996. });
  5997. }
  5998. },
  5999. error => {
  6000. this.$message({
  6001. message: error,
  6002. type: "error"
  6003. });
  6004. });
  6005. },
  6006. //自己填写日报时,刷新到自己的可填报日报列表
  6007. refreshToMyReportProjectList() {
  6008. this.getRecentlyProject();
  6009. },
  6010. getBasecostItemList() {
  6011. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6012. companyId: this.user.companyId
  6013. },
  6014. res => {
  6015. if (res.code == "ok") {
  6016. this.timeBasecostList = res.data;
  6017. }
  6018. });
  6019. },
  6020. getAIReport(createDate) {
  6021. this.http.post('/report/getAIReport', {},
  6022. res => {
  6023. if (res.code == "ok") {
  6024. var quanbu = 0
  6025. this.jsDay = 1
  6026. var zhi = ''
  6027. var slp = res.data
  6028. for(var i in slp) {
  6029. var sp = +slp[i].workingTime + 0
  6030. zhi = this.jsDay * sp
  6031. quanbu = +quanbu + zhi
  6032. }
  6033. this.jsTime = quanbu
  6034. var aiReportData = res.data;
  6035. this.canCancelInDialog = false
  6036. if(aiReportData.length != 0) {
  6037. var arr = [];
  6038. for(var i in aiReportData) {
  6039. arr.push({
  6040. id: null,
  6041. projectId: aiReportData[i].projectId,
  6042. workingTime: aiReportData[i].workingTime,
  6043. content: '',
  6044. progress:100,
  6045. state: 2,
  6046. timeType: aiReportData[i].timeType,
  6047. subProjectList: aiReportData[i].subProjectList,
  6048. taskList: aiReportData[i].taskList,
  6049. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6050. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6051. taskId: aiReportData[i].taskId,
  6052. startTime: aiReportData[i].startTime,
  6053. endTime: aiReportData[i].endTime,
  6054. isOvertime: 0,
  6055. progress:aiReportData[i].progress,
  6056. professionProgress: aiReportData[i].professionProgressList,
  6057. stages:aiReportData[i].stages,
  6058. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6059. pics: null,
  6060. multiWorktime: aiReportData[i].multiWorktime || 0,
  6061. worktimeList: [{}],
  6062. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6063. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6064. wuduList: aiReportData[i].degreeList,
  6065. taskGroups:aiReportData[i].taskGroups,
  6066. customData: aiReportData[i].customData,//自定义的数值
  6067. auditUserList: aiReportData[i].auditUserList,
  6068. projectAuditorId: aiReportData[i].projectAuditorId,
  6069. projectAuditorName: aiReportData[i].projectAuditorName,
  6070. overtimeHours: aiReportData[i].overtimeHours,
  6071. customText: aiReportData[i].customText,
  6072. basecostId: aiReportData[i].basecostId,
  6073. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6074. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6075. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6076. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6077. canEdit: true
  6078. })
  6079. }
  6080. this.workForm.domains = arr;
  6081. } else {
  6082. }
  6083. this.canEdit = true;
  6084. this.originCanEdit = true;
  6085. this.seleChn()
  6086. } else {
  6087. this.$message({
  6088. message: res.msg,
  6089. type: "error"
  6090. });
  6091. }
  6092. },
  6093. error => {
  6094. this.$message({
  6095. message: error,
  6096. type: "error"
  6097. });
  6098. });
  6099. },
  6100. // 获取个人某天的日报 111111
  6101. getReport() {
  6102. this.http.post( this.port.report.getPort, {
  6103. date: this.workForm.createDate
  6104. },
  6105. res => {
  6106. if (res.code == "ok") {
  6107. var quanbu = 0
  6108. this.jsDay = 1
  6109. var zhi = ''
  6110. var slp = res.data.report
  6111. for(var i in slp) {
  6112. var sp = +slp[i].workingTime + 0
  6113. zhi = this.jsDay * sp
  6114. quanbu = +quanbu + zhi
  6115. }
  6116. this.jsTime = quanbu
  6117. var list = res.data;
  6118. this.report = list;
  6119. this.reportTimeType = this.report.timeType;
  6120. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6121. this.isWeekend = !this.report.isWorkDay;
  6122. this.canCancelInDialog = false;
  6123. this.hasWrittenReport = list.report.length != 0;
  6124. if(list.report.length != 0) {
  6125. var arr = [];
  6126. this.canEdit = false;
  6127. let candelete = true
  6128. for(var i in list.report) {
  6129. var flg = null
  6130. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6131. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6132. var filteredRespList = null
  6133. if (targetP.length > 0) {
  6134. var isPublic = targetP[0].isPublic;
  6135. 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);
  6136. }
  6137. let copyData = {
  6138. id: list.report[i].id,
  6139. projectId: list.report[i].projectId,
  6140. workingTime: list.report[i].workingTime,
  6141. content: list.report[i].content,
  6142. state: list.report[i].state,
  6143. timeType: list.report[i].timeType,
  6144. subProjectList: list.report[i].subProjectList,
  6145. taskList: list.report[i].taskList,
  6146. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6147. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6148. taskId: list.report[i].taskId,
  6149. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6150. startTime: list.report[i].startTime,
  6151. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6152. endTime: list.report[i].endTime,
  6153. isOvertime: flg,
  6154. progress:list.report[i].progress,
  6155. professionProgress: list.report[i].professionProgressList,
  6156. stages:list.report[i].stages,
  6157. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6158. pics: list.report[i].pics,
  6159. multiWorktime: list.report[i].multiWorktime,
  6160. worktimeList: list.report[i].worktimeList,
  6161. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6162. multiDegrIdArray: list.report[i].multiDegrIdList,
  6163. wuduList: list.report[i].degreeList,
  6164. taskGroups:list.report[i].taskGroups,
  6165. customData: list.report[i].customData,//自定义的数值
  6166. auditUserList: list.report[i].auditUserList,
  6167. overtimeHours: list.report[i].overtimeHours,
  6168. customText: list.report[i].customText,
  6169. basecostId: list.report[i].basecostId,
  6170. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6171. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6172. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6173. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6174. canEdit: list.report[i].state >= 2 ? true : false,
  6175. extraField1: list.report[i].extraField1,
  6176. extraField2: list.report[i].extraField2,
  6177. extraField3: list.report[i].extraField3,
  6178. workContentList: list.report[i].workContentList,
  6179. filteredRespList: filteredRespList,
  6180. serviceList: list.report[i].serviceList,
  6181. sapServiceId: list.report[i].sapServiceId,
  6182. reportTargetDeptId: list.report[i].deptId
  6183. }
  6184. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6185. //分组负责人审核的情况下,前端不需要显示,无需设置
  6186. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6187. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6188. }
  6189. arr.push(copyData);
  6190. if (list.report[i].state >= 2) {
  6191. this.canEdit = true;
  6192. }
  6193. if(list.report[i].state < 2){
  6194. candelete = false
  6195. }
  6196. if (list.report[i].state == 0){
  6197. this.canCancelInDialog = true
  6198. }
  6199. // 加判断
  6200. if(this.user.timeType.choseFromAlbum == 1) {
  6201. let arrList = []
  6202. for(var k in list.report[i].pics) {
  6203. let obj = {
  6204. name: k,
  6205. url: list.report[i].pics[k]
  6206. }
  6207. arrList.push(obj)
  6208. }
  6209. arr[i].imgListUrl = arrList
  6210. arr[i].imgList = list.report[i].pics
  6211. }
  6212. }
  6213. this.reportCanDelete = candelete
  6214. this.workForm = {
  6215. createDate: this.workForm.createDate,
  6216. domains: arr,
  6217. userNames:null,
  6218. userId:null,
  6219. time: list.time,
  6220. showRefresh: list.showRefresh
  6221. }
  6222. } else {
  6223. this.workForm = {
  6224. createDate: this.workForm.createDate,
  6225. domains: [{
  6226. id: null,
  6227. projectId: "",
  6228. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6229. content: "",
  6230. progress:100,
  6231. state: 2,
  6232. timeType:0,
  6233. multiWorktime: this.reportTimeType.multiWorktime,
  6234. worktimeList:[{}],
  6235. canEdit: true,
  6236. auditorFirst: '',
  6237. auditorSec: '',
  6238. auditorThird: '',
  6239. ccUserid: ''
  6240. }],
  6241. userId:null,
  6242. userNames:null,
  6243. time: this.report.time,
  6244. showRefresh: list.showRefresh
  6245. }
  6246. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6247. this.$set(this.workForm.domains[0],'isOvertime',true)
  6248. if(this.reportTimeType.type != 2){
  6249. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6250. }
  6251. }
  6252. if(this.user.timeType.type == 1) {
  6253. var shuzhi = this.user.timeType.allday + ''
  6254. // console.log('执行一次', shuzhi.indexOf('.'))
  6255. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6256. }
  6257. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6258. //默认给第一个,必填字段
  6259. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6260. }
  6261. this.canEdit = true;
  6262. }
  6263. this.originCanEdit = this.canEdit;
  6264. this.seleChn()
  6265. } else {
  6266. this.$message({
  6267. message: res.msg,
  6268. type: "error"
  6269. });
  6270. }
  6271. },
  6272. error => {
  6273. this.$message({
  6274. message: error,
  6275. type: "error"
  6276. });
  6277. });
  6278. },
  6279. guanbi() {
  6280. this.falsss = false,
  6281. this.workTimeForMinYi=0
  6282. },
  6283. // 打开日报填写
  6284. fillInReport(i, isBatch) {
  6285. this.isWeekend = false
  6286. this.reportCanDelete = false
  6287. // console.log(this.user.timeType.type, '选择时长')
  6288. if(i != 1) {
  6289. this.falsss = false
  6290. } else {
  6291. this.falsss = true
  6292. }
  6293. if (this.isSubstitude) {
  6294. this.getSubstitudeUserDeptList();
  6295. } else {
  6296. this.refreshToMyReportProjectList();
  6297. }
  6298. if(i == -1 || this.isSubstitude) {
  6299. this.isDisable = false;
  6300. } else {
  6301. this.isDisable = true;
  6302. }
  6303. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6304. this.isBatch = isBatch;
  6305. if (this.isBatch == 0 && !this.isSubstitude) {
  6306. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6307. let weekday = new Date(this.workForm.createDate).getDay()
  6308. if(this.user.companyId == 817){
  6309. if(weekday == 0){
  6310. this.isWeekend = true
  6311. }
  6312. }else{
  6313. if(weekday == 0 || weekday == 6){
  6314. this.isWeekend = true
  6315. }
  6316. }
  6317. this.getReport(i);
  6318. } else {
  6319. this.jsTime = 0
  6320. this.jsDay = 0
  6321. this.workForm = {
  6322. createDate: null,//批量填报没有日期
  6323. domains: [{
  6324. id: null,
  6325. projectId: "",
  6326. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6327. content: "",
  6328. progress:100,
  6329. state: 2,
  6330. timeType:0,
  6331. multiWorktime: this.reportTimeType.multiWorktime,
  6332. worktimeList:[{}],
  6333. canEdit: true,
  6334. }],
  6335. }
  6336. if(this.user.timeType.type == 1) {
  6337. var shuzhi = this.user.timeType.allday + ''
  6338. // console.log('执行二次')
  6339. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6340. }
  6341. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6342. this.workForm.showRefresh = true;
  6343. }
  6344. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6345. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6346. }
  6347. this.canEdit = true;
  6348. }
  6349. if (this.isSubstitude) {
  6350. //代填情况,默认计算合计工时
  6351. this.jsDay = 1
  6352. this.seleChn();
  6353. }
  6354. this.dialogVisible = true;
  6355. },
  6356. //按周填报的弹窗口中编辑单项目相关数据
  6357. setWeekFormReportItem(reportId, i, names, row,sss) {
  6358. this.http.post('/report/getReportById', {
  6359. reportId: reportId
  6360. },
  6361. res => {
  6362. if (res.code == "ok") {
  6363. var data = res.data.report;
  6364. sss.subProjectId = data.subProjectId
  6365. sss.subProjectList = data.subProjectList;
  6366. sss.stage = data.stage
  6367. sss.subProjectList = data.subProjectList
  6368. sss.stages = data.stages
  6369. sss.taskGroups = data.taskGroups;
  6370. sss.auditUserList = data.auditUserList;
  6371. sss.degreeId = data.degreeId;
  6372. sss.customData = data.customData;
  6373. sss.wuduList = data.degreeList;
  6374. this.zhoBaoIdx = i
  6375. this.zhoBaoName = names
  6376. this.zhoBao = sss
  6377. this.zhis = row
  6378. if (sss.groupId) {
  6379. //最后一个参数表示是否保留stage的值,不要重置为空
  6380. this.getGroupStages(this.zhoBao, 0, true)
  6381. }
  6382. this.$forceUpdate();
  6383. }
  6384. });
  6385. },
  6386. // 重新计算合计
  6387. fillInThePedometerOnAWeeklyBasis(index) {
  6388. const weeklyItem = this.zhoData[index] || {}
  6389. const dynamicProjectList = this.selProjectList || []
  6390. const collectionArray = dynamicProjectList.map(item => {
  6391. const name = item.projectName
  6392. return Number(weeklyItem[name].workingTime || 0)
  6393. })
  6394. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6395. this.zhoData[index].he = totalNum
  6396. },
  6397. // 按周填报里内容的填写
  6398. showWeekItemEdit(item, i, projectId,names, row) {
  6399. if (item.state == 0) {
  6400. this.$message({
  6401. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6402. type: "error"
  6403. });
  6404. return;
  6405. }
  6406. if (item.state == 1) {
  6407. this.$message({
  6408. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6409. type: "error"
  6410. });
  6411. return;
  6412. }
  6413. if(this.user.timeType.notAllowedNoAttendance == 1){
  6414. if(this.zhoData[i].corpTime){
  6415. if(this.zhoData[i].corpTime.workHours == 0){
  6416. this.$message({
  6417. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6418. type: 'error'
  6419. })
  6420. return
  6421. }
  6422. }else{
  6423. this.$message({
  6424. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6425. type: 'error'
  6426. })
  6427. return
  6428. }
  6429. }
  6430. var obj = {}
  6431. obj.projectId = projectId
  6432. this.tianxieDialogVisible = true
  6433. this.scopess = item
  6434. var sss = {}
  6435. if (item.id != null) {
  6436. sss.id = item.id;
  6437. sss.state = item.state;
  6438. } else {
  6439. sss.id = -1;
  6440. sss.state = 3;
  6441. }
  6442. sss.projectId = projectId;
  6443. sss.progress = item.progress
  6444. sss.time = item.time
  6445. sss.content = item.content;
  6446. if (sss.time == '' && this.reportTimeType.type == 2) {
  6447. //取已填时间范围中最大的一个作为开始时间
  6448. var startTime = '09:00';
  6449. var fillStartTime = '00:00';
  6450. for (var t in this.selProjectList) {
  6451. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6452. if (fillItem.time) {
  6453. if (fillItem.time[1] > fillStartTime) {
  6454. fillStartTime = fillItem.time[1];
  6455. }
  6456. }
  6457. }
  6458. if (fillStartTime == '00:00') {
  6459. fillStartTime = '09:00';
  6460. }
  6461. var fillEndMax = '18:00';
  6462. if (fillStartTime >= '18:00') {
  6463. fillEndMax = '23:59';
  6464. }
  6465. sss.time = [fillStartTime, fillEndMax];
  6466. }
  6467. sss.groupId = item.groupId
  6468. sss.stage = item.stage;
  6469. sss.workingTime = item.workingTime
  6470. sss.projectAuditorId = item.projectAuditorId;
  6471. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6472. //默认选中第一个
  6473. sss.basecostId = this.timeBasecostList[0].id;
  6474. }
  6475. var hasEdited = this.zhoData[i][names].hasEdited;
  6476. if (hasEdited) {
  6477. console.log('执行到了这个')
  6478. console.log('执行到了这个', { ...item }, obj)
  6479. sss = { ...item }
  6480. //编辑过了
  6481. sss.subProjectId = item.subProjectId
  6482. sss.stage = item.stage
  6483. sss.subProjectList = item.subProjectList
  6484. sss.stages = item.stages
  6485. sss.taskGroups = item.taskGroups;
  6486. // sss.auditUserList = obj.auditUserList ;
  6487. sss.degreeId = item.degreeId;
  6488. sss.customData = item.customData;
  6489. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6490. //只有一个审核人,自动设置上去
  6491. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6492. }
  6493. sss.wuduList = item.wuduList;
  6494. this.zhoBaoIdx = i
  6495. this.zhoBaoName = names
  6496. this.zhoBao = sss
  6497. this.zhis = row
  6498. if (sss.groupId) {
  6499. //最后一个参数表示是否保留stage的值,不要重置为空
  6500. this.getGroupStages(this.zhoBao, 0, true)
  6501. }
  6502. this.$forceUpdate();
  6503. this.getWeeklyTaskList(sss)
  6504. } else {
  6505. //第一次打开,获取数据
  6506. if (sss.id == -1) {
  6507. //新填报的
  6508. this.selectProject(obj, 0);
  6509. var that = this
  6510. setTimeout(() =>{
  6511. sss.subProjectId = that.workForm.domains[0].subProjectId
  6512. sss.subProjectList = item.subProjectList;
  6513. sss.stage = that.workForm.domains[0].stage
  6514. sss.subProjectList = that.workForm.domains[0].subProjectList
  6515. sss.stages = that.workForm.domains[0].stages
  6516. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6517. sss.auditUserList = obj.auditUserList;
  6518. sss.degreeId = item.degreeId;
  6519. sss.customData = item.customData;
  6520. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6521. //只有一个审核人,自动设置上去
  6522. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6523. }
  6524. sss.wuduList = row[0].wuduList
  6525. that.zhoBaoIdx = i
  6526. that.zhoBaoName = names
  6527. that.zhoBao = sss
  6528. that.zhis = row
  6529. if (sss.groupId) {
  6530. //最后一个参数表示是否保留stage的值,不要重置为空
  6531. this.getGroupStages(that.zhoBao, 0, false)
  6532. }
  6533. that.$forceUpdate();
  6534. this.getWeeklyTaskList(sss)
  6535. },600);
  6536. } else {
  6537. //编辑填报过的;数据库已经存在的
  6538. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6539. }
  6540. }
  6541. },
  6542. // 按周填报里内容的填写点击确定
  6543. setWeekProItemData() {
  6544. //专业版模式下,任务分组和阶段必填
  6545. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6546. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6547. this.$message({
  6548. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6549. type: "error"
  6550. });
  6551. return;
  6552. }
  6553. }
  6554. // 检查任务分组
  6555. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6556. this.$message({
  6557. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6558. type: "error"
  6559. });
  6560. return
  6561. }
  6562. //检查子项目是否必填
  6563. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6564. this.$message({
  6565. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6566. type: "error"
  6567. });
  6568. return;
  6569. }
  6570. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6571. this.$message({
  6572. message: this.$t('message.Pleaseselectareviewer'),
  6573. type: "error"
  6574. });
  6575. return
  6576. }
  6577. if(this.user.timeType.reportAuditType == 3){
  6578. let auditTips = ''
  6579. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6580. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6581. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6582. if(auditTips){
  6583. auditTips = auditTips.substring(0,auditTips.length - 1)
  6584. this.$message({
  6585. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6586. type: 'error'
  6587. })
  6588. return
  6589. }
  6590. }
  6591. let errtips = ''
  6592. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6593. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6594. errtips += this.user.timeType.customDegreeName + '、'
  6595. }
  6596. }
  6597. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6598. errtips += this.user.timeType.customDataName + '、'
  6599. }
  6600. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6601. errtips += this.user.timeType.customTextName + '、'
  6602. }
  6603. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6604. errtips += this.$t('other.workMatters') +'、'
  6605. }
  6606. if(errtips){
  6607. errtips = errtips.substring(0,errtips.length - 1)
  6608. this.$message({
  6609. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6610. type: 'error'
  6611. })
  6612. return
  6613. }
  6614. this.tianxieDialogVisible = false
  6615. var zhong = this.zhoData
  6616. this.zhoBao.hasEdited = true;
  6617. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6618. this.zhoData = zhong
  6619. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6620. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6621. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6622. },
  6623. // 获取本周
  6624. getCurrentWeek() {
  6625. //今天
  6626. this.targetWeekDate = new Date();
  6627. this.initWeekFormData();
  6628. // this.jiazai()
  6629. },
  6630. // 获取上周
  6631. handleGetPrevWeek() {
  6632. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6633. this.initWeekFormData();
  6634. // this.jiazai()
  6635. },
  6636. // 获取下周
  6637. handleGetNextvWeek() {
  6638. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6639. this.initWeekFormData()
  6640. },
  6641. // 加载动画
  6642. jiazai() {
  6643. this.weekDataLoading = true
  6644. var that = this
  6645. setTimeout(() =>{
  6646. that.weekDataLoading = false
  6647. },1000);
  6648. },
  6649. // 转时间格式
  6650. dealdate(date) {
  6651. const dt = new Date(date)
  6652. const y = dt.getFullYear()
  6653. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6654. const d = (dt.getDate() + '').padStart(2, '0')
  6655. return `${y}-${m}-${d}`
  6656. },
  6657. // 按周填报
  6658. fillInReportss() {
  6659. window.addEventListener('scroll', this.handleScroll, true)
  6660. // this.jiazai()
  6661. this.fillWeekDialogVisi = true;
  6662. if (this.isSubstitude) {
  6663. this.substitudeStep = 1;
  6664. this.getSubstitudeUserDeptList();
  6665. } else {
  6666. this.getCurrentWeek();
  6667. }
  6668. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6669. //重新获取工时预警类型的预算项
  6670. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6671. companyId: this.user.companyId
  6672. },
  6673. res => {
  6674. if (res.code == "ok") {
  6675. this.timeBasecostList = res.data;
  6676. }
  6677. });
  6678. }
  6679. },
  6680. fillInReportCustom() {
  6681. this.weekIndex++
  6682. this.weekParentData = {
  6683. isSubstitude: this.isSubstitude
  6684. }
  6685. this.fillWeekDialogVisiCustom = true
  6686. },
  6687. // 按周填报的项目筛选
  6688. selListFun(){
  6689. this.selProjectList = []
  6690. if(this.selCon.length){
  6691. for (let i = 0; i < this.selCon.length; i++) {
  6692. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6693. }
  6694. this.selConShow = false ;
  6695. for (let i in this.zhoData) {
  6696. var obj = this.zhoData[i];
  6697. for(var j in this.selProjectList) {
  6698. var xinzhi = this.selProjectList[j].projectName
  6699. obj[xinzhi] = {}
  6700. obj[xinzhi].time = ''
  6701. obj[xinzhi].content = ''
  6702. obj[xinzhi].progress = 0
  6703. obj[xinzhi].workingTime = 0
  6704. }
  6705. }
  6706. this.initWeekFormData();
  6707. }else{
  6708. this.$message({
  6709. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6710. type:'error'
  6711. })
  6712. }
  6713. },
  6714. setWeekCardTimeData(list) {
  6715. for(let i in list){
  6716. let datei = '';
  6717. if (this.user.timeType.showDdCardtime == 1) {
  6718. datei = list[i].workDate;
  6719. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6720. datei = list[i].createDate;
  6721. } else if (this.user.timeType.syncFanwei == 1) {
  6722. datei = list[i].workDate;
  6723. }
  6724. for(let m in this.zhoData) {
  6725. if(datei == this.zhoData[m].zhoDataTime){
  6726. let item = {
  6727. startTime: list[i].startTime,
  6728. endTime: list[i].endTime,
  6729. workHours: list[i].workHours,
  6730. otTime: list[i].otTime
  6731. }
  6732. this.$set(this.zhoData[m],'corpTime',item)
  6733. }
  6734. }
  6735. }
  6736. },
  6737. getWeeklyCardTime(){ //按周填报获取考勤信息
  6738. let dateStr = []
  6739. for(let i in this.zhoData){
  6740. dateStr.push(this.zhoData[i].zhoDataTime)
  6741. }
  6742. this.http.post('/report/getWeeklyCardTime',{
  6743. dateStr: JSON.stringify(dateStr)
  6744. },res => {
  6745. if(res.code == 'ok'){
  6746. for(let i in res.data){
  6747. let datei = '';
  6748. if (this.user.timeType.showDdCardtime == 1) {
  6749. datei = res.data[i].workDate.split('-');
  6750. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6751. datei = res.data[i].createDate.split('-');
  6752. }
  6753. for(let m in this.zhoData){
  6754. let datem = new Date(this.zhoData[m].zhoDataTime)
  6755. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6756. let item = {
  6757. startTime: res.data[i].startTime,
  6758. endTime: res.data[i].endTime,
  6759. workHours: res.data[i].workHours
  6760. }
  6761. this.$set(this.zhoData[m],'corpTime',item)
  6762. }
  6763. }
  6764. }
  6765. }else{
  6766. this.$message({
  6767. message: res.msg,
  6768. type: 'error'
  6769. })
  6770. }
  6771. },err => {
  6772. this.$message({
  6773. message: err,
  6774. type: 'error'
  6775. })
  6776. })
  6777. },
  6778. selListqx(){
  6779. this.fillWeekDialogVisi = false
  6780. this.selProjectList = []
  6781. this.selCon = []
  6782. },
  6783. handleScroll() {
  6784. this.changdu = this.projectList.length + 1
  6785. },
  6786. // 自动选择时间点的事件
  6787. // async zhoTimes(item, i) {
  6788. // var iss = i
  6789. // if(item.time == null) {
  6790. // return
  6791. // } else {
  6792. // const zhi = this.zhoData[iss];
  6793. // let he = 0;
  6794. // const timeArr = Object.values(zhi)
  6795. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6796. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6797. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6798. // console.log(data, 'data');
  6799. // zhi.he = `${he}h`;
  6800. // }
  6801. // },
  6802. async zhoTimes(item, index) {
  6803. const zho = this.zhoData[index];
  6804. if (!item.time) {
  6805. return;
  6806. }
  6807. const timeArr = Object.values(zho)
  6808. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6809. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6810. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6811. zho.he = `${totalHours[0]}h`;
  6812. },
  6813. // 判断两个时间段是否重叠
  6814. timeOverlap(idx, dateAr) {
  6815. let zhi = 0
  6816. for (let k in dateAr) {
  6817. if (idx !== k) {
  6818. 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))) {
  6819. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6820. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6821. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6822. }
  6823. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6824. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6825. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6826. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6827. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6828. } else {
  6829. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6830. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6831. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6832. }
  6833. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6834. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6835. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6836. }
  6837. }
  6838. }
  6839. }
  6840. }
  6841. return zhi
  6842. },
  6843. // 计算时间
  6844. getHourMinutes(str, end) {
  6845. var he = 0
  6846. var date2 = '2021/12/12 ' + end +':00'
  6847. var date1 = '2021/12/12 ' + str +':00'
  6848. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6849. var leave1=date3%(24*3600*1000)
  6850. var hours=Math.floor(leave1/(3600*1000))
  6851. var leave2=leave1%(3600*1000)
  6852. var minutes=Math.floor(leave2/(60*1000))
  6853. var shi = hours+'.'+ minutes
  6854. return he += +shi
  6855. },
  6856. // 自动选择事件长度的事件
  6857. zhoXuan(item, i) {
  6858. var iss = i
  6859. if(item.time == null) {
  6860. return
  6861. } else {
  6862. var zhi = this.zhoData[iss]
  6863. var he = 0
  6864. for(var i in zhi) {
  6865. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  6866. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  6867. console.log('执行')
  6868. he += +zhi[i].workingTime
  6869. }
  6870. }
  6871. zhi.he = he + 'h'
  6872. }
  6873. },
  6874. getPushWorkLogData(){
  6875. this.http.post('/sap-sync-log/list', {},
  6876. res => {
  6877. if (res.code == "ok") {
  6878. this.pushWorkTimeLogData = res.data;
  6879. } else {
  6880. this.$message({
  6881. message: res.msg,
  6882. type: "error"
  6883. });
  6884. }
  6885. },
  6886. error => {
  6887. this.$message({
  6888. message: error,
  6889. type: "error"
  6890. });
  6891. });
  6892. },
  6893. // 获取全部人员
  6894. getUsers() {
  6895. this.http.post('/user/getSimpleActiveUserList', {},
  6896. res => {
  6897. if (res.code == "ok") {
  6898. this.usersList = res.data;
  6899. } else {
  6900. this.$message({
  6901. message: res.msg,
  6902. type: "error"
  6903. });
  6904. }
  6905. },
  6906. error => {
  6907. this.$message({
  6908. message: error,
  6909. type: "error"
  6910. });
  6911. });
  6912. },
  6913. // 按时间比例
  6914. addBli(item, i) {
  6915. var iss = i
  6916. if(item.time == null) {
  6917. return
  6918. } else {
  6919. var zhi = this.zhoData[iss]
  6920. var he = 0
  6921. for(var i in zhi) {
  6922. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6923. he += +zhi[i].workingTime
  6924. }
  6925. }
  6926. zhi.he = he.toFixed(1) + 'h'
  6927. }
  6928. },
  6929. //按周填报选择的项目发生变化,需要设置列
  6930. onSelProjectChange() {
  6931. for (let i = 0; i < this.selCon.length; i++) {
  6932. var exists = false;
  6933. for (let j = 0; j < this.selProjectList.length; j++) {
  6934. if (this.selProjectList[j].id == this.selCon[i]) {
  6935. exists = true;
  6936. break;
  6937. }
  6938. }
  6939. if (!exists) {
  6940. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6941. this.selProjectList.push(newProject);
  6942. //添加新项目
  6943. for (var w in this.zhoData) {
  6944. var dayItem = this.zhoData[w];
  6945. var pName = newProject.projectName;
  6946. dayItem[pName] = {};
  6947. dayItem[pName].time = ''
  6948. dayItem[pName].content = ''
  6949. dayItem[pName].progress = 0
  6950. dayItem[pName].workingTime = 0
  6951. }
  6952. }
  6953. }
  6954. //去掉
  6955. for (let j = 0; j < this.selProjectList.length; j++) {
  6956. var exists = false;
  6957. for (let i = 0; i < this.selCon.length; i++) {
  6958. if (this.selProjectList[j].id == this.selCon[i]) {
  6959. exists = true;
  6960. break;
  6961. }
  6962. }
  6963. if (!exists) {
  6964. this.selProjectList.splice(j, 1);
  6965. j--;
  6966. }
  6967. }
  6968. this.loadFilledWeekReportItem();
  6969. //刷新表格
  6970. // this.$refs.weekTable.doLayout();
  6971. },
  6972. //根据选中的项目来刷新填写表格
  6973. loadFilledWeekReportItem() {
  6974. for (var w in this.zhoData) {
  6975. var dayItem = this.zhoData[w];
  6976. for (var i = 0; i < this.selProjectList.length; i++) {
  6977. var curColumnProject = this.selProjectList[i];
  6978. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6979. for (var t in dayItem.reportList) {
  6980. //有日报的项目,不能取消选择
  6981. for (var p in this.fillProjectList) {
  6982. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6983. }
  6984. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6985. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6986. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6987. if (this.reportTimeType.type == 2) {
  6988. //时间段模式
  6989. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6990. }
  6991. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6992. break;
  6993. }
  6994. }
  6995. // dayItem[curColumnProject.projectName] = matchReportItem;
  6996. }
  6997. }
  6998. this.$nextTick(()=>{
  6999. this.$refs.weekTable.doLayout();
  7000. });
  7001. },
  7002. initWeekFormData() {
  7003. this.weekDataLoading = true;
  7004. for (var p in this.fillProjectList) {
  7005. this.fillProjectList[p].canCancel = 1;
  7006. }
  7007. var param = {
  7008. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7009. };
  7010. if (this.isSubstitude) {
  7011. //传代填人的userId
  7012. param.targetUserId = this.workForm.userId[0];
  7013. }
  7014. this.http.post('/report/getWeeklyReportData',param,res => {
  7015. this.weekDataLoading = false;
  7016. if(res.code == 'ok'){
  7017. let projectList = res.data.projectList;
  7018. if (projectList.length > 0) {
  7019. //有选择过项目进行填报,直接选中
  7020. this.selProjectList = projectList;
  7021. this.selCon = [];
  7022. for (let i = 0; i < projectList.length; i++) {
  7023. this.selCon.push(projectList[i].id);
  7024. }
  7025. }
  7026. //设置日期
  7027. this.weekDateRange = res.data.dateList;
  7028. this.zhoData = [];
  7029. var arrst = []
  7030. for(var i in this.weekDateRange) {
  7031. var obj = {}
  7032. obj.zhoDataTime = this.weekDateRange[i].date
  7033. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7034. obj.he = this.weekDateRange[i].filledTime;
  7035. obj.canFill = this.weekDateRange[i].canFill;
  7036. // obj.filledTime = this.weekDateRange[i].filledTime;
  7037. obj.reportList = this.weekDateRange[i].reportList;
  7038. //初始化,防止渲染报错
  7039. for (var j = 0; j < this.selProjectList.length; j++) {
  7040. var pName = this.selProjectList[j].projectName
  7041. obj[pName] = {}
  7042. obj[pName].time = ''
  7043. obj[pName].content = ''
  7044. obj[pName].progress = 0
  7045. obj[pName].workingTime = 0
  7046. }
  7047. arrst.push(obj)
  7048. }
  7049. this.zhoData = arrst
  7050. this.setWeekCardTimeData(res.data.cardTimeList);
  7051. this.loadFilledWeekReportItem();
  7052. }else{
  7053. this.$message({
  7054. message: res.msg,
  7055. type: 'error'
  7056. })
  7057. }
  7058. },err => {
  7059. this.$message({
  7060. message: err,
  7061. type: 'error'
  7062. })
  7063. })
  7064. },
  7065. zhoZhi(res, i) {
  7066. var zhi = 0
  7067. for(var i in res) {
  7068. if(i != 'zhoDataTime' && i != 'he') {
  7069. zhi += +res[i]
  7070. }
  7071. }
  7072. res.he = zhi
  7073. },
  7074. zhoBtn(i) {
  7075. // this.zhoData.split(i, 1)
  7076. var arr = this.zhoData
  7077. arr.splice(i, 1)
  7078. },
  7079. zhoAddlast(){
  7080. this.selConShow = true
  7081. },
  7082. closeAddWeeklyReport(){
  7083. this.fillWeekDialogVisi = false
  7084. this.selConShow = true
  7085. this.selProjectList = []
  7086. this.selCon = []
  7087. },
  7088. checkDateWorkTime() {
  7089. //针对苏州景昱,单独的检查逻辑
  7090. if (this.user.companyId == 5978) {
  7091. //调接口,先检查工时是否存在异常
  7092. var zhi = this.zhoData;
  7093. var array = [];
  7094. for(let n in zhi){
  7095. if(zhi[n].he){
  7096. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7097. array.push(workData)
  7098. }
  7099. }
  7100. this.submitingReport = true;
  7101. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7102. res => {
  7103. this.submitingReport = false;
  7104. if (res.code == "ok") {
  7105. this.submitWeekReport(0)
  7106. } else {
  7107. this.$confirm(res.msg, this.$t('other.prompts'), {
  7108. confirmButtonText: this.$t('huLveBingTiJiao'),
  7109. cancelButtonText: this.$t('btn.cancel'),
  7110. type: 'error'
  7111. }).then(() => {
  7112. this.submitWeekReport(0)
  7113. }).catch(() => {
  7114. });
  7115. }
  7116. },
  7117. error => {
  7118. this.$message({
  7119. message: error,
  7120. type: "error"
  7121. });
  7122. });
  7123. }
  7124. },
  7125. // 提交按周填报
  7126. submitWeekReport(isDraft) {
  7127. var zhi = this.zhoData
  7128. var ll = 0
  7129. if(this.reportTimeType.type == 2) {
  7130. for(var i in zhi) {
  7131. this.dateAr = []
  7132. var alp = []
  7133. var zhis = zhi[i]
  7134. for(var j in zhis) {
  7135. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7136. let objs = {}
  7137. objs.s = zhis[j].time[0]
  7138. objs.e = zhis[j].time[1]
  7139. objs.p = j
  7140. alp.push(objs)
  7141. }
  7142. }
  7143. this.dateAr = alp
  7144. if (this.reportTimeType.timeCanOverlap == 0) {
  7145. let str = this.$t('message.Filledtimeperiodsoverlap')
  7146. if(this.dateAr.length > 0) {
  7147. const trus = this.fns();
  7148. const overlapDataTime = this.getOverlapData(alp);
  7149. if (overlapDataTime.length > 0) {
  7150. const arrList = overlapDataTime.map((item) => item.p);
  7151. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7152. }
  7153. ll += 1
  7154. if(!trus) {
  7155. this.$message({
  7156. message: str,
  7157. type: 'error'
  7158. })
  7159. return false
  7160. }
  7161. }
  7162. } else {
  7163. if(this.dateAr.length > 0) {
  7164. ll +=1 ;
  7165. }
  7166. }
  7167. }
  7168. if(ll == 0) {
  7169. this.$message({
  7170. message: this.$t('message.Pleasefillinthetime'),
  7171. type: 'error'
  7172. })
  7173. return false
  7174. }
  7175. } else if(this.reportTimeType.type == 1){
  7176. for(var i in zhi) {
  7177. var zhis = zhi[i]
  7178. for(var j in zhis) {
  7179. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7180. ll += 1
  7181. }
  7182. }
  7183. }
  7184. if(ll == 0) {
  7185. this.$message({
  7186. message: this.$t('message.Pleaseselectatime'),
  7187. type: 'error'
  7188. })
  7189. return false
  7190. }
  7191. let overcorp = ''
  7192. for(let n in zhi){
  7193. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7194. overcorp += zhi[n].zhoDataTime + ','
  7195. }
  7196. }
  7197. if(this.user.companyId != 5978 && overcorp != ''){
  7198. overcorp = overcorp.substring(0,overcorp.length - 1)
  7199. this.$message({
  7200. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7201. type: 'error'
  7202. })
  7203. return
  7204. }
  7205. }
  7206. var submits = []
  7207. let formData = new FormData();
  7208. formData.append("draft", isDraft);
  7209. if(this.reportTimeType.multiWorktime == 1){
  7210. for (var i in this.zhoData) {
  7211. var zhoD = this.zhoData[i]
  7212. var flgs = false
  7213. for(var j in zhoD) {
  7214. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7215. flgs = true
  7216. // formData.append("degreeId", "-1");
  7217. formData.append("id", '-1');
  7218. if (this.isSubstitude) {
  7219. formData.append('targetUids',this.workForm.userId[0]);
  7220. }
  7221. for(var s in this.selProjectList) {
  7222. if(j == this.selProjectList[s].projectName) {
  7223. formData.append("projectId", this.selProjectList[s].id);
  7224. break;
  7225. }
  7226. }
  7227. if(this.user.timeType.reportAuditType == 3){
  7228. let audItem = {}
  7229. if(this.user.timeType.auditLevel > 0){
  7230. audItem.auditorFirst = zhoD[j].auditorFirst
  7231. }
  7232. if(this.user.timeType.auditLevel > 1){
  7233. audItem.auditorSec = zhoD[j].auditorSec
  7234. }
  7235. if(this.user.timeType.auditLevel > 2){
  7236. audItem.auditorThird = zhoD[j].auditorThird
  7237. }
  7238. if(zhoD[j].ccUserid){
  7239. audItem.ccUserid = zhoD[j].ccUserid
  7240. }
  7241. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7242. }
  7243. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7244. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7245. formData.append("reportTimeType", this.reportTimeType.type);
  7246. formData.append("endTime", '');
  7247. formData.append("startTime", '');
  7248. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7249. var lix = []
  7250. var objjs = {}
  7251. objjs.startTime = zhoD[j].time[0]
  7252. objjs.endTime = zhoD[j].time[1]
  7253. if (zhoD[j].content == null || zhoD[j].content == '') {
  7254. zhoD[j].content == '-'
  7255. }
  7256. objjs.content = zhoD[j].content
  7257. lix.push(objjs)
  7258. var zhiZhi = JSON.stringify(lix)
  7259. zhiZhi = zhiZhi.replace(/,/g,"@");
  7260. formData.append("content", zhiZhi)
  7261. formData.append("isOvertime", 0)
  7262. formData.append("professionProgress", "[]")
  7263. if (zhoD[j].groupId) {
  7264. formData.append("groupId",zhoD[j].groupId)
  7265. } else {
  7266. //解决后台groupId数组越界的问题
  7267. formData.append("groupId",0)
  7268. }
  7269. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7270. formData.append("createDate",zhoD.zhoDataTime)
  7271. if (zhoD[j].projectAuditorId) {
  7272. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7273. }
  7274. if(zhoD[j].basecostId) {
  7275. formData.append("basecostId", zhoD[j].basecostId);
  7276. } else {
  7277. formData.append("basecostId", 0);
  7278. }
  7279. if(this.user.timeType.customDegreeActive){
  7280. if (this.user.timeType.customDegreeMultiple) {
  7281. if (zhoD[j].multiDegrIdArray) {
  7282. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7283. } else {
  7284. formData.append('multiDegrId','[]')
  7285. }
  7286. } else {
  7287. if (zhoD[j].degreeId) {
  7288. formData.append('degreeId',zhoD[j].degreeId)
  7289. } else {
  7290. formData.append('degreeId','-1')
  7291. }
  7292. }
  7293. }else{
  7294. formData.append("degreeId", "-1");
  7295. }
  7296. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7297. formData.append('customData',zhoD[j].customData)
  7298. }else if(this.user.timeType.customDataActive){
  7299. formData.append('customData',0)
  7300. }
  7301. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7302. formData.append('customText',zhoD[j].customText)
  7303. }else if(this.user.timeType.customTextActive){
  7304. formData.append('customText','-')
  7305. }
  7306. }
  7307. }
  7308. }
  7309. } else {
  7310. for (var i in this.zhoData) {
  7311. var zhoD = this.zhoData[i]
  7312. var flgs = false
  7313. if(this.reportTimeType.type == 2) {
  7314. for(var k in this.selProjectList) {
  7315. var pItem = this.selProjectList[k];
  7316. var pName = pItem.projectName;
  7317. var j = pName;
  7318. var pid = pItem.id;
  7319. console.log('j==周报中的项目='+j);
  7320. if(zhoD[j].time && zhoD[j].time != 'null') {
  7321. flgs = true
  7322. // formData.append("degreeId", "-1");
  7323. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7324. if (this.isSubstitude) {
  7325. formData.append('targetUids',this.workForm.userId[0]);
  7326. }
  7327. formData.append("projectId", pid);
  7328. if(this.user.timeType.reportAuditType == 3){
  7329. let audItem = {}
  7330. if(this.user.timeType.auditLevel > 0){
  7331. audItem.auditorFirst = zhoD[j].auditorFirst
  7332. }
  7333. if(this.user.timeType.auditLevel > 1){
  7334. audItem.auditorSec = zhoD[j].auditorSec
  7335. }
  7336. if(this.user.timeType.auditLevel > 2){
  7337. audItem.auditorThird = zhoD[j].auditorThird
  7338. }
  7339. if(zhoD[j].ccUserid){
  7340. audItem.ccUserid = zhoD[j].ccUserid
  7341. }
  7342. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7343. }
  7344. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7345. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7346. formData.append("reportTimeType", this.reportTimeType.type);
  7347. formData.append("endTime", zhoD[j].time[1]);
  7348. formData.append("startTime", zhoD[j].time[0]);
  7349. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7350. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7351. formData.append("isOvertime", 0)
  7352. formData.append("professionProgress", "[]")
  7353. if (zhoD[j].groupId) {
  7354. formData.append("groupId",zhoD[j].groupId)
  7355. } else {
  7356. //解决后台groupId数组越界的问题
  7357. formData.append("groupId",0)
  7358. }
  7359. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7360. formData.append("createDate",zhoD.zhoDataTime)
  7361. if (zhoD[j].projectAuditorId) {
  7362. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7363. }
  7364. if(zhoD[j].basecostId) {
  7365. formData.append("basecostId", zhoD[j].basecostId);
  7366. } else {
  7367. formData.append("basecostId", 0);
  7368. }
  7369. if(this.user.timeType.customDegreeActive){
  7370. if (this.user.timeType.customDegreeMultiple) {
  7371. if (zhoD[j].multiDegrIdArray) {
  7372. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7373. } else {
  7374. formData.append("multiDegrId", "[]");
  7375. }
  7376. } else {
  7377. if (zhoD[j].degreeId) {
  7378. formData.append('degreeId',zhoD[j].degreeId)
  7379. } else {
  7380. formData.append("degreeId", "-1");
  7381. }
  7382. }
  7383. }else{
  7384. formData.append("degreeId", "-1");
  7385. }
  7386. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7387. formData.append('customData',zhoD[j].customData)
  7388. }else if(this.user.timeType.customDataActive){
  7389. formData.append('customData',0)
  7390. }
  7391. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7392. formData.append('customText',zhoD[j].customText)
  7393. }else if(this.user.timeType.customTextActive){
  7394. formData.append('customText','-')
  7395. }
  7396. }
  7397. }
  7398. } else {
  7399. for(var k in this.selProjectList) {
  7400. var pItem = this.selProjectList[k];
  7401. var pName = pItem.projectName;
  7402. var j = pName;
  7403. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7404. flgs = true
  7405. // formData.append("degreeId", "-1");
  7406. console.log('进入了workFpppp==='+j);
  7407. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7408. if (this.isSubstitude) {
  7409. formData.append('targetUids',this.workForm.userId[0]);
  7410. }
  7411. formData.append("projectId", pItem.id);
  7412. if(this.user.timeType.reportAuditType == 3){
  7413. let audItem = {}
  7414. if(this.user.timeType.auditLevel > 0){
  7415. audItem.auditorFirst = zhoD[j].auditorFirst
  7416. }
  7417. if(this.user.timeType.auditLevel > 1){
  7418. audItem.auditorSec = zhoD[j].auditorSec
  7419. }
  7420. if(this.user.timeType.auditLevel > 2){
  7421. audItem.auditorThird = zhoD[j].auditorThird
  7422. }
  7423. if(zhoD[j].ccUserid){
  7424. audItem.ccUserid = zhoD[j].ccUserid
  7425. }
  7426. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7427. }
  7428. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7429. // formData.append("subProjectId", zhoD[j].subProjectId);
  7430. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7431. formData.append("reportTimeType", this.reportTimeType.type);
  7432. if(this.reportTimeType.type == 1) {
  7433. formData.append("workingTime", zhoD[j].workingTime);
  7434. } else if(this.reportTimeType.type == 2) {
  7435. formData.append("endTime", zhoD[j].time[1]);
  7436. formData.append("startTime", zhoD[j].time[0]);
  7437. } else if(this.reportTimeType.type == 3) {
  7438. formData.append("progress", zhoD[j].progress);
  7439. formData.append("workingTime", zhoD[j].workingTime);
  7440. }
  7441. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7442. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7443. formData.append("isOvertime", 0)
  7444. formData.append("professionProgress", "[]")
  7445. if (zhoD[j].groupId) {
  7446. formData.append("groupId",zhoD[j].groupId)
  7447. } else {
  7448. //解决后台groupId数组越界的问题
  7449. formData.append("groupId",0)
  7450. }
  7451. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7452. formData.append("createDate",zhoD.zhoDataTime)
  7453. if (zhoD[j].projectAuditorId) {
  7454. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7455. }
  7456. if(zhoD[j].basecostId) {
  7457. formData.append("basecostId", zhoD[j].basecostId);
  7458. } else {
  7459. formData.append("basecostId", 0);
  7460. }
  7461. if(this.user.timeType.customDegreeActive){
  7462. if (this.user.timeType.customDegreeMultiple) {
  7463. if (zhoD[j].multiDegrIdArray) {
  7464. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7465. } else {
  7466. formData.append("multiDegrId", "[]");
  7467. }
  7468. } else {
  7469. if (zhoD[j].degreeId) {
  7470. formData.append('degreeId',zhoD[j].degreeId)
  7471. } else {
  7472. formData.append("degreeId", "-1");
  7473. }
  7474. }
  7475. }else{
  7476. formData.append("degreeId", "-1");
  7477. }
  7478. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7479. formData.append('customData',zhoD[j].customData)
  7480. }else if(this.user.timeType.customDataActive){
  7481. formData.append('customData',0)
  7482. }
  7483. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7484. formData.append('customText',zhoD[j].customText)
  7485. }else if(this.user.timeType.customTextActive){
  7486. formData.append('customText','-')
  7487. }
  7488. }
  7489. }
  7490. }
  7491. }
  7492. }
  7493. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7494. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7495. if(!next) {
  7496. this.$message({
  7497. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7498. type: 'error'
  7499. })
  7500. return
  7501. }
  7502. // 自定义维度
  7503. this.submitingReport = true;
  7504. this.http.uploadFile( this.port.report.editPort, formData,
  7505. res => {
  7506. // this.listLoading = false;
  7507. this.submitingReport = false;
  7508. if (res.code == "ok") {
  7509. this.$message({
  7510. message: this.$t('message.fillinsuccessfully'),
  7511. type: "success"
  7512. });
  7513. this.fillWeekDialogVisi = false
  7514. this.selConShow = true
  7515. this.zhoData = []
  7516. this.weekDateRange = ''
  7517. this.getReportList();
  7518. this.getDepartment();
  7519. // 关闭弹窗 并 清空
  7520. this.selProjectList = []
  7521. this.selCon = []
  7522. this.getRecentlyProject()
  7523. } else {
  7524. this.$message({
  7525. message: res.msg,
  7526. type: "error"
  7527. });
  7528. }
  7529. },
  7530. error => {
  7531. this.submitingReport = false;
  7532. this.$message({
  7533. message: error,
  7534. type: "error"
  7535. });
  7536. });
  7537. },
  7538. handleGroupAuditorData(data) {
  7539. const { reportAuditType } = this.user.timeType
  7540. if(reportAuditType != 1 && reportAuditType != 2) {
  7541. return {next: true}
  7542. }
  7543. let arrList = [];
  7544. Object.entries(data).forEach(([key, obj]) => {
  7545. Object.entries(obj).forEach(([projectName, projectData]) => {
  7546. if (projectData.workingTime && !projectData.groupId) {
  7547. arrList.push({
  7548. projectName,
  7549. date: obj.zhoDataTime,
  7550. dateText: obj.zhoDataTimeTxt
  7551. });
  7552. }
  7553. });
  7554. });
  7555. if(arrList.length > 0) {
  7556. return {
  7557. next: false,
  7558. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7559. }
  7560. } else {
  7561. return {
  7562. next: true,
  7563. error: [],
  7564. }
  7565. }
  7566. },
  7567. ChangeHourMinutestr (str) {
  7568. if (str !== "0" && str !== "" && str !== null) {
  7569. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7570. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7571. } else {
  7572. return "";
  7573. }
  7574. },
  7575. // 得到两个日期中间的日期
  7576. getdiffdate(stime,etime){
  7577. //初始化日期列表,数组
  7578. var diffdate = new Array();
  7579. var i=0;
  7580. //开始日期小于等于结束日期,并循环
  7581. while(stime<=etime){
  7582. diffdate[i] = stime;
  7583. //获取开始日期时间戳
  7584. var stime_ts = new Date(stime).getTime();
  7585. //增加一天时间戳后的日期
  7586. var next_date = stime_ts + (24*60*60*1000);
  7587. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7588. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7589. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7590. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7591. stime = next_dates_y+next_dates_m+next_dates_d;
  7592. //增加数组key
  7593. i++;
  7594. }
  7595. return diffdate;
  7596. },
  7597. // 添加模块
  7598. addDomain(i) {
  7599. var leftProgress = 10;
  7600. if (this.reportTimeType.type == 3) {
  7601. //计算已经待分配工时比例
  7602. let array = this.workForm.domains;
  7603. let totalProgress = 0;
  7604. for (var i=0;i<array.length; i++) {
  7605. totalProgress += array[i].progress;
  7606. }
  7607. if (totalProgress < 100) {
  7608. leftProgress = 100 - totalProgress;
  7609. }
  7610. }
  7611. var addItem = {
  7612. projectId: "",
  7613. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7614. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7615. ),
  7616. content: "",
  7617. progress:leftProgress,
  7618. state:2,//2-表示待提交
  7619. multiWorktime: this.reportTimeType.multiWorktime,
  7620. worktimeList:[{}],
  7621. canEdit: true,
  7622. auditorFirst: '',
  7623. auditorSec: '',
  7624. auditorThird: '',
  7625. ccUserid: ''
  7626. // degreeId: '',
  7627. };
  7628. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7629. this.$set(addItem,'isOvertime',true)
  7630. if(this.reportTimeType.type == 3){
  7631. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7632. }
  7633. }
  7634. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7635. //默认给第一个,必填字段
  7636. addItem.basecostId = this.timeBasecostList[0].id;
  7637. }
  7638. this.workForm.domains.push(addItem);
  7639. document.getElementById('workFormsItemBottom').scrollIntoView()
  7640. this.canEdit = true
  7641. if (this.reportTimeType.type == 0) {
  7642. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7643. var length = this.workForm.domains.length;
  7644. if (length == 2) {
  7645. this.showAddMore = false;
  7646. }
  7647. }
  7648. this.chuji()
  7649. this.seleChn()
  7650. },
  7651. // 移除模块
  7652. delDomain(i) {
  7653. this.workForm.domains.splice(i,1)
  7654. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7655. if (!this.originCanEdit) {
  7656. let iscan = false
  7657. for(let i in this.workForm.domains){
  7658. if(this.workForm.domains[i].canEdit){
  7659. iscan = true
  7660. }
  7661. }
  7662. this.canEdit = iscan
  7663. }
  7664. //检测当前剩下的一个,时间类型是否是全天
  7665. if (this.reportTimeType.type == 0) {
  7666. if (this.workForm.domains[0].timeType == 0) {
  7667. this.showAddMore = false;
  7668. } else {
  7669. this.showAddMore = true;
  7670. }
  7671. }
  7672. if(this.user.timeType.multiWorktime == 1) {
  7673. this.iptChangs()
  7674. } else {
  7675. this.seleChn(0)
  7676. }
  7677. },
  7678. // 改变月份
  7679. changeMonth() {
  7680. this.isWeekend = false
  7681. let date = new Date()
  7682. let nowmon = date.getMonth() + 1
  7683. let nowday = date.getDate()
  7684. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7685. if (this.isBatch == 0) {
  7686. if(this.user.timeType.fillAhead == 0){
  7687. let date_a = new Date(this.workForm.createDate)
  7688. if(date_a.getTime() > date.getTime()){
  7689. this.workForm.createDate = nowdate
  7690. }
  7691. }
  7692. //只有按天填报才能获取当天的日报
  7693. if(!this.isSubstitude){
  7694. let weekday = new Date(this.workForm.createDate).getDay()
  7695. if(this.user.companyId == 817){
  7696. if(weekday == 0){
  7697. this.isWeekend = true
  7698. }
  7699. }else{
  7700. if(weekday == 0 || weekday == 6){
  7701. this.isWeekend = true
  7702. }
  7703. }
  7704. this.getReport()
  7705. } else {
  7706. //获取代填人员的考勤
  7707. if (this.user.timeType.showCorpwxCardtime == 1) {
  7708. this.getTargetUserCardTime();
  7709. }
  7710. }
  7711. }else {
  7712. if(this.user.timeType.fillAhead == 0){
  7713. let date_a = new Date(this.workForm.createDate[1])
  7714. if(date_a.getTime() > date.getTime()){
  7715. this.workForm.createDate[1] = nowdate
  7716. let sdate = new Date(this.workForm.createDate[0])
  7717. let edate = new Date(this.workForm.createDate[1])
  7718. if(sdate > edate){
  7719. this.workForm.createDate[0] = this.workForm.createDate[1]
  7720. }
  7721. }
  7722. }
  7723. }
  7724. },
  7725. // 判断时间段
  7726. fns() {
  7727. for (let k in this.dateAr) {
  7728. if (!this.judege(k)) {
  7729. return false
  7730. }
  7731. }
  7732. return true
  7733. },
  7734. judege(idx){
  7735. for (let k in this.dateAr) {
  7736. if (idx !== k) {
  7737. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7738. return false
  7739. }
  7740. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7741. return false
  7742. }
  7743. }
  7744. }
  7745. return true
  7746. },
  7747. getOverlapData(data) {
  7748. let overlapData = [];
  7749. for (let i = 0; i < data.length; i++) {
  7750. for (let j = i + 1; j < data.length; j++) {
  7751. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7752. overlapData.push(data[i], data[j]);
  7753. }
  7754. }
  7755. }
  7756. return overlapData;
  7757. },
  7758. // 保存日报111111
  7759. submitReport(isDraft) {
  7760. this.isDraft = isDraft;
  7761. this.$refs.workForm.validate(valid => {
  7762. if (valid) {
  7763. if (!isDraft) {
  7764. //针对苏州景昱,单独的检查逻辑
  7765. if (this.user.companyId == 5978) {
  7766. //调接口,先检查工时是否存在异常
  7767. var totalTime = 0;
  7768. for (var t=0;t<this.workForm.domains.length; t++) {
  7769. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7770. }
  7771. var array = [];
  7772. if (this.isBatch) {
  7773. var startDate = new Date(this.workForm.createDate[0]);
  7774. var endDate = new Date(this.workForm.createDate[1]);
  7775. if (startDate > endDate) {
  7776. this.$message({
  7777. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7778. type: "error"
  7779. });
  7780. return
  7781. } else {
  7782. while(true){
  7783. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7784. array.push(workData);
  7785. startDate.setDate(startDate.getDate() + 1);
  7786. if (startDate > endDate) {
  7787. break;
  7788. }
  7789. }
  7790. }
  7791. } else {
  7792. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7793. array.push(workData)
  7794. }
  7795. this.submitingReport = true;
  7796. var passUserId = this.user.id;
  7797. if (this.isSubstitude) {
  7798. passUserId = this.targetUids;
  7799. }
  7800. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7801. res => {
  7802. this.submitingReport = false;
  7803. if (res.code == "ok") {
  7804. this.submitReportSon()
  7805. } else {
  7806. this.$confirm(res.msg, this.$t('other.prompts'), {
  7807. confirmButtonText: this.$t('huLveBingTiJiao'),
  7808. cancelButtonText: this.$t('btn.cancel'),
  7809. type: 'error'
  7810. }).then(() => {
  7811. this.submitReportSon()
  7812. }).catch(() => {
  7813. });
  7814. }
  7815. },
  7816. error => {
  7817. this.$message({
  7818. message: error,
  7819. type: "error"
  7820. });
  7821. });
  7822. } else if (this.user.companyId == 469) {
  7823. //试点,针对赛元微电子校验考勤工时
  7824. if (this.workForm.time && this.workForm.time.workHours) {
  7825. if (this.totalReportHours > this.workForm.time.workHours) {
  7826. this.$message({
  7827. message: '填报工时不得超过考勤时长',
  7828. type: "error"
  7829. });
  7830. } else if (this.totalReportHours < this.workForm.time.workHours) {
  7831. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  7832. confirmButtonText: this.$t('btn.determine'),
  7833. cancelButtonText: this.$t('btn.cancel'),
  7834. type: 'warning'
  7835. }).then(() => {
  7836. this.submitReportSon()
  7837. }).catch(() => {
  7838. });
  7839. } else {
  7840. this.submitReportSon();
  7841. }
  7842. } else {
  7843. this.$message({
  7844. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  7845. type: "error"
  7846. });
  7847. }
  7848. } else {
  7849. if(this.totalReportHours < this.user.timeType.allday){
  7850. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7851. confirmButtonText: this.$t('btn.determine'),
  7852. cancelButtonText: this.$t('btn.cancel'),
  7853. type: 'warning'
  7854. }).then(() => {
  7855. this.submitReportSon()
  7856. }).catch(() => {
  7857. });
  7858. }else{
  7859. this.submitReportSon()
  7860. }
  7861. }
  7862. } else {
  7863. //暂存,不需要检查工时是否超过考勤
  7864. this.submitReportSon()
  7865. }
  7866. }
  7867. });
  7868. },
  7869. submitReportSon() {
  7870. this.dateAr = []
  7871. //检查重叠
  7872. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7873. let alp = []
  7874. if(this.user.timeType.multiWorktime != 1) {
  7875. for(var p in this.workForm.domains) {
  7876. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7877. let objs = {}
  7878. objs.s = this.workForm.domains[p].startTime
  7879. objs.e = this.workForm.domains[p].endTime
  7880. alp.push(objs)
  7881. }
  7882. }
  7883. this.dateAr = alp
  7884. if(this.dateAr.length > 0) {
  7885. let trus = this.fns()
  7886. if(!trus) {
  7887. this.$message({
  7888. message: this.$t('message.Filledtimeperiodsoverlap'),
  7889. type: "error"
  7890. });
  7891. return
  7892. }
  7893. }
  7894. } else {
  7895. for(var p in this.workForm.domains) {
  7896. var slll = this.workForm.domains[p]
  7897. for(var o in slll.worktimeList) {
  7898. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7899. let objs = {}
  7900. objs.s = slll.worktimeList[o].startTime
  7901. objs.e = slll.worktimeList[o].endTime
  7902. alp.push(objs)
  7903. }
  7904. }
  7905. }
  7906. this.dateAr = alp
  7907. if(this.dateAr.length > 0) {
  7908. let trus = this.fns()
  7909. if(!trus) {
  7910. this.$message({
  7911. message: this.$t('message.Filledtimeperiodsoverlap'),
  7912. type: "error"
  7913. });
  7914. return
  7915. }
  7916. }
  7917. }
  7918. }
  7919. //检查子项目
  7920. if (this.user.timeType.subProMustFill == 1) {
  7921. for(var p in this.workForm.domains) {
  7922. var oneProItem = this.workForm.domains[p]
  7923. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7924. //没有选择子项目
  7925. this.$message({
  7926. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7927. type: "error"
  7928. });
  7929. return
  7930. }
  7931. }
  7932. }
  7933. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7934. if (this.user.companyId == this.yuzhongCompId) {
  7935. for(var p in this.workForm.domains) {
  7936. var oneProItem = this.workForm.domains[p]
  7937. if (!oneProItem.extraField1) {
  7938. this.$message({
  7939. message: this.$t('jiaoSeBiTianQingJianCha'),
  7940. type: "error"
  7941. });
  7942. return
  7943. }
  7944. if (!oneProItem.extraField2) {
  7945. this.$message({
  7946. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7947. type: "error"
  7948. });
  7949. return
  7950. }
  7951. if (!oneProItem.extraField3) {
  7952. this.$message({
  7953. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7954. type: "error"
  7955. });
  7956. return
  7957. }
  7958. }
  7959. }
  7960. // return
  7961. //代填的情况,检查人员是否已经选择
  7962. if (this.isSubstitude) {
  7963. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7964. this.$message({
  7965. message: this.$t('message.pleaseselectthepersontofillin'),
  7966. type: "error"
  7967. });
  7968. return;
  7969. }
  7970. }
  7971. //检查时间,全天和上下午不能同时存在
  7972. if (this.reportTimeType.type == 0) {
  7973. var alldayNum = 0;
  7974. var amNum = 0;
  7975. var pmNum = 0;
  7976. for(var i in this.workForm.domains) {
  7977. if (this.workForm.domains[i].timeType == 0) {
  7978. alldayNum ++;
  7979. } else if (this.workForm.domains[i].timeType == 1) {
  7980. amNum++;
  7981. } else if (this.workForm.domains[i].timeType == 2) {
  7982. pmNum++;
  7983. }
  7984. }
  7985. if (alldayNum > 1) {
  7986. this.$message({
  7987. // message: "工作时间-全天,只能选择一次",
  7988. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7989. type: "error"
  7990. });
  7991. return;
  7992. }
  7993. if (amNum > 1) {
  7994. this.$message({
  7995. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7996. type: "error"
  7997. });
  7998. return;
  7999. }
  8000. if (pmNum > 1) {
  8001. this.$message({
  8002. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8003. type: "error"
  8004. });
  8005. return;
  8006. }
  8007. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8008. this.$message({
  8009. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8010. type: "error"
  8011. });
  8012. return;
  8013. }
  8014. } else if (this.reportTimeType.type == 3) {
  8015. //总百分比不能超过100%
  8016. let total = 0;
  8017. this.workForm.domains.forEach(w=>{total += w.progress});
  8018. if (total > 100) {
  8019. this.$message({
  8020. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8021. type: "error"
  8022. });
  8023. return;
  8024. } else if (total < 100) {
  8025. this.$message({
  8026. message: this.$t('message.cannotbesubmitted'),
  8027. type: "error"
  8028. });
  8029. return;
  8030. }
  8031. }
  8032. this.listLoading = true;
  8033. let formData = new FormData();
  8034. formData.append("draft", this.isDraft);
  8035. var totalTime = 0;
  8036. for (var t=0;t<this.workForm.domains.length; t++) {
  8037. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8038. }
  8039. //批量填报不校验考勤时长,交给后台校验
  8040. if (!this.isBatch) {
  8041. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8042. if (this.workForm.time){
  8043. if (this.workForm.time.workHours == 0){
  8044. this.$message({
  8045. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8046. type: 'error'
  8047. })
  8048. return
  8049. }
  8050. }else{
  8051. this.$message({
  8052. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8053. type: 'error'
  8054. })
  8055. return
  8056. }
  8057. }
  8058. }
  8059. //针对凡己和景昱,苏州博海,此处不校验考勤时长
  8060. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.workForm.time) {
  8061. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8062. this.$message({
  8063. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8064. type: "error"
  8065. });
  8066. return;
  8067. }
  8068. }
  8069. for(var i in this.workForm.domains) {
  8070. // 检查任务/里程碑是否为必填
  8071. let taskRequired = this.user.timeType.taskRequired
  8072. if(taskRequired == 1) {
  8073. if(!this.workForm.domains[i].taskId) {
  8074. this.$message({
  8075. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8076. type: "error"
  8077. });
  8078. return
  8079. }
  8080. }
  8081. if(this.user.timeType.reportAuditType == 3){
  8082. let audItem = {}
  8083. let auditRule = ''
  8084. if(this.workForm.domains[i].id){
  8085. audItem.reportId = this.workForm.domains[i].id
  8086. }
  8087. if(this.user.timeType.auditLevel > 0){
  8088. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8089. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8090. }
  8091. if(this.user.timeType.auditLevel > 1){
  8092. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8093. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8094. }
  8095. if(this.user.timeType.auditLevel > 2){
  8096. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8097. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8098. }
  8099. if(this.workForm.domains[i].ccUserid){
  8100. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8101. }
  8102. if(auditRule){
  8103. auditRule = auditRule.substring(0,auditRule.length - 1)
  8104. this.$message({
  8105. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8106. type: 'error'
  8107. })
  8108. return
  8109. }
  8110. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8111. }
  8112. if (this.user.timeType.customDegreeActive) {
  8113. if (this.user.timeType.customDegreeMultiple) {
  8114. //多选
  8115. if (this.workForm.domains[i].multiDegrIdArray) {
  8116. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8117. degreeArray = degreeArray.replace(/,/g,"@");
  8118. formData.append("multiDegrId", degreeArray);
  8119. } else {
  8120. formData.append("multiDegrId", '[]');
  8121. }
  8122. } else {
  8123. //单选
  8124. if (this.workForm.domains[i].degreeId) {
  8125. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8126. } else {
  8127. formData.append("degreeId", -1);
  8128. }
  8129. }
  8130. } else {
  8131. formData.append("degreeId", -1);
  8132. }
  8133. if(this.workForm.domains[i].customData) {
  8134. // var sss = this.workForm.domains[i].degreeId.toString()
  8135. formData.append("customData", this.workForm.domains[i].customData);
  8136. } else {
  8137. formData.append("customData", 0);
  8138. }
  8139. if(this.workForm.domains[i].customText) {
  8140. formData.append("customText", this.workForm.domains[i].customText);
  8141. } else {
  8142. formData.append("customText", '-');
  8143. }
  8144. if (this.workForm.domains[i].id) {
  8145. formData.append("id", this.workForm.domains[i].id);
  8146. } else {
  8147. formData.append("id", -1);
  8148. }
  8149. formData.append("projectId", this.workForm.domains[i].projectId);
  8150. if (this.workForm.domains[i].subProjectId) {
  8151. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8152. } else {
  8153. formData.append("subProjectId", 0);
  8154. }
  8155. if (this.workForm.domains[i].groupId) {
  8156. formData.append("groupId", this.workForm.domains[i].groupId);
  8157. } else {
  8158. formData.append("groupId", 0);
  8159. }
  8160. if (this.workForm.domains[i].taskId) {
  8161. formData.append("taskId", this.workForm.domains[i].taskId);
  8162. } else {
  8163. formData.append("taskId", 0);
  8164. }
  8165. if (this.workForm.domains[i].taskFinish == true) {
  8166. formData.append("taskFinish", 1);
  8167. } else {
  8168. formData.append("taskFinish", 0);
  8169. }
  8170. formData.append("reportTimeType", this.reportTimeType.type);
  8171. if (this.reportTimeType.type == 0) {
  8172. formData.append("timeType", this.workForm.domains[i].timeType);
  8173. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8174. formData.append("workingTime", workingTime);
  8175. } else if (this.reportTimeType.type == 1){
  8176. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8177. } else if (this.reportTimeType.type == 2) {
  8178. formData.append("endTime", this.workForm.domains[i].endTime);
  8179. formData.append("startTime", this.workForm.domains[i].startTime);
  8180. } else if (this.reportTimeType.type == 3) {
  8181. //按比例分配
  8182. formData.append("progress", this.workForm.domains[i].progress);
  8183. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8184. }
  8185. if(this.user.timeType.choseFromAlbum == 1 ) {
  8186. console.log(this.workForm.domains[i].imgList)
  8187. if(this.workForm.domains[i].imgList) {
  8188. let imgListFor = this.workForm.domains[i].imgList
  8189. for(var b in imgListFor) {
  8190. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8191. }
  8192. console.log(imgListFor)
  8193. let m = JSON.stringify(imgListFor);
  8194. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8195. formData.append("picStr", m);
  8196. } else {
  8197. formData.append("picStr", '[]');
  8198. }
  8199. }
  8200. //处理多个时间事项
  8201. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8202. if (this.reportTimeType.multiWorktime == 1) {
  8203. //检查时间是否有重叠
  8204. var workList = this.workForm.domains[i].worktimeList;
  8205. for (var j=0;j<workList.length; j++) {
  8206. var curItem = workList[j];
  8207. //检查开始时间是否大于结束时间
  8208. if (curItem.startTime >= curItem.endTime) {
  8209. this.$message({
  8210. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8211. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8212. type: "error"
  8213. });
  8214. return;
  8215. }
  8216. //时间不可重叠
  8217. if (this.reportTimeType.timeCanOverlap == 0) {
  8218. for (var p = j+1;p<workList.length; p++) {
  8219. var jItem = workList[p];
  8220. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8221. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8222. this.$message({
  8223. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8224. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8225. type: "error"
  8226. });
  8227. return;
  8228. }
  8229. }
  8230. }
  8231. }
  8232. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8233. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8234. formData.append("content", m);
  8235. } else {
  8236. if (this.workForm.domains[i].content) {
  8237. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8238. m = m.replace(/,/g,",");
  8239. console.log(m, '需要传值的数据')
  8240. // formData.append("content", this.workForm.domains[i].content);
  8241. formData.append("content", m);
  8242. } else {
  8243. formData.append("content", '-');
  8244. }
  8245. }
  8246. if (this.isBatch == 0) {
  8247. formData.append("createDate", this.workForm.createDate);
  8248. } else {
  8249. //批量填报,时间范围
  8250. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8251. }
  8252. if(this.workForm.domains[i].isOvertime) {
  8253. formData.append("isOvertime", 1);
  8254. } else {
  8255. formData.append("isOvertime", 0);
  8256. }
  8257. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8258. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8259. } else {
  8260. formData.append("overtimeHours", 0);
  8261. }
  8262. if(this.workForm.domains[i].basecostId) {
  8263. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8264. } else {
  8265. formData.append("basecostId", 0);
  8266. }
  8267. if (this.workForm.userId != null) {
  8268. var targetUids = '';
  8269. this.workForm.userId.forEach(u=>{
  8270. targetUids += u + '@';
  8271. });
  8272. if (targetUids.length > 0) {
  8273. targetUids = targetUids.substring(0, targetUids.length -1);
  8274. formData.append("targetUids", targetUids);
  8275. }
  8276. }
  8277. //项目专业进度
  8278. if (this.workForm.domains[i].professionProgress) {
  8279. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8280. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8281. formData.append("professionProgress", m);
  8282. } else {
  8283. formData.append("professionProgress", "[]");
  8284. }
  8285. if (this.workForm.domains[i].stage) {
  8286. formData.append("stage", this.workForm.domains[i].stage);
  8287. } else {
  8288. formData.append("stage", "-");
  8289. }
  8290. if (this.workForm.domains[i].projectAuditorId) {
  8291. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8292. } else {
  8293. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8294. this.$message({
  8295. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8296. type: "error"
  8297. });
  8298. return;
  8299. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8300. //分组负责人先审核, 确定是选择了任务分组
  8301. if (this.workForm.domains[i].taskGroups.length == 0) {
  8302. this.$message({
  8303. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8304. type: "error"
  8305. });
  8306. return;
  8307. } else if (!this.workForm.domains[i].groupId) {
  8308. // console.log(this.workForm.domains[i]);
  8309. this.$message({
  8310. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8311. type: "error"
  8312. });
  8313. return;
  8314. }
  8315. }
  8316. }
  8317. if (this.user.companyId == this.yuzhongCompId) {
  8318. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8319. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8320. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8321. }
  8322. //依斯贝的服务Id
  8323. if (this.user.companyId == this.yisibeiCompId) {
  8324. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8325. }
  8326. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8327. this.$message({
  8328. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8329. type: "error"
  8330. });
  8331. return
  8332. }
  8333. if(this.user.timeType.userWithMultiDept == 1) {
  8334. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8335. }
  8336. }
  8337. this.submitingReport = true;
  8338. this.http.uploadFile( this.port.report.editPort, formData,
  8339. res => {
  8340. this.listLoading = false;
  8341. this.submitingReport = false;
  8342. if (res.code == "ok") {
  8343. if(res.msg!=null){
  8344. this.$message({
  8345. dangerouslyUseHTMLString: true,
  8346. message: res.msg,
  8347. type: "warning",
  8348. showClose: true,
  8349. duration: 0
  8350. });
  8351. }else{
  8352. this.$message({
  8353. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8354. type: "success"
  8355. });
  8356. }
  8357. this.dialogVisible = false;
  8358. this.jsDay = 0
  8359. this.jsTime = 0
  8360. this.getReportList();
  8361. this.getDepartment();
  8362. this.getRecentlyProject()
  8363. } else {
  8364. this.$message({
  8365. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8366. type: "error"
  8367. });
  8368. }
  8369. },
  8370. error => {
  8371. this.listLoading = false;
  8372. this.submitingReport = false;
  8373. this.$message({
  8374. message: error,
  8375. type: "error"
  8376. });
  8377. });
  8378. },
  8379. // 判断是展示那个工时导入
  8380. imports() {
  8381. if(this.user.timeType.syncCorpwxTime == 0) {
  8382. this.importDialog = true
  8383. } else {
  8384. this.importWxDialog = true
  8385. }
  8386. },
  8387. // 跳转
  8388. junpToDeskTop(id) {
  8389. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8390. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8391. },
  8392. // 通过日报
  8393. approve(id, item) {
  8394. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8395. this.approveinData = {
  8396. id: id,
  8397. date: this.date +day,
  8398. reportIds: item.id
  8399. }
  8400. if(this.user.timeType.needEvaluate == 1){
  8401. this.$set(this.approveinData,'evaluate','')
  8402. this.approveinDialog = true
  8403. }else{
  8404. this.logining = true;
  8405. this.approveinfun()
  8406. }
  8407. },
  8408. approveinfun(){
  8409. this.http.post( this.port.report.approve, this.approveinData,
  8410. res => {
  8411. this.logining = false;
  8412. if (res.code == "ok") {
  8413. this.approveinDialog = false
  8414. this.$message({
  8415. message: this.$t('message.Reviewsucceeded'),
  8416. type: "success"
  8417. });
  8418. this.refreshReportData(this.approveinData.reportIds);
  8419. this.getDepartment();
  8420. } else {
  8421. this.$message({
  8422. message: res.msg,
  8423. type: "error"
  8424. });
  8425. }
  8426. },
  8427. error => {
  8428. this.logining = false;
  8429. this.$message({
  8430. message: error,
  8431. type: "error"
  8432. });
  8433. });
  8434. },
  8435. //撤回日报
  8436. cancel(item,e) {
  8437. // console.log('can can need',item);
  8438. this.logining = true;
  8439. var ids = '';
  8440. var data = e ? item : item.data;
  8441. data.forEach(element => {
  8442. if(element.id){
  8443. ids +=(element.id+',');
  8444. }
  8445. });
  8446. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8447. res => {
  8448. this.logining = false;
  8449. if (res.code == "ok") {
  8450. this.$message({
  8451. message:this.$t('message.Withdrawalsucceeded'),
  8452. type: "success"
  8453. });
  8454. this.getReportList();
  8455. if(e){this.getReport()}
  8456. this.getDepartment();
  8457. } else {
  8458. this.$message({
  8459. message: res.msg,
  8460. type: "error"
  8461. });
  8462. }
  8463. },
  8464. error => {
  8465. this.logining = false;
  8466. this.$message({
  8467. message: error,
  8468. type: "error"
  8469. });
  8470. });
  8471. },
  8472. showDenyDialog(id,i, item) {
  8473. this.denyReasonDialog = true;
  8474. this.isDenying = false;
  8475. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8476. var ids = item.id;
  8477. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8478. },
  8479. // 未通过日报
  8480. deny() {
  8481. this.logining = true;
  8482. this.isDenying = true;
  8483. this.http.post( this.port.report.deny, this.denyForm,
  8484. res => {
  8485. this.logining = false;
  8486. this.isDenying = false;
  8487. if (res.code == "ok") {
  8488. this.$message({
  8489. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8490. type: "success"
  8491. });
  8492. this.refreshReportData(this.denyForm.reportIds);
  8493. this.getDepartment();
  8494. this.denyReasonDialog = false;
  8495. } else {
  8496. this.$message({
  8497. message: res.msg,
  8498. type: "error"
  8499. });
  8500. }
  8501. },
  8502. error => {
  8503. this.logining = false;
  8504. this.$message({
  8505. message: error,
  8506. type: "error"
  8507. });
  8508. });
  8509. },
  8510. // 查看工时记录弹窗
  8511. toView() {
  8512. this.toViewDialogVisible = true
  8513. this.toViewloading = true
  8514. this.getToView()
  8515. },
  8516. getToView() {
  8517. this.http.post( '/report-import-log/getList', this.toViewForm,
  8518. res => {
  8519. this.toViewloading = false;
  8520. if (res.code == "ok") {
  8521. // console.log(res.data, '数据数据')
  8522. this.toViewList = res.data.records
  8523. this.toViewForm.total = res.data.total
  8524. } else {
  8525. this.toViewloading = false;
  8526. this.$message({
  8527. message: res.msg,
  8528. type: "error"
  8529. });
  8530. }
  8531. })
  8532. },
  8533. // 触发 selectCat 组件更改他的值
  8534. selectCatCli(obj) {
  8535. // console.log(obj, '看看')
  8536. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8537. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8538. },
  8539. vueCasader(obj) {
  8540. if(obj.distinction == 1 && obj.item) {
  8541. let arr = []
  8542. arr.push(obj.item.value)
  8543. this.exportParam.departmentId = arr
  8544. }
  8545. if(obj.distinction == '10' && obj) {
  8546. const { id, other } = obj
  8547. this.workForm.domains[other].reportTargetDeptId = id
  8548. }
  8549. if(obj.distinction == '14' && obj) {
  8550. let arr = []
  8551. arr.push(obj.id)
  8552. this.deptIdForHasReport = arr
  8553. this.showMonthWorkTime()
  8554. }
  8555. if(obj.distinction == '15' && obj) {
  8556. let arr = []
  8557. arr.push(obj.id)
  8558. this.deptIdForNoReport = arr
  8559. this.showMonthNotWorkTime()
  8560. }
  8561. if(obj.distinction == '16' && obj) {
  8562. let arr = []
  8563. arr.push(obj.id)
  8564. this.deptIdForReminder = arr
  8565. this.showMonthWorkTimeReminder()
  8566. }
  8567. if(obj.distinction == '17' && obj) {
  8568. let arr = []
  8569. arr.push(obj.id)
  8570. this.deptIdForHasReport = arr
  8571. this.showReportTimeLessThanCardTimeList();
  8572. }
  8573. },
  8574. //分页
  8575. handleCurrentChange(val) {
  8576. this.toViewForm.pageIndex = val;
  8577. this.getToView();
  8578. },
  8579. handleSizeChange(val) {
  8580. this.toViewForm.pageSize = val;
  8581. this.getToView();
  8582. },
  8583. getAllUsersList(){
  8584. this.http.post('/user/getSimpleActiveUserList',{
  8585. },res => {
  8586. if(res.code == 'ok'){
  8587. this.allUsersList = res.data
  8588. }else{
  8589. this.$message({
  8590. message: res.msg,
  8591. type: 'error'
  8592. })
  8593. }
  8594. },err => {
  8595. this.$message({
  8596. message: err,
  8597. type: 'error'
  8598. })
  8599. })
  8600. },
  8601. //景昱变更提醒
  8602. changeReminder(item){
  8603. let parameter={
  8604. startDate: this.WorktimeDatepickValue[0],
  8605. endDate: this.WorktimeDatepickValue[1],
  8606. }
  8607. if(item){
  8608. parameter.createDate=item.createDate,
  8609. parameter.userId=item.userId
  8610. }
  8611. this.http.post('/report/changeReminder',parameter,res => {
  8612. if(res.code == 'ok'){
  8613. this.$message({
  8614. message: res.msg,
  8615. type: 'success'
  8616. })
  8617. }else{
  8618. this.$message({
  8619. message: res.msg,
  8620. type: 'error'
  8621. })
  8622. }
  8623. },err => {
  8624. this.$message({
  8625. message: err,
  8626. type: 'error'
  8627. })
  8628. })
  8629. },
  8630. //景昱取消异常
  8631. cancelReminder(item){
  8632. let parameter={}
  8633. if(item){
  8634. parameter.createDate=item.createDate,
  8635. parameter.userId=item.userId
  8636. }
  8637. this.http.post('/report/cancelReminder',parameter,res => {
  8638. if(res.code == 'ok'){
  8639. this.$message({
  8640. message: res.msg,
  8641. type: 'success'
  8642. })
  8643. }else{
  8644. this.$message({
  8645. message: res.msg,
  8646. type: 'error'
  8647. })
  8648. }
  8649. },err => {
  8650. this.$message({
  8651. message: err,
  8652. type: 'error'
  8653. })
  8654. })
  8655. this.showMonthWorkTimeReminder()
  8656. },
  8657. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8658. fillWeekCustomClne() {
  8659. this.fillWeekDialogVisiCustom = false
  8660. },
  8661. fillWeekCustomClneTwo() {
  8662. this.fillWeekDialogVisiCustomTwo = false
  8663. },
  8664. fillWeekCustomSubmit() {
  8665. this.getReportList();
  8666. this.getDepartment();
  8667. this.getRecentlyProject()
  8668. },
  8669. // 待填日报姓名搜索
  8670. nameAearchSeek(flg) {
  8671. if(!this.nameAearch) {
  8672. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8673. return
  8674. }
  8675. if(flg) {
  8676. this.enterpriseWechatgetUser()
  8677. }
  8678. },
  8679. handleThreeData(userList) {
  8680. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8681. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8682. },
  8683. // 过滤树节点
  8684. filterTreeNodes(treeData, filterKeywords) {
  8685. return treeData.filter((node) => {
  8686. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8687. if (node.children && node.children.length > 0) {
  8688. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8689. }
  8690. return true;
  8691. }
  8692. if (node.children && node.children.length > 0) {
  8693. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8694. return node.children.length > 0;
  8695. }
  8696. return false;
  8697. });
  8698. },
  8699. // 企业微信获取人员
  8700. enterpriseWechatgetUser() {
  8701. this.deptMembDataLoading = true
  8702. this.http.post('/user/getEmployeeList',{
  8703. departmentId: -1,
  8704. pageIndex: 1,
  8705. pageSize: 100,
  8706. keyword: this.nameAearch,
  8707. status: '',
  8708. roleId: '',
  8709. cursor: '',
  8710. onlyDirect: '',
  8711. matchingType: ''
  8712. },res => {
  8713. if(res.code == 'ok'){
  8714. this.deptMembDataLoading = false
  8715. const userListName = res.data.records.map(item => item.name)
  8716. this.handleThreeData(userListName)
  8717. setTimeout(() => {
  8718. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8719. }, 200)
  8720. }else{
  8721. this.deptMembDataLoading = false
  8722. this.$message({
  8723. message: res.msg,
  8724. type: 'error'
  8725. })
  8726. }
  8727. },err => {
  8728. this.deptMembDataLoading = false
  8729. this.$message({
  8730. message: err,
  8731. type: 'error'
  8732. })
  8733. })
  8734. },
  8735. changeTreeNodeStatus(node) {
  8736. let allZt = true
  8737. node.expanded = allZt
  8738. for (let i = 0; i < node.childNodes.length; i++) {
  8739. node.childNodes[i].expanded = allZt
  8740. if (node.childNodes[i].childNodes.length > 0) {
  8741. this.changeTreeNodeStatus(node.childNodes[i])
  8742. }
  8743. }
  8744. },
  8745. // 按周填报获取相关任务
  8746. async getWeeklyTaskList(item) {
  8747. const { projectId, groupId, stage, taskId } = item
  8748. let parms = { projectId, isSubstitude: 0 }
  8749. groupId ? parms.groupId = groupId : ''
  8750. stage ? parms.stage = stage : ''
  8751. const { data } = await this.postData('/task/getRecentTask', parms)
  8752. this.zhoBao.taskId = taskId
  8753. this.$set(this.zhoBao, 'taskList', data)
  8754. },
  8755. // 封装 post 请求
  8756. postData(url, params) {
  8757. return new Promise((resolve, reject) => {
  8758. this.http.post(url, { ...params },
  8759. res => {
  8760. resolve(res)
  8761. },
  8762. error => {
  8763. this.$message({
  8764. message: error,
  8765. type: "error"
  8766. });
  8767. reject(error)
  8768. })
  8769. })
  8770. },
  8771. // 自定义事件
  8772. selectCal(obj) {
  8773. if(obj.distinction == '1') {
  8774. this.zhoBao.projectAuditorId = obj.id
  8775. } else if(obj.distinction == '2') {
  8776. this.zhoBao.auditorFirst = obj.id
  8777. } else if(obj.distinction == '3') {
  8778. this.zhoBao.auditorSec = obj.id
  8779. } else if(obj.distinction == '4') {
  8780. this.zhoBao.auditorThird = obj.id
  8781. } else if(obj.distinction == '5') {
  8782. this.zhoBao.ccUserid = obj.id
  8783. } else if(obj.distinction == '12') {
  8784. this.usersListId = obj.id
  8785. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8786. this.searchKeyword = obj.name
  8787. } else {
  8788. this.searchKeyword = ''
  8789. }
  8790. this.searchScreen(0)
  8791. } else if(obj.distinction == '13') {
  8792. this.usersListId = obj.id
  8793. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8794. this.searchKeyword = obj.name
  8795. } else {
  8796. this.searchKeyword = ''
  8797. }
  8798. this.searchScreen(1)
  8799. } else if(obj.distinction == '15') {
  8800. this.usersListId = obj.id
  8801. this.showReportTimeLessThanCardTimeList();
  8802. }
  8803. }
  8804. },
  8805. created() {
  8806. this.getUsers()
  8807. let height = window.innerHeight;
  8808. this.tableHeight = height - 178;
  8809. const that = this;
  8810. window.onresize = function temp() {
  8811. that.tableHeight = window.innerHeight - 178;
  8812. };
  8813. this.toViewForm.companyId = this.user.companyId
  8814. this.initDrag([{
  8815. type: "LR",
  8816. domClass: {
  8817. // 中间分割线的名字
  8818. resize: "line-line",
  8819. // 左侧盒子的名字
  8820. left: "box-left",
  8821. // 右侧盒子的名字
  8822. right: "box-right",
  8823. // 父级的名字
  8824. box: "box-father",
  8825. },
  8826. otherInfo: {
  8827. // 限制左边栏最低宽度
  8828. leftWidth: 120,
  8829. },
  8830. },
  8831. {
  8832. type: "LR",
  8833. domClass: {
  8834. // 中间分割线的名字
  8835. resize: "line-second",
  8836. // 左侧盒子的名字
  8837. left: "left-laowang",
  8838. // 右侧盒子的名字
  8839. right: "box-second-father",
  8840. // 父级的名字
  8841. box: "grand",
  8842. },
  8843. otherInfo: {
  8844. // 限制左边栏最低宽度
  8845. leftWidth: 120,
  8846. },
  8847. },
  8848. ]);
  8849. }
  8850. };
  8851. </script>
  8852. <style lang="scss" scoped>
  8853. @import "../../assets/scss/handle";
  8854. .themeFontColor {
  8855. @include font_color("color");
  8856. }
  8857. .fillWeekDialogVisiCustom {
  8858. width: 100%;
  8859. height: 70vh;
  8860. }
  8861. .fillWeekCustom {
  8862. .el-dialog__body {
  8863. padding: 20px 20px !important;
  8864. }
  8865. }
  8866. .photos {
  8867. position: relative;
  8868. display: flex;
  8869. flex-wrap: wrap;
  8870. }
  8871. .photos_img {
  8872. width: 120px;
  8873. height: 120px;
  8874. margin-right: 20px;
  8875. margin-bottom: 20px;
  8876. cursor: pointer;
  8877. img {
  8878. width: 100%;
  8879. height: 100%;
  8880. }
  8881. }
  8882. .paginatis {
  8883. padding: 10px 10px;
  8884. background: #f2f2f2;
  8885. }
  8886. .waiting {
  8887. color:orange;
  8888. }
  8889. .filledReportStyle {
  8890. color:#32CD32;
  8891. }
  8892. .RejectStyle {
  8893. color:red;
  8894. }
  8895. .waitSubmitStyle{
  8896. @include font_color("color");
  8897. }
  8898. .chooseDate {
  8899. .waiting {
  8900. @include font_color("color");
  8901. }
  8902. .filledReportStyle {
  8903. @include font_color("color");
  8904. }
  8905. .RejectStyle {
  8906. @include font_color("color");
  8907. }
  8908. .waitSubmitStyle{
  8909. @include font_color("color");
  8910. }
  8911. }
  8912. .allDaily {
  8913. width:100%;
  8914. }
  8915. .report_title {
  8916. padding:10px 0;
  8917. color:#666;
  8918. }
  8919. .clearfix {
  8920. overflow-x: auto;
  8921. white-space: nowrap;
  8922. padding: 15px 0 10px 0;
  8923. // overflow-y: hidden;
  8924. .date_item {
  8925. padding: 0 3px;
  8926. cursor: pointer;
  8927. position: relative;
  8928. }
  8929. .chooseDate {
  8930. position: absolute;
  8931. bottom: -3px;
  8932. width: 37px;
  8933. height: 2px;
  8934. left: 14px;
  8935. @include background_color("background_color");
  8936. }
  8937. }
  8938. .one_daily {
  8939. i {
  8940. @include font_color("color1");
  8941. margin-right: 5px;
  8942. }
  8943. .one_daily_body {
  8944. padding: 10px 0px;
  8945. p {
  8946. margin: 0;
  8947. line-height: 30px;
  8948. }
  8949. }
  8950. ul {
  8951. padding: 0;
  8952. }
  8953. }
  8954. .checkbtn {
  8955. float: right;
  8956. margin-top: -10px;
  8957. }
  8958. .selConStyle{
  8959. margin-top:9rem;
  8960. margin-bottom:11rem;
  8961. .selConStyle_title{
  8962. height: 3rem;
  8963. text-align: center;
  8964. font-size: 17px;
  8965. }
  8966. .el-select{
  8967. margin: 0 15%;
  8968. width: 70%;
  8969. }
  8970. }
  8971. </style>
  8972. <style lang="scss">
  8973. /*去除upload组件过渡效果*/
  8974. .photos .el-upload-list__item {
  8975. transition: none !important;
  8976. }
  8977. .daily {
  8978. .el-card__body {
  8979. height: 80%;
  8980. overflow-y: auto;
  8981. }
  8982. .el-card__header {
  8983. padding: 0 20px;
  8984. }
  8985. }
  8986. .membListClass{
  8987. .el-dialog__body{
  8988. padding-top: 10px;
  8989. }
  8990. }
  8991. // .editReportDialog .el-dialog__footer{
  8992. // position: sticky;
  8993. // bottom: 0;
  8994. // background: #fff;
  8995. // height: 70px;
  8996. // z-index: 1010;
  8997. // }
  8998. .editReportDialog{
  8999. min-width: 800px;
  9000. }
  9001. .touruxiangmu{
  9002. max-width: 1000px;
  9003. }
  9004. </style>
  9005. <style scoped>
  9006. /* 项目标签的样式 */
  9007. .el-tag + .el-tag {
  9008. margin-left: 10px;
  9009. }
  9010. .button-new-tag {
  9011. margin-left: 10px;
  9012. height: 32px;
  9013. line-height: 30px;
  9014. padding-top: 0;
  9015. padding-bottom: 0;
  9016. }
  9017. .input-new-tag {
  9018. width: 90px;
  9019. margin-left: 10px;
  9020. vertical-align: bottom;
  9021. }
  9022. .selectworktime .el-table__fixed-body-wrapper{
  9023. top: 48px !important;
  9024. }
  9025. .selectworktime_export .selectworktime_export_l{
  9026. width: 650px;
  9027. float: left;
  9028. height: 42px;
  9029. }
  9030. .approvalProcessBox{
  9031. margin-left: 30px;
  9032. font-size: 14px;
  9033. line-height: 16px;
  9034. cursor: pointer;
  9035. }
  9036. .approvalProcessBox i {
  9037. margin-right: 0;
  9038. height: 16px;
  9039. width: 16px;
  9040. display: inline-block;
  9041. transform: scale(1.2);
  9042. position: relative;
  9043. top: 0.5px;
  9044. @include font_color("color");
  9045. }
  9046. .approvalProcessBox .approvalProcessClick{
  9047. cursor: pointer;
  9048. @include font_color("color");
  9049. font-size: 14px;
  9050. }
  9051. .approvalProcessBox:hover .approvalProcessClick{
  9052. color: #3485fb;
  9053. }
  9054. </style>
  9055. <style lang="scss" scoped>
  9056. .bionicClass {
  9057. -webkit-appearance: none;
  9058. background-color: #FFF;
  9059. background-image: none;
  9060. border-radius: 4px;
  9061. border: 1px solid #DCDFE6;
  9062. box-sizing: border-box;
  9063. color: #606266;
  9064. display: inline-block;
  9065. height: 40px;
  9066. line-height: 40px;
  9067. outline: 0;
  9068. padding: 0 15px;
  9069. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9070. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9071. width: 350px;
  9072. cursor: pointer;
  9073. .bionicClassText {
  9074. color: #C0C4CC;
  9075. }
  9076. }
  9077. // 加班样式
  9078. .overtime {
  9079. display: inline-block;
  9080. margin-left: 20px;
  9081. input {
  9082. display: inline-block;
  9083. margin-top: 5px;
  9084. }
  9085. }
  9086. .plus {
  9087. display: inline-block;
  9088. }
  9089. // .tages {
  9090. // float: right;
  9091. // }
  9092. .overtime {
  9093. display: inline-block;
  9094. margin-left: 30px;
  9095. }
  9096. .bloks {
  9097. display: inline-block;
  9098. width: 380px;
  9099. }
  9100. .zhiss {
  9101. display: flex;
  9102. justify-content: space-around;
  9103. align-items: center;
  9104. }
  9105. .zhoFel {
  9106. display: flex;
  9107. justify-content: space-between;
  9108. align-items: center;
  9109. }
  9110. // 左右滑动样式
  9111. .line {
  9112. width: 30px;
  9113. /* height: 500px; */
  9114. background: #f2f2f2;
  9115. cursor: w-resize;
  9116. }
  9117. .box-father {
  9118. border: 8px solid #000;
  9119. }
  9120. .line-second {
  9121. width: 10px;
  9122. /* background: red; */
  9123. }
  9124. .flex {
  9125. display: flex;
  9126. width: 100%;
  9127. }
  9128. .box-left {
  9129. flex: 0 0 400px;
  9130. /* height: 600px; */
  9131. /* background: blue; */
  9132. }
  9133. .box-right {
  9134. /* height: 600px; */
  9135. /* background: green; */
  9136. flex: 1;
  9137. }
  9138. .box-postion {
  9139. width: 200px;
  9140. /* height: 400px; */
  9141. background: #ccc;
  9142. }
  9143. .custom-tree-node {
  9144. flex: 1;
  9145. display: flex;
  9146. align-items: center;
  9147. justify-content: space-between;
  9148. font-size: 14px;
  9149. padding-right: 8px;
  9150. }
  9151. .daitianrbao {
  9152. width: 100%;
  9153. box-sizing: border-box;
  9154. height: 40px;
  9155. border-radius: 4px;
  9156. border: 1px solid #DCDFE6;
  9157. overflow: hidden;
  9158. text-overflow: ellipsis;
  9159. display: flex;
  9160. // align-items: center;
  9161. }
  9162. .daitianrbao .spnn {
  9163. display: inline-block;
  9164. box-sizing: border-box;
  9165. padding: 0 15px;
  9166. overflow: hidden;
  9167. text-overflow: ellipsis;
  9168. }
  9169. .daitianrbao .hover {
  9170. color: #DCDFE6 !important;
  9171. }
  9172. </style>