daily.vue 444 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  252. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <!-- 简陋的无报告提示 -->
  327. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </el-card>
  334. </div>
  335. <!-- 工时推送日志弹窗 -->
  336. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  337. <template>
  338. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  339. </template>
  340. <template>
  341. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  342. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  343. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  344. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  345. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  346. <el-table-column prop="result" label="推送结果" width="250">
  347. <template slot-scope="scope">
  348. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  349. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  350. </template>
  351. </el-table-column>
  352. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  353. </el-table>
  354. </template>
  355. <span slot="footer" class="dialog-footer">
  356. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  357. </span>
  358. </el-dialog>
  359. <!-- 填写日报的dialog -->
  360. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  361. <div style="height: 65vh;overflow: auto;">
  362. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  363. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  364. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  365. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  366. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  367. <span class="spnn" v-if="workForm.userNames">
  368. <span v-for="(item, index) in workForm.userNames" :key="index">
  369. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  370. <span v-if="index < workForm.userNames.length - 1">,</span>
  371. </span>
  372. </span>
  373. <span class="spnn hover" v-else>
  374. {{$t('defaultText.pleaseSelectAsubstitute')}}
  375. </span>
  376. </div>
  377. </el-form-item>
  378. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  379. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  380. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  381. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  382. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  383. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  384. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  385. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  386. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  387. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  388. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  389. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  390. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  391. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  392. </span>
  393. <!--批量填报和批量代填不显示考勤记录-->
  394. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  395. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  396. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  397. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  398. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  399. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  400. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  401. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  402. @click="refreshAttendance(workForm.createDate)"></el-button>
  403. <!-- AI智能填报 -->
  404. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  405. </el-form-item>
  406. <!-- 000000 -->
  407. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  408. <div v-if="reportTimeType.multiWorktime==0">
  409. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  410. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  411. <el-select v-model="domain.timeType" style="width:200px;"
  412. v-if="reportTimeType.type == 0"
  413. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  414. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  415. @change="onTimeTypeChange(domain.timeType)">
  416. <el-option
  417. v-for="item in timeType"
  418. :key="item.value"
  419. :label="item.label"
  420. :value="item.value">
  421. </el-option>
  422. </el-select>
  423. <!-- 数字时长选择 -->
  424. <el-select v-model="domain.workingTime" style="width:200px;"
  425. v-if="reportTimeType.type == 1"
  426. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  427. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  428. @change="seleChn(0,domain)">
  429. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  430. </el-select>
  431. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  432. <span v-if="reportTimeType.type == 2">
  433. <!--时间范围选择 -->
  434. <el-time-picker
  435. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  436. v-model="domain.startTime"
  437. :placeholder="$t('time.startTime')"
  438. style="width:120px;"
  439. format="HH:mm"
  440. value-format="HH:mm"
  441. :picker-options="{
  442. start: '08:00',
  443. end: '23:30'
  444. }"
  445. @change="iptChang()">
  446. </el-time-picker> - <el-time-picker
  447. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  448. v-model="domain.endTime"
  449. :placeholder="$t('time.endTime')"
  450. style="width:120px;"
  451. format="HH:mm"
  452. value-format="HH:mm"
  453. :picker-options="{
  454. start: '08:00',
  455. end: '23:30',
  456. minTime: domain.startTime
  457. }"
  458. @change="iptChang()">
  459. </el-time-picker>
  460. </span>
  461. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  462. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  463. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  464. </div>
  465. </el-form-item>
  466. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  467. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  468. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  469. @change="selectProject(domain, index)"
  470. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  471. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  472. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  473. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  474. <span style="float: right;">{{ item.projectName }}</span>
  475. </el-option>
  476. </el-option-group>
  477. </el-select>
  478. <!--昱众不显示子项目-->
  479. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  480. <span style="margin-left:45px;">
  481. {{$t('lable.subproject')}}</span>
  482. <!--子项目 -->
  483. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  484. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  485. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  486. </el-select>
  487. </template>
  488. <template v-if="user.companyId == yuzhongCompId">
  489. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  490. <!--角色选择 -->
  491. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  492. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  493. <el-option
  494. v-for="item in roleList"
  495. :key="item.value"
  496. :label="item.label"
  497. :value="item.value">
  498. </el-option>
  499. </el-select>
  500. </template>
  501. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
  502. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  503. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  504. </el-link>
  505. <!-- <el-link type="primary" v-if="canEdit"
  506. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  507. </el-form-item>
  508. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  509. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  510. </el-form-item>
  511. <!--如果设置了工时成本预警的预算成本项-->
  512. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  513. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  514. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  515. </el-select>
  516. </el-form-item>
  517. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  518. <template slot="label">
  519. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  520. <span >{{$t('lable.taskGrouping')}}</span>
  521. </template>
  522. <!-- 任务分组 -->
  523. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  524. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  525. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  526. </el-select>
  527. <template v-if="user.companyId == yuzhongCompId">
  528. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  529. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  530. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  531. <el-option
  532. v-for="item in domain.filteredRespList"
  533. :key="item.id"
  534. :label="item.jobRespon"
  535. :value="item.id">
  536. </el-option>
  537. </el-select>
  538. </template>
  539. <template v-else><!-- 项目的阶段 -->
  540. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  541. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  542. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  543. @change="changeStages(domain, index)"
  544. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  545. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  546. </el-select>
  547. </template>
  548. </el-form-item>
  549. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  550. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  551. <template slot="label">
  552. <span style="color:#FF0000;">*</span>
  553. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  554. </template>
  555. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  556. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  557. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  558. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  559. </el-option>
  560. </el-select>
  561. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="domain.projectAuditorId ? true : false" :flgs="true" @selectCatCli="selectCatCli" :disabled="!domain.canEdit"></selectCat>
  562. </el-form-item>
  563. </div>
  564. <el-form-item v-if="user.companyId == yuzhongCompId">
  565. <template slot="label">
  566. <span style="color:#FF0000;">*</span>
  567. <span >工作内容</span>
  568. </template>
  569. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  570. :disabled="(workForm.domains[index].state>=2?false:true)" >
  571. <el-option
  572. v-for="item in domain.workContentList"
  573. :key="item.id"
  574. :label="item.workContext"
  575. :value="item.id">
  576. </el-option>
  577. </el-select>
  578. </el-form-item>
  579. <!-- 111111 -->
  580. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  581. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  582. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  583. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  584. <span v-else>{{item.name}}</span>
  585. </el-option>
  586. </el-select>
  587. <template v-if="user.timeType.auditLevel > 1">
  588. <i class="el-icon-right"></i>
  589. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  590. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  591. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  592. <span v-else>{{item.name}}</span>
  593. </el-option>
  594. </el-select>
  595. </template>
  596. <template v-if="user.timeType.auditLevel > 2">
  597. <i class="el-icon-right"></i>
  598. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  599. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  600. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  601. <span v-else>{{item.name}}</span>
  602. </el-option>
  603. </el-select>
  604. </template>
  605. </el-form-item>
  606. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  607. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  608. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  609. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  610. <span v-else>{{item.name}}</span>
  611. </el-option>
  612. </el-select>
  613. </el-form-item>
  614. <!-- 相关维度/自定义维度 -->
  615. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  616. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  617. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  618. </el-option>
  619. </el-select>
  620. </el-form-item>
  621. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  622. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  623. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  624. </el-option>
  625. </el-select>
  626. </el-form-item>
  627. <!-- 相关数值 -->
  628. <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  629. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  630. </el-form-item>
  631. <!-- 自定义文本 -->
  632. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  633. <el-input :disabled="!domain.canEdit" v-model="domain.customText" type="textarea" :rows="1" style="width:75%;margin-right:7%" maxlength="1000" show-word-limit></el-input>
  634. </el-form-item>
  635. <!--按比例填报-->
  636. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  637. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  638. <div style="width:400px;">
  639. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  640. <el-col :span="isBatch?6:10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span><span v-if="isBatch == 0">{{domain.workingTime}}{{$t('time.hour')}}</span></span></el-col>
  641. </div>
  642. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  643. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  644. </div>
  645. </el-form-item>
  646. <!--工程专业版本模式下, 各个专业的进度填报 -->
  647. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  648. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  649. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  650. <el-input size="mini" style="width:60px;" v-model="item.progress"
  651. @keyup.native="onProgressChange"
  652. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  653. </span>
  654. </el-form-item>
  655. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  656. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  657. <template slot="label" v-if="user.companyId == 3092">
  658. <span style="color:#FF0000;">*</span>
  659. <span >任务</span>
  660. </template>
  661. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  662. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  663. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  664. </el-select>
  665. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  666. </el-form-item>
  667. <!--针对依斯贝的SAP服务-->
  668. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  669. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  670. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  671. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  672. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  673. </el-select>
  674. </el-form-item>
  675. <!--工作事项-->
  676. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  677. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  678. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  679. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  680. </el-form-item>
  681. <!-- 拍照上传 -->
  682. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  683. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  684. <div class="photos">
  685. <div>
  686. <el-upload
  687. list-type="picture-card"
  688. :http-request="(file) => {return addImg(file, index)}"
  689. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  690. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  691. :file-list="domain.imgListUrl" :limit="9"
  692. :disabled="workForm.domains[index].state>=2?false:true">
  693. <i class="el-icon-plus"></i>
  694. </el-upload>
  695. </div>
  696. </div>
  697. </el-form-item>
  698. </div>
  699. <!--多个工作事项填报的情况 -->
  700. <div v-if="reportTimeType.multiWorktime==1">
  701. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  702. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  703. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  704. @change="selectProject(domain, index)"
  705. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  706. <!-- <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  707. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  708. <span style="float: right;">{{ item.projectName }}</span>
  709. </el-option> -->
  710. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  711. <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
  712. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  713. <span style="float: right;">{{ item.projectName }}</span>
  714. </el-option>
  715. </el-option-group>
  716. </el-select>
  717. <template v-if="user.timeType.mainProjectState != 1">
  718. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  719. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  720. <!--子项目 -->
  721. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  722. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  723. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  724. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  725. </el-select>
  726. </template>
  727. <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  728. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  729. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  730. </el-link>
  731. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  732. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  733. </div>
  734. <!-- <el-link type="primary" v-if="canEdit"
  735. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  736. </el-form-item>
  737. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  738. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  739. </el-form-item>
  740. <!--如果设置了工时成本预警的预算成本项-->
  741. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  742. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  743. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  744. </el-select>
  745. </el-form-item>
  746. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  747. <!-- 任务分组 -->
  748. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  749. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  750. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  751. </el-select>
  752. <!-- 项目的阶段 -->
  753. <span v-if="domain.stages != null && domain.stages.length> 0"
  754. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  755. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  756. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  757. @change="changeStages(domain, index)"
  758. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  759. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  760. </el-select>
  761. </el-form-item>
  762. <el-form-item :label="$t('other.projectAuditor')" >
  763. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  764. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  765. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  766. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  767. </el-option>
  768. </el-select>
  769. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" :flgs="true" @selectCatCli="selectCatCli"></selectCat>
  770. </el-form-item>
  771. <!--工程专业版本模式下, 各个专业的进度填报 -->
  772. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  773. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  774. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  775. <el-input size="mini" style="width:60px;" v-model="item.progress"
  776. @keyup.native="onProgressChange"
  777. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  778. </span>
  779. </el-form-item>
  780. <!-- 相关维度 -->
  781. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  782. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  783. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  784. </el-option>
  785. </el-select>
  786. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  787. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  788. </el-option>
  789. </el-select>
  790. </el-form-item>
  791. <!-- 相关数值 -->
  792. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  793. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  794. </el-form-item>
  795. <!-- 自定义文本 -->
  796. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  797. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  798. </el-form-item>
  799. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  800. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  801. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  802. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  803. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  804. </el-select>
  805. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  806. </el-form-item>
  807. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  808. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  809. <i v-if="tIndex>0&&workForm.domains[index].state>=2" @click="removeTimeItem(domain,tIndex)" class="el-icon-delete" style="position:absolute;right:-7px;top:-7px;font-size:16px;"></i>
  810. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  811. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  812. <span v-if="reportTimeType.type == 2">
  813. <!-- <span> -->
  814. <!--时间范围选择 -->
  815. <el-time-picker
  816. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  817. v-model="timeItem.startTime"
  818. :placeholder="$t('time.startTime')"
  819. style="width:120px;"
  820. format="HH:mm"
  821. value-format="HH:mm"
  822. :picker-options="{
  823. start: '00:00',
  824. end: '23:59',
  825. }"
  826. @change="iptChangs()">
  827. </el-time-picker> - <el-time-picker
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  829. v-model="timeItem.endTime"
  830. :placeholder="$t('time.endTime')"
  831. style="width:120px;"
  832. format="HH:mm"
  833. value-format="HH:mm"
  834. :picker-options="{
  835. start: '00:00',
  836. end: '23:59',
  837. minTime: timeItem.startTime
  838. }"
  839. @change="iptChangs()">
  840. </el-time-picker>
  841. </span>
  842. </el-form-item>
  843. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  844. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  845. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  846. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  847. ></el-input>
  848. </el-form-item>
  849. </div>
  850. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  851. </div>
  852. <!--照片的显示 -->
  853. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  854. <el-image v-for="(pic, index) in domain.pics" :key="index"
  855. style="width: 100px; height: 100px; margin-right:10px;"
  856. :src="pic"
  857. :preview-src-list="domain.pics">
  858. </el-image>
  859. </p>
  860. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  861. </div>
  862. <span id="workFormsItemBottom"></span>
  863. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  864. </el-form>
  865. </div>
  866. <span slot="footer" class="dialog-footer">
  867. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  868. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  869. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  870. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  871. <el-button v-if="!isSubstitude && !isBatch" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  872. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  873. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  874. </span>
  875. </el-dialog>
  876. <!-- 按周填报 -->
  877. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  878. <!-- 按周填报-已填工时-点击 -->
  879. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  880. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  881. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  882. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  883. <el-table-column prop="state" :label="$t('state.states')">
  884. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  885. </el-table-column>
  886. <!-- <el-table-column label="操作">
  887. <template slot-scope="scope">
  888. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  889. </template>
  890. </el-table-column> -->
  891. </el-table>
  892. <span slot="footer" class="dialog-footer">
  893. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  894. </span>
  895. </el-dialog>
  896. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  897. <el-form-item style="height:30px;margin-top:-72px;">
  898. <!-- <el-date-picker v-model="weekDateRange" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initWeekFormData()" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" style="margin-right: 18px" :clearable="false"></el-date-picker> -->
  899. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  900. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  901. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  902. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  903. <el-select v-model="selCon" size="small" multiple :placeholder="$t('defaultText.pleaseChoose')" @change="onSelProjectChange()" filterable style="margin-right:50px;float:right;width:50%;" collapse-tags>
  904. <el-option
  905. v-for="item in fillProjectList"
  906. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  907. :key="item.id"
  908. :label="item.projectName + '\u3000' + item.projectCode"
  909. :value="item.id">
  910. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  911. <span style="float: right">{{ item.projectName }}</span>
  912. </el-option>
  913. </el-select>
  914. <span style="float:right;margin-right:10px;">选择项目</span>
  915. </el-form-item>
  916. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  917. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  918. <template slot-scope="scope">
  919. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  920. </template>
  921. </el-table-column>
  922. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  923. <template slot-scope="scope">
  924. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  925. <p v-else></p>
  926. </template>
  927. </el-table-column> -->
  928. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  929. <template slot-scope="scope">
  930. <div v-if="scope.row.canFill == 1">
  931. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  932. <el-button v-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 3 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  933. <el-button v-else-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 1 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  934. <el-button v-else-if="scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+workReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  935. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  936. </div>
  937. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  938. <el-button v-if="scope.row[item.projectName] != null && scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}<span v-if="scope.row[item.projectName].state != 3" :class="statusStyle[scope.row[item.projectName].state]">({{scope.row[item.projectName].workingTime+'h-'+hworkReportStateString[scope.row[item.projectName].state]}})</span></el-button>
  939. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  940. </div>
  941. </div>
  942. <div v-else >
  943. <span style="color:#999999;">不可超前填报</span>
  944. </div>
  945. </template>
  946. </el-table-column>
  947. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  948. <template slot-scope="scope">
  949. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  950. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  951. </template>
  952. </el-table-column>
  953. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  954. <template slot-scope="scope">
  955. <div class="zhiss">
  956. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  957. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  958. </div>
  959. </template>
  960. </el-table-column>
  961. </el-table>
  962. </el-form>
  963. <span slot="footer" class="dialog-footer" >
  964. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  965. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  966. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  967. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  968. </span>
  969. </el-dialog>
  970. <!-- 重庆物奇私人定制的按周填报 -->
  971. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  972. <div class="fillWeekDialogVisiCustom">
  973. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  974. </div>
  975. </el-dialog>
  976. <!-- 选择时间 -->
  977. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  978. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  979. <span slot="footer" class="dialog-footer">
  980. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  981. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  982. </span>
  983. </el-dialog>
  984. <!-- 按周填报弹窗 -->
  985. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  986. <div>
  987. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  988. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  989. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  990. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  991. </el-select>
  992. </div>
  993. <!--如果设置了工时成本预警的预算成本项-->
  994. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  995. <p>{{$t('lable.budgetSource')}}</p>
  996. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  997. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  998. </el-select>
  999. </div>
  1000. <!-- 任务分组 -->
  1001. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1002. <p>{{$t('lable.taskGrouping')}}</p>
  1003. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1004. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1005. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1006. </el-select>
  1007. </div>
  1008. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  1009. <p>{{$t('other.inputStage')}}</p>
  1010. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1011. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1012. </el-select>
  1013. </div>
  1014. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1015. <p>{{$t('other.reviewer')}}</p>
  1016. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1017. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1018. </el-select>
  1019. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1020. </div>
  1021. <template v-if="user.timeType.reportAuditType == 3">
  1022. <div class="zhoFel">
  1023. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1024. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1025. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1026. </el-select>
  1027. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1028. </div>
  1029. <div class="zhoFel">
  1030. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1031. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1032. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. <div class="zhoFel">
  1037. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1038. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1039. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1040. </el-select>
  1041. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1042. </div>
  1043. <div class="zhoFel">
  1044. <p>{{ $t('chao-song-ren') }}</p>
  1045. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1046. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1047. </el-select>
  1048. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1049. </div>
  1050. </template>
  1051. <!-- 自定义维度 -->
  1052. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1053. <p>{{user.timeType.customDegreeName}}</p>
  1054. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1055. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1056. </el-select>
  1057. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1058. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1059. </el-select>
  1060. </div>
  1061. <!-- 自定义数值 -->
  1062. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1063. <p>{{user.timeType.customDataName}}</p>
  1064. <el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  1065. </div>
  1066. <!-- 自定义文本 -->
  1067. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1068. <p>{{user.timeType.customTextName}}</p>
  1069. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1070. </div>
  1071. <!-- 选择任务 -->
  1072. <div class="zhoFel" v-if="user.company.packageProject==1 && user.company.nonProjectSimple==0">
  1073. <p>任务 / 里程碑</p>
  1074. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1075. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1076. </el-select>
  1077. </div>
  1078. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1079. <p>{{$t('other.timeSelection')}}</p>
  1080. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" @change="$forceUpdate()" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  1081. </div>
  1082. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1083. <p>{{$t('other.chooseDuration')}}</p>
  1084. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1085. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1086. </el-select>
  1087. </div>
  1088. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1089. <p>{{$t('lable.percentageOfTime')}}</p>
  1090. <div style="width:400px;display: flex;align-items: center;">
  1091. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1092. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}{{$t('time.hour')}}</span></el-col>
  1093. </div>
  1094. </div>
  1095. <div class="zhoFel">
  1096. <p>{{$t('other.workMatters')}}</p>
  1097. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1098. </div>
  1099. </div>
  1100. <span slot="footer" class="dialog-footer">
  1101. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1102. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1103. </span>
  1104. </el-dialog>
  1105. <!--导出报表条件选择 -->
  1106. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1107. <el-form ref="form3" :model="exportParam" >
  1108. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1109. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1110. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1111. </el-select>
  1112. </el-form-item>
  1113. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1114. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1115. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1116. </el-form-item>
  1117. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1118. <el-date-picker
  1119. v-model="exportParam.dateRange" :editable="false"
  1120. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1121. :range-separator="$t('other.to')"
  1122. type="daterange"
  1123. :start-placeholder="$t('time.startDate')"
  1124. :end-placeholder="$t('time.endDate')"
  1125. ></el-date-picker>
  1126. </el-form-item>
  1127. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1128. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1129. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1130. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1131. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1132. </el-select>
  1133. </el-form-item>
  1134. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1135. <div class="exportReportRadio">
  1136. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1137. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1138. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1139. <i class="el-icon-question"></i>
  1140. </el-tooltip>
  1141. </div>
  1142. </el-form-item>
  1143. </el-form>
  1144. <div slot="footer" class="dialog-footer">
  1145. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1146. </div>
  1147. </el-dialog>
  1148. <!--导出报表条件选择 -->
  1149. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1150. <el-form ref="form3" :model="exportParam" >
  1151. <el-form-item prop="range" :label="$t('time.dateRange')">
  1152. <el-date-picker
  1153. v-model="exportParam.dateRange" :editable="false"
  1154. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1155. :clearable="true"
  1156. :range-separator="$t('other.to')"
  1157. type="daterange"
  1158. :start-placeholder="$t('time.startDate')"
  1159. :end-placeholder="$t('time.endDate')"
  1160. ></el-date-picker>
  1161. </el-form-item>
  1162. </el-form>
  1163. <div slot="footer" class="dialog-footer">
  1164. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1165. </div>
  1166. </el-dialog>
  1167. <!--人员列表 -->
  1168. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1169. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1170. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1171. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1172. <el-table-column type="selection"></el-table-column>
  1173. <el-table-column prop="label" :label="$t('lable.name')" >
  1174. <template slot-scope="scope">
  1175. <span>
  1176. <!-- {{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}} -->
  1177. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1178. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1179. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1180. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1181. </span>
  1182. <span v-else>
  1183. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1184. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1185. </span>
  1186. </span>
  1187. </template>
  1188. </el-table-column>
  1189. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1190. <template slot-scope="scope">
  1191. <div>
  1192. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1193. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1194. </div>
  1195. </template>
  1196. </el-table-column>
  1197. </el-table>
  1198. </el-tab-pane>
  1199. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1200. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1201. <el-table-column prop="label" :label="$t('lable.name')" >
  1202. <template slot-scope="scope">
  1203. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天 - ' + leaveTypeName[scope.row.leaveType] + ')' : '(请假' + scope.row.leaveTimes + 'h - ' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1204. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  1205. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1206. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1208. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1209. </span>
  1210. <span v-else>
  1211. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1212. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1213. </span>
  1214. </template>
  1215. </el-table-column>
  1216. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1217. <template slot-scope="scope">
  1218. <div>
  1219. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1220. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1221. </div>
  1222. </template>
  1223. </el-table-column>
  1224. </el-table>
  1225. </el-tab-pane>
  1226. </el-tabs>
  1227. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1228. <el-table-column type="selection"></el-table-column>
  1229. <el-table-column prop="label" :label="$t('lable.name')" >
  1230. <template slot-scope="scope">
  1231. <div>
  1232. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1233. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1234. </div>
  1235. </template>
  1236. </el-table-column>
  1237. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1238. <template slot-scope="scope">
  1239. <div>
  1240. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1241. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1242. </div>
  1243. </template>
  1244. </el-table-column>
  1245. </el-table>
  1246. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1247. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1248. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1249. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1250. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1251. </div>
  1252. </el-dialog>
  1253. <!-- 按部门选择人员 -->
  1254. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1255. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1256. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1257. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1258. </el-input>
  1259. <div class="tree" style="height:400px">
  1260. <el-scrollbar style="height:100%">
  1261. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1262. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1263. highlight-current :filter-node-method="filterNode">
  1264. <span class="custom-tree-node" slot-scope="{ node }">
  1265. <span v-if="user.userNameNeedTranslate == '1'">
  1266. <span v-if="node.data.children">
  1267. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1268. </span>
  1269. <span v-else>
  1270. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1271. </span>
  1272. </span>
  1273. <span v-if="user.userNameNeedTranslate != '1'">
  1274. {{ node.label }}
  1275. </span>
  1276. <!-- {{ node.label }} -->
  1277. </span>
  1278. </el-tree>
  1279. </el-scrollbar>
  1280. </div>
  1281. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1282. <div slot="footer" class="dialog-footer">
  1283. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1284. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1285. </div>
  1286. </el-dialog>
  1287. <el-dialog
  1288. v-if="monthWorkTimeDialog"
  1289. :visible.sync="monthWorkTimeDialog"
  1290. :close-on-click-modal="false"
  1291. customClass="customWidth selectworktime"
  1292. width="1200px"
  1293. title=""
  1294. >
  1295. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1296. <el-tabs v-model="activeName" @tab-click="handleClick">
  1297. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1298. <div class="selectworktime_export" style="margin-top:10px;">
  1299. <div class="selectworktime_export_l">
  1300. <el-date-picker
  1301. class="selecteworktime_datapick"
  1302. v-model="WorktimeDatepickValue"
  1303. value-format="yyyy-MM-dd"
  1304. type="daterange"
  1305. align="right"
  1306. unlink-panels
  1307. :range-separator="$t('other.to')"
  1308. :start-placeholder="$t('time.startDate')"
  1309. :end-placeholder="$t('time.endDate')"
  1310. :default-time="['12:00:00', '12:00:00']"
  1311. size="small"
  1312. popper-class="selecteorktime_datapick_popper"
  1313. @change="showMonthWorkTime()"
  1314. >
  1315. </el-date-picker>
  1316. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1317. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1318. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1319. <!-- 222 -->
  1320. </div>
  1321. <div>
  1322. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1323. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1324. </el-input>
  1325. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1326. </div>
  1327. <el-link
  1328. type="primary"
  1329. style="float: right; vertical-align: middle;height:32px"
  1330. @click="exportMembWorkHours()"
  1331. >{{$t('export.exportData')}}</el-link
  1332. >
  1333. </div>
  1334. <el-table ref="hasworkTbl"
  1335. :data="monthWorkDataS"
  1336. v-el-table-infinite-scroll="listScroll"
  1337. border
  1338. :height="500"
  1339. highlight-current-row
  1340. style="width: 100%"
  1341. v-loading="tbload"
  1342. :lazy="true"
  1343. >
  1344. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1345. <template slot-scope="scope">
  1346. {{ scope.$index + 1 }}
  1347. </template>
  1348. </el-table-column>
  1349. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1350. <template slot-scope="scope">
  1351. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1352. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1353. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1354. <!-- {{scope.row.name}} -->
  1355. </span>
  1356. </template>
  1357. </el-table-column>
  1358. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1359. <template slot-scope="scope">
  1360. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1361. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1362. </template>
  1363. </el-table-column>
  1364. <el-table-column
  1365. min-width="105"
  1366. v-for="(item, index) in pickDateArray"
  1367. :key="index"
  1368. :label="item.label"
  1369. align="center"
  1370. >
  1371. <template slot-scope="scope">
  1372. <div
  1373. style="color: red"
  1374. v-if="
  1375. scope.row.worktimeList.filter(
  1376. (w) =>
  1377. w.createDate==item.date
  1378. ).length > 0 &&
  1379. scope.row.worktimeList.filter(
  1380. (w) =>w.createDate==item.date
  1381. )[0].workingTime < reportTimeType.allday
  1382. "
  1383. >
  1384. {{
  1385. scope.row.worktimeList.filter(
  1386. (w) =>w.createDate==item.date
  1387. )[0].workingTime.toFixed(1)
  1388. }}
  1389. </div>
  1390. <div
  1391. style="color: #20a0ff"
  1392. v-if="
  1393. scope.row.worktimeList.filter(
  1394. (w) =>w.createDate==item.date
  1395. ).length > 0 &&
  1396. scope.row.worktimeList.filter(
  1397. (w) =>w.createDate==item.date
  1398. )[0].workingTime > reportTimeType.allday
  1399. "
  1400. >
  1401. {{
  1402. scope.row.worktimeList.filter(
  1403. (w) =>w.createDate==item.date
  1404. )[0].workingTime.toFixed(1)
  1405. }}
  1406. </div>
  1407. <div
  1408. v-if="
  1409. scope.row.worktimeList.filter(
  1410. (w) =>w.createDate==item.date
  1411. ).length > 0 &&
  1412. scope.row.worktimeList.filter(
  1413. (w) =>w.createDate==item.date
  1414. )[0].workingTime == reportTimeType.allday
  1415. "
  1416. >
  1417. {{
  1418. scope.row.worktimeList.filter(
  1419. (w) =>w.createDate==item.date
  1420. )[0].workingTime
  1421. }}
  1422. </div>
  1423. <div
  1424. v-if="
  1425. scope.row.worktimeList.filter(
  1426. (w) =>w.createDate==item.date
  1427. ).length == 0
  1428. "
  1429. >
  1430. 0
  1431. </div>
  1432. <div
  1433. v-if="
  1434. scope.row.worktimeList.filter(
  1435. (w) =>w.createDate==item.date
  1436. ).length > 0 &&
  1437. typeof scope.row.worktimeList.filter(
  1438. (w) =>w.createDate==item.date
  1439. )[0].workingTime == 'string'
  1440. "
  1441. >
  1442. {{
  1443. scope.row.worktimeList.filter(
  1444. (w) =>w.createDate==item.date
  1445. )[0].workingTime
  1446. }}
  1447. </div>
  1448. </template>
  1449. </el-table-column>
  1450. </el-table>
  1451. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1452. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1453. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1454. <label style="font-size: 16px">员工每日已填报工时数</label>
  1455. <el-link
  1456. type="primary"
  1457. style="float: right; margin-right: 60px"
  1458. @click="exportMembWorkHours()"
  1459. >导出已填报数据</el-link
  1460. > -->
  1461. <!-- <el-button >导出</el-button> -->
  1462. <!-- </div> -->
  1463. </el-tab-pane>
  1464. <el-tab-pane label="未提交人员列表" name="second" >
  1465. <div class="selectworktime_export" style="margin-top:10px">
  1466. <div class="selectworktime_export_l">
  1467. <el-date-picker
  1468. class="selecteworktime_datapick"
  1469. v-model="WorktimeDatepickValue"
  1470. value-format="yyyy-MM-dd"
  1471. type="daterange"
  1472. align="right"
  1473. unlink-panels
  1474. :range-separator="$t('other.to')"
  1475. :start-placeholder="$t('time.startDate')"
  1476. :end-placeholder="$t('time.endDate')"
  1477. :default-time="['12:00:00', '12:00:00']"
  1478. size="small"
  1479. popper-class="selecteorktime_datapick_popper"
  1480. @change="showMonthNotWorkTime()"
  1481. >
  1482. </el-date-picker>
  1483. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1484. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1485. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1486. </div>
  1487. <div>
  1488. <div style="margin-top:10px;">
  1489. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1490. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1491. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1492. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1493. </el-input>
  1494. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1495. <el-link
  1496. type="primary"
  1497. style="float: right; vertical-align: middle;height:32px"
  1498. @click="exportMembNotWorkHours()"
  1499. >{{$t('export.exportData')}}</el-link
  1500. >
  1501. </div>
  1502. </div>
  1503. </div>
  1504. <el-table
  1505. ref="hasworkTbl2"
  1506. :data="monthNotWorkDateS"
  1507. v-el-table-infinite-scroll="notListScroll"
  1508. border
  1509. :height="500"
  1510. highlight-current-row
  1511. style="width: 100%"
  1512. v-loading="tbload"
  1513. lazy
  1514. >
  1515. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1516. <template slot-scope="scope">
  1517. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1518. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1519. </template>
  1520. </el-table-column>
  1521. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1522. <template slot-scope="scope">
  1523. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1524. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1525. </template>
  1526. </el-table-column>
  1527. <el-table-column
  1528. min-width="200"
  1529. :label="$t('weekDay.date')"
  1530. align="center"
  1531. prop="createDate"
  1532. >
  1533. </el-table-column>
  1534. <el-table-column
  1535. min-width="200"
  1536. :label="$t('state.states')"
  1537. align="center"
  1538. prop="status"
  1539. />
  1540. <el-table-column
  1541. min-width="200"
  1542. :label="$t('other.attendanceData')"
  1543. prop="cardTime"
  1544. align="center"
  1545. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1546. </el-table>
  1547. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1548. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1549. </el-tab-pane>
  1550. </el-tabs>
  1551. </el-dialog>
  1552. <!--驳回弹出框 -->
  1553. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1554. <div>
  1555. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
  1556. </div>
  1557. <div slot="footer" class="dialog-footer">
  1558. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1559. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1560. </div>
  1561. </el-dialog>
  1562. <!-- 通过弹出框 -->
  1563. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1564. <div>
  1565. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1566. </div>
  1567. <div slot="footer" class="dialog-footer">
  1568. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1569. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1570. </div>
  1571. </el-dialog>
  1572. <!--批量导入日报 -->
  1573. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1574. <p>1. {{$t('other.download')}}
  1575. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1576. </p>
  1577. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1578. <p style="display: flex;justify-content: center;">
  1579. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1580. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1581. </el-upload>
  1582. </p>
  1583. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1584. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1585. </div>
  1586. </el-dialog>
  1587. <!-- 工时导入记录弹窗 -->
  1588. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1589. <div style="height: 452px">
  1590. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1591. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1592. <el-table-column prop="userName" :label="$t('other.operator')">
  1593. <template slot-scope="scope">
  1594. <div>
  1595. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1596. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1597. </div>
  1598. </template>
  1599. </el-table-column>
  1600. <el-table-column prop="datel" :label="$t('other.document')">
  1601. <template slot-scope="scope">
  1602. <div>
  1603. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1604. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1605. </div>
  1606. </template>
  1607. </el-table-column>
  1608. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1609. <template slot-scope="scope">
  1610. <div>
  1611. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1612. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1613. </div>
  1614. </template>
  1615. </el-table-column>
  1616. </el-table>
  1617. <el-col :span="24" class="paginatis">
  1618. <el-pagination
  1619. @size-change="handleSizeChange"
  1620. @current-change="handleCurrentChange"
  1621. :page-sizes="[20 , 50 , 80 , 100]"
  1622. :page-size="20"
  1623. layout="total, sizes, prev, pager, next"
  1624. :total="toViewForm.total"
  1625. style="float:right;"
  1626. ></el-pagination>
  1627. </el-col>
  1628. </div>
  1629. </el-dialog>
  1630. <!--基于企业微信考勤数据的工时导入 -->
  1631. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1632. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1633. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1634. </el-step>
  1635. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1636. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1637. </el-steps>
  1638. <div v-if="active==0" style="padding:30px;height:360px;">
  1639. <div style="margin-top:50px;margin-left:280px;">
  1640. <el-date-picker
  1641. v-model="importWxParam.date" :editable="false"
  1642. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1643. :clearable="true"
  1644. :range-separator="$t('other.to')"
  1645. type="daterange"
  1646. :start-placeholder="$t('time.startDate')"
  1647. :end-placeholder="$t('time.endDate')"
  1648. @change="loadCheckInData"
  1649. ></el-date-picker>
  1650. </div>
  1651. </div>
  1652. <div v-if="active==1" style="padding:10px;">
  1653. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1654. style="width: 100%;margin-top:5px;" >
  1655. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1656. <template slot-scope="scope">
  1657. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1658. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1659. </template>
  1660. </el-table-column>
  1661. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1662. </el-table-column>
  1663. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1664. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1665. <template slot-scope="scope">
  1666. <div>
  1667. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1668. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1669. </div>
  1670. </template>
  1671. </el-table-column>
  1672. <el-table-column prop="departmentName" label="部门" >
  1673. <template slot-scope="scope">
  1674. <div>
  1675. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1676. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1677. </div>
  1678. </template>
  1679. </el-table-column>
  1680. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1681. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1682. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1683. <template slot-scope="scope">
  1684. {{scope.row.workHours.toFixed(1)}}h
  1685. </template>
  1686. </el-table-column>
  1687. </el-table>
  1688. </div>
  1689. <div v-if="active==2" >
  1690. <p style="display: flex;justify-content: center;height:390px;">
  1691. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1692. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1693. </el-upload>
  1694. </p>
  1695. </div>
  1696. <div slot="title">
  1697. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1698. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1699. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1700. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1701. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1702. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1703. </div>
  1704. <span slot="footer">
  1705. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1706. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1707. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1708. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1709. </span>
  1710. </el-dialog>
  1711. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1712. <p style="display: flex;justify-content: center;height:100px;">
  1713. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1714. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1715. </el-upload>
  1716. </p>
  1717. </el-dialog>
  1718. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1719. <div>
  1720. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1721. v-model="deleteReportParam.date" :editable="false"
  1722. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1723. :clearable="true"
  1724. :range-separator="$t('other.to')"
  1725. type="daterange"
  1726. :start-placeholder="$t('time.startDate')"
  1727. :end-placeholder="$t('time.endDate')"
  1728. ></el-date-picker>
  1729. </div>
  1730. <div style="margin-top:10px;">
  1731. <span>请选择部门:</span>
  1732. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1733. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1734. </div>
  1735. <div style="margin-top:10px;">
  1736. <span>请选择员工:</span>
  1737. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1738. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1739. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1740. <span v-else>{{item.name}}</span>
  1741. </el-option>
  1742. </el-select>
  1743. </div>
  1744. <span slot="footer">
  1745. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1746. </span>
  1747. </el-dialog>
  1748. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1749. <div>
  1750. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1751. v-model="deleteReportParam.date" :editable="false"
  1752. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1753. :clearable="true"
  1754. :range-separator="$t('other.to')"
  1755. type="daterange"
  1756. :start-placeholder="$t('time.startDate')"
  1757. :end-placeholder="$t('time.endDate')"
  1758. ></el-date-picker>
  1759. </div>
  1760. <div style="margin-top:15px;">
  1761. <span>选择部门:</span>
  1762. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1763. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1764. size="small" v-if="user.userNameNeedTranslate != 1"
  1765. ></el-cascader>
  1766. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1767. </div>
  1768. <span slot="footer">
  1769. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1770. </span>
  1771. </el-dialog>
  1772. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1773. <div>
  1774. <span>选择时间:</span><el-date-picker
  1775. v-model="modImportTime"
  1776. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1777. :clearable="true"
  1778. type="datetime"
  1779. ></el-date-picker>
  1780. <span>选择导入人员:</span><el-select
  1781. v-model="modImportUserId"
  1782. >
  1783. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1784. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1785. <span v-else>{{item.name}}</span>
  1786. </el-option>
  1787. </el-select>
  1788. </div>
  1789. <span slot="footer">
  1790. <el-button @click="confirmChangeModTime" >确认</el-button>
  1791. </span>
  1792. </el-dialog>
  1793. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1794. <div>
  1795. <span>请选择年月:</span>
  1796. <el-date-picker
  1797. v-model="ratioYmonth" :editable="false"
  1798. format="yyyyMM" value-format="yyyyMM"
  1799. type="month"
  1800. ></el-date-picker>
  1801. </div>
  1802. <span slot="footer">
  1803. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1804. </span>
  1805. </el-dialog>
  1806. <!--工时批量代填 -->
  1807. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1808. <div>
  1809. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1810. v-model="importWxParam.date" :editable="false"
  1811. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1812. :clearable="true"
  1813. :range-separator="$t('other.to')"
  1814. type="daterange"
  1815. :start-placeholder="$t('time.startDate')"
  1816. :end-placeholder="$t('time.endDate')"
  1817. @change="loadCheckInData"
  1818. ></el-date-picker>
  1819. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1820. </div>
  1821. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1822. :key="timeStamp"
  1823. style="width: 100%;margin-top:5px;" ref="tab">
  1824. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1825. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1826. <template slot-scope="scope">
  1827. <div>
  1828. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1829. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1830. </div>
  1831. </template>
  1832. </el-table-column>
  1833. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1834. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1835. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1836. <template slot-scope="scope">
  1837. {{scope.row.workHours.toFixed(1)}}h
  1838. </template>
  1839. </el-table-column>
  1840. <!--项目名称列表 -->
  1841. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1842. <template slot-scope="scope">
  1843. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1844. </template>
  1845. </el-table-column>
  1846. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1847. <template slot-scope="scope">
  1848. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1849. </template>
  1850. </el-table-column>
  1851. </el-table>
  1852. </el-dialog>
  1853. <!--基于企业微信考勤数据的工时导入 -->
  1854. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1855. <div style="padding-bottom:10px;">
  1856. <p>{{importResultMsg}}</p>
  1857. </div>
  1858. <!-- <span slot="footer" class="dialog-footer">
  1859. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1860. </span> -->
  1861. </el-dialog>
  1862. <!-- 审核流程展示 -->
  1863. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1864. <div style="padding:20px 40px 20px 0">
  1865. <el-timeline :reverse="false">
  1866. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1867. <!-- {{item.msg}} -->
  1868. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1869. <span v-if="user.userNameNeedTranslate == 1">
  1870. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1871. <span>{{item.msgCon.two}}</span>
  1872. </span>
  1873. </el-timeline-item>
  1874. </el-timeline>
  1875. </div>
  1876. </el-dialog>
  1877. </section>
  1878. </template>
  1879. <script>
  1880. // 左右滑动
  1881. import dragMixin from "@/common/js/tensile.js";
  1882. import util from "../../common/js/util";
  1883. // 自定义select组件
  1884. import selectCat from "@/components/select.vue"
  1885. // 引入自定义级联组件
  1886. import vueCascader from "@/components/cascader.vue"
  1887. // 重庆物奇定制组件
  1888. import WeeklyCustomization from "./weeklyCustomization.vue"
  1889. import { mapMutations } from 'vuex'
  1890. let _that = this
  1891. export default {
  1892. mixins: [dragMixin],
  1893. components: {
  1894. selectCat,
  1895. vueCascader,
  1896. WeeklyCustomization
  1897. },
  1898. data() {
  1899. return {
  1900. exportType: 0,
  1901. exportingData: false,
  1902. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1903. jobResponseList:[],
  1904. yisibeiCompId: 3092,
  1905. yuzhongCompId: 3385,
  1906. mingyiName : '成都明夷电子科技有限公司',
  1907. // mingyiName : '明夷',
  1908. modItemDataId: null,
  1909. modImportTime: null,
  1910. modImportUserId: null,
  1911. showModImportTimeDialog: false,
  1912. showBatchSimpleApproveReport: false,
  1913. startDeleting: false,
  1914. showBatchDeleteReport: false,
  1915. deleteReportParam: {date:null, userIds:[]},
  1916. isDenying: false,
  1917. targetWeekDate: null,//填写周报中的周日期
  1918. importCardTimeVisi: false,
  1919. startRatioExporting: false,
  1920. exportUserRatio: false,
  1921. ratioYmonth:null,
  1922. hasWrittenReport: false,
  1923. today:null,
  1924. syncTimeLoading: false,
  1925. seluserText: '',
  1926. translation: '1', // 1、文字, 2、部门, 3、人员
  1927. exportLoad: false,
  1928. getPickerOptions: {
  1929. disabledDate: (time) => {
  1930. var date = new Date();
  1931. var year = date.getFullYear();
  1932. var month = date.getMonth() + 1;
  1933. if (month >= 1 && month <= 9) {
  1934. month = "0" + month;
  1935. }
  1936. var currentdate = year.toString() + month.toString();
  1937. var timeyear = time.getFullYear();
  1938. var timemonth = time.getMonth() + 1;
  1939. if (timemonth >= 1 && timemonth <= 9) {
  1940. timemonth = "0" + timemonth;
  1941. }
  1942. var timedate = timeyear.toString() + timemonth.toString();
  1943. if(this.user.timeType.fillAhead == 0){
  1944. return currentdate < timedate;
  1945. }else{
  1946. return false
  1947. }
  1948. }
  1949. },
  1950. alalal: '8.0',
  1951. timeBasecostList:null,
  1952. tbload: false,
  1953. exportTimeDialog: false,
  1954. searchKeyword: '',
  1955. monthWorkDataS: [],
  1956. monthNotWorkDateS: [],
  1957. pickDateArray:[],
  1958. WorktimeDatepickValue: [],
  1959. activeName:"first",
  1960. isLeave: 0,
  1961. submitingReport: false,
  1962. importResultMsg:null,
  1963. showImportResult:false,
  1964. importingData: false,
  1965. isDraft: 0,
  1966. timeStamp: 0,
  1967. projectColumns:[],
  1968. checkinLoading:false,
  1969. importWxParam:{date:null,},
  1970. active:0,
  1971. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1972. importWxDialog:false,
  1973. importDialog:false,
  1974. denyForm:null,
  1975. denyReasonDialog:false,
  1976. monthWorkTimeDialog: false,
  1977. isSubstitude:false,
  1978. isFill:false,
  1979. unFillList:[],
  1980. fillList:[],
  1981. fillMembList:[],
  1982. fillMembList_leave: [],
  1983. membListVisible: false,
  1984. isBatch:0,//是否是批量填报
  1985. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1986. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1987. weekDay : [this.$t('weekDay.sunday'), this.$t('weekDay.monday'), this.$t('weekDay.tuesday'), this.$t('weekDay.wednesday'), this.$t('weekDay.thursday'), this.$t('weekDay.friday'), this.$t('weekDay.saturday')],
  1988. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1989. fillStatusList: [],
  1990. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1991. exportDialog:false,
  1992. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1993. subProjectList:[],
  1994. canEdit: true,
  1995. originCanEdit: true,
  1996. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  1997. selectTime:null,
  1998. reportTimeType:{},
  1999. curDate:'',
  2000. isAllSelect: false,
  2001. approveDialogVisible:false,
  2002. deptId:null,
  2003. targetUid: null,
  2004. membCount:0,
  2005. selectState:"-1",
  2006. user: JSON.parse(sessionStorage.getItem("user")),
  2007. allUsersList: [],
  2008. showAddMore:false,
  2009. allDate: [],
  2010. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2011. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2012. choseDay: 0,
  2013. tableHeight: 0,
  2014. listLoading: false,
  2015. projectList: [], //项目列表
  2016. fillProjectList: [],
  2017. reportList: [], //日报列表
  2018. reportNames:[], //批量审批列表
  2019. selCon:[], //筛选条件
  2020. selProjectList:[], //筛选后项目列表
  2021. selConShow: true,
  2022. usersList: [], // 全部人员列表
  2023. usersListId: '', // 选中的人员id
  2024. dialogVisible: false, //项目弹窗
  2025. report: '',
  2026. workForm: {
  2027. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2028. domains: [{
  2029. id: null,
  2030. projectId: "",
  2031. workingTime: "",
  2032. timeType:0,
  2033. content: "",
  2034. state: 2,
  2035. multiWorktime:0,
  2036. worktimeList:[],
  2037. degreeId: null,
  2038. auditUserList: [],
  2039. }],
  2040. },
  2041. workRules: {
  2042. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2043. },
  2044. chooseParticipVisible: false,
  2045. logining: false,
  2046. isDisable: false,
  2047. timeType:[],
  2048. deptMembData: [
  2049. ],
  2050. //部门人员树状结构
  2051. data: [
  2052. {
  2053. id: -1,
  2054. label: this.$t('lable.allStaff'),
  2055. membCount:0
  2056. },
  2057. {
  2058. id: 0,
  2059. label: this.$t('lable.unassigned'),
  2060. }
  2061. ],
  2062. allData:{},
  2063. batchShowData:{},
  2064. option: [],
  2065. deptOptionList: [],
  2066. depData: {
  2067. id: -1,
  2068. label: this.$t('lable.allStaff'),
  2069. },
  2070. defaultProps: {
  2071. children: 'children',
  2072. label: 'label'
  2073. },
  2074. isNew: false,
  2075. selected: false,
  2076. valuet: new Date(),
  2077. domObj: null,
  2078. participator:[],
  2079. chosenMembCount:0,
  2080. jsDay: 0,
  2081. jsTime: 0,
  2082. falsss: false,
  2083. weidu: [],
  2084. weiduList: [],
  2085. yonghuUser: [],
  2086. dateAr: [],
  2087. batchSubFillDialog: false,
  2088. isSubstiS: false,
  2089. fillWeekDialogVisi: false,
  2090. fillWeekDialogVisiCustom: false,
  2091. zhoData: [],
  2092. weekDateRange: [],
  2093. btnZho: false,
  2094. weekDataLoading: false,
  2095. changdu: 6,
  2096. tianxieDialogVisible: false,
  2097. scopess: {},
  2098. zhoBao: {
  2099. time: '',
  2100. workingTime: '',
  2101. progress: '',
  2102. con: '',
  2103. subProjectId: '',
  2104. stage: '',
  2105. subProjectList: [],
  2106. stages: [],
  2107. },
  2108. zhoBaoIdx: '',
  2109. zhoBaoName: '',
  2110. zhis: {},
  2111. dealList: [],
  2112. toViewDialogVisible: false,
  2113. toViewList: [],
  2114. toViewloading: true,
  2115. toViewForm: {
  2116. pageIndex: '1',
  2117. pageSize: '20',
  2118. total: 0,
  2119. },
  2120. toViewloadings: false,
  2121. tabPositionss: 'top',
  2122. monthTotal: 0,
  2123. monthTotalPage: 0,
  2124. monthTotalLages: 20,
  2125. monthWorkData: [],
  2126. monthNotWorkDate: [],
  2127. monthWorkDataS1: [],
  2128. monthnotTotal: 0,
  2129. monthnotTotalPage: 0,
  2130. monthnotTotalLages: 20,
  2131. monthNotWorkDateS1: [],
  2132. deptMembDataText: '',
  2133. isFlag: false,
  2134. isMore: false,
  2135. stateKey: '0',
  2136. expandDate: [],
  2137. notifySelList:[],
  2138. departmentList: [],
  2139. approvalProcessDialog: false,
  2140. approvalProcessData: [],
  2141. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2142. leaveTypeName: [this.$t('leave.personalLeave'),this.$t('leave.sickLeave'),this.$t('leave.annualLeave'),this.$t('leave.maternityLeave'),this.$t('leave.marriageLeave'),this.$t('leave.bereavementLeave'),this.$t('leave.leave'),this.$t('leave.paternityLeave'),this.$t('leave.other')],
  2143. isWeekend: false,
  2144. canCancelInDialog: false,
  2145. approveinData: {},
  2146. approveinDialog: false,
  2147. reportCanDelete: false,
  2148. weeklyFilledTimeDialog: false,
  2149. weeklyFilledTimeList: [],
  2150. weeklyFilledTimeLoading: false,
  2151. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2152. weeklyFilledTimeCanDelete: false,
  2153. weeklyFilledTimeDate: null,
  2154. leaveAllNum: 0,
  2155. dataLoading: false,
  2156. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2157. vacationTime: {},
  2158. integrationProjectList: [],
  2159. totalReportHours: 0, // 合计的工时
  2160. workTimeForMinYi:0,
  2161. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2162. weekIndex: 1,
  2163. weekParentData: {},
  2164. deptIdForNoReport:[],
  2165. nameAearch: '', // 企业微信姓名搜索
  2166. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2167. deptMembDataLoading: false,
  2168. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2169. {
  2170. id: 4811,
  2171. // id: 10,
  2172. name: '陕西柘中建设工程有限公司'
  2173. }
  2174. ],
  2175. pushWorkTimeLogDig:false,
  2176. pushWorkTimeLogData:[],
  2177. };
  2178. },
  2179. watch: {
  2180. deptMembDataText(val) {
  2181. this.$refs.chooseMembTree.filter(val);
  2182. }
  2183. },
  2184. filters: {
  2185. // 过滤
  2186. amounts(value) {
  2187. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2188. return 0
  2189. }
  2190. var zhi = +value + 0
  2191. return zhi.toFixed(1)
  2192. },
  2193. // zhoData
  2194. zhoData(value, arr) {
  2195. var dateArray = value.split("-");
  2196. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2197. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2198. // console.log(arr[date.getDay()])
  2199. // return "周" + "日一二三四五六".charAt(date.getDay());
  2200. return arr[date.getDay()]
  2201. },
  2202. // 过滤数字
  2203. numbers(value) {
  2204. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2205. return 0
  2206. }
  2207. return value
  2208. },
  2209. },
  2210. computed: {},
  2211. mounted() {
  2212. var now = new Date();
  2213. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2214. this.today = t;
  2215. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2216. this.exportParam.dateRange = [startStr,t];
  2217. this.getAllDate(1);
  2218. this.getReportList();
  2219. this.getProjectList();
  2220. this.getFillProjectList();
  2221. this.getTimeType();
  2222. this.getDepartment();
  2223. this.scrollFunction()
  2224. this.userssHu();
  2225. if(this.user.timeType.reportAuditType == 3){
  2226. this.getAllUsersList()
  2227. }
  2228. if (this.user.company.packageProject == 1) {
  2229. this.getBasecostItemList();
  2230. }
  2231. if(this.user.timeType.lockWorktime){
  2232. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2233. }
  2234. //设置了下限
  2235. if (this.user.timeType.minReportTime) {
  2236. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2237. }
  2238. const that = this
  2239. if(this.user.userNameNeedTranslate == 1) {
  2240. that.dataLoading = that.$store.state.dataLoading
  2241. this.upDataLoading()
  2242. setTimeout(()=>{
  2243. that.dataLoading = that.$store.state.dataLoading
  2244. }, 1000)
  2245. }
  2246. if (this.user.companyId == this.yuzhongCompId) {
  2247. this.getJobResponList();
  2248. }
  2249. },
  2250. methods: {
  2251. ...mapMutations(['upDataLoading']),
  2252. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2253. isCustomization(userInfo, permissionArray) {
  2254. const { companyId } = userInfo
  2255. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2256. return isReportPictureRequired
  2257. },
  2258. //任务被选中
  2259. onTaskSelected(domainItem) {
  2260. //取服务
  2261. if (domainItem.taskId) {
  2262. var that = this;
  2263. var param = {taskId:domainItem.taskId};
  2264. if (this.isSubstitude) {
  2265. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2266. param.userId = this.workForm.userId[0];
  2267. }
  2268. }
  2269. this.http.post('/task/getMyTaskService',param, res => {
  2270. if (res.code == "ok") {
  2271. // domainItem.workContentList = res.data;
  2272. that.$set(domainItem, 'sapServiceId', null);
  2273. that.$set(domainItem, 'serviceList', res.data);
  2274. } else {
  2275. this.$message({
  2276. message: res.msg,
  2277. type: "error"
  2278. });
  2279. }
  2280. },error => {
  2281. this.$message({
  2282. message: error,
  2283. type: "error"
  2284. });
  2285. }
  2286. );
  2287. } else {
  2288. //清空服务
  2289. }
  2290. },
  2291. onBatchTimeChange() {
  2292. //反向计算每日工作时长
  2293. if (this.workForm.createDate) {
  2294. let sdate = new Date(this.workForm.createDate[0]);
  2295. let edate = new Date(this.workForm.createDate[1]);
  2296. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2297. console.log('days===', days)
  2298. if (days < 0) {
  2299. return;
  2300. }
  2301. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2302. //总时长发生改变,自动按比例计算
  2303. this.workForm.domains.forEach(d=>{
  2304. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2305. });
  2306. }
  2307. },
  2308. //更新工作内容列表
  2309. updateJobContent(domainItem) {
  2310. var that = this;
  2311. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2312. if (res.code == "ok") {
  2313. // domainItem.workContentList = res.data;
  2314. that.$set(domainItem, 'extraField3', null);
  2315. that.$set(domainItem, 'workContentList', res.data);
  2316. } else {
  2317. this.$message({
  2318. message: res.msg,
  2319. type: "error"
  2320. });
  2321. }
  2322. },error => {
  2323. this.$message({
  2324. message: error,
  2325. type: "error"
  2326. });
  2327. }
  2328. );
  2329. },
  2330. updateResponse(domainItem) {
  2331. var that = this;
  2332. var selectPid = domainItem.projectId;
  2333. domainItem.extraField2 = null;
  2334. domainItem.extraField3 = null;
  2335. if (selectPid && domainItem.extraField1) {
  2336. //是否非项目
  2337. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2338. console.log('==========','isPublic=='+isPublic);
  2339. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2340. console.log(filteredRespList);
  2341. domainItem.filteredRespList = filteredRespList;
  2342. }
  2343. },
  2344. getJobResponList() {
  2345. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2346. if (res.code == "ok") {
  2347. this.jobResponseList = res.data;
  2348. } else {
  2349. this.$message({
  2350. message: res.msg,
  2351. type: "error"
  2352. });
  2353. }
  2354. },error => {
  2355. this.$message({
  2356. message: error,
  2357. type: "error"
  2358. });
  2359. }
  2360. );
  2361. },
  2362. openModImportTime(row) {
  2363. this.showModImportTimeDialog = true;
  2364. this.modItemDataId = row.id;
  2365. },
  2366. delImportTime(row) {
  2367. let rowId = row.id;
  2368. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2369. confirmButtonText: this.$t('btn.determine'),
  2370. cancelButtonText: this.$t('btn.cancel'),
  2371. type: "warning"
  2372. })
  2373. .then(() => {
  2374. this.http.post('/report-import-log/delete',{
  2375. id: rowId
  2376. },res => {
  2377. if (res.code == "ok") {
  2378. this.$message({
  2379. message: '删除成功',
  2380. type: "success"
  2381. });
  2382. this.getToView();
  2383. } else {
  2384. this.$message({
  2385. message: res.msg,
  2386. type: "error"
  2387. });
  2388. }
  2389. },error => {
  2390. this.$message({
  2391. message: error,
  2392. type: "error"
  2393. });
  2394. }
  2395. );
  2396. }).catch(() => {this.startDeleting = false});
  2397. },
  2398. confirmChangeModTime() {
  2399. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2400. this.$message({
  2401. message: '请选择时间',
  2402. type: "error"
  2403. });
  2404. return;
  2405. }
  2406. this.http.post('/report-import-log/changeTime',{
  2407. modLogDateTime: this.modImportTime,
  2408. modImportUserId: this.modImportUserId,
  2409. id: this.modItemDataId
  2410. },res => {
  2411. if (res.code == "ok") {
  2412. this.$message({
  2413. message: '修改成功',
  2414. type: "success"
  2415. });
  2416. this.getToView();
  2417. this.showModImportTimeDialog = false;
  2418. } else {
  2419. this.$message({
  2420. message: res.msg,
  2421. type: "error"
  2422. });
  2423. }
  2424. },error => {
  2425. this.$message({
  2426. message: error,
  2427. type: "error"
  2428. });
  2429. }
  2430. );
  2431. },
  2432. confirmBatchApproveReport() {
  2433. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2434. this.$message({
  2435. message: '请选择日期范围',
  2436. type: "error"
  2437. });
  2438. return;
  2439. }
  2440. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2441. confirmButtonText: this.$t('btn.determine'),
  2442. cancelButtonText: this.$t('btn.cancel'),
  2443. type: "warning"
  2444. })
  2445. .then(() => {
  2446. this.startDeleting = true;
  2447. let obj = {
  2448. startDate: this.deleteReportParam.date[0],
  2449. endDate: this.deleteReportParam.date[1]
  2450. }
  2451. if(this.deleteReportParam.departmentId) {
  2452. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2453. } else {
  2454. obj.departmentId = null
  2455. }
  2456. this.http.post('/report/batchApproveByDate',obj,res => {
  2457. if (res.code == "ok") {
  2458. this.$message({
  2459. message: '审核通过',
  2460. type: "success"
  2461. });
  2462. this.getReportList();
  2463. this.getDepartment();
  2464. this.startDeleting = false;
  2465. } else {
  2466. this.$message({
  2467. message: res.msg,
  2468. type: "error"
  2469. });
  2470. }
  2471. },error => {
  2472. this.$message({
  2473. message: error,
  2474. type: "error"
  2475. });
  2476. }
  2477. );
  2478. }).catch(() => {this.startDeleting = false});
  2479. },
  2480. confirmBatchDelReport() {
  2481. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2482. this.$message({
  2483. message: '请选择部门或人员',
  2484. type: "error"
  2485. });
  2486. return;
  2487. }
  2488. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2489. this.$message({
  2490. message: '请选择日期范围',
  2491. type: "error"
  2492. });
  2493. return;
  2494. }
  2495. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2496. confirmButtonText: this.$t('btn.determine'),
  2497. cancelButtonText: this.$t('btn.cancel'),
  2498. type: "warning"
  2499. })
  2500. .then(() => {
  2501. this.startDeleting = true;
  2502. this.http.post('/report/batchDelete',{
  2503. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2504. startDate: this.deleteReportParam.date[0],
  2505. endDate: this.deleteReportParam.date[1],
  2506. deptId: this.deleteReportParam.deptId[0]
  2507. },res => {
  2508. if (res.code == "ok") {
  2509. this.$message({
  2510. message: this.$t('message.successfullyDeleted'),
  2511. type: "success"
  2512. });
  2513. this.getReportList();
  2514. this.getDepartment();
  2515. this.startDeleting = false;
  2516. } else {
  2517. this.$message({
  2518. message: res.msg,
  2519. type: "error"
  2520. });
  2521. }
  2522. },error => {
  2523. this.$message({
  2524. message: error,
  2525. type: "error"
  2526. });
  2527. }
  2528. );
  2529. }).catch(() => {this.startDeleting = false});
  2530. },
  2531. getRecentlyProject() {
  2532. this.http.post('/project/nearProject',{},res => {
  2533. if(res.code == 'ok'){
  2534. let topObj = {
  2535. label: '最近选择项目',
  2536. peojectList: res.data
  2537. }
  2538. let botomObj = {
  2539. label: '全部项目',
  2540. peojectList: this.fillProjectList
  2541. }
  2542. //最近项目如果在fillProjectList中不存在,需要移除
  2543. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2544. this.integrationProjectList = [topObj, botomObj]
  2545. }else {
  2546. this.$message({
  2547. message: res.msg,
  2548. type: 'error'
  2549. })
  2550. }
  2551. },err => {
  2552. this.$message({
  2553. message: err,
  2554. type: 'error'
  2555. })
  2556. })
  2557. },
  2558. handlePictureCardPreview(file, index) {
  2559. console.log(file, index)
  2560. let arr = []
  2561. let imgArr = this.workForm.domains[index].imgListUrl
  2562. for(var i in imgArr) {
  2563. arr.push(imgArr[i].url)
  2564. }
  2565. console.log(arr, '图片数据')
  2566. const $viewer = this.$viewerApi({
  2567. images: arr
  2568. });
  2569. },
  2570. // 图片上传
  2571. addImg(e, index) {
  2572. console.log(e, '数据')
  2573. let formData = new FormData()
  2574. formData.append('multipartFile', e.file)
  2575. this.http.uploadFile('/common/uploadFile', formData,
  2576. res => {
  2577. if (res.code == "ok") {
  2578. this.$message({
  2579. message: this.$t('uploadedsuccessfully'),
  2580. type: "success"
  2581. });
  2582. if(!this.workForm.domains[index].imgList) {
  2583. this.workForm.domains[index].imgList = []
  2584. this.workForm.domains[index].imgListUrl = []
  2585. }
  2586. this.workForm.domains[index].imgList.push(res.data)
  2587. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2588. } else {
  2589. this.$message({message: res.msg,type: "error"});
  2590. }
  2591. console.log(this.workForm.domains[index])
  2592. },
  2593. error => {this.$message({message: error,type: "error"});
  2594. });
  2595. },
  2596. // 删除图片
  2597. delImg(file,fileList, index) {
  2598. console.log(file, fileList)
  2599. let idx = 0
  2600. for(let i in fileList) {
  2601. if(fileList[i].uid == file.uid) {
  2602. idx = i
  2603. }
  2604. }
  2605. this.workForm.domains[index].imgList.splice(idx, 1)
  2606. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2607. console.log(this.workForm.domains[index])
  2608. },
  2609. test(){
  2610. console.log('test',this.workForm.domains);
  2611. },
  2612. getHour(s1, s2) {
  2613. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2614. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2615. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2616. var ms = s2.getTime() - s1.getTime();
  2617. if (ms < 0) return 0;
  2618. let ma = ms / 1000 / 60 / 60
  2619. return ma; //小时
  2620. },
  2621. refreshWXCardTime(workdate) {
  2622. if (!workdate) return;
  2623. this.syncTimeLoading = true;
  2624. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2625. date: workdate,
  2626. },res => {
  2627. this.syncTimeLoading = false;
  2628. if(res.code == 'ok'){
  2629. this.workForm.time = res.data.time;
  2630. }else {
  2631. this.$message({
  2632. message: res.msg,
  2633. type: 'error'
  2634. })
  2635. }
  2636. },err => {
  2637. this.syncTimeLoading = false;
  2638. this.$message({
  2639. message: err,
  2640. type: 'error'
  2641. })
  2642. })
  2643. },
  2644. refreshAttendance(workdate) {
  2645. if (!workdate) return;
  2646. this.syncTimeLoading = true;
  2647. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2648. startDate: workdate[0],
  2649. endDate: workdate[1]
  2650. },res => {
  2651. this.syncTimeLoading = false;
  2652. if(res.code == 'ok'){
  2653. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2654. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2655. this.totalReportHours = this.workTimeForMinYi;
  2656. }else {
  2657. this.$message({
  2658. message: res.msg,
  2659. type: 'error'
  2660. })
  2661. }
  2662. },err => {
  2663. this.syncTimeLoading = false;
  2664. this.$message({
  2665. message: err,
  2666. type: 'error'
  2667. })
  2668. })
  2669. },
  2670. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2671. this.weeklyFilledTimeDialog = true
  2672. this.weeklyFilledTimeLoading = true
  2673. this.weeklyFilledTimeDate = parameterDate
  2674. this.http.post('/report/getReportList',{
  2675. date: parameterDate,
  2676. userId: this.user.id
  2677. },res => {
  2678. this.weeklyFilledTimeLoading = false
  2679. if(res.code == 'ok'){
  2680. this.weeklyFilledTimeList = res.data[0].data
  2681. let candelete = true
  2682. for(let i in this.weeklyFilledTimeList){
  2683. if(this.weeklyFilledTimeList[i].state < 2){
  2684. candelete = false
  2685. }
  2686. }
  2687. this.weeklyFilledTimeCanDelete = candelete
  2688. }else {
  2689. this.$message({
  2690. message: res.msg,
  2691. type: 'error'
  2692. })
  2693. }
  2694. },err => {
  2695. this.weeklyFilledTimeLoading = false
  2696. this.$message({
  2697. message: err,
  2698. type: 'error'
  2699. })
  2700. })
  2701. },
  2702. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2703. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2704. confirmButtonText: this.$t('btn.determine'),
  2705. cancelButtonText: this.$t('btn.cancel'),
  2706. type: "warning"
  2707. })
  2708. .then(() => {
  2709. this.http.post('/report/delete',{
  2710. userId: this.user.id,
  2711. date: this.weeklyFilledTimeDate
  2712. },res => {
  2713. if (res.code == "ok") {
  2714. this.$message({
  2715. message: this.$t('message.successfullyDeleted'),
  2716. type: "success"
  2717. });
  2718. this.getWeeklyWorkTime()
  2719. this.getReportList();
  2720. this.getDepartment();
  2721. this.weeklyFilledTimeDialog = false;
  2722. } else {
  2723. this.$message({
  2724. message: res.msg,
  2725. type: "error"
  2726. });
  2727. }
  2728. },error => {
  2729. this.$message({
  2730. message: error,
  2731. type: "error"
  2732. });
  2733. }
  2734. );
  2735. }).catch(() => {});
  2736. },
  2737. getApprovalProcess(item){
  2738. // console.log('this.date',this.choseDate);
  2739. this.http.post('/report-log/get',{
  2740. creatorId: item.id,
  2741. createDate: sessionStorage.msg
  2742. },res => {
  2743. if(res.code == 'ok'){
  2744. this.approvalProcessDialog = true
  2745. if(this.user.userNameNeedTranslate == 1) {
  2746. for(var i in res.data) {
  2747. let obj = {
  2748. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2749. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2750. }
  2751. res.data[i].msgCon = obj
  2752. }
  2753. }
  2754. this.approvalProcessData = res.data
  2755. console.log(this.approvalProcessData, '数据卡看')
  2756. }else{
  2757. this.$message({
  2758. message: res.msg,
  2759. type: 'error'
  2760. })
  2761. }
  2762. },err => {
  2763. this.$message({
  2764. message: err,
  2765. type: 'error'
  2766. })
  2767. })
  2768. },
  2769. filterNode(value, data) {
  2770. if (!value) return true;
  2771. return data.label.indexOf(value) !== -1;
  2772. },
  2773. triggerCalculateOT(index) {
  2774. var str = this.workForm.domains[index].overtimeHours + ''
  2775. if(str.indexOf('.') != '-1') {
  2776. var s = str.split('.')[0]
  2777. var st = str.split('.')[1]
  2778. var sts = st.split('')
  2779. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2780. }
  2781. },
  2782. searchScreen(e){
  2783. if(e){
  2784. this.monthNotWorkDateS1 = []
  2785. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2786. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2787. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2788. }
  2789. }
  2790. if (this.monthNotWorkDateS1.length > 50) {
  2791. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2792. }else{
  2793. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2794. }
  2795. // if (this.monthNotWorkDateS1.length > 0) {
  2796. // setTimeout(() => {
  2797. // this.tableListenernot()
  2798. // }, 1000);
  2799. // }
  2800. }else{
  2801. this.monthWorkDataS1 = []
  2802. for (let i = 0; i < this.monthWorkData.length; i++) {
  2803. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2804. this.monthWorkDataS1.push(this.monthWorkData[i])
  2805. }
  2806. }
  2807. if (this.monthWorkDataS1.length > 50) {
  2808. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2809. }else{
  2810. this.monthWorkDataS = this.monthWorkDataS1
  2811. }
  2812. // if (this.monthWorkDataS1.length > 0) {
  2813. // setTimeout(() => {
  2814. // this.tableListener()
  2815. // }, 1000);
  2816. // }
  2817. }
  2818. },
  2819. addUpload(data) {
  2820. // var zhi = data.fileName.split('.')[0]
  2821. // var sss = zhi + '.xlsx'
  2822. // return
  2823. var filePath = '/upload/' + data.serverName;
  2824. const a = document.createElement('a'); // 创建a标签
  2825. a.setAttribute('download', data.fileName);// download属性
  2826. a.setAttribute('href', filePath);// href链接
  2827. a.click(); //自执行点击事件
  2828. a.remove();
  2829. },
  2830. restrictNumber(targetId) {
  2831. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2832. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2833. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2834. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2835. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2836. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2837. inpu.value = parseFloat(inpu.value);
  2838. }
  2839. },
  2840. //获取项目下的任务分组
  2841. getTaskGroups(domain, index) {
  2842. domain.groupId=null;
  2843. this.http.post('/task-group/listMyJoinGroup',{
  2844. projectId: domain.projectId,
  2845. isSubstitude: this.isSubstitude ? 1 : 0
  2846. },
  2847. res => {
  2848. if (res.code == "ok") {
  2849. this.workForm.domains[index].taskGroups = res.data;
  2850. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2851. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2852. // this.getGroupStages(domain, index);
  2853. // }
  2854. this.$forceUpdate();
  2855. }
  2856. },
  2857. error => {
  2858. this.$message({
  2859. message: error,
  2860. type: "error"
  2861. });
  2862. }
  2863. );
  2864. },
  2865. //下载填报工时占比报表
  2866. downloadProjectRatio() {
  2867. this.exportUserRatio = true;
  2868. // let now = new Date();
  2869. // let month = now.getMonth();//默认看上个月的
  2870. // let monthStr = month<10? ('0'+month): month;
  2871. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2872. const today = new Date();
  2873. const year = today.getFullYear();
  2874. const month = today.getMonth() + 1;
  2875. let lastMonthYear, lastMonth;
  2876. if (month === 1) {
  2877. lastMonthYear = year - 1;
  2878. lastMonth = 12;
  2879. } else {
  2880. lastMonthYear = year;
  2881. lastMonth = month - 1;
  2882. }
  2883. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2884. console.log('赋值 ==>', this.ratioYmonth)
  2885. },
  2886. confirmDownloadRatio() {
  2887. this.startRatioExporting = true;
  2888. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2889. ymonth: this.ratioYmonth
  2890. },
  2891. res => {
  2892. if (res.code == "ok") {
  2893. this.startRatioExporting = false;
  2894. var filePath = res.data;
  2895. const a = document.createElement('a'); // 创建a标签
  2896. var data = filePath.split("/");
  2897. a.setAttribute('download', data[data.length-1]);// download属性
  2898. a.setAttribute('href', filePath);// href链接
  2899. a.click(); //自执行点击事件
  2900. a.remove();
  2901. } else {
  2902. this.startRatioExporting = false;
  2903. this.$message({
  2904. message: res.msg,
  2905. type: "error"
  2906. });
  2907. }
  2908. },
  2909. error => {
  2910. this.checkinLoading = false;
  2911. this.$message({
  2912. message: error,
  2913. type: "error"
  2914. });
  2915. }
  2916. );
  2917. },
  2918. //下载带企业微信考勤数据的工时统计模板
  2919. downloadCheckInExcel() {
  2920. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2921. startDate: this.importWxParam.date[0],
  2922. endDate: this.importWxParam.date[1],
  2923. },
  2924. res => {
  2925. if (res.code == "ok") {
  2926. var filePath = res.data;
  2927. const a = document.createElement('a'); // 创建a标签
  2928. var data = filePath.split("/");
  2929. a.setAttribute('download', data[data.length-1]);// download属性
  2930. a.setAttribute('href', filePath);// href链接
  2931. a.click(); //自执行点击事件
  2932. a.remove();
  2933. } else {
  2934. this.$message({
  2935. message: res.msg,
  2936. type: "error"
  2937. });
  2938. }
  2939. },
  2940. error => {
  2941. this.checkinLoading = false;
  2942. this.$message({
  2943. message: error,
  2944. type: "error"
  2945. });
  2946. }
  2947. );
  2948. },
  2949. pre() {
  2950. if (this.active == 0) return;
  2951. this.active--;
  2952. },
  2953. next() {
  2954. this.active++;
  2955. },
  2956. triggerTotalTime(index) {
  2957. var item = this.checkinList[index];
  2958. var total = 0.0;
  2959. for (var i=0;i<this.projectColumns.length; i++) {
  2960. var key = this.projectColumns[i];
  2961. if (item[key] != null && item[key] != '') {
  2962. total += parseFloat(item[key]);
  2963. }
  2964. }
  2965. item.totalFillTime = total;
  2966. },
  2967. //提交批量代填的数据
  2968. submitBatchSubFillData() {
  2969. var data = JSON.stringify(this.checkinList);
  2970. this.http.post('/user-corpwx-time/submitProjectTime',{
  2971. json: data,
  2972. projectColumns: JSON.stringify(this.projectColumns)
  2973. },
  2974. res => {
  2975. if (res.code == "ok") {
  2976. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2977. this.importWxDialog = false;
  2978. }
  2979. },
  2980. error => {
  2981. this.checkinLoading = false;
  2982. this.$message({
  2983. message: error,
  2984. type: "error"
  2985. });
  2986. }
  2987. );
  2988. },
  2989. loadCheckInData() {
  2990. if (this.importWxParam.date == null) {
  2991. this.checkinList = [];
  2992. return;
  2993. }
  2994. this.checkinLoading = true;
  2995. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2996. startDate: this.importWxParam.date[0],
  2997. endDate: this.importWxParam.date[1],
  2998. },
  2999. res => {
  3000. if (res.code == "ok") {
  3001. this.checkinLoading = false;
  3002. this.checkinList = res.data.list;
  3003. this.projectColumns = res.data.projects;
  3004. // 自定义表格会导致表格错乱,需重新计算表格
  3005. this.$nextTick(()=>{
  3006. this.$refs.tab.doLayout()
  3007. })
  3008. }
  3009. },
  3010. error => {
  3011. this.checkinLoading = false;
  3012. this.$message({
  3013. message: error,
  3014. type: "error"
  3015. });
  3016. }
  3017. );
  3018. },
  3019. importCardTime(item) {
  3020. //首先判断文件类型
  3021. let str = item.file.name.split(".");
  3022. let format = str[str.length - 1];
  3023. if (format != "xls" && format != "xlsx") {
  3024. this.$message({
  3025. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3026. type: "error"
  3027. });
  3028. } else {
  3029. this.importingData = true;
  3030. let formData = new FormData();
  3031. formData.append("multipartFile", item.file);
  3032. formData.append("companyId", this.user.companyId);
  3033. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3034. res => {
  3035. this.$refs.uploadCardTime.clearFiles();
  3036. this.importingData = false;
  3037. if (res.code == "ok") {
  3038. //换成弹出框,以免有人等了半天回来啥也没看到
  3039. this.$message({
  3040. message: '导入考勤时长成功',
  3041. type: "success"
  3042. });
  3043. } else {
  3044. this.$message({
  3045. message: res.msg,
  3046. type: "error"
  3047. });
  3048. }
  3049. },
  3050. error => {
  3051. this.$refs.upload.clearFiles();
  3052. this.listLoading = false;
  3053. this.$message({
  3054. message: error,
  3055. type: "error"
  3056. });
  3057. });
  3058. }
  3059. },
  3060. batchImportWxData(item) {
  3061. //首先判断文件类型
  3062. let str = item.file.name.split(".");
  3063. let format = str[str.length - 1];
  3064. if (format != "xls" && format != "xlsx") {
  3065. this.$message({
  3066. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3067. type: "error"
  3068. });
  3069. } else {
  3070. this.importingData = true;
  3071. let formData = new FormData();
  3072. formData.append("file", item.file);
  3073. formData.append("companyId", this.user.companyId);
  3074. formData.append("withCheckIn", 1);
  3075. this.http.uploadFile('/report/importData', formData,
  3076. res => {
  3077. this.$refs.upload.clearFiles();
  3078. this.showImportResult = true;
  3079. this.importingData = false;
  3080. if (res.code == "ok") {
  3081. //换成弹出框,以免有人等了半天回来啥也没看到
  3082. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3083. this.getReportList();
  3084. this.importWxDialog = false;
  3085. } else {
  3086. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3087. }
  3088. },
  3089. error => {
  3090. this.$refs.upload.clearFiles();
  3091. this.listLoading = false;
  3092. this.$message({
  3093. message: error,
  3094. type: "error"
  3095. });
  3096. });
  3097. }
  3098. },
  3099. batchImportData(item) {
  3100. //首先判断文件类型
  3101. let str = item.file.name.split(".");
  3102. let format = str[str.length - 1];
  3103. if (format != "xls" && format != "xlsx") {
  3104. this.$message({
  3105. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3106. type: "error"
  3107. });
  3108. } else {
  3109. this.importingData = true;
  3110. let formData = new FormData();
  3111. formData.append("file", item.file);
  3112. formData.append("companyId", this.user.companyId);
  3113. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3114. this.http.uploadFile(url, formData,
  3115. res => {
  3116. this.$refs.upload.clearFiles();
  3117. this.importingData = false;
  3118. this.showImportResult = true;
  3119. if (res.code == "ok") {
  3120. //换成弹出框,以免有人等了半天回来啥也没看到
  3121. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3122. this.getReportList();
  3123. this.importWXDialog = false;
  3124. } else {
  3125. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3126. }
  3127. },
  3128. error => {
  3129. this.$refs.upload.clearFiles();
  3130. this.importingData = false;
  3131. this.$message({
  3132. message: error,
  3133. type: "error"
  3134. });
  3135. });
  3136. }
  3137. },
  3138. userssHu() {
  3139. this.http.post('/time-type/getCompanyTimeSetting',{
  3140. companyId: this.user.companyId
  3141. },
  3142. res => {
  3143. if (res.code == "ok") {
  3144. this.yonghuUser = res.data
  3145. }
  3146. },
  3147. error => {
  3148. this.$message({
  3149. message: error,
  3150. type: "error"
  3151. });
  3152. }
  3153. );
  3154. },
  3155. iptBlur(i) {
  3156. if(this.isBatch == 0) {
  3157. return
  3158. }
  3159. this.http.post('/report/getWorkDays',{
  3160. startDate: this.workForm.createDate[0],
  3161. endDate: this.workForm.createDate[1]
  3162. },
  3163. res => {
  3164. if (res.code == "ok") {
  3165. this.jsDay = res.data
  3166. this.chuji(i)
  3167. } else {
  3168. this.$message({
  3169. message: res.msg,
  3170. type: "error"
  3171. });
  3172. }
  3173. },
  3174. error => {
  3175. this.$message({
  3176. message: error,
  3177. type: "error"
  3178. });
  3179. }
  3180. );
  3181. //明夷硬编码获取
  3182. if (this.user.company.companyName == this.mingyiName) {
  3183. this.getWorkTimeForMinYi();
  3184. }
  3185. },
  3186. getWorkTimeForMinYi(){
  3187. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3188. startDate: this.workForm.createDate[0],
  3189. endDate: this.workForm.createDate[1]
  3190. },
  3191. res => {
  3192. if (res.code == "ok") {
  3193. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3194. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3195. this.totalReportHours = this.workTimeForMinYi;
  3196. } else {
  3197. this.$message({
  3198. message: res.msg,
  3199. type: "error"
  3200. });
  3201. this.workForm.createDate = [];
  3202. }
  3203. },
  3204. error => {
  3205. this.$message({
  3206. message: error,
  3207. type: "error"
  3208. });
  3209. }
  3210. );
  3211. },
  3212. chuji(i) {
  3213. if(i == 0) {
  3214. this.seleChn(1)
  3215. } else if(i == 1) {
  3216. this.seleChn(0)
  3217. } else if(i == 2) {
  3218. if(this.workForm.domains[0].multiWorktime > 0) {
  3219. this.iptChangs()
  3220. } else {
  3221. this.iptChang()
  3222. }
  3223. } else if(i == 3) {
  3224. this.seleChn(0)
  3225. }
  3226. },
  3227. seleChn(e,domain) {
  3228. if(e == 1) {
  3229. for(var i in this.workForm.domains) {
  3230. if(this.workForm.domains[i].timeType == 0) {
  3231. this.workForm.domains[i].workingTime = 8
  3232. } else {
  3233. this.workForm.domains[i].workingTime = 4
  3234. }
  3235. }
  3236. }
  3237. var quanbu = 0
  3238. var spl = this.workForm.domains
  3239. var zhi = ''
  3240. for(var i in spl) {
  3241. var sp = +spl[i].workingTime + 0
  3242. zhi = this.jsDay * sp
  3243. quanbu = +quanbu + zhi
  3244. }
  3245. this.jsTime = quanbu
  3246. this.totalReportHours = quanbu
  3247. let worktime = this.jsTime
  3248. // 自动计算加班时长
  3249. if(this.isBatch != 0){
  3250. worktime = this.jsTime / this.jsDay
  3251. }
  3252. if(this.user.timeType.fillOvertime && domain){
  3253. let isover = false
  3254. let alltime = 0
  3255. let allover = 0 //此处alltime同上面的worktime
  3256. for(let d in spl){
  3257. if(spl[d].isOvertime){
  3258. isover = true
  3259. allover += spl[d].overtimeHours*1
  3260. }
  3261. alltime += spl[d].workingTime*1
  3262. }
  3263. if(domain.overtimeHours){
  3264. allover = allover - domain.overtimeHours
  3265. }
  3266. if(worktime*1 > this.user.timeType.allday){
  3267. if(isover){
  3268. if(alltime > (allover + this.user.timeType.allday)){
  3269. this.$set(domain,'isOvertime',true)
  3270. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3271. }else{
  3272. this.$set(domain,'isOvertime',false)
  3273. this.$set(domain,'overtimeHours',null)
  3274. if(alltime < (allover + this.user.timeType.allday)){
  3275. let overtime = allover + this.user.timeType.allday - alltime
  3276. for(let pi in spl){
  3277. if(spl[pi].overtimeHours){
  3278. if((overtime - spl[pi].overtimeHours*1) > 0){
  3279. overtime = overtime - spl[pi].overtimeHours*1
  3280. this.$set(spl[pi],'isOvertime',false)
  3281. this.$set(spl[pi],'overtimeHours',null)
  3282. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3283. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3284. break
  3285. }else{
  3286. this.$set(spl[pi],'isOvertime',false)
  3287. this.$set(spl[pi],'overtimeHours',null)
  3288. break
  3289. }
  3290. }
  3291. }
  3292. }
  3293. }
  3294. }else{
  3295. this.$set(domain,'isOvertime',true)
  3296. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3297. }
  3298. }else{
  3299. for(let di in spl){
  3300. this.$set(spl[di],'isOvertime',false)
  3301. this.$set(spl[di],'overtimeHours',null)
  3302. }
  3303. }
  3304. }
  3305. },
  3306. iptChang() {
  3307. var sl = this.workForm.domains
  3308. let timeArr = []
  3309. for(var i in sl) {
  3310. if(sl[i].startTime && sl[i].endTime) {
  3311. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3312. }
  3313. }
  3314. this.getTimeHours(timeArr)
  3315. // for(let j in arrNum) {
  3316. // this.timeJsonStr += arrNum[j]
  3317. // if(flg) {
  3318. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3319. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3320. // }
  3321. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3322. // flg = true
  3323. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3324. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3325. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3326. // }
  3327. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3328. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3329. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3330. // }
  3331. // }
  3332. },
  3333. iptChangs() {
  3334. var sl = this.workForm.domains
  3335. let timeArr = []
  3336. for(var i in sl) {
  3337. for(var j in sl[i].worktimeList){
  3338. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3339. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3340. }
  3341. }
  3342. }
  3343. this.getTimeHours(timeArr)
  3344. },
  3345. // 调用接口或去数据
  3346. getTimeHours(arr) {
  3347. this.http.post('/report/getHoursByTimeRange',{
  3348. timeJsonStr: JSON.stringify(arr)
  3349. },res => {
  3350. if(res.code === 'ok') {
  3351. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3352. } else {
  3353. this.$message({
  3354. message: res.msg,
  3355. type: 'error'
  3356. })
  3357. }
  3358. },err => {
  3359. this.$message({
  3360. message: err,
  3361. type: 'error'
  3362. })
  3363. })
  3364. },
  3365. // 按周填报调用接口计算时间
  3366. async getWeekHoursByTimeRange(timeRange) {
  3367. const url = '/report/getHoursByTimeRange';
  3368. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3369. var that = this;
  3370. return new Promise((resolve, reject) => {
  3371. this.http.post(url, data, function(res) {
  3372. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3373. }, function(err) {
  3374. reject(err);
  3375. });
  3376. });
  3377. },
  3378. removeTimeItem(item, index) {
  3379. item.worktimeList.splice(index, 1);
  3380. this.iptChangs()
  3381. },
  3382. //添加工时
  3383. addNewWorktime(index, item) {
  3384. if(item.worktimeList == null ) {
  3385. item.worktimeList = []
  3386. }
  3387. item.worktimeList.push({});
  3388. },
  3389. //复制项目
  3390. copyProject(index) {
  3391. var leftProgress = 10;
  3392. if (this.reportTimeType.type == 3) {
  3393. //计算已经待分配工时比例
  3394. let array = this.workForm.domains;
  3395. let totalProgress = 0;
  3396. for (var i=0;i<array.length; i++) {
  3397. totalProgress += array[i].progress;
  3398. }
  3399. if (totalProgress < 100) {
  3400. leftProgress = 100 - totalProgress;
  3401. }
  3402. }
  3403. var newIndex = index+1;
  3404. var itemDomain = {
  3405. projectId: this.workForm.domains[index].projectId,
  3406. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3407. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3408. ),
  3409. content: "",
  3410. progress:leftProgress,
  3411. state:2,//2-表示待提交
  3412. };
  3413. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3414. if (this.reportTimeType.type == 0) {
  3415. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3416. var length = this.workForm.domains.length;
  3417. if (length == 2) {
  3418. this.showAddMore = false;
  3419. }
  3420. }
  3421. this.selectProject(itemDomain, newIndex);
  3422. },
  3423. pushWorkTime(reportId){
  3424. let url=''
  3425. if(this.user.timeType.syncSap == 1){
  3426. url='/report/pushProjectReportToSap'
  3427. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3428. var pushDate = this.date + day;
  3429. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3430. confirmButtonText: '确定',
  3431. cancelButtonText: '取消',
  3432. type: 'info'
  3433. }).then(() => {
  3434. const loading = this.$loading({
  3435. lock: true,
  3436. text: '正在推送中,请耐心等待。',
  3437. spinner: 'el-icon-loading',
  3438. background: 'rgba(0, 0, 0, 0.7)'
  3439. });
  3440. this.http.post(url,{
  3441. pushDate: pushDate,
  3442. reportId: reportId
  3443. },res => {
  3444. loading.close();
  3445. if(res.code == 'ok'){
  3446. this.$message({
  3447. type: 'success',
  3448. message: res.data
  3449. });
  3450. }else{
  3451. this.$message({
  3452. type: 'error',
  3453. message: res.msg
  3454. })
  3455. }
  3456. },err => {
  3457. loading.close();
  3458. this.$message({
  3459. type: 'error',
  3460. message: err
  3461. })
  3462. })
  3463. }).catch(() => {
  3464. });
  3465. }else{
  3466. url='/report/pushReportDataToThird'
  3467. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3468. confirmButtonText: '确定',
  3469. cancelButtonText: '取消',
  3470. type: 'info'
  3471. }).then(() => {
  3472. const loading = this.$loading({
  3473. lock: true,
  3474. text: '正在推送中,请耐心等待。',
  3475. spinner: 'el-icon-loading',
  3476. background: 'rgba(0, 0, 0, 0.7)'
  3477. });
  3478. this.http.post(url,{
  3479. yearMonth: this.date
  3480. },res => {
  3481. loading.close();
  3482. if(res.code == 'ok'){
  3483. this.$message({
  3484. type: 'success',
  3485. message: '推送成功!'
  3486. });
  3487. }else{
  3488. this.$message({
  3489. type: 'error',
  3490. message: res.msg
  3491. })
  3492. }
  3493. },err => {
  3494. loading.close();
  3495. this.$message({
  3496. type: 'error',
  3497. message: err
  3498. })
  3499. })
  3500. }).catch(() => {
  3501. });
  3502. }
  3503. },
  3504. showWorkTime(){
  3505. this.monthWorkTimeDialog = true;
  3506. this.searchKeyword = ''
  3507. this.WorktimeDatepickValue = this.istoMonth()
  3508. if(this.WorktimeDatepickValue.length == 0){
  3509. let newdate = new Date();
  3510. let nowdate = newdate.toLocaleDateString();
  3511. let getauto = this.getAutoWeekDate(nowdate)
  3512. let nowwd = [getauto[0],getauto[6]]
  3513. this.WorktimeDatepickValue = nowwd
  3514. }
  3515. this.showMonthWorkTime()
  3516. },
  3517. handleClick(t,e){
  3518. if (t.name == "first") {
  3519. this.showMonthWorkTime()
  3520. }else{
  3521. this.showMonthNotWorkTime()
  3522. }
  3523. },
  3524. //导出员工每日填报工时数
  3525. exportMembWorkHours() {
  3526. this.http.post(
  3527. "/report/exportUserDailyWorkTime",
  3528. {
  3529. // month: this.date,
  3530. startDate: this.WorktimeDatepickValue[0],
  3531. endDate: this.WorktimeDatepickValue[1],
  3532. },
  3533. (res) => {
  3534. if (res.code == "ok") {
  3535. let url = res.data;
  3536. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3537. }
  3538. },
  3539. (error) => {
  3540. this.$message({
  3541. message: error,
  3542. type: "error",
  3543. });
  3544. }
  3545. );
  3546. },
  3547. exportMembNotWorkHours() {
  3548. this.http.post(
  3549. "/report/exportNoReportUserList",
  3550. {
  3551. // month: this.date,
  3552. startDate: this.WorktimeDatepickValue[0],
  3553. endDate: this.WorktimeDatepickValue[1],
  3554. },
  3555. (res) => {
  3556. if (res.code == "ok") {
  3557. let url = res.data;
  3558. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3559. }
  3560. },
  3561. (error) => {
  3562. this.$message({
  3563. message: error,
  3564. type: "error",
  3565. });
  3566. }
  3567. );
  3568. },
  3569. downloadByA(name, url) {
  3570. const a = document.createElement("a"); // 创建a标签
  3571. a.setAttribute("download", name); // download属性
  3572. a.setAttribute("href", url); // href链接
  3573. a.click(); // 自执行点击事件
  3574. a.remove();
  3575. },
  3576. // 是否本月判断
  3577. istoMonth(){
  3578. let todate = new Date()
  3579. let tomonth = todate.getMonth() + 1
  3580. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3581. if(this.date == adate){
  3582. return []
  3583. }else{
  3584. let sedate = new Date(this.date)
  3585. let semonth = sedate.getMonth() + 1
  3586. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3587. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3588. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3589. return [sedates1, sedates2]
  3590. }
  3591. },
  3592. showMonthWorkTime() {
  3593. this.monthTotalPage = 0,
  3594. this.tbload = true
  3595. this.http.post(
  3596. "/report/getUserDailyWorkTime",
  3597. // "/report/getNoReportUserList",
  3598. {
  3599. // month: this.date,
  3600. startDate: this.WorktimeDatepickValue[0],
  3601. endDate: this.WorktimeDatepickValue[1],
  3602. },
  3603. (res) => {
  3604. if (res.code == "ok") {
  3605. this.tbload = false;
  3606. this.pickDateArray = res.data.days;
  3607. // console.log('dataarray',res.data.days);
  3608. this.monthWorkData = res.data.list;
  3609. // this.monthWorkDataS = this.monthWorkData
  3610. // this.monthWorkDataS1 = res.data.list
  3611. this.monthTotal = res.data.list.length
  3612. if (this.monthWorkData.length > 50) {
  3613. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3614. }else{
  3615. this.monthWorkDataS = this.monthWorkData
  3616. }
  3617. this.searchScreen(0)
  3618. // this.monthWorkDataS = infoList
  3619. // 判断
  3620. // if (this.monthWorkDataS1.length > 0) {
  3621. // setTimeout(() => {
  3622. // this.tableListener()
  3623. // }, 1000);
  3624. // }
  3625. this.$nextTick(function(){
  3626. this.$refs.hasworkTbl.doLayout();
  3627. });
  3628. // this.$forceUpdate()
  3629. }
  3630. },
  3631. (error) => {
  3632. this.tbload = false
  3633. this.$message({
  3634. message: error,
  3635. type: "error",
  3636. });
  3637. }
  3638. );
  3639. },
  3640. // tableListener(){
  3641. // let that = this;
  3642. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3643. // // 添加scroll监听事件
  3644. // dom.addEventListener("scroll", function () {
  3645. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3646. // if (scrollDistance < 2) {
  3647. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3648. // that.monthTotalPage++; //当前页数自增
  3649. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3650. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3651. // var infoList = arrList.splice(
  3652. // that.monthTotalPage * that.monthTotalLages,
  3653. // that.monthTotalLages
  3654. // );
  3655. // // 数据添加
  3656. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3657. // }
  3658. // }
  3659. // })
  3660. // },
  3661. showMonthNotWorkTime() {
  3662. this.monthTotalPage = 0,
  3663. this.tbload = true,
  3664. this.http.post(
  3665. "/report/getNoReportUserList",
  3666. {
  3667. startDate: this.WorktimeDatepickValue[0],
  3668. endDate: this.WorktimeDatepickValue[1],
  3669. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3670. },
  3671. (res) => {
  3672. if (res.code == "ok") {
  3673. this.tbload = false
  3674. this.monthNotWorkDate = res.data;
  3675. // this.monthNotWorkDateS1 = res.data
  3676. this.monthnotTotal = res.data.length
  3677. // 2222111
  3678. if (this.monthNotWorkDate.length > 50) {
  3679. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3680. } else {
  3681. this.monthNotWorkDateS = this.monthNotWorkDate
  3682. }
  3683. this.searchScreen(1)
  3684. // 判断
  3685. // if (this.monthnotworkDateS1.length > 0) {
  3686. // setTimeout(() => {
  3687. // this.tableListenernot()
  3688. // }, 1000);
  3689. // }
  3690. this.$nextTick(function(){
  3691. this.$refs.hasworkTbl2.doLayout();
  3692. });
  3693. }
  3694. },
  3695. (error) => {
  3696. this.tbload = false
  3697. this.$message({
  3698. message: error,
  3699. type: "error",
  3700. });
  3701. }
  3702. );
  3703. },
  3704. // tableListenernot(){
  3705. // let that = this;
  3706. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3707. // dom.addEventListener("scroll", function () {
  3708. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3709. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3710. // if (scrollDistance2 < 2) {
  3711. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3712. // that.monthnotTotalPage++; //当前页数自增
  3713. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3714. // var infoList = arrList.splice(
  3715. // that.monthnotTotalPage * that.monthnotTotalLages,
  3716. // that.monthnotTotalLages
  3717. // );
  3718. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3719. // }
  3720. // }
  3721. // })
  3722. // },
  3723. listScroll(){
  3724. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3725. this.isMore = true
  3726. setTimeout(()=>{
  3727. this.isMore = false
  3728. },1000)
  3729. }else {
  3730. this.isFlag = true
  3731. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3732. this.monthWorkDataS = datalist
  3733. setTimeout(()=>{
  3734. this.isFlag = false
  3735. },300)
  3736. }
  3737. },
  3738. notListScroll(){
  3739. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3740. this.isMore = true
  3741. setTimeout(()=>{
  3742. this.isMore = false
  3743. },1000)
  3744. }else {
  3745. this.isFlag = true
  3746. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3747. this.monthNotWorkDateS = datalist
  3748. // console.log('length',this.monthNotWorkDateS.length)
  3749. setTimeout(()=>{
  3750. this.isFlag = false
  3751. },300)
  3752. }
  3753. },
  3754. // 获取默认这zhou日期参数 222
  3755. getLastWeek(e){
  3756. let newdate = new Date()
  3757. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3758. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3759. if(e){
  3760. this.WorktimeDatepickValue = lastwd
  3761. this.showMonthWorkTime()
  3762. }else{
  3763. this.WorktimeDatepickValue = lastwd
  3764. this.showMonthNotWorkTime()
  3765. }
  3766. },
  3767. getThisWeek(e){
  3768. let newdate = new Date();
  3769. let nowdate = newdate.toLocaleDateString();
  3770. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3771. if(e){
  3772. this.WorktimeDatepickValue = nowwd
  3773. this.showMonthWorkTime()
  3774. }else{
  3775. this.WorktimeDatepickValue = nowwd
  3776. this.showMonthNotWorkTime()
  3777. }
  3778. },
  3779. getDoubleLastWeek(e){
  3780. let newdate = new Date()
  3781. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3782. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3783. if(e){
  3784. this.WorktimeDatepickValue = nextwd
  3785. this.showMonthWorkTime()
  3786. }else{
  3787. this.WorktimeDatepickValue = nextwd
  3788. this.showMonthNotWorkTime()
  3789. }
  3790. },
  3791. alreadyAllDate(stime,etime){
  3792. let diffdate = new Array();
  3793. let i=0;
  3794. while(stime<=etime){
  3795. let dateArray = stime.split("-");
  3796. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3797. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3798. let stimewk = this.weekDay[date.getDay()]
  3799. 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')
  3800. 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])
  3801. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3802. let stime_ts = new Date(stime).getTime();
  3803. let next_date = stime_ts + (24*60*60*1000);
  3804. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3805. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3806. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3807. stime = next_dates_y+next_dates_m+next_dates_d;
  3808. i++;
  3809. }
  3810. return diffdate
  3811. },
  3812. getAutoWeekDate(e) {
  3813. let dateString = e;
  3814. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3815. if (dateString.match(dateStringReg)) {
  3816. let presentDate = new Date(dateString),
  3817. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3818. return Array.from(new Array(7), function (val, index) {
  3819. let formatDate = new Date(
  3820. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3821. );
  3822. return (
  3823. formatDate.getFullYear() +
  3824. "-" +
  3825. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3826. "-" +
  3827. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3828. );
  3829. });
  3830. } else {
  3831. throw new Error(
  3832. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3833. );
  3834. }
  3835. },
  3836. onProgressChange() {
  3837. this.$forceUpdate();
  3838. },
  3839. showChooseMembTree() {
  3840. this.chosenMembCount = this.participator.length;
  3841. this.chooseParticipVisible = true;
  3842. },
  3843. onTreeItemChange() {
  3844. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3845. var list = chosenList.filter(item=>item.isUser == 1);
  3846. this.chosenMembCount = list.length;
  3847. },
  3848. findUserInTree() {
  3849. if (this.filterName == '') {
  3850. this.deptMembData = this.allMembData;
  3851. } else {
  3852. var list = this.findRecursively(this.filterName, this.allMembData);
  3853. this.deptMembData = list;
  3854. }
  3855. },
  3856. findRecursively(username, list) {
  3857. var filterList = [];
  3858. for (var i=0;i<list.length; i++) {
  3859. if (list[i].isUser == 1) {
  3860. if (list[i].label.indexOf(username) >= 0) {
  3861. //匹配上了
  3862. filterList.push(list[i]);
  3863. }
  3864. } else if (list[i].children != null && list[i].children.length > 0) {
  3865. var subList = this.findRecursively(username, list[i].children);
  3866. if (subList.length > 0) {
  3867. subList.forEach(s=>filterList.push(s));
  3868. }
  3869. }
  3870. }
  3871. return filterList;
  3872. },
  3873. //确定选择参与人
  3874. chooseParticip() {
  3875. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3876. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3877. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3878. if (this.user.company.packageProject == 1) {
  3879. if (this.chosenMembList.length > 1) {
  3880. this.$message({
  3881. message: '每次仅支持代填一个人',
  3882. type: "error",
  3883. });
  3884. return;
  3885. }
  3886. }
  3887. this.chooseParticipVisible = false;
  3888. this.workForm.userNames = '';
  3889. this.workForm.userId = [];
  3890. this.participator = [];
  3891. for (var i=0;i<this.chosenMembList.length; i++) {
  3892. this.workForm.userId.push(this.chosenMembList[i].id);
  3893. this.workForm.userNames += this.chosenMembList[i].label+',';
  3894. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3895. this.participator.push(item);
  3896. }
  3897. if (this.workForm.userNames.length > 0) {
  3898. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3899. }
  3900. if(this.user.userNameNeedTranslate == 1) {
  3901. if(this.workForm.userNames) {
  3902. this.workForm.userNames = this.workForm.userNames.split(',')
  3903. }
  3904. }
  3905. },
  3906. notifySel(sel){
  3907. // console.log(sel);
  3908. this.notifySelList = sel
  3909. },
  3910. //微信通知人员填写
  3911. Notify(code) {
  3912. if (this.notifySelList.length == 0) return;
  3913. var ids = '';
  3914. this.notifySelList.forEach(f=>{
  3915. ids += f.id+',';
  3916. })
  3917. this.http.post('/user/pushFillReport',{
  3918. ids: ids, date: this.curDate,
  3919. code: code
  3920. },
  3921. res => {
  3922. if (res.code == "ok") {
  3923. this.$message({
  3924. message: this.$t('message.sentSuccessfully'),
  3925. type: "success"
  3926. });
  3927. }
  3928. },
  3929. error => {
  3930. this.$message({
  3931. message: error,
  3932. type: "error"
  3933. });
  3934. }
  3935. );
  3936. },
  3937. //导出人员列表
  3938. exportMemb() {
  3939. if (this.fillMembList.length == 0) return;
  3940. var ids = '';
  3941. this.fillMembList.forEach(f=>{
  3942. ids += f.id+',';
  3943. })
  3944. this.http.post('/user/exportMembList',{
  3945. ids: ids,isFill: this.isFill, date: this.curDate
  3946. },
  3947. res => {
  3948. if (res.code == "ok") {
  3949. var aTag = document.createElement('a');
  3950. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3951. aTag.href = res.data;
  3952. aTag.click();
  3953. }
  3954. },
  3955. error => {
  3956. this.$message({
  3957. message: error,
  3958. type: "error"
  3959. });
  3960. }
  3961. );
  3962. },
  3963. showMembList(fill) {
  3964. this.membListVisible = true;
  3965. if (fill == 0) {
  3966. this.fillMembList = this.unFillList;
  3967. this.isFill = false;
  3968. let leaveList = []
  3969. let unleaveList = []
  3970. for(let i in this.fillMembList){
  3971. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3972. leaveList.push(this.fillMembList[i])
  3973. }else{
  3974. unleaveList.push(this.fillMembList[i])
  3975. }
  3976. }
  3977. this.fillMembList = unleaveList
  3978. this.fillMembList_leave = leaveList
  3979. } else if(fill == 1){
  3980. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3981. this.isFill = true;
  3982. }else{
  3983. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3984. this.isFill = true;
  3985. }
  3986. },
  3987. //获取自己填写的日报状态
  3988. getReportFillStatus() {
  3989. this.http.post('/report/getReportFillStatus',{
  3990. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3991. },
  3992. res => {
  3993. if (res.code == "ok") {
  3994. this.fillStatusList = res.data;
  3995. this.allDate.forEach(d=>{
  3996. var fillInfo = null;
  3997. d.state = null;
  3998. this.fillStatusList.forEach(s=>{
  3999. // console.log(d)
  4000. var d1 = s.createDate.split('-')[2];
  4001. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4002. // console.log(d2, '我被执行了')
  4003. if (d1.indexOf('0') == 0) {
  4004. d1 = d1.substring(1,d1.length);
  4005. }
  4006. if (d1 == d2) {
  4007. d.state = s.state;
  4008. }
  4009. })
  4010. })
  4011. this.$forceUpdate();
  4012. }
  4013. },
  4014. error => {
  4015. this.$message({
  4016. message: error,
  4017. type: "error"
  4018. });
  4019. }
  4020. );
  4021. },
  4022. scrollFunction () {
  4023. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4024. if (this.domObj.attachEvent) { // IE
  4025. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4026. } else if (this.domObj.addEventListener) {
  4027. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4028. }
  4029. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4030. },
  4031. mouseScroll(event) { // google 浏览器下
  4032. let detail = event.wheelDelta || event.detail
  4033. let moveForwardStep = -1
  4034. let moveBackStep = 1
  4035. let step = 0
  4036. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4037. event.preventDefault() // 阻止浏览器默认事件
  4038. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4039. },
  4040. // //左右滚动
  4041. // wheel(e){
  4042. // var a = document.getElementById("dateScroll");
  4043. // var scroll_width = 80; //滚动一下的距离
  4044. // var e = e || window.event, v;
  4045. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4046. // if(v>3||-v>3) v=-v;
  4047. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4048. // e.preventDefault(); //阻止浏览器的默认滚动
  4049. // },
  4050. showExportDialog() {
  4051. this.exportType = 0
  4052. this.exportDialog = true;
  4053. },
  4054. showExportTimeDialog() {
  4055. this.exportTimeDialog = true;
  4056. },
  4057. changeAllTime() {
  4058. //总时长发生改变,自动按比例计算
  4059. this.workForm.domains.forEach(d=>{
  4060. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4061. });
  4062. //计算jsTime
  4063. if (this.workForm.createDate) {
  4064. let sdate = new Date(this.workForm.createDate[0]);
  4065. let edate = new Date(this.workForm.createDate[1]);
  4066. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4067. console.log('days===', days)
  4068. if (days < 0) {
  4069. days = 0;
  4070. }
  4071. this.jsTime = this.reportTimeType.allday * days;
  4072. }
  4073. },
  4074. // 是否加班的单机事件
  4075. check() {
  4076. this.selected = !this.selected
  4077. this.isNew = this.selected
  4078. },
  4079. updateSubProject() {
  4080. this.$forceUpdate();
  4081. },
  4082. selectDegreeId(domain, index) {
  4083. this.http.post('/report/defaultDegree',{
  4084. projectId: domain.projectId
  4085. },
  4086. res => {
  4087. if (res.code == "ok") {
  4088. if(res.data) {
  4089. this.workForm.domains[index].degreeId = res.data.id + ''
  4090. this.$forceUpdate();
  4091. }
  4092. }
  4093. },
  4094. error => {
  4095. this.$message({
  4096. message: error,
  4097. type: "error"
  4098. });
  4099. }
  4100. );
  4101. },
  4102. //项目选中了, 加载子项目
  4103. selectProject(domain, index) {
  4104. if(!domain.projectId){
  4105. return;
  4106. }
  4107. // 默认选中上次填写的自定义维度
  4108. if(this.yonghuUser.customDegreeActive == 1) {
  4109. this.selectDegreeId(domain, index)
  4110. }
  4111. // console.log('projectId===',domain.projectId);
  4112. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4113. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4114. this.http.post('/sub-project/list',{
  4115. projectId: domain.projectId,
  4116. isReport: true
  4117. },
  4118. res => {
  4119. //清空之前选中的子项目
  4120. // this.workForm.domains[index].subProjectId = 0;
  4121. if (res.code == "ok") {
  4122. this.workForm.domains[index].subProjectList = res.data;
  4123. this.workForm.domains[index].subProjectId = null;
  4124. this.$forceUpdate();
  4125. }
  4126. },
  4127. error => {
  4128. this.$message({
  4129. message: error,
  4130. type: "error"
  4131. });
  4132. }
  4133. );
  4134. //项目相关的近期任务
  4135. if (this.user.company.packageProject == 1) {
  4136. this.getRecentTaskList(domain, index);
  4137. //获取项目相关专业
  4138. if (this.user.company.packageEngineering == 1) {
  4139. this.getProjectProfessions(domain, index);
  4140. }
  4141. //获取项目下的任务分组
  4142. this.getTaskGroups(domain, index);
  4143. }
  4144. // 获取项目相关的维度
  4145. // domain.degreeId = null
  4146. this.$set(domain,'degreeId',null)
  4147. this.$set(domain,'multiDegrIdArray',null)
  4148. this.dimension(domain, index);
  4149. //获取项目审核人
  4150. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4151. this.getProjectAuditorList(domain, index);
  4152. } else {
  4153. //按分组的负责人来审核
  4154. domain.projectAuditorId = null;
  4155. domain.projectAuditorName = null;
  4156. domain.auditUserList = null;
  4157. }
  4158. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4159. if (this.reportTimeType.type == 3) {
  4160. //新增项目时,自动计算
  4161. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4162. domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
  4163. }
  4164. //加载昱众的工作职责
  4165. if (this.user.companyId == this.yuzhongCompId) {
  4166. this.updateResponse(domain);
  4167. }
  4168. },
  4169. getRecentTaskList(domain, index) {
  4170. //刷新任务时,清空服务
  4171. this.$set(domain, 'sapServiceId', null);
  4172. this.$set(domain, 'taskId', null);
  4173. var param = {
  4174. projectId: domain.projectId,
  4175. isSubstitude:this.isSubstitude?1:0,
  4176. };
  4177. if (domain.groupId) {
  4178. param.groupId = domain.groupId;
  4179. }
  4180. if (domain.stage) {
  4181. param.stage = domain.stage;
  4182. }
  4183. //专业版代填,获取代填员工的任务
  4184. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4185. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4186. this.$message({
  4187. message: '请选择代填的员工',
  4188. type: "error"
  4189. });
  4190. return;
  4191. } else {
  4192. param.userId = this.workForm.userId[0];
  4193. }
  4194. }
  4195. this.http.post('/task/getRecentTask',param,
  4196. res => {
  4197. if (res.code == "ok") {
  4198. this.workForm.domains[index].allTaskList = res.data;
  4199. this.workForm.domains[index].taskList = res.data;
  4200. this.$forceUpdate();
  4201. }
  4202. },
  4203. error => {
  4204. this.$message({
  4205. message: error,
  4206. type: "error"
  4207. });
  4208. }
  4209. );
  4210. },
  4211. //获取项目审核人
  4212. getProjectAuditorList(domainItem, index) {
  4213. if(domainItem.projectId == '') {
  4214. return
  4215. }
  4216. domainItem.projectAuditorId = null;
  4217. domainItem.projectAuditorName = null;
  4218. this.http.post('/project-auditor/getList',{
  4219. projectId: domainItem.projectId,
  4220. },
  4221. res => {
  4222. if (res.code == "ok") {
  4223. domainItem.auditUserList = res.data;
  4224. if (res.data.length==0) {
  4225. this.$message({
  4226. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4227. type: "error"
  4228. });
  4229. } else if (res.data.length==1) {
  4230. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4231. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4232. }
  4233. this.$forceUpdate();
  4234. }
  4235. },
  4236. error => {
  4237. this.$message({
  4238. message: error,
  4239. type: "error"
  4240. });
  4241. }
  4242. );
  4243. },
  4244. // 获取维度数据
  4245. dimension(domain, index) {
  4246. if(domain.projectId == '') {
  4247. return
  4248. }
  4249. this.http.post('/project/getDegreeList',{
  4250. projectId: domain.projectId,
  4251. },
  4252. res => {
  4253. if (res.code == "ok") {
  4254. // console.log("维度数据",res.data);
  4255. this.workForm.domains[index].wuduList = res.data
  4256. // this.workForm = this.workForm
  4257. this.$forceUpdate()
  4258. }
  4259. },
  4260. error => {
  4261. this.$message({
  4262. message: error,
  4263. type: "error"
  4264. });
  4265. }
  4266. );
  4267. },
  4268. //切换任务阶段
  4269. changeStages(domain, index) {
  4270. if (domain.stage == null || domain.stage == '') {
  4271. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4272. } else {
  4273. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4274. }
  4275. this.getRecentTaskList(domain, index);
  4276. this.$forceUpdate();
  4277. },
  4278. getGroupStages(domain, index, keepStage) {
  4279. // console.log(domain);
  4280. if(!domain.groupId){
  4281. domain.projectAuditorId = ''
  4282. domain.stages = []
  4283. if(this.user.timeType.reportAuditType >= 1){
  4284. domain.auditUserList = []
  4285. }
  4286. this.$forceUpdate();
  4287. return
  4288. }
  4289. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4290. res => {
  4291. if (res.code == "ok") {
  4292. if (!keepStage) {
  4293. domain.stage = '';
  4294. }
  4295. domain.stages = res.data;
  4296. this.getRecentTaskList(domain, index);
  4297. this.$forceUpdate();
  4298. }
  4299. },
  4300. error => {
  4301. this.$message({
  4302. message: error,
  4303. type: "error"
  4304. });
  4305. });
  4306. //检查当前的项目是否需要获取分组的负责人
  4307. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4308. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4309. res => {
  4310. if (res.code == "ok") {
  4311. domain.getProjectAuditorList = res.data;
  4312. domain.auditUserList = res.data;
  4313. if (res.data.length==1) {
  4314. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4315. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4316. } else if (res.data.length==0) {
  4317. domain.projectAuditorId = null;
  4318. domain.projectAuditorName = null;
  4319. }
  4320. this.$forceUpdate();
  4321. }
  4322. },
  4323. error => {
  4324. this.$message({
  4325. message: error,
  4326. type: "error"
  4327. });
  4328. });
  4329. }
  4330. },
  4331. getProjectProfessions(domain, index) {
  4332. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4333. res => {
  4334. if (res.code == "ok") {
  4335. this.workForm.domains[index].professionProgress = res.data;
  4336. this.$forceUpdate();
  4337. }
  4338. },
  4339. error => {
  4340. this.$message({
  4341. message: error,
  4342. type: "error"
  4343. });
  4344. });
  4345. },
  4346. //删除自己的日报
  4347. deleteReport() {
  4348. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4349. confirmButtonText: this.$t('btn.determine'),
  4350. cancelButtonText: this.$t('btn.cancel'),
  4351. type: "warning"
  4352. })
  4353. .then(() => {
  4354. this.listLoading = true;
  4355. this.http.post('/report/delete',{
  4356. userId: this.user.id,
  4357. date: this.workForm.createDate
  4358. },
  4359. res => {
  4360. this.listLoading = false;
  4361. if (res.code == "ok") {
  4362. this.$message({
  4363. message: this.$t('message.successfullyDeleted'),
  4364. type: "success"
  4365. });
  4366. this.getReportList();
  4367. this.getDepartment();
  4368. this.dialogVisible = false;
  4369. } else {
  4370. this.$message({
  4371. message: res.msg,
  4372. type: "error"
  4373. });
  4374. }
  4375. },
  4376. error => {
  4377. this.listLoading = false;
  4378. this.$message({
  4379. message: error,
  4380. type: "error"
  4381. });
  4382. }
  4383. );
  4384. })
  4385. .catch(() => {});
  4386. },
  4387. // 管理员删除日报
  4388. guanli(item) {
  4389. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4390. let param = {date: this.date + day, userId: item.id};
  4391. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4392. confirmButtonText: this.$t('btn.determine'),
  4393. cancelButtonText: this.$t('btn.cancel'),
  4394. type: "warning"
  4395. })
  4396. .then(() => {
  4397. this.listLoading = true;
  4398. this.http.post('/report/delete',param,
  4399. res => {
  4400. this.listLoading = false;
  4401. if (res.code == "ok") {
  4402. this.$message({
  4403. message: this.$t('message.successfullyDeleted'),
  4404. type: "success"
  4405. });
  4406. this.getReportList();
  4407. this.getDepartment();
  4408. this.dialogVisible = false;
  4409. } else {
  4410. this.$message({
  4411. message: res.msg,
  4412. type: "error"
  4413. });
  4414. }
  4415. },
  4416. error => {
  4417. this.listLoading = false;
  4418. this.$message({
  4419. message: error,
  4420. type: "error"
  4421. });
  4422. }
  4423. );
  4424. })
  4425. .catch(() => {});
  4426. },
  4427. selectAll() {
  4428. if (this.isAllSelect) {
  4429. var keys = [];
  4430. this.reportNames.forEach(b=>{
  4431. keys.push(b.id);
  4432. })
  4433. this.$refs.approveTree.setCheckedKeys(keys);
  4434. } else {
  4435. this.$refs.approveTree.setCheckedKeys([]);
  4436. }
  4437. },
  4438. removeEmptyNode(list) {
  4439. for (var i=0;i<list.length;i++) {
  4440. var cnt = 0;
  4441. if (list[i].membCount == 0) {
  4442. list.splice(i, 1);
  4443. i--;
  4444. } else if (list[i].children != null) {
  4445. this.removeEmptyNode(list[i].children);
  4446. }
  4447. }
  4448. },
  4449. calculateMembCount(list) {
  4450. for (var i in list) {
  4451. var cnt = 0;
  4452. if (list[i].children != null) {
  4453. this.calculateMembCount(list[i].children);
  4454. for (var m in list[i].children) {
  4455. cnt += list[i].children[m].membCount;
  4456. }
  4457. }
  4458. if (list[i].isUser == 1) {
  4459. cnt++;
  4460. this.membCount++;
  4461. }
  4462. list[i].membCount = cnt;
  4463. }
  4464. },
  4465. stateChange() {
  4466. // console.log(this.allData,'alldate');
  4467. this.membCount = 0;
  4468. if (this.selectState == -1) {
  4469. //全部状态
  4470. this.data = this.allData;
  4471. } else {
  4472. //未填报
  4473. this.seluserText = ''
  4474. var newData = JSON.parse(JSON.stringify(this.allData));
  4475. this.filterState(this.selectState, newData);
  4476. this.data = newData;
  4477. }
  4478. this.calculateMembCount(this.data);
  4479. this.data[0].membCount = this.membCount;//总人数
  4480. },
  4481. //按状态过滤部门人员
  4482. filterState(state, list) {
  4483. for (var i =0;i<list.length; i++) {
  4484. var obj = list[i];
  4485. if (obj.isUser == 1) {
  4486. var match = false;
  4487. if (state == -2) {
  4488. if (obj.state == null) {
  4489. match = true;
  4490. }
  4491. } else {
  4492. if (obj.state == state) {
  4493. match = true;
  4494. }
  4495. }
  4496. if (!match) {
  4497. list.splice(i, 1);
  4498. i--;
  4499. } else {
  4500. }
  4501. } else {
  4502. if (obj.children != null) {
  4503. this.filterState(state, obj.children);
  4504. }
  4505. }
  4506. }
  4507. },
  4508. //a按名称过滤部门人员
  4509. async seluserforText(){
  4510. const { userNameNeedTranslate } = this.user
  4511. this.membCount = 0;
  4512. var newData = JSON.parse(JSON.stringify(this.allData));
  4513. let textList = [this.seluserText]
  4514. if(userNameNeedTranslate == 1) {
  4515. this.dataLoading = true
  4516. let res = await this.postData('/user/getEmployeeList', {
  4517. keyword: this.seluserText,
  4518. cursor: '',
  4519. departmentId: -1,
  4520. pageIndex: 1,
  4521. pageSize: 1000
  4522. })
  4523. textList = res.data.records.map(item => item.name)
  4524. this.dataLoading = false
  4525. }
  4526. // return
  4527. console.log(textList, '<=== textList')
  4528. this.seluserforTextin(this.seluserText, newData, textList)
  4529. console.log(newData, 'Data')
  4530. this.data = newData;
  4531. this.calculateMembCount(this.data);
  4532. this.data[0].membCount = this.membCount;//总人数
  4533. },
  4534. seluserforTextin(text, list, textList = []){
  4535. for (var i =0;i<list.length; i++) {
  4536. var obj = list[i];
  4537. if (obj.isUser == 1) {
  4538. var match = false;
  4539. // if (obj.label.indexOf(text) != -1) {
  4540. // match = true
  4541. // }
  4542. if(textList.some(item => item.includes(obj.label))) {
  4543. match = true
  4544. }
  4545. if (!match) {
  4546. list.splice(i, 1);
  4547. i--;
  4548. } else {
  4549. }
  4550. } else {
  4551. if (obj.children != null) {
  4552. this.seluserforTextin(text, obj.children, textList);
  4553. }
  4554. }
  4555. }
  4556. },
  4557. // 当节点发生变化时
  4558. nodeChangeExpand(data) {
  4559. // 保存当前展开的节点
  4560. let flag = false
  4561. this.nodeModelData.some(item => {
  4562. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4563. flag = true
  4564. return true
  4565. }
  4566. })
  4567. if (!flag) { // 不存在则存到数组里
  4568. this.nodeModelData.push(data.id)
  4569. }
  4570. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4571. },
  4572. nodeChangeCollapse(data) {
  4573. console.log(this.nodeModelData)
  4574. this.nodeModelData.some((item, i) => {
  4575. if (item === data.id) {
  4576. this.nodeModelData.length = i
  4577. }
  4578. })
  4579. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4580. },
  4581. // 部门列表点击
  4582. handleNodeClick(data) {
  4583. // this.dealList = data
  4584. this.theValues(data.id, this.allData)
  4585. // this.depData = data;
  4586. var list = [];
  4587. if (data.id == -1) {
  4588. this.deptId = null;
  4589. this.targetUid = null;
  4590. list = this.data;
  4591. } else if (data.isUser == 1) {
  4592. this.deptId = null;
  4593. this.targetUid = data.id;
  4594. } else {
  4595. this.deptId = data.id;
  4596. this.targetUid = null;
  4597. list.push(data);
  4598. }
  4599. this.getReportList();
  4600. if (list.length > 0) {
  4601. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4602. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4603. }
  4604. },
  4605. exportPushLog(){
  4606. this.http.post('/sap-sync-log/export',{},
  4607. res => {
  4608. if (res.code == "ok") {
  4609. var filePath = res.data;
  4610. var fName = '推送日志.xlsx'
  4611. const a = document.createElement('a'); // 创建a标签
  4612. a.setAttribute('download', fName);// download属性
  4613. a.setAttribute('href', filePath);// href链接
  4614. a.click(); //自执行点击事件
  4615. a.remove();
  4616. } else {
  4617. this.$message({
  4618. message: res.msg,
  4619. type: "error"
  4620. });
  4621. }
  4622. },
  4623. error => {
  4624. this.$message({
  4625. message: error,
  4626. type: "error"
  4627. });
  4628. });
  4629. },
  4630. theValues(id, item) {
  4631. for(var i in item) {
  4632. if(item[i].id == id) {
  4633. this.depData = item[i]
  4634. if(id == '-1') {
  4635. this.translation = '1'
  4636. } else {
  4637. if(item[i].children) {
  4638. this.translation = '2'
  4639. } else {
  4640. this.translation = '3'
  4641. }
  4642. }
  4643. return
  4644. } else {
  4645. if(item[i].children) {
  4646. this.theValues(id, item[i].children)
  4647. }
  4648. }
  4649. }
  4650. },
  4651. //获取可以选择的代填的人员列表
  4652. getSubstitudeUserDeptList() {
  4653. if (this.deptMembData.length == 0) {
  4654. this.http.post("/department/listMyMembs", {},
  4655. res => {
  4656. if (res.code == "ok") {
  4657. let noAllData = JSON.parse(JSON.stringify(res.data));
  4658. if (noAllData.length > 0) {
  4659. // if (noAllData[0].label == '全部人员') {
  4660. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4661. noAllData.splice(0,1);
  4662. }
  4663. }
  4664. this.setUserToDept(noAllData);
  4665. this.deptMembData = noAllData;
  4666. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4667. console.log(this.deptMembData, '代填人员数据')
  4668. } else {
  4669. this.$message({
  4670. message: res.msg,
  4671. type: "error"
  4672. });
  4673. }
  4674. },
  4675. error => {
  4676. this.$message({
  4677. message: error,
  4678. type: "error"
  4679. });
  4680. });
  4681. }
  4682. },
  4683. // 获取部门列表
  4684. getDepartmentForApprove() {
  4685. this.http.post( this.port.manage.depList, {},
  4686. res => {
  4687. if (res.code == "ok") {
  4688. var list1 = JSON.parse(JSON.stringify(res.data));
  4689. this.deptOptionList = this.changeArr(list1);
  4690. console.log(this.deptOptionList, '部门')
  4691. } else {
  4692. this.$message({
  4693. message: res.msg,
  4694. type: "error"
  4695. });
  4696. }
  4697. },
  4698. error => {
  4699. this.$message({
  4700. message: error,
  4701. type: "error"
  4702. });
  4703. });
  4704. },
  4705. // 获取部门列表
  4706. getDepartment() {
  4707. //如果没有权限,就不需要获取
  4708. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4709. return;
  4710. }
  4711. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4712. var param = {date:this.date + day};
  4713. this.http.post("/report/getMembList", param,
  4714. res => {
  4715. if (res.code == "ok") {
  4716. if(res.data.length == 0){
  4717. return
  4718. }
  4719. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4720. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4721. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4722. // if (this.user.role > 0) {
  4723. // }
  4724. list.splice(0,0,{
  4725. id: -1,
  4726. label: this.$t('lable.allStaff'),
  4727. })
  4728. this.membCount = 0;
  4729. //设置员工到部门下面
  4730. this.setUserToDept(list);
  4731. this.data = list;
  4732. // console.log('data',this.data);
  4733. this.expandDate = [this.data[1].id]
  4734. this.allData = list;
  4735. // if (noAllData.length > 0) {
  4736. // if (noAllData[0].label == '全部人员') {
  4737. // noAllData.splice(0,1);
  4738. // }
  4739. // }
  4740. // this.setUserToDept(noAllData);
  4741. // this.deptMembData = noAllData;
  4742. this.option = this.changeArr(list1);
  4743. list[0].membCount = this.membCount;
  4744. if (this.depData.id == -1) {
  4745. this.depData.membCount = this.membCount;
  4746. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4747. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4748. } else {
  4749. if (this.depData.isUser == null) {
  4750. var dep = this.findTargetDept(this.data, this.depData.id);
  4751. var membDeptList = [];
  4752. membDeptList.push(dep);
  4753. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4754. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4755. }
  4756. }
  4757. if (this.depData.isUser == null) {
  4758. if (this.isFill) {
  4759. this.fillMembList = this.fillList;
  4760. } else {
  4761. this.fillMembList = this.unFillList;
  4762. }
  4763. }
  4764. this.leaveAllNum = 0
  4765. for(let i in this.unFillList){
  4766. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4767. this.leaveAllNum += 1
  4768. }
  4769. }
  4770. this.stateChange()
  4771. } else {
  4772. this.$message({
  4773. message: res.msg,
  4774. type: "error"
  4775. });
  4776. }
  4777. },
  4778. error => {
  4779. this.$message({
  4780. message: error,
  4781. type: "error"
  4782. });
  4783. });
  4784. this.getReportFillStatus();
  4785. },
  4786. findTargetDept(list, deptId) {
  4787. var t = null;
  4788. for (var i=0;i<list.length; i++) {
  4789. if (list[i].isUser == null && list[i].id == deptId) {
  4790. t = list[i];
  4791. break;
  4792. }
  4793. }
  4794. if (t == null) {
  4795. for (var i=0;i<list.length; i++) {
  4796. if (list[i].children != null && list[i].children.length > 0) {
  4797. t = this.findTargetDept(list[i].children, deptId);
  4798. if (t != null) {
  4799. break;
  4800. }
  4801. }
  4802. }
  4803. }
  4804. return t;
  4805. },
  4806. getUserMembListFromDeptList(list, isFill) {
  4807. var membList = [];
  4808. for (var i in list) {
  4809. var deptName = list[i].label;
  4810. if (list[i].userList != null) {
  4811. list[i].userList.forEach(element => {
  4812. if (isFill == 0) {
  4813. //获取未填的
  4814. if (element.state == null) {
  4815. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4816. membList.push(obj);
  4817. }
  4818. } else {
  4819. if (element.state != null) {
  4820. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4821. membList.push(obj);
  4822. }
  4823. }
  4824. });
  4825. }
  4826. if (list[i].children != null) {
  4827. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4828. }
  4829. }
  4830. return membList;
  4831. },
  4832. setUserToDept(list) {
  4833. for (var i in list) {
  4834. var cnt = 0;
  4835. if (list[i].children != null) {
  4836. this.setUserToDept(list[i].children);
  4837. for (var m in list[i].children) {
  4838. cnt += list[i].children[m].membCount;
  4839. }
  4840. }
  4841. if (list[i].userList != null) {
  4842. if (list[i].children == null) {
  4843. list[i].children = [];
  4844. }
  4845. list[i].userList.forEach(element => {
  4846. var obj = {
  4847. id: element.id,
  4848. label:element.name,
  4849. state:element.state,
  4850. parentId:element.departmentId,
  4851. isUser:1,
  4852. workingTime: element.workingTime,
  4853. leaveDays: element.leaveDays,
  4854. leaveTimes: element.leaveTimes
  4855. };
  4856. list[i].children.push(obj);
  4857. this.membCount++;
  4858. cnt++;
  4859. });
  4860. }
  4861. list[i].membCount = cnt;
  4862. }
  4863. },
  4864. // 修改数组
  4865. changeArr(arr) {
  4866. for (var i = 0; i < arr.length; i++) {
  4867. if(arr[i].id != -1 && arr[i].id != 0) {
  4868. if (arr[i].children != null && arr[i].children.length>0) {
  4869. arr[i].children = this.changeArr(arr[i].children);
  4870. }
  4871. arr[i].id && (arr[i].value = arr[i].id);
  4872. delete arr[i].id;
  4873. }
  4874. }
  4875. for(var i in arr) {
  4876. if(arr[i].id == -1 || arr[i].id == 0) {
  4877. arr.splice(i,1)
  4878. }
  4879. }
  4880. return arr;
  4881. },
  4882. //时间段范围设置改动,监听
  4883. onTimeTypeChange(timeType) {
  4884. this.seleChn(1)
  4885. this.showAddMore = true;
  4886. for(var i in this.workForm.domains) {
  4887. if (this.workForm.domains[i].timeType == 0) {
  4888. this.showAddMore = false;
  4889. break;
  4890. }
  4891. }
  4892. if (this.showAddMore) {
  4893. //检测数量
  4894. if (this.workForm.domains.length == 2) {
  4895. this.showAddMore = false;
  4896. } else {
  4897. this.showAddMore = true;
  4898. }
  4899. }
  4900. },
  4901. getTimeType() {
  4902. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4903. res => {
  4904. if (res.code == "ok") {
  4905. var t = res.data;
  4906. this.reportTimeType = t;
  4907. if (this.reportTimeType.type > 0) {
  4908. this.showAddMore = true;
  4909. }
  4910. //转化时间格式
  4911. if (t.allday != null) {
  4912. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4913. }
  4914. if (t.am != null) {
  4915. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4916. }
  4917. if (t.pm != null) {
  4918. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4919. }
  4920. let arr = []
  4921. for(var i in res.data.excludeTimeList) {
  4922. let obj = {
  4923. s: res.data.excludeTimeList[i].startTime,
  4924. e: res.data.excludeTimeList[i].endTime,
  4925. }
  4926. arr.push(obj)
  4927. }
  4928. this.vacationTime = arr
  4929. } else {
  4930. this.$message({
  4931. message: res.msg,
  4932. type: "error"
  4933. });
  4934. }
  4935. },
  4936. error => {
  4937. this.listLoading = false;
  4938. this.$message({
  4939. message: error,
  4940. type: "error"
  4941. });
  4942. });
  4943. },
  4944. // 改变月份 -------
  4945. changeMonthOut() {
  4946. this.getAllDate();
  4947. this.getReportList();
  4948. this.getDepartment();
  4949. },
  4950. // 选择日期
  4951. choseDate(i, item) {
  4952. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4953. return
  4954. }
  4955. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4956. this.choseDay = i;
  4957. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4958. sessionStorage.msg = this.date + day,
  4959. this.getReportList();
  4960. this.getDepartment();
  4961. this.curDate = item.date;
  4962. },
  4963. canClick(i, item){
  4964. let nowDate = new Date()
  4965. let nowDateYear = nowDate.getFullYear()
  4966. let itemYear = parseInt(this.date.split('-')[0])
  4967. let nowDateMonth = nowDate.getMonth() + 1
  4968. let itemMonth = parseInt(this.date.split('-')[1])
  4969. let nowDateDay = nowDate.getDate()
  4970. let itemDay = parseInt(item.showDate.split('.')[1])
  4971. if(nowDateYear < itemYear){
  4972. return false
  4973. }else if(nowDateYear == itemYear){
  4974. if(nowDateMonth < itemMonth){
  4975. return false
  4976. }else if(nowDateMonth == itemMonth){
  4977. if(nowDateDay < itemDay){
  4978. return false
  4979. }
  4980. }
  4981. }
  4982. },
  4983. // 获取日期列表
  4984. getAllDate(e) {
  4985. var dayArry = [];
  4986. var day = this.getCountDays();
  4987. let curMonthDay = null;
  4988. for (var k = 1; k <= day; k++) {
  4989. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4990. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4991. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4992. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4993. if(sessionStorage.msg) {
  4994. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4995. this.choseDay = k - 1;
  4996. curMonthDay = str;
  4997. }
  4998. } else {
  4999. if (new Date().getDate() == k) {
  5000. this.choseDay = k - 1;
  5001. }
  5002. }
  5003. } else {
  5004. this.choseDay = 0;
  5005. }
  5006. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5007. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5008. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5009. }
  5010. this.allDate = dayArry;
  5011. //不能超过最大日期
  5012. if (this.choseDay > day-1) {
  5013. this.choseDay = day-1;
  5014. }
  5015. if(sessionStorage.from != 1){
  5016. let nowmonth = new Date().getMonth() + 1
  5017. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5018. let nowdate = new Date().getDate()
  5019. if(nowd == this.date){
  5020. if(e && sessionStorage.msg){
  5021. }else{
  5022. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5023. }
  5024. let nowday = new Date(sessionStorage.msg).getDate()
  5025. this.choseDay = nowday - 1
  5026. let monthdate = new Date(sessionStorage.msg)
  5027. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5028. }else{
  5029. if(e && sessionStorage.msg){
  5030. }else{
  5031. sessionStorage.msg = this.date + '-01'
  5032. }
  5033. let monthdate = new Date(sessionStorage.msg)
  5034. this.choseDay = monthdate.getDate() - 1
  5035. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5036. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5037. }
  5038. }else{
  5039. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5040. }
  5041. //从消息点击跳转过来的,直接加载指定日期
  5042. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5043. this.curDate = sessionStorage.msg;
  5044. sessionStorage.from = 0;
  5045. } else {
  5046. // if (curMonthDay != null) {
  5047. // // this.curDate = curMonthDay;
  5048. // let d = new Date(sessionStorage.msg)
  5049. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5050. // } else {
  5051. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5052. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5053. // }
  5054. }
  5055. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5056. // if(!sessionStorage.msg){
  5057. // let msgday = this.choseDay + 1
  5058. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5059. // }
  5060. this.getReportFillStatus();
  5061. },
  5062. getCountDays() {
  5063. var newstr = this.date.replace(/-/g, "/");
  5064. var curDate = new Date(newstr+'/01');
  5065. var curMonth = curDate.getMonth();
  5066. curDate.setMonth(curMonth + 1);
  5067. curDate.setDate(0);
  5068. return curDate.getDate();
  5069. },
  5070. //获取日报列表
  5071. getReportList() {
  5072. this.listLoading = true;
  5073. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5074. let param = {date: this.date + day};
  5075. if (this.deptId) {
  5076. param.deptId = this.deptId;
  5077. }
  5078. if (this.targetUid) {
  5079. param.userId = this.targetUid;
  5080. }
  5081. this.http.post( this.port.report.list, param,
  5082. res => {
  5083. this.listLoading = false;
  5084. if (res.code == "ok") {
  5085. this.reportList = res.data;
  5086. if(document.querySelector("#day"+this.choseDay)){
  5087. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5088. }
  5089. } else {
  5090. this.$message({
  5091. message: res.msg,
  5092. type: "error"
  5093. });
  5094. }
  5095. },
  5096. error => {
  5097. this.listLoading = false;
  5098. this.$message({
  5099. message: error,
  5100. type: "error"
  5101. });
  5102. });
  5103. },
  5104. // 处理数据
  5105. // dealWith() {
  5106. // var tianxie = 0
  5107. // var weixtianxie = 0
  5108. // if(this.selectState == -1) {
  5109. // } else {
  5110. // var arr = []
  5111. // for (var i in this.reportList) {
  5112. // arr.push(this.reportList[i].id)
  5113. // }
  5114. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  5115. // }
  5116. // },
  5117. // getDealWith(item, tx, wtx, arr) {
  5118. // for(var i in item) {
  5119. // if(item[i].children) {
  5120. // this.getDealWith(item[i].children, tx, wtx, arr)
  5121. // } else {
  5122. // if(arr.indexOf(item[i].id) != '-1') {
  5123. // tx = +tx + 1
  5124. // }
  5125. // }
  5126. // }
  5127. // },
  5128. //导出员工工时统计
  5129. exportUserTime() {
  5130. this.listLoading = true;
  5131. var param = {};
  5132. if (this.exportParam.dateRange != null) {
  5133. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5134. }
  5135. this.http.post('/department/exportDeptStatistic', param,
  5136. res => {
  5137. this.listLoading = false;
  5138. if (res.code == "ok") {
  5139. location.href = res.data;
  5140. this.exportTimeDialog = false;
  5141. } else {
  5142. this.$message({
  5143. message: res.msg,
  5144. type: "error"
  5145. });
  5146. }
  5147. },
  5148. error => {
  5149. this.listLoading = false;
  5150. this.$message({
  5151. message: error,
  5152. type: "error"
  5153. });
  5154. });
  5155. },
  5156. //导出日报
  5157. exportReport() {
  5158. this.exportingData = true;
  5159. var param = {};
  5160. if (this.exportParam.dateRange != null) {
  5161. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5162. }
  5163. if (this.exportParam.projectId != null) {
  5164. param.projectId = this.exportParam.projectId;
  5165. }
  5166. if (this.exportParam.departmentId != null) {
  5167. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5168. }
  5169. param.stateKey = this.stateKey
  5170. // param.departmentId = this.user.departmentId
  5171. console.log(param, '《=== 导出传的参数')
  5172. this.http.post( this.port.report.export, param,
  5173. res => {
  5174. this.exportingData = false;
  5175. if (res.code == "ok") {
  5176. location.href = res.data;
  5177. this.exportDialog = false;
  5178. } else {
  5179. this.$message({
  5180. message: res.msg,
  5181. type: "error"
  5182. });
  5183. }
  5184. },
  5185. error => {
  5186. this.exportingData = false;
  5187. this.$message({
  5188. message: error,
  5189. type: "error"
  5190. });
  5191. });
  5192. },
  5193. //获取项目列表
  5194. getProjectList() {
  5195. this.listLoading = true;
  5196. this.http.post( this.port.project.list, {},
  5197. res => {
  5198. this.listLoading = false;
  5199. if (res.code == "ok") {
  5200. for(var i in res.data) {
  5201. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5202. res.data[i].projectCode = ''
  5203. }
  5204. }
  5205. this.projectList = res.data;
  5206. console.log("项目列表",this.projectList);
  5207. } else {
  5208. this.$message({
  5209. message: res.msg,
  5210. type: "error"
  5211. });
  5212. }
  5213. },
  5214. error => {
  5215. this.listLoading = false;
  5216. this.$message({
  5217. message: error,
  5218. type: "error"
  5219. });
  5220. });
  5221. },
  5222. // 获取填报日报的项目下拉列表
  5223. getFillProjectList() {
  5224. this.http.post( this.port.project.list, {
  5225. forReport: 1
  5226. },res => {
  5227. if (res.code == "ok") {
  5228. for(var i in res.data) {
  5229. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5230. res.data[i].projectCode = ''
  5231. }
  5232. }
  5233. this.fillProjectList = res.data;
  5234. this.getRecentlyProject()
  5235. } else {
  5236. this.$message({
  5237. message: res.msg,
  5238. type: "error"
  5239. });
  5240. }
  5241. },
  5242. error => {
  5243. this.$message({
  5244. message: error,
  5245. type: "error"
  5246. });
  5247. });
  5248. },
  5249. getBasecostItemList() {
  5250. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5251. companyId: this.user.companyId
  5252. },
  5253. res => {
  5254. if (res.code == "ok") {
  5255. this.timeBasecostList = res.data;
  5256. }
  5257. });
  5258. },
  5259. getAIReport(createDate) {
  5260. this.http.post('/report/getAIReport', {},
  5261. res => {
  5262. if (res.code == "ok") {
  5263. var quanbu = 0
  5264. this.jsDay = 1
  5265. var zhi = ''
  5266. var slp = res.data
  5267. for(var i in slp) {
  5268. var sp = +slp[i].workingTime + 0
  5269. zhi = this.jsDay * sp
  5270. quanbu = +quanbu + zhi
  5271. }
  5272. this.jsTime = quanbu
  5273. var aiReportData = res.data;
  5274. this.canCancelInDialog = false
  5275. if(aiReportData.length != 0) {
  5276. var arr = [];
  5277. for(var i in aiReportData) {
  5278. arr.push({
  5279. id: null,
  5280. projectId: aiReportData[i].projectId,
  5281. workingTime: aiReportData[i].workingTime,
  5282. content: '',
  5283. progress:100,
  5284. state: 2,
  5285. timeType: aiReportData[i].timeType,
  5286. subProjectList: aiReportData[i].subProjectList,
  5287. taskList: aiReportData[i].taskList,
  5288. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5289. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5290. taskId: aiReportData[i].taskId,
  5291. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5292. startTime: aiReportData[i].startTime,
  5293. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5294. endTime: aiReportData[i].endTime,
  5295. isOvertime: 0,
  5296. progress:aiReportData[i].progress,
  5297. professionProgress: aiReportData[i].professionProgressList,
  5298. stages:aiReportData[i].stages,
  5299. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5300. pics: null,
  5301. multiWorktime: aiReportData[i].multiWorktime,
  5302. worktimeList: [{}],
  5303. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5304. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5305. wuduList: aiReportData[i].degreeList,
  5306. taskGroups:aiReportData[i].taskGroups,
  5307. customData: aiReportData[i].customData,//自定义的数值
  5308. auditUserList: aiReportData[i].auditUserList,
  5309. projectAuditorId: aiReportData[i].projectAuditorId,
  5310. projectAuditorName: aiReportData[i].projectAuditorName,
  5311. overtimeHours: aiReportData[i].overtimeHours,
  5312. customText: aiReportData[i].customText,
  5313. basecostId: aiReportData[i].basecostId,
  5314. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5315. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5316. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5317. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5318. canEdit: true
  5319. })
  5320. }
  5321. this.workForm.domains = arr;
  5322. } else {
  5323. }
  5324. this.canEdit = true;
  5325. this.originCanEdit = true;
  5326. this.seleChn()
  5327. } else {
  5328. this.$message({
  5329. message: res.msg,
  5330. type: "error"
  5331. });
  5332. }
  5333. },
  5334. error => {
  5335. this.$message({
  5336. message: error,
  5337. type: "error"
  5338. });
  5339. });
  5340. },
  5341. // 获取个人某天的日报 111111
  5342. getReport() {
  5343. this.http.post( this.port.report.getPort, {
  5344. date: this.workForm.createDate
  5345. },
  5346. res => {
  5347. if (res.code == "ok") {
  5348. var quanbu = 0
  5349. this.jsDay = 1
  5350. var zhi = ''
  5351. var slp = res.data.report
  5352. for(var i in slp) {
  5353. var sp = +slp[i].workingTime + 0
  5354. zhi = this.jsDay * sp
  5355. quanbu = +quanbu + zhi
  5356. }
  5357. this.jsTime = quanbu
  5358. var list = res.data;
  5359. this.report = list;
  5360. this.reportTimeType = this.report.timeType;
  5361. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5362. this.isWeekend = !this.report.isWorkDay;
  5363. this.canCancelInDialog = false;
  5364. this.hasWrittenReport = list.report.length != 0;
  5365. if(list.report.length != 0) {
  5366. var arr = [];
  5367. this.canEdit = false;
  5368. let candelete = true
  5369. for(var i in list.report) {
  5370. var flg = null
  5371. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5372. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5373. var filteredRespList = null
  5374. if (targetP.length > 0) {
  5375. var isPublic = targetP[0].isPublic;
  5376. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5377. }
  5378. arr.push({
  5379. id: list.report[i].id,
  5380. projectId: list.report[i].projectId,
  5381. workingTime: list.report[i].workingTime,
  5382. content: list.report[i].content,
  5383. state: list.report[i].state,
  5384. timeType: list.report[i].timeType,
  5385. subProjectList: list.report[i].subProjectList,
  5386. taskList: list.report[i].taskList,
  5387. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5388. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5389. taskId: list.report[i].taskId,
  5390. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5391. startTime: list.report[i].startTime,
  5392. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5393. endTime: list.report[i].endTime,
  5394. isOvertime: flg,
  5395. progress:list.report[i].progress,
  5396. professionProgress: list.report[i].professionProgressList,
  5397. stages:list.report[i].stages,
  5398. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5399. pics: list.report[i].pics,
  5400. multiWorktime: list.report[i].multiWorktime,
  5401. worktimeList: list.report[i].worktimeList,
  5402. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5403. multiDegrIdArray: list.report[i].multiDegrIdList,
  5404. wuduList: list.report[i].degreeList,
  5405. taskGroups:list.report[i].taskGroups,
  5406. customData: list.report[i].customData,//自定义的数值
  5407. auditUserList: list.report[i].auditUserList,
  5408. projectAuditorId: list.report[i].projectAuditorId,
  5409. projectAuditorName: list.report[i].projectAuditorName,
  5410. overtimeHours: list.report[i].overtimeHours,
  5411. customText: list.report[i].customText,
  5412. basecostId: list.report[i].basecostId,
  5413. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5414. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5415. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5416. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5417. canEdit: list.report[i].state >= 2 ? true : false,
  5418. extraField1: list.report[i].extraField1,
  5419. extraField2: list.report[i].extraField2,
  5420. extraField3: list.report[i].extraField3,
  5421. workContentList: list.report[i].workContentList,
  5422. filteredRespList: filteredRespList,
  5423. serviceList: list.report[i].serviceList,
  5424. sapServiceId: list.report[i].sapServiceId,
  5425. })
  5426. if (list.report[i].state >= 2) {
  5427. this.canEdit = true;
  5428. }
  5429. if(list.report[i].state < 2){
  5430. candelete = false
  5431. }
  5432. if (list.report[i].state == 0){
  5433. this.canCancelInDialog = true
  5434. }
  5435. // 加判断
  5436. if(this.user.timeType.choseFromAlbum == 1) {
  5437. let arrList = []
  5438. for(var k in list.report[i].pics) {
  5439. let obj = {
  5440. name: k,
  5441. url: list.report[i].pics[k]
  5442. }
  5443. arrList.push(obj)
  5444. }
  5445. arr[i].imgListUrl = arrList
  5446. arr[i].imgList = list.report[i].pics
  5447. }
  5448. }
  5449. this.reportCanDelete = candelete
  5450. this.workForm = {
  5451. createDate: this.workForm.createDate,
  5452. domains: arr,
  5453. userNames:null,
  5454. userId:null,
  5455. time: list.time
  5456. }
  5457. console.log('workForm', this.workForm)
  5458. } else {
  5459. this.workForm = {
  5460. createDate: this.workForm.createDate,
  5461. domains: [{
  5462. id: null,
  5463. projectId: "",
  5464. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5465. content: "",
  5466. progress:100,
  5467. state: 2,
  5468. timeType:0,
  5469. multiWorktime: this.reportTimeType.multiWorktime,
  5470. worktimeList:[{}],
  5471. canEdit: true,
  5472. auditorFirst: '',
  5473. auditorSec: '',
  5474. auditorThird: '',
  5475. ccUserid: ''
  5476. }],
  5477. userId:null,
  5478. userNames:null,
  5479. time: this.report.time
  5480. }
  5481. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5482. this.$set(this.workForm.domains[0],'isOvertime',true)
  5483. if(this.reportTimeType.type != 2){
  5484. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5485. }
  5486. }
  5487. if(this.user.timeType.type == 1) {
  5488. var shuzhi = this.user.timeType.allday + ''
  5489. // console.log('执行一次', shuzhi.indexOf('.'))
  5490. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5491. }
  5492. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5493. //默认给第一个,必填字段
  5494. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5495. }
  5496. this.canEdit = true;
  5497. }
  5498. this.originCanEdit = this.canEdit;
  5499. this.seleChn()
  5500. } else {
  5501. this.$message({
  5502. message: res.msg,
  5503. type: "error"
  5504. });
  5505. }
  5506. },
  5507. error => {
  5508. this.$message({
  5509. message: error,
  5510. type: "error"
  5511. });
  5512. });
  5513. },
  5514. guanbi() {
  5515. this.falsss = false,
  5516. this.workTimeForMinYi=0
  5517. },
  5518. // 打开日报填写
  5519. fillInReport(i, isBatch) {
  5520. this.isWeekend = false
  5521. this.reportCanDelete = false
  5522. // console.log(this.user.timeType.type, '选择时长')
  5523. if(i != 1) {
  5524. this.falsss = false
  5525. } else {
  5526. this.falsss = true
  5527. }
  5528. if (this.isSubstitude) {
  5529. this.getSubstitudeUserDeptList();
  5530. }
  5531. if(i == -1 || this.isSubstitude) {
  5532. this.isDisable = false;
  5533. } else {
  5534. this.isDisable = true;
  5535. }
  5536. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5537. this.isBatch = isBatch;
  5538. if (this.isBatch == 0 && !this.isSubstitude) {
  5539. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5540. let weekday = new Date(this.workForm.createDate).getDay()
  5541. if(this.user.companyId == 817){
  5542. if(weekday == 0){
  5543. this.isWeekend = true
  5544. }
  5545. }else{
  5546. if(weekday == 0 || weekday == 6){
  5547. this.isWeekend = true
  5548. }
  5549. }
  5550. this.getReport(i);
  5551. } else {
  5552. // console.log('执行到了这里')
  5553. this.jsTime = 0
  5554. this.jsDay = 0
  5555. this.workForm = {
  5556. createDate: null,//批量填报没有日期
  5557. domains: [{
  5558. id: null,
  5559. projectId: "",
  5560. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5561. content: "",
  5562. progress:100,
  5563. state: 2,
  5564. timeType:0,
  5565. multiWorktime: this.reportTimeType.multiWorktime,
  5566. worktimeList:[{}],
  5567. canEdit: true,
  5568. }],
  5569. }
  5570. if(this.user.timeType.type == 1) {
  5571. var shuzhi = this.user.timeType.allday + ''
  5572. // console.log('执行二次')
  5573. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5574. }
  5575. // console.log(this.workForm)
  5576. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5577. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5578. }
  5579. this.canEdit = true;
  5580. }
  5581. this.dialogVisible = true;
  5582. },
  5583. //按周填报的弹窗口中编辑单项目相关数据
  5584. setWeekFormReportItem(reportId, i, names, row,sss) {
  5585. console.log(sss)
  5586. this.http.post('/report/getReportById', {
  5587. reportId: reportId
  5588. },
  5589. res => {
  5590. if (res.code == "ok") {
  5591. var data = res.data.report;
  5592. sss.subProjectId = data.subProjectId
  5593. sss.subProjectList = data.subProjectList;
  5594. sss.stage = data.stage
  5595. sss.subProjectList = data.subProjectList
  5596. sss.stages = data.stages
  5597. sss.taskGroups = data.taskGroups;
  5598. sss.auditUserList = data.auditUserList;
  5599. sss.degreeId = data.degreeId;
  5600. sss.customData = data.customData;
  5601. sss.wuduList = data.degreeList;
  5602. this.zhoBaoIdx = i
  5603. this.zhoBaoName = names
  5604. this.zhoBao = sss
  5605. this.zhis = row
  5606. if (sss.groupId) {
  5607. //最后一个参数表示是否保留stage的值,不要重置为空
  5608. this.getGroupStages(this.zhoBao, 0, true)
  5609. }
  5610. this.$forceUpdate();
  5611. }
  5612. });
  5613. },
  5614. // 按周填报里内容的填写
  5615. tianxies(item, i, names, row) {
  5616. if (item.state == 0) {
  5617. this.$message({
  5618. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5619. type: "error"
  5620. });
  5621. return;
  5622. }
  5623. if (item.state == 1) {
  5624. this.$message({
  5625. message: '已通过状态不可修改',
  5626. type: "error"
  5627. });
  5628. return;
  5629. }
  5630. if(this.user.timeType.notAllowedNoAttendance == 1){
  5631. if(this.zhoData[i].corpTime){
  5632. if(this.zhoData[i].corpTime.workHours == 0){
  5633. this.$message({
  5634. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5635. type: 'error'
  5636. })
  5637. return
  5638. }
  5639. }else{
  5640. this.$message({
  5641. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5642. type: 'error'
  5643. })
  5644. return
  5645. }
  5646. }
  5647. var idd = ''
  5648. var obj = {}
  5649. for(var l in this.projectList) {
  5650. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5651. }
  5652. obj.projectId = idd
  5653. this.tianxieDialogVisible = true
  5654. this.scopess = item
  5655. console.log(item, '《==== 当前的对象')
  5656. var sss = {}
  5657. if (item.id != null) {
  5658. sss.id = item.id;
  5659. sss.state = item.state;
  5660. } else {
  5661. sss.id = -1;
  5662. sss.state = 3;
  5663. }
  5664. sss.projectId = idd;
  5665. sss.progress = item.progress
  5666. sss.time = item.time
  5667. sss.content = item.content;
  5668. console.log('333', sss.content)
  5669. if (sss.time == '' && this.reportTimeType.type == 2) {
  5670. //取已填时间范围中最大的一个作为开始时间
  5671. var startTime = '09:00';
  5672. var fillStartTime = '00:00';
  5673. for (var t in this.selProjectList) {
  5674. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5675. if (fillItem.time) {
  5676. if (fillItem.time[1] > fillStartTime) {
  5677. fillStartTime = fillItem.time[1];
  5678. }
  5679. }
  5680. }
  5681. if (fillStartTime == '00:00') {
  5682. fillStartTime = '09:00';
  5683. }
  5684. var fillEndMax = '18:00';
  5685. if (fillStartTime >= '18:00') {
  5686. fillEndMax = '23:59';
  5687. }
  5688. sss.time = [fillStartTime, fillEndMax];
  5689. }
  5690. sss.groupId = item.groupId
  5691. sss.stage = item.stage;
  5692. sss.workingTime = item.workingTime
  5693. sss.projectAuditorId = item.projectAuditorId;
  5694. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5695. //默认选中第一个
  5696. sss.basecostId = this.timeBasecostList[0].id;
  5697. }
  5698. var hasEdited = this.zhoData[i][names].hasEdited;
  5699. if (hasEdited) {
  5700. sss = { ...item }
  5701. //编辑过了
  5702. sss.subProjectId = item.subProjectId
  5703. sss.stage = item.stage
  5704. sss.subProjectList = item.subProjectList
  5705. sss.stages = item.stages
  5706. sss.taskGroups = item.taskGroups;
  5707. console.log(sss.taskGroups, '33333');
  5708. sss.auditUserList = obj.auditUserList;
  5709. sss.degreeId = item.degreeId;
  5710. sss.customData = item.customData;
  5711. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5712. //只有一个审核人,自动设置上去
  5713. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5714. }
  5715. sss.wuduList = item.wuduList;
  5716. this.zhoBaoIdx = i
  5717. this.zhoBaoName = names
  5718. this.zhoBao = sss
  5719. this.zhis = row
  5720. if (sss.groupId) {
  5721. //最后一个参数表示是否保留stage的值,不要重置为空
  5722. this.getGroupStages(this.zhoBao, 0, true)
  5723. }
  5724. this.$forceUpdate();
  5725. this.getWeeklyTaskList(sss)
  5726. console.log('最后的周报 ===>', this.zhoBao)
  5727. } else {
  5728. //第一次打开,获取数据
  5729. if (sss.id == -1) {
  5730. //新填报的
  5731. this.selectProject(obj, 0);
  5732. var that = this
  5733. setTimeout(() =>{
  5734. sss.subProjectId = that.workForm.domains[0].subProjectId
  5735. sss.subProjectList = item.subProjectList;
  5736. sss.stage = that.workForm.domains[0].stage
  5737. sss.subProjectList = that.workForm.domains[0].subProjectList
  5738. sss.stages = that.workForm.domains[0].stages
  5739. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5740. sss.auditUserList = obj.auditUserList;
  5741. sss.degreeId = item.degreeId;
  5742. sss.customData = item.customData;
  5743. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5744. //只有一个审核人,自动设置上去
  5745. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5746. }
  5747. sss.wuduList = row[0].wuduList
  5748. that.zhoBaoIdx = i
  5749. that.zhoBaoName = names
  5750. that.zhoBao = sss
  5751. that.zhis = row
  5752. if (sss.groupId) {
  5753. //最后一个参数表示是否保留stage的值,不要重置为空
  5754. this.getGroupStages(that.zhoBao, 0, false)
  5755. }
  5756. that.$forceUpdate();
  5757. this.getWeeklyTaskList(sss)
  5758. },600);
  5759. } else {
  5760. //编辑填报过的;数据库已经存在的
  5761. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5762. }
  5763. }
  5764. },
  5765. // 按周填报里内容的填写点击确定
  5766. setWeekProItemData() {
  5767. //专业版模式下,任务分组和阶段必填
  5768. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5769. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5770. this.$message({
  5771. message: '任务分组和阶段必填,请检查',
  5772. type: "error"
  5773. });
  5774. return;
  5775. }
  5776. }
  5777. //检查子项目是否必填
  5778. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5779. this.$message({
  5780. message: '子项目必填,请检查',
  5781. type: "error"
  5782. });
  5783. return;
  5784. }
  5785. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5786. this.$message({
  5787. message: this.$t('message.Pleaseselectareviewer'),
  5788. type: "error"
  5789. });
  5790. return
  5791. }
  5792. if(this.user.timeType.reportAuditType == 3){
  5793. let auditTips = ''
  5794. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5795. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5796. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5797. if(auditTips){
  5798. auditTips = auditTips.substring(0,auditTips.length - 1)
  5799. this.$message({
  5800. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5801. type: 'error'
  5802. })
  5803. return
  5804. }
  5805. }
  5806. let errtips = ''
  5807. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5808. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5809. errtips += this.user.timeType.customDegreeName + '、'
  5810. }
  5811. }
  5812. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5813. errtips += this.user.timeType.customDataName + '、'
  5814. }
  5815. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5816. errtips += this.user.timeType.customTextName + '、'
  5817. }
  5818. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5819. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5820. }
  5821. if(errtips){
  5822. errtips = errtips.substring(0,errtips.length - 1)
  5823. this.$message({
  5824. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5825. type: 'error'
  5826. })
  5827. return
  5828. }
  5829. this.tianxieDialogVisible = false
  5830. var zhong = this.zhoData
  5831. this.zhoBao.hasEdited = true;
  5832. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5833. this.zhoData = zhong
  5834. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5835. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5836. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5837. },
  5838. // 获取本周
  5839. getCurrentWeek() {
  5840. //今天
  5841. this.targetWeekDate = new Date();
  5842. this.initWeekFormData();
  5843. // this.jiazai()
  5844. },
  5845. // 获取上周
  5846. handleGetPrevWeek() {
  5847. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5848. this.initWeekFormData();
  5849. // this.jiazai()
  5850. },
  5851. // 获取下周
  5852. handleGetNextvWeek() {
  5853. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5854. this.initWeekFormData()
  5855. },
  5856. // 加载动画
  5857. jiazai() {
  5858. this.weekDataLoading = true
  5859. var that = this
  5860. setTimeout(() =>{
  5861. that.weekDataLoading = false
  5862. },1000);
  5863. },
  5864. // 转时间格式
  5865. dealdate(date) {
  5866. const dt = new Date(date)
  5867. const y = dt.getFullYear()
  5868. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5869. const d = (dt.getDate() + '').padStart(2, '0')
  5870. return `${y}-${m}-${d}`
  5871. },
  5872. // 按周填报
  5873. fillInReportss() {
  5874. window.addEventListener('scroll', this.handleScroll, true)
  5875. // this.jiazai()
  5876. this.fillWeekDialogVisi = true
  5877. this.getCurrentWeek();
  5878. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5879. //重新获取工时预警类型的预算项
  5880. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5881. companyId: this.user.companyId
  5882. },
  5883. res => {
  5884. if (res.code == "ok") {
  5885. this.timeBasecostList = res.data;
  5886. }
  5887. });
  5888. }
  5889. },
  5890. fillInReportCustom() {
  5891. this.weekIndex++
  5892. this.weekParentData = {
  5893. isSubstitude: this.isSubstitude
  5894. }
  5895. this.fillWeekDialogVisiCustom = true
  5896. },
  5897. // 按周填报的项目筛选
  5898. selListFun(){
  5899. this.selProjectList = []
  5900. if(this.selCon.length){
  5901. for (let i = 0; i < this.selCon.length; i++) {
  5902. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5903. }
  5904. this.selConShow = false ;
  5905. for (let i in this.zhoData) {
  5906. var obj = this.zhoData[i];
  5907. for(var j in this.selProjectList) {
  5908. var xinzhi = this.selProjectList[j].projectName
  5909. obj[xinzhi] = {}
  5910. obj[xinzhi].time = ''
  5911. obj[xinzhi].content = ''
  5912. obj[xinzhi].progress = 0
  5913. obj[xinzhi].workingTime = 0
  5914. }
  5915. }
  5916. this.initWeekFormData();
  5917. }else{
  5918. this.$message({
  5919. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5920. type:'error'
  5921. })
  5922. }
  5923. },
  5924. setWeekCardTimeData(list) {
  5925. for(let i in list){
  5926. let datei = '';
  5927. if (this.user.timeType.showDdCardtime == 1) {
  5928. datei = list[i].workDate;
  5929. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5930. datei = list[i].createDate;
  5931. } else if (this.user.timeType.syncFanwei == 1) {
  5932. datei = list[i].workDate;
  5933. }
  5934. for(let m in this.zhoData) {
  5935. if(datei == this.zhoData[m].zhoDataTime){
  5936. let item = {
  5937. startTime: list[i].startTime,
  5938. endTime: list[i].endTime,
  5939. workHours: list[i].workHours
  5940. }
  5941. this.$set(this.zhoData[m],'corpTime',item)
  5942. }
  5943. }
  5944. }
  5945. },
  5946. getWeeklyCardTime(){ //按周填报获取考勤信息
  5947. let dateStr = []
  5948. for(let i in this.zhoData){
  5949. dateStr.push(this.zhoData[i].zhoDataTime)
  5950. }
  5951. this.http.post('/report/getWeeklyCardTime',{
  5952. dateStr: JSON.stringify(dateStr)
  5953. },res => {
  5954. if(res.code == 'ok'){
  5955. for(let i in res.data){
  5956. let datei = '';
  5957. if (this.user.timeType.showDdCardtime == 1) {
  5958. datei = res.data[i].workDate.split('-');
  5959. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5960. datei = res.data[i].createDate.split('-');
  5961. }
  5962. for(let m in this.zhoData){
  5963. let datem = new Date(this.zhoData[m].zhoDataTime)
  5964. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5965. let item = {
  5966. startTime: res.data[i].startTime,
  5967. endTime: res.data[i].endTime,
  5968. workHours: res.data[i].workHours
  5969. }
  5970. this.$set(this.zhoData[m],'corpTime',item)
  5971. }
  5972. }
  5973. }
  5974. }else{
  5975. this.$message({
  5976. message: res.msg,
  5977. type: 'error'
  5978. })
  5979. }
  5980. },err => {
  5981. this.$message({
  5982. message: err,
  5983. type: 'error'
  5984. })
  5985. })
  5986. },
  5987. selListqx(){
  5988. this.fillWeekDialogVisi = false
  5989. this.selProjectList = []
  5990. this.selCon = []
  5991. },
  5992. handleScroll() {
  5993. this.changdu = this.projectList.length + 1
  5994. },
  5995. // 自动选择时间点的事件
  5996. // async zhoTimes(item, i) {
  5997. // var iss = i
  5998. // if(item.time == null) {
  5999. // return
  6000. // } else {
  6001. // const zhi = this.zhoData[iss];
  6002. // let he = 0;
  6003. // const timeArr = Object.values(zhi)
  6004. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6005. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6006. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6007. // console.log(data, 'data');
  6008. // zhi.he = `${he}h`;
  6009. // }
  6010. // },
  6011. async zhoTimes(item, index) {
  6012. const zho = this.zhoData[index];
  6013. if (!item.time) {
  6014. return;
  6015. }
  6016. const timeArr = Object.values(zho)
  6017. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6018. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6019. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6020. zho.he = `${totalHours[0]}h`;
  6021. },
  6022. // 判断两个时间段是否重叠
  6023. timeOverlap(idx, dateAr) {
  6024. let zhi = 0
  6025. for (let k in dateAr) {
  6026. if (idx !== k) {
  6027. 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))) {
  6028. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6029. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6030. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6031. }
  6032. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6033. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6034. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6035. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6036. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6037. } else {
  6038. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6039. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6040. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6041. }
  6042. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6043. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6044. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6045. }
  6046. }
  6047. }
  6048. }
  6049. }
  6050. return zhi
  6051. },
  6052. // 计算时间
  6053. getHourMinutes(str, end) {
  6054. var he = 0
  6055. var date2 = '2021/12/12 ' + end +':00'
  6056. var date1 = '2021/12/12 ' + str +':00'
  6057. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6058. var leave1=date3%(24*3600*1000)
  6059. var hours=Math.floor(leave1/(3600*1000))
  6060. var leave2=leave1%(3600*1000)
  6061. var minutes=Math.floor(leave2/(60*1000))
  6062. var shi = hours+'.'+ minutes
  6063. return he += +shi
  6064. },
  6065. // 自动选择事件长度的事件
  6066. zhoXuan(item, i) {
  6067. var iss = i
  6068. if(item.time == null) {
  6069. return
  6070. } else {
  6071. var zhi = this.zhoData[iss]
  6072. var he = 0
  6073. for(var i in zhi) {
  6074. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6075. he += +zhi[i].workingTime
  6076. }
  6077. }
  6078. zhi.he = he + 'h'
  6079. }
  6080. },
  6081. getPushWorkLogData(){
  6082. this.http.post('/sap-sync-log/list', {},
  6083. res => {
  6084. if (res.code == "ok") {
  6085. this.pushWorkTimeLogData = res.data;
  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. // 获取全部人员
  6101. getUsers() {
  6102. this.http.post('/user/getSimpleActiveUserList', {},
  6103. res => {
  6104. if (res.code == "ok") {
  6105. this.usersList = res.data;
  6106. } else {
  6107. this.$message({
  6108. message: res.msg,
  6109. type: "error"
  6110. });
  6111. }
  6112. },
  6113. error => {
  6114. this.$message({
  6115. message: error,
  6116. type: "error"
  6117. });
  6118. });
  6119. },
  6120. // 按时间比例
  6121. addBli(item, i) {
  6122. var iss = i
  6123. if(item.time == null) {
  6124. return
  6125. } else {
  6126. var zhi = this.zhoData[iss]
  6127. var he = 0
  6128. for(var i in zhi) {
  6129. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6130. he += +zhi[i].workingTime
  6131. }
  6132. }
  6133. zhi.he = he.toFixed(1) + 'h'
  6134. }
  6135. },
  6136. //按周填报选择的项目发生变化,需要设置列
  6137. onSelProjectChange() {
  6138. for (let i = 0; i < this.selCon.length; i++) {
  6139. var exists = false;
  6140. for (let j = 0; j < this.selProjectList.length; j++) {
  6141. if (this.selProjectList[j].id == this.selCon[i]) {
  6142. exists = true;
  6143. break;
  6144. }
  6145. }
  6146. if (!exists) {
  6147. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6148. this.selProjectList.push(newProject);
  6149. //添加新项目
  6150. for (var w in this.zhoData) {
  6151. var dayItem = this.zhoData[w];
  6152. var pName = newProject.projectName;
  6153. dayItem[pName] = {};
  6154. dayItem[pName].time = ''
  6155. dayItem[pName].content = ''
  6156. dayItem[pName].progress = 0
  6157. dayItem[pName].workingTime = 0
  6158. }
  6159. }
  6160. }
  6161. //去掉
  6162. for (let j = 0; j < this.selProjectList.length; j++) {
  6163. var exists = false;
  6164. for (let i = 0; i < this.selCon.length; i++) {
  6165. if (this.selProjectList[j].id == this.selCon[i]) {
  6166. exists = true;
  6167. break;
  6168. }
  6169. }
  6170. if (!exists) {
  6171. this.selProjectList.splice(j, 1);
  6172. j--;
  6173. }
  6174. }
  6175. this.loadFilledWeekReportItem();
  6176. //刷新表格
  6177. // this.$refs.weekTable.doLayout();
  6178. },
  6179. //根据选中的项目来刷新填写表格
  6180. loadFilledWeekReportItem() {
  6181. for (var w in this.zhoData) {
  6182. var dayItem = this.zhoData[w];
  6183. for (var i = 0; i < this.selProjectList.length; i++) {
  6184. var curColumnProject = this.selProjectList[i];
  6185. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6186. for (var t in dayItem.reportList) {
  6187. //有日报的项目,不能取消选择
  6188. for (var p in this.fillProjectList) {
  6189. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6190. }
  6191. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6192. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6193. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6194. if (this.reportTimeType.type == 2) {
  6195. //时间段模式
  6196. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6197. }
  6198. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6199. break;
  6200. }
  6201. }
  6202. // dayItem[curColumnProject.projectName] = matchReportItem;
  6203. }
  6204. }
  6205. this.$nextTick(()=>{
  6206. this.$refs.weekTable.doLayout();
  6207. });
  6208. },
  6209. initWeekFormData() {
  6210. this.weekDataLoading = true;
  6211. for (var p in this.fillProjectList) {
  6212. this.fillProjectList[p].canCancel = 1;
  6213. }
  6214. this.http.post('/report/getWeeklyReportData',{
  6215. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6216. },res => {
  6217. this.weekDataLoading = false;
  6218. if(res.code == 'ok'){
  6219. let projectList = res.data.projectList;
  6220. if (projectList.length > 0) {
  6221. //有选择过项目进行填报,直接选中
  6222. this.selProjectList = projectList;
  6223. this.selCon = [];
  6224. for (let i = 0; i < projectList.length; i++) {
  6225. this.selCon.push(projectList[i].id);
  6226. }
  6227. }
  6228. //设置日期
  6229. this.weekDateRange = res.data.dateList;
  6230. this.zhoData = [];
  6231. var arrst = []
  6232. for(var i in this.weekDateRange) {
  6233. var obj = {}
  6234. obj.zhoDataTime = this.weekDateRange[i].date
  6235. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6236. obj.he = this.weekDateRange[i].filledTime;
  6237. obj.canFill = this.weekDateRange[i].canFill;
  6238. // obj.filledTime = this.weekDateRange[i].filledTime;
  6239. obj.reportList = this.weekDateRange[i].reportList;
  6240. //初始化,防止渲染报错
  6241. for (var j = 0; j < this.selProjectList.length; j++) {
  6242. var pName = this.selProjectList[j].projectName
  6243. obj[pName] = {}
  6244. obj[pName].time = ''
  6245. obj[pName].content = ''
  6246. obj[pName].progress = 0
  6247. obj[pName].workingTime = 0
  6248. }
  6249. arrst.push(obj)
  6250. }
  6251. this.zhoData = arrst
  6252. this.setWeekCardTimeData(res.data.cardTimeList);
  6253. this.loadFilledWeekReportItem();
  6254. }else{
  6255. this.$message({
  6256. message: res.msg,
  6257. type: 'error'
  6258. })
  6259. }
  6260. },err => {
  6261. this.$message({
  6262. message: err,
  6263. type: 'error'
  6264. })
  6265. })
  6266. },
  6267. zhoZhi(res, i) {
  6268. var zhi = 0
  6269. for(var i in res) {
  6270. if(i != 'zhoDataTime' && i != 'he') {
  6271. zhi += +res[i]
  6272. }
  6273. }
  6274. res.he = zhi
  6275. },
  6276. zhoBtn(i) {
  6277. // this.zhoData.split(i, 1)
  6278. var arr = this.zhoData
  6279. arr.splice(i, 1)
  6280. },
  6281. zhoAddlast(){
  6282. this.selConShow = true
  6283. },
  6284. closeAddWeeklyReport(){
  6285. this.fillWeekDialogVisi = false
  6286. this.selConShow = true
  6287. this.selProjectList = []
  6288. this.selCon = []
  6289. },
  6290. // 提交按周填报
  6291. submitWeekReport(isDraft) {
  6292. var zhi = this.zhoData
  6293. var ll = 0
  6294. if(this.reportTimeType.type == 2) {
  6295. for(var i in zhi) {
  6296. this.dateAr = []
  6297. var alp = []
  6298. var zhis = zhi[i]
  6299. console.log(zhis)
  6300. for(var j in zhis) {
  6301. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6302. let objs = {}
  6303. objs.s = zhis[j].time[0]
  6304. objs.e = zhis[j].time[1]
  6305. objs.p = j
  6306. alp.push(objs)
  6307. }
  6308. }
  6309. console.log(alp)
  6310. this.dateAr = alp
  6311. if (this.reportTimeType.timeCanOverlap == 0) {
  6312. let str = this.$t('message.Filledtimeperiodsoverlap')
  6313. if(this.dateAr.length > 0) {
  6314. const trus = this.fns();
  6315. const overlapDataTime = this.getOverlapData(alp);
  6316. if (overlapDataTime.length > 0) {
  6317. const arrList = overlapDataTime.map((item) => item.p);
  6318. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6319. }
  6320. ll += 1
  6321. if(!trus) {
  6322. this.$message({
  6323. message: str,
  6324. type: 'error'
  6325. })
  6326. return false
  6327. }
  6328. }
  6329. } else {
  6330. if(this.dateAr.length > 0) {
  6331. ll +=1 ;
  6332. }
  6333. }
  6334. }
  6335. if(ll == 0) {
  6336. this.$message({
  6337. message: this.$t('message.Pleasefillinthetime'),
  6338. type: 'error'
  6339. })
  6340. return false
  6341. }
  6342. } else if(this.reportTimeType.type == 1){
  6343. for(var i in zhi) {
  6344. var zhis = zhi[i]
  6345. for(var j in zhis) {
  6346. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6347. ll += 1
  6348. }
  6349. }
  6350. }
  6351. if(ll == 0) {
  6352. this.$message({
  6353. message: this.$t('message.Pleaseselectatime'),
  6354. type: 'error'
  6355. })
  6356. return false
  6357. }
  6358. let overcorp = ''
  6359. for(let n in zhi){
  6360. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6361. overcorp += zhi[n].zhoDataTime + ','
  6362. }
  6363. }
  6364. if(overcorp != ''){
  6365. overcorp = overcorp.substring(0,overcorp.length - 1)
  6366. this.$message({
  6367. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6368. type: 'error'
  6369. })
  6370. return
  6371. }
  6372. }
  6373. var submits = []
  6374. let formData = new FormData();
  6375. formData.append("draft", isDraft);
  6376. if(this.reportTimeType.multiWorktime == 1){
  6377. for (var i in this.zhoData) {
  6378. var zhoD = this.zhoData[i]
  6379. var flgs = false
  6380. for(var j in zhoD) {
  6381. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6382. flgs = true
  6383. // formData.append("degreeId", "-1");
  6384. formData.append("id", '-1');
  6385. for(var s in this.projectList) {
  6386. if(j == this.projectList[s].projectName) {
  6387. formData.append("projectId", this.projectList[s].id);
  6388. }
  6389. }
  6390. if(this.user.timeType.reportAuditType == 3){
  6391. let audItem = {}
  6392. if(this.user.timeType.auditLevel > 0){
  6393. audItem.auditorFirst = zhoD[j].auditorFirst
  6394. }
  6395. if(this.user.timeType.auditLevel > 1){
  6396. audItem.auditorSec = zhoD[j].auditorSec
  6397. }
  6398. if(this.user.timeType.auditLevel > 2){
  6399. audItem.auditorThird = zhoD[j].auditorThird
  6400. }
  6401. if(zhoD[j].ccUserid){
  6402. audItem.ccUserid = zhoD[j].ccUserid
  6403. }
  6404. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6405. }
  6406. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6407. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6408. formData.append("reportTimeType", this.reportTimeType.type);
  6409. formData.append("endTime", '');
  6410. formData.append("startTime", '');
  6411. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6412. var lix = []
  6413. var objjs = {}
  6414. objjs.startTime = zhoD[j].time[0]
  6415. objjs.endTime = zhoD[j].time[1]
  6416. if (zhoD[j].content == null || zhoD[j].content == '') {
  6417. zhoD[j].content == '-'
  6418. }
  6419. objjs.content = zhoD[j].content
  6420. lix.push(objjs)
  6421. var zhiZhi = JSON.stringify(lix)
  6422. zhiZhi = zhiZhi.replace(/,/g,"@");
  6423. formData.append("content", zhiZhi)
  6424. formData.append("isOvertime", 0)
  6425. formData.append("professionProgress", "[]")
  6426. if (zhoD[j].groupId) {
  6427. formData.append("groupId",zhoD[j].groupId)
  6428. } else {
  6429. //解决后台groupId数组越界的问题
  6430. formData.append("groupId",0)
  6431. }
  6432. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6433. formData.append("createDate",zhoD.zhoDataTime)
  6434. if (zhoD[j].projectAuditorId) {
  6435. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6436. }
  6437. if(zhoD[j].basecostId) {
  6438. formData.append("basecostId", zhoD[j].basecostId);
  6439. } else {
  6440. formData.append("basecostId", 0);
  6441. }
  6442. if(this.user.timeType.customDegreeActive){
  6443. if (this.user.timeType.customDegreeMultiple) {
  6444. if (zhoD[j].multiDegrIdArray) {
  6445. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6446. } else {
  6447. formData.append('multiDegrId','[]')
  6448. }
  6449. } else {
  6450. if (zhoD[j].degreeId) {
  6451. formData.append('degreeId',zhoD[j].degreeId)
  6452. } else {
  6453. formData.append('degreeId','-1')
  6454. }
  6455. }
  6456. }else{
  6457. formData.append("degreeId", "-1");
  6458. }
  6459. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6460. formData.append('customData',zhoD[j].customData)
  6461. }else if(this.user.timeType.customDataActive){
  6462. formData.append('customData',0)
  6463. }
  6464. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6465. formData.append('customText',zhoD[j].customText)
  6466. }else if(this.user.timeType.customTextActive){
  6467. formData.append('customText','-')
  6468. }
  6469. }
  6470. }
  6471. }
  6472. } else {
  6473. for (var i in this.zhoData) {
  6474. var zhoD = this.zhoData[i]
  6475. var flgs = false
  6476. if(this.reportTimeType.type == 2) {
  6477. for(var k in this.selProjectList) {
  6478. var pItem = this.selProjectList[k];
  6479. var pName = pItem.projectName;
  6480. var j = pName;
  6481. console.log('j==周报中的项目='+j);
  6482. if(zhoD[j].time && zhoD[j].time != 'null') {
  6483. flgs = true
  6484. // formData.append("degreeId", "-1");
  6485. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6486. for(var s in this.projectList) {
  6487. if(j == this.projectList[s].projectName) {
  6488. formData.append("projectId", this.projectList[s].id);
  6489. }
  6490. }
  6491. if(this.user.timeType.reportAuditType == 3){
  6492. let audItem = {}
  6493. if(this.user.timeType.auditLevel > 0){
  6494. audItem.auditorFirst = zhoD[j].auditorFirst
  6495. }
  6496. if(this.user.timeType.auditLevel > 1){
  6497. audItem.auditorSec = zhoD[j].auditorSec
  6498. }
  6499. if(this.user.timeType.auditLevel > 2){
  6500. audItem.auditorThird = zhoD[j].auditorThird
  6501. }
  6502. if(zhoD[j].ccUserid){
  6503. audItem.ccUserid = zhoD[j].ccUserid
  6504. }
  6505. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6506. }
  6507. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6508. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6509. formData.append("reportTimeType", this.reportTimeType.type);
  6510. formData.append("endTime", zhoD[j].time[1]);
  6511. formData.append("startTime", zhoD[j].time[0]);
  6512. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6513. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6514. formData.append("isOvertime", 0)
  6515. formData.append("professionProgress", "[]")
  6516. if (zhoD[j].groupId) {
  6517. formData.append("groupId",zhoD[j].groupId)
  6518. } else {
  6519. //解决后台groupId数组越界的问题
  6520. formData.append("groupId",0)
  6521. }
  6522. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6523. formData.append("createDate",zhoD.zhoDataTime)
  6524. if (zhoD[j].projectAuditorId) {
  6525. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6526. }
  6527. if(zhoD[j].basecostId) {
  6528. formData.append("basecostId", zhoD[j].basecostId);
  6529. } else {
  6530. formData.append("basecostId", 0);
  6531. }
  6532. if(this.user.timeType.customDegreeActive){
  6533. if (this.user.timeType.customDegreeMultiple) {
  6534. if (zhoD[j].multiDegrIdArray) {
  6535. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6536. } else {
  6537. formData.append("multiDegrId", "[]");
  6538. }
  6539. } else {
  6540. if (zhoD[j].degreeId) {
  6541. formData.append('degreeId',zhoD[j].degreeId)
  6542. } else {
  6543. formData.append("degreeId", "-1");
  6544. }
  6545. }
  6546. }else{
  6547. formData.append("degreeId", "-1");
  6548. }
  6549. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6550. formData.append('customData',zhoD[j].customData)
  6551. }else if(this.user.timeType.customDataActive){
  6552. formData.append('customData',0)
  6553. }
  6554. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6555. formData.append('customText',zhoD[j].customText)
  6556. }else if(this.user.timeType.customTextActive){
  6557. formData.append('customText','-')
  6558. }
  6559. }
  6560. }
  6561. } else {
  6562. for(var k in this.selProjectList) {
  6563. var pItem = this.selProjectList[k];
  6564. var pName = pItem.projectName;
  6565. var j = pName;
  6566. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6567. flgs = true
  6568. // formData.append("degreeId", "-1");
  6569. console.log('进入了workFpppp==='+j);
  6570. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6571. for(var s in this.projectList) {
  6572. if(j == this.projectList[s].projectName) {
  6573. formData.append("projectId", this.projectList[s].id);
  6574. }
  6575. }
  6576. if(this.user.timeType.reportAuditType == 3){
  6577. let audItem = {}
  6578. if(this.user.timeType.auditLevel > 0){
  6579. audItem.auditorFirst = zhoD[j].auditorFirst
  6580. }
  6581. if(this.user.timeType.auditLevel > 1){
  6582. audItem.auditorSec = zhoD[j].auditorSec
  6583. }
  6584. if(this.user.timeType.auditLevel > 2){
  6585. audItem.auditorThird = zhoD[j].auditorThird
  6586. }
  6587. if(zhoD[j].ccUserid){
  6588. audItem.ccUserid = zhoD[j].ccUserid
  6589. }
  6590. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6591. }
  6592. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6593. // formData.append("subProjectId", zhoD[j].subProjectId);
  6594. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6595. formData.append("reportTimeType", this.reportTimeType.type);
  6596. if(this.reportTimeType.type == 1) {
  6597. formData.append("workingTime", zhoD[j].workingTime);
  6598. } else if(this.reportTimeType.type == 2) {
  6599. formData.append("endTime", zhoD[j].time[1]);
  6600. formData.append("startTime", zhoD[j].time[0]);
  6601. } else if(this.reportTimeType.type == 3) {
  6602. formData.append("progress", zhoD[j].progress);
  6603. formData.append("workingTime", zhoD[j].workingTime);
  6604. }
  6605. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6606. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6607. formData.append("isOvertime", 0)
  6608. formData.append("professionProgress", "[]")
  6609. if (zhoD[j].groupId) {
  6610. formData.append("groupId",zhoD[j].groupId)
  6611. } else {
  6612. //解决后台groupId数组越界的问题
  6613. formData.append("groupId",0)
  6614. }
  6615. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6616. formData.append("createDate",zhoD.zhoDataTime)
  6617. if (zhoD[j].projectAuditorId) {
  6618. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6619. }
  6620. if(zhoD[j].basecostId) {
  6621. formData.append("basecostId", zhoD[j].basecostId);
  6622. } else {
  6623. formData.append("basecostId", 0);
  6624. }
  6625. if(this.user.timeType.customDegreeActive){
  6626. if (this.user.timeType.customDegreeMultiple) {
  6627. if (zhoD[j].multiDegrIdArray) {
  6628. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6629. } else {
  6630. formData.append("multiDegrId", "[]");
  6631. }
  6632. } else {
  6633. if (zhoD[j].degreeId) {
  6634. formData.append('degreeId',zhoD[j].degreeId)
  6635. } else {
  6636. formData.append("degreeId", "-1");
  6637. }
  6638. }
  6639. }else{
  6640. formData.append("degreeId", "-1");
  6641. }
  6642. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6643. formData.append('customData',zhoD[j].customData)
  6644. }else if(this.user.timeType.customDataActive){
  6645. formData.append('customData',0)
  6646. }
  6647. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6648. formData.append('customText',zhoD[j].customText)
  6649. }else if(this.user.timeType.customTextActive){
  6650. formData.append('customText','-')
  6651. }
  6652. }
  6653. }
  6654. }
  6655. }
  6656. }
  6657. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6658. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6659. if(!next) {
  6660. this.$message({
  6661. message: `【${error.join('、')}】请填写任务分组`,
  6662. type: 'error'
  6663. })
  6664. return
  6665. }
  6666. // 自定义维度
  6667. this.submitingReport = true;
  6668. this.http.uploadFile( this.port.report.editPort, formData,
  6669. res => {
  6670. // this.listLoading = false;
  6671. this.submitingReport = false;
  6672. if (res.code == "ok") {
  6673. this.$message({
  6674. message: this.$t('message.fillinsuccessfully'),
  6675. type: "success"
  6676. });
  6677. this.fillWeekDialogVisi = false
  6678. this.selConShow = true
  6679. this.zhoData = []
  6680. this.weekDateRange = ''
  6681. this.getReportList();
  6682. this.getDepartment();
  6683. // 关闭弹窗 并 清空
  6684. this.selProjectList = []
  6685. this.selCon = []
  6686. this.getRecentlyProject()
  6687. } else {
  6688. this.$message({
  6689. message: res.msg,
  6690. type: "error"
  6691. });
  6692. }
  6693. },
  6694. error => {
  6695. this.submitingReport = false;
  6696. this.$message({
  6697. message: error,
  6698. type: "error"
  6699. });
  6700. });
  6701. },
  6702. handleGroupAuditorData(data) {
  6703. const { reportAuditType } = this.user.timeType
  6704. if(reportAuditType != 1 && reportAuditType != 2) {
  6705. return {next: true}
  6706. }
  6707. let arrList = [];
  6708. Object.entries(data).forEach(([key, obj]) => {
  6709. Object.entries(obj).forEach(([projectName, projectData]) => {
  6710. if (projectData.workingTime && !projectData.groupId) {
  6711. arrList.push({
  6712. projectName,
  6713. date: obj.zhoDataTime,
  6714. dateText: obj.zhoDataTimeTxt
  6715. });
  6716. }
  6717. });
  6718. });
  6719. if(arrList.length > 0) {
  6720. return {
  6721. next: false,
  6722. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6723. }
  6724. } else {
  6725. return {
  6726. next: true,
  6727. error: [],
  6728. }
  6729. }
  6730. },
  6731. ChangeHourMinutestr (str) {
  6732. if (str !== "0" && str !== "" && str !== null) {
  6733. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6734. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6735. } else {
  6736. return "";
  6737. }
  6738. },
  6739. // 得到两个日期中间的日期
  6740. getdiffdate(stime,etime){
  6741. //初始化日期列表,数组
  6742. var diffdate = new Array();
  6743. var i=0;
  6744. //开始日期小于等于结束日期,并循环
  6745. while(stime<=etime){
  6746. diffdate[i] = stime;
  6747. //获取开始日期时间戳
  6748. var stime_ts = new Date(stime).getTime();
  6749. //增加一天时间戳后的日期
  6750. var next_date = stime_ts + (24*60*60*1000);
  6751. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6752. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6753. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6754. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6755. stime = next_dates_y+next_dates_m+next_dates_d;
  6756. //增加数组key
  6757. i++;
  6758. }
  6759. return diffdate;
  6760. },
  6761. // 添加模块
  6762. addDomain(i) {
  6763. var leftProgress = 10;
  6764. if (this.reportTimeType.type == 3) {
  6765. //计算已经待分配工时比例
  6766. let array = this.workForm.domains;
  6767. let totalProgress = 0;
  6768. for (var i=0;i<array.length; i++) {
  6769. totalProgress += array[i].progress;
  6770. }
  6771. if (totalProgress < 100) {
  6772. leftProgress = 100 - totalProgress;
  6773. }
  6774. }
  6775. var addItem = {
  6776. projectId: "",
  6777. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6778. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6779. ),
  6780. content: "",
  6781. progress:leftProgress,
  6782. state:2,//2-表示待提交
  6783. multiWorktime: this.reportTimeType.multiWorktime,
  6784. worktimeList:[{}],
  6785. canEdit: true,
  6786. auditorFirst: '',
  6787. auditorSec: '',
  6788. auditorThird: '',
  6789. ccUserid: ''
  6790. // degreeId: '',
  6791. };
  6792. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6793. this.$set(addItem,'isOvertime',true)
  6794. if(this.reportTimeType.type == 3){
  6795. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6796. }
  6797. }
  6798. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6799. //默认给第一个,必填字段
  6800. addItem.basecostId = this.timeBasecostList[0].id;
  6801. }
  6802. this.workForm.domains.push(addItem);
  6803. document.getElementById('workFormsItemBottom').scrollIntoView()
  6804. this.canEdit = true
  6805. if (this.reportTimeType.type == 0) {
  6806. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6807. var length = this.workForm.domains.length;
  6808. if (length == 2) {
  6809. this.showAddMore = false;
  6810. }
  6811. }
  6812. this.chuji()
  6813. this.seleChn()
  6814. },
  6815. // 移除模块
  6816. delDomain(i) {
  6817. this.workForm.domains.splice(i,1)
  6818. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6819. if (!this.originCanEdit) {
  6820. let iscan = false
  6821. for(let i in this.workForm.domains){
  6822. if(this.workForm.domains[i].canEdit){
  6823. iscan = true
  6824. }
  6825. }
  6826. this.canEdit = iscan
  6827. }
  6828. //检测当前剩下的一个,时间类型是否是全天
  6829. if (this.reportTimeType.type == 0) {
  6830. if (this.workForm.domains[0].timeType == 0) {
  6831. this.showAddMore = false;
  6832. } else {
  6833. this.showAddMore = true;
  6834. }
  6835. }
  6836. if(this.user.timeType.multiWorktime == 1) {
  6837. this.iptChangs()
  6838. } else {
  6839. this.seleChn(0)
  6840. }
  6841. },
  6842. // 改变月份
  6843. changeMonth() {
  6844. this.isWeekend = false
  6845. let date = new Date()
  6846. let nowmon = date.getMonth() + 1
  6847. let nowday = date.getDate()
  6848. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6849. if (this.isBatch == 0) {
  6850. if(this.user.timeType.fillAhead == 0){
  6851. let date_a = new Date(this.workForm.createDate)
  6852. if(date_a.getTime() > date.getTime()){
  6853. this.workForm.createDate = nowdate
  6854. }
  6855. }
  6856. //只有按天填报才能获取当天的日报
  6857. if(!this.isSubstitude){
  6858. let weekday = new Date(this.workForm.createDate).getDay()
  6859. if(this.user.companyId == 817){
  6860. if(weekday == 0){
  6861. this.isWeekend = true
  6862. }
  6863. }else{
  6864. if(weekday == 0 || weekday == 6){
  6865. this.isWeekend = true
  6866. }
  6867. }
  6868. this.getReport()
  6869. }
  6870. }else {
  6871. if(this.user.timeType.fillAhead == 0){
  6872. let date_a = new Date(this.workForm.createDate[1])
  6873. if(date_a.getTime() > date.getTime()){
  6874. this.workForm.createDate[1] = nowdate
  6875. let sdate = new Date(this.workForm.createDate[0])
  6876. let edate = new Date(this.workForm.createDate[1])
  6877. if(sdate > edate){
  6878. this.workForm.createDate[0] = this.workForm.createDate[1]
  6879. }
  6880. }
  6881. }
  6882. }
  6883. },
  6884. // 判断时间段
  6885. fns() {
  6886. for (let k in this.dateAr) {
  6887. if (!this.judege(k)) {
  6888. return false
  6889. }
  6890. }
  6891. return true
  6892. },
  6893. judege(idx){
  6894. for (let k in this.dateAr) {
  6895. if (idx !== k) {
  6896. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6897. return false
  6898. }
  6899. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6900. return false
  6901. }
  6902. }
  6903. }
  6904. return true
  6905. },
  6906. getOverlapData(data) {
  6907. let overlapData = [];
  6908. for (let i = 0; i < data.length; i++) {
  6909. for (let j = i + 1; j < data.length; j++) {
  6910. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6911. overlapData.push(data[i], data[j]);
  6912. }
  6913. }
  6914. }
  6915. return overlapData;
  6916. },
  6917. // 保存日报111111
  6918. submitReport(isDraft) {
  6919. this.isDraft = isDraft;
  6920. this.$refs.workForm.validate(valid => {
  6921. if (valid) {
  6922. if(this.totalReportHours < this.user.timeType.allday){
  6923. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6924. confirmButtonText: '确定',
  6925. cancelButtonText: '取消',
  6926. type: 'warning'
  6927. }).then(() => {
  6928. this.submitReportSon()
  6929. }).catch(() => {
  6930. });
  6931. }else{
  6932. this.submitReportSon()
  6933. }
  6934. }
  6935. });
  6936. },
  6937. submitReportSon() {
  6938. this.dateAr = []
  6939. //检查重叠
  6940. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6941. let alp = []
  6942. if(this.user.timeType.multiWorktime != 1) {
  6943. for(var p in this.workForm.domains) {
  6944. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6945. let objs = {}
  6946. objs.s = this.workForm.domains[p].startTime
  6947. objs.e = this.workForm.domains[p].endTime
  6948. alp.push(objs)
  6949. }
  6950. }
  6951. this.dateAr = alp
  6952. if(this.dateAr.length > 0) {
  6953. let trus = this.fns()
  6954. if(!trus) {
  6955. this.$message({
  6956. message: this.$t('message.Filledtimeperiodsoverlap'),
  6957. type: "error"
  6958. });
  6959. return
  6960. }
  6961. }
  6962. } else {
  6963. for(var p in this.workForm.domains) {
  6964. var slll = this.workForm.domains[p]
  6965. for(var o in slll.worktimeList) {
  6966. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6967. let objs = {}
  6968. objs.s = slll.worktimeList[o].startTime
  6969. objs.e = slll.worktimeList[o].endTime
  6970. alp.push(objs)
  6971. }
  6972. }
  6973. }
  6974. this.dateAr = alp
  6975. if(this.dateAr.length > 0) {
  6976. let trus = this.fns()
  6977. if(!trus) {
  6978. this.$message({
  6979. message: this.$t('message.Filledtimeperiodsoverlap'),
  6980. type: "error"
  6981. });
  6982. return
  6983. }
  6984. }
  6985. }
  6986. }
  6987. //检查子项目
  6988. if (this.user.timeType.subProMustFill == 1) {
  6989. for(var p in this.workForm.domains) {
  6990. var oneProItem = this.workForm.domains[p]
  6991. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6992. //没有选择子项目
  6993. this.$message({
  6994. message: '子项目必填,请检查',
  6995. type: "error"
  6996. });
  6997. return
  6998. }
  6999. }
  7000. }
  7001. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7002. if (this.user.companyId == this.yuzhongCompId) {
  7003. for(var p in this.workForm.domains) {
  7004. var oneProItem = this.workForm.domains[p]
  7005. if (!oneProItem.extraField1) {
  7006. this.$message({
  7007. message: '角色必填,请检查',
  7008. type: "error"
  7009. });
  7010. return
  7011. }
  7012. if (!oneProItem.extraField2) {
  7013. this.$message({
  7014. message: '工作职责必填,请检查',
  7015. type: "error"
  7016. });
  7017. return
  7018. }
  7019. if (!oneProItem.extraField3) {
  7020. this.$message({
  7021. message: '工作内容必填,请检查',
  7022. type: "error"
  7023. });
  7024. return
  7025. }
  7026. }
  7027. }
  7028. // return
  7029. //代填的情况,检查人员是否已经选择
  7030. if (this.isSubstitude) {
  7031. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7032. this.$message({
  7033. message: this.$t('message.pleaseselectthepersontofillin'),
  7034. type: "error"
  7035. });
  7036. return;
  7037. }
  7038. }
  7039. //检查时间,全天和上下午不能同时存在
  7040. if (this.reportTimeType.type == 0) {
  7041. var alldayNum = 0;
  7042. var amNum = 0;
  7043. var pmNum = 0;
  7044. for(var i in this.workForm.domains) {
  7045. if (this.workForm.domains[i].timeType == 0) {
  7046. alldayNum ++;
  7047. } else if (this.workForm.domains[i].timeType == 1) {
  7048. amNum++;
  7049. } else if (this.workForm.domains[i].timeType == 2) {
  7050. pmNum++;
  7051. }
  7052. }
  7053. if (alldayNum > 1) {
  7054. this.$message({
  7055. // message: "工作时间-全天,只能选择一次",
  7056. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7057. type: "error"
  7058. });
  7059. return;
  7060. }
  7061. if (amNum > 1) {
  7062. this.$message({
  7063. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7064. type: "error"
  7065. });
  7066. return;
  7067. }
  7068. if (pmNum > 1) {
  7069. this.$message({
  7070. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7071. type: "error"
  7072. });
  7073. return;
  7074. }
  7075. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7076. this.$message({
  7077. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7078. type: "error"
  7079. });
  7080. return;
  7081. }
  7082. } else if (this.reportTimeType.type == 3) {
  7083. //总百分比不能超过100%
  7084. let total = 0;
  7085. this.workForm.domains.forEach(w=>{total += w.progress});
  7086. if (total > 100) {
  7087. this.$message({
  7088. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7089. type: "error"
  7090. });
  7091. return;
  7092. } else if (total < 100) {
  7093. this.$message({
  7094. message: this.$t('message.cannotbesubmitted'),
  7095. type: "error"
  7096. });
  7097. return;
  7098. }
  7099. }
  7100. this.listLoading = true;
  7101. let formData = new FormData();
  7102. formData.append("draft", this.isDraft);
  7103. var totalTime = 0;
  7104. for (var t=0;t<this.workForm.domains.length; t++) {
  7105. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7106. }
  7107. //批量填报不校验考勤时长,交给后台校验
  7108. if (!this.isBatch) {
  7109. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7110. if (this.workForm.time){
  7111. if (this.workForm.time.workHours == 0){
  7112. this.$message({
  7113. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7114. type: 'error'
  7115. })
  7116. return
  7117. }
  7118. }else{
  7119. this.$message({
  7120. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7121. type: 'error'
  7122. })
  7123. return
  7124. }
  7125. }
  7126. }
  7127. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7128. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7129. this.$message({
  7130. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7131. type: "error"
  7132. });
  7133. return;
  7134. }
  7135. }
  7136. for(var i in this.workForm.domains) {
  7137. if(this.user.timeType.reportAuditType == 3){
  7138. let audItem = {}
  7139. let auditRule = ''
  7140. if(this.workForm.domains[i].id){
  7141. audItem.reportId = this.workForm.domains[i].id
  7142. }
  7143. if(this.user.timeType.auditLevel > 0){
  7144. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7145. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7146. }
  7147. if(this.user.timeType.auditLevel > 1){
  7148. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7149. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7150. }
  7151. if(this.user.timeType.auditLevel > 2){
  7152. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7153. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7154. }
  7155. if(this.workForm.domains[i].ccUserid){
  7156. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7157. }
  7158. if(auditRule){
  7159. auditRule = auditRule.substring(0,auditRule.length - 1)
  7160. this.$message({
  7161. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7162. type: 'error'
  7163. })
  7164. return
  7165. }
  7166. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7167. }
  7168. if (this.user.timeType.customDegreeActive) {
  7169. if (this.user.timeType.customDegreeMultiple) {
  7170. //多选
  7171. if (this.workForm.domains[i].multiDegrIdArray) {
  7172. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7173. degreeArray = degreeArray.replace(/,/g,"@");
  7174. formData.append("multiDegrId", degreeArray);
  7175. } else {
  7176. formData.append("multiDegrId", '[]');
  7177. }
  7178. } else {
  7179. //单选
  7180. if (this.workForm.domains[i].degreeId) {
  7181. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7182. } else {
  7183. formData.append("degreeId", -1);
  7184. }
  7185. }
  7186. } else {
  7187. formData.append("degreeId", -1);
  7188. }
  7189. if(this.workForm.domains[i].customData) {
  7190. // var sss = this.workForm.domains[i].degreeId.toString()
  7191. formData.append("customData", this.workForm.domains[i].customData);
  7192. } else {
  7193. formData.append("customData", 0);
  7194. }
  7195. if(this.workForm.domains[i].customText) {
  7196. formData.append("customText", this.workForm.domains[i].customText);
  7197. } else {
  7198. formData.append("customText", '-');
  7199. }
  7200. if (this.workForm.domains[i].id) {
  7201. formData.append("id", this.workForm.domains[i].id);
  7202. } else {
  7203. formData.append("id", -1);
  7204. }
  7205. formData.append("projectId", this.workForm.domains[i].projectId);
  7206. if (this.workForm.domains[i].subProjectId) {
  7207. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7208. } else {
  7209. formData.append("subProjectId", 0);
  7210. }
  7211. if (this.workForm.domains[i].groupId) {
  7212. formData.append("groupId", this.workForm.domains[i].groupId);
  7213. } else {
  7214. formData.append("groupId", 0);
  7215. }
  7216. if (this.workForm.domains[i].taskId) {
  7217. formData.append("taskId", this.workForm.domains[i].taskId);
  7218. } else {
  7219. formData.append("taskId", 0);
  7220. }
  7221. if (this.workForm.domains[i].taskFinish == true) {
  7222. formData.append("taskFinish", 1);
  7223. } else {
  7224. formData.append("taskFinish", 0);
  7225. }
  7226. formData.append("reportTimeType", this.reportTimeType.type);
  7227. if (this.reportTimeType.type == 0) {
  7228. formData.append("timeType", this.workForm.domains[i].timeType);
  7229. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7230. formData.append("workingTime", workingTime);
  7231. } else if (this.reportTimeType.type == 1){
  7232. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7233. } else if (this.reportTimeType.type == 2) {
  7234. formData.append("endTime", this.workForm.domains[i].endTime);
  7235. formData.append("startTime", this.workForm.domains[i].startTime);
  7236. } else if (this.reportTimeType.type == 3) {
  7237. //按比例分配
  7238. formData.append("progress", this.workForm.domains[i].progress);
  7239. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7240. }
  7241. if(this.user.timeType.choseFromAlbum == 1 ) {
  7242. console.log(this.workForm.domains[i].imgList)
  7243. if(this.workForm.domains[i].imgList) {
  7244. let imgListFor = this.workForm.domains[i].imgList
  7245. for(var b in imgListFor) {
  7246. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7247. }
  7248. console.log(imgListFor)
  7249. let m = JSON.stringify(imgListFor);
  7250. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7251. formData.append("picStr", m);
  7252. } else {
  7253. formData.append("picStr", '[]');
  7254. }
  7255. }
  7256. //处理多个时间事项
  7257. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7258. if (this.reportTimeType.multiWorktime == 1) {
  7259. //检查时间是否有重叠
  7260. var workList = this.workForm.domains[i].worktimeList;
  7261. for (var j=0;j<workList.length; j++) {
  7262. var curItem = workList[j];
  7263. //检查开始时间是否大于结束时间
  7264. if (curItem.startTime >= curItem.endTime) {
  7265. this.$message({
  7266. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7267. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7268. type: "error"
  7269. });
  7270. return;
  7271. }
  7272. //时间不可重叠
  7273. if (this.reportTimeType.timeCanOverlap == 0) {
  7274. for (var p = j+1;p<workList.length; p++) {
  7275. var jItem = workList[p];
  7276. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7277. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7278. this.$message({
  7279. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7280. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7281. type: "error"
  7282. });
  7283. return;
  7284. }
  7285. }
  7286. }
  7287. }
  7288. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7289. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7290. formData.append("content", m);
  7291. } else {
  7292. if (this.workForm.domains[i].content) {
  7293. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7294. m = m.replace(/,/g,",");
  7295. console.log(m, '需要传值的数据')
  7296. // formData.append("content", this.workForm.domains[i].content);
  7297. formData.append("content", m);
  7298. } else {
  7299. formData.append("content", '-');
  7300. }
  7301. }
  7302. if (this.isBatch == 0) {
  7303. formData.append("createDate", this.workForm.createDate);
  7304. } else {
  7305. //批量填报,时间范围
  7306. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7307. }
  7308. if(this.workForm.domains[i].isOvertime) {
  7309. formData.append("isOvertime", 1);
  7310. } else {
  7311. formData.append("isOvertime", 0);
  7312. }
  7313. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7314. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7315. } else {
  7316. formData.append("overtimeHours", 0);
  7317. }
  7318. if(this.workForm.domains[i].basecostId) {
  7319. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7320. } else {
  7321. formData.append("basecostId", 0);
  7322. }
  7323. if (this.workForm.userId != null) {
  7324. var targetUids = '';
  7325. this.workForm.userId.forEach(u=>{
  7326. targetUids += u + '@';
  7327. });
  7328. if (targetUids.length > 0) {
  7329. targetUids = targetUids.substring(0, targetUids.length -1);
  7330. formData.append("targetUids", targetUids);
  7331. }
  7332. }
  7333. //项目专业进度
  7334. if (this.workForm.domains[i].professionProgress) {
  7335. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7336. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7337. formData.append("professionProgress", m);
  7338. } else {
  7339. formData.append("professionProgress", "[]");
  7340. }
  7341. if (this.workForm.domains[i].stage) {
  7342. formData.append("stage", this.workForm.domains[i].stage);
  7343. } else {
  7344. formData.append("stage", "-");
  7345. }
  7346. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7347. if (this.workForm.domains[i].projectAuditorId) {
  7348. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7349. } else {
  7350. // console.log('执行到了这里')
  7351. // console.log(this.user.timeType.reportAuditType)
  7352. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7353. this.$message({
  7354. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7355. type: "error"
  7356. });
  7357. return;
  7358. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7359. //分组负责人先审核, 确定是选择了任务分组
  7360. if (this.workForm.domains[i].taskGroups.length == 0) {
  7361. this.$message({
  7362. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7363. type: "error"
  7364. });
  7365. } else if (!this.workForm.domains[i].groupId) {
  7366. // console.log(this.workForm.domains[i]);
  7367. this.$message({
  7368. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7369. type: "error"
  7370. });
  7371. } else {
  7372. this.$message({
  7373. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7374. type: "error"
  7375. });
  7376. }
  7377. return;
  7378. }
  7379. }
  7380. if (this.user.companyId == this.yuzhongCompId) {
  7381. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7382. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7383. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7384. }
  7385. //依斯贝的服务Id
  7386. if (this.user.companyId == this.yisibeiCompId) {
  7387. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7388. }
  7389. }
  7390. this.submitingReport = true;
  7391. this.http.uploadFile( this.port.report.editPort, formData,
  7392. res => {
  7393. this.listLoading = false;
  7394. this.submitingReport = false;
  7395. if (res.code == "ok") {
  7396. if(res.msg!=null){
  7397. this.$message({
  7398. dangerouslyUseHTMLString: true,
  7399. message: res.msg,
  7400. type: "warning",
  7401. showClose: true,
  7402. duration: 0
  7403. });
  7404. }else{
  7405. this.$message({
  7406. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7407. type: "success"
  7408. });
  7409. }
  7410. this.dialogVisible = false;
  7411. this.jsDay = 0
  7412. this.jsTime = 0
  7413. this.getReportList();
  7414. this.getDepartment();
  7415. this.getRecentlyProject()
  7416. } else {
  7417. this.$message({
  7418. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7419. type: "error"
  7420. });
  7421. }
  7422. },
  7423. error => {
  7424. this.listLoading = false;
  7425. this.submitingReport = false;
  7426. this.$message({
  7427. message: error,
  7428. type: "error"
  7429. });
  7430. });
  7431. },
  7432. // 判断是展示那个工时导入
  7433. imports() {
  7434. if(this.user.timeType.syncCorpwxTime == 0) {
  7435. this.importDialog = true
  7436. } else {
  7437. this.importWxDialog = true
  7438. }
  7439. },
  7440. // 跳转
  7441. junpToDeskTop(id) {
  7442. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7443. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7444. },
  7445. // 通过日报
  7446. approve(id, item) {
  7447. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7448. this.approveinData = {
  7449. id: id,
  7450. date: this.date +day,
  7451. reportIds: item.id
  7452. }
  7453. if(this.user.timeType.needEvaluate == 1){
  7454. this.$set(this.approveinData,'evaluate','')
  7455. this.approveinDialog = true
  7456. }else{
  7457. this.logining = true;
  7458. this.approveinfun()
  7459. }
  7460. },
  7461. approveinfun(){
  7462. this.http.post( this.port.report.approve, this.approveinData,
  7463. res => {
  7464. this.logining = false;
  7465. if (res.code == "ok") {
  7466. this.approveinDialog = false
  7467. this.$message({
  7468. message: this.$t('message.Reviewsucceeded'),
  7469. type: "success"
  7470. });
  7471. this.getReportList();
  7472. this.getDepartment();
  7473. } else {
  7474. this.$message({
  7475. message: res.msg,
  7476. type: "error"
  7477. });
  7478. }
  7479. },
  7480. error => {
  7481. this.logining = false;
  7482. this.$message({
  7483. message: error,
  7484. type: "error"
  7485. });
  7486. });
  7487. },
  7488. //撤回日报
  7489. cancel(item,e) {
  7490. // console.log('can can need',item);
  7491. this.logining = true;
  7492. var ids = '';
  7493. var data = e ? item : item.data;
  7494. data.forEach(element => {
  7495. if(element.id){
  7496. ids +=(element.id+',');
  7497. }
  7498. });
  7499. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7500. res => {
  7501. this.logining = false;
  7502. if (res.code == "ok") {
  7503. this.$message({
  7504. message:this.$t('message.Withdrawalsucceeded'),
  7505. type: "success"
  7506. });
  7507. this.getReportList();
  7508. if(e){this.getReport()}
  7509. this.getDepartment();
  7510. } else {
  7511. this.$message({
  7512. message: res.msg,
  7513. type: "error"
  7514. });
  7515. }
  7516. },
  7517. error => {
  7518. this.logining = false;
  7519. this.$message({
  7520. message: error,
  7521. type: "error"
  7522. });
  7523. });
  7524. },
  7525. showDenyDialog(id,i, item) {
  7526. this.denyReasonDialog = true;
  7527. this.isDenying = false;
  7528. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7529. var ids = item.id;
  7530. // var data = item.data;
  7531. // data.forEach(element => {
  7532. // ids +=(element.id+',');
  7533. // });
  7534. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7535. },
  7536. // 未通过日报
  7537. deny() {
  7538. this.logining = true;
  7539. this.isDenying = true;
  7540. this.http.post( this.port.report.deny, this.denyForm,
  7541. res => {
  7542. this.logining = false;
  7543. this.isDenying = false;
  7544. if (res.code == "ok") {
  7545. this.$message({
  7546. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7547. type: "success"
  7548. });
  7549. this.getReportList();
  7550. this.getDepartment();
  7551. this.denyReasonDialog = false;
  7552. } else {
  7553. this.$message({
  7554. message: res.msg,
  7555. type: "error"
  7556. });
  7557. }
  7558. },
  7559. error => {
  7560. this.logining = false;
  7561. this.$message({
  7562. message: error,
  7563. type: "error"
  7564. });
  7565. });
  7566. },
  7567. // 查看工时记录弹窗
  7568. toView() {
  7569. this.toViewDialogVisible = true
  7570. this.toViewloading = true
  7571. this.getToView()
  7572. },
  7573. getToView() {
  7574. this.http.post( '/report-import-log/getList', this.toViewForm,
  7575. res => {
  7576. this.toViewloading = false;
  7577. if (res.code == "ok") {
  7578. // console.log(res.data, '数据数据')
  7579. this.toViewList = res.data.records
  7580. this.toViewForm.total = res.data.total
  7581. } else {
  7582. this.toViewloading = false;
  7583. this.$message({
  7584. message: res.msg,
  7585. type: "error"
  7586. });
  7587. }
  7588. })
  7589. },
  7590. // 触发 selectCat 组件更改他的值
  7591. selectCatCli(obj) {
  7592. // console.log(obj, '看看')
  7593. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7594. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7595. },
  7596. vueCasader(obj) {
  7597. // console.log(obj, '看看值')
  7598. if(obj.distinction == 1 && obj.item) {
  7599. let arr = []
  7600. arr.push(obj.item.id)
  7601. this.exportParam.departmentId = arr
  7602. }
  7603. },
  7604. //分页
  7605. handleCurrentChange(val) {
  7606. this.toViewForm.pageIndex = val;
  7607. this.getToView();
  7608. },
  7609. handleSizeChange(val) {
  7610. this.toViewForm.pageSize = val;
  7611. this.getToView();
  7612. },
  7613. getAllUsersList(){
  7614. this.http.post('/user/getSimpleActiveUserList',{
  7615. },res => {
  7616. if(res.code == 'ok'){
  7617. this.allUsersList = res.data
  7618. }else{
  7619. this.$message({
  7620. message: res.msg,
  7621. type: 'error'
  7622. })
  7623. }
  7624. },err => {
  7625. this.$message({
  7626. message: err,
  7627. type: 'error'
  7628. })
  7629. })
  7630. },
  7631. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7632. fillWeekCustomClne() {
  7633. this.fillWeekDialogVisiCustom = false
  7634. },
  7635. fillWeekCustomSubmit() {
  7636. this.getReportList();
  7637. this.getDepartment();
  7638. this.getRecentlyProject()
  7639. },
  7640. // 待填日报姓名搜索
  7641. nameAearchSeek(flg) {
  7642. if(!this.nameAearch) {
  7643. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7644. return
  7645. }
  7646. if(flg) {
  7647. this.enterpriseWechatgetUser()
  7648. }
  7649. },
  7650. handleThreeData(userList) {
  7651. console.log(userList, '人员数据')
  7652. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7653. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7654. },
  7655. // 过滤树节点
  7656. filterTreeNodes(treeData, filterKeywords) {
  7657. return treeData.filter((node) => {
  7658. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7659. if (node.children && node.children.length > 0) {
  7660. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7661. }
  7662. return true;
  7663. }
  7664. if (node.children && node.children.length > 0) {
  7665. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7666. return node.children.length > 0;
  7667. }
  7668. return false;
  7669. });
  7670. },
  7671. // 企业微信获取人员
  7672. enterpriseWechatgetUser() {
  7673. this.deptMembDataLoading = true
  7674. this.http.post('/user/getEmployeeList',{
  7675. departmentId: -1,
  7676. pageIndex: 1,
  7677. pageSize: 100,
  7678. keyword: this.nameAearch,
  7679. status: '',
  7680. roleId: '',
  7681. cursor: '',
  7682. onlyDirect: '',
  7683. matchingType: ''
  7684. },res => {
  7685. if(res.code == 'ok'){
  7686. this.deptMembDataLoading = false
  7687. const userListName = res.data.records.map(item => item.name)
  7688. this.handleThreeData(userListName)
  7689. }else{
  7690. this.deptMembDataLoading = false
  7691. this.$message({
  7692. message: res.msg,
  7693. type: 'error'
  7694. })
  7695. }
  7696. },err => {
  7697. this.deptMembDataLoading = false
  7698. this.$message({
  7699. message: err,
  7700. type: 'error'
  7701. })
  7702. })
  7703. },
  7704. // 按周填报获取相关任务
  7705. async getWeeklyTaskList(item) {
  7706. console.log(item, '<=== 数据')
  7707. const { projectId, groupId, stage, taskId } = item
  7708. console.log(projectId, groupId, stage)
  7709. let parms = { projectId, isSubstitude: 0 }
  7710. groupId ? parms.groupId = groupId : ''
  7711. stage ? parms.stage = stage : ''
  7712. const { data } = await this.postData('/task/getRecentTask', parms)
  7713. this.zhoBao.taskId = taskId
  7714. this.$set(this.zhoBao, 'taskList', data)
  7715. console.log(this.zhoBao)
  7716. },
  7717. // 封装 post 请求
  7718. postData(url, params) {
  7719. return new Promise((resolve, reject) => {
  7720. this.http.post(url, { ...params },
  7721. res => {
  7722. resolve(res)
  7723. },
  7724. error => {
  7725. this.$message({
  7726. message: error,
  7727. type: "error"
  7728. });
  7729. reject(error)
  7730. })
  7731. })
  7732. },
  7733. // 自定义事件
  7734. selectCal(obj) {
  7735. console.log(obj, '传数据来源')
  7736. if(obj.distinction == '1') {
  7737. this.zhoBao.projectAuditorId = obj.id
  7738. } else if(obj.distinction == '2') {
  7739. this.zhoBao.auditorFirst = obj.id
  7740. } else if(obj.distinction == '3') {
  7741. this.zhoBao.auditorSec = obj.id
  7742. } else if(obj.distinction == '4') {
  7743. this.zhoBao.auditorThird = obj.id
  7744. } else if(obj.distinction == '5') {
  7745. this.zhoBao.ccUserid = obj.id
  7746. } else if(obj.distinction == '12') {
  7747. this.usersListId = obj.id
  7748. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7749. this.searchKeyword = obj.name
  7750. } else {
  7751. this.searchKeyword = ''
  7752. }
  7753. this.searchScreen(0)
  7754. } else if(obj.distinction == '13') {
  7755. this.usersListId = obj.id
  7756. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7757. this.searchKeyword = obj.name
  7758. } else {
  7759. this.searchKeyword = ''
  7760. }
  7761. this.searchScreen(1)
  7762. }
  7763. }
  7764. },
  7765. created() {
  7766. this.getUsers()
  7767. let height = window.innerHeight;
  7768. this.tableHeight = height - 178;
  7769. const that = this;
  7770. window.onresize = function temp() {
  7771. that.tableHeight = window.innerHeight - 178;
  7772. };
  7773. this.toViewForm.companyId = this.user.companyId
  7774. this.initDrag([{
  7775. type: "LR",
  7776. domClass: {
  7777. // 中间分割线的名字
  7778. resize: "line-line",
  7779. // 左侧盒子的名字
  7780. left: "box-left",
  7781. // 右侧盒子的名字
  7782. right: "box-right",
  7783. // 父级的名字
  7784. box: "box-father",
  7785. },
  7786. otherInfo: {
  7787. // 限制左边栏最低宽度
  7788. leftWidth: 120,
  7789. },
  7790. },
  7791. {
  7792. type: "LR",
  7793. domClass: {
  7794. // 中间分割线的名字
  7795. resize: "line-second",
  7796. // 左侧盒子的名字
  7797. left: "left-laowang",
  7798. // 右侧盒子的名字
  7799. right: "box-second-father",
  7800. // 父级的名字
  7801. box: "grand",
  7802. },
  7803. otherInfo: {
  7804. // 限制左边栏最低宽度
  7805. leftWidth: 120,
  7806. },
  7807. },
  7808. ]);
  7809. }
  7810. };
  7811. </script>
  7812. <style lang="scss" scoped>
  7813. .fillWeekDialogVisiCustom {
  7814. width: 100%;
  7815. height: 70vh;
  7816. }
  7817. .fillWeekCustom {
  7818. .el-dialog__body {
  7819. padding: 20px 20px !important;
  7820. }
  7821. }
  7822. .photos {
  7823. position: relative;
  7824. display: flex;
  7825. flex-wrap: wrap;
  7826. }
  7827. .photos_img {
  7828. width: 120px;
  7829. height: 120px;
  7830. margin-right: 20px;
  7831. margin-bottom: 20px;
  7832. cursor: pointer;
  7833. img {
  7834. width: 100%;
  7835. height: 100%;
  7836. }
  7837. }
  7838. .paginatis {
  7839. padding: 10px 10px;
  7840. background: #f2f2f2;
  7841. }
  7842. .waiting {
  7843. color:orange;
  7844. }
  7845. .filledReportStyle {
  7846. color:#32CD32;
  7847. }
  7848. .RejectStyle {
  7849. color:red;
  7850. }
  7851. .waitSubmitStyle{
  7852. color: #409eff;
  7853. }
  7854. .chooseDate {
  7855. .waiting {
  7856. color: #20a0ff;
  7857. }
  7858. .filledReportStyle {
  7859. color:#20a0ff;
  7860. }
  7861. .RejectStyle {
  7862. color: #20a0ff;
  7863. }
  7864. .waitSubmitStyle{
  7865. color: #20a0ff;
  7866. }
  7867. }
  7868. .allDaily {
  7869. width:100%;
  7870. }
  7871. .report_title {
  7872. padding:10px 0;
  7873. color:#666;
  7874. }
  7875. .clearfix {
  7876. overflow-x: auto;
  7877. white-space: nowrap;
  7878. padding: 15px 0 10px 0;
  7879. // overflow-y: hidden;
  7880. .date_item {
  7881. padding: 0 3px;
  7882. cursor: pointer;
  7883. position: relative;
  7884. }
  7885. .chooseDate {
  7886. position: absolute;
  7887. bottom: -3px;
  7888. width: 37px;
  7889. height: 2px;
  7890. left: 14px;
  7891. background: #20a0ff;
  7892. }
  7893. }
  7894. .one_daily {
  7895. i {
  7896. color: #9ed0ff;
  7897. margin-right: 5px;
  7898. }
  7899. .one_daily_body {
  7900. padding: 10px 0px;
  7901. p {
  7902. margin: 0;
  7903. line-height: 30px;
  7904. }
  7905. }
  7906. ul {
  7907. padding: 0;
  7908. }
  7909. }
  7910. .checkbtn {
  7911. float: right;
  7912. margin-top: -10px;
  7913. }
  7914. .selConStyle{
  7915. margin-top:9rem;
  7916. margin-bottom:11rem;
  7917. .selConStyle_title{
  7918. height: 3rem;
  7919. text-align: center;
  7920. font-size: 17px;
  7921. }
  7922. .el-select{
  7923. margin: 0 15%;
  7924. width: 70%;
  7925. }
  7926. }
  7927. </style>
  7928. <style lang="scss">
  7929. /*去除upload组件过渡效果*/
  7930. .photos .el-upload-list__item {
  7931. transition: none !important;
  7932. }
  7933. .daily {
  7934. .el-card__body {
  7935. height: 80%;
  7936. overflow-y: auto;
  7937. }
  7938. .el-card__header {
  7939. padding: 0 20px;
  7940. }
  7941. }
  7942. .membListClass{
  7943. .el-dialog__body{
  7944. padding-top: 10px;
  7945. }
  7946. }
  7947. // .editReportDialog .el-dialog__footer{
  7948. // position: sticky;
  7949. // bottom: 0;
  7950. // background: #fff;
  7951. // height: 70px;
  7952. // z-index: 1010;
  7953. // }
  7954. .editReportDialog{
  7955. min-width: 800px;
  7956. }
  7957. .touruxiangmu{
  7958. max-width: 1000px;
  7959. }
  7960. </style>
  7961. <style scoped>
  7962. /* 项目标签的样式 */
  7963. .el-tag + .el-tag {
  7964. margin-left: 10px;
  7965. }
  7966. .button-new-tag {
  7967. margin-left: 10px;
  7968. height: 32px;
  7969. line-height: 30px;
  7970. padding-top: 0;
  7971. padding-bottom: 0;
  7972. }
  7973. .input-new-tag {
  7974. width: 90px;
  7975. margin-left: 10px;
  7976. vertical-align: bottom;
  7977. }
  7978. .selectworktime .el-table__fixed-body-wrapper{
  7979. top: 48px !important;
  7980. }
  7981. .selectworktime_export .selectworktime_export_l{
  7982. width: 650px;
  7983. float: left;
  7984. height: 42px;
  7985. }
  7986. .approvalProcessBox{
  7987. margin-left: 30px;
  7988. font-size: 14px;
  7989. line-height: 16px;
  7990. cursor: pointer;
  7991. }
  7992. .approvalProcessBox i {
  7993. margin-right: 0;
  7994. height: 16px;
  7995. width: 16px;
  7996. display: inline-block;
  7997. transform: scale(1.2);
  7998. position: relative;
  7999. top: 0.5px;
  8000. color: #409eff;
  8001. }
  8002. .approvalProcessBox .approvalProcessClick{
  8003. cursor: pointer;
  8004. color: #409eff;
  8005. font-size: 14px;
  8006. }
  8007. .approvalProcessBox:hover .approvalProcessClick{
  8008. color: #3485fb;
  8009. }
  8010. </style>
  8011. <style lang="scss" scoped>
  8012. // 加班样式
  8013. .overtime {
  8014. display: inline-block;
  8015. margin-left: 20px;
  8016. input {
  8017. display: inline-block;
  8018. margin-top: 5px;
  8019. }
  8020. }
  8021. .plus {
  8022. display: inline-block;
  8023. }
  8024. // .tages {
  8025. // float: right;
  8026. // }
  8027. .overtime {
  8028. display: inline-block;
  8029. margin-left: 30px;
  8030. }
  8031. .bloks {
  8032. display: inline-block;
  8033. width: 380px;
  8034. }
  8035. .zhiss {
  8036. display: flex;
  8037. justify-content: space-around;
  8038. align-items: center;
  8039. }
  8040. .zhoFel {
  8041. display: flex;
  8042. justify-content: space-between;
  8043. align-items: center;
  8044. }
  8045. // 左右滑动样式
  8046. .line {
  8047. width: 30px;
  8048. /* height: 500px; */
  8049. background: #f2f2f2;
  8050. cursor: w-resize;
  8051. }
  8052. .box-father {
  8053. border: 8px solid #000;
  8054. }
  8055. .line-second {
  8056. width: 10px;
  8057. /* background: red; */
  8058. }
  8059. .flex {
  8060. display: flex;
  8061. width: 100%;
  8062. }
  8063. .box-left {
  8064. flex: 0 0 400px;
  8065. /* height: 600px; */
  8066. /* background: blue; */
  8067. }
  8068. .box-right {
  8069. /* height: 600px; */
  8070. /* background: green; */
  8071. flex: 1;
  8072. }
  8073. .box-postion {
  8074. width: 200px;
  8075. /* height: 400px; */
  8076. background: #ccc;
  8077. }
  8078. .custom-tree-node {
  8079. flex: 1;
  8080. display: flex;
  8081. align-items: center;
  8082. justify-content: space-between;
  8083. font-size: 14px;
  8084. padding-right: 8px;
  8085. }
  8086. .daitianrbao {
  8087. width: 100%;
  8088. box-sizing: border-box;
  8089. height: 40px;
  8090. border-radius: 4px;
  8091. border: 1px solid #DCDFE6;
  8092. overflow: hidden;
  8093. text-overflow: ellipsis;
  8094. display: flex;
  8095. // align-items: center;
  8096. }
  8097. .daitianrbao .spnn {
  8098. display: inline-block;
  8099. box-sizing: border-box;
  8100. padding: 0 15px;
  8101. overflow: hidden;
  8102. text-overflow: ellipsis;
  8103. }
  8104. .daitianrbao .hover {
  8105. color: #DCDFE6 !important;
  8106. }
  8107. </style>