daily.vue 364 KB

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