daily.vue 358 KB

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