daily.vue 360 KB

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