daily.vue 431 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191
  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')" v-if="user.userNameNeedTranslate != 1" 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 && 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 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"
  252. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  253. <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"
  254. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  255. <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"
  256. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  257. <!--自己可以撤回待审核状态的报告 -->
  258. <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>
  259. </span>
  260. </p>
  261. <p v-if="user.companyId == yuzhongCompId">
  262. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  263. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  264. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  265. <!--任务分组和阶段 -->
  266. <p v-if="item2.groupId != 0">
  267. {{$t('other.taskGroup')}}:{{item2.groupName}}
  268. <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>
  269. </p>
  270. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  271. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  272. <!-- 自定义日报文本 -->
  273. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  274. <p v-if="user.company.packageEngineering == 1">
  275. {{$t('other.professionalProgress')}}:
  276. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  277. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  278. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  279. </el-tooltip>
  280. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  281. <i class="iconfont firerock-iconshenhetongguo"></i>
  282. </el-tooltip>
  283. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  284. <i class="iconfont firerock-iconshenhebohui"></i>
  285. </el-tooltip>
  286. </span>
  287. </p>
  288. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  289. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  290. </p>
  291. <div v-if="item2.multiWorktime==0">
  292. <p style="display: inline-block;">{{$t('time.duration')}}:
  293. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  295. {{item2.time.toFixed(1)}}h
  296. <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>
  297. </p>
  298. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  299. </div>
  300. <div v-if="item2.multiWorktime==1" >
  301. <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>
  302. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  303. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  304. <p style="display: inline-block;">{{$t('time.duration')}}:
  305. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  306. {{timeItem.time.toFixed(1)}}h
  307. </p>
  308. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  309. </div>
  310. </div>
  311. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  312. <!--照片的显示 -->
  313. <p v-if="item2.pics != null && item2.pics.length > 0">
  314. <el-image v-for="(pic, index) in item2.pics" :key="index"
  315. style="width: 100px; height: 100px; margin-right:10px;"
  316. :src="pic"
  317. :preview-src-list="item2.pics">
  318. </el-image>
  319. </p>
  320. </el-card>
  321. </el-timeline-item>
  322. </el-timeline>
  323. </div>
  324. </div>
  325. <!-- 简陋的无报告提示 -->
  326. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </el-card>
  333. </div>
  334. <!-- 工时推送日志弹窗 -->
  335. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  336. <template>
  337. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  338. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  339. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  340. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  341. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  342. <el-table-column prop="result" label="推送结果" width="250">
  343. <template slot-scope="scope">
  344. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  345. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  349. </el-table>
  350. </template>
  351. <span slot="footer" class="dialog-footer">
  352. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  353. </span>
  354. </el-dialog>
  355. <!-- 填写日报的dialog -->
  356. <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">
  357. <div style="height: 65vh;overflow: auto;">
  358. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  359. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  360. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  361. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  362. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  363. <span class="spnn" v-if="workForm.userNames">
  364. <span v-for="(item, index) in workForm.userNames" :key="index">
  365. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  366. <span v-if="index < workForm.userNames.length - 1">,</span>
  367. </span>
  368. </span>
  369. <span class="spnn hover" v-else>
  370. {{$t('defaultText.pleaseSelectAsubstitute')}}
  371. </span>
  372. </div>
  373. </el-form-item>
  374. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  375. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  376. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  377. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  378. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  379. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  380. <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>
  381. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  382. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  383. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  384. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  385. <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>
  386. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  387. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  388. </span>
  389. <!--批量填报和批量代填不显示考勤记录-->
  390. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  391. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  392. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  393. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  394. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  395. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  396. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  397. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  398. @click="refreshAttendance(workForm.createDate)"></el-button>
  399. <!-- AI智能填报 -->
  400. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  401. </el-form-item>
  402. <!-- 000000 -->
  403. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  404. <div v-if="reportTimeType.multiWorktime==0">
  405. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  406. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  407. <el-select v-model="domain.timeType" style="width:200px;"
  408. v-if="reportTimeType.type == 0"
  409. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  410. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  411. @change="onTimeTypeChange(domain.timeType)">
  412. <el-option
  413. v-for="item in timeType"
  414. :key="item.value"
  415. :label="item.label"
  416. :value="item.value">
  417. </el-option>
  418. </el-select>
  419. <!-- 数字时长选择 -->
  420. <el-select v-model="domain.workingTime" style="width:200px;"
  421. v-if="reportTimeType.type == 1"
  422. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  423. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  424. @change="seleChn(0,domain)">
  425. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  426. </el-select>
  427. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  428. <span v-if="reportTimeType.type == 2">
  429. <!--时间范围选择 -->
  430. <el-time-picker
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  432. v-model="domain.startTime"
  433. :placeholder="$t('time.startTime')"
  434. style="width:120px;"
  435. format="HH:mm"
  436. value-format="HH:mm"
  437. :picker-options="{
  438. start: '08:00',
  439. end: '23:30'
  440. }"
  441. @change="iptChang()">
  442. </el-time-picker> - <el-time-picker
  443. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  444. v-model="domain.endTime"
  445. :placeholder="$t('time.endTime')"
  446. style="width:120px;"
  447. format="HH:mm"
  448. value-format="HH:mm"
  449. :picker-options="{
  450. start: '08:00',
  451. end: '23:30',
  452. minTime: domain.startTime
  453. }"
  454. @change="iptChang()">
  455. </el-time-picker>
  456. </span>
  457. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  458. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  459. <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>
  460. </div>
  461. </el-form-item>
  462. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  463. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  464. <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"
  465. @change="selectProject(domain, index)"
  466. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  467. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  468. <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">
  469. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  470. <span style="float: right;">{{ item.projectName }}</span>
  471. </el-option>
  472. </el-option-group>
  473. </el-select>
  474. <!--昱众不显示子项目-->
  475. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  476. <span style="margin-left:45px;">
  477. {{$t('lable.subproject')}}</span>
  478. <!--子项目 -->
  479. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  480. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  481. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  482. </el-select>
  483. </template>
  484. <template v-if="user.companyId == yuzhongCompId">
  485. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  486. <!--角色选择 -->
  487. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  488. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  489. <el-option
  490. v-for="item in roleList"
  491. :key="item.value"
  492. :label="item.label"
  493. :value="item.value">
  494. </el-option>
  495. </el-select>
  496. </template>
  497. <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%;"
  498. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  499. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  500. </el-link>
  501. <!-- <el-link type="primary" v-if="canEdit"
  502. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  503. </el-form-item>
  504. <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">
  505. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  506. </el-form-item>
  507. <!--如果设置了工时成本预警的预算成本项-->
  508. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  509. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  510. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  511. </el-select>
  512. </el-form-item>
  513. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  514. <template slot="label">
  515. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  516. <span >{{$t('lable.taskGrouping')}}</span>
  517. </template>
  518. <!-- 任务分组 -->
  519. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  520. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  521. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  522. </el-select>
  523. <template v-if="user.companyId == yuzhongCompId">
  524. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  525. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  526. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  527. <el-option
  528. v-for="item in domain.filteredRespList"
  529. :key="item.id"
  530. :label="item.jobRespon"
  531. :value="item.id">
  532. </el-option>
  533. </el-select>
  534. </template>
  535. <template v-else><!-- 项目的阶段 -->
  536. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  537. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  538. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  539. @change="changeStages(domain, index)"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  541. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  542. </el-select>
  543. </template>
  544. </el-form-item>
  545. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  546. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  547. <template slot="label">
  548. <span style="color:#FF0000;">*</span>
  549. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  550. </template>
  551. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  552. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  553. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  554. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  555. </el-option>
  556. </el-select>
  557. <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>
  558. </el-form-item>
  559. </div>
  560. <el-form-item v-if="user.companyId == yuzhongCompId">
  561. <template slot="label">
  562. <span style="color:#FF0000;">*</span>
  563. <span >工作内容</span>
  564. </template>
  565. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  566. :disabled="(workForm.domains[index].state>=2?false:true)" >
  567. <el-option
  568. v-for="item in domain.workContentList"
  569. :key="item.id"
  570. :label="item.workContext"
  571. :value="item.id">
  572. </el-option>
  573. </el-select>
  574. </el-form-item>
  575. <!-- 111111 -->
  576. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  577. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  578. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  579. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  580. <span v-else>{{item.name}}</span>
  581. </el-option>
  582. </el-select>
  583. <template v-if="user.timeType.auditLevel > 1">
  584. <i class="el-icon-right"></i>
  585. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  586. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  587. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  588. <span v-else>{{item.name}}</span>
  589. </el-option>
  590. </el-select>
  591. </template>
  592. <template v-if="user.timeType.auditLevel > 2">
  593. <i class="el-icon-right"></i>
  594. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  595. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  596. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  597. <span v-else>{{item.name}}</span>
  598. </el-option>
  599. </el-select>
  600. </template>
  601. </el-form-item>
  602. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  603. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  604. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  605. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  606. <span v-else>{{item.name}}</span>
  607. </el-option>
  608. </el-select>
  609. </el-form-item>
  610. <!-- 相关维度/自定义维度 -->
  611. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :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'">
  612. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  613. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  614. </el-option>
  615. </el-select>
  616. </el-form-item>
  617. <!-- 相关数值 -->
  618. <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">
  619. <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>
  620. </el-form-item>
  621. <!-- 自定义文本 -->
  622. <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">
  623. <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>
  624. </el-form-item>
  625. <!--按比例填报-->
  626. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  627. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  628. <div style="width:400px;">
  629. <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>
  630. <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>
  631. </div>
  632. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  633. <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>
  634. </div>
  635. </el-form-item>
  636. <!--工程专业版本模式下, 各个专业的进度填报 -->
  637. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  638. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  639. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  640. <el-input size="mini" style="width:60px;" v-model="item.progress"
  641. @keyup.native="onProgressChange"
  642. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  643. </span>
  644. </el-form-item>
  645. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  646. <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))" >
  647. <template slot="label" v-if="user.companyId == 3092">
  648. <span style="color:#FF0000;">*</span>
  649. <span >任务</span>
  650. </template>
  651. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  652. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  653. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  654. </el-select>
  655. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  656. </el-form-item>
  657. <!--针对依斯贝的SAP服务-->
  658. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  659. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  660. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  661. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  662. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  663. </el-select>
  664. </el-form-item>
  665. <!--工作事项-->
  666. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  667. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  668. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  669. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  670. </el-form-item>
  671. <!-- 拍照上传 -->
  672. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  673. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  674. <div class="photos">
  675. <div>
  676. <el-upload
  677. list-type="picture-card"
  678. :http-request="(file) => {return addImg(file, index)}"
  679. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  680. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  681. :file-list="domain.imgListUrl" :limit="9"
  682. :disabled="workForm.domains[index].state>=2?false:true">
  683. <i class="el-icon-plus"></i>
  684. </el-upload>
  685. </div>
  686. </div>
  687. </el-form-item>
  688. </div>
  689. <!--多个工作事项填报的情况 -->
  690. <div v-if="reportTimeType.multiWorktime==1">
  691. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  692. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  693. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  694. @change="selectProject(domain, index)"
  695. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  696. <!-- <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">
  697. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  698. <span style="float: right;">{{ item.projectName }}</span>
  699. </el-option> -->
  700. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  701. <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">
  702. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  703. <span style="float: right;">{{ item.projectName }}</span>
  704. </el-option>
  705. </el-option-group>
  706. </el-select>
  707. <template v-if="user.timeType.mainProjectState != 1">
  708. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  709. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  710. <!--子项目 -->
  711. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  712. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  714. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  715. </el-select>
  716. </template>
  717. <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;"
  718. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  719. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  720. </el-link>
  721. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  722. <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>
  723. </div>
  724. <!-- <el-link type="primary" v-if="canEdit"
  725. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  726. </el-form-item>
  727. <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">
  728. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  729. </el-form-item>
  730. <!--如果设置了工时成本预警的预算成本项-->
  731. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  732. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  733. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  734. </el-select>
  735. </el-form-item>
  736. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  737. <!-- 任务分组 -->
  738. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  740. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  741. </el-select>
  742. <!-- 项目的阶段 -->
  743. <span v-if="domain.stages != null && domain.stages.length> 0"
  744. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  745. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  746. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  747. @change="changeStages(domain, index)"
  748. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  749. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  750. </el-select>
  751. </el-form-item>
  752. <el-form-item :label="$t('other.projectAuditor')" >
  753. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  754. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  755. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  756. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  757. </el-option>
  758. </el-select>
  759. <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>
  760. </el-form-item>
  761. <!--工程专业版本模式下, 各个专业的进度填报 -->
  762. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  763. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  764. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  765. <el-input size="mini" style="width:60px;" v-model="item.progress"
  766. @keyup.native="onProgressChange"
  767. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  768. </span>
  769. </el-form-item>
  770. <!-- 相关维度 -->
  771. <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'">
  772. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  773. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  774. </el-option>
  775. </el-select>
  776. </el-form-item>
  777. <!-- 相关数值 -->
  778. <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">
  779. <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>
  780. </el-form-item>
  781. <!-- 自定义文本 -->
  782. <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">
  783. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  784. </el-form-item>
  785. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  786. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  787. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  788. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  789. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  790. </el-select>
  791. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  792. </el-form-item>
  793. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  794. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  795. <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>
  796. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  797. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  798. <span v-if="reportTimeType.type == 2">
  799. <!-- <span> -->
  800. <!--时间范围选择 -->
  801. <el-time-picker
  802. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  803. v-model="timeItem.startTime"
  804. :placeholder="$t('time.startTime')"
  805. style="width:120px;"
  806. format="HH:mm"
  807. value-format="HH:mm"
  808. :picker-options="{
  809. start: '00:00',
  810. end: '23:59',
  811. }"
  812. @change="iptChangs()">
  813. </el-time-picker> - <el-time-picker
  814. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  815. v-model="timeItem.endTime"
  816. :placeholder="$t('time.endTime')"
  817. style="width:120px;"
  818. format="HH:mm"
  819. value-format="HH:mm"
  820. :picker-options="{
  821. start: '00:00',
  822. end: '23:59',
  823. minTime: timeItem.startTime
  824. }"
  825. @change="iptChangs()">
  826. </el-time-picker>
  827. </span>
  828. </el-form-item>
  829. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  830. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  831. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  832. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  833. ></el-input>
  834. </el-form-item>
  835. </div>
  836. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  837. </div>
  838. <!--照片的显示 -->
  839. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  840. <el-image v-for="(pic, index) in domain.pics" :key="index"
  841. style="width: 100px; height: 100px; margin-right:10px;"
  842. :src="pic"
  843. :preview-src-list="domain.pics">
  844. </el-image>
  845. </p>
  846. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  847. </div>
  848. <span id="workFormsItemBottom"></span>
  849. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  850. </el-form>
  851. </div>
  852. <span slot="footer" class="dialog-footer">
  853. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  854. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  855. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  856. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  857. <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>
  858. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  859. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  860. </span>
  861. </el-dialog>
  862. <!-- 按周填报 -->
  863. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  864. <!-- 按周填报-已填工时-点击 -->
  865. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  866. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  867. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  868. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  869. <el-table-column prop="state" :label="$t('state.states')">
  870. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  871. </el-table-column>
  872. <!-- <el-table-column label="操作">
  873. <template slot-scope="scope">
  874. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  875. </template>
  876. </el-table-column> -->
  877. </el-table>
  878. <span slot="footer" class="dialog-footer">
  879. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  880. </span>
  881. </el-dialog>
  882. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  883. <el-form-item style="height:30px;margin-top:-72px;">
  884. <!-- <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> -->
  885. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  886. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  887. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  888. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  889. <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>
  890. <el-option
  891. v-for="item in fillProjectList"
  892. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  893. :key="item.id"
  894. :label="item.projectName + '\u3000' + item.projectCode"
  895. :value="item.id">
  896. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  897. <span style="float: right">{{ item.projectName }}</span>
  898. </el-option>
  899. </el-select>
  900. <span style="float:right;margin-right:10px;">选择项目</span>
  901. </el-form-item>
  902. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  903. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  904. <template slot-scope="scope">
  905. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  906. </template>
  907. </el-table-column>
  908. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  909. <template slot-scope="scope">
  910. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  911. <p v-else></p>
  912. </template>
  913. </el-table-column> -->
  914. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  915. <template slot-scope="scope">
  916. <div v-if="scope.row.canFill == 1">
  917. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  918. <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>
  919. <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>
  920. <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>
  921. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  922. </div>
  923. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  924. <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>
  925. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  926. </div>
  927. </div>
  928. <div v-else >
  929. <span style="color:#999999;">不可超前填报</span>
  930. </div>
  931. </template>
  932. </el-table-column>
  933. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  934. <template slot-scope="scope">
  935. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  936. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  937. </template>
  938. </el-table-column>
  939. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  940. <template slot-scope="scope">
  941. <div class="zhiss">
  942. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  943. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  944. </div>
  945. </template>
  946. </el-table-column>
  947. </el-table>
  948. </el-form>
  949. <span slot="footer" class="dialog-footer" >
  950. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  951. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  952. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  953. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  954. </span>
  955. </el-dialog>
  956. <!-- 重庆物奇私人定制的按周填报 -->
  957. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  958. <div class="fillWeekDialogVisiCustom">
  959. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  960. </div>
  961. </el-dialog>
  962. <!-- 选择时间 -->
  963. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  964. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  965. <span slot="footer" class="dialog-footer">
  966. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  967. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  968. </span>
  969. </el-dialog>
  970. <!-- 按周填报弹窗 -->
  971. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  972. <div>
  973. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  974. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  975. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  976. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  977. </el-select>
  978. </div>
  979. <!--如果设置了工时成本预警的预算成本项-->
  980. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  981. <p>{{$t('lable.budgetSource')}}</p>
  982. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  983. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  984. </el-select>
  985. </div>
  986. <!-- 任务分组 -->
  987. <div class="zhoFel" v-if="user.company.packageProject == 1">
  988. <p>{{$t('lable.taskGrouping')}}</p>
  989. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  990. @change="getGroupStages(zhoBao, 0)">
  991. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  995. <p>{{$t('other.inputStage')}}</p>
  996. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  997. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  998. </el-select>
  999. </div>
  1000. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1001. <p>{{$t('other.reviewer')}}</p>
  1002. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1003. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1004. </el-select>
  1005. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1006. </div>
  1007. <template v-if="user.timeType.reportAuditType == 3">
  1008. <div class="zhoFel">
  1009. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1010. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1011. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1012. </el-select>
  1013. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1014. </div>
  1015. <div class="zhoFel">
  1016. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1017. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1018. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <div class="zhoFel">
  1023. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1024. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-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.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1028. </div>
  1029. <div class="zhoFel">
  1030. <p>{{ $t('chao-song-ren') }}</p>
  1031. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" 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.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. </template>
  1037. <!-- 自定义维度 -->
  1038. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1039. <p>{{user.timeType.customDegreeName}}</p>
  1040. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1041. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1042. </el-select>
  1043. </div>
  1044. <!-- 自定义数值 -->
  1045. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1046. <p>{{user.timeType.customDataName}}</p>
  1047. <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>
  1048. </div>
  1049. <!-- 自定义文本 -->
  1050. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1051. <p>{{user.timeType.customTextName}}</p>
  1052. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1053. </div>
  1054. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1055. <p>{{$t('other.timeSelection')}}</p>
  1056. <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>
  1057. </div>
  1058. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1059. <p>{{$t('other.chooseDuration')}}</p>
  1060. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1061. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1062. </el-select>
  1063. </div>
  1064. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1065. <p>{{$t('lable.percentageOfTime')}}</p>
  1066. <div style="width:400px;display: flex;align-items: center;">
  1067. <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>
  1068. <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>
  1069. </div>
  1070. </div>
  1071. <div class="zhoFel">
  1072. <p>{{$t('other.workMatters')}}</p>
  1073. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1074. </div>
  1075. </div>
  1076. <span slot="footer" class="dialog-footer">
  1077. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1078. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1079. </span>
  1080. </el-dialog>
  1081. <!--导出报表条件选择 -->
  1082. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1083. <el-form ref="form3" :model="exportParam" >
  1084. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1085. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1086. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1087. </el-select>
  1088. </el-form-item>
  1089. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1090. <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>
  1091. <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>
  1092. </el-form-item>
  1093. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1094. <el-date-picker
  1095. v-model="exportParam.dateRange" :editable="false"
  1096. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1097. :range-separator="$t('other.to')"
  1098. type="daterange"
  1099. :start-placeholder="$t('time.startDate')"
  1100. :end-placeholder="$t('time.endDate')"
  1101. ></el-date-picker>
  1102. </el-form-item>
  1103. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1104. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1105. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1106. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1107. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1108. </el-select>
  1109. </el-form-item>
  1110. </el-form>
  1111. <div slot="footer" class="dialog-footer">
  1112. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  1113. </div>
  1114. </el-dialog>
  1115. <!--导出报表条件选择 -->
  1116. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1117. <el-form ref="form3" :model="exportParam" >
  1118. <el-form-item prop="range" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :clearable="true"
  1123. :range-separator="$t('other.to')"
  1124. type="daterange"
  1125. :start-placeholder="$t('time.startDate')"
  1126. :end-placeholder="$t('time.endDate')"
  1127. ></el-date-picker>
  1128. </el-form-item>
  1129. </el-form>
  1130. <div slot="footer" class="dialog-footer">
  1131. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1132. </div>
  1133. </el-dialog>
  1134. <!--人员列表 -->
  1135. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1136. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1137. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1138. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1139. <el-table-column type="selection"></el-table-column>
  1140. <el-table-column prop="label" :label="$t('lable.name')" >
  1141. <template slot-scope="scope">
  1142. <span>
  1143. <!-- {{(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}} -->
  1144. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1145. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1146. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1147. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1148. </span>
  1149. <span v-else>
  1150. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1151. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1152. </span>
  1153. </span>
  1154. </template>
  1155. </el-table-column>
  1156. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1157. <template slot-scope="scope">
  1158. <div>
  1159. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1160. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1161. </div>
  1162. </template>
  1163. </el-table-column>
  1164. </el-table>
  1165. </el-tab-pane>
  1166. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1167. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1168. <el-table-column prop="label" :label="$t('lable.name')" >
  1169. <template slot-scope="scope">
  1170. <!-- <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> -->
  1171. <!-- <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> -->
  1172. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1173. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1174. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1175. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1176. </span>
  1177. <span v-else>
  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>
  1181. </template>
  1182. </el-table-column>
  1183. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1184. <template slot-scope="scope">
  1185. <div>
  1186. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1187. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1188. </div>
  1189. </template>
  1190. </el-table-column>
  1191. </el-table>
  1192. </el-tab-pane>
  1193. </el-tabs>
  1194. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1195. <el-table-column type="selection"></el-table-column>
  1196. <el-table-column prop="label" :label="$t('lable.name')" >
  1197. <template slot-scope="scope">
  1198. <div>
  1199. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1200. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1201. </div>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1205. <template slot-scope="scope">
  1206. <div>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1209. </div>
  1210. </template>
  1211. </el-table-column>
  1212. </el-table>
  1213. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1214. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1215. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1216. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1217. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1218. </div>
  1219. </el-dialog>
  1220. <!-- 按部门选择人员 -->
  1221. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1222. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1223. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1224. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1225. </el-input>
  1226. <div class="tree" style="height:400px">
  1227. <el-scrollbar style="height:100%">
  1228. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1229. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1230. highlight-current :filter-node-method="filterNode">
  1231. <span class="custom-tree-node" slot-scope="{ node }">
  1232. <span v-if="user.userNameNeedTranslate == '1'">
  1233. <span v-if="node.data.children">
  1234. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1235. </span>
  1236. <span v-else>
  1237. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1238. </span>
  1239. </span>
  1240. <span v-if="user.userNameNeedTranslate != '1'">
  1241. {{ node.label }}
  1242. </span>
  1243. <!-- {{ node.label }} -->
  1244. </span>
  1245. </el-tree>
  1246. </el-scrollbar>
  1247. </div>
  1248. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1249. <div slot="footer" class="dialog-footer">
  1250. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1251. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <el-dialog
  1255. v-if="monthWorkTimeDialog"
  1256. :visible.sync="monthWorkTimeDialog"
  1257. :close-on-click-modal="false"
  1258. customClass="customWidth selectworktime"
  1259. width="1200px"
  1260. title=""
  1261. >
  1262. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1263. <el-tabs v-model="activeName" @tab-click="handleClick">
  1264. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1265. <div class="selectworktime_export" style="margin-top:10px;">
  1266. <div class="selectworktime_export_l">
  1267. <el-date-picker
  1268. class="selecteworktime_datapick"
  1269. v-model="WorktimeDatepickValue"
  1270. value-format="yyyy-MM-dd"
  1271. type="daterange"
  1272. align="right"
  1273. unlink-panels
  1274. :range-separator="$t('other.to')"
  1275. :start-placeholder="$t('time.startDate')"
  1276. :end-placeholder="$t('time.endDate')"
  1277. :default-time="['12:00:00', '12:00:00']"
  1278. size="small"
  1279. popper-class="selecteorktime_datapick_popper"
  1280. @change="showMonthWorkTime()"
  1281. >
  1282. </el-date-picker>
  1283. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1284. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1285. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1286. <!-- 222 -->
  1287. </div>
  1288. <div>
  1289. <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">
  1290. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1291. </el-input>
  1292. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1293. </div>
  1294. <el-link
  1295. type="primary"
  1296. style="float: right; vertical-align: middle;height:32px"
  1297. @click="exportMembWorkHours()"
  1298. >{{$t('export.exportData')}}</el-link
  1299. >
  1300. </div>
  1301. <el-table ref="hasworkTbl"
  1302. :data="monthWorkDataS"
  1303. v-el-table-infinite-scroll="listScroll"
  1304. border
  1305. :height="500"
  1306. highlight-current-row
  1307. style="width: 100%"
  1308. v-loading="tbload"
  1309. :lazy="true"
  1310. >
  1311. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1312. <template slot-scope="scope">
  1313. {{ scope.$index + 1 }}
  1314. </template>
  1315. </el-table-column>
  1316. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1317. <template slot-scope="scope">
  1318. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1319. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1320. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1321. <!-- {{scope.row.name}} -->
  1322. </span>
  1323. </template>
  1324. </el-table-column>
  1325. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1326. <template slot-scope="scope">
  1327. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1328. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1329. </template>
  1330. </el-table-column>
  1331. <el-table-column
  1332. min-width="105"
  1333. v-for="(item, index) in pickDateArray"
  1334. :key="index"
  1335. :label="item.label"
  1336. align="center"
  1337. >
  1338. <template slot-scope="scope">
  1339. <div
  1340. style="color: red"
  1341. v-if="
  1342. scope.row.worktimeList.filter(
  1343. (w) =>
  1344. w.createDate==item.date
  1345. ).length > 0 &&
  1346. scope.row.worktimeList.filter(
  1347. (w) =>w.createDate==item.date
  1348. )[0].workingTime < reportTimeType.allday
  1349. "
  1350. >
  1351. {{
  1352. scope.row.worktimeList.filter(
  1353. (w) =>w.createDate==item.date
  1354. )[0].workingTime.toFixed(1)
  1355. }}
  1356. </div>
  1357. <div
  1358. style="color: #20a0ff"
  1359. v-if="
  1360. scope.row.worktimeList.filter(
  1361. (w) =>w.createDate==item.date
  1362. ).length > 0 &&
  1363. scope.row.worktimeList.filter(
  1364. (w) =>w.createDate==item.date
  1365. )[0].workingTime > reportTimeType.allday
  1366. "
  1367. >
  1368. {{
  1369. scope.row.worktimeList.filter(
  1370. (w) =>w.createDate==item.date
  1371. )[0].workingTime.toFixed(1)
  1372. }}
  1373. </div>
  1374. <div
  1375. v-if="
  1376. scope.row.worktimeList.filter(
  1377. (w) =>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
  1388. }}
  1389. </div>
  1390. <div
  1391. v-if="
  1392. scope.row.worktimeList.filter(
  1393. (w) =>w.createDate==item.date
  1394. ).length == 0
  1395. "
  1396. >
  1397. 0
  1398. </div>
  1399. <div
  1400. v-if="
  1401. scope.row.worktimeList.filter(
  1402. (w) =>w.createDate==item.date
  1403. ).length > 0 &&
  1404. typeof scope.row.worktimeList.filter(
  1405. (w) =>w.createDate==item.date
  1406. )[0].workingTime == 'string'
  1407. "
  1408. >
  1409. {{
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. )[0].workingTime
  1413. }}
  1414. </div>
  1415. </template>
  1416. </el-table-column>
  1417. </el-table>
  1418. <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>
  1419. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1420. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1421. <label style="font-size: 16px">员工每日已填报工时数</label>
  1422. <el-link
  1423. type="primary"
  1424. style="float: right; margin-right: 60px"
  1425. @click="exportMembWorkHours()"
  1426. >导出已填报数据</el-link
  1427. > -->
  1428. <!-- <el-button >导出</el-button> -->
  1429. <!-- </div> -->
  1430. </el-tab-pane>
  1431. <el-tab-pane label="未提交人员列表" name="second" >
  1432. <div class="selectworktime_export" style="margin-top:10px">
  1433. <div class="selectworktime_export_l">
  1434. <el-date-picker
  1435. class="selecteworktime_datapick"
  1436. v-model="WorktimeDatepickValue"
  1437. value-format="yyyy-MM-dd"
  1438. type="daterange"
  1439. align="right"
  1440. unlink-panels
  1441. :range-separator="$t('other.to')"
  1442. :start-placeholder="$t('time.startDate')"
  1443. :end-placeholder="$t('time.endDate')"
  1444. :default-time="['12:00:00', '12:00:00']"
  1445. size="small"
  1446. popper-class="selecteorktime_datapick_popper"
  1447. @change="showMonthNotWorkTime()"
  1448. >
  1449. </el-date-picker>
  1450. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1451. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1452. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1453. </div>
  1454. <div>
  1455. <div style="margin-top:10px;">
  1456. <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>
  1457. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1458. <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">
  1459. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1460. </el-input>
  1461. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1462. <el-link
  1463. type="primary"
  1464. style="float: right; vertical-align: middle;height:32px"
  1465. @click="exportMembNotWorkHours()"
  1466. >{{$t('export.exportData')}}</el-link
  1467. >
  1468. </div>
  1469. </div>
  1470. </div>
  1471. <el-table
  1472. ref="hasworkTbl2"
  1473. :data="monthNotWorkDateS"
  1474. v-el-table-infinite-scroll="notListScroll"
  1475. border
  1476. :height="500"
  1477. highlight-current-row
  1478. style="width: 100%"
  1479. v-loading="tbload"
  1480. lazy
  1481. >
  1482. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1483. <template slot-scope="scope">
  1484. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1485. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1486. </template>
  1487. </el-table-column>
  1488. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1489. <template slot-scope="scope">
  1490. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1491. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1492. </template>
  1493. </el-table-column>
  1494. <el-table-column
  1495. min-width="200"
  1496. :label="$t('weekDay.date')"
  1497. align="center"
  1498. prop="createDate"
  1499. >
  1500. </el-table-column>
  1501. <el-table-column
  1502. min-width="200"
  1503. :label="$t('state.states')"
  1504. align="center"
  1505. prop="status"
  1506. />
  1507. <el-table-column
  1508. min-width="200"
  1509. :label="$t('other.attendanceData')"
  1510. prop="cardTime"
  1511. align="center"
  1512. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1513. </el-table>
  1514. <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>
  1515. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1516. </el-tab-pane>
  1517. </el-tabs>
  1518. </el-dialog>
  1519. <!--驳回弹出框 -->
  1520. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1521. <div>
  1522. <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')" />
  1523. </div>
  1524. <div slot="footer" class="dialog-footer">
  1525. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1526. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1527. </div>
  1528. </el-dialog>
  1529. <!-- 通过弹出框 -->
  1530. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1531. <div>
  1532. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1533. </div>
  1534. <div slot="footer" class="dialog-footer">
  1535. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1536. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1537. </div>
  1538. </el-dialog>
  1539. <!--批量导入日报 -->
  1540. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1541. <p>1. {{$t('other.download')}}
  1542. <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>
  1543. </p>
  1544. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1545. <p style="display: flex;justify-content: center;">
  1546. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1547. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1548. </el-upload>
  1549. </p>
  1550. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1551. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1552. </div>
  1553. </el-dialog>
  1554. <!-- 工时导入记录弹窗 -->
  1555. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1556. <div style="height: 452px">
  1557. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1558. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1559. <el-table-column prop="userName" :label="$t('other.operator')">
  1560. <template slot-scope="scope">
  1561. <div>
  1562. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1563. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1564. </div>
  1565. </template>
  1566. </el-table-column>
  1567. <el-table-column prop="datel" :label="$t('other.document')">
  1568. <template slot-scope="scope">
  1569. <div>
  1570. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1571. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1572. </div>
  1573. </template>
  1574. </el-table-column>
  1575. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1576. <template slot-scope="scope">
  1577. <div>
  1578. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1579. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1580. </div>
  1581. </template>
  1582. </el-table-column>
  1583. </el-table>
  1584. <el-col :span="24" class="paginatis">
  1585. <el-pagination
  1586. @size-change="handleSizeChange"
  1587. @current-change="handleCurrentChange"
  1588. :page-sizes="[20 , 50 , 80 , 100]"
  1589. :page-size="20"
  1590. layout="total, sizes, prev, pager, next"
  1591. :total="toViewForm.total"
  1592. style="float:right;"
  1593. ></el-pagination>
  1594. </el-col>
  1595. </div>
  1596. </el-dialog>
  1597. <!--基于企业微信考勤数据的工时导入 -->
  1598. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1599. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1600. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1601. </el-step>
  1602. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1603. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1604. </el-steps>
  1605. <div v-if="active==0" style="padding:30px;height:360px;">
  1606. <div style="margin-top:50px;margin-left:280px;">
  1607. <el-date-picker
  1608. v-model="importWxParam.date" :editable="false"
  1609. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1610. :clearable="true"
  1611. :range-separator="$t('other.to')"
  1612. type="daterange"
  1613. :start-placeholder="$t('time.startDate')"
  1614. :end-placeholder="$t('time.endDate')"
  1615. @change="loadCheckInData"
  1616. ></el-date-picker>
  1617. </div>
  1618. </div>
  1619. <div v-if="active==1" style="padding:10px;">
  1620. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1621. style="width: 100%;margin-top:5px;" >
  1622. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1623. <template slot-scope="scope">
  1624. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1625. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1626. </template>
  1627. </el-table-column>
  1628. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1629. </el-table-column>
  1630. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1631. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1632. <template slot-scope="scope">
  1633. <div>
  1634. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1635. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1636. </div>
  1637. </template>
  1638. </el-table-column>
  1639. <el-table-column prop="departmentName" label="部门" >
  1640. <template slot-scope="scope">
  1641. <div>
  1642. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1643. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1644. </div>
  1645. </template>
  1646. </el-table-column>
  1647. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1648. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1649. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1650. <template slot-scope="scope">
  1651. {{scope.row.workHours.toFixed(1)}}h
  1652. </template>
  1653. </el-table-column>
  1654. </el-table>
  1655. </div>
  1656. <div v-if="active==2" >
  1657. <p style="display: flex;justify-content: center;height:390px;">
  1658. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1659. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1660. </el-upload>
  1661. </p>
  1662. </div>
  1663. <div slot="title">
  1664. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1665. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1666. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1667. <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>
  1668. <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>
  1669. <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>
  1670. </div>
  1671. <span slot="footer">
  1672. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1673. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1674. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1675. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1676. </span>
  1677. </el-dialog>
  1678. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1679. <p style="display: flex;justify-content: center;height:100px;">
  1680. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1681. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1682. </el-upload>
  1683. </p>
  1684. </el-dialog>
  1685. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1686. <div>
  1687. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1688. v-model="deleteReportParam.date" :editable="false"
  1689. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1690. :clearable="true"
  1691. :range-separator="$t('other.to')"
  1692. type="daterange"
  1693. :start-placeholder="$t('time.startDate')"
  1694. :end-placeholder="$t('time.endDate')"
  1695. ></el-date-picker>
  1696. </div>
  1697. <div style="margin-top:10px;">
  1698. <span>请选择部门:</span>
  1699. <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>
  1700. <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>
  1701. </div>
  1702. <div style="margin-top:10px;">
  1703. <span>请选择员工:</span>
  1704. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1705. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1706. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1707. <span v-else>{{item.name}}</span>
  1708. </el-option>
  1709. </el-select>
  1710. </div>
  1711. <span slot="footer">
  1712. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1713. </span>
  1714. </el-dialog>
  1715. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1716. <div>
  1717. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1718. v-model="deleteReportParam.date" :editable="false"
  1719. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1720. :clearable="true"
  1721. :range-separator="$t('other.to')"
  1722. type="daterange"
  1723. :start-placeholder="$t('time.startDate')"
  1724. :end-placeholder="$t('time.endDate')"
  1725. ></el-date-picker>
  1726. </div>
  1727. <div style="margin-top:15px;">
  1728. <span>选择部门:</span>
  1729. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1730. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1731. size="small" v-if="user.userNameNeedTranslate != 1"
  1732. ></el-cascader>
  1733. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1734. </div>
  1735. <span slot="footer">
  1736. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1737. </span>
  1738. </el-dialog>
  1739. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1740. <div>
  1741. <span>选择时间:</span><el-date-picker
  1742. v-model="modImportTime"
  1743. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1744. :clearable="true"
  1745. type="datetime"
  1746. ></el-date-picker>
  1747. <span>选择导入人员:</span><el-select
  1748. v-model="modImportUserId"
  1749. >
  1750. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1751. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1752. <span v-else>{{item.name}}</span>
  1753. </el-option>
  1754. </el-select>
  1755. </div>
  1756. <span slot="footer">
  1757. <el-button @click="confirmChangeModTime" >确认</el-button>
  1758. </span>
  1759. </el-dialog>
  1760. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1761. <div>
  1762. <span>请选择年月:</span>
  1763. <el-date-picker
  1764. v-model="ratioYmonth" :editable="false"
  1765. format="yyyyMM" value-format="yyyyMM"
  1766. type="month"
  1767. ></el-date-picker>
  1768. </div>
  1769. <span slot="footer">
  1770. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1771. </span>
  1772. </el-dialog>
  1773. <!--工时批量代填 -->
  1774. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1775. <div>
  1776. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1777. v-model="importWxParam.date" :editable="false"
  1778. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1779. :clearable="true"
  1780. :range-separator="$t('other.to')"
  1781. type="daterange"
  1782. :start-placeholder="$t('time.startDate')"
  1783. :end-placeholder="$t('time.endDate')"
  1784. @change="loadCheckInData"
  1785. ></el-date-picker>
  1786. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1787. </div>
  1788. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1789. :key="timeStamp"
  1790. style="width: 100%;margin-top:5px;" ref="tab">
  1791. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1792. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1793. <template slot-scope="scope">
  1794. <div>
  1795. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1796. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1797. </div>
  1798. </template>
  1799. </el-table-column>
  1800. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1801. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1802. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1803. <template slot-scope="scope">
  1804. {{scope.row.workHours.toFixed(1)}}h
  1805. </template>
  1806. </el-table-column>
  1807. <!--项目名称列表 -->
  1808. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1809. <template slot-scope="scope">
  1810. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1811. </template>
  1812. </el-table-column>
  1813. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1814. <template slot-scope="scope">
  1815. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1816. </template>
  1817. </el-table-column>
  1818. </el-table>
  1819. </el-dialog>
  1820. <!--基于企业微信考勤数据的工时导入 -->
  1821. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1822. <div style="padding-bottom:10px;">
  1823. <p>{{importResultMsg}}</p>
  1824. </div>
  1825. <!-- <span slot="footer" class="dialog-footer">
  1826. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1827. </span> -->
  1828. </el-dialog>
  1829. <!-- 审核流程展示 -->
  1830. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1831. <div style="padding:20px 40px 20px 0">
  1832. <el-timeline :reverse="false">
  1833. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1834. <!-- {{item.msg}} -->
  1835. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1836. <span v-if="user.userNameNeedTranslate == 1">
  1837. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1838. <span>{{item.msgCon.two}}</span>
  1839. </span>
  1840. </el-timeline-item>
  1841. </el-timeline>
  1842. </div>
  1843. </el-dialog>
  1844. </section>
  1845. </template>
  1846. <script>
  1847. // 左右滑动
  1848. import dragMixin from "@/common/js/tensile.js";
  1849. import util from "../../common/js/util";
  1850. // 自定义select组件
  1851. import selectCat from "@/components/select.vue"
  1852. // 引入自定义级联组件
  1853. import vueCascader from "@/components/cascader.vue"
  1854. // 重庆物奇定制组件
  1855. import WeeklyCustomization from "./weeklyCustomization.vue"
  1856. import { mapMutations } from 'vuex'
  1857. let _that = this
  1858. export default {
  1859. mixins: [dragMixin],
  1860. components: {
  1861. selectCat,
  1862. vueCascader,
  1863. WeeklyCustomization
  1864. },
  1865. data() {
  1866. return {
  1867. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1868. jobResponseList:[],
  1869. yisibeiCompId: 3092,
  1870. yuzhongCompId: 3385,
  1871. mingyiName : '成都明夷电子科技有限公司',
  1872. // mingyiName : '明夷',
  1873. modItemDataId: null,
  1874. modImportTime: null,
  1875. modImportUserId: null,
  1876. showModImportTimeDialog: false,
  1877. showBatchSimpleApproveReport: false,
  1878. startDeleting: false,
  1879. showBatchDeleteReport: false,
  1880. deleteReportParam: {date:null, userIds:[]},
  1881. isDenying: false,
  1882. targetWeekDate: null,//填写周报中的周日期
  1883. importCardTimeVisi: false,
  1884. startRatioExporting: false,
  1885. exportUserRatio: false,
  1886. ratioYmonth:null,
  1887. hasWrittenReport: false,
  1888. today:null,
  1889. syncTimeLoading: false,
  1890. seluserText: '',
  1891. translation: '1', // 1、文字, 2、部门, 3、人员
  1892. exportLoad: false,
  1893. getPickerOptions: {
  1894. disabledDate: (time) => {
  1895. var date = new Date();
  1896. var year = date.getFullYear();
  1897. var month = date.getMonth() + 1;
  1898. if (month >= 1 && month <= 9) {
  1899. month = "0" + month;
  1900. }
  1901. var currentdate = year.toString() + month.toString();
  1902. var timeyear = time.getFullYear();
  1903. var timemonth = time.getMonth() + 1;
  1904. if (timemonth >= 1 && timemonth <= 9) {
  1905. timemonth = "0" + timemonth;
  1906. }
  1907. var timedate = timeyear.toString() + timemonth.toString();
  1908. if(this.user.timeType.fillAhead == 0){
  1909. return currentdate < timedate;
  1910. }else{
  1911. return false
  1912. }
  1913. }
  1914. },
  1915. alalal: '8.0',
  1916. timeBasecostList:null,
  1917. tbload: false,
  1918. exportTimeDialog: false,
  1919. searchKeyword: '',
  1920. monthWorkDataS: [],
  1921. monthNotWorkDateS: [],
  1922. pickDateArray:[],
  1923. WorktimeDatepickValue: [],
  1924. activeName:"first",
  1925. isLeave: 0,
  1926. submitingReport: false,
  1927. importResultMsg:null,
  1928. showImportResult:false,
  1929. importingData: false,
  1930. isDraft: 0,
  1931. timeStamp: 0,
  1932. projectColumns:[],
  1933. checkinLoading:false,
  1934. importWxParam:{date:null,},
  1935. active:0,
  1936. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1937. importWxDialog:false,
  1938. importDialog:false,
  1939. denyForm:null,
  1940. denyReasonDialog:false,
  1941. monthWorkTimeDialog: false,
  1942. isSubstitude:false,
  1943. isFill:false,
  1944. unFillList:[],
  1945. fillList:[],
  1946. fillMembList:[],
  1947. fillMembList_leave: [],
  1948. membListVisible: false,
  1949. isBatch:0,//是否是批量填报
  1950. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1951. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1952. 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')],
  1953. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1954. fillStatusList: [],
  1955. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1956. exportDialog:false,
  1957. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1958. subProjectList:[],
  1959. canEdit: true,
  1960. originCanEdit: true,
  1961. timeRange:[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],
  1962. selectTime:null,
  1963. reportTimeType:{},
  1964. curDate:'',
  1965. isAllSelect: false,
  1966. approveDialogVisible:false,
  1967. deptId:null,
  1968. targetUid: null,
  1969. membCount:0,
  1970. selectState:"-1",
  1971. user: JSON.parse(sessionStorage.getItem("user")),
  1972. allUsersList: [],
  1973. showAddMore:false,
  1974. allDate: [],
  1975. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1976. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1977. choseDay: 0,
  1978. tableHeight: 0,
  1979. listLoading: false,
  1980. projectList: [], //项目列表
  1981. fillProjectList: [],
  1982. reportList: [], //日报列表
  1983. reportNames:[], //批量审批列表
  1984. selCon:[], //筛选条件
  1985. selProjectList:[], //筛选后项目列表
  1986. selConShow: true,
  1987. usersList: [], // 全部人员列表
  1988. usersListId: '', // 选中的人员id
  1989. dialogVisible: false, //项目弹窗
  1990. report: '',
  1991. workForm: {
  1992. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1993. domains: [{
  1994. id: null,
  1995. projectId: "",
  1996. workingTime: "",
  1997. timeType:0,
  1998. content: "",
  1999. state: 2,
  2000. multiWorktime:0,
  2001. worktimeList:[],
  2002. degreeId: null,
  2003. auditUserList: [],
  2004. }],
  2005. },
  2006. workRules: {
  2007. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2008. },
  2009. chooseParticipVisible: false,
  2010. logining: false,
  2011. isDisable: false,
  2012. timeType:[],
  2013. deptMembData: [
  2014. ],
  2015. //部门人员树状结构
  2016. data: [
  2017. {
  2018. id: -1,
  2019. label: this.$t('lable.allStaff'),
  2020. membCount:0
  2021. },
  2022. {
  2023. id: 0,
  2024. label: this.$t('lable.unassigned'),
  2025. }
  2026. ],
  2027. allData:{},
  2028. batchShowData:{},
  2029. option: [],
  2030. deptOptionList: [],
  2031. depData: {
  2032. id: -1,
  2033. label: this.$t('lable.allStaff'),
  2034. },
  2035. defaultProps: {
  2036. children: 'children',
  2037. label: 'label'
  2038. },
  2039. isNew: false,
  2040. selected: false,
  2041. valuet: new Date(),
  2042. domObj: null,
  2043. participator:[],
  2044. chosenMembCount:0,
  2045. jsDay: 0,
  2046. jsTime: 0,
  2047. falsss: false,
  2048. weidu: [],
  2049. weiduList: [],
  2050. yonghuUser: [],
  2051. dateAr: [],
  2052. batchSubFillDialog: false,
  2053. isSubstiS: false,
  2054. fillWeekDialogVisi: false,
  2055. fillWeekDialogVisiCustom: false,
  2056. zhoData: [],
  2057. weekDateRange: [],
  2058. btnZho: false,
  2059. weekDataLoading: false,
  2060. changdu: 6,
  2061. tianxieDialogVisible: false,
  2062. scopess: {},
  2063. zhoBao: {
  2064. time: '',
  2065. workingTime: '',
  2066. progress: '',
  2067. con: '',
  2068. subProjectId: '',
  2069. stage: '',
  2070. subProjectList: [],
  2071. stages: [],
  2072. },
  2073. zhoBaoIdx: '',
  2074. zhoBaoName: '',
  2075. zhis: {},
  2076. dealList: [],
  2077. toViewDialogVisible: false,
  2078. toViewList: [],
  2079. toViewloading: true,
  2080. toViewForm: {
  2081. pageIndex: '1',
  2082. pageSize: '20',
  2083. total: 0,
  2084. },
  2085. toViewloadings: false,
  2086. tabPositionss: 'top',
  2087. monthTotal: 0,
  2088. monthTotalPage: 0,
  2089. monthTotalLages: 20,
  2090. monthWorkData: [],
  2091. monthNotWorkDate: [],
  2092. monthWorkDataS1: [],
  2093. monthnotTotal: 0,
  2094. monthnotTotalPage: 0,
  2095. monthnotTotalLages: 20,
  2096. monthNotWorkDateS1: [],
  2097. deptMembDataText: '',
  2098. isFlag: false,
  2099. isMore: false,
  2100. stateKey: '0',
  2101. expandDate: [],
  2102. notifySelList:[],
  2103. departmentList: [],
  2104. approvalProcessDialog: false,
  2105. approvalProcessData: [],
  2106. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2107. 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')],
  2108. isWeekend: false,
  2109. canCancelInDialog: false,
  2110. approveinData: {},
  2111. approveinDialog: false,
  2112. reportCanDelete: false,
  2113. weeklyFilledTimeDialog: false,
  2114. weeklyFilledTimeList: [],
  2115. weeklyFilledTimeLoading: false,
  2116. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2117. weeklyFilledTimeCanDelete: false,
  2118. weeklyFilledTimeDate: null,
  2119. leaveAllNum: 0,
  2120. dataLoading: false,
  2121. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2122. vacationTime: {},
  2123. integrationProjectList: [],
  2124. totalReportHours: 0, // 合计的工时
  2125. workTimeForMinYi:0,
  2126. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2127. weekIndex: 1,
  2128. weekParentData: {},
  2129. deptIdForNoReport:[],
  2130. nameAearch: '', // 企业微信姓名搜索
  2131. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2132. deptMembDataLoading: false,
  2133. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2134. {
  2135. id: 4811,
  2136. // id: 10,
  2137. name: '陕西柘中建设工程有限公司'
  2138. }
  2139. ],
  2140. pushWorkTimeLogDig:false,
  2141. pushWorkTimeLogData:[],
  2142. };
  2143. },
  2144. watch: {
  2145. deptMembDataText(val) {
  2146. this.$refs.chooseMembTree.filter(val);
  2147. }
  2148. },
  2149. filters: {
  2150. // 过滤
  2151. amounts(value) {
  2152. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2153. return 0
  2154. }
  2155. var zhi = +value + 0
  2156. return zhi.toFixed(1)
  2157. },
  2158. // zhoData
  2159. zhoData(value, arr) {
  2160. var dateArray = value.split("-");
  2161. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2162. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2163. // console.log(arr[date.getDay()])
  2164. // return "周" + "日一二三四五六".charAt(date.getDay());
  2165. return arr[date.getDay()]
  2166. },
  2167. // 过滤数字
  2168. numbers(value) {
  2169. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2170. return 0
  2171. }
  2172. return value
  2173. },
  2174. },
  2175. computed: {},
  2176. mounted() {
  2177. var now = new Date();
  2178. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2179. this.today = t;
  2180. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2181. this.exportParam.dateRange = [startStr,t];
  2182. this.getAllDate(1);
  2183. this.getReportList();
  2184. this.getProjectList();
  2185. this.getFillProjectList();
  2186. this.getTimeType();
  2187. this.getDepartment();
  2188. this.scrollFunction()
  2189. this.userssHu();
  2190. if(this.user.timeType.reportAuditType == 3){
  2191. this.getAllUsersList()
  2192. }
  2193. if (this.user.company.packageProject == 1) {
  2194. this.getBasecostItemList();
  2195. }
  2196. if(this.user.timeType.lockWorktime){
  2197. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2198. }
  2199. const that = this
  2200. if(this.user.userNameNeedTranslate == 1) {
  2201. that.dataLoading = that.$store.state.dataLoading
  2202. this.upDataLoading()
  2203. setTimeout(()=>{
  2204. that.dataLoading = that.$store.state.dataLoading
  2205. }, 1000)
  2206. }
  2207. if (this.user.companyId == this.yuzhongCompId) {
  2208. this.getJobResponList();
  2209. }
  2210. },
  2211. methods: {
  2212. ...mapMutations(['upDataLoading']),
  2213. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2214. isCustomization(userInfo, permissionArray) {
  2215. const { companyId } = userInfo
  2216. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2217. return isReportPictureRequired
  2218. },
  2219. //任务被选中
  2220. onTaskSelected(domainItem) {
  2221. //取服务
  2222. if (domainItem.taskId) {
  2223. var that = this;
  2224. var param = {taskId:domainItem.taskId};
  2225. if (this.isSubstitude) {
  2226. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2227. param.userId = this.workForm.userId[0];
  2228. }
  2229. }
  2230. this.http.post('/task/getMyTaskService',param, res => {
  2231. if (res.code == "ok") {
  2232. // domainItem.workContentList = res.data;
  2233. that.$set(domainItem, 'sapServiceId', null);
  2234. that.$set(domainItem, 'serviceList', res.data);
  2235. } else {
  2236. this.$message({
  2237. message: res.msg,
  2238. type: "error"
  2239. });
  2240. }
  2241. },error => {
  2242. this.$message({
  2243. message: error,
  2244. type: "error"
  2245. });
  2246. }
  2247. );
  2248. } else {
  2249. //清空服务
  2250. }
  2251. },
  2252. onBatchTimeChange() {
  2253. //反向计算每日工作时长
  2254. if (this.workForm.createDate) {
  2255. let sdate = new Date(this.workForm.createDate[0]);
  2256. let edate = new Date(this.workForm.createDate[1]);
  2257. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2258. console.log('days===', days)
  2259. if (days < 0) {
  2260. return;
  2261. }
  2262. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2263. //总时长发生改变,自动按比例计算
  2264. this.workForm.domains.forEach(d=>{
  2265. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2266. });
  2267. }
  2268. },
  2269. //更新工作内容列表
  2270. updateJobContent(domainItem) {
  2271. var that = this;
  2272. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2273. if (res.code == "ok") {
  2274. // domainItem.workContentList = res.data;
  2275. that.$set(domainItem, 'extraField3', null);
  2276. that.$set(domainItem, 'workContentList', res.data);
  2277. } else {
  2278. this.$message({
  2279. message: res.msg,
  2280. type: "error"
  2281. });
  2282. }
  2283. },error => {
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. }
  2289. );
  2290. },
  2291. updateResponse(domainItem) {
  2292. var that = this;
  2293. var selectPid = domainItem.projectId;
  2294. domainItem.extraField2 = null;
  2295. domainItem.extraField3 = null;
  2296. if (selectPid && domainItem.extraField1) {
  2297. //是否非项目
  2298. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2299. console.log('==========','isPublic=='+isPublic);
  2300. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2301. console.log(filteredRespList);
  2302. domainItem.filteredRespList = filteredRespList;
  2303. }
  2304. },
  2305. getJobResponList() {
  2306. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2307. if (res.code == "ok") {
  2308. this.jobResponseList = res.data;
  2309. } else {
  2310. this.$message({
  2311. message: res.msg,
  2312. type: "error"
  2313. });
  2314. }
  2315. },error => {
  2316. this.$message({
  2317. message: error,
  2318. type: "error"
  2319. });
  2320. }
  2321. );
  2322. },
  2323. openModImportTime(row) {
  2324. this.showModImportTimeDialog = true;
  2325. this.modItemDataId = row.id;
  2326. },
  2327. delImportTime(row) {
  2328. let rowId = row.id;
  2329. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2330. confirmButtonText: this.$t('btn.determine'),
  2331. cancelButtonText: this.$t('btn.cancel'),
  2332. type: "warning"
  2333. })
  2334. .then(() => {
  2335. this.http.post('/report-import-log/delete',{
  2336. id: rowId
  2337. },res => {
  2338. if (res.code == "ok") {
  2339. this.$message({
  2340. message: '删除成功',
  2341. type: "success"
  2342. });
  2343. this.getToView();
  2344. } else {
  2345. this.$message({
  2346. message: res.msg,
  2347. type: "error"
  2348. });
  2349. }
  2350. },error => {
  2351. this.$message({
  2352. message: error,
  2353. type: "error"
  2354. });
  2355. }
  2356. );
  2357. }).catch(() => {this.startDeleting = false});
  2358. },
  2359. confirmChangeModTime() {
  2360. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2361. this.$message({
  2362. message: '请选择时间',
  2363. type: "error"
  2364. });
  2365. return;
  2366. }
  2367. this.http.post('/report-import-log/changeTime',{
  2368. modLogDateTime: this.modImportTime,
  2369. modImportUserId: this.modImportUserId,
  2370. id: this.modItemDataId
  2371. },res => {
  2372. if (res.code == "ok") {
  2373. this.$message({
  2374. message: '修改成功',
  2375. type: "success"
  2376. });
  2377. this.getToView();
  2378. this.showModImportTimeDialog = false;
  2379. } else {
  2380. this.$message({
  2381. message: res.msg,
  2382. type: "error"
  2383. });
  2384. }
  2385. },error => {
  2386. this.$message({
  2387. message: error,
  2388. type: "error"
  2389. });
  2390. }
  2391. );
  2392. },
  2393. confirmBatchApproveReport() {
  2394. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2395. this.$message({
  2396. message: '请选择日期范围',
  2397. type: "error"
  2398. });
  2399. return;
  2400. }
  2401. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2402. confirmButtonText: this.$t('btn.determine'),
  2403. cancelButtonText: this.$t('btn.cancel'),
  2404. type: "warning"
  2405. })
  2406. .then(() => {
  2407. this.startDeleting = true;
  2408. let obj = {
  2409. startDate: this.deleteReportParam.date[0],
  2410. endDate: this.deleteReportParam.date[1]
  2411. }
  2412. if(this.deleteReportParam.departmentId) {
  2413. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2414. } else {
  2415. obj.departmentId = null
  2416. }
  2417. this.http.post('/report/batchApproveByDate',obj,res => {
  2418. if (res.code == "ok") {
  2419. this.$message({
  2420. message: '审核通过',
  2421. type: "success"
  2422. });
  2423. this.getReportList();
  2424. this.getDepartment();
  2425. this.startDeleting = false;
  2426. } else {
  2427. this.$message({
  2428. message: res.msg,
  2429. type: "error"
  2430. });
  2431. }
  2432. },error => {
  2433. this.$message({
  2434. message: error,
  2435. type: "error"
  2436. });
  2437. }
  2438. );
  2439. }).catch(() => {this.startDeleting = false});
  2440. },
  2441. confirmBatchDelReport() {
  2442. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2443. this.$message({
  2444. message: '请选择部门或人员',
  2445. type: "error"
  2446. });
  2447. return;
  2448. }
  2449. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2450. this.$message({
  2451. message: '请选择日期范围',
  2452. type: "error"
  2453. });
  2454. return;
  2455. }
  2456. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2457. confirmButtonText: this.$t('btn.determine'),
  2458. cancelButtonText: this.$t('btn.cancel'),
  2459. type: "warning"
  2460. })
  2461. .then(() => {
  2462. this.startDeleting = true;
  2463. this.http.post('/report/batchDelete',{
  2464. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2465. startDate: this.deleteReportParam.date[0],
  2466. endDate: this.deleteReportParam.date[1],
  2467. deptId: this.deleteReportParam.deptId[0]
  2468. },res => {
  2469. if (res.code == "ok") {
  2470. this.$message({
  2471. message: this.$t('message.successfullyDeleted'),
  2472. type: "success"
  2473. });
  2474. this.getReportList();
  2475. this.getDepartment();
  2476. this.startDeleting = false;
  2477. } else {
  2478. this.$message({
  2479. message: res.msg,
  2480. type: "error"
  2481. });
  2482. }
  2483. },error => {
  2484. this.$message({
  2485. message: error,
  2486. type: "error"
  2487. });
  2488. }
  2489. );
  2490. }).catch(() => {this.startDeleting = false});
  2491. },
  2492. getRecentlyProject() {
  2493. this.http.post('/project/nearProject',{},res => {
  2494. if(res.code == 'ok'){
  2495. let topObj = {
  2496. label: '最近选择项目',
  2497. peojectList: res.data
  2498. }
  2499. let botomObj = {
  2500. label: '全部项目',
  2501. peojectList: this.fillProjectList
  2502. }
  2503. //最近项目如果在fillProjectList中不存在,需要移除
  2504. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2505. this.integrationProjectList = [topObj, botomObj]
  2506. }else {
  2507. this.$message({
  2508. message: res.msg,
  2509. type: 'error'
  2510. })
  2511. }
  2512. },err => {
  2513. this.$message({
  2514. message: err,
  2515. type: 'error'
  2516. })
  2517. })
  2518. },
  2519. handlePictureCardPreview(file, index) {
  2520. console.log(file, index)
  2521. let arr = []
  2522. let imgArr = this.workForm.domains[index].imgListUrl
  2523. for(var i in imgArr) {
  2524. arr.push(imgArr[i].url)
  2525. }
  2526. console.log(arr, '图片数据')
  2527. const $viewer = this.$viewerApi({
  2528. images: arr
  2529. });
  2530. },
  2531. // 图片上传
  2532. addImg(e, index) {
  2533. console.log(e, '数据')
  2534. let formData = new FormData()
  2535. formData.append('multipartFile', e.file)
  2536. this.http.uploadFile('/common/uploadFile', formData,
  2537. res => {
  2538. if (res.code == "ok") {
  2539. this.$message({
  2540. message: this.$t('uploadedsuccessfully'),
  2541. type: "success"
  2542. });
  2543. if(!this.workForm.domains[index].imgList) {
  2544. this.workForm.domains[index].imgList = []
  2545. this.workForm.domains[index].imgListUrl = []
  2546. }
  2547. this.workForm.domains[index].imgList.push(res.data)
  2548. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2549. } else {
  2550. this.$message({message: res.msg,type: "error"});
  2551. }
  2552. console.log(this.workForm.domains[index])
  2553. },
  2554. error => {this.$message({message: error,type: "error"});
  2555. });
  2556. },
  2557. // 删除图片
  2558. delImg(file,fileList, index) {
  2559. console.log(file, fileList)
  2560. let idx = 0
  2561. for(let i in fileList) {
  2562. if(fileList[i].uid == file.uid) {
  2563. idx = i
  2564. }
  2565. }
  2566. this.workForm.domains[index].imgList.splice(idx, 1)
  2567. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2568. console.log(this.workForm.domains[index])
  2569. },
  2570. test(){
  2571. console.log('test',this.workForm.domains);
  2572. },
  2573. getHour(s1, s2) {
  2574. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2575. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2576. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2577. var ms = s2.getTime() - s1.getTime();
  2578. if (ms < 0) return 0;
  2579. let ma = ms / 1000 / 60 / 60
  2580. return ma; //小时
  2581. },
  2582. refreshWXCardTime(workdate) {
  2583. if (!workdate) return;
  2584. this.syncTimeLoading = true;
  2585. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2586. date: workdate,
  2587. },res => {
  2588. this.syncTimeLoading = false;
  2589. if(res.code == 'ok'){
  2590. this.workForm.time = res.data.time;
  2591. }else {
  2592. this.$message({
  2593. message: res.msg,
  2594. type: 'error'
  2595. })
  2596. }
  2597. },err => {
  2598. this.syncTimeLoading = false;
  2599. this.$message({
  2600. message: err,
  2601. type: 'error'
  2602. })
  2603. })
  2604. },
  2605. refreshAttendance(workdate) {
  2606. if (!workdate) return;
  2607. this.syncTimeLoading = true;
  2608. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2609. startDate: workdate[0],
  2610. endDate: workdate[1]
  2611. },res => {
  2612. this.syncTimeLoading = false;
  2613. if(res.code == 'ok'){
  2614. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2615. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2616. this.totalReportHours = this.workTimeForMinYi;
  2617. }else {
  2618. this.$message({
  2619. message: res.msg,
  2620. type: 'error'
  2621. })
  2622. }
  2623. },err => {
  2624. this.syncTimeLoading = false;
  2625. this.$message({
  2626. message: err,
  2627. type: 'error'
  2628. })
  2629. })
  2630. },
  2631. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2632. this.weeklyFilledTimeDialog = true
  2633. this.weeklyFilledTimeLoading = true
  2634. this.weeklyFilledTimeDate = parameterDate
  2635. this.http.post('/report/getReportList',{
  2636. date: parameterDate,
  2637. userId: this.user.id
  2638. },res => {
  2639. this.weeklyFilledTimeLoading = false
  2640. if(res.code == 'ok'){
  2641. this.weeklyFilledTimeList = res.data[0].data
  2642. let candelete = true
  2643. for(let i in this.weeklyFilledTimeList){
  2644. if(this.weeklyFilledTimeList[i].state < 2){
  2645. candelete = false
  2646. }
  2647. }
  2648. this.weeklyFilledTimeCanDelete = candelete
  2649. }else {
  2650. this.$message({
  2651. message: res.msg,
  2652. type: 'error'
  2653. })
  2654. }
  2655. },err => {
  2656. this.weeklyFilledTimeLoading = false
  2657. this.$message({
  2658. message: err,
  2659. type: 'error'
  2660. })
  2661. })
  2662. },
  2663. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2664. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2665. confirmButtonText: this.$t('btn.determine'),
  2666. cancelButtonText: this.$t('btn.cancel'),
  2667. type: "warning"
  2668. })
  2669. .then(() => {
  2670. this.http.post('/report/delete',{
  2671. userId: this.user.id,
  2672. date: this.weeklyFilledTimeDate
  2673. },res => {
  2674. if (res.code == "ok") {
  2675. this.$message({
  2676. message: this.$t('message.successfullyDeleted'),
  2677. type: "success"
  2678. });
  2679. this.getWeeklyWorkTime()
  2680. this.getReportList();
  2681. this.getDepartment();
  2682. this.weeklyFilledTimeDialog = false;
  2683. } else {
  2684. this.$message({
  2685. message: res.msg,
  2686. type: "error"
  2687. });
  2688. }
  2689. },error => {
  2690. this.$message({
  2691. message: error,
  2692. type: "error"
  2693. });
  2694. }
  2695. );
  2696. }).catch(() => {});
  2697. },
  2698. getApprovalProcess(item){
  2699. // console.log('this.date',this.choseDate);
  2700. this.http.post('/report-log/get',{
  2701. creatorId: item.id,
  2702. createDate: sessionStorage.msg
  2703. },res => {
  2704. if(res.code == 'ok'){
  2705. this.approvalProcessDialog = true
  2706. if(this.user.userNameNeedTranslate == 1) {
  2707. for(var i in res.data) {
  2708. let obj = {
  2709. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2710. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2711. }
  2712. res.data[i].msgCon = obj
  2713. }
  2714. }
  2715. this.approvalProcessData = res.data
  2716. console.log(this.approvalProcessData, '数据卡看')
  2717. }else{
  2718. this.$message({
  2719. message: res.msg,
  2720. type: 'error'
  2721. })
  2722. }
  2723. },err => {
  2724. this.$message({
  2725. message: err,
  2726. type: 'error'
  2727. })
  2728. })
  2729. },
  2730. filterNode(value, data) {
  2731. if (!value) return true;
  2732. return data.label.indexOf(value) !== -1;
  2733. },
  2734. triggerCalculateOT(index) {
  2735. var str = this.workForm.domains[index].overtimeHours + ''
  2736. if(str.indexOf('.') != '-1') {
  2737. var s = str.split('.')[0]
  2738. var st = str.split('.')[1]
  2739. var sts = st.split('')
  2740. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2741. }
  2742. },
  2743. searchScreen(e){
  2744. if(e){
  2745. this.monthNotWorkDateS1 = []
  2746. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2747. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2748. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2749. }
  2750. }
  2751. if (this.monthNotWorkDateS1.length > 50) {
  2752. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2753. }else{
  2754. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2755. }
  2756. // if (this.monthNotWorkDateS1.length > 0) {
  2757. // setTimeout(() => {
  2758. // this.tableListenernot()
  2759. // }, 1000);
  2760. // }
  2761. }else{
  2762. this.monthWorkDataS1 = []
  2763. for (let i = 0; i < this.monthWorkData.length; i++) {
  2764. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2765. this.monthWorkDataS1.push(this.monthWorkData[i])
  2766. }
  2767. }
  2768. if (this.monthWorkDataS1.length > 50) {
  2769. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2770. }else{
  2771. this.monthWorkDataS = this.monthWorkDataS1
  2772. }
  2773. // if (this.monthWorkDataS1.length > 0) {
  2774. // setTimeout(() => {
  2775. // this.tableListener()
  2776. // }, 1000);
  2777. // }
  2778. }
  2779. },
  2780. addUpload(data) {
  2781. // var zhi = data.fileName.split('.')[0]
  2782. // var sss = zhi + '.xlsx'
  2783. // return
  2784. var filePath = '/upload/' + data.serverName;
  2785. const a = document.createElement('a'); // 创建a标签
  2786. a.setAttribute('download', data.fileName);// download属性
  2787. a.setAttribute('href', filePath);// href链接
  2788. a.click(); //自执行点击事件
  2789. a.remove();
  2790. },
  2791. restrictNumber(targetId) {
  2792. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2793. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2794. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2795. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2796. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2797. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2798. inpu.value = parseFloat(inpu.value);
  2799. }
  2800. },
  2801. //获取项目下的任务分组
  2802. getTaskGroups(domain, index) {
  2803. domain.groupId=null;
  2804. this.http.post('/task-group/listMyJoinGroup',{
  2805. projectId: domain.projectId,
  2806. isSubstitude: this.isSubstitude ? 1 : 0
  2807. },
  2808. res => {
  2809. if (res.code == "ok") {
  2810. this.workForm.domains[index].taskGroups = res.data;
  2811. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2812. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2813. // this.getGroupStages(domain, index);
  2814. // }
  2815. this.$forceUpdate();
  2816. }
  2817. },
  2818. error => {
  2819. this.$message({
  2820. message: error,
  2821. type: "error"
  2822. });
  2823. }
  2824. );
  2825. },
  2826. //下载填报工时占比报表
  2827. downloadProjectRatio() {
  2828. this.exportUserRatio = true;
  2829. // let now = new Date();
  2830. // let month = now.getMonth();//默认看上个月的
  2831. // let monthStr = month<10? ('0'+month): month;
  2832. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2833. const today = new Date();
  2834. const year = today.getFullYear();
  2835. const month = today.getMonth() + 1;
  2836. let lastMonthYear, lastMonth;
  2837. if (month === 1) {
  2838. lastMonthYear = year - 1;
  2839. lastMonth = 12;
  2840. } else {
  2841. lastMonthYear = year;
  2842. lastMonth = month - 1;
  2843. }
  2844. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2845. console.log('赋值 ==>', this.ratioYmonth)
  2846. },
  2847. confirmDownloadRatio() {
  2848. this.startRatioExporting = true;
  2849. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2850. ymonth: this.ratioYmonth
  2851. },
  2852. res => {
  2853. if (res.code == "ok") {
  2854. this.startRatioExporting = false;
  2855. var filePath = res.data;
  2856. const a = document.createElement('a'); // 创建a标签
  2857. var data = filePath.split("/");
  2858. a.setAttribute('download', data[data.length-1]);// download属性
  2859. a.setAttribute('href', filePath);// href链接
  2860. a.click(); //自执行点击事件
  2861. a.remove();
  2862. } else {
  2863. this.startRatioExporting = false;
  2864. this.$message({
  2865. message: res.msg,
  2866. type: "error"
  2867. });
  2868. }
  2869. },
  2870. error => {
  2871. this.checkinLoading = false;
  2872. this.$message({
  2873. message: error,
  2874. type: "error"
  2875. });
  2876. }
  2877. );
  2878. },
  2879. //下载带企业微信考勤数据的工时统计模板
  2880. downloadCheckInExcel() {
  2881. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2882. startDate: this.importWxParam.date[0],
  2883. endDate: this.importWxParam.date[1],
  2884. },
  2885. res => {
  2886. if (res.code == "ok") {
  2887. var filePath = res.data;
  2888. const a = document.createElement('a'); // 创建a标签
  2889. var data = filePath.split("/");
  2890. a.setAttribute('download', data[data.length-1]);// download属性
  2891. a.setAttribute('href', filePath);// href链接
  2892. a.click(); //自执行点击事件
  2893. a.remove();
  2894. } else {
  2895. this.$message({
  2896. message: res.msg,
  2897. type: "error"
  2898. });
  2899. }
  2900. },
  2901. error => {
  2902. this.checkinLoading = false;
  2903. this.$message({
  2904. message: error,
  2905. type: "error"
  2906. });
  2907. }
  2908. );
  2909. },
  2910. pre() {
  2911. if (this.active == 0) return;
  2912. this.active--;
  2913. },
  2914. next() {
  2915. this.active++;
  2916. },
  2917. triggerTotalTime(index) {
  2918. var item = this.checkinList[index];
  2919. var total = 0.0;
  2920. for (var i=0;i<this.projectColumns.length; i++) {
  2921. var key = this.projectColumns[i];
  2922. if (item[key] != null && item[key] != '') {
  2923. total += parseFloat(item[key]);
  2924. }
  2925. }
  2926. item.totalFillTime = total;
  2927. },
  2928. //提交批量代填的数据
  2929. submitBatchSubFillData() {
  2930. var data = JSON.stringify(this.checkinList);
  2931. this.http.post('/user-corpwx-time/submitProjectTime',{
  2932. json: data,
  2933. projectColumns: JSON.stringify(this.projectColumns)
  2934. },
  2935. res => {
  2936. if (res.code == "ok") {
  2937. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2938. this.importWxDialog = false;
  2939. }
  2940. },
  2941. error => {
  2942. this.checkinLoading = false;
  2943. this.$message({
  2944. message: error,
  2945. type: "error"
  2946. });
  2947. }
  2948. );
  2949. },
  2950. loadCheckInData() {
  2951. if (this.importWxParam.date == null) {
  2952. this.checkinList = [];
  2953. return;
  2954. }
  2955. this.checkinLoading = true;
  2956. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2957. startDate: this.importWxParam.date[0],
  2958. endDate: this.importWxParam.date[1],
  2959. },
  2960. res => {
  2961. if (res.code == "ok") {
  2962. this.checkinLoading = false;
  2963. this.checkinList = res.data.list;
  2964. this.projectColumns = res.data.projects;
  2965. // 自定义表格会导致表格错乱,需重新计算表格
  2966. this.$nextTick(()=>{
  2967. this.$refs.tab.doLayout()
  2968. })
  2969. }
  2970. },
  2971. error => {
  2972. this.checkinLoading = false;
  2973. this.$message({
  2974. message: error,
  2975. type: "error"
  2976. });
  2977. }
  2978. );
  2979. },
  2980. importCardTime(item) {
  2981. //首先判断文件类型
  2982. let str = item.file.name.split(".");
  2983. let format = str[str.length - 1];
  2984. if (format != "xls" && format != "xlsx") {
  2985. this.$message({
  2986. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2987. type: "error"
  2988. });
  2989. } else {
  2990. this.importingData = true;
  2991. let formData = new FormData();
  2992. formData.append("multipartFile", item.file);
  2993. formData.append("companyId", this.user.companyId);
  2994. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  2995. res => {
  2996. this.$refs.uploadCardTime.clearFiles();
  2997. this.importingData = false;
  2998. if (res.code == "ok") {
  2999. //换成弹出框,以免有人等了半天回来啥也没看到
  3000. this.$message({
  3001. message: '导入考勤时长成功',
  3002. type: "success"
  3003. });
  3004. } else {
  3005. this.$message({
  3006. message: res.msg,
  3007. type: "error"
  3008. });
  3009. }
  3010. },
  3011. error => {
  3012. this.$refs.upload.clearFiles();
  3013. this.listLoading = false;
  3014. this.$message({
  3015. message: error,
  3016. type: "error"
  3017. });
  3018. });
  3019. }
  3020. },
  3021. batchImportWxData(item) {
  3022. //首先判断文件类型
  3023. let str = item.file.name.split(".");
  3024. let format = str[str.length - 1];
  3025. if (format != "xls" && format != "xlsx") {
  3026. this.$message({
  3027. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3028. type: "error"
  3029. });
  3030. } else {
  3031. this.importingData = true;
  3032. let formData = new FormData();
  3033. formData.append("file", item.file);
  3034. formData.append("companyId", this.user.companyId);
  3035. formData.append("withCheckIn", 1);
  3036. this.http.uploadFile('/report/importData', formData,
  3037. res => {
  3038. this.$refs.upload.clearFiles();
  3039. this.showImportResult = true;
  3040. this.importingData = false;
  3041. if (res.code == "ok") {
  3042. //换成弹出框,以免有人等了半天回来啥也没看到
  3043. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3044. this.getReportList();
  3045. this.importWxDialog = false;
  3046. } else {
  3047. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  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. batchImportData(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. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3075. this.http.uploadFile(url, formData,
  3076. res => {
  3077. this.$refs.upload.clearFiles();
  3078. this.importingData = false;
  3079. this.showImportResult = true;
  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.importingData = false;
  3092. this.$message({
  3093. message: error,
  3094. type: "error"
  3095. });
  3096. });
  3097. }
  3098. },
  3099. userssHu() {
  3100. this.http.post('/time-type/getCompanyTimeSetting',{
  3101. companyId: this.user.companyId
  3102. },
  3103. res => {
  3104. if (res.code == "ok") {
  3105. this.yonghuUser = res.data
  3106. }
  3107. },
  3108. error => {
  3109. this.$message({
  3110. message: error,
  3111. type: "error"
  3112. });
  3113. }
  3114. );
  3115. },
  3116. iptBlur(i) {
  3117. if(this.isBatch == 0) {
  3118. return
  3119. }
  3120. this.http.post('/report/getWorkDays',{
  3121. startDate: this.workForm.createDate[0],
  3122. endDate: this.workForm.createDate[1]
  3123. },
  3124. res => {
  3125. if (res.code == "ok") {
  3126. this.jsDay = res.data
  3127. this.chuji(i)
  3128. } else {
  3129. this.$message({
  3130. message: res.msg,
  3131. type: "error"
  3132. });
  3133. }
  3134. },
  3135. error => {
  3136. this.$message({
  3137. message: error,
  3138. type: "error"
  3139. });
  3140. }
  3141. );
  3142. //明夷硬编码获取
  3143. if (this.user.company.companyName == this.mingyiName) {
  3144. this.getWorkTimeForMinYi();
  3145. }
  3146. },
  3147. getWorkTimeForMinYi(){
  3148. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3149. startDate: this.workForm.createDate[0],
  3150. endDate: this.workForm.createDate[1]
  3151. },
  3152. res => {
  3153. if (res.code == "ok") {
  3154. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3155. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3156. this.totalReportHours = this.workTimeForMinYi;
  3157. } else {
  3158. this.$message({
  3159. message: res.msg,
  3160. type: "error"
  3161. });
  3162. this.workForm.createDate = [];
  3163. }
  3164. },
  3165. error => {
  3166. this.$message({
  3167. message: error,
  3168. type: "error"
  3169. });
  3170. }
  3171. );
  3172. },
  3173. chuji(i) {
  3174. if(i == 0) {
  3175. this.seleChn(1)
  3176. } else if(i == 1) {
  3177. this.seleChn(0)
  3178. } else if(i == 2) {
  3179. if(this.workForm.domains[0].multiWorktime > 0) {
  3180. this.iptChangs()
  3181. } else {
  3182. this.iptChang()
  3183. }
  3184. } else if(i == 3) {
  3185. this.seleChn(0)
  3186. }
  3187. },
  3188. seleChn(e,domain) {
  3189. if(e == 1) {
  3190. for(var i in this.workForm.domains) {
  3191. if(this.workForm.domains[i].timeType == 0) {
  3192. this.workForm.domains[i].workingTime = 8
  3193. } else {
  3194. this.workForm.domains[i].workingTime = 4
  3195. }
  3196. }
  3197. }
  3198. var quanbu = 0
  3199. var spl = this.workForm.domains
  3200. var zhi = ''
  3201. for(var i in spl) {
  3202. var sp = +spl[i].workingTime + 0
  3203. zhi = this.jsDay * sp
  3204. quanbu = +quanbu + zhi
  3205. }
  3206. this.jsTime = quanbu
  3207. this.totalReportHours = quanbu
  3208. let worktime = this.jsTime
  3209. // 自动计算加班时长
  3210. if(this.isBatch != 0){
  3211. worktime = this.jsTime / this.jsDay
  3212. }
  3213. if(this.user.timeType.fillOvertime && domain){
  3214. let isover = false
  3215. let alltime = 0
  3216. let allover = 0 //此处alltime同上面的worktime
  3217. for(let d in spl){
  3218. if(spl[d].isOvertime){
  3219. isover = true
  3220. allover += spl[d].overtimeHours*1
  3221. }
  3222. alltime += spl[d].workingTime*1
  3223. }
  3224. if(domain.overtimeHours){
  3225. allover = allover - domain.overtimeHours
  3226. }
  3227. if(worktime*1 > this.user.timeType.allday){
  3228. if(isover){
  3229. if(alltime > (allover + this.user.timeType.allday)){
  3230. this.$set(domain,'isOvertime',true)
  3231. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3232. }else{
  3233. this.$set(domain,'isOvertime',false)
  3234. this.$set(domain,'overtimeHours',null)
  3235. if(alltime < (allover + this.user.timeType.allday)){
  3236. let overtime = allover + this.user.timeType.allday - alltime
  3237. for(let pi in spl){
  3238. if(spl[pi].overtimeHours){
  3239. if((overtime - spl[pi].overtimeHours*1) > 0){
  3240. overtime = overtime - spl[pi].overtimeHours*1
  3241. this.$set(spl[pi],'isOvertime',false)
  3242. this.$set(spl[pi],'overtimeHours',null)
  3243. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3244. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3245. break
  3246. }else{
  3247. this.$set(spl[pi],'isOvertime',false)
  3248. this.$set(spl[pi],'overtimeHours',null)
  3249. break
  3250. }
  3251. }
  3252. }
  3253. }
  3254. }
  3255. }else{
  3256. this.$set(domain,'isOvertime',true)
  3257. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3258. }
  3259. }else{
  3260. for(let di in spl){
  3261. this.$set(spl[di],'isOvertime',false)
  3262. this.$set(spl[di],'overtimeHours',null)
  3263. }
  3264. }
  3265. }
  3266. },
  3267. iptChang() {
  3268. var sl = this.workForm.domains
  3269. let timeArr = []
  3270. for(var i in sl) {
  3271. if(sl[i].startTime && sl[i].endTime) {
  3272. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3273. }
  3274. }
  3275. this.getTimeHours(timeArr)
  3276. // for(let j in arrNum) {
  3277. // this.timeJsonStr += arrNum[j]
  3278. // if(flg) {
  3279. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3280. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3281. // }
  3282. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3283. // flg = true
  3284. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3285. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3286. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3287. // }
  3288. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3289. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3290. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3291. // }
  3292. // }
  3293. },
  3294. iptChangs() {
  3295. var sl = this.workForm.domains
  3296. let timeArr = []
  3297. for(var i in sl) {
  3298. for(var j in sl[i].worktimeList){
  3299. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3300. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3301. }
  3302. }
  3303. }
  3304. this.getTimeHours(timeArr)
  3305. },
  3306. // 调用接口或去数据
  3307. getTimeHours(arr) {
  3308. this.http.post('/report/getHoursByTimeRange',{
  3309. timeJsonStr: JSON.stringify(arr)
  3310. },res => {
  3311. if(res.code === 'ok') {
  3312. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3313. } else {
  3314. this.$message({
  3315. message: res.msg,
  3316. type: 'error'
  3317. })
  3318. }
  3319. },err => {
  3320. this.$message({
  3321. message: err,
  3322. type: 'error'
  3323. })
  3324. })
  3325. },
  3326. // 按周填报调用接口计算时间
  3327. async getWeekHoursByTimeRange(timeRange) {
  3328. const url = '/report/getHoursByTimeRange';
  3329. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3330. var that = this;
  3331. return new Promise((resolve, reject) => {
  3332. this.http.post(url, data, function(res) {
  3333. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3334. }, function(err) {
  3335. reject(err);
  3336. });
  3337. });
  3338. },
  3339. removeTimeItem(item, index) {
  3340. item.worktimeList.splice(index, 1);
  3341. this.iptChangs()
  3342. },
  3343. //添加工时
  3344. addNewWorktime(index, item) {
  3345. if(item.worktimeList == null ) {
  3346. item.worktimeList = []
  3347. }
  3348. item.worktimeList.push({});
  3349. },
  3350. //复制项目
  3351. copyProject(index) {
  3352. var leftProgress = 10;
  3353. if (this.reportTimeType.type == 3) {
  3354. //计算已经待分配工时比例
  3355. let array = this.workForm.domains;
  3356. let totalProgress = 0;
  3357. for (var i=0;i<array.length; i++) {
  3358. totalProgress += array[i].progress;
  3359. }
  3360. if (totalProgress < 100) {
  3361. leftProgress = 100 - totalProgress;
  3362. }
  3363. }
  3364. var newIndex = index+1;
  3365. var itemDomain = {
  3366. projectId: this.workForm.domains[index].projectId,
  3367. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3368. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3369. ),
  3370. content: "",
  3371. progress:leftProgress,
  3372. state:2,//2-表示待提交
  3373. };
  3374. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3375. if (this.reportTimeType.type == 0) {
  3376. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3377. var length = this.workForm.domains.length;
  3378. if (length == 2) {
  3379. this.showAddMore = false;
  3380. }
  3381. }
  3382. this.selectProject(itemDomain, newIndex);
  3383. },
  3384. pushWorkTime(){
  3385. let url=''
  3386. if(this.user.timeType.syncSap == 1){
  3387. url='/report/pushProjectReportToSap'
  3388. }else{
  3389. url='/report/pushReportDataToThird'
  3390. }
  3391. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3392. confirmButtonText: '确定',
  3393. cancelButtonText: '取消',
  3394. type: 'info'
  3395. }).then(() => {
  3396. const loading = this.$loading({
  3397. lock: true,
  3398. text: '正在推送中,请耐心等待。',
  3399. spinner: 'el-icon-loading',
  3400. background: 'rgba(0, 0, 0, 0.7)'
  3401. });
  3402. this.http.post(url,{
  3403. yearMonth: this.date
  3404. },res => {
  3405. loading.close();
  3406. if(res.code == 'ok'){
  3407. this.$message({
  3408. type: 'success',
  3409. message: '推送成功!'
  3410. });
  3411. }else{
  3412. this.$message({
  3413. type: 'error',
  3414. message: res.msg
  3415. })
  3416. }
  3417. },err => {
  3418. loading.close();
  3419. this.$message({
  3420. type: 'error',
  3421. message: err
  3422. })
  3423. })
  3424. }).catch(() => {
  3425. });
  3426. },
  3427. showWorkTime(){
  3428. this.monthWorkTimeDialog = true;
  3429. this.searchKeyword = ''
  3430. this.WorktimeDatepickValue = this.istoMonth()
  3431. if(this.WorktimeDatepickValue.length == 0){
  3432. let newdate = new Date();
  3433. let nowdate = newdate.toLocaleDateString();
  3434. let getauto = this.getAutoWeekDate(nowdate)
  3435. let nowwd = [getauto[0],getauto[6]]
  3436. this.WorktimeDatepickValue = nowwd
  3437. }
  3438. this.showMonthWorkTime()
  3439. },
  3440. handleClick(t,e){
  3441. if (t.name == "first") {
  3442. this.showMonthWorkTime()
  3443. }else{
  3444. this.showMonthNotWorkTime()
  3445. }
  3446. },
  3447. //导出员工每日填报工时数
  3448. exportMembWorkHours() {
  3449. this.http.post(
  3450. "/report/exportUserDailyWorkTime",
  3451. {
  3452. // month: this.date,
  3453. startDate: this.WorktimeDatepickValue[0],
  3454. endDate: this.WorktimeDatepickValue[1],
  3455. },
  3456. (res) => {
  3457. if (res.code == "ok") {
  3458. let url = res.data;
  3459. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3460. }
  3461. },
  3462. (error) => {
  3463. this.$message({
  3464. message: error,
  3465. type: "error",
  3466. });
  3467. }
  3468. );
  3469. },
  3470. exportMembNotWorkHours() {
  3471. this.http.post(
  3472. "/report/exportNoReportUserList",
  3473. {
  3474. // month: this.date,
  3475. startDate: this.WorktimeDatepickValue[0],
  3476. endDate: this.WorktimeDatepickValue[1],
  3477. },
  3478. (res) => {
  3479. if (res.code == "ok") {
  3480. let url = res.data;
  3481. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3482. }
  3483. },
  3484. (error) => {
  3485. this.$message({
  3486. message: error,
  3487. type: "error",
  3488. });
  3489. }
  3490. );
  3491. },
  3492. downloadByA(name, url) {
  3493. const a = document.createElement("a"); // 创建a标签
  3494. a.setAttribute("download", name); // download属性
  3495. a.setAttribute("href", url); // href链接
  3496. a.click(); // 自执行点击事件
  3497. a.remove();
  3498. },
  3499. // 是否本月判断
  3500. istoMonth(){
  3501. let todate = new Date()
  3502. let tomonth = todate.getMonth() + 1
  3503. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3504. if(this.date == adate){
  3505. return []
  3506. }else{
  3507. let sedate = new Date(this.date)
  3508. let semonth = sedate.getMonth() + 1
  3509. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3510. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3511. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3512. return [sedates1, sedates2]
  3513. }
  3514. },
  3515. showMonthWorkTime() {
  3516. this.monthTotalPage = 0,
  3517. this.tbload = true
  3518. this.http.post(
  3519. "/report/getUserDailyWorkTime",
  3520. // "/report/getNoReportUserList",
  3521. {
  3522. // month: this.date,
  3523. startDate: this.WorktimeDatepickValue[0],
  3524. endDate: this.WorktimeDatepickValue[1],
  3525. },
  3526. (res) => {
  3527. if (res.code == "ok") {
  3528. this.tbload = false;
  3529. this.pickDateArray = res.data.days;
  3530. // console.log('dataarray',res.data.days);
  3531. this.monthWorkData = res.data.list;
  3532. // this.monthWorkDataS = this.monthWorkData
  3533. // this.monthWorkDataS1 = res.data.list
  3534. this.monthTotal = res.data.list.length
  3535. if (this.monthWorkData.length > 50) {
  3536. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3537. }else{
  3538. this.monthWorkDataS = this.monthWorkData
  3539. }
  3540. this.searchScreen(0)
  3541. // this.monthWorkDataS = infoList
  3542. // 判断
  3543. // if (this.monthWorkDataS1.length > 0) {
  3544. // setTimeout(() => {
  3545. // this.tableListener()
  3546. // }, 1000);
  3547. // }
  3548. this.$nextTick(function(){
  3549. this.$refs.hasworkTbl.doLayout();
  3550. });
  3551. // this.$forceUpdate()
  3552. }
  3553. },
  3554. (error) => {
  3555. this.tbload = false
  3556. this.$message({
  3557. message: error,
  3558. type: "error",
  3559. });
  3560. }
  3561. );
  3562. },
  3563. // tableListener(){
  3564. // let that = this;
  3565. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3566. // // 添加scroll监听事件
  3567. // dom.addEventListener("scroll", function () {
  3568. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3569. // if (scrollDistance < 2) {
  3570. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3571. // that.monthTotalPage++; //当前页数自增
  3572. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3573. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3574. // var infoList = arrList.splice(
  3575. // that.monthTotalPage * that.monthTotalLages,
  3576. // that.monthTotalLages
  3577. // );
  3578. // // 数据添加
  3579. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3580. // }
  3581. // }
  3582. // })
  3583. // },
  3584. showMonthNotWorkTime() {
  3585. this.monthTotalPage = 0,
  3586. this.tbload = true,
  3587. this.http.post(
  3588. "/report/getNoReportUserList",
  3589. {
  3590. startDate: this.WorktimeDatepickValue[0],
  3591. endDate: this.WorktimeDatepickValue[1],
  3592. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3593. },
  3594. (res) => {
  3595. if (res.code == "ok") {
  3596. this.tbload = false
  3597. this.monthNotWorkDate = res.data;
  3598. // this.monthNotWorkDateS1 = res.data
  3599. this.monthnotTotal = res.data.length
  3600. // 2222111
  3601. if (this.monthNotWorkDate.length > 50) {
  3602. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3603. } else {
  3604. this.monthNotWorkDateS = this.monthNotWorkDate
  3605. }
  3606. this.searchScreen(1)
  3607. // 判断
  3608. // if (this.monthnotworkDateS1.length > 0) {
  3609. // setTimeout(() => {
  3610. // this.tableListenernot()
  3611. // }, 1000);
  3612. // }
  3613. this.$nextTick(function(){
  3614. this.$refs.hasworkTbl2.doLayout();
  3615. });
  3616. }
  3617. },
  3618. (error) => {
  3619. this.tbload = false
  3620. this.$message({
  3621. message: error,
  3622. type: "error",
  3623. });
  3624. }
  3625. );
  3626. },
  3627. // tableListenernot(){
  3628. // let that = this;
  3629. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3630. // dom.addEventListener("scroll", function () {
  3631. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3632. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3633. // if (scrollDistance2 < 2) {
  3634. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3635. // that.monthnotTotalPage++; //当前页数自增
  3636. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3637. // var infoList = arrList.splice(
  3638. // that.monthnotTotalPage * that.monthnotTotalLages,
  3639. // that.monthnotTotalLages
  3640. // );
  3641. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3642. // }
  3643. // }
  3644. // })
  3645. // },
  3646. listScroll(){
  3647. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3648. this.isMore = true
  3649. setTimeout(()=>{
  3650. this.isMore = false
  3651. },1000)
  3652. }else {
  3653. this.isFlag = true
  3654. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3655. this.monthWorkDataS = datalist
  3656. setTimeout(()=>{
  3657. this.isFlag = false
  3658. },300)
  3659. }
  3660. },
  3661. notListScroll(){
  3662. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3663. this.isMore = true
  3664. setTimeout(()=>{
  3665. this.isMore = false
  3666. },1000)
  3667. }else {
  3668. this.isFlag = true
  3669. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3670. this.monthNotWorkDateS = datalist
  3671. // console.log('length',this.monthNotWorkDateS.length)
  3672. setTimeout(()=>{
  3673. this.isFlag = false
  3674. },300)
  3675. }
  3676. },
  3677. // 获取默认这zhou日期参数 222
  3678. getLastWeek(e){
  3679. let newdate = new Date()
  3680. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3681. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3682. if(e){
  3683. this.WorktimeDatepickValue = lastwd
  3684. this.showMonthWorkTime()
  3685. }else{
  3686. this.WorktimeDatepickValue = lastwd
  3687. this.showMonthNotWorkTime()
  3688. }
  3689. },
  3690. getThisWeek(e){
  3691. let newdate = new Date();
  3692. let nowdate = newdate.toLocaleDateString();
  3693. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3694. if(e){
  3695. this.WorktimeDatepickValue = nowwd
  3696. this.showMonthWorkTime()
  3697. }else{
  3698. this.WorktimeDatepickValue = nowwd
  3699. this.showMonthNotWorkTime()
  3700. }
  3701. },
  3702. getDoubleLastWeek(e){
  3703. let newdate = new Date()
  3704. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3705. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3706. if(e){
  3707. this.WorktimeDatepickValue = nextwd
  3708. this.showMonthWorkTime()
  3709. }else{
  3710. this.WorktimeDatepickValue = nextwd
  3711. this.showMonthNotWorkTime()
  3712. }
  3713. },
  3714. alreadyAllDate(stime,etime){
  3715. let diffdate = new Array();
  3716. let i=0;
  3717. while(stime<=etime){
  3718. let dateArray = stime.split("-");
  3719. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3720. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3721. let stimewk = this.weekDay[date.getDay()]
  3722. 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')
  3723. 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])
  3724. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3725. let stime_ts = new Date(stime).getTime();
  3726. let next_date = stime_ts + (24*60*60*1000);
  3727. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3728. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3729. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3730. stime = next_dates_y+next_dates_m+next_dates_d;
  3731. i++;
  3732. }
  3733. return diffdate
  3734. },
  3735. getAutoWeekDate(e) {
  3736. let dateString = e;
  3737. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3738. if (dateString.match(dateStringReg)) {
  3739. let presentDate = new Date(dateString),
  3740. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3741. return Array.from(new Array(7), function (val, index) {
  3742. let formatDate = new Date(
  3743. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3744. );
  3745. return (
  3746. formatDate.getFullYear() +
  3747. "-" +
  3748. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3749. "-" +
  3750. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3751. );
  3752. });
  3753. } else {
  3754. throw new Error(
  3755. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3756. );
  3757. }
  3758. },
  3759. onProgressChange() {
  3760. this.$forceUpdate();
  3761. },
  3762. showChooseMembTree() {
  3763. this.chosenMembCount = this.participator.length;
  3764. this.chooseParticipVisible = true;
  3765. },
  3766. onTreeItemChange() {
  3767. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3768. var list = chosenList.filter(item=>item.isUser == 1);
  3769. this.chosenMembCount = list.length;
  3770. },
  3771. findUserInTree() {
  3772. if (this.filterName == '') {
  3773. this.deptMembData = this.allMembData;
  3774. } else {
  3775. var list = this.findRecursively(this.filterName, this.allMembData);
  3776. this.deptMembData = list;
  3777. }
  3778. },
  3779. findRecursively(username, list) {
  3780. var filterList = [];
  3781. for (var i=0;i<list.length; i++) {
  3782. if (list[i].isUser == 1) {
  3783. if (list[i].label.indexOf(username) >= 0) {
  3784. //匹配上了
  3785. filterList.push(list[i]);
  3786. }
  3787. } else if (list[i].children != null && list[i].children.length > 0) {
  3788. var subList = this.findRecursively(username, list[i].children);
  3789. if (subList.length > 0) {
  3790. subList.forEach(s=>filterList.push(s));
  3791. }
  3792. }
  3793. }
  3794. return filterList;
  3795. },
  3796. //确定选择参与人
  3797. chooseParticip() {
  3798. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3799. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3800. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3801. if (this.user.company.packageProject == 1) {
  3802. if (this.chosenMembList.length > 1) {
  3803. this.$message({
  3804. message: '每次仅支持代填一个人',
  3805. type: "error",
  3806. });
  3807. return;
  3808. }
  3809. }
  3810. this.chooseParticipVisible = false;
  3811. this.workForm.userNames = '';
  3812. this.workForm.userId = [];
  3813. this.participator = [];
  3814. for (var i=0;i<this.chosenMembList.length; i++) {
  3815. this.workForm.userId.push(this.chosenMembList[i].id);
  3816. this.workForm.userNames += this.chosenMembList[i].label+',';
  3817. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3818. this.participator.push(item);
  3819. }
  3820. if (this.workForm.userNames.length > 0) {
  3821. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3822. }
  3823. if(this.user.userNameNeedTranslate == 1) {
  3824. if(this.workForm.userNames) {
  3825. this.workForm.userNames = this.workForm.userNames.split(',')
  3826. }
  3827. }
  3828. },
  3829. notifySel(sel){
  3830. // console.log(sel);
  3831. this.notifySelList = sel
  3832. },
  3833. //微信通知人员填写
  3834. Notify(code) {
  3835. if (this.notifySelList.length == 0) return;
  3836. var ids = '';
  3837. this.notifySelList.forEach(f=>{
  3838. ids += f.id+',';
  3839. })
  3840. this.http.post('/user/pushFillReport',{
  3841. ids: ids, date: this.curDate,
  3842. code: code
  3843. },
  3844. res => {
  3845. if (res.code == "ok") {
  3846. this.$message({
  3847. message: this.$t('message.sentSuccessfully'),
  3848. type: "success"
  3849. });
  3850. }
  3851. },
  3852. error => {
  3853. this.$message({
  3854. message: error,
  3855. type: "error"
  3856. });
  3857. }
  3858. );
  3859. },
  3860. //导出人员列表
  3861. exportMemb() {
  3862. if (this.fillMembList.length == 0) return;
  3863. var ids = '';
  3864. this.fillMembList.forEach(f=>{
  3865. ids += f.id+',';
  3866. })
  3867. this.http.post('/user/exportMembList',{
  3868. ids: ids,isFill: this.isFill, date: this.curDate
  3869. },
  3870. res => {
  3871. if (res.code == "ok") {
  3872. var aTag = document.createElement('a');
  3873. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3874. aTag.href = res.data;
  3875. aTag.click();
  3876. }
  3877. },
  3878. error => {
  3879. this.$message({
  3880. message: error,
  3881. type: "error"
  3882. });
  3883. }
  3884. );
  3885. },
  3886. showMembList(fill) {
  3887. this.membListVisible = true;
  3888. if (fill == 0) {
  3889. this.fillMembList = this.unFillList;
  3890. this.isFill = false;
  3891. let leaveList = []
  3892. let unleaveList = []
  3893. for(let i in this.fillMembList){
  3894. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3895. leaveList.push(this.fillMembList[i])
  3896. }else{
  3897. unleaveList.push(this.fillMembList[i])
  3898. }
  3899. }
  3900. this.fillMembList = unleaveList
  3901. this.fillMembList_leave = leaveList
  3902. } else if(fill == 1){
  3903. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3904. this.isFill = true;
  3905. }else{
  3906. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3907. this.isFill = true;
  3908. }
  3909. },
  3910. //获取自己填写的日报状态
  3911. getReportFillStatus() {
  3912. this.http.post('/report/getReportFillStatus',{
  3913. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3914. },
  3915. res => {
  3916. if (res.code == "ok") {
  3917. this.fillStatusList = res.data;
  3918. this.allDate.forEach(d=>{
  3919. var fillInfo = null;
  3920. d.state = null;
  3921. this.fillStatusList.forEach(s=>{
  3922. // console.log(d)
  3923. var d1 = s.createDate.split('-')[2];
  3924. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  3925. // console.log(d2, '我被执行了')
  3926. if (d1.indexOf('0') == 0) {
  3927. d1 = d1.substring(1,d1.length);
  3928. }
  3929. if (d1 == d2) {
  3930. d.state = s.state;
  3931. }
  3932. })
  3933. })
  3934. this.$forceUpdate();
  3935. }
  3936. },
  3937. error => {
  3938. this.$message({
  3939. message: error,
  3940. type: "error"
  3941. });
  3942. }
  3943. );
  3944. },
  3945. scrollFunction () {
  3946. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  3947. if (this.domObj.attachEvent) { // IE
  3948. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  3949. } else if (this.domObj.addEventListener) {
  3950. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  3951. }
  3952. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  3953. },
  3954. mouseScroll(event) { // google 浏览器下
  3955. let detail = event.wheelDelta || event.detail
  3956. let moveForwardStep = -1
  3957. let moveBackStep = 1
  3958. let step = 0
  3959. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  3960. event.preventDefault() // 阻止浏览器默认事件
  3961. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  3962. },
  3963. // //左右滚动
  3964. // wheel(e){
  3965. // var a = document.getElementById("dateScroll");
  3966. // var scroll_width = 80; //滚动一下的距离
  3967. // var e = e || window.event, v;
  3968. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  3969. // if(v>3||-v>3) v=-v;
  3970. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  3971. // e.preventDefault(); //阻止浏览器的默认滚动
  3972. // },
  3973. showExportDialog() {
  3974. this.exportDialog = true;
  3975. },
  3976. showExportTimeDialog() {
  3977. this.exportTimeDialog = true;
  3978. },
  3979. changeAllTime() {
  3980. //总时长发生改变,自动按比例计算
  3981. this.workForm.domains.forEach(d=>{
  3982. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  3983. });
  3984. //计算jsTime
  3985. if (this.workForm.createDate) {
  3986. let sdate = new Date(this.workForm.createDate[0]);
  3987. let edate = new Date(this.workForm.createDate[1]);
  3988. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  3989. console.log('days===', days)
  3990. if (days < 0) {
  3991. days = 0;
  3992. }
  3993. this.jsTime = this.reportTimeType.allday * days;
  3994. }
  3995. },
  3996. // 是否加班的单机事件
  3997. check() {
  3998. this.selected = !this.selected
  3999. this.isNew = this.selected
  4000. },
  4001. updateSubProject() {
  4002. this.$forceUpdate();
  4003. },
  4004. selectDegreeId(domain, index) {
  4005. this.http.post('/report/defaultDegree',{
  4006. projectId: domain.projectId
  4007. },
  4008. res => {
  4009. if (res.code == "ok") {
  4010. if(res.data) {
  4011. this.workForm.domains[index].degreeId = res.data.id + ''
  4012. this.$forceUpdate();
  4013. }
  4014. }
  4015. },
  4016. error => {
  4017. this.$message({
  4018. message: error,
  4019. type: "error"
  4020. });
  4021. }
  4022. );
  4023. },
  4024. //项目选中了, 加载子项目
  4025. selectProject(domain, index) {
  4026. if(!domain.projectId){
  4027. return;
  4028. }
  4029. // 默认选中上次填写的自定义维度
  4030. if(this.yonghuUser.customDegreeActive == 1) {
  4031. this.selectDegreeId(domain, index)
  4032. }
  4033. // console.log('projectId===',domain.projectId);
  4034. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4035. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4036. this.http.post('/sub-project/list',{
  4037. projectId: domain.projectId,
  4038. isReport: true
  4039. },
  4040. res => {
  4041. //清空之前选中的子项目
  4042. // this.workForm.domains[index].subProjectId = 0;
  4043. if (res.code == "ok") {
  4044. this.workForm.domains[index].subProjectList = res.data;
  4045. this.workForm.domains[index].subProjectId = null;
  4046. this.$forceUpdate();
  4047. }
  4048. },
  4049. error => {
  4050. this.$message({
  4051. message: error,
  4052. type: "error"
  4053. });
  4054. }
  4055. );
  4056. //项目相关的近期任务
  4057. if (this.user.company.packageProject == 1) {
  4058. this.getRecentTaskList(domain, index);
  4059. //获取项目相关专业
  4060. if (this.user.company.packageEngineering == 1) {
  4061. this.getProjectProfessions(domain, index);
  4062. }
  4063. //获取项目下的任务分组
  4064. this.getTaskGroups(domain, index);
  4065. }
  4066. // 获取项目相关的维度
  4067. // domain.degreeId = null
  4068. this.$set(domain,'degreeId',null)
  4069. this.dimension(domain, index);
  4070. //获取项目审核人
  4071. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4072. this.getProjectAuditorList(domain, index);
  4073. } else {
  4074. //按分组的负责人来审核
  4075. domain.projectAuditorId = null;
  4076. domain.projectAuditorName = null;
  4077. domain.auditUserList = null;
  4078. }
  4079. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4080. if (this.reportTimeType.type == 3) {
  4081. //新增项目时,自动计算
  4082. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4083. domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
  4084. }
  4085. //加载昱众的工作职责
  4086. if (this.user.companyId == this.yuzhongCompId) {
  4087. this.updateResponse(domain);
  4088. }
  4089. },
  4090. getRecentTaskList(domain, index) {
  4091. //刷新任务时,清空服务
  4092. this.$set(domain, 'sapServiceId', null);
  4093. this.$set(domain, 'taskId', null);
  4094. var param = {
  4095. projectId: domain.projectId,
  4096. isSubstitude:this.isSubstitude?1:0,
  4097. };
  4098. if (domain.groupId) {
  4099. param.groupId = domain.groupId;
  4100. }
  4101. if (domain.stage) {
  4102. param.stage = domain.stage;
  4103. }
  4104. //专业版代填,获取代填员工的任务
  4105. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4106. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4107. this.$message({
  4108. message: '请选择代填的员工',
  4109. type: "error"
  4110. });
  4111. return;
  4112. } else {
  4113. param.userId = this.workForm.userId[0];
  4114. }
  4115. }
  4116. this.http.post('/task/getRecentTask',param,
  4117. res => {
  4118. if (res.code == "ok") {
  4119. this.workForm.domains[index].allTaskList = res.data;
  4120. this.workForm.domains[index].taskList = res.data;
  4121. this.$forceUpdate();
  4122. }
  4123. },
  4124. error => {
  4125. this.$message({
  4126. message: error,
  4127. type: "error"
  4128. });
  4129. }
  4130. );
  4131. },
  4132. //获取项目审核人
  4133. getProjectAuditorList(domainItem, index) {
  4134. if(domainItem.projectId == '') {
  4135. return
  4136. }
  4137. domainItem.projectAuditorId = null;
  4138. domainItem.projectAuditorName = null;
  4139. this.http.post('/project-auditor/getList',{
  4140. projectId: domainItem.projectId,
  4141. },
  4142. res => {
  4143. if (res.code == "ok") {
  4144. domainItem.auditUserList = res.data;
  4145. if (res.data.length==0) {
  4146. this.$message({
  4147. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4148. type: "error"
  4149. });
  4150. } else if (res.data.length==1) {
  4151. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4152. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4153. }
  4154. this.$forceUpdate();
  4155. }
  4156. },
  4157. error => {
  4158. this.$message({
  4159. message: error,
  4160. type: "error"
  4161. });
  4162. }
  4163. );
  4164. },
  4165. // 获取维度数据
  4166. dimension(domain, index) {
  4167. if(domain.projectId == '') {
  4168. return
  4169. }
  4170. this.http.post('/project/getDegreeList',{
  4171. projectId: domain.projectId,
  4172. },
  4173. res => {
  4174. if (res.code == "ok") {
  4175. // console.log("维度数据",res.data);
  4176. this.workForm.domains[index].wuduList = res.data
  4177. // this.workForm = this.workForm
  4178. this.$forceUpdate()
  4179. }
  4180. },
  4181. error => {
  4182. this.$message({
  4183. message: error,
  4184. type: "error"
  4185. });
  4186. }
  4187. );
  4188. },
  4189. //切换任务阶段
  4190. changeStages(domain, index) {
  4191. if (domain.stage == null || domain.stage == '') {
  4192. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4193. } else {
  4194. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4195. }
  4196. this.getRecentTaskList(domain, index);
  4197. this.$forceUpdate();
  4198. },
  4199. getGroupStages(domain, index, keepStage) {
  4200. // console.log(domain);
  4201. if(!domain.groupId){
  4202. domain.projectAuditorId = ''
  4203. domain.stages = []
  4204. if(this.user.timeType.reportAuditType >= 1){
  4205. domain.auditUserList = []
  4206. }
  4207. this.$forceUpdate();
  4208. return
  4209. }
  4210. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4211. res => {
  4212. if (res.code == "ok") {
  4213. if (!keepStage) {
  4214. domain.stage = '';
  4215. }
  4216. domain.stages = res.data;
  4217. domain.taskId = null;
  4218. this.getRecentTaskList(domain, index);
  4219. this.$forceUpdate();
  4220. }
  4221. },
  4222. error => {
  4223. this.$message({
  4224. message: error,
  4225. type: "error"
  4226. });
  4227. });
  4228. //检查当前的项目是否需要获取分组的负责人
  4229. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4230. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4231. res => {
  4232. if (res.code == "ok") {
  4233. domain.getProjectAuditorList = res.data;
  4234. domain.auditUserList = res.data;
  4235. if (res.data.length==1) {
  4236. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4237. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4238. } else if (res.data.length==0) {
  4239. domain.projectAuditorId = null;
  4240. domain.projectAuditorName = null;
  4241. }
  4242. this.$forceUpdate();
  4243. }
  4244. },
  4245. error => {
  4246. this.$message({
  4247. message: error,
  4248. type: "error"
  4249. });
  4250. });
  4251. }
  4252. },
  4253. getProjectProfessions(domain, index) {
  4254. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4255. res => {
  4256. if (res.code == "ok") {
  4257. this.workForm.domains[index].professionProgress = res.data;
  4258. this.$forceUpdate();
  4259. }
  4260. },
  4261. error => {
  4262. this.$message({
  4263. message: error,
  4264. type: "error"
  4265. });
  4266. });
  4267. },
  4268. //删除自己的日报
  4269. deleteReport() {
  4270. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4271. confirmButtonText: this.$t('btn.determine'),
  4272. cancelButtonText: this.$t('btn.cancel'),
  4273. type: "warning"
  4274. })
  4275. .then(() => {
  4276. this.listLoading = true;
  4277. this.http.post('/report/delete',{
  4278. userId: this.user.id,
  4279. date: this.workForm.createDate
  4280. },
  4281. res => {
  4282. this.listLoading = false;
  4283. if (res.code == "ok") {
  4284. this.$message({
  4285. message: this.$t('message.successfullyDeleted'),
  4286. type: "success"
  4287. });
  4288. this.getReportList();
  4289. this.getDepartment();
  4290. this.dialogVisible = false;
  4291. } else {
  4292. this.$message({
  4293. message: res.msg,
  4294. type: "error"
  4295. });
  4296. }
  4297. },
  4298. error => {
  4299. this.listLoading = false;
  4300. this.$message({
  4301. message: error,
  4302. type: "error"
  4303. });
  4304. }
  4305. );
  4306. })
  4307. .catch(() => {});
  4308. },
  4309. // 管理员删除日报
  4310. guanli(item) {
  4311. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4312. let param = {date: this.date + day, userId: item.id};
  4313. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4314. confirmButtonText: this.$t('btn.determine'),
  4315. cancelButtonText: this.$t('btn.cancel'),
  4316. type: "warning"
  4317. })
  4318. .then(() => {
  4319. this.listLoading = true;
  4320. this.http.post('/report/delete',param,
  4321. res => {
  4322. this.listLoading = false;
  4323. if (res.code == "ok") {
  4324. this.$message({
  4325. message: this.$t('message.successfullyDeleted'),
  4326. type: "success"
  4327. });
  4328. this.getReportList();
  4329. this.getDepartment();
  4330. this.dialogVisible = false;
  4331. } else {
  4332. this.$message({
  4333. message: res.msg,
  4334. type: "error"
  4335. });
  4336. }
  4337. },
  4338. error => {
  4339. this.listLoading = false;
  4340. this.$message({
  4341. message: error,
  4342. type: "error"
  4343. });
  4344. }
  4345. );
  4346. })
  4347. .catch(() => {});
  4348. },
  4349. selectAll() {
  4350. if (this.isAllSelect) {
  4351. var keys = [];
  4352. this.reportNames.forEach(b=>{
  4353. keys.push(b.id);
  4354. })
  4355. this.$refs.approveTree.setCheckedKeys(keys);
  4356. } else {
  4357. this.$refs.approveTree.setCheckedKeys([]);
  4358. }
  4359. },
  4360. removeEmptyNode(list) {
  4361. for (var i=0;i<list.length;i++) {
  4362. var cnt = 0;
  4363. if (list[i].membCount == 0) {
  4364. list.splice(i, 1);
  4365. i--;
  4366. } else if (list[i].children != null) {
  4367. this.removeEmptyNode(list[i].children);
  4368. }
  4369. }
  4370. },
  4371. calculateMembCount(list) {
  4372. for (var i in list) {
  4373. var cnt = 0;
  4374. if (list[i].children != null) {
  4375. this.calculateMembCount(list[i].children);
  4376. for (var m in list[i].children) {
  4377. cnt += list[i].children[m].membCount;
  4378. }
  4379. }
  4380. if (list[i].isUser == 1) {
  4381. cnt++;
  4382. this.membCount++;
  4383. }
  4384. list[i].membCount = cnt;
  4385. }
  4386. },
  4387. stateChange() {
  4388. // console.log(this.allData,'alldate');
  4389. this.membCount = 0;
  4390. if (this.selectState == -1) {
  4391. //全部状态
  4392. this.data = this.allData;
  4393. } else {
  4394. //未填报
  4395. this.seluserText = ''
  4396. var newData = JSON.parse(JSON.stringify(this.allData));
  4397. this.filterState(this.selectState, newData);
  4398. this.data = newData;
  4399. }
  4400. this.calculateMembCount(this.data);
  4401. this.data[0].membCount = this.membCount;//总人数
  4402. },
  4403. //按状态过滤部门人员
  4404. filterState(state, list) {
  4405. for (var i =0;i<list.length; i++) {
  4406. var obj = list[i];
  4407. if (obj.isUser == 1) {
  4408. var match = false;
  4409. if (state == -2) {
  4410. if (obj.state == null) {
  4411. match = true;
  4412. }
  4413. } else {
  4414. if (obj.state == state) {
  4415. match = true;
  4416. }
  4417. }
  4418. if (!match) {
  4419. list.splice(i, 1);
  4420. i--;
  4421. } else {
  4422. }
  4423. } else {
  4424. if (obj.children != null) {
  4425. this.filterState(state, obj.children);
  4426. }
  4427. }
  4428. }
  4429. },
  4430. //a按名称过滤部门人员
  4431. seluserforText(){
  4432. this.membCount = 0;
  4433. var newData = JSON.parse(JSON.stringify(this.allData));
  4434. this.seluserforTextin(this.seluserText, newData)
  4435. this.data = newData;
  4436. this.calculateMembCount(this.data);
  4437. this.data[0].membCount = this.membCount;//总人数
  4438. },
  4439. seluserforTextin(text, list){
  4440. for (var i =0;i<list.length; i++) {
  4441. var obj = list[i];
  4442. if (obj.isUser == 1) {
  4443. var match = false;
  4444. if (obj.label.indexOf(text) != -1) {
  4445. match = true
  4446. }
  4447. if (!match) {
  4448. list.splice(i, 1);
  4449. i--;
  4450. } else {
  4451. }
  4452. } else {
  4453. if (obj.children != null) {
  4454. this.seluserforTextin(text, obj.children);
  4455. }
  4456. }
  4457. }
  4458. },
  4459. // 当节点发生变化时
  4460. nodeChangeExpand(data) {
  4461. // 保存当前展开的节点
  4462. let flag = false
  4463. this.nodeModelData.some(item => {
  4464. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4465. flag = true
  4466. return true
  4467. }
  4468. })
  4469. if (!flag) { // 不存在则存到数组里
  4470. this.nodeModelData.push(data.id)
  4471. }
  4472. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4473. },
  4474. nodeChangeCollapse(data) {
  4475. console.log(this.nodeModelData)
  4476. this.nodeModelData.some((item, i) => {
  4477. if (item === data.id) {
  4478. this.nodeModelData.length = i
  4479. }
  4480. })
  4481. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4482. },
  4483. // 部门列表点击
  4484. handleNodeClick(data) {
  4485. // this.dealList = data
  4486. this.theValues(data.id, this.allData)
  4487. // this.depData = data;
  4488. var list = [];
  4489. if (data.id == -1) {
  4490. this.deptId = null;
  4491. this.targetUid = null;
  4492. list = this.data;
  4493. } else if (data.isUser == 1) {
  4494. this.deptId = null;
  4495. this.targetUid = data.id;
  4496. } else {
  4497. this.deptId = data.id;
  4498. this.targetUid = null;
  4499. list.push(data);
  4500. }
  4501. this.getReportList();
  4502. if (list.length > 0) {
  4503. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4504. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4505. }
  4506. },
  4507. theValues(id, item) {
  4508. for(var i in item) {
  4509. if(item[i].id == id) {
  4510. this.depData = item[i]
  4511. if(id == '-1') {
  4512. this.translation = '1'
  4513. } else {
  4514. if(item[i].children) {
  4515. this.translation = '2'
  4516. } else {
  4517. this.translation = '3'
  4518. }
  4519. }
  4520. return
  4521. } else {
  4522. if(item[i].children) {
  4523. this.theValues(id, item[i].children)
  4524. }
  4525. }
  4526. }
  4527. },
  4528. //获取可以选择的代填的人员列表
  4529. getSubstitudeUserDeptList() {
  4530. if (this.deptMembData.length == 0) {
  4531. this.http.post("/department/listMyMembs", {},
  4532. res => {
  4533. if (res.code == "ok") {
  4534. let noAllData = JSON.parse(JSON.stringify(res.data));
  4535. if (noAllData.length > 0) {
  4536. // if (noAllData[0].label == '全部人员') {
  4537. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4538. noAllData.splice(0,1);
  4539. }
  4540. }
  4541. this.setUserToDept(noAllData);
  4542. this.deptMembData = noAllData;
  4543. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4544. console.log(this.deptMembData, '代填人员数据')
  4545. } else {
  4546. this.$message({
  4547. message: res.msg,
  4548. type: "error"
  4549. });
  4550. }
  4551. },
  4552. error => {
  4553. this.$message({
  4554. message: error,
  4555. type: "error"
  4556. });
  4557. });
  4558. }
  4559. },
  4560. // 获取部门列表
  4561. getDepartmentForApprove() {
  4562. this.http.post( this.port.manage.depList, {},
  4563. res => {
  4564. if (res.code == "ok") {
  4565. var list1 = JSON.parse(JSON.stringify(res.data));
  4566. this.deptOptionList = this.changeArr(list1);
  4567. console.log(this.deptOptionList, '部门')
  4568. } else {
  4569. this.$message({
  4570. message: res.msg,
  4571. type: "error"
  4572. });
  4573. }
  4574. },
  4575. error => {
  4576. this.$message({
  4577. message: error,
  4578. type: "error"
  4579. });
  4580. });
  4581. },
  4582. // 获取部门列表
  4583. getDepartment() {
  4584. //如果没有权限,就不需要获取
  4585. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4586. return;
  4587. }
  4588. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4589. var param = {date:this.date + day};
  4590. this.http.post("/report/getMembList", param,
  4591. res => {
  4592. if (res.code == "ok") {
  4593. if(res.data.length == 0){
  4594. return
  4595. }
  4596. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4597. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4598. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4599. // if (this.user.role > 0) {
  4600. // }
  4601. list.splice(0,0,{
  4602. id: -1,
  4603. label: this.$t('lable.allStaff'),
  4604. })
  4605. this.membCount = 0;
  4606. //设置员工到部门下面
  4607. this.setUserToDept(list);
  4608. this.data = list;
  4609. // console.log('data',this.data);
  4610. this.expandDate = [this.data[1].id]
  4611. this.allData = list;
  4612. // if (noAllData.length > 0) {
  4613. // if (noAllData[0].label == '全部人员') {
  4614. // noAllData.splice(0,1);
  4615. // }
  4616. // }
  4617. // this.setUserToDept(noAllData);
  4618. // this.deptMembData = noAllData;
  4619. this.option = this.changeArr(list1);
  4620. list[0].membCount = this.membCount;
  4621. if (this.depData.id == -1) {
  4622. this.depData.membCount = this.membCount;
  4623. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4624. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4625. } else {
  4626. if (this.depData.isUser == null) {
  4627. var dep = this.findTargetDept(this.data, this.depData.id);
  4628. var membDeptList = [];
  4629. membDeptList.push(dep);
  4630. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4631. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4632. }
  4633. }
  4634. if (this.depData.isUser == null) {
  4635. if (this.isFill) {
  4636. this.fillMembList = this.fillList;
  4637. } else {
  4638. this.fillMembList = this.unFillList;
  4639. }
  4640. }
  4641. this.leaveAllNum = 0
  4642. for(let i in this.unFillList){
  4643. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4644. this.leaveAllNum += 1
  4645. }
  4646. }
  4647. this.stateChange()
  4648. } else {
  4649. this.$message({
  4650. message: res.msg,
  4651. type: "error"
  4652. });
  4653. }
  4654. },
  4655. error => {
  4656. this.$message({
  4657. message: error,
  4658. type: "error"
  4659. });
  4660. });
  4661. this.getReportFillStatus();
  4662. },
  4663. findTargetDept(list, deptId) {
  4664. var t = null;
  4665. for (var i=0;i<list.length; i++) {
  4666. if (list[i].isUser == null && list[i].id == deptId) {
  4667. t = list[i];
  4668. break;
  4669. }
  4670. }
  4671. if (t == null) {
  4672. for (var i=0;i<list.length; i++) {
  4673. if (list[i].children != null && list[i].children.length > 0) {
  4674. t = this.findTargetDept(list[i].children, deptId);
  4675. if (t != null) {
  4676. break;
  4677. }
  4678. }
  4679. }
  4680. }
  4681. return t;
  4682. },
  4683. getUserMembListFromDeptList(list, isFill) {
  4684. var membList = [];
  4685. for (var i in list) {
  4686. var deptName = list[i].label;
  4687. if (list[i].userList != null) {
  4688. list[i].userList.forEach(element => {
  4689. if (isFill == 0) {
  4690. //获取未填的
  4691. if (element.state == null) {
  4692. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4693. membList.push(obj);
  4694. }
  4695. } else {
  4696. if (element.state != null) {
  4697. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4698. membList.push(obj);
  4699. }
  4700. }
  4701. });
  4702. }
  4703. if (list[i].children != null) {
  4704. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4705. }
  4706. }
  4707. return membList;
  4708. },
  4709. setUserToDept(list) {
  4710. for (var i in list) {
  4711. var cnt = 0;
  4712. if (list[i].children != null) {
  4713. this.setUserToDept(list[i].children);
  4714. for (var m in list[i].children) {
  4715. cnt += list[i].children[m].membCount;
  4716. }
  4717. }
  4718. if (list[i].userList != null) {
  4719. if (list[i].children == null) {
  4720. list[i].children = [];
  4721. }
  4722. list[i].userList.forEach(element => {
  4723. var obj = {
  4724. id: element.id,
  4725. label:element.name,
  4726. state:element.state,
  4727. parentId:element.departmentId,
  4728. isUser:1,
  4729. workingTime: element.workingTime,
  4730. leaveDays: element.leaveDays,
  4731. leaveTimes: element.leaveTimes
  4732. };
  4733. list[i].children.push(obj);
  4734. this.membCount++;
  4735. cnt++;
  4736. });
  4737. }
  4738. list[i].membCount = cnt;
  4739. }
  4740. },
  4741. // 修改数组
  4742. changeArr(arr) {
  4743. for (var i = 0; i < arr.length; i++) {
  4744. if(arr[i].id != -1 && arr[i].id != 0) {
  4745. if (arr[i].children != null && arr[i].children.length>0) {
  4746. arr[i].children = this.changeArr(arr[i].children);
  4747. }
  4748. arr[i].id && (arr[i].value = arr[i].id);
  4749. delete arr[i].id;
  4750. }
  4751. }
  4752. for(var i in arr) {
  4753. if(arr[i].id == -1 || arr[i].id == 0) {
  4754. arr.splice(i,1)
  4755. }
  4756. }
  4757. return arr;
  4758. },
  4759. //时间段范围设置改动,监听
  4760. onTimeTypeChange(timeType) {
  4761. this.seleChn(1)
  4762. this.showAddMore = true;
  4763. for(var i in this.workForm.domains) {
  4764. if (this.workForm.domains[i].timeType == 0) {
  4765. this.showAddMore = false;
  4766. break;
  4767. }
  4768. }
  4769. if (this.showAddMore) {
  4770. //检测数量
  4771. if (this.workForm.domains.length == 2) {
  4772. this.showAddMore = false;
  4773. } else {
  4774. this.showAddMore = true;
  4775. }
  4776. }
  4777. },
  4778. getTimeType() {
  4779. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4780. res => {
  4781. if (res.code == "ok") {
  4782. var t = res.data;
  4783. this.reportTimeType = t;
  4784. if (this.reportTimeType.type > 0) {
  4785. this.showAddMore = true;
  4786. }
  4787. //转化时间格式
  4788. if (t.allday != null) {
  4789. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4790. }
  4791. if (t.am != null) {
  4792. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4793. }
  4794. if (t.pm != null) {
  4795. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4796. }
  4797. let arr = []
  4798. for(var i in res.data.excludeTimeList) {
  4799. let obj = {
  4800. s: res.data.excludeTimeList[i].startTime,
  4801. e: res.data.excludeTimeList[i].endTime,
  4802. }
  4803. arr.push(obj)
  4804. }
  4805. this.vacationTime = arr
  4806. } else {
  4807. this.$message({
  4808. message: res.msg,
  4809. type: "error"
  4810. });
  4811. }
  4812. },
  4813. error => {
  4814. this.listLoading = false;
  4815. this.$message({
  4816. message: error,
  4817. type: "error"
  4818. });
  4819. });
  4820. },
  4821. // 改变月份 -------
  4822. changeMonthOut() {
  4823. this.getAllDate();
  4824. this.getReportList();
  4825. this.getDepartment();
  4826. },
  4827. // 选择日期
  4828. choseDate(i, item) {
  4829. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4830. return
  4831. }
  4832. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4833. this.choseDay = i;
  4834. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4835. sessionStorage.msg = this.date + day,
  4836. this.getReportList();
  4837. this.getDepartment();
  4838. this.curDate = item.date;
  4839. },
  4840. canClick(i, item){
  4841. let nowDate = new Date()
  4842. let nowDateYear = nowDate.getFullYear()
  4843. let itemYear = parseInt(this.date.split('-')[0])
  4844. let nowDateMonth = nowDate.getMonth() + 1
  4845. let itemMonth = parseInt(this.date.split('-')[1])
  4846. let nowDateDay = nowDate.getDate()
  4847. let itemDay = parseInt(item.showDate.split('.')[1])
  4848. if(nowDateYear < itemYear){
  4849. return false
  4850. }else if(nowDateYear == itemYear){
  4851. if(nowDateMonth < itemMonth){
  4852. return false
  4853. }else if(nowDateMonth == itemMonth){
  4854. if(nowDateDay < itemDay){
  4855. return false
  4856. }
  4857. }
  4858. }
  4859. },
  4860. // 获取日期列表
  4861. getAllDate(e) {
  4862. var dayArry = [];
  4863. var day = this.getCountDays();
  4864. let curMonthDay = null;
  4865. for (var k = 1; k <= day; k++) {
  4866. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4867. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4868. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4869. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4870. if(sessionStorage.msg) {
  4871. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4872. this.choseDay = k - 1;
  4873. curMonthDay = str;
  4874. }
  4875. } else {
  4876. if (new Date().getDate() == k) {
  4877. this.choseDay = k - 1;
  4878. }
  4879. }
  4880. } else {
  4881. this.choseDay = 0;
  4882. }
  4883. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  4884. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  4885. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  4886. }
  4887. this.allDate = dayArry;
  4888. //不能超过最大日期
  4889. if (this.choseDay > day-1) {
  4890. this.choseDay = day-1;
  4891. }
  4892. if(sessionStorage.from != 1){
  4893. let nowmonth = new Date().getMonth() + 1
  4894. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  4895. let nowdate = new Date().getDate()
  4896. if(nowd == this.date){
  4897. if(e && sessionStorage.msg){
  4898. }else{
  4899. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  4900. }
  4901. let nowday = new Date(sessionStorage.msg).getDate()
  4902. this.choseDay = nowday - 1
  4903. let monthdate = new Date(sessionStorage.msg)
  4904. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  4905. }else{
  4906. if(e && sessionStorage.msg){
  4907. }else{
  4908. sessionStorage.msg = this.date + '-01'
  4909. }
  4910. let monthdate = new Date(sessionStorage.msg)
  4911. this.choseDay = monthdate.getDate() - 1
  4912. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  4913. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  4914. }
  4915. }else{
  4916. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  4917. }
  4918. //从消息点击跳转过来的,直接加载指定日期
  4919. if (sessionStorage.from == 1 && sessionStorage.msg) {
  4920. this.curDate = sessionStorage.msg;
  4921. sessionStorage.from = 0;
  4922. } else {
  4923. // if (curMonthDay != null) {
  4924. // // this.curDate = curMonthDay;
  4925. // let d = new Date(sessionStorage.msg)
  4926. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  4927. // } else {
  4928. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  4929. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  4930. // }
  4931. }
  4932. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  4933. // if(!sessionStorage.msg){
  4934. // let msgday = this.choseDay + 1
  4935. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  4936. // }
  4937. this.getReportFillStatus();
  4938. },
  4939. getCountDays() {
  4940. var newstr = this.date.replace(/-/g, "/");
  4941. var curDate = new Date(newstr+'/01');
  4942. var curMonth = curDate.getMonth();
  4943. curDate.setMonth(curMonth + 1);
  4944. curDate.setDate(0);
  4945. return curDate.getDate();
  4946. },
  4947. //获取日报列表
  4948. getReportList() {
  4949. this.listLoading = true;
  4950. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4951. let param = {date: this.date + day};
  4952. if (this.deptId) {
  4953. param.deptId = this.deptId;
  4954. }
  4955. if (this.targetUid) {
  4956. param.userId = this.targetUid;
  4957. }
  4958. this.http.post( this.port.report.list, param,
  4959. res => {
  4960. this.listLoading = false;
  4961. if (res.code == "ok") {
  4962. this.reportList = res.data;
  4963. if(document.querySelector("#day"+this.choseDay)){
  4964. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  4965. }
  4966. } else {
  4967. this.$message({
  4968. message: res.msg,
  4969. type: "error"
  4970. });
  4971. }
  4972. },
  4973. error => {
  4974. this.listLoading = false;
  4975. this.$message({
  4976. message: error,
  4977. type: "error"
  4978. });
  4979. });
  4980. },
  4981. // 处理数据
  4982. // dealWith() {
  4983. // var tianxie = 0
  4984. // var weixtianxie = 0
  4985. // if(this.selectState == -1) {
  4986. // } else {
  4987. // var arr = []
  4988. // for (var i in this.reportList) {
  4989. // arr.push(this.reportList[i].id)
  4990. // }
  4991. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  4992. // }
  4993. // },
  4994. // getDealWith(item, tx, wtx, arr) {
  4995. // for(var i in item) {
  4996. // if(item[i].children) {
  4997. // this.getDealWith(item[i].children, tx, wtx, arr)
  4998. // } else {
  4999. // if(arr.indexOf(item[i].id) != '-1') {
  5000. // tx = +tx + 1
  5001. // }
  5002. // }
  5003. // }
  5004. // },
  5005. //导出员工工时统计
  5006. exportUserTime() {
  5007. this.listLoading = true;
  5008. var param = {};
  5009. if (this.exportParam.dateRange != null) {
  5010. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5011. }
  5012. this.http.post('/department/exportDeptStatistic', param,
  5013. res => {
  5014. this.listLoading = false;
  5015. if (res.code == "ok") {
  5016. location.href = res.data;
  5017. this.exportTimeDialog = false;
  5018. } else {
  5019. this.$message({
  5020. message: res.msg,
  5021. type: "error"
  5022. });
  5023. }
  5024. },
  5025. error => {
  5026. this.listLoading = false;
  5027. this.$message({
  5028. message: error,
  5029. type: "error"
  5030. });
  5031. });
  5032. },
  5033. //导出日报
  5034. exportReport() {
  5035. this.listLoading = true;
  5036. var param = {};
  5037. if (this.exportParam.dateRange != null) {
  5038. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5039. }
  5040. if (this.exportParam.projectId != null) {
  5041. param.projectId = this.exportParam.projectId;
  5042. }
  5043. if (this.exportParam.departmentId != null) {
  5044. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5045. }
  5046. param.stateKey = this.stateKey
  5047. // param.departmentId = this.user.departmentId
  5048. this.http.post( this.port.report.export, param,
  5049. res => {
  5050. this.listLoading = false;
  5051. if (res.code == "ok") {
  5052. location.href = res.data;
  5053. this.exportDialog = false;
  5054. } else {
  5055. this.$message({
  5056. message: res.msg,
  5057. type: "error"
  5058. });
  5059. }
  5060. },
  5061. error => {
  5062. this.listLoading = false;
  5063. this.$message({
  5064. message: error,
  5065. type: "error"
  5066. });
  5067. });
  5068. },
  5069. //获取项目列表
  5070. getProjectList() {
  5071. this.listLoading = true;
  5072. this.http.post( this.port.project.list, {},
  5073. res => {
  5074. this.listLoading = false;
  5075. if (res.code == "ok") {
  5076. for(var i in res.data) {
  5077. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5078. res.data[i].projectCode = ''
  5079. }
  5080. }
  5081. this.projectList = res.data;
  5082. console.log("项目列表",this.projectList);
  5083. } else {
  5084. this.$message({
  5085. message: res.msg,
  5086. type: "error"
  5087. });
  5088. }
  5089. },
  5090. error => {
  5091. this.listLoading = false;
  5092. this.$message({
  5093. message: error,
  5094. type: "error"
  5095. });
  5096. });
  5097. },
  5098. // 获取填报日报的项目下拉列表
  5099. getFillProjectList() {
  5100. this.http.post( this.port.project.list, {
  5101. forReport: 1
  5102. },res => {
  5103. if (res.code == "ok") {
  5104. for(var i in res.data) {
  5105. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5106. res.data[i].projectCode = ''
  5107. }
  5108. }
  5109. this.fillProjectList = res.data;
  5110. this.getRecentlyProject()
  5111. } else {
  5112. this.$message({
  5113. message: res.msg,
  5114. type: "error"
  5115. });
  5116. }
  5117. },
  5118. error => {
  5119. this.$message({
  5120. message: error,
  5121. type: "error"
  5122. });
  5123. });
  5124. },
  5125. getBasecostItemList() {
  5126. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5127. companyId: this.user.companyId
  5128. },
  5129. res => {
  5130. if (res.code == "ok") {
  5131. this.timeBasecostList = res.data;
  5132. }
  5133. });
  5134. },
  5135. getAIReport(createDate) {
  5136. this.http.post('/report/getAIReport', {},
  5137. res => {
  5138. if (res.code == "ok") {
  5139. var quanbu = 0
  5140. this.jsDay = 1
  5141. var zhi = ''
  5142. var slp = res.data
  5143. for(var i in slp) {
  5144. var sp = +slp[i].workingTime + 0
  5145. zhi = this.jsDay * sp
  5146. quanbu = +quanbu + zhi
  5147. }
  5148. this.jsTime = quanbu
  5149. var aiReportData = res.data;
  5150. this.canCancelInDialog = false
  5151. if(aiReportData.length != 0) {
  5152. var arr = [];
  5153. for(var i in aiReportData) {
  5154. arr.push({
  5155. id: null,
  5156. projectId: aiReportData[i].projectId,
  5157. workingTime: aiReportData[i].workingTime,
  5158. content: '',
  5159. progress:100,
  5160. state: 2,
  5161. timeType: aiReportData[i].timeType,
  5162. subProjectList: aiReportData[i].subProjectList,
  5163. taskList: aiReportData[i].taskList,
  5164. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5165. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5166. taskId: aiReportData[i].taskId,
  5167. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5168. startTime: aiReportData[i].startTime,
  5169. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5170. endTime: aiReportData[i].endTime,
  5171. isOvertime: 0,
  5172. progress:aiReportData[i].progress,
  5173. professionProgress: aiReportData[i].professionProgressList,
  5174. stages:aiReportData[i].stages,
  5175. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5176. pics: null,
  5177. multiWorktime: aiReportData[i].multiWorktime,
  5178. worktimeList: [{}],
  5179. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5180. wuduList: aiReportData[i].degreeList,
  5181. taskGroups:aiReportData[i].taskGroups,
  5182. customData: aiReportData[i].customData,//自定义的数值
  5183. auditUserList: aiReportData[i].auditUserList,
  5184. projectAuditorId: aiReportData[i].projectAuditorId,
  5185. projectAuditorName: aiReportData[i].projectAuditorName,
  5186. overtimeHours: aiReportData[i].overtimeHours,
  5187. customText: aiReportData[i].customText,
  5188. basecostId: aiReportData[i].basecostId,
  5189. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5190. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5191. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5192. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5193. canEdit: true
  5194. })
  5195. }
  5196. this.workForm.domains = arr;
  5197. } else {
  5198. }
  5199. this.canEdit = true;
  5200. this.originCanEdit = true;
  5201. this.seleChn()
  5202. } else {
  5203. this.$message({
  5204. message: res.msg,
  5205. type: "error"
  5206. });
  5207. }
  5208. },
  5209. error => {
  5210. this.$message({
  5211. message: error,
  5212. type: "error"
  5213. });
  5214. });
  5215. },
  5216. // 获取个人某天的日报 111111
  5217. getReport() {
  5218. this.http.post( this.port.report.getPort, {
  5219. date: this.workForm.createDate
  5220. },
  5221. res => {
  5222. if (res.code == "ok") {
  5223. var quanbu = 0
  5224. this.jsDay = 1
  5225. var zhi = ''
  5226. var slp = res.data.report
  5227. for(var i in slp) {
  5228. var sp = +slp[i].workingTime + 0
  5229. zhi = this.jsDay * sp
  5230. quanbu = +quanbu + zhi
  5231. }
  5232. this.jsTime = quanbu
  5233. var list = res.data;
  5234. this.report = list;
  5235. this.reportTimeType = this.report.timeType;
  5236. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5237. this.isWeekend = !this.report.isWorkDay;
  5238. this.canCancelInDialog = false;
  5239. this.hasWrittenReport = list.report.length != 0;
  5240. if(list.report.length != 0) {
  5241. var arr = [];
  5242. this.canEdit = false;
  5243. let candelete = true
  5244. for(var i in list.report) {
  5245. var flg = null
  5246. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5247. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5248. var filteredRespList = null
  5249. if (targetP.length > 0) {
  5250. var isPublic = targetP[0].isPublic;
  5251. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5252. }
  5253. arr.push({
  5254. id: list.report[i].id,
  5255. projectId: list.report[i].projectId,
  5256. workingTime: list.report[i].workingTime,
  5257. content: list.report[i].content,
  5258. state: list.report[i].state,
  5259. timeType: list.report[i].timeType,
  5260. subProjectList: list.report[i].subProjectList,
  5261. taskList: list.report[i].taskList,
  5262. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5263. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5264. taskId: list.report[i].taskId,
  5265. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5266. startTime: list.report[i].startTime,
  5267. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5268. endTime: list.report[i].endTime,
  5269. isOvertime: flg,
  5270. progress:list.report[i].progress,
  5271. professionProgress: list.report[i].professionProgressList,
  5272. stages:list.report[i].stages,
  5273. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5274. pics: list.report[i].pics,
  5275. multiWorktime: list.report[i].multiWorktime,
  5276. worktimeList: list.report[i].worktimeList,
  5277. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5278. wuduList: list.report[i].degreeList,
  5279. taskGroups:list.report[i].taskGroups,
  5280. customData: list.report[i].customData,//自定义的数值
  5281. auditUserList: list.report[i].auditUserList,
  5282. projectAuditorId: list.report[i].projectAuditorId,
  5283. projectAuditorName: list.report[i].projectAuditorName,
  5284. overtimeHours: list.report[i].overtimeHours,
  5285. customText: list.report[i].customText,
  5286. basecostId: list.report[i].basecostId,
  5287. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5288. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5289. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5290. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5291. canEdit: list.report[i].state >= 2 ? true : false,
  5292. extraField1: list.report[i].extraField1,
  5293. extraField2: list.report[i].extraField2,
  5294. extraField3: list.report[i].extraField3,
  5295. workContentList: list.report[i].workContentList,
  5296. filteredRespList: filteredRespList,
  5297. serviceList: list.report[i].serviceList,
  5298. sapServiceId: list.report[i].sapServiceId,
  5299. })
  5300. if (list.report[i].state >= 2) {
  5301. this.canEdit = true;
  5302. }
  5303. if(list.report[i].state < 2){
  5304. candelete = false
  5305. }
  5306. if (list.report[i].state == 0){
  5307. this.canCancelInDialog = true
  5308. }
  5309. // 加判断
  5310. if(this.user.timeType.choseFromAlbum == 1) {
  5311. let arrList = []
  5312. for(var k in list.report[i].pics) {
  5313. let obj = {
  5314. name: k,
  5315. url: list.report[i].pics[k]
  5316. }
  5317. arrList.push(obj)
  5318. }
  5319. arr[i].imgListUrl = arrList
  5320. arr[i].imgList = list.report[i].pics
  5321. }
  5322. }
  5323. this.reportCanDelete = candelete
  5324. this.workForm = {
  5325. createDate: this.workForm.createDate,
  5326. domains: arr,
  5327. userNames:null,
  5328. userId:null,
  5329. time: list.time
  5330. }
  5331. console.log('workForm', this.workForm)
  5332. } else {
  5333. this.workForm = {
  5334. createDate: this.workForm.createDate,
  5335. domains: [{
  5336. id: null,
  5337. projectId: "",
  5338. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5339. content: "",
  5340. progress:100,
  5341. state: 2,
  5342. timeType:0,
  5343. multiWorktime: this.reportTimeType.multiWorktime,
  5344. worktimeList:[{}],
  5345. canEdit: true,
  5346. auditorFirst: '',
  5347. auditorSec: '',
  5348. auditorThird: '',
  5349. ccUserid: ''
  5350. }],
  5351. userId:null,
  5352. userNames:null,
  5353. time: this.report.time
  5354. }
  5355. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5356. this.$set(this.workForm.domains[0],'isOvertime',true)
  5357. if(this.reportTimeType.type != 2){
  5358. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5359. }
  5360. }
  5361. if(this.user.timeType.type == 1) {
  5362. var shuzhi = this.user.timeType.allday + ''
  5363. // console.log('执行一次', shuzhi.indexOf('.'))
  5364. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5365. }
  5366. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5367. //默认给第一个,必填字段
  5368. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5369. }
  5370. this.canEdit = true;
  5371. }
  5372. this.originCanEdit = this.canEdit;
  5373. this.seleChn()
  5374. } else {
  5375. this.$message({
  5376. message: res.msg,
  5377. type: "error"
  5378. });
  5379. }
  5380. },
  5381. error => {
  5382. this.$message({
  5383. message: error,
  5384. type: "error"
  5385. });
  5386. });
  5387. },
  5388. guanbi() {
  5389. this.falsss = false,
  5390. this.workTimeForMinYi=0
  5391. },
  5392. // 打开日报填写
  5393. fillInReport(i, isBatch) {
  5394. this.isWeekend = false
  5395. this.reportCanDelete = false
  5396. // console.log(this.user.timeType.type, '选择时长')
  5397. if(i != 1) {
  5398. this.falsss = false
  5399. } else {
  5400. this.falsss = true
  5401. }
  5402. if (this.isSubstitude) {
  5403. this.getSubstitudeUserDeptList();
  5404. }
  5405. if(i == -1 || this.isSubstitude) {
  5406. this.isDisable = false;
  5407. } else {
  5408. this.isDisable = true;
  5409. }
  5410. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5411. this.isBatch = isBatch;
  5412. if (this.isBatch == 0 && !this.isSubstitude) {
  5413. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5414. let weekday = new Date(this.workForm.createDate).getDay()
  5415. if(this.user.companyId == 817){
  5416. if(weekday == 0){
  5417. this.isWeekend = true
  5418. }
  5419. }else{
  5420. if(weekday == 0 || weekday == 6){
  5421. this.isWeekend = true
  5422. }
  5423. }
  5424. this.getReport(i);
  5425. } else {
  5426. // console.log('执行到了这里')
  5427. this.jsTime = 0
  5428. this.jsDay = 0
  5429. this.workForm = {
  5430. createDate: null,//批量填报没有日期
  5431. domains: [{
  5432. id: null,
  5433. projectId: "",
  5434. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5435. content: "",
  5436. progress:100,
  5437. state: 2,
  5438. timeType:0,
  5439. multiWorktime: this.reportTimeType.multiWorktime,
  5440. worktimeList:[{}],
  5441. canEdit: true,
  5442. }],
  5443. }
  5444. if(this.user.timeType.type == 1) {
  5445. var shuzhi = this.user.timeType.allday + ''
  5446. // console.log('执行二次')
  5447. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5448. }
  5449. // console.log(this.workForm)
  5450. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5451. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5452. }
  5453. this.canEdit = true;
  5454. }
  5455. this.dialogVisible = true;
  5456. },
  5457. //按周填报的弹窗口中编辑单项目相关数据
  5458. setWeekFormReportItem(reportId, i, names, row,sss) {
  5459. console.log(sss)
  5460. this.http.post('/report/getReportById', {
  5461. reportId: reportId
  5462. },
  5463. res => {
  5464. if (res.code == "ok") {
  5465. var data = res.data.report;
  5466. sss.subProjectId = data.subProjectId
  5467. sss.subProjectList = data.subProjectList;
  5468. sss.stage = data.stage
  5469. sss.subProjectList = data.subProjectList
  5470. sss.stages = data.stages
  5471. sss.taskGroups = data.taskGroups;
  5472. sss.auditUserList = data.auditUserList;
  5473. sss.degreeId = data.degreeId;
  5474. sss.customData = data.customData;
  5475. sss.wuduList = data.degreeList;
  5476. this.zhoBaoIdx = i
  5477. this.zhoBaoName = names
  5478. this.zhoBao = sss
  5479. this.zhis = row
  5480. if (sss.groupId) {
  5481. //最后一个参数表示是否保留stage的值,不要重置为空
  5482. this.getGroupStages(this.zhoBao, 0, true)
  5483. }
  5484. this.$forceUpdate();
  5485. }
  5486. });
  5487. },
  5488. // 按周填报里内容的填写
  5489. tianxies(item, i, names, row) {
  5490. if (item.state == 0) {
  5491. this.$message({
  5492. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5493. type: "error"
  5494. });
  5495. return;
  5496. }
  5497. if (item.state == 1) {
  5498. this.$message({
  5499. message: '已通过状态不可修改',
  5500. type: "error"
  5501. });
  5502. return;
  5503. }
  5504. if(this.user.timeType.notAllowedNoAttendance == 1){
  5505. if(this.zhoData[i].corpTime){
  5506. if(this.zhoData[i].corpTime.workHours == 0){
  5507. this.$message({
  5508. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5509. type: 'error'
  5510. })
  5511. return
  5512. }
  5513. }else{
  5514. this.$message({
  5515. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5516. type: 'error'
  5517. })
  5518. return
  5519. }
  5520. }
  5521. var idd = ''
  5522. var obj = {}
  5523. for(var l in this.projectList) {
  5524. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5525. }
  5526. obj.projectId = idd
  5527. this.tianxieDialogVisible = true
  5528. this.scopess = item
  5529. var sss = {}
  5530. if (item.id != null) {
  5531. sss.id = item.id;
  5532. sss.state = item.state;
  5533. } else {
  5534. sss.id = -1;
  5535. sss.state = 3;
  5536. }
  5537. sss.projectId = idd;
  5538. sss.progress = item.progress
  5539. sss.time = item.time
  5540. sss.content = item.content;
  5541. console.log('333', sss.content)
  5542. if (sss.time == '' && this.reportTimeType.type == 2) {
  5543. //取已填时间范围中最大的一个作为开始时间
  5544. var startTime = '09:00';
  5545. var fillStartTime = '00:00';
  5546. for (var t in this.selProjectList) {
  5547. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5548. if (fillItem.time) {
  5549. if (fillItem.time[1] > fillStartTime) {
  5550. fillStartTime = fillItem.time[1];
  5551. }
  5552. }
  5553. }
  5554. if (fillStartTime == '00:00') {
  5555. fillStartTime = '09:00';
  5556. }
  5557. var fillEndMax = '18:00';
  5558. if (fillStartTime >= '18:00') {
  5559. fillEndMax = '23:59';
  5560. }
  5561. sss.time = [fillStartTime, fillEndMax];
  5562. }
  5563. sss.groupId = item.groupId
  5564. sss.stage = item.stage;
  5565. sss.workingTime = item.workingTime
  5566. sss.projectAuditorId = item.projectAuditorId;
  5567. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5568. //默认选中第一个
  5569. sss.basecostId = this.timeBasecostList[0].id;
  5570. }
  5571. var hasEdited = this.zhoData[i][names].hasEdited;
  5572. if (hasEdited) {
  5573. //编辑过了
  5574. sss.subProjectId = item.subProjectId
  5575. sss.stage = item.stage
  5576. sss.subProjectList = item.subProjectList
  5577. sss.stages = item.stages
  5578. sss.taskGroups = item.taskGroups;
  5579. console.log(sss.taskGroups, '33333');
  5580. sss.auditUserList = obj.auditUserList;
  5581. sss.degreeId = item.degreeId;
  5582. sss.customData = item.customData;
  5583. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5584. //只有一个审核人,自动设置上去
  5585. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5586. }
  5587. sss.wuduList = item.wuduList;
  5588. this.zhoBaoIdx = i
  5589. this.zhoBaoName = names
  5590. this.zhoBao = sss
  5591. this.zhis = row
  5592. if (sss.groupId) {
  5593. //最后一个参数表示是否保留stage的值,不要重置为空
  5594. this.getGroupStages(this.zhoBao, 0, true)
  5595. }
  5596. this.$forceUpdate();
  5597. } else {
  5598. //第一次打开,获取数据
  5599. if (sss.id == -1) {
  5600. //新填报的
  5601. this.selectProject(obj, 0);
  5602. var that = this
  5603. setTimeout(() =>{
  5604. sss.subProjectId = that.workForm.domains[0].subProjectId
  5605. sss.subProjectList = item.subProjectList;
  5606. sss.stage = that.workForm.domains[0].stage
  5607. sss.subProjectList = that.workForm.domains[0].subProjectList
  5608. sss.stages = that.workForm.domains[0].stages
  5609. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5610. sss.auditUserList = obj.auditUserList;
  5611. sss.degreeId = item.degreeId;
  5612. sss.customData = item.customData;
  5613. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5614. //只有一个审核人,自动设置上去
  5615. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5616. }
  5617. sss.wuduList = row[0].wuduList
  5618. that.zhoBaoIdx = i
  5619. that.zhoBaoName = names
  5620. that.zhoBao = sss
  5621. that.zhis = row
  5622. if (sss.groupId) {
  5623. //最后一个参数表示是否保留stage的值,不要重置为空
  5624. this.getGroupStages(that.zhoBao, 0, false)
  5625. }
  5626. that.$forceUpdate();
  5627. },600);
  5628. } else {
  5629. //编辑填报过的;数据库已经存在的
  5630. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5631. }
  5632. }
  5633. },
  5634. // 按周填报里内容的填写点击确定
  5635. setWeekProItemData() {
  5636. //专业版模式下,任务分组和阶段必填
  5637. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5638. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5639. this.$message({
  5640. message: '任务分组和阶段必填,请检查',
  5641. type: "error"
  5642. });
  5643. return;
  5644. }
  5645. }
  5646. //检查子项目是否必填
  5647. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5648. this.$message({
  5649. message: '子项目必填,请检查',
  5650. type: "error"
  5651. });
  5652. return;
  5653. }
  5654. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5655. this.$message({
  5656. message: this.$t('message.Pleaseselectareviewer'),
  5657. type: "error"
  5658. });
  5659. return
  5660. }
  5661. if(this.user.timeType.reportAuditType == 3){
  5662. let auditTips = ''
  5663. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5664. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5665. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5666. if(auditTips){
  5667. auditTips = auditTips.substring(0,auditTips.length - 1)
  5668. this.$message({
  5669. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5670. type: 'error'
  5671. })
  5672. return
  5673. }
  5674. }
  5675. let errtips = ''
  5676. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  5677. errtips += this.user.timeType.customDegreeName + '、'
  5678. }
  5679. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5680. errtips += this.user.timeType.customDataName + '、'
  5681. }
  5682. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5683. errtips += this.user.timeType.customTextName + '、'
  5684. }
  5685. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5686. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5687. }
  5688. if(errtips){
  5689. errtips = errtips.substring(0,errtips.length - 1)
  5690. this.$message({
  5691. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5692. type: 'error'
  5693. })
  5694. return
  5695. }
  5696. this.tianxieDialogVisible = false
  5697. var zhong = this.zhoData
  5698. this.zhoBao.hasEdited = true;
  5699. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5700. this.zhoData = zhong
  5701. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5702. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5703. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5704. },
  5705. // 获取本周
  5706. getCurrentWeek() {
  5707. //今天
  5708. this.targetWeekDate = new Date();
  5709. this.initWeekFormData();
  5710. // this.jiazai()
  5711. },
  5712. // 获取上周
  5713. handleGetPrevWeek() {
  5714. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5715. this.initWeekFormData();
  5716. // this.jiazai()
  5717. },
  5718. // 获取下周
  5719. handleGetNextvWeek() {
  5720. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5721. this.initWeekFormData()
  5722. },
  5723. // 加载动画
  5724. jiazai() {
  5725. this.weekDataLoading = true
  5726. var that = this
  5727. setTimeout(() =>{
  5728. that.weekDataLoading = false
  5729. },1000);
  5730. },
  5731. // 转时间格式
  5732. dealdate(date) {
  5733. const dt = new Date(date)
  5734. const y = dt.getFullYear()
  5735. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5736. const d = (dt.getDate() + '').padStart(2, '0')
  5737. return `${y}-${m}-${d}`
  5738. },
  5739. // 按周填报
  5740. fillInReportss() {
  5741. window.addEventListener('scroll', this.handleScroll, true)
  5742. // this.jiazai()
  5743. this.fillWeekDialogVisi = true
  5744. this.getCurrentWeek();
  5745. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5746. //重新获取工时预警类型的预算项
  5747. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5748. companyId: this.user.companyId
  5749. },
  5750. res => {
  5751. if (res.code == "ok") {
  5752. this.timeBasecostList = res.data;
  5753. }
  5754. });
  5755. }
  5756. },
  5757. fillInReportCustom() {
  5758. this.weekIndex++
  5759. this.weekParentData = {
  5760. isSubstitude: this.isSubstitude
  5761. }
  5762. this.fillWeekDialogVisiCustom = true
  5763. },
  5764. // 按周填报的项目筛选
  5765. selListFun(){
  5766. this.selProjectList = []
  5767. if(this.selCon.length){
  5768. for (let i = 0; i < this.selCon.length; i++) {
  5769. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5770. }
  5771. this.selConShow = false ;
  5772. for (let i in this.zhoData) {
  5773. var obj = this.zhoData[i];
  5774. for(var j in this.selProjectList) {
  5775. var xinzhi = this.selProjectList[j].projectName
  5776. obj[xinzhi] = {}
  5777. obj[xinzhi].time = ''
  5778. obj[xinzhi].content = ''
  5779. obj[xinzhi].progress = 0
  5780. obj[xinzhi].workingTime = 0
  5781. }
  5782. }
  5783. this.initWeekFormData();
  5784. }else{
  5785. this.$message({
  5786. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5787. type:'error'
  5788. })
  5789. }
  5790. },
  5791. setWeekCardTimeData(list) {
  5792. for(let i in list){
  5793. let datei = '';
  5794. if (this.user.timeType.showDdCardtime == 1) {
  5795. datei = list[i].workDate;
  5796. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5797. datei = list[i].createDate;
  5798. } else if (this.user.timeType.syncFanwei == 1) {
  5799. datei = list[i].workDate;
  5800. }
  5801. for(let m in this.zhoData) {
  5802. if(datei == this.zhoData[m].zhoDataTime){
  5803. let item = {
  5804. startTime: list[i].startTime,
  5805. endTime: list[i].endTime,
  5806. workHours: list[i].workHours
  5807. }
  5808. this.$set(this.zhoData[m],'corpTime',item)
  5809. }
  5810. }
  5811. }
  5812. },
  5813. getWeeklyCardTime(){ //按周填报获取考勤信息
  5814. let dateStr = []
  5815. for(let i in this.zhoData){
  5816. dateStr.push(this.zhoData[i].zhoDataTime)
  5817. }
  5818. this.http.post('/report/getWeeklyCardTime',{
  5819. dateStr: JSON.stringify(dateStr)
  5820. },res => {
  5821. if(res.code == 'ok'){
  5822. for(let i in res.data){
  5823. let datei = '';
  5824. if (this.user.timeType.showDdCardtime == 1) {
  5825. datei = res.data[i].workDate.split('-');
  5826. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5827. datei = res.data[i].createDate.split('-');
  5828. }
  5829. for(let m in this.zhoData){
  5830. let datem = new Date(this.zhoData[m].zhoDataTime)
  5831. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5832. let item = {
  5833. startTime: res.data[i].startTime,
  5834. endTime: res.data[i].endTime,
  5835. workHours: res.data[i].workHours
  5836. }
  5837. this.$set(this.zhoData[m],'corpTime',item)
  5838. }
  5839. }
  5840. }
  5841. }else{
  5842. this.$message({
  5843. message: res.msg,
  5844. type: 'error'
  5845. })
  5846. }
  5847. },err => {
  5848. this.$message({
  5849. message: err,
  5850. type: 'error'
  5851. })
  5852. })
  5853. },
  5854. selListqx(){
  5855. this.fillWeekDialogVisi = false
  5856. this.selProjectList = []
  5857. this.selCon = []
  5858. },
  5859. handleScroll() {
  5860. this.changdu = this.projectList.length + 1
  5861. },
  5862. // 自动选择时间点的事件
  5863. // async zhoTimes(item, i) {
  5864. // var iss = i
  5865. // if(item.time == null) {
  5866. // return
  5867. // } else {
  5868. // const zhi = this.zhoData[iss];
  5869. // let he = 0;
  5870. // const timeArr = Object.values(zhi)
  5871. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  5872. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  5873. // const data = await this.getWeekHoursByTimeRange(timeArr);
  5874. // console.log(data, 'data');
  5875. // zhi.he = `${he}h`;
  5876. // }
  5877. // },
  5878. async zhoTimes(item, index) {
  5879. const zho = this.zhoData[index];
  5880. if (!item.time) {
  5881. return;
  5882. }
  5883. const timeArr = Object.values(zho)
  5884. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  5885. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  5886. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  5887. zho.he = `${totalHours[0]}h`;
  5888. },
  5889. // 判断两个时间段是否重叠
  5890. timeOverlap(idx, dateAr) {
  5891. let zhi = 0
  5892. for (let k in dateAr) {
  5893. if (idx !== k) {
  5894. 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))) {
  5895. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  5896. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  5897. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  5898. }
  5899. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  5900. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  5901. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  5902. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  5903. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  5904. } else {
  5905. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  5906. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  5907. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  5908. }
  5909. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  5910. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  5911. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  5912. }
  5913. }
  5914. }
  5915. }
  5916. }
  5917. return zhi
  5918. },
  5919. // 计算时间
  5920. getHourMinutes(str, end) {
  5921. var he = 0
  5922. var date2 = '2021/12/12 ' + end +':00'
  5923. var date1 = '2021/12/12 ' + str +':00'
  5924. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  5925. var leave1=date3%(24*3600*1000)
  5926. var hours=Math.floor(leave1/(3600*1000))
  5927. var leave2=leave1%(3600*1000)
  5928. var minutes=Math.floor(leave2/(60*1000))
  5929. var shi = hours+'.'+ minutes
  5930. return he += +shi
  5931. },
  5932. // 自动选择事件长度的事件
  5933. zhoXuan(item, i) {
  5934. var iss = i
  5935. if(item.time == null) {
  5936. return
  5937. } else {
  5938. var zhi = this.zhoData[iss]
  5939. var he = 0
  5940. for(var i in zhi) {
  5941. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  5942. he += +zhi[i].workingTime
  5943. }
  5944. }
  5945. zhi.he = he + 'h'
  5946. }
  5947. },
  5948. getPushWorkLogData(){
  5949. this.http.post('/sap-sync-log/list', {},
  5950. res => {
  5951. if (res.code == "ok") {
  5952. this.pushWorkTimeLogData = res.data;
  5953. } else {
  5954. this.$message({
  5955. message: res.msg,
  5956. type: "error"
  5957. });
  5958. }
  5959. },
  5960. error => {
  5961. this.$message({
  5962. message: error,
  5963. type: "error"
  5964. });
  5965. });
  5966. },
  5967. // 获取全部人员
  5968. getUsers() {
  5969. this.http.post('/user/getSimpleActiveUserList', {},
  5970. res => {
  5971. if (res.code == "ok") {
  5972. this.usersList = res.data;
  5973. } else {
  5974. this.$message({
  5975. message: res.msg,
  5976. type: "error"
  5977. });
  5978. }
  5979. },
  5980. error => {
  5981. this.$message({
  5982. message: error,
  5983. type: "error"
  5984. });
  5985. });
  5986. },
  5987. // 按时间比例
  5988. addBli(item, i) {
  5989. var iss = i
  5990. if(item.time == null) {
  5991. return
  5992. } else {
  5993. var zhi = this.zhoData[iss]
  5994. var he = 0
  5995. for(var i in zhi) {
  5996. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  5997. he += +zhi[i].workingTime
  5998. }
  5999. }
  6000. zhi.he = he.toFixed(1) + 'h'
  6001. }
  6002. },
  6003. //按周填报选择的项目发生变化,需要设置列
  6004. onSelProjectChange() {
  6005. for (let i = 0; i < this.selCon.length; i++) {
  6006. var exists = false;
  6007. for (let j = 0; j < this.selProjectList.length; j++) {
  6008. if (this.selProjectList[j].id == this.selCon[i]) {
  6009. exists = true;
  6010. break;
  6011. }
  6012. }
  6013. if (!exists) {
  6014. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6015. this.selProjectList.push(newProject);
  6016. //添加新项目
  6017. for (var w in this.zhoData) {
  6018. var dayItem = this.zhoData[w];
  6019. var pName = newProject.projectName;
  6020. dayItem[pName] = {};
  6021. dayItem[pName].time = ''
  6022. dayItem[pName].content = ''
  6023. dayItem[pName].progress = 0
  6024. dayItem[pName].workingTime = 0
  6025. }
  6026. }
  6027. }
  6028. //去掉
  6029. for (let j = 0; j < this.selProjectList.length; j++) {
  6030. var exists = false;
  6031. for (let i = 0; i < this.selCon.length; i++) {
  6032. if (this.selProjectList[j].id == this.selCon[i]) {
  6033. exists = true;
  6034. break;
  6035. }
  6036. }
  6037. if (!exists) {
  6038. this.selProjectList.splice(j, 1);
  6039. j--;
  6040. }
  6041. }
  6042. this.loadFilledWeekReportItem();
  6043. //刷新表格
  6044. // this.$refs.weekTable.doLayout();
  6045. },
  6046. //根据选中的项目来刷新填写表格
  6047. loadFilledWeekReportItem() {
  6048. for (var w in this.zhoData) {
  6049. var dayItem = this.zhoData[w];
  6050. for (var i = 0; i < this.selProjectList.length; i++) {
  6051. var curColumnProject = this.selProjectList[i];
  6052. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6053. for (var t in dayItem.reportList) {
  6054. //有日报的项目,不能取消选择
  6055. for (var p in this.fillProjectList) {
  6056. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6057. }
  6058. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6059. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6060. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6061. if (this.reportTimeType.type == 2) {
  6062. //时间段模式
  6063. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6064. }
  6065. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6066. break;
  6067. }
  6068. }
  6069. // dayItem[curColumnProject.projectName] = matchReportItem;
  6070. }
  6071. }
  6072. this.$nextTick(()=>{
  6073. this.$refs.weekTable.doLayout();
  6074. });
  6075. },
  6076. initWeekFormData() {
  6077. this.weekDataLoading = true;
  6078. for (var p in this.fillProjectList) {
  6079. this.fillProjectList[p].canCancel = 1;
  6080. }
  6081. this.http.post('/report/getWeeklyReportData',{
  6082. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6083. },res => {
  6084. this.weekDataLoading = false;
  6085. if(res.code == 'ok'){
  6086. let projectList = res.data.projectList;
  6087. if (projectList.length > 0) {
  6088. //有选择过项目进行填报,直接选中
  6089. this.selProjectList = projectList;
  6090. this.selCon = [];
  6091. for (let i = 0; i < projectList.length; i++) {
  6092. this.selCon.push(projectList[i].id);
  6093. }
  6094. }
  6095. //设置日期
  6096. this.weekDateRange = res.data.dateList;
  6097. this.zhoData = [];
  6098. var arrst = []
  6099. for(var i in this.weekDateRange) {
  6100. var obj = {}
  6101. obj.zhoDataTime = this.weekDateRange[i].date
  6102. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6103. obj.he = this.weekDateRange[i].filledTime;
  6104. obj.canFill = this.weekDateRange[i].canFill;
  6105. // obj.filledTime = this.weekDateRange[i].filledTime;
  6106. obj.reportList = this.weekDateRange[i].reportList;
  6107. //初始化,防止渲染报错
  6108. for (var j = 0; j < this.selProjectList.length; j++) {
  6109. var pName = this.selProjectList[j].projectName
  6110. obj[pName] = {}
  6111. obj[pName].time = ''
  6112. obj[pName].content = ''
  6113. obj[pName].progress = 0
  6114. obj[pName].workingTime = 0
  6115. }
  6116. arrst.push(obj)
  6117. }
  6118. this.zhoData = arrst
  6119. this.setWeekCardTimeData(res.data.cardTimeList);
  6120. this.loadFilledWeekReportItem();
  6121. }else{
  6122. this.$message({
  6123. message: res.msg,
  6124. type: 'error'
  6125. })
  6126. }
  6127. },err => {
  6128. this.$message({
  6129. message: err,
  6130. type: 'error'
  6131. })
  6132. })
  6133. },
  6134. zhoZhi(res, i) {
  6135. var zhi = 0
  6136. for(var i in res) {
  6137. if(i != 'zhoDataTime' && i != 'he') {
  6138. zhi += +res[i]
  6139. }
  6140. }
  6141. res.he = zhi
  6142. },
  6143. zhoBtn(i) {
  6144. // this.zhoData.split(i, 1)
  6145. var arr = this.zhoData
  6146. arr.splice(i, 1)
  6147. },
  6148. zhoAddlast(){
  6149. this.selConShow = true
  6150. },
  6151. closeAddWeeklyReport(){
  6152. this.fillWeekDialogVisi = false
  6153. this.selConShow = true
  6154. this.selProjectList = []
  6155. this.selCon = []
  6156. },
  6157. // 提交按周填报
  6158. submitWeekReport(isDraft) {
  6159. var zhi = this.zhoData
  6160. var ll = 0
  6161. if(this.reportTimeType.type == 2) {
  6162. for(var i in zhi) {
  6163. this.dateAr = []
  6164. var alp = []
  6165. var zhis = zhi[i]
  6166. console.log(zhis)
  6167. for(var j in zhis) {
  6168. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6169. let objs = {}
  6170. objs.s = zhis[j].time[0]
  6171. objs.e = zhis[j].time[1]
  6172. objs.p = j
  6173. alp.push(objs)
  6174. }
  6175. }
  6176. console.log(alp)
  6177. this.dateAr = alp
  6178. if (this.reportTimeType.timeCanOverlap == 0) {
  6179. let str = this.$t('message.Filledtimeperiodsoverlap')
  6180. if(this.dateAr.length > 0) {
  6181. const trus = this.fns();
  6182. const overlapDataTime = this.getOverlapData(alp);
  6183. if (overlapDataTime.length > 0) {
  6184. const arrList = overlapDataTime.map((item) => item.p);
  6185. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6186. }
  6187. ll += 1
  6188. if(!trus) {
  6189. this.$message({
  6190. message: str,
  6191. type: 'error'
  6192. })
  6193. return false
  6194. }
  6195. }
  6196. } else {
  6197. if(this.dateAr.length > 0) {
  6198. ll +=1 ;
  6199. }
  6200. }
  6201. }
  6202. if(ll == 0) {
  6203. this.$message({
  6204. message: this.$t('message.Pleasefillinthetime'),
  6205. type: 'error'
  6206. })
  6207. return false
  6208. }
  6209. } else if(this.reportTimeType.type == 1){
  6210. for(var i in zhi) {
  6211. var zhis = zhi[i]
  6212. for(var j in zhis) {
  6213. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6214. ll += 1
  6215. }
  6216. }
  6217. }
  6218. if(ll == 0) {
  6219. this.$message({
  6220. message: this.$t('message.Pleaseselectatime'),
  6221. type: 'error'
  6222. })
  6223. return false
  6224. }
  6225. let overcorp = ''
  6226. for(let n in zhi){
  6227. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6228. overcorp += zhi[n].zhoDataTime + ','
  6229. }
  6230. }
  6231. if(overcorp != ''){
  6232. overcorp = overcorp.substring(0,overcorp.length - 1)
  6233. this.$message({
  6234. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6235. type: 'error'
  6236. })
  6237. return
  6238. }
  6239. }
  6240. var submits = []
  6241. let formData = new FormData();
  6242. formData.append("draft", isDraft);
  6243. if(this.reportTimeType.multiWorktime == 1){
  6244. for (var i in this.zhoData) {
  6245. var zhoD = this.zhoData[i]
  6246. var flgs = false
  6247. for(var j in zhoD) {
  6248. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6249. flgs = true
  6250. // formData.append("degreeId", "-1");
  6251. formData.append("id", '-1');
  6252. for(var s in this.projectList) {
  6253. if(j == this.projectList[s].projectName) {
  6254. formData.append("projectId", this.projectList[s].id);
  6255. }
  6256. }
  6257. if(this.user.timeType.reportAuditType == 3){
  6258. let audItem = {}
  6259. if(this.user.timeType.auditLevel > 0){
  6260. audItem.auditorFirst = zhoD[j].auditorFirst
  6261. }
  6262. if(this.user.timeType.auditLevel > 1){
  6263. audItem.auditorSec = zhoD[j].auditorSec
  6264. }
  6265. if(this.user.timeType.auditLevel > 2){
  6266. audItem.auditorThird = zhoD[j].auditorThird
  6267. }
  6268. if(zhoD[j].ccUserid){
  6269. audItem.ccUserid = zhoD[j].ccUserid
  6270. }
  6271. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6272. }
  6273. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6274. formData.append("taskId", 0);
  6275. formData.append("reportTimeType", this.reportTimeType.type);
  6276. formData.append("endTime", '');
  6277. formData.append("startTime", '');
  6278. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6279. var lix = []
  6280. var objjs = {}
  6281. objjs.startTime = zhoD[j].time[0]
  6282. objjs.endTime = zhoD[j].time[1]
  6283. if (zhoD[j].content == null || zhoD[j].content == '') {
  6284. zhoD[j].content == '-'
  6285. }
  6286. objjs.content = zhoD[j].content
  6287. lix.push(objjs)
  6288. var zhiZhi = JSON.stringify(lix)
  6289. zhiZhi = zhiZhi.replace(/,/g,"@");
  6290. formData.append("content", zhiZhi)
  6291. formData.append("isOvertime", 0)
  6292. formData.append("professionProgress", "[]")
  6293. if (zhoD[j].groupId) {
  6294. formData.append("groupId",zhoD[j].groupId)
  6295. } else {
  6296. //解决后台groupId数组越界的问题
  6297. formData.append("groupId",0)
  6298. }
  6299. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6300. formData.append("createDate",zhoD.zhoDataTime)
  6301. if (zhoD[j].projectAuditorId) {
  6302. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6303. }
  6304. if(zhoD[j].basecostId) {
  6305. formData.append("basecostId", zhoD[j].basecostId);
  6306. } else {
  6307. formData.append("basecostId", 0);
  6308. }
  6309. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6310. formData.append('degreeId',zhoD[j].degreeId)
  6311. }else{
  6312. formData.append("degreeId", "-1");
  6313. }
  6314. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6315. formData.append('customData',zhoD[j].customData)
  6316. }else if(this.user.timeType.customDataActive){
  6317. formData.append('customData',0)
  6318. }
  6319. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6320. formData.append('customText',zhoD[j].customText)
  6321. }else if(this.user.timeType.customTextActive){
  6322. formData.append('customText','-')
  6323. }
  6324. }
  6325. }
  6326. }
  6327. } else {
  6328. for (var i in this.zhoData) {
  6329. var zhoD = this.zhoData[i]
  6330. var flgs = false
  6331. if(this.reportTimeType.type == 2) {
  6332. for(var k in this.selProjectList) {
  6333. var pItem = this.selProjectList[k];
  6334. var pName = pItem.projectName;
  6335. var j = pName;
  6336. console.log('j==周报中的项目='+j);
  6337. if(zhoD[j].time && zhoD[j].time != 'null') {
  6338. flgs = true
  6339. // formData.append("degreeId", "-1");
  6340. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6341. for(var s in this.projectList) {
  6342. if(j == this.projectList[s].projectName) {
  6343. formData.append("projectId", this.projectList[s].id);
  6344. }
  6345. }
  6346. if(this.user.timeType.reportAuditType == 3){
  6347. let audItem = {}
  6348. if(this.user.timeType.auditLevel > 0){
  6349. audItem.auditorFirst = zhoD[j].auditorFirst
  6350. }
  6351. if(this.user.timeType.auditLevel > 1){
  6352. audItem.auditorSec = zhoD[j].auditorSec
  6353. }
  6354. if(this.user.timeType.auditLevel > 2){
  6355. audItem.auditorThird = zhoD[j].auditorThird
  6356. }
  6357. if(zhoD[j].ccUserid){
  6358. audItem.ccUserid = zhoD[j].ccUserid
  6359. }
  6360. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6361. }
  6362. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6363. formData.append("taskId", 0);
  6364. formData.append("reportTimeType", this.reportTimeType.type);
  6365. formData.append("endTime", zhoD[j].time[1]);
  6366. formData.append("startTime", zhoD[j].time[0]);
  6367. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6368. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6369. formData.append("isOvertime", 0)
  6370. formData.append("professionProgress", "[]")
  6371. if (zhoD[j].groupId) {
  6372. formData.append("groupId",zhoD[j].groupId)
  6373. } else {
  6374. //解决后台groupId数组越界的问题
  6375. formData.append("groupId",0)
  6376. }
  6377. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6378. formData.append("createDate",zhoD.zhoDataTime)
  6379. if (zhoD[j].projectAuditorId) {
  6380. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6381. }
  6382. if(zhoD[j].basecostId) {
  6383. formData.append("basecostId", zhoD[j].basecostId);
  6384. } else {
  6385. formData.append("basecostId", 0);
  6386. }
  6387. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6388. formData.append('degreeId',zhoD[j].degreeId)
  6389. }else{
  6390. formData.append("degreeId", "-1");
  6391. }
  6392. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6393. formData.append('customData',zhoD[j].customData)
  6394. }else if(this.user.timeType.customDataActive){
  6395. formData.append('customData',0)
  6396. }
  6397. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6398. formData.append('customText',zhoD[j].customText)
  6399. }else if(this.user.timeType.customTextActive){
  6400. formData.append('customText','-')
  6401. }
  6402. }
  6403. }
  6404. } else {
  6405. for(var k in this.selProjectList) {
  6406. var pItem = this.selProjectList[k];
  6407. var pName = pItem.projectName;
  6408. var j = pName;
  6409. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6410. flgs = true
  6411. // formData.append("degreeId", "-1");
  6412. console.log('进入了workFpppp==='+j);
  6413. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6414. for(var s in this.projectList) {
  6415. if(j == this.projectList[s].projectName) {
  6416. formData.append("projectId", this.projectList[s].id);
  6417. }
  6418. }
  6419. if(this.user.timeType.reportAuditType == 3){
  6420. let audItem = {}
  6421. if(this.user.timeType.auditLevel > 0){
  6422. audItem.auditorFirst = zhoD[j].auditorFirst
  6423. }
  6424. if(this.user.timeType.auditLevel > 1){
  6425. audItem.auditorSec = zhoD[j].auditorSec
  6426. }
  6427. if(this.user.timeType.auditLevel > 2){
  6428. audItem.auditorThird = zhoD[j].auditorThird
  6429. }
  6430. if(zhoD[j].ccUserid){
  6431. audItem.ccUserid = zhoD[j].ccUserid
  6432. }
  6433. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6434. }
  6435. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6436. // formData.append("subProjectId", zhoD[j].subProjectId);
  6437. formData.append("taskId", 0);
  6438. formData.append("reportTimeType", this.reportTimeType.type);
  6439. if(this.reportTimeType.type == 1) {
  6440. formData.append("workingTime", zhoD[j].workingTime);
  6441. } else if(this.reportTimeType.type == 2) {
  6442. formData.append("endTime", zhoD[j].time[1]);
  6443. formData.append("startTime", zhoD[j].time[0]);
  6444. } else if(this.reportTimeType.type == 3) {
  6445. formData.append("progress", zhoD[j].progress);
  6446. formData.append("workingTime", zhoD[j].workingTime);
  6447. }
  6448. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6449. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6450. formData.append("isOvertime", 0)
  6451. formData.append("professionProgress", "[]")
  6452. if (zhoD[j].groupId) {
  6453. formData.append("groupId",zhoD[j].groupId)
  6454. } else {
  6455. //解决后台groupId数组越界的问题
  6456. formData.append("groupId",0)
  6457. }
  6458. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6459. formData.append("createDate",zhoD.zhoDataTime)
  6460. if (zhoD[j].projectAuditorId) {
  6461. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6462. }
  6463. if(zhoD[j].basecostId) {
  6464. formData.append("basecostId", zhoD[j].basecostId);
  6465. } else {
  6466. formData.append("basecostId", 0);
  6467. }
  6468. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6469. formData.append('degreeId',zhoD[j].degreeId)
  6470. }else{
  6471. formData.append("degreeId", "-1");
  6472. }
  6473. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6474. formData.append('customData',zhoD[j].customData)
  6475. }else if(this.user.timeType.customDataActive){
  6476. formData.append('customData',0)
  6477. }
  6478. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6479. formData.append('customText',zhoD[j].customText)
  6480. }else if(this.user.timeType.customTextActive){
  6481. formData.append('customText','-')
  6482. }
  6483. }
  6484. }
  6485. }
  6486. }
  6487. }
  6488. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6489. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6490. if(!next) {
  6491. this.$message({
  6492. message: `【${error.join('、')}】请填写任务分组`,
  6493. type: 'error'
  6494. })
  6495. return
  6496. }
  6497. // 自定义维度
  6498. this.submitingReport = true;
  6499. this.http.uploadFile( this.port.report.editPort, formData,
  6500. res => {
  6501. // this.listLoading = false;
  6502. this.submitingReport = false;
  6503. if (res.code == "ok") {
  6504. this.$message({
  6505. message: this.$t('message.fillinsuccessfully'),
  6506. type: "success"
  6507. });
  6508. this.fillWeekDialogVisi = false
  6509. this.selConShow = true
  6510. this.zhoData = []
  6511. this.weekDateRange = ''
  6512. this.getReportList();
  6513. this.getDepartment();
  6514. // 关闭弹窗 并 清空
  6515. this.selProjectList = []
  6516. this.selCon = []
  6517. this.getRecentlyProject()
  6518. } else {
  6519. this.$message({
  6520. message: res.msg,
  6521. type: "error"
  6522. });
  6523. }
  6524. },
  6525. error => {
  6526. this.submitingReport = false;
  6527. this.$message({
  6528. message: error,
  6529. type: "error"
  6530. });
  6531. });
  6532. },
  6533. handleGroupAuditorData(data) {
  6534. const { reportAuditType } = this.user.timeType
  6535. if(reportAuditType != 1 && reportAuditType != 2) {
  6536. return {next: true}
  6537. }
  6538. let arrList = [];
  6539. Object.entries(data).forEach(([key, obj]) => {
  6540. Object.entries(obj).forEach(([projectName, projectData]) => {
  6541. if (projectData.workingTime && !projectData.groupId) {
  6542. arrList.push({
  6543. projectName,
  6544. date: obj.zhoDataTime,
  6545. dateText: obj.zhoDataTimeTxt
  6546. });
  6547. }
  6548. });
  6549. });
  6550. if(arrList.length > 0) {
  6551. return {
  6552. next: false,
  6553. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6554. }
  6555. } else {
  6556. return {
  6557. next: true,
  6558. error: [],
  6559. }
  6560. }
  6561. },
  6562. ChangeHourMinutestr (str) {
  6563. if (str !== "0" && str !== "" && str !== null) {
  6564. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6565. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6566. } else {
  6567. return "";
  6568. }
  6569. },
  6570. // 得到两个日期中间的日期
  6571. getdiffdate(stime,etime){
  6572. //初始化日期列表,数组
  6573. var diffdate = new Array();
  6574. var i=0;
  6575. //开始日期小于等于结束日期,并循环
  6576. while(stime<=etime){
  6577. diffdate[i] = stime;
  6578. //获取开始日期时间戳
  6579. var stime_ts = new Date(stime).getTime();
  6580. //增加一天时间戳后的日期
  6581. var next_date = stime_ts + (24*60*60*1000);
  6582. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6583. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6584. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6585. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6586. stime = next_dates_y+next_dates_m+next_dates_d;
  6587. //增加数组key
  6588. i++;
  6589. }
  6590. return diffdate;
  6591. },
  6592. // 添加模块
  6593. addDomain(i) {
  6594. var leftProgress = 10;
  6595. if (this.reportTimeType.type == 3) {
  6596. //计算已经待分配工时比例
  6597. let array = this.workForm.domains;
  6598. let totalProgress = 0;
  6599. for (var i=0;i<array.length; i++) {
  6600. totalProgress += array[i].progress;
  6601. }
  6602. if (totalProgress < 100) {
  6603. leftProgress = 100 - totalProgress;
  6604. }
  6605. }
  6606. var addItem = {
  6607. projectId: "",
  6608. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6609. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6610. ),
  6611. content: "",
  6612. progress:leftProgress,
  6613. state:2,//2-表示待提交
  6614. multiWorktime: this.reportTimeType.multiWorktime,
  6615. worktimeList:[{}],
  6616. canEdit: true,
  6617. auditorFirst: '',
  6618. auditorSec: '',
  6619. auditorThird: '',
  6620. ccUserid: ''
  6621. // degreeId: '',
  6622. };
  6623. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6624. this.$set(addItem,'isOvertime',true)
  6625. if(this.reportTimeType.type == 3){
  6626. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6627. }
  6628. }
  6629. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6630. //默认给第一个,必填字段
  6631. addItem.basecostId = this.timeBasecostList[0].id;
  6632. }
  6633. this.workForm.domains.push(addItem);
  6634. document.getElementById('workFormsItemBottom').scrollIntoView()
  6635. this.canEdit = true
  6636. if (this.reportTimeType.type == 0) {
  6637. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6638. var length = this.workForm.domains.length;
  6639. if (length == 2) {
  6640. this.showAddMore = false;
  6641. }
  6642. }
  6643. this.chuji()
  6644. this.seleChn()
  6645. },
  6646. // 移除模块
  6647. delDomain(i) {
  6648. this.workForm.domains.splice(i,1)
  6649. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6650. if (!this.originCanEdit) {
  6651. let iscan = false
  6652. for(let i in this.workForm.domains){
  6653. if(this.workForm.domains[i].canEdit){
  6654. iscan = true
  6655. }
  6656. }
  6657. this.canEdit = iscan
  6658. }
  6659. //检测当前剩下的一个,时间类型是否是全天
  6660. if (this.reportTimeType.type == 0) {
  6661. if (this.workForm.domains[0].timeType == 0) {
  6662. this.showAddMore = false;
  6663. } else {
  6664. this.showAddMore = true;
  6665. }
  6666. }
  6667. if(this.user.timeType.multiWorktime == 1) {
  6668. this.iptChangs()
  6669. } else {
  6670. this.seleChn(0)
  6671. }
  6672. },
  6673. // 改变月份
  6674. changeMonth() {
  6675. this.isWeekend = false
  6676. let date = new Date()
  6677. let nowmon = date.getMonth() + 1
  6678. let nowday = date.getDate()
  6679. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6680. if (this.isBatch == 0) {
  6681. if(this.user.timeType.fillAhead == 0){
  6682. let date_a = new Date(this.workForm.createDate)
  6683. if(date_a.getTime() > date.getTime()){
  6684. this.workForm.createDate = nowdate
  6685. }
  6686. }
  6687. //只有按天填报才能获取当天的日报
  6688. if(!this.isSubstitude){
  6689. let weekday = new Date(this.workForm.createDate).getDay()
  6690. if(this.user.companyId == 817){
  6691. if(weekday == 0){
  6692. this.isWeekend = true
  6693. }
  6694. }else{
  6695. if(weekday == 0 || weekday == 6){
  6696. this.isWeekend = true
  6697. }
  6698. }
  6699. this.getReport()
  6700. }
  6701. }else {
  6702. if(this.user.timeType.fillAhead == 0){
  6703. let date_a = new Date(this.workForm.createDate[1])
  6704. if(date_a.getTime() > date.getTime()){
  6705. this.workForm.createDate[1] = nowdate
  6706. let sdate = new Date(this.workForm.createDate[0])
  6707. let edate = new Date(this.workForm.createDate[1])
  6708. if(sdate > edate){
  6709. this.workForm.createDate[0] = this.workForm.createDate[1]
  6710. }
  6711. }
  6712. }
  6713. }
  6714. },
  6715. // 判断时间段
  6716. fns() {
  6717. for (let k in this.dateAr) {
  6718. if (!this.judege(k)) {
  6719. return false
  6720. }
  6721. }
  6722. return true
  6723. },
  6724. judege(idx){
  6725. for (let k in this.dateAr) {
  6726. if (idx !== k) {
  6727. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6728. return false
  6729. }
  6730. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6731. return false
  6732. }
  6733. }
  6734. }
  6735. return true
  6736. },
  6737. getOverlapData(data) {
  6738. let overlapData = [];
  6739. for (let i = 0; i < data.length; i++) {
  6740. for (let j = i + 1; j < data.length; j++) {
  6741. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6742. overlapData.push(data[i], data[j]);
  6743. }
  6744. }
  6745. }
  6746. return overlapData;
  6747. },
  6748. // 保存日报111111
  6749. submitReport(isDraft) {
  6750. this.isDraft = isDraft;
  6751. this.$refs.workForm.validate(valid => {
  6752. if (valid) {
  6753. if(this.totalReportHours < this.user.timeType.allday){
  6754. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6755. confirmButtonText: '确定',
  6756. cancelButtonText: '取消',
  6757. type: 'warning'
  6758. }).then(() => {
  6759. this.submitReportSon()
  6760. }).catch(() => {
  6761. });
  6762. }else{
  6763. this.submitReportSon()
  6764. }
  6765. }
  6766. });
  6767. },
  6768. submitReportSon() {
  6769. this.dateAr = []
  6770. //检查重叠
  6771. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6772. let alp = []
  6773. if(this.user.timeType.multiWorktime != 1) {
  6774. for(var p in this.workForm.domains) {
  6775. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6776. let objs = {}
  6777. objs.s = this.workForm.domains[p].startTime
  6778. objs.e = this.workForm.domains[p].endTime
  6779. alp.push(objs)
  6780. }
  6781. }
  6782. this.dateAr = alp
  6783. if(this.dateAr.length > 0) {
  6784. let trus = this.fns()
  6785. if(!trus) {
  6786. this.$message({
  6787. message: this.$t('message.Filledtimeperiodsoverlap'),
  6788. type: "error"
  6789. });
  6790. return
  6791. }
  6792. }
  6793. } else {
  6794. for(var p in this.workForm.domains) {
  6795. var slll = this.workForm.domains[p]
  6796. for(var o in slll.worktimeList) {
  6797. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6798. let objs = {}
  6799. objs.s = slll.worktimeList[o].startTime
  6800. objs.e = slll.worktimeList[o].endTime
  6801. alp.push(objs)
  6802. }
  6803. }
  6804. }
  6805. this.dateAr = alp
  6806. if(this.dateAr.length > 0) {
  6807. let trus = this.fns()
  6808. if(!trus) {
  6809. this.$message({
  6810. message: this.$t('message.Filledtimeperiodsoverlap'),
  6811. type: "error"
  6812. });
  6813. return
  6814. }
  6815. }
  6816. }
  6817. }
  6818. //检查子项目
  6819. if (this.user.timeType.subProMustFill == 1) {
  6820. for(var p in this.workForm.domains) {
  6821. var oneProItem = this.workForm.domains[p]
  6822. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6823. //没有选择子项目
  6824. this.$message({
  6825. message: '子项目必填,请检查',
  6826. type: "error"
  6827. });
  6828. return
  6829. }
  6830. }
  6831. }
  6832. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  6833. if (this.user.companyId == this.yuzhongCompId) {
  6834. for(var p in this.workForm.domains) {
  6835. var oneProItem = this.workForm.domains[p]
  6836. if (!oneProItem.extraField1) {
  6837. this.$message({
  6838. message: '角色必填,请检查',
  6839. type: "error"
  6840. });
  6841. return
  6842. }
  6843. if (!oneProItem.extraField2) {
  6844. this.$message({
  6845. message: '工作职责必填,请检查',
  6846. type: "error"
  6847. });
  6848. return
  6849. }
  6850. if (!oneProItem.extraField3) {
  6851. this.$message({
  6852. message: '工作内容必填,请检查',
  6853. type: "error"
  6854. });
  6855. return
  6856. }
  6857. }
  6858. }
  6859. // return
  6860. //代填的情况,检查人员是否已经选择
  6861. if (this.isSubstitude) {
  6862. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  6863. this.$message({
  6864. message: this.$t('message.pleaseselectthepersontofillin'),
  6865. type: "error"
  6866. });
  6867. return;
  6868. }
  6869. }
  6870. //检查时间,全天和上下午不能同时存在
  6871. if (this.reportTimeType.type == 0) {
  6872. var alldayNum = 0;
  6873. var amNum = 0;
  6874. var pmNum = 0;
  6875. for(var i in this.workForm.domains) {
  6876. if (this.workForm.domains[i].timeType == 0) {
  6877. alldayNum ++;
  6878. } else if (this.workForm.domains[i].timeType == 1) {
  6879. amNum++;
  6880. } else if (this.workForm.domains[i].timeType == 2) {
  6881. pmNum++;
  6882. }
  6883. }
  6884. if (alldayNum > 1) {
  6885. this.$message({
  6886. // message: "工作时间-全天,只能选择一次",
  6887. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  6888. type: "error"
  6889. });
  6890. return;
  6891. }
  6892. if (amNum > 1) {
  6893. this.$message({
  6894. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  6895. type: "error"
  6896. });
  6897. return;
  6898. }
  6899. if (pmNum > 1) {
  6900. this.$message({
  6901. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  6902. type: "error"
  6903. });
  6904. return;
  6905. }
  6906. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  6907. this.$message({
  6908. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  6909. type: "error"
  6910. });
  6911. return;
  6912. }
  6913. } else if (this.reportTimeType.type == 3) {
  6914. //总百分比不能超过100%
  6915. let total = 0;
  6916. this.workForm.domains.forEach(w=>{total += w.progress});
  6917. if (total > 100) {
  6918. this.$message({
  6919. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  6920. type: "error"
  6921. });
  6922. return;
  6923. } else if (total < 100) {
  6924. this.$message({
  6925. message: this.$t('message.cannotbesubmitted'),
  6926. type: "error"
  6927. });
  6928. return;
  6929. }
  6930. }
  6931. this.listLoading = true;
  6932. let formData = new FormData();
  6933. formData.append("draft", this.isDraft);
  6934. var totalTime = 0;
  6935. for (var t=0;t<this.workForm.domains.length; t++) {
  6936. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  6937. }
  6938. //批量填报不校验考勤时长,交给后台校验
  6939. if (!this.isBatch) {
  6940. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  6941. if (this.workForm.time){
  6942. if (this.workForm.time.workHours == 0){
  6943. this.$message({
  6944. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6945. type: 'error'
  6946. })
  6947. return
  6948. }
  6949. }else{
  6950. this.$message({
  6951. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6952. type: 'error'
  6953. })
  6954. return
  6955. }
  6956. }
  6957. }
  6958. if (this.reportTimeType.type == 1 && this.workForm.time) {
  6959. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  6960. this.$message({
  6961. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  6962. type: "error"
  6963. });
  6964. return;
  6965. }
  6966. }
  6967. for(var i in this.workForm.domains) {
  6968. if(this.user.timeType.reportAuditType == 3){
  6969. let audItem = {}
  6970. let auditRule = ''
  6971. if(this.workForm.domains[i].id){
  6972. audItem.reportId = this.workForm.domains[i].id
  6973. }
  6974. if(this.user.timeType.auditLevel > 0){
  6975. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  6976. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  6977. }
  6978. if(this.user.timeType.auditLevel > 1){
  6979. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  6980. audItem.auditorSec = this.workForm.domains[i].auditorSec
  6981. }
  6982. if(this.user.timeType.auditLevel > 2){
  6983. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  6984. audItem.auditorThird = this.workForm.domains[i].auditorThird
  6985. }
  6986. if(this.workForm.domains[i].ccUserid){
  6987. audItem.ccUserid = this.workForm.domains[i].ccUserid
  6988. }
  6989. if(auditRule){
  6990. auditRule = auditRule.substring(0,auditRule.length - 1)
  6991. this.$message({
  6992. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  6993. type: 'error'
  6994. })
  6995. return
  6996. }
  6997. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6998. }
  6999. if(this.workForm.domains[i].degreeId) {
  7000. // var sss = this.workForm.domains[i].degreeId.toString()
  7001. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7002. } else {
  7003. formData.append("degreeId", -1);
  7004. }
  7005. if(this.workForm.domains[i].customData) {
  7006. // var sss = this.workForm.domains[i].degreeId.toString()
  7007. formData.append("customData", this.workForm.domains[i].customData);
  7008. } else {
  7009. formData.append("customData", 0);
  7010. }
  7011. if(this.workForm.domains[i].customText) {
  7012. formData.append("customText", this.workForm.domains[i].customText);
  7013. } else {
  7014. formData.append("customText", '-');
  7015. }
  7016. if (this.workForm.domains[i].id) {
  7017. formData.append("id", this.workForm.domains[i].id);
  7018. } else {
  7019. formData.append("id", -1);
  7020. }
  7021. formData.append("projectId", this.workForm.domains[i].projectId);
  7022. if (this.workForm.domains[i].subProjectId) {
  7023. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7024. } else {
  7025. formData.append("subProjectId", 0);
  7026. }
  7027. if (this.workForm.domains[i].groupId) {
  7028. formData.append("groupId", this.workForm.domains[i].groupId);
  7029. } else {
  7030. formData.append("groupId", 0);
  7031. }
  7032. if (this.workForm.domains[i].taskId) {
  7033. formData.append("taskId", this.workForm.domains[i].taskId);
  7034. } else {
  7035. formData.append("taskId", 0);
  7036. }
  7037. if (this.workForm.domains[i].taskFinish == true) {
  7038. formData.append("taskFinish", 1);
  7039. } else {
  7040. formData.append("taskFinish", 0);
  7041. }
  7042. formData.append("reportTimeType", this.reportTimeType.type);
  7043. if (this.reportTimeType.type == 0) {
  7044. formData.append("timeType", this.workForm.domains[i].timeType);
  7045. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7046. formData.append("workingTime", workingTime);
  7047. } else if (this.reportTimeType.type == 1){
  7048. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7049. } else if (this.reportTimeType.type == 2) {
  7050. formData.append("endTime", this.workForm.domains[i].endTime);
  7051. formData.append("startTime", this.workForm.domains[i].startTime);
  7052. } else if (this.reportTimeType.type == 3) {
  7053. //按比例分配
  7054. formData.append("progress", this.workForm.domains[i].progress);
  7055. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7056. }
  7057. if(this.user.timeType.choseFromAlbum == 1 ) {
  7058. console.log(this.workForm.domains[i].imgList)
  7059. if(this.workForm.domains[i].imgList) {
  7060. let imgListFor = this.workForm.domains[i].imgList
  7061. for(var b in imgListFor) {
  7062. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7063. }
  7064. console.log(imgListFor)
  7065. let m = JSON.stringify(imgListFor);
  7066. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7067. formData.append("picStr", m);
  7068. } else {
  7069. formData.append("picStr", '[]');
  7070. }
  7071. }
  7072. //处理多个时间事项
  7073. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7074. if (this.reportTimeType.multiWorktime == 1) {
  7075. //检查时间是否有重叠
  7076. var workList = this.workForm.domains[i].worktimeList;
  7077. for (var j=0;j<workList.length; j++) {
  7078. var curItem = workList[j];
  7079. //检查开始时间是否大于结束时间
  7080. if (curItem.startTime >= curItem.endTime) {
  7081. this.$message({
  7082. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7083. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7084. type: "error"
  7085. });
  7086. return;
  7087. }
  7088. //时间不可重叠
  7089. if (this.reportTimeType.timeCanOverlap == 0) {
  7090. for (var p = j+1;p<workList.length; p++) {
  7091. var jItem = workList[p];
  7092. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7093. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7094. this.$message({
  7095. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7096. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7097. type: "error"
  7098. });
  7099. return;
  7100. }
  7101. }
  7102. }
  7103. }
  7104. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7105. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7106. formData.append("content", m);
  7107. } else {
  7108. if (this.workForm.domains[i].content) {
  7109. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7110. m = m.replace(/,/g,",");
  7111. console.log(m, '需要传值的数据')
  7112. // formData.append("content", this.workForm.domains[i].content);
  7113. formData.append("content", m);
  7114. } else {
  7115. formData.append("content", '-');
  7116. }
  7117. }
  7118. if (this.isBatch == 0) {
  7119. formData.append("createDate", this.workForm.createDate);
  7120. } else {
  7121. //批量填报,时间范围
  7122. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7123. }
  7124. if(this.workForm.domains[i].isOvertime) {
  7125. formData.append("isOvertime", 1);
  7126. } else {
  7127. formData.append("isOvertime", 0);
  7128. }
  7129. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7130. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7131. } else {
  7132. formData.append("overtimeHours", 0);
  7133. }
  7134. if(this.workForm.domains[i].basecostId) {
  7135. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7136. } else {
  7137. formData.append("basecostId", 0);
  7138. }
  7139. if (this.workForm.userId != null) {
  7140. var targetUids = '';
  7141. this.workForm.userId.forEach(u=>{
  7142. targetUids += u + '@';
  7143. });
  7144. if (targetUids.length > 0) {
  7145. targetUids = targetUids.substring(0, targetUids.length -1);
  7146. formData.append("targetUids", targetUids);
  7147. }
  7148. }
  7149. //项目专业进度
  7150. if (this.workForm.domains[i].professionProgress) {
  7151. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7152. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7153. formData.append("professionProgress", m);
  7154. } else {
  7155. formData.append("professionProgress", "[]");
  7156. }
  7157. if (this.workForm.domains[i].stage) {
  7158. formData.append("stage", this.workForm.domains[i].stage);
  7159. } else {
  7160. formData.append("stage", "-");
  7161. }
  7162. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7163. if (this.workForm.domains[i].projectAuditorId) {
  7164. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7165. } else {
  7166. // console.log('执行到了这里')
  7167. // console.log(this.user.timeType.reportAuditType)
  7168. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7169. this.$message({
  7170. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7171. type: "error"
  7172. });
  7173. return;
  7174. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7175. //分组负责人先审核, 确定是选择了任务分组
  7176. if (this.workForm.domains[i].taskGroups.length == 0) {
  7177. this.$message({
  7178. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7179. type: "error"
  7180. });
  7181. } else if (!this.workForm.domains[i].groupId) {
  7182. // console.log(this.workForm.domains[i]);
  7183. this.$message({
  7184. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7185. type: "error"
  7186. });
  7187. } else {
  7188. this.$message({
  7189. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7190. type: "error"
  7191. });
  7192. }
  7193. return;
  7194. }
  7195. }
  7196. if (this.user.companyId == this.yuzhongCompId) {
  7197. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7198. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7199. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7200. }
  7201. //依斯贝的服务Id
  7202. if (this.user.companyId == this.yisibeiCompId) {
  7203. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7204. }
  7205. }
  7206. this.submitingReport = true;
  7207. this.http.uploadFile( this.port.report.editPort, formData,
  7208. res => {
  7209. this.listLoading = false;
  7210. this.submitingReport = false;
  7211. if (res.code == "ok") {
  7212. if(res.msg!=null){
  7213. this.$message({
  7214. dangerouslyUseHTMLString: true,
  7215. message: res.msg,
  7216. type: "warning",
  7217. showClose: true,
  7218. duration: 0
  7219. });
  7220. }else{
  7221. this.$message({
  7222. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7223. type: "success"
  7224. });
  7225. }
  7226. this.dialogVisible = false;
  7227. this.jsDay = 0
  7228. this.jsTime = 0
  7229. this.getReportList();
  7230. this.getDepartment();
  7231. this.getRecentlyProject()
  7232. } else {
  7233. this.$message({
  7234. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7235. type: "error"
  7236. });
  7237. }
  7238. },
  7239. error => {
  7240. this.listLoading = false;
  7241. this.submitingReport = false;
  7242. this.$message({
  7243. message: error,
  7244. type: "error"
  7245. });
  7246. });
  7247. },
  7248. // 判断是展示那个工时导入
  7249. imports() {
  7250. if(this.user.timeType.syncCorpwxTime == 0) {
  7251. this.importDialog = true
  7252. } else {
  7253. this.importWxDialog = true
  7254. }
  7255. },
  7256. // 跳转
  7257. junpToDeskTop(id) {
  7258. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7259. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7260. },
  7261. // 通过日报
  7262. approve(id, item) {
  7263. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7264. this.approveinData = {
  7265. id: id,
  7266. date: this.date +day,
  7267. reportIds: item.id
  7268. }
  7269. if(this.user.timeType.needEvaluate == 1){
  7270. this.$set(this.approveinData,'evaluate','')
  7271. this.approveinDialog = true
  7272. }else{
  7273. this.logining = true;
  7274. this.approveinfun()
  7275. }
  7276. },
  7277. approveinfun(){
  7278. this.http.post( this.port.report.approve, this.approveinData,
  7279. res => {
  7280. this.logining = false;
  7281. if (res.code == "ok") {
  7282. this.approveinDialog = false
  7283. this.$message({
  7284. message: this.$t('message.Reviewsucceeded'),
  7285. type: "success"
  7286. });
  7287. this.getReportList();
  7288. this.getDepartment();
  7289. } else {
  7290. this.$message({
  7291. message: res.msg,
  7292. type: "error"
  7293. });
  7294. }
  7295. },
  7296. error => {
  7297. this.logining = false;
  7298. this.$message({
  7299. message: error,
  7300. type: "error"
  7301. });
  7302. });
  7303. },
  7304. //撤回日报
  7305. cancel(item,e) {
  7306. // console.log('can can need',item);
  7307. this.logining = true;
  7308. var ids = '';
  7309. var data = e ? item : item.data;
  7310. data.forEach(element => {
  7311. if(element.id){
  7312. ids +=(element.id+',');
  7313. }
  7314. });
  7315. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7316. res => {
  7317. this.logining = false;
  7318. if (res.code == "ok") {
  7319. this.$message({
  7320. message:this.$t('message.Withdrawalsucceeded'),
  7321. type: "success"
  7322. });
  7323. this.getReportList();
  7324. if(e){this.getReport()}
  7325. this.getDepartment();
  7326. } else {
  7327. this.$message({
  7328. message: res.msg,
  7329. type: "error"
  7330. });
  7331. }
  7332. },
  7333. error => {
  7334. this.logining = false;
  7335. this.$message({
  7336. message: error,
  7337. type: "error"
  7338. });
  7339. });
  7340. },
  7341. showDenyDialog(id,i, item) {
  7342. this.denyReasonDialog = true;
  7343. this.isDenying = false;
  7344. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7345. var ids = item.id;
  7346. // var data = item.data;
  7347. // data.forEach(element => {
  7348. // ids +=(element.id+',');
  7349. // });
  7350. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7351. },
  7352. // 未通过日报
  7353. deny() {
  7354. this.logining = true;
  7355. this.isDenying = true;
  7356. this.http.post( this.port.report.deny, this.denyForm,
  7357. res => {
  7358. this.logining = false;
  7359. this.isDenying = false;
  7360. if (res.code == "ok") {
  7361. this.$message({
  7362. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7363. type: "success"
  7364. });
  7365. this.getReportList();
  7366. this.getDepartment();
  7367. this.denyReasonDialog = false;
  7368. } else {
  7369. this.$message({
  7370. message: res.msg,
  7371. type: "error"
  7372. });
  7373. }
  7374. },
  7375. error => {
  7376. this.logining = false;
  7377. this.$message({
  7378. message: error,
  7379. type: "error"
  7380. });
  7381. });
  7382. },
  7383. // 查看工时记录弹窗
  7384. toView() {
  7385. this.toViewDialogVisible = true
  7386. this.toViewloading = true
  7387. this.getToView()
  7388. },
  7389. getToView() {
  7390. this.http.post( '/report-import-log/getList', this.toViewForm,
  7391. res => {
  7392. this.toViewloading = false;
  7393. if (res.code == "ok") {
  7394. // console.log(res.data, '数据数据')
  7395. this.toViewList = res.data.records
  7396. this.toViewForm.total = res.data.total
  7397. } else {
  7398. this.toViewloading = false;
  7399. this.$message({
  7400. message: res.msg,
  7401. type: "error"
  7402. });
  7403. }
  7404. })
  7405. },
  7406. // 触发 selectCat 组件更改他的值
  7407. selectCatCli(obj) {
  7408. // console.log(obj, '看看')
  7409. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7410. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7411. },
  7412. vueCasader(obj) {
  7413. // console.log(obj, '看看值')
  7414. if(obj.distinction == 1) {
  7415. let arr = []
  7416. arr.push(obj.item.id)
  7417. this.exportParam.departmentId = arr
  7418. }
  7419. },
  7420. //分页
  7421. handleCurrentChange(val) {
  7422. this.toViewForm.pageIndex = val;
  7423. this.getToView();
  7424. },
  7425. handleSizeChange(val) {
  7426. this.toViewForm.pageSize = val;
  7427. this.getToView();
  7428. },
  7429. getAllUsersList(){
  7430. this.http.post('/user/getSimpleActiveUserList',{
  7431. },res => {
  7432. if(res.code == 'ok'){
  7433. this.allUsersList = res.data
  7434. }else{
  7435. this.$message({
  7436. message: res.msg,
  7437. type: 'error'
  7438. })
  7439. }
  7440. },err => {
  7441. this.$message({
  7442. message: err,
  7443. type: 'error'
  7444. })
  7445. })
  7446. },
  7447. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7448. fillWeekCustomClne() {
  7449. this.fillWeekDialogVisiCustom = false
  7450. },
  7451. fillWeekCustomSubmit() {
  7452. this.getReportList();
  7453. this.getDepartment();
  7454. this.getRecentlyProject()
  7455. },
  7456. // 待填日报姓名搜索
  7457. nameAearchSeek(flg) {
  7458. if(!this.nameAearch) {
  7459. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7460. return
  7461. }
  7462. if(flg) {
  7463. this.enterpriseWechatgetUser()
  7464. }
  7465. },
  7466. handleThreeData(userList) {
  7467. console.log(userList, '人员数据')
  7468. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7469. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7470. },
  7471. // 过滤树节点
  7472. filterTreeNodes(treeData, filterKeywords) {
  7473. return treeData.filter((node) => {
  7474. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7475. if (node.children && node.children.length > 0) {
  7476. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7477. }
  7478. return true;
  7479. }
  7480. if (node.children && node.children.length > 0) {
  7481. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7482. return node.children.length > 0;
  7483. }
  7484. return false;
  7485. });
  7486. },
  7487. // 企业微信获取人员
  7488. enterpriseWechatgetUser() {
  7489. this.deptMembDataLoading = true
  7490. this.http.post('/user/getEmployeeList',{
  7491. departmentId: -1,
  7492. pageIndex: 1,
  7493. pageSize: 100,
  7494. keyword: this.nameAearch,
  7495. status: '',
  7496. roleId: '',
  7497. cursor: '',
  7498. onlyDirect: '',
  7499. matchingType: ''
  7500. },res => {
  7501. if(res.code == 'ok'){
  7502. this.deptMembDataLoading = false
  7503. const userListName = res.data.records.map(item => item.name)
  7504. this.handleThreeData(userListName)
  7505. }else{
  7506. this.deptMembDataLoading = false
  7507. this.$message({
  7508. message: res.msg,
  7509. type: 'error'
  7510. })
  7511. }
  7512. },err => {
  7513. this.deptMembDataLoading = false
  7514. this.$message({
  7515. message: err,
  7516. type: 'error'
  7517. })
  7518. })
  7519. },
  7520. // 自定义事件
  7521. selectCal(obj) {
  7522. console.log(obj, '传数据来源')
  7523. if(obj.distinction == '1') {
  7524. this.zhoBao.projectAuditorId = obj.id
  7525. } else if(obj.distinction == '2') {
  7526. this.zhoBao.auditorFirst = obj.id
  7527. } else if(obj.distinction == '3') {
  7528. this.zhoBao.auditorSec = obj.id
  7529. } else if(obj.distinction == '4') {
  7530. this.zhoBao.auditorThird = obj.id
  7531. } else if(obj.distinction == '5') {
  7532. this.zhoBao.ccUserid = obj.id
  7533. } else if(obj.distinction == '12') {
  7534. this.usersListId = obj.id
  7535. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7536. this.searchKeyword = obj.name
  7537. } else {
  7538. this.searchKeyword = ''
  7539. }
  7540. this.searchScreen(0)
  7541. } else if(obj.distinction == '13') {
  7542. this.usersListId = obj.id
  7543. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7544. this.searchKeyword = obj.name
  7545. } else {
  7546. this.searchKeyword = ''
  7547. }
  7548. this.searchScreen(1)
  7549. }
  7550. }
  7551. },
  7552. created() {
  7553. this.getUsers()
  7554. let height = window.innerHeight;
  7555. this.tableHeight = height - 178;
  7556. const that = this;
  7557. window.onresize = function temp() {
  7558. that.tableHeight = window.innerHeight - 178;
  7559. };
  7560. this.toViewForm.companyId = this.user.companyId
  7561. this.initDrag([{
  7562. type: "LR",
  7563. domClass: {
  7564. // 中间分割线的名字
  7565. resize: "line-line",
  7566. // 左侧盒子的名字
  7567. left: "box-left",
  7568. // 右侧盒子的名字
  7569. right: "box-right",
  7570. // 父级的名字
  7571. box: "box-father",
  7572. },
  7573. otherInfo: {
  7574. // 限制左边栏最低宽度
  7575. leftWidth: 120,
  7576. },
  7577. },
  7578. {
  7579. type: "LR",
  7580. domClass: {
  7581. // 中间分割线的名字
  7582. resize: "line-second",
  7583. // 左侧盒子的名字
  7584. left: "left-laowang",
  7585. // 右侧盒子的名字
  7586. right: "box-second-father",
  7587. // 父级的名字
  7588. box: "grand",
  7589. },
  7590. otherInfo: {
  7591. // 限制左边栏最低宽度
  7592. leftWidth: 120,
  7593. },
  7594. },
  7595. ]);
  7596. }
  7597. };
  7598. </script>
  7599. <style lang="scss" scoped>
  7600. .fillWeekDialogVisiCustom {
  7601. width: 100%;
  7602. height: 70vh;
  7603. }
  7604. .fillWeekCustom {
  7605. .el-dialog__body {
  7606. padding: 20px 20px !important;
  7607. }
  7608. }
  7609. .photos {
  7610. position: relative;
  7611. display: flex;
  7612. flex-wrap: wrap;
  7613. }
  7614. .photos_img {
  7615. width: 120px;
  7616. height: 120px;
  7617. margin-right: 20px;
  7618. margin-bottom: 20px;
  7619. cursor: pointer;
  7620. img {
  7621. width: 100%;
  7622. height: 100%;
  7623. }
  7624. }
  7625. .paginatis {
  7626. padding: 10px 10px;
  7627. background: #f2f2f2;
  7628. }
  7629. .waiting {
  7630. color:orange;
  7631. }
  7632. .filledReportStyle {
  7633. color:#32CD32;
  7634. }
  7635. .RejectStyle {
  7636. color:red;
  7637. }
  7638. .waitSubmitStyle{
  7639. color: #409eff;
  7640. }
  7641. .chooseDate {
  7642. .waiting {
  7643. color: #20a0ff;
  7644. }
  7645. .filledReportStyle {
  7646. color:#20a0ff;
  7647. }
  7648. .RejectStyle {
  7649. color: #20a0ff;
  7650. }
  7651. .waitSubmitStyle{
  7652. color: #20a0ff;
  7653. }
  7654. }
  7655. .allDaily {
  7656. width:100%;
  7657. }
  7658. .report_title {
  7659. padding:10px 0;
  7660. color:#666;
  7661. }
  7662. .clearfix {
  7663. overflow-x: auto;
  7664. white-space: nowrap;
  7665. padding: 15px 0 10px 0;
  7666. // overflow-y: hidden;
  7667. .date_item {
  7668. padding: 0 3px;
  7669. cursor: pointer;
  7670. position: relative;
  7671. }
  7672. .chooseDate {
  7673. position: absolute;
  7674. bottom: -3px;
  7675. width: 37px;
  7676. height: 2px;
  7677. left: 14px;
  7678. background: #20a0ff;
  7679. }
  7680. }
  7681. .one_daily {
  7682. i {
  7683. color: #9ed0ff;
  7684. margin-right: 5px;
  7685. }
  7686. .one_daily_body {
  7687. padding: 10px 0px;
  7688. p {
  7689. margin: 0;
  7690. line-height: 30px;
  7691. }
  7692. }
  7693. ul {
  7694. padding: 0;
  7695. }
  7696. }
  7697. .checkbtn {
  7698. float: right;
  7699. margin-top: -10px;
  7700. }
  7701. .selConStyle{
  7702. margin-top:9rem;
  7703. margin-bottom:11rem;
  7704. .selConStyle_title{
  7705. height: 3rem;
  7706. text-align: center;
  7707. font-size: 17px;
  7708. }
  7709. .el-select{
  7710. margin: 0 15%;
  7711. width: 70%;
  7712. }
  7713. }
  7714. </style>
  7715. <style lang="scss">
  7716. /*去除upload组件过渡效果*/
  7717. .photos .el-upload-list__item {
  7718. transition: none !important;
  7719. }
  7720. .daily {
  7721. .el-card__body {
  7722. height: 80%;
  7723. overflow-y: auto;
  7724. }
  7725. .el-card__header {
  7726. padding: 0 20px;
  7727. }
  7728. }
  7729. .membListClass{
  7730. .el-dialog__body{
  7731. padding-top: 10px;
  7732. }
  7733. }
  7734. // .editReportDialog .el-dialog__footer{
  7735. // position: sticky;
  7736. // bottom: 0;
  7737. // background: #fff;
  7738. // height: 70px;
  7739. // z-index: 1010;
  7740. // }
  7741. .editReportDialog{
  7742. min-width: 800px;
  7743. }
  7744. .touruxiangmu{
  7745. max-width: 1000px;
  7746. }
  7747. </style>
  7748. <style scoped>
  7749. /* 项目标签的样式 */
  7750. .el-tag + .el-tag {
  7751. margin-left: 10px;
  7752. }
  7753. .button-new-tag {
  7754. margin-left: 10px;
  7755. height: 32px;
  7756. line-height: 30px;
  7757. padding-top: 0;
  7758. padding-bottom: 0;
  7759. }
  7760. .input-new-tag {
  7761. width: 90px;
  7762. margin-left: 10px;
  7763. vertical-align: bottom;
  7764. }
  7765. .selectworktime .el-table__fixed-body-wrapper{
  7766. top: 48px !important;
  7767. }
  7768. .selectworktime_export .selectworktime_export_l{
  7769. width: 650px;
  7770. float: left;
  7771. height: 42px;
  7772. }
  7773. .approvalProcessBox{
  7774. margin-left: 30px;
  7775. font-size: 14px;
  7776. line-height: 16px;
  7777. cursor: pointer;
  7778. }
  7779. .approvalProcessBox i {
  7780. margin-right: 0;
  7781. height: 16px;
  7782. width: 16px;
  7783. display: inline-block;
  7784. transform: scale(1.2);
  7785. position: relative;
  7786. top: 0.5px;
  7787. color: #409eff;
  7788. }
  7789. .approvalProcessBox .approvalProcessClick{
  7790. cursor: pointer;
  7791. color: #409eff;
  7792. font-size: 14px;
  7793. }
  7794. .approvalProcessBox:hover .approvalProcessClick{
  7795. color: #3485fb;
  7796. }
  7797. </style>
  7798. <style lang="scss" scoped>
  7799. // 加班样式
  7800. .overtime {
  7801. display: inline-block;
  7802. margin-left: 20px;
  7803. input {
  7804. display: inline-block;
  7805. margin-top: 5px;
  7806. }
  7807. }
  7808. .plus {
  7809. display: inline-block;
  7810. }
  7811. // .tages {
  7812. // float: right;
  7813. // }
  7814. .overtime {
  7815. display: inline-block;
  7816. margin-left: 30px;
  7817. }
  7818. .bloks {
  7819. display: inline-block;
  7820. width: 380px;
  7821. }
  7822. .zhiss {
  7823. display: flex;
  7824. justify-content: space-around;
  7825. align-items: center;
  7826. }
  7827. .zhoFel {
  7828. display: flex;
  7829. justify-content: space-between;
  7830. align-items: center;
  7831. }
  7832. // 左右滑动样式
  7833. .line {
  7834. width: 30px;
  7835. /* height: 500px; */
  7836. background: #f2f2f2;
  7837. cursor: w-resize;
  7838. }
  7839. .box-father {
  7840. border: 8px solid #000;
  7841. }
  7842. .line-second {
  7843. width: 10px;
  7844. /* background: red; */
  7845. }
  7846. .flex {
  7847. display: flex;
  7848. width: 100%;
  7849. }
  7850. .box-left {
  7851. flex: 0 0 400px;
  7852. /* height: 600px; */
  7853. /* background: blue; */
  7854. }
  7855. .box-right {
  7856. /* height: 600px; */
  7857. /* background: green; */
  7858. flex: 1;
  7859. }
  7860. .box-postion {
  7861. width: 200px;
  7862. /* height: 400px; */
  7863. background: #ccc;
  7864. }
  7865. .custom-tree-node {
  7866. flex: 1;
  7867. display: flex;
  7868. align-items: center;
  7869. justify-content: space-between;
  7870. font-size: 14px;
  7871. padding-right: 8px;
  7872. }
  7873. .daitianrbao {
  7874. width: 100%;
  7875. box-sizing: border-box;
  7876. height: 40px;
  7877. border-radius: 4px;
  7878. border: 1px solid #DCDFE6;
  7879. overflow: hidden;
  7880. text-overflow: ellipsis;
  7881. display: flex;
  7882. // align-items: center;
  7883. }
  7884. .daitianrbao .spnn {
  7885. display: inline-block;
  7886. box-sizing: border-box;
  7887. padding: 0 15px;
  7888. overflow: hidden;
  7889. text-overflow: ellipsis;
  7890. }
  7891. .daitianrbao .hover {
  7892. color: #DCDFE6 !important;
  7893. }
  7894. </style>