1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039 |
- <template>
- <section >
- <!--列表-->
- <div>
- <el-card class="box-card daily" shadow="never">
- <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
- <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;">
- <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
- style="width:190px;"
- @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
- </div>
- <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
- <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
- @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;' : '') ">
- <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
- <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
- <br>
- <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
- <span class="chooseDate" v-if="index == choseDay"></span>
- </div>
- </div>
- </span>
- </div>
- </div>
- <div style="display:flex;">
- <div class="grand flex">
- <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
- <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
- <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
-
- </div> -->
- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
- <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" v-if="user.userNameNeedTranslate != 1" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
- <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
- </el-input>
- <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
- <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
- <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
- <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
- <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
- <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
- <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
- </el-select>
- </div>
- <div>
- <el-tree :data="data" @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading">
- <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
- <!-- <span>{{ node.label }}</span> -->
- <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
- <span v-if="user.userNameNeedTranslate == '1'">
- <span v-if="node.data.children">
- <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
- </span>
- <span v-else>
- <ww-open-data type='userName' :openid='node.label'></ww-open-data>
- </span>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{ node.label }}
- </span>
-
- <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
- </span>
-
- <div style="position: absolute;right: 15px;">
- <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
- <!-- 未填报 -->
- {{$t('state.DidNotFillIn')}}
- </span>
- <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'">
- <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
- {{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)')}}
- </span>
- <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
- <!-- 待审核 -->
- {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
- <!-- 已通过 -->
- {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
- <!-- 未通过 -->
- {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
- <!-- 待提交 -->
- {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
- </span>
- </div>
- </span>
- </el-tree>
- </div>
- </div>
- </div>
- <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">
- <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
- -
- -
- -
- </div>
- </div>
- <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
- <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
- <div class="allDaily" style="float:left;flex-grow:1">
- <!--系统管理员和部门负责人 -->
- <div class="report_title" style="display:flex;justify-content: space-between;">
- <span>
- <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
- <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
- <!-- {{depData != null ?depData.label:""}} -->
- <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
- <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
- <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
- <span v-if="targetUid == null">
- <!-- - 已提交 -->
- -{{$t('state.hasBeenSubmitted')}}
- <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')}},
- <!-- 待提交 -->
- {{$t('state.waitingsubmit')}}
- <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')}},
- <!-- 漏填 -->
- <!-- {{$t('state.missFillReport')}} -->
- 未填
- <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')}}
- <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
- </span>
- </span>
- </span>
- <span style="float:right;">
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
- <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
- <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>
- <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>
- <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
- <!--部门负责人给个导出工时的功能 -->
- <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
- <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
- <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
- </span>
- </div>
- <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
- <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
- <i class="fa fa-circle"></i>
- <!-- {{item1.name}} -->
- <span v-if="user.userNameNeedTranslate == '1'">
- <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{item1.name}}
- </span>
- <span style="margin-left:30px;">
- <span style="margin-right:20px;">
- <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
- <!-- 工作总时长: -->
- {{$t('other.totalWorkingHours')}}
- <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
- <span >{{item1.reportTime | amounts}}</span>h
- </span>
- <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
- <i class="iconfont firerock-iconliucheng1"></i>
- <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
- <!-- 审批流程 -->
- {{$t('other.approvalProcess')}}
- </span>
- </span>
- </span>
- <div class="checkbtn" style="padding-right:20px;">
- <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>
- <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
- </div>
- <div class="one_daily_body">
- <el-timeline>
- <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
- <el-card shadow="never">
- <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
- <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
- <span v-if="user.company.packageEngineering == 0">
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
- <span v-if="item2.isDeptAudit==0">
- <span v-if="item2.projectAuditState==0">
- <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
- <span v-if="item2.projectAuditorName != null">(
- <!-- {{item2.projectAuditorName}} -->
- <span v-if="user.userNameNeedTranslate == '1'">
- <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
- )</span>
- <!-- 审核 --> {{$t('other.audit')}}
- </span>
- <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
- <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
- <span v-if="item2.projectAuditorName != null">(
- <!-- {{item2.projectAuditorName}} -->
- <span v-if="user.userNameNeedTranslate == '1'">
- <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
- )</span>
- <!-- 审核通过 --> {{$t('state.approved')}}
- </span>
- </span>
- <span v-else-if="item2.isDeptAudit==1">
- <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
- ({{$t('other.await')}}
- <span v-if="user.userNameNeedTranslate == '1'">
- <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
- {{$t('other.audit')}})
- </span>
- ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
- <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
- </span>
-
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
- </span>
- <!-- <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> -->
- <span v-if="user.company.packageEngineering == 1">
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
- (
- <span v-if="user.userNameNeedTranslate != 1">
- {{item2.projectAuditorName}}
- </span>
- <span v-if="user.userNameNeedTranslate == 1">
- <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
- </span>
- )
- </span>{{$t('other.audit')}} ]</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
- </span>
- <!--每个项目上单独审核 -->
- <span style="float:right;">
- <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
- size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
- <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
- size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
- <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || (user.timeType.reportAuditType== 5 && (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
- @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
- <!--自己可以撤回待审核状态的报告 -->
- <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>
- </span>
- </p>
- <!--任务分组和阶段 -->
- <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>
- <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
- <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
- <!-- 自定义日报文本 -->
- <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
- <p v-if="user.company.packageEngineering == 1">
- {{$t('other.professionalProgress')}}:
- <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
- <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
- <i class="iconfont firerock-icondaibandengdaishenhe"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhetongguo"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhebohui"></i>
- </el-tooltip>
- </span>
- </p>
- <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
- </p>
- <div v-if="item2.multiWorktime==0">
- <p style="display: inline-block;">{{$t('time.duration')}}:
- <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
- {{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>
- <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
- </div>
- <div v-if="item2.multiWorktime==1" >
- <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>
- <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
- <p style="display: inline-block;">{{$t('time.duration')}}:
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
- {{timeItem.time.toFixed(1)}}h
- </p>
- <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
- </div>
- </div>
- <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
-
- <!--照片的显示 -->
- <p v-if="item2.pics != null && item2.pics.length > 0">
- <el-image v-for="(pic, index) in item2.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="item2.pics">
- </el-image>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- <!-- 简陋的无报告提示 -->
- <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- <!-- 填写日报的dialog -->
- <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">
- <div style="height: 65vh;overflow: auto;">
- <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
- <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
- <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
- :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
- <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
- <span class="spnn" v-if="workForm.userNames">
- <span v-for="(item, index) in workForm.userNames" :key="index">
- <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
- <span v-if="index < workForm.userNames.length - 1">,</span>
- </span>
- </span>
- <span class="spnn hover" v-else>
- {{$t('defaultText.pleaseSelectAsubstitute')}}
- </span>
- </div>
- </el-form-item>
- <el-form-item :label="$t('screening.workingDate')" prop="createDate">
- <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
- @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
- <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
- <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{$t('other.fillInTheTotal')}} {{jsTime}} {{$t('time.hour')}}</div>
- <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
- <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
- v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
- <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
- <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
- <!--批量填报和批量代填不显示考勤记录-->
- <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
- <el-button type="default" style="margin-left:5px;" size="mini" :loading="syncTimeLoading"
- v-if="!isBatch && user.timeType.syncCorpwxTime==1 && (workForm.createDate == today || !workForm.time || workForm.time.workHours <= 0)" icon="el-icon-refresh"
- @click="refreshWXCardTime(workForm.createDate)"></el-button>
- <!-- AI智能填报 -->
- <el-button type="primary" @click="getAIReport()" v-if="(user.companyId == 7 || user.companyId == 10) && !hasWrittenReport" size="mini" style="margin-left:5px;" >AI智能填报</el-button>
- </el-form-item>
- <!-- 000000 -->
- <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
- <div v-if="reportTimeType.multiWorktime==0">
- <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
- <el-select v-model="domain.timeType" style="width:200px;"
- v-if="reportTimeType.type == 0"
- :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- @change="onTimeTypeChange(domain.timeType)">
- <el-option
- v-for="item in timeType"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <!-- 数字时长选择 -->
- <el-select v-model="domain.workingTime" style="width:200px;"
- v-if="reportTimeType.type == 1"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
- @change="seleChn(0,domain)">
- <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
- </el-select>
- <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
- <span v-if="reportTimeType.type == 2">
- <!--时间范围选择 -->
- <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="domain.startTime"
- :placeholder="$t('time.startTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '08:00',
- end: '23:30'
- }"
- @change="iptChang()">
- </el-time-picker> - <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="domain.endTime"
- :placeholder="$t('time.endTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '08:00',
- end: '23:30',
- minTime: domain.startTime
- }"
- @change="iptChang()">
- </el-time-picker>
- </span>
- <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
- <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
- <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>
- </div>
- </el-form-item>
-
- <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
- :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
- <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"
- @change="selectProject(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
-
- <!-- <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">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option> -->
- <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
- <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option>
- </el-option-group>
- </el-select>
- <template v-if="user.timeType.mainProjectState != 1">
- <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
- <!--子项目 -->
- <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
- v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
- <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </template>
-
- <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:15%;"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
- </el-link>
- <!-- <el-link type="primary" v-if="canEdit"
- :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
- </el-form-item>
- <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">
- <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
- </el-form-item>
- <!--如果设置了工时成本预警的预算成本项-->
- <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
- <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
- <!-- 任务分组 -->
- <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
- <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <!-- 项目的阶段 -->
- <span v-if="domain.stages != null && domain.stages.length> 0"
- style="margin-left:30px;">{{$t('other.inputStage')}}</span>
- <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
- clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
- @change="changeStages(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </el-form-item>
- <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
- <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')" v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
-
- <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
- <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
- <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
- <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
- </el-option>
- </el-select>
- <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>
- </el-form-item>
- </div>
- <!-- 111111 -->
- <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
- <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- <template v-if="user.timeType.auditLevel > 1">
- <i class="el-icon-right"></i>
- <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </template>
- <template v-if="user.timeType.auditLevel > 2">
- <i class="el-icon-right"></i>
- <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </template>
- </el-form-item>
- <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
- <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
- <span v-else>{{item.name}}</span>
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关维度/自定义维度 -->
- <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'">
- <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关数值 -->
- <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">
- <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>
- </el-form-item>
- <!-- 自定义文本 -->
- <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">
- <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>
- </el-form-item>
- <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
- <div style="width:300px;">
- <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>
- <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>
- </div>
- <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
- <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>
- </div>
- </el-form-item>
- <!--工程专业版本模式下, 各个专业的进度填报 -->
- <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
- <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
- <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
- <el-input size="mini" style="width:60px;" v-model="item.progress"
- @keyup.native="onProgressChange"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
- </span>
- </el-form-item>
- <!--项目管理专业版模式下,项目下的近期执行的任务 -->
- <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
- <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
- </el-form-item>
- <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
- :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
- <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
- </el-form-item>
- <!-- 拍照上传 -->
- <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1">
- <div class="photos">
- <div>
- <el-upload
- list-type="picture-card"
- :http-request="(file) => {return addImg(file, index)}"
- :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
- :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
- :file-list="domain.imgListUrl" :limit="9"
- :disabled="workForm.domains[index].state>=2?false:true">
- <i class="el-icon-plus"></i>
- </el-upload>
- </div>
- </div>
- </el-form-item>
- </div>
- <!--多个工作事项填报的情况 -->
- <div v-if="reportTimeType.multiWorktime==1">
- <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
- <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
- @change="selectProject(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
- <!-- <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">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option> -->
- <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
- <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id" :disabled="item.status!=1 && item.status!=4">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option>
- </el-option-group>
- </el-select>
- <template v-if="user.timeType.mainProjectState != 1">
- <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
- <!--子项目 -->
- <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
- v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
- <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </template>
- <el-link v-if="(index >= 1 || workForm.domains.length > 1)&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
- </el-link>
- <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
- <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>
- </div>
-
- <!-- <el-link type="primary" v-if="canEdit"
- :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
- </el-form-item>
- <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">
- <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
- </el-form-item>
- <!--如果设置了工时成本预警的预算成本项-->
- <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
- <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
- <!-- 任务分组 -->
- <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
- <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <!-- 项目的阶段 -->
- <span v-if="domain.stages != null && domain.stages.length> 0"
- style="margin-left:30px;">{{$t('other.inputStage')}}</span>
- <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
- clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
- @change="changeStages(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('other.projectAuditor')" >
- <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
- <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
- <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
- <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
- </el-option>
- </el-select>
- <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>
- </el-form-item>
-
- <!--工程专业版本模式下, 各个专业的进度填报 -->
- <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
- <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
- <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
- <el-input size="mini" style="width:60px;" v-model="item.progress"
- @keyup.native="onProgressChange"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
- </span>
- </el-form-item>
- <!-- 相关维度 -->
- <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'">
- <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关数值 -->
- <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">
- <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>
- </el-form-item>
- <!-- 自定义文本 -->
- <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">
- <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
- </el-form-item>
- <!--项目管理专业版模式下,项目下的近期执行的任务 -->
- <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
- <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
- </el-form-item>
- <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
- <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>
- <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
-
- <span v-if="reportTimeType.type == 2">
- <!-- <span> -->
- <!--时间范围选择 -->
- <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="timeItem.startTime"
- :placeholder="$t('time.startTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '00:00',
- end: '23:59',
- }"
- @change="iptChangs()">
- </el-time-picker> - <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="timeItem.endTime"
- :placeholder="$t('time.endTime')"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '00:00',
- end: '23:59',
- minTime: timeItem.startTime
- }"
- @change="iptChangs()">
- </el-time-picker>
- </span>
- </el-form-item>
- <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
- :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
- <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- ></el-input>
- </el-form-item>
- </div>
- <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
- </div>
- <!--照片的显示 -->
- <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
- <el-image v-for="(pic, index) in domain.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="domain.pics">
- </el-image>
- </p>
- <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
- </div>
- <span id="workFormsItemBottom"></span>
- <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
- <span style="margin-right:20px">合计工时:{{totalReportHours}}小时</span>
- <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
- <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
- <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
- <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
- :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
- </span>
- </el-dialog>
- <!-- 按周填报 -->
- <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
- <!-- 按周填报-已填工时-点击 -->
- <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
- <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
- <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
- <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
- <el-table-column prop="state" :label="$t('state.states')">
- <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
- </el-table-column>
- <!-- <el-table-column label="操作">
- <template slot-scope="scope">
- <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
- </template>
- </el-table-column> -->
- </el-table>
- <span slot="footer" class="dialog-footer">
- <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
- </span>
- </el-dialog>
- <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
- <el-form-item :label="$t('screening.workingDate')" prop="createDate">
- <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>
- <el-button @click="handleGetPrevWeek()">{{$t('time.lastWeek')}}</el-button>
- <el-button @click="handleGetNextvWeek()">{{$t('time.nextWeek')}}</el-button>
- <el-button @click="getCurrentWeek()">{{$t('time.thisWeek')}}</el-button>
- <el-button @click="newDates()">{{$t('time.addedDate')}}</el-button>
- </el-form-item>
- <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading" max-height="400">
- <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
- <template slot-scope="scope">
- {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData(weekDay)}})
- </template>
- </el-table-column>
- <el-table-column fixed="left" :label="$t('other.hoursFilled')+ '(h)'" width="100" prop="filledTime" align="center">
- <template slot-scope="scope">
- <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
- <p v-else></p>
- </template>
- </el-table-column>
- <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
- <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
- <template slot-scope="scope">
- <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
- <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>
- <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>
- <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>
- <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
- </div>
- <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
- <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>
- <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
- </div>
- </template>
- </el-table-column>
- <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
- <template slot-scope="scope">
- <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
- <span v-else>{{$t('other.noAttendanceRecord')}}</span>
- </template>
- </el-table-column>
-
- <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
- <template slot-scope="scope">
- <div class="zhiss">
- <p>{{scope.row.filledTime ? parseFloat(scope.row.he) + scope.row.filledTime*1 : parseFloat(scope.row.he)}}</p>
- <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
-
- <!-- 按周填报项目筛选 -->
- <div v-if="selConShow" class="selConStyle">
- <div class="selConStyle_title">{{$t('defaultText.pleaseSelectTheItemYouWantToFillIn')}}</div>
- <el-select v-model="selCon" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable>
- <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">
- <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
- <span style="float: right">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer" v-if="selConShow">
- <el-button @click="selListqx()">{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="selListFun()">{{$t('btn.nextStep')}}</el-button>
- <!-- :loading="submitingReport" -->
- </span>
- <span slot="footer" class="dialog-footer" v-if="!selConShow">
- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button>
- <el-button @click="zhoAddqx()">{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
- </span>
- </el-dialog>
- <!-- 选择时间 -->
- <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
- <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
- </span>
- </el-dialog>
- <!-- 按周填报弹窗 -->
- <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
- <div>
- <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
- <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
- <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <!--如果设置了工时成本预警的预算成本项-->
- <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
- <p>{{$t('lable.budgetSource')}}</p>
- <el-select v-model="zhoBao.basecostId" style="width: 355px">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </div>
- <!-- 任务分组 -->
- <div class="zhoFel" v-if="user.company.packageProject == 1">
- <p>{{$t('lable.taskGrouping')}}</p>
- <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
- @change="getGroupStages(zhoBao, 0)">
- <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
- <p>{{$t('other.inputStage')}}</p>
- <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
- <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
- <p>{{$t('other.reviewer')}}</p>
- <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
- </div>
- <template v-if="user.timeType.reportAuditType == 3">
- <div class="zhoFel">
- <p>{{ $t('di-yi-shen-he-ren') }}</p>
- <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
- </div>
- <div class="zhoFel">
- <p>{{ $t('di-er-shen-he-ren') }}</p>
- <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
- </div>
- <div class="zhoFel">
- <p>{{ $t('di-san-shen-he-ren') }}</p>
- <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
- </div>
- <div class="zhoFel">
- <p>{{ $t('chao-song-ren') }}</p>
- <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
- <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
- </div>
- </template>
- <!-- 自定义维度 -->
- <div class="zhoFel" v-if="user.timeType.customDegreeActive">
- <p>{{user.timeType.customDegreeName}}</p>
- <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
- <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
-
- </div>
- <!-- 自定义数值 -->
- <div class="zhoFel" v-if="user.timeType.customDataActive">
- <p>{{user.timeType.customDataName}}</p>
- <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>
- </div>
- <!-- 自定义文本 -->
- <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
- <p>{{user.timeType.customTextName}}</p>
- <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 2">
- <p>{{$t('other.timeSelection')}}</p>
- <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>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 1">
- <p>{{$t('other.chooseDuration')}}</p>
- <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
- <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 3">
- <p>{{$t('lable.percentageOfTime')}}</p>
- <div style="width:355px;display: flex;align-items: center;">
- <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>
- <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>
- </div>
- </div>
- <div class="zhoFel">
- <p>{{$t('other.workMatters')}}</p>
- <el-input type="textarea" v-model="zhoBao.con" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="btnTianxiaes()">{{$t('btn.determine')}}</el-button>
- </span>
- </el-dialog>
- <!--导出报表条件选择 -->
- <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
- <el-form ref="form3" :model="exportParam" >
- <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
- <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
- <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
- <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>
- <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>
- </el-form-item>
- <el-form-item prop="projectId" :label="$t('time.dateRange')">
- <el-date-picker
- v-model="exportParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </el-form-item>
- <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
- <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
- <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
- <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
- <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
- </div>
- </el-dialog>
- <!--导出报表条件选择 -->
- <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
- <el-form ref="form3" :model="exportParam" >
- <el-form-item prop="range" :label="$t('time.dateRange')">
- <el-date-picker
- v-model="exportParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- ></el-date-picker>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
- </div>
- </el-dialog>
- <!--人员列表 -->
- <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
- <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
- <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
- <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="label" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <span>
- <!-- {{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}} -->
- <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
- <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
- </span>
- <span v-else>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
- </span>
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="deptName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
- <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
- <el-table-column prop="label" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <!-- <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> -->
- <!-- <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> -->
- <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
- <span>{{scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
- </span>
- <span v-else>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="deptName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="label" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="deptName" :label="$t('lable.department')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
- <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
- <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
- <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
- <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
- </div>
- </el-dialog>
-
- <!-- 按部门选择人员 -->
- <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
- <div class="tree" style="height:400px">
- <el-scrollbar style="height:100%">
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
- ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
- highlight-current :filter-node-method="filterNode">
- <span class="custom-tree-node" slot-scope="{ node }">
- <span v-if="user.userNameNeedTranslate == '1'">
- <span v-if="node.data.children">
- <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
- </span>
- <span v-else>
- <ww-open-data type='userName' :openid='node.label'></ww-open-data>
- </span>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{ node.label }}
- </span>
- </span>
- </el-tree>
- </el-scrollbar>
- </div>
- <div>{{$t('btn.choose')}} {{chosenMembCount}} {{$t('other.people')}}</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
- </div>
- </el-dialog>
- <el-dialog
- v-if="monthWorkTimeDialog"
- :visible.sync="monthWorkTimeDialog"
- :close-on-click-modal="false"
- customClass="customWidth selectworktime"
- width="63%"
- title=""
- >
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane :label="$t('other.completedHours')" name="first">
- <div class="selectworktime_export" style="margin-top:10px;">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- :range-separator="$t('other.to')"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthWorkTime()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
- <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
- <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
-
- <!-- 222 -->
- </div>
- <div>
- <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">
- <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
- </el-input>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
- </div>
- <el-link
- type="primary"
- style="float: right; vertical-align: middle;height:32px"
- @click="exportMembWorkHours()"
- >{{$t('export.exportData')}}</el-link
- >
- </div>
- <el-table ref="hasworkTbl"
- :data="monthWorkDataS"
- v-el-table-infinite-scroll="listScroll"
- border
- :height="500"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- :lazy="true"
- >
- <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
- <template slot-scope="scope">
- {{ scope.$index + 1 }}
- </template>
- </el-table-column>
- <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
- <template slot-scope="scope">
- <span :style="scope.row.worktimeList.length==0?'color:red':''">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
- <!-- {{scope.row.name}} -->
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
- </template>
- </el-table-column>
- <el-table-column
- min-width="105"
- v-for="(item, index) in pickDateArray"
- :key="index"
- :label="item.label"
- align="center"
- >
- <template slot-scope="scope">
- <div
- style="color: red"
- v-if="
- scope.row.worktimeList.filter(
- (w) =>
- w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime < reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime.toFixed(1)
- }}
- </div>
- <div
- style="color: #20a0ff"
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime > reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime.toFixed(1)
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime == reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length == 0
- "
- >
- 0
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- typeof scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime == 'string'
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <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>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
- <!-- <div slot="title" class="dialog-title selectworktime_title">
- <label style="font-size: 16px">员工每日已填报工时数</label>
- <el-link
- type="primary"
- style="float: right; margin-right: 60px"
- @click="exportMembWorkHours()"
- >导出已填报数据</el-link
- > -->
- <!-- <el-button >导出</el-button> -->
- <!-- </div> -->
- </el-tab-pane>
- <el-tab-pane :label="$t('other.unfilledPersonList')" name="second" >
- <div class="selectworktime_export" style="margin-top:10px">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- :range-separator="$t('other.to')"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthNotWorkTime()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
- <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
- <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
-
- </div>
- <div>
- <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">
- <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
- </el-input>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
- </div>
- <el-link
- type="primary"
- style="float: right; vertical-align: middle;height:32px"
- @click="exportMembNotWorkHours()"
- >{{$t('export.exportData')}}</el-link
- >
- </div>
- <el-table
- ref="hasworkTbl2"
- :data="monthNotWorkDateS"
- v-el-table-infinite-scroll="notListScroll"
- border
- :height="500"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- lazy
- >
- <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
- </template>
- </el-table-column>
- <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
- </template>
- </el-table-column>
- <el-table-column
- min-width="200"
- :label="$t('weekDay.date')"
- align="center"
- prop="createDate"
- >
- </el-table-column>
- <el-table-column
- min-width="200"
- :label="$t('state.states')"
- align="center"
- prop="status"
- />
- <el-table-column
- min-width="200"
- :label="$t('other.attendanceData')"
- prop="cardTime"
- align="center"
- v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
- </el-table>
- <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>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- <!--驳回弹出框 -->
- <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <div>
- <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')" />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="deny()" >{{$t('btn.submit')}}</el-button>
- </div>
- </el-dialog>
- <!-- 通过弹出框 -->
- <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <div>
- <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
- <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
- </div>
- </el-dialog>
- <!--批量导入日报 -->
- <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
- <p>1. {{$t('other.download')}}
- <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>
- </p>
- <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
- <p style="display: flex;justify-content: center;">
- <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
- </el-upload>
- </p>
- <div style="display: flex;justify-content: end;padding-bottom: 1em;">
- <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
- </div>
- </el-dialog>
- <!-- 工时导入记录弹窗 -->
- <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
- <div style="height: 452px">
- <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
- <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
- <el-table-column prop="userName" :label="$t('other.operator')">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="datel" :label="$t('other.document')">
- <template slot-scope="scope">
- <div>
- <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
- <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-col :span="24" class="paginatis">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20 , 50 , 80 , 100]"
- :page-size="20"
- layout="total, sizes, prev, pager, next"
- :total="toViewForm.total"
- style="float:right;"
- ></el-pagination>
- </el-col>
- </div>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
- <el-steps :active="active" finish-status="success" style="margin-left:50px;">
- <el-step :title="$t('other.selectadaterangetoimporthours')">
-
- </el-step>
- <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
- <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
- </el-steps>
-
-
- <div v-if="active==0" style="padding:30px;height:360px;">
- <div style="margin-top:50px;margin-left:280px;">
- <el-date-picker
- v-model="importWxParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- @change="loadCheckInData"
- ></el-date-picker>
- </div>
- </div>
- <div v-if="active==1" style="padding:10px;">
- <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
- style="width: 100%;margin-top:5px;" >
- <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
- <template slot-scope="scope">
- <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
- <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
- </el-table-column>
- <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
- <el-table-column prop="username" :label="$t('screening.employeename')" >
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
- <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
- <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
- <template slot-scope="scope">
- {{scope.row.workHours.toFixed(1)}}h
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="active==2" >
- <p style="display: flex;justify-content: center;height:390px;">
- <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
- </el-upload>
- </p>
- </div>
- <div slot="title">
- <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
- <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
- </div>
-
- <span slot="footer">
- <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
- type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
- <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
-
- <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
-
- </span>
- </el-dialog>
- <!--工时批量代填 -->
- <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
- <div>
- <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
- v-model="importWxParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- :range-separator="$t('other.to')"
- type="daterange"
- :start-placeholder="$t('time.startDate')"
- :end-placeholder="$t('time.endDate')"
- @change="loadCheckInData"
- ></el-date-picker>
- <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
- </div>
- <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
- :key="timeStamp"
- style="width: 100%;margin-top:5px;" ref="tab">
- <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
- <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
- <template slot-scope="scope">
- {{scope.row.workHours.toFixed(1)}}h
- </template>
- </el-table-column>
- <!--项目名称列表 -->
- <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
- <template slot-scope="scope">
- <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input> h
- </template>
- </el-table-column>
- <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
- <template slot-scope="scope">
- {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}} h
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
- <div style="padding-bottom:10px;">
- <p>{{importResultMsg}}</p>
- </div>
- <!-- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="showImportResult=false">关闭</el-button>
- </span> -->
- </el-dialog>
-
- <!-- 审核流程展示 -->
- <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
- <div style="padding:20px 40px 20px 0">
- <el-timeline :reverse="false">
- <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
- <!-- {{item.msg}} -->
- <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
- <span v-if="user.userNameNeedTranslate == 1">
- <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
- <span>{{item.msgCon.two}}</span>
- </span>
- </el-timeline-item>
- </el-timeline>
- </div>
- </el-dialog>
- </section>
- </template>
- <script>
- // 左右滑动
- import dragMixin from "@/common/js/tensile.js";
- import util from "../../common/js/util";
- // 自定义select组件
- import selectCat from "@/components/select.vue"
- // 引入自定义级联组件
- import vueCascader from "@/components/cascader.vue"
-
- import { mapMutations } from 'vuex'
- let _that = this
- export default {
- mixins: [dragMixin],
- components: {
- selectCat,
- vueCascader
- },
- data() {
- return {
- hasWrittenReport: false,
- today:null,
- syncTimeLoading: false,
- seluserText: '',
- translation: '1', // 1、文字, 2、部门, 3、人员
- exportLoad: false,
- getPickerOptions: {
- disabledDate: (time) => {
- var date = new Date();
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- var currentdate = year.toString() + month.toString();
-
- var timeyear = time.getFullYear();
- var timemonth = time.getMonth() + 1;
- if (timemonth >= 1 && timemonth <= 9) {
- timemonth = "0" + timemonth;
- }
- var timedate = timeyear.toString() + timemonth.toString();
- if(this.user.timeType.fillAhead == 0){
- return currentdate < timedate;
- }else{
- return false
- }
-
- }
- },
- alalal: '8.0',
- timeBasecostList:null,
- tbload: false,
- exportTimeDialog: false,
- searchKeyword: '',
- monthWorkDataS: [],
- monthNotWorkDateS: [],
- pickDateArray:[],
- WorktimeDatepickValue: [],
- activeName:"first",
- isLeave: 0,
- submitingReport: false,
- importResultMsg:null,
- showImportResult:false,
- importingData: false,
- isDraft: 0,
- timeStamp: 0,
- projectColumns:[],
- checkinLoading:false,
- importWxParam:{date:null,},
- active:0,
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- importWxDialog:false,
- importDialog:false,
- denyForm:null,
- denyReasonDialog:false,
- monthWorkTimeDialog: false,
- isSubstitude:false,
- isFill:false,
- unFillList:[],
- fillList:[],
- fillMembList:[],
- fillMembList_leave: [],
- membListVisible: false,
- isBatch:0,//是否是批量填报
- editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
- // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
- 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')],
- statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
- fillStatusList: [],
- exportParam:{projectId: null, dateRange:[], departmentId: null},
- exportDialog:false,
- timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
- subProjectList:[],
- canEdit: true,
- originCanEdit: true,
- 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],
- selectTime:null,
- reportTimeType:{},
- curDate:'',
- isAllSelect: false,
- approveDialogVisible:false,
- deptId:null,
- targetUid: null,
- membCount:0,
- selectState:"-1",
- user: JSON.parse(sessionStorage.getItem("user")),
- allUsersList: [],
- showAddMore:false,
- allDate: [],
- typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
- date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
- choseDay: 0,
- tableHeight: 0,
- listLoading: false,
- projectList: [], //项目列表
- fillProjectList: [],
- reportList: [], //日报列表
- reportNames:[], //批量审批列表
- selCon:[], //筛选条件
- selProjectList:[], //筛选后项目列表
- selConShow: true,
- usersList: [], // 全部人员列表
- usersListId: '', // 选中的人员id
- dialogVisible: false, //项目弹窗
- report: '',
- workForm: {
- createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
- domains: [{
- id: null,
- projectId: "",
- workingTime: "",
- timeType:0,
- content: "",
- state: 2,
- multiWorktime:0,
- worktimeList:[],
- degreeId: null,
- auditUserList: [],
- }],
- },
- workRules: {
- createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
- },
- chooseParticipVisible: false,
- logining: false,
- isDisable: false,
- timeType:[],
- deptMembData: [
-
- ],
- //部门人员树状结构
- data: [
- {
- id: -1,
- label: this.$t('lable.allStaff'),
- membCount:0
- },
- {
- id: 0,
- label: this.$t('lable.unassigned'),
- }
- ],
- allData:{},
- batchShowData:{},
- option: [],
- depData: {
- id: -1,
- label: this.$t('lable.allStaff'),
- },
- defaultProps: {
- children: 'children',
- label: 'label'
- },
- isNew: false,
- selected: false,
- valuet: new Date(),
- domObj: null,
- participator:[],
- chosenMembCount:0,
- jsDay: 0,
- jsTime: 0,
- falsss: false,
- weidu: [],
- weiduList: [],
- yonghuUser: [],
- dateAr: [],
- batchSubFillDialog: false,
- isSubstiS: false,
- diasZho: false,
- zhoData: [],
- zhoRqi: [],
- btnZho: false,
- zhoLoading: false,
- changdu: 6,
- tianxieDialogVisible: false,
- scopess: {},
- zhoBao: {
- time: '',
- workingTime: '',
- progress: '',
- con: '',
- subProjectId: '',
- stage: '',
- subProjectList: [],
- stages: [],
- },
- zhoBaoIdx: '',
- zhoBaoName: '',
- zhis: {},
- dealList: [],
- toViewDialogVisible: false,
- toViewList: [],
- toViewloading: true,
- toViewForm: {
- pageIndex: '1',
- pageSize: '20',
- total: 0,
- },
- toViewloadings: false,
- tabPositionss: 'top',
- monthTotal: 0,
- monthTotalPage: 0,
- monthTotalLages: 20,
- monthWorkData: [],
- monthNotWorkDate: [],
- monthWorkDataS1: [],
- monthnotTotal: 0,
- monthnotTotalPage: 0,
- monthnotTotalLages: 20,
- monthNotWorkDateS1: [],
- deptMembDataText: '',
- isFlag: false,
- isMore: false,
- stateKey: '0',
- expandDate: [],
- notifySelList:[],
- departmentList: [],
- approvalProcessDialog: false,
- approvalProcessData: [],
- // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
- 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')],
- isWeekend: false,
- canCancelInDialog: false,
- approveinData: {},
- approveinDialog: false,
- reportCanDelete: false,
- weeklyFilledTimeDialog: false,
- weeklyFilledTimeList: [],
- weeklyFilledTimeLoading: false,
- workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
- weeklyFilledTimeCanDelete: false,
- weeklyFilledTimeDate: null,
- leaveAllNum: 0,
- dataLoading: false,
- zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
- vacationTime: {},
- integrationProjectList: [],
- totalReportHours: 0, // 合计的工时
- };
- },
- watch: {
- deptMembDataText(val) {
- this.$refs.chooseMembTree.filter(val);
- }
- },
- filters: {
-
- // 过滤
- amounts(value) {
- if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
- return 0
- }
- var zhi = +value + 0
- return zhi.toFixed(1)
- },
- // zhoData
- zhoData(value, arr) {
- var dateArray = value.split("-");
- var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
- // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
- // console.log(arr[date.getDay()])
- // return "周" + "日一二三四五六".charAt(date.getDay());
- return arr[date.getDay()]
- },
- // 过滤数字
- numbers(value) {
- if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
- return 0
- }
- return value
- },
-
- },
- computed: {},
- mounted() {
- var now = new Date();
- var t = util.formatDate.format(now, 'yyyy-MM-dd');
- this.today = t;
- var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
- this.exportParam.dateRange = [startStr,t];
- this.getAllDate(1);
- this.getReportList();
- this.getProjectList();
- this.getFillProjectList();
- this.getTimeType();
- this.getDepartment();
- this.scrollFunction()
- this.userssHu();
- if(this.user.timeType.reportAuditType == 3){
- this.getAllUsersList()
- }
- if (this.user.company.packageProject == 1) {
- this.getBasecostItemList();
- }
- if(this.user.timeType.lockWorktime){
- this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
- }
- const that = this
- if(this.user.userNameNeedTranslate == 1) {
- that.dataLoading = that.$store.state.dataLoading
- this.upDataLoading()
- setTimeout(()=>{
- that.dataLoading = that.$store.state.dataLoading
- }, 1000)
- }
- },
- methods: {
- ...mapMutations(['upDataLoading']),
- getRecentlyProject() {
- this.http.post('/project/nearProject',{},res => {
- if(res.code == 'ok'){
- let topObj = {
- label: '最近选择项目',
- peojectList: res.data
- }
- let botomObj = {
- label: '全部项目',
- peojectList: this.fillProjectList
- }
- this.integrationProjectList = [topObj, botomObj]
- console.log(this.integrationProjectList, '整合')
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- handlePictureCardPreview(file, index) {
- console.log(file, index)
- let arr = []
- let imgArr = this.workForm.domains[index].imgListUrl
- for(var i in imgArr) {
- arr.push(imgArr[i].url)
- }
- console.log(arr, '图片数据')
- const $viewer = this.$viewerApi({
- images: arr
- });
- },
- // 图片上传
- addImg(e, index) {
- console.log(e, '数据')
- let formData = new FormData()
- formData.append('multipartFile', e.file)
- this.http.uploadFile('/common/uploadFile', formData,
- res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('uploadedsuccessfully'),
- type: "success"
- });
- if(!this.workForm.domains[index].imgList) {
- this.workForm.domains[index].imgList = []
- this.workForm.domains[index].imgListUrl = []
- }
- this.workForm.domains[index].imgList.push(res.data)
- this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
- } else {
- this.$message({message: res.msg,type: "error"});
- }
- console.log(this.workForm.domains[index])
- },
- error => {this.$message({message: error,type: "error"});
- });
- },
- // 删除图片
- delImg(file,fileList, index) {
- console.log(file, fileList)
- let idx = 0
- for(let i in fileList) {
- if(fileList[i].uid == file.uid) {
- idx = i
- }
- }
- this.workForm.domains[index].imgList.splice(idx, 1)
- this.workForm.domains[index].imgListUrl.splice(idx, 1)
- console.log(this.workForm.domains[index])
- },
- test(){
- console.log('test',this.workForm.domains);
- },
- getHour(s1, s2) {
- var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
- s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
- s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
- var ms = s2.getTime() - s1.getTime();
- if (ms < 0) return 0;
- let ma = ms / 1000 / 60 / 60
- return ma; //小时
- },
- refreshWXCardTime(workdate) {
- if (!workdate) return;
- this.syncTimeLoading = true;
- this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
- date: workdate,
- },res => {
- this.syncTimeLoading = false;
- if(res.code == 'ok'){
- this.workForm.time = res.data.time;
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.syncTimeLoading = false;
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
- this.weeklyFilledTimeDialog = true
- this.weeklyFilledTimeLoading = true
- this.weeklyFilledTimeDate = parameterDate
- this.http.post('/report/getReportList',{
- date: parameterDate,
- userId: this.user.id
- },res => {
- this.weeklyFilledTimeLoading = false
- if(res.code == 'ok'){
- this.weeklyFilledTimeList = res.data[0].data
- let candelete = true
- for(let i in this.weeklyFilledTimeList){
- if(this.weeklyFilledTimeList[i].state < 2){
- candelete = false
- }
- }
- this.weeklyFilledTimeCanDelete = candelete
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.weeklyFilledTimeLoading = false
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
- this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.http.post('/report/delete',{
- userId: this.user.id,
- date: this.weeklyFilledTimeDate
- },res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getWeeklyWorkTime()
- this.getReportList();
- this.getDepartment();
- this.weeklyFilledTimeDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }).catch(() => {});
- },
- getApprovalProcess(item){
- // console.log('this.date',this.choseDate);
- this.http.post('/report-log/get',{
- creatorId: item.id,
- createDate: sessionStorage.msg
- },res => {
- if(res.code == 'ok'){
- this.approvalProcessDialog = true
- if(this.user.userNameNeedTranslate == 1) {
- for(var i in res.data) {
- let obj = {
- one: res.data[i].msg.split('$userName=')[1].split('$')[0],
- two: res.data[i].msg.split('$userName=')[1].split('$')[1],
- }
- res.data[i].msgCon = obj
- }
- }
- this.approvalProcessData = res.data
- console.log(this.approvalProcessData, '数据卡看')
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- filterNode(value, data) {
- if (!value) return true;
- return data.label.indexOf(value) !== -1;
- },
- triggerCalculateOT(index) {
- var str = this.workForm.domains[index].overtimeHours + ''
- if(str.indexOf('.') != '-1') {
- var s = str.split('.')[0]
- var st = str.split('.')[1]
- var sts = st.split('')
- this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
- }
- },
- searchScreen(e){
- if(e){
- this.monthNotWorkDateS1 = []
- for (let i = 0; i < this.monthNotWorkDate.length; i++) {
- if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
- this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
- }
- }
- if (this.monthNotWorkDateS1.length > 50) {
- this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
- }else{
- this.monthNotWorkDateS = this.monthNotWorkDateS1
- }
- // if (this.monthNotWorkDateS1.length > 0) {
- // setTimeout(() => {
- // this.tableListenernot()
- // }, 1000);
- // }
- }else{
- this.monthWorkDataS1 = []
- for (let i = 0; i < this.monthWorkData.length; i++) {
- if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
- this.monthWorkDataS1.push(this.monthWorkData[i])
- }
- }
- if (this.monthWorkDataS1.length > 50) {
- this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkDataS1
- }
- // if (this.monthWorkDataS1.length > 0) {
- // setTimeout(() => {
- // this.tableListener()
- // }, 1000);
- // }
- }
- },
- addUpload(data) {
- // var zhi = data.fileName.split('.')[0]
- // var sss = zhi + '.xlsx'
- // return
- var filePath = '/upload/' + data.serverName;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', data.fileName);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- },
- restrictNumber(targetId) {
- let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
- inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
- inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
- inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
- inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
- if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
- inpu.value = parseFloat(inpu.value);
- }
- },
-
-
- //获取项目下的任务分组
- getTaskGroups(domain, index) {
- domain.groupId=null;
- this.http.post('/task-group/listMyJoinGroup',{
- projectId: domain.projectId,
- isSubstitude: this.isSubstitude ? 1 : 0
- },
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].taskGroups = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //下载带企业微信考勤数据的工时统计模板
- downloadCheckInExcel() {
- this.http.post('/user-corpwx-time/exportCheckInExcel',{
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- },
- res => {
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- var data = filePath.split("/");
- a.setAttribute('download', data[data.length-1]);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- pre() {
- if (this.active == 0) return;
- this.active--;
- },
- next() {
- this.active++;
- },
- triggerTotalTime(index) {
- var item = this.checkinList[index];
- var total = 0.0;
- for (var i=0;i<this.projectColumns.length; i++) {
- var key = this.projectColumns[i];
- if (item[key] != null && item[key] != '') {
- total += parseFloat(item[key]);
- }
- }
- item.totalFillTime = total;
- },
- //提交批量代填的数据
- submitBatchSubFillData() {
- var data = JSON.stringify(this.checkinList);
- this.http.post('/user-corpwx-time/submitProjectTime',{
- json: data,
- projectColumns: JSON.stringify(this.projectColumns)
- },
- res => {
- if (res.code == "ok") {
- this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
- this.importWxDialog = false;
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- loadCheckInData() {
- if (this.importWxParam.date == null) {
- this.checkinList = [];
- return;
- }
- this.checkinLoading = true;
- this.http.post('/user-corpwx-time/getMyDeptMembsData',{
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- },
- res => {
- if (res.code == "ok") {
- this.checkinLoading = false;
- this.checkinList = res.data.list;
- this.projectColumns = res.data.projects;
- // 自定义表格会导致表格错乱,需重新计算表格
- this.$nextTick(()=>{
- this.$refs.tab.doLayout()
- })
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- batchImportWxData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("companyId", this.user.companyId);
- formData.append("withCheckIn", 1);
- this.http.uploadFile('/report/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.showImportResult = true;
- this.importingData = false;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
- this.getReportList();
- this.importWxDialog = false;
- } else {
- this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- batchImportData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("companyId", this.user.companyId);
- this.http.uploadFile('/report/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.showImportResult = true;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
- this.getReportList();
- this.importWXDialog = false;
- } else {
- this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- userssHu() {
- this.http.post('/time-type/getCompanyTimeSetting',{
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.yonghuUser = res.data
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- iptBlur(i) {
- if(this.isBatch == 0) {
- return
- }
-
- this.http.post('/report/getWorkDays',{
- startDate: this.workForm.createDate[0],
- endDate: this.workForm.createDate[1]
- },
- res => {
- if (res.code == "ok") {
- this.jsDay = res.data
- this.chuji(i)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- this.workForm.createDate = [];
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- var sl = this.workForm.domains
- this.chuji(i)
- },
- chuji(i) {
- if(i == 0) {
- this.seleChn(1)
- } else if(i == 1) {
- this.seleChn(0)
- } else if(i == 2) {
- if(this.workForm.domains[0].multiWorktime > 0) {
- this.iptChangs()
- } else {
- this.iptChang()
- }
- } else if(i == 3) {
- this.seleChn(0)
- }
- },
- seleChn(e,domain) {
-
- if(e == 1) {
- for(var i in this.workForm.domains) {
- if(this.workForm.domains[i].timeType == 0) {
- this.workForm.domains[i].workingTime = 8
- } else {
- this.workForm.domains[i].workingTime = 4
- }
- }
- }
- var quanbu = 0
- var spl = this.workForm.domains
- var zhi = ''
- for(var i in spl) {
- var sp = +spl[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- this.totalReportHours = quanbu
- let worktime = this.jsTime
- // 自动计算加班时长
- if(this.isBatch != 0){
- worktime = this.jsTime / this.jsDay
- }
- if(this.user.timeType.fillOvertime && domain){
- let isover = false
- let alltime = 0
- let allover = 0 //此处alltime同上面的worktime
- for(let d in spl){
- if(spl[d].isOvertime){
- isover = true
- allover += spl[d].overtimeHours*1
- }
- alltime += spl[d].workingTime*1
- }
- if(domain.overtimeHours){
- allover = allover - domain.overtimeHours
- }
- if(worktime*1 > this.user.timeType.allday){
- if(isover){
- if(alltime > (allover + this.user.timeType.allday)){
- this.$set(domain,'isOvertime',true)
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
- }else{
- this.$set(domain,'isOvertime',false)
- this.$set(domain,'overtimeHours',null)
- if(alltime < (allover + this.user.timeType.allday)){
- let overtime = allover + this.user.timeType.allday - alltime
- for(let pi in spl){
- if(spl[pi].overtimeHours){
- if((overtime - spl[pi].overtimeHours*1) > 0){
- overtime = overtime - spl[pi].overtimeHours*1
- this.$set(spl[pi],'isOvertime',false)
- this.$set(spl[pi],'overtimeHours',null)
- }else if((overtime - spl[pi].overtimeHours*1) < 0){
- this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
- break
- }else{
- this.$set(spl[pi],'isOvertime',false)
- this.$set(spl[pi],'overtimeHours',null)
- break
- }
- }
- }
- }
- }
- }else{
- this.$set(domain,'isOvertime',true)
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
- }
- }else{
- for(let di in spl){
- this.$set(spl[di],'isOvertime',false)
- this.$set(spl[di],'overtimeHours',null)
- }
- }
-
- }
- },
- iptChang() {
- var sl = this.workForm.domains
- let timeArr = []
- for(var i in sl) {
- if(sl[i].startTime && sl[i].endTime) {
- timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
- }
-
- }
- this.getTimeHours(timeArr)
- // for(let j in arrNum) {
- // this.timeJsonStr += arrNum[j]
- // if(flg) {
- // this.$set(this.workForm.domains[j],'isOvertime', true)
- // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
- // }
- // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
- // flg = true
- // this.$set(this.workForm.domains[j],'isOvertime', true)
- // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
- // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
- // }
- // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
- // this.$set(this.workForm.domains[j],'isOvertime', false)
- // this.$set(this.workForm.domains[j],'overtimeHours', '')
- // }
- // }
- },
- iptChangs() {
- var sl = this.workForm.domains
- let timeArr = []
- for(var i in sl) {
- for(var j in sl[i].worktimeList){
- if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
- timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
- }
- }
- }
- this.getTimeHours(timeArr)
- },
- // 调用接口或去数据
- getTimeHours(arr) {
- this.http.post('/report/getHoursByTimeRange',{
- timeJsonStr: JSON.stringify(arr)
- },res => {
- this.$set(this, 'totalReportHours', +res.data * this.jsDay)
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- removeTimeItem(item, index) {
- item.worktimeList.splice(index, 1);
- this.iptChangs()
- },
- //添加工时
- addNewWorktime(index, item) {
- if(item.worktimeList == null ) {
- item.worktimeList = []
- }
- item.worktimeList.push({});
- },
- //复制项目
- copyProject(index) {
- var leftProgress = 10;
- if (this.reportTimeType.type == 3) {
- //计算已经待分配工时比例
- let array = this.workForm.domains;
- let totalProgress = 0;
- for (var i=0;i<array.length; i++) {
- totalProgress += array[i].progress;
- }
- if (totalProgress < 100) {
- leftProgress = 100 - totalProgress;
- }
- }
- var newIndex = index+1;
- var itemDomain = {
- projectId: this.workForm.domains[index].projectId,
- workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
- this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
- ),
- content: "",
- progress:leftProgress,
- state:2,//2-表示待提交
- };
- this.workForm.domains.splice(newIndex, 0,itemDomain);
-
- if (this.reportTimeType.type == 0) {
- //全天上下午模式下,检测时间段数量,达到2个,不能再加了
- var length = this.workForm.domains.length;
- if (length == 2) {
- this.showAddMore = false;
- }
- }
- this.selectProject(itemDomain, newIndex);
- },
- pushWorkTime(){
- this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'info'
- }).then(() => {
- const loading = this.$loading({
- lock: true,
- text: '正在推送中,请耐心等待。',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
-
- this.http.post('/report/pushReportDataToThird',{
- yearMonth: this.date
- },res => {
- loading.close();
- if(res.code == 'ok'){
- this.$message({
- type: 'success',
- message: '推送成功!'
- });
- }else{
- this.$message({
- type: 'error',
- message: res.msg
- })
- }
- },err => {
- loading.close();
- this.$message({
- type: 'error',
- message: err
- })
- })
-
- }).catch(() => {
- });
- },
- showWorkTime(){
- this.monthWorkTimeDialog = true;
- this.searchKeyword = ''
- this.WorktimeDatepickValue = this.istoMonth()
- if(this.WorktimeDatepickValue.length == 0){
- let newdate = new Date();
- let nowdate = newdate.toLocaleDateString();
- let getauto = this.getAutoWeekDate(nowdate)
- let nowwd = [getauto[0],getauto[6]]
- this.WorktimeDatepickValue = nowwd
- }
- this.showMonthWorkTime()
- },
- handleClick(t,e){
- if (t.name == "first") {
- this.showMonthWorkTime()
- }else{
- this.showMonthNotWorkTime()
- }
- },
- //导出员工每日填报工时数
- exportMembWorkHours() {
- this.http.post(
- "/report/exportUserDailyWorkTime",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- exportMembNotWorkHours() {
-
- this.http.post(
- "/report/exportNoReportUserList",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- downloadByA(name, url) {
- const a = document.createElement("a"); // 创建a标签
- a.setAttribute("download", name); // download属性
- a.setAttribute("href", url); // href链接
- a.click(); // 自执行点击事件
- a.remove();
- },
- // 是否本月判断
- istoMonth(){
- let todate = new Date()
- let tomonth = todate.getMonth() + 1
- let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
- if(this.date == adate){
- return []
- }else{
- let sedate = new Date(this.date)
- let semonth = sedate.getMonth() + 1
- let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
- let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
- let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
- return [sedates1, sedates2]
- }
- },
- showMonthWorkTime() {
- this.monthTotalPage = 0,
- this.tbload = true
- this.http.post(
- "/report/getUserDailyWorkTime",
- // "/report/getNoReportUserList",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- this.tbload = false;
- this.pickDateArray = res.data.days;
- // console.log('dataarray',res.data.days);
- this.monthWorkData = res.data.list;
- // this.monthWorkDataS = this.monthWorkData
- // this.monthWorkDataS1 = res.data.list
- this.monthTotal = res.data.list.length
- if (this.monthWorkData.length > 50) {
- this.monthWorkDataS = this.monthWorkData.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkData
- }
- this.searchScreen(0)
- // this.monthWorkDataS = infoList
- // 判断
- // if (this.monthWorkDataS1.length > 0) {
- // setTimeout(() => {
- // this.tableListener()
- // }, 1000);
- // }
- this.$nextTick(function(){
- this.$refs.hasworkTbl.doLayout();
- });
- // this.$forceUpdate()
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- // tableListener(){
- // let that = this;
- // let dom = that.$refs.hasworkTbl.bodyWrapper;
- // // 添加scroll监听事件
- // dom.addEventListener("scroll", function () {
- // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
- // if (scrollDistance < 2) {
- // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
- // that.monthTotalPage++; //当前页数自增
- // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
- // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
- // var infoList = arrList.splice(
- // that.monthTotalPage * that.monthTotalLages,
- // that.monthTotalLages
- // );
- // // 数据添加
- // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
- // }
- // }
- // })
- // },
- showMonthNotWorkTime() {
- this.monthTotalPage = 0,
- this.tbload = true
- this.http.post(
- "/report/getNoReportUserList",
- {
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- this.tbload = false
- this.monthNotWorkDate = res.data;
- // this.monthNotWorkDateS1 = res.data
- this.monthnotTotal = res.data.length
- // 2222111
- if (this.monthNotWorkDate.length > 50) {
- this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
- } else {
- this.monthNotWorkDateS = this.monthNotWorkDate
- }
- this.searchScreen(1)
- // 判断
- // if (this.monthnotworkDateS1.length > 0) {
- // setTimeout(() => {
- // this.tableListenernot()
- // }, 1000);
- // }
- this.$nextTick(function(){
- this.$refs.hasworkTbl2.doLayout();
- });
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- // tableListenernot(){
- // let that = this;
- // let dom = that.$refs.hasworkTbl2.bodyWrapper;
- // dom.addEventListener("scroll", function () {
- // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
- // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
- // if (scrollDistance2 < 2) {
- // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
- // that.monthnotTotalPage++; //当前页数自增
- // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
- // var infoList = arrList.splice(
- // that.monthnotTotalPage * that.monthnotTotalLages,
- // that.monthnotTotalLages
- // );
- // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
- // }
- // }
- // })
- // },
- listScroll(){
- if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
- this.isMore = true
- setTimeout(()=>{
- this.isMore = false
- },1000)
- }else {
- this.isFlag = true
- let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
- this.monthWorkDataS = datalist
- setTimeout(()=>{
- this.isFlag = false
- },300)
- }
- },
- notListScroll(){
- if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
- this.isMore = true
- setTimeout(()=>{
- this.isMore = false
- },1000)
- }else {
- this.isFlag = true
- let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
- this.monthNotWorkDateS = datalist
- // console.log('length',this.monthNotWorkDateS.length)
- setTimeout(()=>{
- this.isFlag = false
- },300)
- }
- },
- // 获取默认这zhou日期参数 222
- getLastWeek(e){
- let newdate = new Date()
- let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
- let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
- if(e){
- this.WorktimeDatepickValue = lastwd
- this.showMonthWorkTime()
-
- }else{
- this.WorktimeDatepickValue = lastwd
- this.showMonthNotWorkTime()
- }
- },
- getThisWeek(e){
- let newdate = new Date();
- let nowdate = newdate.toLocaleDateString();
- let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
- if(e){
- this.WorktimeDatepickValue = nowwd
- this.showMonthWorkTime()
- }else{
- this.WorktimeDatepickValue = nowwd
- this.showMonthNotWorkTime()
- }
- },
- getDoubleLastWeek(e){
- let newdate = new Date()
- let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
- let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
- if(e){
- this.WorktimeDatepickValue = nextwd
- this.showMonthWorkTime()
- }else{
- this.WorktimeDatepickValue = nextwd
- this.showMonthNotWorkTime()
- }
- },
- alreadyAllDate(stime,etime){
- let diffdate = new Array();
- let i=0;
- while(stime<=etime){
- let dateArray = stime.split("-");
- let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
- // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
- let stimewk = this.weekDay[date.getDay()]
- 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')
- 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])
- diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
- let stime_ts = new Date(stime).getTime();
- let next_date = stime_ts + (24*60*60*1000);
- let next_dates_y = new Date(next_date).getFullYear()+'-';
- let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
- let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
- stime = next_dates_y+next_dates_m+next_dates_d;
- i++;
- }
- return diffdate
- },
- getAutoWeekDate(e) {
- let dateString = e;
- let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
- if (dateString.match(dateStringReg)) {
- let presentDate = new Date(dateString),
- today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
- return Array.from(new Array(7), function (val, index) {
- let formatDate = new Date(
- presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
- );
- return (
- formatDate.getFullYear() +
- "-" +
- ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
- "-" +
- (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
- );
- });
- } else {
- throw new Error(
- 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
- );
- }
- },
- onProgressChange() {
- this.$forceUpdate();
- },
- showChooseMembTree() {
- this.chosenMembCount = this.participator.length;
- this.chooseParticipVisible = true;
- },
- onTreeItemChange() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- findUserInTree() {
- if (this.filterName == '') {
- this.deptMembData = this.allMembData;
- } else {
- var list = this.findRecursively(this.filterName, this.allMembData);
- this.deptMembData = list;
- }
- },
- findRecursively(username, list) {
- var filterList = [];
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == 1) {
- if (list[i].label.indexOf(username) >= 0) {
- //匹配上了
- filterList.push(list[i]);
- }
- } else if (list[i].children != null && list[i].children.length > 0) {
- var subList = this.findRecursively(username, list[i].children);
- if (subList.length > 0) {
- subList.forEach(s=>filterList.push(s));
- }
- }
- }
- return filterList;
- },
- //确定选择参与人
- chooseParticip() {
- this.chooseParticipVisible = false;
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
- this.workForm.userNames = '';
- this.workForm.userId = [];
- this.participator = [];
- for (var i=0;i<this.chosenMembList.length; i++) {
- this.workForm.userId.push(this.chosenMembList[i].id);
- this.workForm.userNames += this.chosenMembList[i].label+',';
- var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
- this.participator.push(item);
- }
- if (this.workForm.userNames.length > 0) {
- this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
- }
- if(this.user.userNameNeedTranslate == 1) {
- if(this.workForm.userNames) {
- this.workForm.userNames = this.workForm.userNames.split(',')
- }
- }
-
- },
- notifySel(sel){
- // console.log(sel);
- this.notifySelList = sel
- },
- //微信通知人员填写
- Notify(code) {
- if (this.notifySelList.length == 0) return;
- var ids = '';
- this.notifySelList.forEach(f=>{
- ids += f.id+',';
- })
- this.http.post('/user/pushFillReport',{
- ids: ids, date: this.curDate,
- code: code
- },
- res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.sentSuccessfully'),
- type: "success"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //导出人员列表
- exportMemb() {
- if (this.fillMembList.length == 0) return;
- var ids = '';
- this.fillMembList.forEach(f=>{
- ids += f.id+',';
- })
- this.http.post('/user/exportMembList',{
- ids: ids,isFill: this.isFill, date: this.curDate
- },
- res => {
- if (res.code == "ok") {
- var aTag = document.createElement('a');
- aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
- aTag.href = res.data;
- aTag.click();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- showMembList(fill) {
- this.membListVisible = true;
- if (fill == 0) {
- this.fillMembList = this.unFillList;
- this.isFill = false;
- let leaveList = []
- let unleaveList = []
- for(let i in this.fillMembList){
- if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
- leaveList.push(this.fillMembList[i])
- }else{
- unleaveList.push(this.fillMembList[i])
- }
- }
- this.fillMembList = unleaveList
- this.fillMembList_leave = leaveList
- } else if(fill == 1){
- this.fillMembList = this.fillList.filter(item => item.state != 3);
- this.isFill = true;
- }else{
- this.fillMembList = this.fillList.filter(item => item.state == 3);
- this.isFill = true;
- }
- },
- //获取自己填写的日报状态
- getReportFillStatus() {
- this.http.post('/report/getReportFillStatus',{
- startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
- },
- res => {
- if (res.code == "ok") {
- this.fillStatusList = res.data;
- this.allDate.forEach(d=>{
- var fillInfo = null;
- d.state = null;
- this.fillStatusList.forEach(s=>{
- // console.log(d)
- var d1 = s.createDate.split('-')[2];
- var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
- // console.log(d2, '我被执行了')
- if (d1.indexOf('0') == 0) {
- d1 = d1.substring(1,d1.length);
- }
-
- if (d1 == d2) {
- d.state = s.state;
- }
- })
- })
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- scrollFunction () {
- this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
- if (this.domObj.attachEvent) { // IE
- this.domObj.attachEvent('onmousewheel', this.mouseScroll)
- } else if (this.domObj.addEventListener) {
- this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
- }
- this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
- },
- mouseScroll(event) { // google 浏览器下
- let detail = event.wheelDelta || event.detail
- let moveForwardStep = -1
- let moveBackStep = 1
- let step = 0
- step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
- event.preventDefault() // 阻止浏览器默认事件
- this.domObj.scrollLeft = this.domObj.scrollLeft + step
- },
- // //左右滚动
- // wheel(e){
- // var a = document.getElementById("dateScroll");
- // var scroll_width = 80; //滚动一下的距离
- // var e = e || window.event, v;
- // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
- // if(v>3||-v>3) v=-v;
- // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
-
- // e.preventDefault(); //阻止浏览器的默认滚动
- // },
- showExportDialog() {
- this.exportDialog = true;
- },
- showExportTimeDialog() {
- this.exportTimeDialog = true;
- },
- changeAllTime() {
- //总时长发生改变,自动按比例计算
- this.workForm.domains.forEach(d=>{
- d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
- });
- },
- // 是否加班的单机事件
- check() {
- this.selected = !this.selected
- this.isNew = this.selected
-
- },
- updateSubProject() {
- this.$forceUpdate();
- },
- selectDegreeId(domain, index) {
- this.http.post('/report/defaultDegree',{
- projectId: domain.projectId
- },
- res => {
- if (res.code == "ok") {
- if(res.data) {
- this.workForm.domains[index].degreeId = res.data.id + ''
- this.$forceUpdate();
- }
-
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //项目选中了, 加载子项目
- selectProject(domain, index) {
- if(!domain.projectId){
- return;
- }
- // 默认选中上次填写的自定义维度
- if(this.yonghuUser.customDegreeActive == 1) {
- this.selectDegreeId(domain, index)
- }
- // console.log('projectId===',domain.projectId);
- domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
- this.http.post('/sub-project/list',{
- projectId: domain.projectId,
- isReport: true
- },
- res => {
- //清空之前选中的子项目
- // this.workForm.domains[index].subProjectId = 0;
- if (res.code == "ok") {
- this.workForm.domains[index].subProjectList = res.data;
- this.workForm.domains[index].subProjectId = null;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- //项目相关的近期任务
- if (this.user.company.packageProject == 1) {
- this.http.post('/task/getRecentTask',{
- projectId: domain.projectId,
- isSubstitude:this.isSubstitude?1:0
- },
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].allTaskList = res.data;
- this.workForm.domains[index].taskList = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- //获取项目相关专业
- if (this.user.company.packageEngineering == 1) {
- this.getProjectProfessions(domain, index);
- }
-
- // 获取项目相关的维度
- // domain.degreeId = null
- this.$set(domain,'degreeId',null)
- this.dimension(domain, index);
- //获取项目下的任务分组
- this.getTaskGroups(domain, index);
- //获取项目审核人
- if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
- this.getProjectAuditorList(domain, index);
- } else {
- //按分组的负责人来审核
- domain.projectAuditorId = null;
- domain.projectAuditorName = null;
- domain.auditUserList = null;
- }
- },
- //获取项目审核人
- getProjectAuditorList(domainItem, index) {
- if(domainItem.projectId == '') {
- return
- }
- domainItem.projectAuditorId = null;
- domainItem.projectAuditorName = null;
- this.http.post('/project-auditor/getList',{
- projectId: domainItem.projectId,
- },
- res => {
- if (res.code == "ok") {
- domainItem.auditUserList = res.data;
- if (res.data.length==0) {
- this.$message({
- message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
- type: "error"
- });
- } else if (res.data.length==1) {
- domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
- domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- // 获取维度数据
- dimension(domain, index) {
- if(domain.projectId == '') {
- return
- }
- this.http.post('/project/getDegreeList',{
- projectId: domain.projectId,
- },
- res => {
- if (res.code == "ok") {
- // console.log("维度数据",res.data);
- this.workForm.domains[index].wuduList = res.data
- // this.workForm = this.workForm
- this.$forceUpdate()
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //切换任务阶段
- changeStages(domain, index) {
- if (domain.stage == null || domain.stage == '') {
- this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
- } else {
- this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
- }
- this.$forceUpdate();
- },
- getGroupStages(domain, index, keepStage) {
- // console.log(domain);
- if(!domain.groupId){
- domain.projectAuditorId = ''
- domain.stages = []
- if(this.user.timeType.reportAuditType >= 1){
- domain.auditUserList = []
- }
- this.$forceUpdate();
- return
- }
- this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
- res => {
- if (res.code == "ok") {
- if (!keepStage) {
- domain.stage = '';
- }
- domain.stages = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- //检查当前的项目是否需要获取分组的负责人
- if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
- this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
- res => {
- if (res.code == "ok") {
- domain.getProjectAuditorList = res.data;
- domain.auditUserList = res.data;
- if (res.data.length==1) {
- domain.projectAuditorId = domain.auditUserList[0].auditorId;
- domain.projectAuditorName = domain.auditUserList[0].auditorName;
- } else if (res.data.length==0) {
- domain.projectAuditorId = null;
- domain.projectAuditorName = null;
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- getProjectProfessions(domain, index) {
- this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].professionProgress = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //删除自己的日报
- deleteReport() {
- this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/report/delete',{
- userId: this.user.id,
- date: this.workForm.createDate
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.dialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
-
- },
- // 管理员删除日报
- guanli(item) {
-
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- let param = {date: this.date + day, userId: item.id};
-
- this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/report/delete',param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.dialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
-
- selectAll() {
- if (this.isAllSelect) {
- var keys = [];
- this.reportNames.forEach(b=>{
- keys.push(b.id);
- })
- this.$refs.approveTree.setCheckedKeys(keys);
- } else {
- this.$refs.approveTree.setCheckedKeys([]);
- }
- },
-
- removeEmptyNode(list) {
- for (var i=0;i<list.length;i++) {
- var cnt = 0;
- if (list[i].membCount == 0) {
- list.splice(i, 1);
- i--;
- } else if (list[i].children != null) {
- this.removeEmptyNode(list[i].children);
- }
- }
- },
- calculateMembCount(list) {
- for (var i in list) {
- var cnt = 0;
- if (list[i].children != null) {
- this.calculateMembCount(list[i].children);
- for (var m in list[i].children) {
- cnt += list[i].children[m].membCount;
- }
- }
-
- if (list[i].isUser == 1) {
- cnt++;
- this.membCount++;
- }
- list[i].membCount = cnt;
- }
- },
- stateChange() {
- // console.log(this.allData,'alldate');
- this.membCount = 0;
- if (this.selectState == -1) {
- //全部状态
- this.data = this.allData;
- } else {
- //未填报
- this.seluserText = ''
- var newData = JSON.parse(JSON.stringify(this.allData));
- this.filterState(this.selectState, newData);
- this.data = newData;
- }
- this.calculateMembCount(this.data);
- this.data[0].membCount = this.membCount;//总人数
- },
- //按状态过滤部门人员
- filterState(state, list) {
- for (var i =0;i<list.length; i++) {
- var obj = list[i];
- if (obj.isUser == 1) {
- var match = false;
- if (state == -2) {
- if (obj.state == null) {
- match = true;
- }
- } else {
- if (obj.state == state) {
- match = true;
- }
- }
- if (!match) {
- list.splice(i, 1);
- i--;
- } else {
- }
- } else {
- if (obj.children != null) {
- this.filterState(state, obj.children);
- }
- }
- }
- },
- //a按名称过滤部门人员
-
- seluserforText(){
- this.membCount = 0;
- var newData = JSON.parse(JSON.stringify(this.allData));
- this.seluserforTextin(this.seluserText, newData)
- this.data = newData;
- this.calculateMembCount(this.data);
- this.data[0].membCount = this.membCount;//总人数
- },
- seluserforTextin(text, list){
- for (var i =0;i<list.length; i++) {
- var obj = list[i];
- if (obj.isUser == 1) {
- var match = false;
- if (obj.label.indexOf(text) != -1) {
- match = true
- }
- if (!match) {
- list.splice(i, 1);
- i--;
- } else {
- }
- } else {
- if (obj.children != null) {
- this.seluserforTextin(text, obj.children);
- }
- }
- }
- },
- // 部门列表点击
- handleNodeClick(data) {
- // this.dealList = data
- this.theValues(data.id, this.allData)
- // this.depData = data;
- var list = [];
- if (data.id == -1) {
- this.deptId = null;
- this.targetUid = null;
- list = this.data;
- } else if (data.isUser == 1) {
- this.deptId = null;
- this.targetUid = data.id;
- } else {
- this.deptId = data.id;
- this.targetUid = null;
- list.push(data);
- }
- this.getReportList();
- if (list.length > 0) {
- this.unFillList = this.getUserMembListFromDeptList(list, 0);
- this.fillList = this.getUserMembListFromDeptList(list, 1)
- }
- },
- theValues(id, item) {
- for(var i in item) {
- if(item[i].id == id) {
- this.depData = item[i]
- if(id == '-1') {
- this.translation = '1'
- } else {
- if(item[i].children) {
- this.translation = '2'
- } else {
- this.translation = '3'
- }
- }
- return
- } else {
- if(item[i].children) {
- this.theValues(id, item[i].children)
- }
- }
- }
- },
- //获取可以选择的代填的人员列表
- getSubstitudeUserDeptList() {
- if (this.deptMembData.length == 0) {
- this.http.post("/department/listMyMembs", {},
- res => {
- if (res.code == "ok") {
- let noAllData = JSON.parse(JSON.stringify(res.data));
- if (noAllData.length > 0) {
- // if (noAllData[0].label == '全部人员') {
- if (noAllData[0].label == this.$t('lable.allStaff')) {
- noAllData.splice(0,1);
- }
- }
- this.setUserToDept(noAllData);
- this.deptMembData = noAllData;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
-
- // 获取部门列表
- getDepartment() {
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var param = {date:this.date + day};
- this.http.post("/report/getMembList", param,
- res => {
- if (res.code == "ok") {
- if(res.data.length == 0){
- // this.$message({
- // message: '请联系管理员设置负责部门',
- // type: 'error'
- // })
- return
- }
- this.departmentList = JSON.parse(JSON.stringify(res.data))
- var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
- // let noAllData = JSON.parse(JSON.stringify(res.data));
- // if (this.user.role > 0) {
-
- // }
- list.splice(0,0,{
- id: -1,
- label: this.$t('lable.allStaff'),
- })
- this.membCount = 0;
- //设置员工到部门下面
- this.setUserToDept(list);
- this.data = list;
- // console.log('data',this.data);
- this.expandDate = [this.data[1].id]
- this.allData = list;
-
- // if (noAllData.length > 0) {
- // if (noAllData[0].label == '全部人员') {
- // noAllData.splice(0,1);
- // }
- // }
- // this.setUserToDept(noAllData);
- // this.deptMembData = noAllData;
- this.option = this.changeArr(list1);
- list[0].membCount = this.membCount;
- if (this.depData.id == -1) {
- this.depData.membCount = this.membCount;
- this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
- this.fillList = this.getUserMembListFromDeptList(this.data, 1);
- } else {
- if (this.depData.isUser == null) {
- var dep = this.findTargetDept(this.data, this.depData.id);
- var membDeptList = [];
- membDeptList.push(dep);
- this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
- this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
- }
- }
- if (this.depData.isUser == null) {
- if (this.isFill) {
- this.fillMembList = this.fillList;
- } else {
- this.fillMembList = this.unFillList;
- }
- }
- this.leaveAllNum = 0
- for(let i in this.unFillList){
- if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
- this.leaveAllNum += 1
- }
- }
- this.stateChange()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- this.getReportFillStatus();
- },
- findTargetDept(list, deptId) {
- var t = null;
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == null && list[i].id == deptId) {
- t = list[i];
- break;
- }
- }
- if (t == null) {
- for (var i=0;i<list.length; i++) {
- if (list[i].children != null && list[i].children.length > 0) {
- t = this.findTargetDept(list[i].children, deptId);
- if (t != null) {
- break;
- }
- }
- }
- }
- return t;
- },
- getUserMembListFromDeptList(list, isFill) {
- var membList = [];
- for (var i in list) {
- var deptName = list[i].label;
- if (list[i].userList != null) {
- list[i].userList.forEach(element => {
- if (isFill == 0) {
- //获取未填的
- if (element.state == null) {
- var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
- membList.push(obj);
- }
- } else {
- if (element.state != null) {
- var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
- membList.push(obj);
- }
- }
-
- });
- }
- if (list[i].children != null) {
- membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
- }
- }
- return membList;
- },
- setUserToDept(list) {
- for (var i in list) {
- var cnt = 0;
- if (list[i].children != null) {
- this.setUserToDept(list[i].children);
- for (var m in list[i].children) {
- cnt += list[i].children[m].membCount;
- }
- }
-
- if (list[i].userList != null) {
- if (list[i].children == null) {
- list[i].children = [];
- }
- list[i].userList.forEach(element => {
- var obj = {
- id: element.id,
- label:element.name,
- state:element.state,
- parentId:element.departmentId,
- isUser:1,
- workingTime: element.workingTime,
- leaveDays: element.leaveDays,
- leaveTimes: element.leaveTimes
- };
- list[i].children.push(obj);
- this.membCount++;
- cnt++;
- });
- }
- list[i].membCount = cnt;
- }
- },
- // 修改数组
- changeArr(arr) {
- for (var i = 0; i < arr.length; i++) {
- if(arr[i].id != -1 && arr[i].id != 0) {
- if (arr[i].children != null && arr[i].children.length>0) {
- arr[i].children = this.changeArr(arr[i].children);
- }
- arr[i].id && (arr[i].value = arr[i].id);
- delete arr[i].id;
- }
- }
- for(var i in arr) {
- if(arr[i].id == -1 || arr[i].id == 0) {
- arr.splice(i,1)
- }
- }
- return arr;
- },
- //时间段范围设置改动,监听
- onTimeTypeChange(timeType) {
- this.seleChn(1)
- this.showAddMore = true;
- for(var i in this.workForm.domains) {
- if (this.workForm.domains[i].timeType == 0) {
- this.showAddMore = false;
- break;
- }
- }
- if (this.showAddMore) {
- //检测数量
- if (this.workForm.domains.length == 2) {
- this.showAddMore = false;
- } else {
- this.showAddMore = true;
- }
- }
- },
- getTimeType() {
- this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
- res => {
- if (res.code == "ok") {
- var t = res.data;
- this.reportTimeType = t;
- if (this.reportTimeType.type > 0) {
- this.showAddMore = true;
- }
- //转化时间格式
- if (t.allday != null) {
- this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
- }
- if (t.am != null) {
- this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
- }
- if (t.pm != null) {
- this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
- }
- let arr = []
- for(var i in res.data.excludeTimeList) {
- let obj = {
- s: res.data.excludeTimeList[i].startTime,
- e: res.data.excludeTimeList[i].endTime,
- }
- arr.push(obj)
- }
- this.vacationTime = arr
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 改变月份 -------
- changeMonthOut() {
- this.getAllDate();
-
- this.getReportList();
- this.getDepartment();
- },
- // 选择日期
- choseDate(i, item) {
- if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
- return
- }
- // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
- this.choseDay = i;
- let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- sessionStorage.msg = this.date + day,
- this.getReportList();
- this.getDepartment();
- this.curDate = item.date;
- },
- canClick(i, item){
- let nowDate = new Date()
- let nowDateYear = nowDate.getFullYear()
- let itemYear = parseInt(this.date.split('-')[0])
- let nowDateMonth = nowDate.getMonth() + 1
- let itemMonth = parseInt(this.date.split('-')[1])
- let nowDateDay = nowDate.getDate()
- let itemDay = parseInt(item.showDate.split('.')[1])
- if(nowDateYear < itemYear){
- return false
- }else if(nowDateYear == itemYear){
- if(nowDateMonth < itemMonth){
- return false
- }else if(nowDateMonth == itemMonth){
- if(nowDateDay < itemDay){
- return false
- }
- }
- }
- },
- // 获取日期列表
- getAllDate(e) {
- var dayArry = [];
- var day = this.getCountDays();
- let curMonthDay = null;
- for (var k = 1; k <= day; k++) {
- var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
- var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
- if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
- new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
- if(sessionStorage.msg) {
- if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
- this.choseDay = k - 1;
- curMonthDay = str;
- }
- } else {
- if (new Date().getDate() == k) {
- this.choseDay = k - 1;
- }
- }
- } else {
- this.choseDay = 0;
- }
- var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
- var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
- dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
- }
- this.allDate = dayArry;
- //不能超过最大日期
- if (this.choseDay > day-1) {
- this.choseDay = day-1;
- }
- if(sessionStorage.from != 1){
- let nowmonth = new Date().getMonth() + 1
- let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
- let nowdate = new Date().getDate()
- if(nowd == this.date){
-
- if(e && sessionStorage.msg){
- }else{
- sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
- }
- let nowday = new Date(sessionStorage.msg).getDate()
- this.choseDay = nowday - 1
-
- let monthdate = new Date(sessionStorage.msg)
- this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
-
- }else{
- if(e && sessionStorage.msg){
- }else{
- sessionStorage.msg = this.date + '-01'
- }
- let monthdate = new Date(sessionStorage.msg)
- this.choseDay = monthdate.getDate() - 1
- this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
- // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
- }
- }else{
- this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
- }
-
- //从消息点击跳转过来的,直接加载指定日期
- if (sessionStorage.from == 1 && sessionStorage.msg) {
- this.curDate = sessionStorage.msg;
- sessionStorage.from = 0;
- } else {
- // if (curMonthDay != null) {
- // // this.curDate = curMonthDay;
- // let d = new Date(sessionStorage.msg)
- // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
- // } else {
- // let d = new Date(this.date.replace(/-/g, "/")+'/01')
- // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
- // }
- }
- // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
- // if(!sessionStorage.msg){
- // let msgday = this.choseDay + 1
- // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
- // }
-
- this.getReportFillStatus();
- },
- getCountDays() {
- var newstr = this.date.replace(/-/g, "/");
- var curDate = new Date(newstr+'/01');
- var curMonth = curDate.getMonth();
- curDate.setMonth(curMonth + 1);
- curDate.setDate(0);
- return curDate.getDate();
- },
- //获取日报列表
- getReportList() {
- this.listLoading = true;
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- let param = {date: this.date + day};
- if (this.deptId) {
- param.deptId = this.deptId;
- }
- if (this.targetUid) {
- param.userId = this.targetUid;
- }
- this.http.post( this.port.report.list, param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.reportList = res.data;
- if(document.querySelector("#day"+this.choseDay)){
- document.querySelector("#day"+this.choseDay).scrollIntoView(true);
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 处理数据
- // dealWith() {
- // var tianxie = 0
- // var weixtianxie = 0
- // if(this.selectState == -1) {
- // } else {
- // var arr = []
- // for (var i in this.reportList) {
- // arr.push(this.reportList[i].id)
- // }
- // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
- // }
- // },
- // getDealWith(item, tx, wtx, arr) {
- // for(var i in item) {
- // if(item[i].children) {
- // this.getDealWith(item[i].children, tx, wtx, arr)
- // } else {
- // if(arr.indexOf(item[i].id) != '-1') {
- // tx = +tx + 1
- // }
- // }
- // }
- // },
- //导出员工工时统计
- exportUserTime() {
- this.listLoading = true;
- var param = {};
- if (this.exportParam.dateRange != null) {
- param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
- }
- this.http.post('/department/exportDeptStatistic', param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- location.href = res.data;
- this.exportTimeDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //导出日报
- exportReport() {
- this.listLoading = true;
- var param = {};
- if (this.exportParam.dateRange != null) {
- param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
- }
- if (this.exportParam.projectId != null) {
- param.projectId = this.exportParam.projectId;
- }
- if (this.exportParam.departmentId != null) {
- param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
- }
- param.stateKey = this.stateKey
- // param.departmentId = this.user.departmentId
- this.http.post( this.port.report.export, param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- location.href = res.data;
- this.exportDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取项目列表
- getProjectList() {
- this.listLoading = true;
- this.http.post( this.port.project.list, {},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.projectList = res.data;
-
- // console.log("项目列表",this.projectList);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取填报日报的项目下拉列表
- getFillProjectList() {
- this.http.post( this.port.project.list, {
- forReport: 1
- },res => {
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.fillProjectList = res.data;
- this.getRecentlyProject()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getBasecostItemList() {
- this.http.post('/project-basecost-setting/getReportBasecostList', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.timeBasecostList = res.data;
- }
- });
-
- },
- getAIReport(createDate) {
- this.http.post('/report/getAIReport', {},
- res => {
- if (res.code == "ok") {
- var quanbu = 0
- this.jsDay = 1
- var zhi = ''
- var slp = res.data
- for(var i in slp) {
- var sp = +slp[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- var aiReportData = res.data;
-
- this.canCancelInDialog = false
- if(aiReportData.length != 0) {
- var arr = [];
- for(var i in aiReportData) {
- arr.push({
- id: null,
- projectId: aiReportData[i].projectId,
- workingTime: aiReportData[i].workingTime,
- content: '',
- progress:100,
- state: 2,
- timeType: aiReportData[i].timeType,
- subProjectList: aiReportData[i].subProjectList,
- taskList: aiReportData[i].taskList,
- subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
- groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
- taskId: aiReportData[i].taskId,
- // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
- startTime: aiReportData[i].startTime,
- // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
- endTime: aiReportData[i].endTime,
- isOvertime: 0,
- progress:aiReportData[i].progress,
- professionProgress: aiReportData[i].professionProgressList,
- stages:aiReportData[i].stages,
- stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
- pics: null,
- multiWorktime: aiReportData[i].multiWorktime,
- worktimeList: [{}],
- degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
- wuduList: aiReportData[i].degreeList,
- taskGroups:aiReportData[i].taskGroups,
- customData: aiReportData[i].customData,//自定义的数值
- auditUserList: aiReportData[i].auditUserList,
- projectAuditorId: aiReportData[i].projectAuditorId,
- projectAuditorName: aiReportData[i].projectAuditorName,
- overtimeHours: aiReportData[i].overtimeHours,
- customText: aiReportData[i].customText,
- basecostId: aiReportData[i].basecostId,
- auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
- auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
- auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
- ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
- canEdit: true
- })
- }
- this.workForm.domains = arr;
- } else {
-
- }
- this.canEdit = true;
- this.originCanEdit = true;
- this.seleChn()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取个人某天的日报 111111
- getReport() {
- this.http.post( this.port.report.getPort, {
- date: this.workForm.createDate
- },
- res => {
- if (res.code == "ok") {
- var quanbu = 0
- this.jsDay = 1
- var zhi = ''
- var slp = res.data.report
- for(var i in slp) {
- var sp = +slp[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- var list = res.data;
- this.report = list;
- this.reportTimeType = this.report.timeType;
- //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
- this.isWeekend = !this.report.isWorkDay;
-
- this.canCancelInDialog = false;
- this.hasWrittenReport = list.report.length != 0;
- if(list.report.length != 0) {
- var arr = [];
- this.canEdit = false;
- let candelete = true
- for(var i in list.report) {
- var flg = null
- list.report[i].isOvertime == 1 ? flg = true : flg = false
- arr.push({
- id: list.report[i].id,
- projectId: list.report[i].projectId,
- workingTime: list.report[i].workingTime,
- content: list.report[i].content,
- state: list.report[i].state,
- timeType: list.report[i].timeType,
- subProjectList: list.report[i].subProjectList,
- taskList: list.report[i].taskList,
- subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
- groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
- taskId: list.report[i].taskId,
- // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
- startTime: list.report[i].startTime,
- // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
- endTime: list.report[i].endTime,
- isOvertime: flg,
- progress:list.report[i].progress,
- professionProgress: list.report[i].professionProgressList,
- stages:list.report[i].stages,
- stage:list.report[i].stage == '-'?null:list.report[i].stage,
- pics: list.report[i].pics,
- multiWorktime: list.report[i].multiWorktime,
- worktimeList: list.report[i].worktimeList,
- degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
- wuduList: list.report[i].degreeList,
- taskGroups:list.report[i].taskGroups,
- customData: list.report[i].customData,//自定义的数值
- auditUserList: list.report[i].auditUserList,
- projectAuditorId: list.report[i].projectAuditorId,
- projectAuditorName: list.report[i].projectAuditorName,
- overtimeHours: list.report[i].overtimeHours,
- customText: list.report[i].customText,
- basecostId: list.report[i].basecostId,
- auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
- auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
- auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
- ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
- canEdit: list.report[i].state >= 2 ? true : false
- })
- if (list.report[i].state >= 2) {
- this.canEdit = true;
- }
- if(list.report[i].state < 2){
- candelete = false
- }
- if (list.report[i].state == 0){
- this.canCancelInDialog = true
- }
- // 加判断
- if(this.user.timeType.choseFromAlbum == 1) {
- let arrList = []
- for(var k in list.report[i].pics) {
- let obj = {
- name: k,
- url: list.report[i].pics[k]
- }
- arrList.push(obj)
- }
- arr[i].imgListUrl = arrList
- arr[i].imgList = list.report[i].pics
- }
- }
- this.reportCanDelete = candelete
- this.workForm = {
- createDate: this.workForm.createDate,
- domains: arr,
- userNames:null,
- userId:null,
- time: list.time
- }
- console.log('workForm', this.workForm)
- } else {
- this.workForm = {
- createDate: this.workForm.createDate,
- domains: [{
- id: null,
- projectId: "",
- workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- auditorFirst: '',
- auditorSec: '',
- auditorThird: '',
- ccUserid: ''
-
- }],
- userId:null,
- userNames:null,
- time: this.report.time
- }
- if(this.isWeekend && this.user.timeType.lockWorktime != 1){
- this.$set(this.workForm.domains[0],'isOvertime',true)
- if(this.reportTimeType.type != 2){
- this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
- }
- }
- if(this.user.timeType.type == 1) {
- var shuzhi = this.user.timeType.allday + ''
- // console.log('执行一次', shuzhi.indexOf('.'))
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
- }
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认给第一个,必填字段
- this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
- }
-
- this.canEdit = true;
- }
- this.originCanEdit = this.canEdit;
- this.seleChn()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- guanbi() {
- this.falsss = false
- },
- // 打开日报填写
- fillInReport(i, isBatch) {
- this.isWeekend = false
- this.reportCanDelete = false
- // console.log(this.user.timeType.type, '选择时长')
- if(i != 1) {
- this.falsss = false
- } else {
- this.falsss = true
- }
- if (this.isSubstitude) {
- this.getSubstitudeUserDeptList();
- }
- if(i == -1 || this.isSubstitude) {
- this.isDisable = false;
- } else {
- this.isDisable = true;
- }
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.isBatch = isBatch;
- if (this.isBatch == 0 && !this.isSubstitude) {
- this.workForm.createDate = this.date + day; // 获取个人某天的日报
- let weekday = new Date(this.workForm.createDate).getDay()
- if(this.user.companyId == 817){
- if(weekday == 0){
- this.isWeekend = true
- }
- }else{
- if(weekday == 0 || weekday == 6){
- this.isWeekend = true
- }
- }
- this.getReport(i);
- } else {
- // console.log('执行到了这里')
- this.jsTime = 0
- this.jsDay = 0
- this.workForm = {
- createDate: null,//批量填报没有日期
- domains: [{
- id: null,
- projectId: "",
- workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- }],
- }
- if(this.user.timeType.type == 1) {
- var shuzhi = this.user.timeType.allday + ''
- // console.log('执行二次')
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
- }
- // console.log(this.workForm)
- if (this.timeBasecostList&&this.timeBasecostList.length>0) {
- this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
- }
- this.canEdit = true;
- }
-
- this.dialogVisible = true;
-
- },
- // 按周填报里内容的填写
- tianxies(item, i, names, row) {
- if(this.user.timeType.notAllowedNoAttendance == 1){
- if(this.zhoData[i].corpTime){
- if(this.zhoData[i].corpTime.workHours == 0){
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }else{
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }
- var idd = ''
- var obj = {}
- for(var l in this.projectList) {
- if(this.projectList[l].projectName == names) idd = this.projectList[l].id
- }
- obj.projectId = idd
- this.selectProject(obj, 0)
- // console.log(this.workForm.domains[0], '打印出来的')
- this.tianxieDialogVisible = true
- this.scopess = item
- var sss = {}
-
- sss.projectId = idd;
- sss.con = item.con
- sss.progress = item.progress
- sss.time = item.time
- sss.groupId = item.groupId
- sss.stage = item.stage;
- sss.workingTime = item.workingTime
- sss.projectAuditorId = item.projectAuditorId;
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认选中第一个
- sss.basecostId = this.timeBasecostList[0].id;
- }
-
- var that = this
- setTimeout(() =>{
- var isFirstEdit = false;
- if(Object.keys(item).length < 5) {
- //首次点开当前的这个cell,初始化数据
- isFirstEdit = true;
- sss.subProjectId = that.workForm.domains[0].subProjectId
- sss.stage = that.workForm.domains[0].stage
- sss.subProjectList = that.workForm.domains[0].subProjectList
- sss.stages = that.workForm.domains[0].stages
- sss.taskGroups = that.workForm.domains[0].taskGroups;
- sss.auditUserList = obj.auditUserList;
- } else {
- sss.subProjectId = item.subProjectId
- sss.stage = item.stage
- sss.subProjectList = item.subProjectList
- sss.stages = item.stages
- sss.taskGroups = item.taskGroups;
- sss.auditUserList = obj.auditUserList;
- sss.degreeId = item.degreeId;
- sss.customData = item.customData;
- }
- if (sss.auditUserList != null && sss.auditUserList.length==1) {
- //只有一个审核人,自动设置上去
- sss.projectAuditorId = sss.auditUserList[0].auditorId;
- }
- sss.wuduList = row[0].wuduList
- // console.log(sss, '数据')
- that.zhoBaoIdx = i
- that.zhoBaoName = names
- that.zhoBao = sss
- that.zhis = row
- if (sss.groupId) {
- //最后一个参数表示是否保留stage的值,不要重置为空
- this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
- }
- that.$forceUpdate();
- },600);
- },
- // 按周填报里内容的填写点击确定
- btnTianxiaes() {
- //检查子项目是否必填
- if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
- this.$message({
- message: '子项目必填,请检查',
- type: "error"
- });
- return;
- }
- if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
- this.$message({
- message: this.$t('message.Pleaseselectareviewer'),
- type: "error"
- });
- return
- }
- if(this.user.timeType.reportAuditType == 3){
- let auditTips = ''
- if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
- // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
- // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
- if(auditTips){
- auditTips = auditTips.substring(0,auditTips.length - 1)
- this.$message({
- message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
- type: 'error'
- })
- return
- }
- }
- let errtips = ''
- if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
- errtips += this.user.timeType.customDegreeName + '、'
- }
- if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
- errtips += this.user.timeType.customDataName + '、'
- }
- if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
- errtips += this.user.timeType.customTextName + '、'
- }
- if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
- errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
- }
- if(errtips){
- errtips = errtips.substring(0,errtips.length - 1)
- this.$message({
- message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
- type: 'error'
- })
- return
- }
- this.tianxieDialogVisible = false
- var zhong = this.zhoData
- zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
- this.zhoData = zhong
- if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
- if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
- if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
- },
- // 获取本周
- getCurrentWeek() {
- const currentDate = new Date()
- const week = currentDate.getDay()
- const millisecond = 1000 * 60 * 60 * 24
- const minusDay = week != 0 ? week - 1 : 4
- const monday = new Date(currentDate.getTime() - minusDay * millisecond)
- var stat = this.dealdate(monday)
- var end
- if(this.user.timeType.fillAhead == 1){
- const endDay = week == 0 || week == 6 ? 0 : 5 - week
- const endDate = new Date(currentDate.getTime() + endDay * millisecond)
- end = this.dealdate(endDate)
- }else{
- end = this.dealdate(currentDate)
- }
-
- this.zhoRqi = [stat, end]
- // console.log('date',currentDate,this.zhoRqi);
- this.zhoRqis()
- // this.jiazai()
- },
- // 获取上周
- handleGetPrevWeek() {
- const Time = new Date(this.zhoRqi[0])
- let weekNum = Time.getDay()
- weekNum = weekNum == 0 ? 7 : weekNum
- let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
- let fitstDate = new Date(
- Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
- )
- let startDate = `${fitstDate.getFullYear()}-${
- fitstDate.getMonth() + 1 < 10
- ? '0' + (fitstDate.getMonth() + 1)
- : fitstDate.getMonth() + 1
- }-${
- fitstDate.getDate() < 10
- ? '0' + fitstDate.getDate()
- : fitstDate.getDate()
- }`
- let endDate = `${lastDate.getFullYear()}-${
- lastDate.getMonth() + 1 < 10
- ? '0' + (lastDate.getMonth() + 1)
- : lastDate.getMonth() + 1
- }-${
- lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
- }`
- var stat = this.dealdate(startDate)
- var ends = this.dealdate(endDate)
- var end = this.dateChange(-2, ends)
- this.zhoRqi = [stat, end]
- this.zhoRqis()
- // this.jiazai()
- },
- // 获取下周
- handleGetNextvWeek() {
- const Time = new Date(this.zhoRqi[1])
- let weekNum = Time.getDay()
- weekNum = weekNum == 0 ? 7 : weekNum
- let fitstDate = new Date(
- Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
- )
- let lastDate = new Date(
- Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
- )
- let startDate = `${fitstDate.getFullYear()}-${
- fitstDate.getMonth() + 1 < 10
- ? '0' + (fitstDate.getMonth() + 1)
- : fitstDate.getMonth() + 1
- }-${
- fitstDate.getDate() < 10
- ? '0' + fitstDate.getDate()
- : fitstDate.getDate()
- }`
- let endDate = `${lastDate.getFullYear()}-${
- lastDate.getMonth() + 1 < 10
- ? '0' + (lastDate.getMonth() + 1)
- : lastDate.getMonth() + 1
- }-${
- lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
- }`
- var stat = this.dealdate(startDate)
- var ends = this.dealdate(endDate)
- var end = this.dateChange(-2, ends)
- this.zhoRqi = [stat, end]
- this.zhoRqis()
- },
- // 新增日期
- newDates() {
- const millisecond = 1000 * 60 * 60 * 24
- let edate = new Date(this.zhoRqi[1])
- let nowdate = new Date()
- let nowdate2
- if(this.user.timeType.fillAhead == 1){
- let week = nowdate.getDay()
- const endDay = week > 5 ? 0 : 5 - week
- const endDate = new Date(nowdate.getTime() + endDay * millisecond)
- nowdate2 = this.dealdate(endDate)
- }else{
- nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
- }
- if(edate >= nowdate2){
- return
- }
- this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
-
- var obj = {}
- obj.zhoDataTime = this.zhoRqi[1]
- obj.he = 0
- for(var j in this.projectList) {
- var xinzhi = this.projectList[j].projectName
- obj[xinzhi] = {}
- obj[xinzhi].time = ''
- obj[xinzhi].con = ''
- obj[xinzhi].progress = 0
- obj[xinzhi].workingTime = 0
- }
- this.zhoData.push(obj)
- if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
- this.getWeeklyCardTime();
- }
- this.getWeeklyWorkTime();
- },
- // 减去时间
- dateChange(num = 1,date = false) {
- if (!date) {
- date = new Date();//没有传入值时,默认是当前日期
- date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
- }
- date += " 00:00:00";//设置为当天凌晨12点
- date = Date.parse(new Date(date))/1000;//转换为时间戳
- date += (86400) * num;//修改后的时间戳
- var newDate = new Date(parseInt(date) * 1000);//转换为时间
- var nian = newDate.getFullYear()
- var yue = ''
- var ri = ''
- var yues = (newDate.getMonth() + 1)
- var ris = newDate.getDate()
- yues > 9 ? yue = yues : yue = '0' + yues
- ris > 9 ? ri = ris : ri = '0' + ris
- return nian +'-'+yue+'-'+ri
- },
- // 加载动画
- jiazai() {
- this.zhoLoading = true
- var that = this
- setTimeout(() =>{
- that.zhoLoading = false
- },1000);
- },
- // 转时间格式
- dealdate(date) {
- const dt = new Date(date)
- const y = dt.getFullYear()
- const m = (dt.getMonth() + 1 + '').padStart(2, '0')
- const d = (dt.getDate() + '').padStart(2, '0')
- return `${y}-${m}-${d}`
- },
- // 按周填报
- fillInReportss() {
- window.addEventListener('scroll', this.handleScroll, true)
- // this.jiazai()
- this.diasZho = true
- this.getCurrentWeek()
- // 项目数量判断 <=5
- if(this.projectList.length < 5){
- this.selProjectList = this.projectList
- this.selConShow = false
- }
- if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
- //重新获取工时预警类型的预算项
- this.http.post('/project-basecost-setting/getReportBasecostList', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.timeBasecostList = res.data;
- }
- });
- }
- },
- // 按周填报的项目筛选
- selListFun(){
- this.selProjectList = []
- if(this.selCon.length){
- for (let i = 0; i < this.selCon.length; i++) {
- this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
- }
- this.selConShow = false
- }else{
- this.$message({
- message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
- type:'error'
- })
- }
- },
- getWeeklyCardTime(){ //按周填报获取考勤信息
- let dateStr = []
- for(let i in this.zhoData){
- dateStr.push(this.zhoData[i].zhoDataTime)
- }
- this.http.post('/report/getWeeklyCardTime',{
- dateStr: JSON.stringify(dateStr)
- },res => {
- if(res.code == 'ok'){
- for(let i in res.data){
- let datei = '';
- if (this.user.timeType.showDdCardtime == 1) {
- datei = res.data[i].workDate.split('-');
- } else if (this.user.timeType.showCorpwxCardtime == 1) {
- datei = res.data[i].createDate.split('-');
- }
-
- for(let m in this.zhoData){
- let datem = new Date(this.zhoData[m].zhoDataTime)
-
- if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
- let item = {
- startTime: res.data[i].startTime,
- endTime: res.data[i].endTime,
- workHours: res.data[i].workHours
- }
- this.$set(this.zhoData[m],'corpTime',item)
- }
- }
- }
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- getWeeklyWorkTime(){ //按周填报获取已填工时
- let dateStr = []
- for(let i in this.zhoData){
- dateStr.push(this.zhoData[i].zhoDataTime)
- }
- this.http.post('/report/getWeeklyWorkTime',{
- dateStr: JSON.stringify(dateStr)
- },res => {
- if(res.code == 'ok'){
- for(let n in this.zhoData){
- delete this.zhoData[n].filledTime
- }
- for(let i in res.data){
- let datei = res.data[i].createDate.split('-');
- for(let m in this.zhoData){
- let datem = new Date(this.zhoData[m].zhoDataTime)
- if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
- this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
- let reportTimes = [];
- if (res.data[i].startTime != null) {
- reportTimes = res.data[i].startTime.split(',')
- }
-
- this.$set(this.zhoData[m],'reportTimes',reportTimes)
- }
- }
- }
- // console.log('zhodata',this.zhoData);
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- selListqx(){
- this.diasZho = false
- this.selProjectList = []
- this.selCon = []
- },
- handleScroll() {
- this.changdu = this.projectList.length + 1
- },
- // 自动选择时间点的事件
- zhoTimes(item, i, ims, event) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
- let selectionTime = this.getHour(zhi[i].time[0], zhi[i].time[1])
- let subtractedData = 0
- // he += +this.getHour(zhi[i].time[0], zhi[i].time[1])
- // 计算需要减去的时间
- let arr = JSON.parse(JSON.stringify(this.vacationTime))
- arr.unshift({s: zhi[i].time[0], e: zhi[i].time[1]})
- console.log(arr, '要看的数据')
- for(var j in arr) {
- subtractedData += +this.timeOverlap(j, arr)
- }
-
- he = +selectionTime - +subtractedData
- console.log(selectionTime ,subtractedData)
- }
- }
- zhi.he = he + 'h'
- }
- console.log(zhi.he, '看看结果')
- },
- // 判断两个时间段是否重叠
- timeOverlap(idx, dateAr) {
- let zhi = 0
- for (let k in dateAr) {
- if (idx !== k) {
- 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))) {
- // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
- zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
- }
- // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
- zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
- } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
- } else {
- // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
- if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
- }
- // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
- if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
- zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
- }
- }
- }
- }
- }
- return zhi
- },
- // 计算时间
- getHourMinutes(str, end) {
- var he = 0
- var date2 = '2021/12/12 ' + end +':00'
- var date1 = '2021/12/12 ' + str +':00'
- var date3 = new Date(date2).getTime() - new Date(date1).getTime();
- var leave1=date3%(24*3600*1000)
- var hours=Math.floor(leave1/(3600*1000))
- var leave2=leave1%(3600*1000)
- var minutes=Math.floor(leave2/(60*1000))
- var shi = hours+'.'+ minutes
- return he += +shi
- },
- // 自动选择事件长度的事件
- zhoXuan(item, i) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
- he += +zhi[i].workingTime
- }
- }
- zhi.he = he + 'h'
- }
- },
- // 获取全部人员
- getUsers() {
- this.http.post('/user/getSimpleActiveUserList', {},
- res => {
- if (res.code == "ok") {
- this.usersList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 按时间比例
- addBli(item, i) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
- he += +zhi[i].workingTime
- }
- }
- zhi.he = he.toFixed(1) + 'h'
- }
- },
- zhoRqis() {
- let nowdate = new Date()
- let nowdate2
- if(this.user.timeType.fillAhead == 1){
- const millisecond = 1000 * 60 * 60 * 24
- let week = nowdate.getDay()
- const endDay = week == 0 || week == 6 ? 0 : 5 - week
- const endDate = new Date(nowdate.getTime() + endDay * millisecond)
- nowdate2 = this.dealdate(endDate)
- }else{
- nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
- }
- let edate = new Date(this.zhoRqi[1])
- if(edate >= nowdate2){
- let emon = nowdate2.getMonth() + 1
- let eday = nowdate2.getDate()
- let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
- this.zhoRqi[1] = edate2
- }
- this.zhoData = []
- if(this.zhoRqi) {
- var stime = this.zhoRqi[0]
- var etime = this.zhoRqi[1]
- var zhi = this.getdiffdate(stime, etime)
- var arrst = []
- for(var i in zhi) {
- var obj = {}
- obj.zhoDataTime = zhi[i]
- obj.he = 0
- for(var j in this.projectList) {
- var xinzhi = this.projectList[j].projectName
- obj[xinzhi] = {}
- obj[xinzhi].time = ''
- obj[xinzhi].con = ''
- obj[xinzhi].progress = 0
- obj[xinzhi].workingTime = 0
- }
- arrst.push(obj)
- }
- this.zhoData = arrst
- }
- if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
- this.getWeeklyCardTime()
- // this.getWeeklyFilledTime()
- }
- if (this.zhoData.length) {
- this.getWeeklyWorkTime();
- }
- },
- zhoZhi(res, i) {
- var zhi = 0
- for(var i in res) {
- if(i != 'zhoDataTime' && i != 'he') {
- zhi += +res[i]
- }
- }
- res.he = zhi
- },
- zhoBtn(i) {
- // this.zhoData.split(i, 1)
- var arr = this.zhoData
- arr.splice(i, 1)
- },
- zhoAddlast(){
- this.selConShow = true
- },
- zhoAddqx(){
- this.diasZho = false
- this.selConShow = true
- this.selProjectList = []
- this.selCon = []
- },
- // 提交按周填报
- zhoAdd() {
- var zhi = this.zhoData
- var ll = 0
- if(this.reportTimeType.type == 2) {
- for(var i in zhi) {
- this.dateAr = []
- var alp = []
- var zhis = zhi[i]
- for(var j in zhis) {
- if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
- let objs = {}
- objs.s = zhis[j].time[0]
- objs.e = zhis[j].time[1]
- alp.push(objs)
- }
- }
- if(zhis.reportTimes){
- for(let k in zhis.reportTimes){
- let objs = {}
- objs.s = zhis.reportTimes[k].split('-')[0]
- objs.e = zhis.reportTimes[k].split('-')[1]
- alp.push(objs)
- }
- }
-
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- ll += 1
- if(!trus) {
- this.$message({
- message: this.$t('message.Filledtimeperiodsoverlap'),
- type: 'error'
- })
- return false
- }
- }
-
- }
- if(ll == 0) {
- this.$message({
- message: this.$t('message.Pleasefillinthetime'),
- type: 'error'
- })
- return false
- }
- } else if(this.reportTimeType.type == 1){
- for(var i in zhi) {
- var zhis = zhi[i]
- for(var j in zhis) {
- if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
- ll += 1
- }
- }
- }
- if(ll == 0) {
- this.$message({
- message: this.$t('message.Pleaseselectatime'),
- type: 'error'
- })
- return false
- }
- let overcorp = ''
- for(let n in zhi){
- if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
- overcorp += zhi[n].zhoDataTime + ','
- }
-
- }
- if(overcorp != ''){
- overcorp = overcorp.substring(0,overcorp.length - 1)
- this.$message({
- message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
- type: 'error'
- })
- return
- }
- }
- var submits = []
- let formData = new FormData();
- if(this.reportTimeType.multiWorktime == 1){
- for (var i in this.zhoData) {
- var zhoD = this.zhoData[i]
- var flgs = false
- for(var j in zhoD) {
- if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- for(var s in this.projectList) {
- if(j == this.projectList[s].projectName) {
- formData.append("projectId", this.projectList[s].id);
- }
- }
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- if(this.user.timeType.auditLevel > 0){
- audItem.auditorFirst = zhoD[j].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- audItem.auditorSec = zhoD[j].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- audItem.auditorThird = zhoD[j].auditorThird
- }
- if(zhoD[j].ccUserid){
- audItem.ccUserid = zhoD[j].ccUserid
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
- formData.append("taskId", 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- formData.append("endTime", '');
- formData.append("startTime", '');
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- var lix = []
- var objjs = {}
- objjs.startTime = zhoD[j].time[0]
- objjs.endTime = zhoD[j].time[1]
- if (zhoD[j].con == null || zhoD[j].con == '') {
- zhoD[j].con == '-'
- }
- objjs.content = zhoD[j].con
- lix.push(objjs)
- var zhiZhi = JSON.stringify(lix)
- zhiZhi = zhiZhi.replace(/,/g,"@");
- formData.append("content", zhiZhi)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- if (zhoD[j].groupId) {
- formData.append("groupId",zhoD[j].groupId)
- } else {
- //解决后台groupId数组越界的问题
- formData.append("groupId",0)
- }
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
- formData.append('degreeId',zhoD[j].degreeId)
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- }
- }
- }
- } else {
- for (var i in this.zhoData) {
- var zhoD = this.zhoData[i]
- var flgs = false
- if(this.reportTimeType.type == 2) {
- for(var j in zhoD) {
- if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- for(var s in this.projectList) {
- if(j == this.projectList[s].projectName) {
- formData.append("projectId", this.projectList[s].id);
- }
- }
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- if(this.user.timeType.auditLevel > 0){
- audItem.auditorFirst = zhoD[j].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- audItem.auditorSec = zhoD[j].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- audItem.auditorThird = zhoD[j].auditorThird
- }
- if(zhoD[j].ccUserid){
- audItem.ccUserid = zhoD[j].ccUserid
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
- formData.append("taskId", 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- formData.append("endTime", zhoD[j].time[1]);
- formData.append("startTime", zhoD[j].time[0]);
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- if (zhoD[j].groupId) {
- formData.append("groupId",zhoD[j].groupId)
- } else {
- //解决后台groupId数组越界的问题
- formData.append("groupId",0)
- }
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
- formData.append('degreeId',zhoD[j].degreeId)
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- }
- }
- } else {
- for(var j in zhoD) {
- 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') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- for(var s in this.projectList) {
- if(j == this.projectList[s].projectName) {
- formData.append("projectId", this.projectList[s].id);
- }
- }
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- if(this.user.timeType.auditLevel > 0){
- audItem.auditorFirst = zhoD[j].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- audItem.auditorSec = zhoD[j].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- audItem.auditorThird = zhoD[j].auditorThird
- }
- if(zhoD[j].ccUserid){
- audItem.ccUserid = zhoD[j].ccUserid
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
- // formData.append("subProjectId", zhoD[j].subProjectId);
- formData.append("taskId", 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- if(this.reportTimeType.type == 1) {
- formData.append("workingTime", zhoD[j].workingTime);
- } else if(this.reportTimeType.type == 2) {
- formData.append("endTime", zhoD[j].time[1]);
- formData.append("startTime", zhoD[j].time[0]);
- } else if(this.reportTimeType.type == 3) {
- formData.append("progress", zhoD[j].progress);
- formData.append("workingTime", zhoD[j].workingTime);
- }
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- if (zhoD[j].groupId) {
- formData.append("groupId",zhoD[j].groupId)
- } else {
- //解决后台groupId数组越界的问题
- formData.append("groupId",0)
- }
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
- formData.append('degreeId',zhoD[j].degreeId)
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- }
- }
- }
- }
- }
-
- // 自定义维度
- this.submitingReport = true;
- this.http.uploadFile( this.port.report.editPort, formData,
- res => {
- // this.listLoading = false;
- this.submitingReport = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.fillinsuccessfully'),
- type: "success"
- });
- this.diasZho = false
- this.selConShow = true
- this.zhoData = []
- this.zhoRqi = ''
- this.getReportList();
- this.getDepartment();
- // 关闭弹窗 并 清空
- this.selProjectList = []
- this.selCon = []
- this.getRecentlyProject()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.submitingReport = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- ChangeHourMinutestr (str) {
- if (str !== "0" && str !== "" && str !== null) {
- return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
- (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
- } else {
- return "";
- }
- },
- // 得到两个日期中间的日期
- getdiffdate(stime,etime){
- //初始化日期列表,数组
- var diffdate = new Array();
- var i=0;
- //开始日期小于等于结束日期,并循环
- while(stime<=etime){
- diffdate[i] = stime;
-
- //获取开始日期时间戳
- var stime_ts = new Date(stime).getTime();
-
- //增加一天时间戳后的日期
- var next_date = stime_ts + (24*60*60*1000);
-
- //拼接年月日,这里的月份会返回(0-11),所以要+1
- var next_dates_y = new Date(next_date).getFullYear()+'-';
- var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
- var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
-
- stime = next_dates_y+next_dates_m+next_dates_d;
-
- //增加数组key
- i++;
- }
- return diffdate;
- },
- // 添加模块
- addDomain(i) {
- var leftProgress = 10;
- if (this.reportTimeType.type == 3) {
- //计算已经待分配工时比例
- let array = this.workForm.domains;
- let totalProgress = 0;
- for (var i=0;i<array.length; i++) {
- totalProgress += array[i].progress;
- }
- if (totalProgress < 100) {
- leftProgress = 100 - totalProgress;
- }
- }
- var addItem = {
- projectId: "",
- workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
- this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
- ),
- content: "",
- progress:leftProgress,
- state:2,//2-表示待提交
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- canEdit: true,
- auditorFirst: '',
- auditorSec: '',
- auditorThird: '',
- ccUserid: ''
- // degreeId: '',
- };
- if(this.isWeekend && this.user.timeType.lockWorktime != 1){
- this.$set(addItem,'isOvertime',true)
- if(this.reportTimeType.type == 3){
- this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
- }
- }
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认给第一个,必填字段
- addItem.basecostId = this.timeBasecostList[0].id;
- }
- this.workForm.domains.push(addItem);
- document.getElementById('workFormsItemBottom').scrollIntoView()
- this.canEdit = true
- if (this.reportTimeType.type == 0) {
- //全天上下午模式下,检测时间段数量,达到2个,不能再加了
- var length = this.workForm.domains.length;
- if (length == 2) {
- this.showAddMore = false;
- }
- }
- this.chuji()
-
- this.seleChn()
- },
- // 移除模块
- delDomain(i) {
- this.workForm.domains.splice(i,1)
- //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
- if (!this.originCanEdit) {
- let iscan = false
- for(let i in this.workForm.domains){
- if(this.workForm.domains[i].canEdit){
- iscan = true
- }
- }
- this.canEdit = iscan
- }
-
- //检测当前剩下的一个,时间类型是否是全天
- if (this.reportTimeType.type == 0) {
- if (this.workForm.domains[0].timeType == 0) {
- this.showAddMore = false;
- } else {
- this.showAddMore = true;
- }
- }
-
- if(this.user.timeType.multiWorktime == 1) {
- this.iptChangs()
- } else {
- this.seleChn(0)
- }
- },
- // 改变月份
- changeMonth() {
- this.isWeekend = false
- let date = new Date()
- let nowmon = date.getMonth() + 1
- let nowday = date.getDate()
- let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
- if (this.isBatch == 0) {
- if(this.user.timeType.fillAhead == 0){
- let date_a = new Date(this.workForm.createDate)
- if(date_a.getTime() > date.getTime()){
- this.workForm.createDate = nowdate
- }
- }
- //只有按天填报才能获取当天的日报
- if(!this.isSubstitude){
- let weekday = new Date(this.workForm.createDate).getDay()
- if(this.user.companyId == 817){
- if(weekday == 0){
- this.isWeekend = true
- }
- }else{
- if(weekday == 0 || weekday == 6){
- this.isWeekend = true
- }
- }
- this.getReport()
- }
- }else {
- if(this.user.timeType.fillAhead == 0){
- let date_a = new Date(this.workForm.createDate[1])
- if(date_a.getTime() > date.getTime()){
- this.workForm.createDate[1] = nowdate
- let sdate = new Date(this.workForm.createDate[0])
- let edate = new Date(this.workForm.createDate[1])
- if(sdate > edate){
- this.workForm.createDate[0] = this.workForm.createDate[1]
- }
- }
- }
- }
- },
- // 判断时间段
- fns() {
- for (let k in this.dateAr) {
- if (!this.judege(k)) {
- return false
- }
- }
- return true
- },
- judege(idx){
- for (let k in this.dateAr) {
- if (idx !== k) {
- if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
- return false
- }
- if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
- return false
- }
- }
- }
- return true
- },
- // 保存日报111111
- submitReport(isDraft) {
- this.isDraft = isDraft;
- this.$refs.workForm.validate(valid => {
- if (valid) {
- if(this.totalReportHours < this.user.timeType.allday){
- this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.submitReportSon()
- }).catch(() => {
- });
- }else{
- this.submitReportSon()
- }
- }
- });
- },
- submitReportSon() {
- this.dateAr = []
- let alp = []
- if(this.user.timeType.multiWorktime != 1) {
- for(var p in this.workForm.domains) {
- if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
- let objs = {}
- objs.s = this.workForm.domains[p].startTime
- objs.e = this.workForm.domains[p].endTime
- alp.push(objs)
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- if(!trus) {
- this.$message({
- message: this.$t('message.Filledtimeperiodsoverlap'),
- type: "error"
- });
- return
- }
- }
- } else {
- for(var p in this.workForm.domains) {
- var slll = this.workForm.domains[p]
- for(var o in slll.worktimeList) {
- if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
- let objs = {}
- objs.s = slll.worktimeList[o].startTime
- objs.e = slll.worktimeList[o].endTime
- alp.push(objs)
- }
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- if(!trus) {
- this.$message({
- message: this.$t('message.Filledtimeperiodsoverlap'),
- type: "error"
- });
- return
- }
- }
- }
- //检查子项目
- if (this.user.timeType.subProMustFill == 1) {
- for(var p in this.workForm.domains) {
- var oneProItem = this.workForm.domains[p]
- if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
- //没有选择子项目
- this.$message({
- message: '子项目必填,请检查',
- type: "error"
- });
- return
- }
- }
- }
- // return
- //代填的情况,检查人员是否已经选择
- if (this.isSubstitude) {
- if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
- this.$message({
- message: this.$t('message.pleaseselectthepersontofillin'),
- type: "error"
- });
- return;
- }
- }
- //检查时间,全天和上下午不能同时存在
- if (this.reportTimeType.type == 0) {
- var alldayNum = 0;
- var amNum = 0;
- var pmNum = 0;
- for(var i in this.workForm.domains) {
- if (this.workForm.domains[i].timeType == 0) {
- alldayNum ++;
- } else if (this.workForm.domains[i].timeType == 1) {
- amNum++;
- } else if (this.workForm.domains[i].timeType == 2) {
- pmNum++;
- }
- }
- if (alldayNum > 1) {
- this.$message({
- // message: "工作时间-全天,只能选择一次",
- message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
- type: "error"
- });
- return;
- }
- if (amNum > 1) {
- this.$message({
- message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
- type: "error"
- });
- return;
- }
- if (pmNum > 1) {
- this.$message({
- message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
- type: "error"
- });
- return;
- }
- if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
- this.$message({
- message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
- type: "error"
- });
- return;
- }
- } else if (this.reportTimeType.type == 3) {
- //总百分比不能超过100%
- let total = 0;
- this.workForm.domains.forEach(w=>{total += w.progress});
- if (total > 100) {
- this.$message({
- message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
- type: "error"
- });
- return;
- } else if (total < 100) {
- this.$message({
- message: this.$t('message.cannotbesubmitted'),
- type: "error"
- });
- return;
- }
- }
-
- this.listLoading = true;
- let formData = new FormData();
- formData.append("draft", this.isDraft);
- var totalTime = 0;
- for (var t=0;t<this.workForm.domains.length; t++) {
- totalTime += parseFloat(this.workForm.domains[t].workingTime);
- }
- //批量填报不校验考勤时长,交给后台校验
- if (!this.isBatch) {
- if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
- if (this.workForm.time){
- if (this.workForm.time.workHours == 0){
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }else{
- this.$message({
- message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
- type: 'error'
- })
- return
- }
- }
- }
-
- if (this.reportTimeType.type == 1 && this.workForm.time) {
- if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
- this.$message({
- message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
- type: "error"
- });
- return;
- }
- }
- for(var i in this.workForm.domains) {
- if(this.user.timeType.reportAuditType == 3){
- let audItem = {}
- let auditRule = ''
- if(this.workForm.domains[i].id){
- audItem.reportId = this.workForm.domains[i].id
- }
- if(this.user.timeType.auditLevel > 0){
- if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
- audItem.auditorFirst = this.workForm.domains[i].auditorFirst
- }
- if(this.user.timeType.auditLevel > 1){
- // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
- audItem.auditorSec = this.workForm.domains[i].auditorSec
- }
- if(this.user.timeType.auditLevel > 2){
- // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
- audItem.auditorThird = this.workForm.domains[i].auditorThird
- }
- if(this.workForm.domains[i].ccUserid){
- audItem.ccUserid = this.workForm.domains[i].ccUserid
- }
- if(auditRule){
- auditRule = auditRule.substring(0,auditRule.length - 1)
- this.$message({
- message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
- type: 'error'
- })
- return
- }
- formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
- }
-
- if(this.workForm.domains[i].degreeId) {
- // var sss = this.workForm.domains[i].degreeId.toString()
- formData.append("degreeId", this.workForm.domains[i].degreeId);
- } else {
- formData.append("degreeId", -1);
- }
- if(this.workForm.domains[i].customData) {
- // var sss = this.workForm.domains[i].degreeId.toString()
- formData.append("customData", this.workForm.domains[i].customData);
- } else {
- formData.append("customData", 0);
- }
- if(this.workForm.domains[i].customText) {
- formData.append("customText", this.workForm.domains[i].customText);
- } else {
- formData.append("customText", '-');
- }
- if (this.workForm.domains[i].id) {
- formData.append("id", this.workForm.domains[i].id);
- } else {
- formData.append("id", -1);
- }
- formData.append("projectId", this.workForm.domains[i].projectId);
- if (this.workForm.domains[i].subProjectId) {
- formData.append("subProjectId", this.workForm.domains[i].subProjectId);
- } else {
- formData.append("subProjectId", 0);
- }
- if (this.workForm.domains[i].groupId) {
- formData.append("groupId", this.workForm.domains[i].groupId);
- } else {
- formData.append("groupId", 0);
- }
- if (this.workForm.domains[i].taskId) {
- formData.append("taskId", this.workForm.domains[i].taskId);
- } else {
- formData.append("taskId", 0);
- }
- if (this.workForm.domains[i].taskFinish == true) {
- formData.append("taskFinish", 1);
- } else {
- formData.append("taskFinish", 0);
- }
-
- formData.append("reportTimeType", this.reportTimeType.type);
- if (this.reportTimeType.type == 0) {
- formData.append("timeType", this.workForm.domains[i].timeType);
- var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
- formData.append("workingTime", workingTime);
- } else if (this.reportTimeType.type == 1){
- formData.append("workingTime", this.workForm.domains[i].workingTime);
- } else if (this.reportTimeType.type == 2) {
- formData.append("endTime", this.workForm.domains[i].endTime);
- formData.append("startTime", this.workForm.domains[i].startTime);
- } else if (this.reportTimeType.type == 3) {
- //按比例分配
- formData.append("progress", this.workForm.domains[i].progress);
- formData.append("workingTime", this.workForm.domains[i].workingTime);
- }
- if(this.user.timeType.choseFromAlbum == 1 ) {
- console.log(this.workForm.domains[i].imgList)
- if(this.workForm.domains[i].imgList) {
- let imgListFor = this.workForm.domains[i].imgList
- for(var b in imgListFor) {
- imgListFor[b] = imgListFor[b].replace('/upload/', '')
- }
- console.log(imgListFor)
- let m = JSON.stringify(imgListFor);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("picStr", m);
- } else {
- formData.append("picStr", '[]');
- }
- }
-
-
- //处理多个时间事项
- formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
- if (this.reportTimeType.multiWorktime == 1) {
- //检查时间是否有重叠
- var workList = this.workForm.domains[i].worktimeList;
- for (var j=0;j<workList.length; j++) {
- var curItem = workList[j];
- //检查开始时间是否大于结束时间
- if (curItem.startTime >= curItem.endTime) {
- this.$message({
- message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
- this.$t('message.Endtimemustbegreaterthanstarttime'),
- type: "error"
- });
- return;
- }
- for (var p = j+1;p<workList.length; p++) {
- var jItem = workList[p];
- if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
- || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
- this.$message({
- message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
- jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
- type: "error"
- });
- return;
- }
- }
- }
- let m = JSON.stringify(this.workForm.domains[i].worktimeList);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("content", m);
- } else {
- if (this.workForm.domains[i].content) {
- let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
- m = m.replace(/,/g,",");
- console.log(m, '需要传值的数据')
- // formData.append("content", this.workForm.domains[i].content);
- formData.append("content", m);
- } else {
- formData.append("content", '-');
- }
- }
-
- if (this.isBatch == 0) {
- formData.append("createDate", this.workForm.createDate);
- } else {
- //批量填报,时间范围
- formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
- }
-
- if(this.workForm.domains[i].isOvertime) {
- formData.append("isOvertime", 1);
- } else {
- formData.append("isOvertime", 0);
- }
- if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
- formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
- } else {
- formData.append("overtimeHours", 0);
- }
- if(this.workForm.domains[i].basecostId) {
- formData.append("basecostId", this.workForm.domains[i].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if (this.workForm.userId != null) {
- var targetUids = '';
- this.workForm.userId.forEach(u=>{
- targetUids += u + '@';
- });
- if (targetUids.length > 0) {
- targetUids = targetUids.substring(0, targetUids.length -1);
- formData.append("targetUids", targetUids);
- }
- }
- //项目专业进度
- if (this.workForm.domains[i].professionProgress) {
- var m = JSON.stringify(this.workForm.domains[i].professionProgress);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("professionProgress", m);
- } else {
- formData.append("professionProgress", "[]");
- }
- if (this.workForm.domains[i].stage) {
- formData.append("stage", this.workForm.domains[i].stage);
- } else {
- formData.append("stage", "-");
- }
- // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
- if (this.workForm.domains[i].projectAuditorId) {
- formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
- } else {
- // console.log('执行到了这里')
- // console.log(this.user.timeType.reportAuditType)
- if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
- this.$message({
- message: this.$t('message.Pleasespecifyaprojectreviewer'),
- type: "error"
- });
- return;
- } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
- //分组负责人先审核, 确定是选择了任务分组
- if (this.workForm.domains[i].taskGroups.length == 0) {
- this.$message({
- message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
- type: "error"
- });
- } else if (!this.workForm.domains[i].groupId) {
- // console.log(this.workForm.domains[i]);
- this.$message({
- message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
- type: "error"
- });
- } else {
- this.$message({
- message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
- type: "error"
- });
- }
- return;
- }
-
- }
- }
- this.submitingReport = true;
- this.http.uploadFile( this.port.report.editPort, formData,
- res => {
- this.listLoading = false;
- this.submitingReport = false;
- if (res.code == "ok") {
- if(res.msg!=null){
- this.$message({
- message: res.msg,
- type: "success"
- });
- }else{
- this.$message({
- message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
- type: "success"
- });
- }
- this.dialogVisible = false;
- this.jsDay = 0
- this.jsTime = 0
- this.getReportList();
- this.getDepartment();
- this.getRecentlyProject()
- } else {
- this.$message({
- message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.submitingReport = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 判断是展示那个工时导入
- imports() {
- if(this.user.timeType.syncCorpwxTime == 0) {
- this.importDialog = true
- } else {
- this.importWxDialog = true
- }
- },
- // 跳转
- junpToDeskTop(id) {
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.$router.push("/desktop/" + id + "/" + this.date +day);
- },
- // 通过日报
- approve(id, item) {
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.approveinData = {
- id: id,
- date: this.date +day,
- reportIds: item.id
- }
- if(this.user.timeType.needEvaluate == 1){
- this.$set(this.approveinData,'evaluate','')
- this.approveinDialog = true
- }else{
- this.logining = true;
- this.approveinfun()
- }
-
- },
- approveinfun(){
- this.http.post( this.port.report.approve, this.approveinData,
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.approveinDialog = false
- this.$message({
- message: this.$t('message.Reviewsucceeded'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //撤回日报
- cancel(item,e) {
- // console.log('can can need',item);
- this.logining = true;
-
- var ids = '';
- var data = e ? item : item.data;
- data.forEach(element => {
- if(element.id){
- ids +=(element.id+',');
- }
- });
- this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message:this.$t('message.Withdrawalsucceeded'),
- type: "success"
- });
- this.getReportList();
- if(e){this.getReport()}
- this.getDepartment();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- showDenyDialog(id,i, item) {
- this.denyReasonDialog = true;
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var ids = item.id;
- // var data = item.data;
- // data.forEach(element => {
- // ids +=(element.id+',');
- // });
- this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
- },
- // 未通过日报
- deny() {
- this.logining = true;
-
- this.http.post( this.port.report.deny, this.denyForm,
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.denyReasonDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 查看工时记录弹窗
- toView() {
- this.toViewDialogVisible = true
- this.toViewloading = true
- this.getToView()
- },
- getToView() {
- this.http.post( '/report-import-log/getList', this.toViewForm,
- res => {
- this.toViewloading = false;
- if (res.code == "ok") {
- // console.log(res.data, '数据数据')
- this.toViewList = res.data.records
- this.toViewForm.total = res.data.total
- } else {
- this.toViewloading = false;
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- })
- },
- // 触发 selectCat 组件更改他的值
- selectCatCli(obj) {
- // console.log(obj, '看看')
- // obj.id 是 选中人员的id, obj.idx 是 当前的索引
- this.workForm.domains[obj.idx].projectAuditorId = obj.id
- },
- vueCasader(obj) {
- // console.log(obj, '看看值')
- if(obj.distinction == 1) {
- let arr = []
- arr.push(obj.item.id)
- this.exportParam.departmentId = arr
- }
- },
- //分页
- handleCurrentChange(val) {
- this.toViewForm.pageIndex = val;
- this.getToView();
- },
- handleSizeChange(val) {
- this.toViewForm.pageSize = val;
- this.getToView();
- },
- getAllUsersList(){
- this.http.post('/user/getSimpleActiveUserList',{
- },res => {
- if(res.code == 'ok'){
- this.allUsersList = res.data
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 自定义事件
- selectCal(obj) {
- console.log(obj, '传数据来源')
- if(obj.distinction == '1') {
- this.zhoBao.projectAuditorId = obj.id
- } else if(obj.distinction == '2') {
- this.zhoBao.auditorFirst = obj.id
- } else if(obj.distinction == '3') {
- this.zhoBao.auditorSec = obj.id
- } else if(obj.distinction == '4') {
- this.zhoBao.auditorThird = obj.id
- } else if(obj.distinction == '5') {
- this.zhoBao.ccUserid = obj.id
- } else if(obj.distinction == '12') {
- this.usersListId = obj.id
- if(obj.name != this.$t('defaultText.pleaseChoose')) {
- this.searchKeyword = obj.name
- } else {
- this.searchKeyword = ''
- }
- this.searchScreen(0)
- } else if(obj.distinction == '13') {
- this.usersListId = obj.id
- if(obj.name != this.$t('defaultText.pleaseChoose')) {
- this.searchKeyword = obj.name
- } else {
- this.searchKeyword = ''
- }
- this.searchScreen(1)
- }
- }
- },
- created() {
- this.getUsers()
- let height = window.innerHeight;
- this.tableHeight = height - 178;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 178;
- };
- this.toViewForm.companyId = this.user.companyId
- this.initDrag([{
- type: "LR",
- domClass: {
- // 中间分割线的名字
- resize: "line-line",
- // 左侧盒子的名字
- left: "box-left",
- // 右侧盒子的名字
- right: "box-right",
- // 父级的名字
- box: "box-father",
- },
- otherInfo: {
- // 限制左边栏最低宽度
- leftWidth: 120,
- },
- },
- {
- type: "LR",
- domClass: {
- // 中间分割线的名字
- resize: "line-second",
- // 左侧盒子的名字
- left: "left-laowang",
- // 右侧盒子的名字
- right: "box-second-father",
- // 父级的名字
- box: "grand",
- },
- otherInfo: {
- // 限制左边栏最低宽度
- leftWidth: 120,
- },
- },
- ]);
- }
- };
- </script>
- <style lang="scss" scoped>
- .photos {
- position: relative;
- display: flex;
- flex-wrap: wrap;
- }
- .photos_img {
- width: 120px;
- height: 120px;
- margin-right: 20px;
- margin-bottom: 20px;
- cursor: pointer;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .paginatis {
- padding: 10px 10px;
- background: #f2f2f2;
- }
- .waiting {
- color:orange;
- }
- .filledReportStyle {
- color:#32CD32;
- }
- .RejectStyle {
- color:red;
- }
- .waitSubmitStyle{
- color: #409eff;
- }
- .chooseDate {
- .waiting {
- color: #20a0ff;
- }
- .filledReportStyle {
- color:#20a0ff;
- }
- .RejectStyle {
- color: #20a0ff;
- }
- .waitSubmitStyle{
- color: #20a0ff;
- }
- }
- .allDaily {
- width:100%;
- }
- .report_title {
- padding:10px 0;
- color:#666;
- }
- .clearfix {
- overflow-x: auto;
- white-space: nowrap;
- padding: 15px 0 10px 0;
- // overflow-y: hidden;
- .date_item {
- padding: 0 3px;
- cursor: pointer;
- position: relative;
- }
- .chooseDate {
- position: absolute;
- bottom: -3px;
- width: 37px;
- height: 2px;
- left: 14px;
- background: #20a0ff;
- }
- }
- .one_daily {
- i {
- color: #9ed0ff;
- margin-right: 5px;
- }
- .one_daily_body {
- padding: 10px 0px;
- p {
- margin: 0;
- line-height: 30px;
- }
- }
- ul {
- padding: 0;
- }
- }
- .checkbtn {
- float: right;
- margin-top: -10px;
- }
- .selConStyle{
- margin-top:9rem;
- margin-bottom:11rem;
- .selConStyle_title{
- height: 3rem;
- text-align: center;
- font-size: 17px;
- }
- .el-select{
- margin: 0 15%;
- width: 70%;
- }
- }
- </style>
- <style lang="scss">
- /*去除upload组件过渡效果*/
- .photos .el-upload-list__item {
- transition: none !important;
- }
- .daily {
- .el-card__body {
- height: 80%;
- overflow-y: auto;
- }
- .el-card__header {
- padding: 0 20px;
- }
- }
- .membListClass{
- .el-dialog__body{
- padding-top: 10px;
- }
- }
- // .editReportDialog .el-dialog__footer{
- // position: sticky;
- // bottom: 0;
- // background: #fff;
- // height: 70px;
- // z-index: 1010;
- // }
- .editReportDialog{
- min-width: 800px;
- }
- .touruxiangmu{
- max-width: 1000px;
- }
- </style>
- <style scoped>
- /* 项目标签的样式 */
- .el-tag + .el-tag {
- margin-left: 10px;
- }
- .button-new-tag {
- margin-left: 10px;
- height: 32px;
- line-height: 30px;
- padding-top: 0;
- padding-bottom: 0;
- }
- .input-new-tag {
- width: 90px;
- margin-left: 10px;
- vertical-align: bottom;
- }
- .selectworktime .el-table__fixed-body-wrapper{
- top: 48px !important;
- }
- .selectworktime_export .selectworktime_export_l{
- width: 65%;
- float: left;
- height: 42px;
- }
- .approvalProcessBox{
- margin-left: 30px;
- font-size: 14px;
- line-height: 16px;
- cursor: pointer;
- }
- .approvalProcessBox i {
- margin-right: 0;
- height: 16px;
- width: 16px;
- display: inline-block;
- transform: scale(1.2);
- position: relative;
- top: 0.5px;
- color: #409eff;
- }
- .approvalProcessBox .approvalProcessClick{
- cursor: pointer;
- color: #409eff;
- font-size: 14px;
- }
- .approvalProcessBox:hover .approvalProcessClick{
- color: #3485fb;
- }
- </style>
- <style lang="scss" scoped>
- // 加班样式
- .overtime {
- display: inline-block;
- margin-left: 20px;
- input {
- display: inline-block;
- margin-top: 5px;
- }
- }
- .plus {
- display: inline-block;
- }
- // .tages {
- // float: right;
- // }
- .overtime {
- display: inline-block;
- margin-left: 30px;
- }
- .bloks {
- display: inline-block;
- width: 380px;
- }
- .zhiss {
- display: flex;
- justify-content: space-around;
- align-items: center;
- }
- .zhoFel {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- // 左右滑动样式
- .line {
- width: 30px;
- /* height: 500px; */
- background: #f2f2f2;
- cursor: w-resize;
- }
- .box-father {
- border: 8px solid #000;
- }
- .line-second {
- width: 10px;
- /* background: red; */
- }
- .flex {
- display: flex;
- width: 100%;
- }
- .box-left {
- flex: 0 0 400px;
- /* height: 600px; */
- /* background: blue; */
- }
- .box-right {
- /* height: 600px; */
- /* background: green; */
- flex: 1;
- }
- .box-postion {
- width: 200px;
- /* height: 400px; */
- background: #ccc;
- }
- .custom-tree-node {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 14px;
- padding-right: 8px;
- }
- .daitianrbao {
- width: 100%;
- box-sizing: border-box;
- height: 40px;
- border-radius: 4px;
- border: 1px solid #DCDFE6;
- overflow: hidden;
- text-overflow: ellipsis;
- display: flex;
- // align-items: center;
- }
- .daitianrbao .spnn {
- display: inline-block;
- box-sizing: border-box;
- padding: 0 15px;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .daitianrbao .hover {
- color: #DCDFE6 !important;
- }
- </style>
|