daily.vue 361 KB

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