daily.vue 401 KB

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