daily.vue 370 KB

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