daily.vue 332 KB

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