daily.vue 413 KB

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